Enum fhir_model::ParsedReference
source · pub enum ParsedReference<'a> {
Local {
id: &'a str,
},
Relative {
resource_type: &'a str,
id: &'a str,
version_id: Option<&'a str>,
},
Absolute {
url: &'a str,
resource_type: Option<&'a str>,
id: Option<&'a str>,
},
}Expand description
Parsed parts of a FHIR reference. Can be one of local reference, relative reference or absolute reference. The absolute reference is unchecked and can be anything, it is used as fallback.
Variants§
Local
Local reference, the resource is to be found in the contained field.
Relative
Fields
Relative reference, the resource is on the same FHIR server.
Absolute
Fields
Absolute reference, the resource can be anywhere, might not even be FHIR
server. Might not be a URL, but a URI like a urn:uuid:....
Implementations§
source§impl<'a> ParsedReference<'a>
impl<'a> ParsedReference<'a>
sourcepub fn resource_type(&self) -> Option<&'a str>
pub fn resource_type(&self) -> Option<&'a str>
Get the resource type that this reference points to as string reference.
Might not be present/visible in absolute URLs or local references. In
absolute URLs, it might also return garbage, as the URL might have
enough segments, but the segment was not an actual resource type. Take
care when parsing to ResourceType.
Trait Implementations§
source§impl<'a> Clone for ParsedReference<'a>
impl<'a> Clone for ParsedReference<'a>
source§fn clone(&self) -> ParsedReference<'a>
fn clone(&self) -> ParsedReference<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<'a> Debug for ParsedReference<'a>
impl<'a> Debug for ParsedReference<'a>
source§impl<'a> PartialEq for ParsedReference<'a>
impl<'a> PartialEq for ParsedReference<'a>
source§fn eq(&self, other: &ParsedReference<'a>) -> bool
fn eq(&self, other: &ParsedReference<'a>) -> bool
self and other values to be equal, and is used
by ==.