Skip to main content

struct_name

Function struct_name 

Source
pub fn struct_name(
    sd: &StructureDefinition,
    element: &ElementDefinition,
) -> String
Expand description

Returns the generated Rust struct name for a FHIR element.

For the root element, the struct name is derived from the structure definition’s id. Primitive FHIR types are prefixed with "FHIR" to distinguish them from Rust primitive types (e.g. stringFHIRString).

For nested elements, the struct name is constructed by:

  • Splitting the element id on '.'.
  • Capitalizing each path segment.
  • Concatenating the segments.
  • Removing the FHIR choice-type marker ([x]), if present.

§Panics

This function will panic if:

§Arguments

§Returns

A String containing the generated Rust struct name.