Skip to main content

FieldSchema

Struct FieldSchema 

Source
pub struct FieldSchema {
    pub name: &'static str,
    pub path: &'static str,
    pub kind: Kind,
    pub min: u32,
    pub max: Option<u32>,
    pub many: bool,
    pub types: &'static [&'static str],
    pub target_profiles: &'static [&'static str],
    pub content_reference: Option<&'static str>,
    pub is_summary: bool,
    pub is_modifier: bool,
}
Expand description

One element of a type, in definition order.

The cardinality, the path, the type codes and their target profiles, the content reference and the two flags are the ElementDefinition fields of the definition this element comes from (https://hl7.org/fhir/R4/elementdefinition.html).

Fields§

§name: &'static str

The element name (the JSON key; a choice’s stem).

§path: &'static str

The element path, for example Observation.value[x].

§kind: Kind

How it travels.

§min: u32

The minimum cardinality.

§max: Option<u32>

The maximum cardinality; None is *.

§many: bool

Whether it repeats.

§types: &'static [&'static str]

The type codes the definition lists, in its order; a choice lists its alternatives and a content reference lists none.

§target_profiles: &'static [&'static str]

The canonical URLs the definition’s types list in targetProfile, in its order: the resources a Reference admits and the definitions a canonical admits (https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.type.targetProfile).

§content_reference: Option<&'static str>

The element path a contentReference names, without the leading #.

§is_summary: bool

Whether the element is part of the summary view, the isSummary flag a _summary=true answer keeps (https://hl7.org/fhir/R4/search.html#summary).

§is_modifier: bool

Whether the element modifies the meaning of its parent, the isModifier flag (https://hl7.org/fhir/R4/conformance-rules.html#isModifier).

Implementations§

Source§

impl FieldSchema

Source

pub fn choices(&self) -> impl Iterator<Item = ChoiceForm> + '_

The alternatives of a choice element, in definition order; none for an element of a single type.

Source

pub fn choice_type(&self, suffix: &str) -> Option<&'static str>

The type code of the choice alternative whose JSON suffix is suffix, None when the element lists no such type.

Trait Implementations§

Source§

impl Clone for FieldSchema

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for FieldSchema

Source§

impl Debug for FieldSchema

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for FieldSchema

Source§

impl PartialEq for FieldSchema

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FieldSchema

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.