pub fn struct_name(
sd: &StructureDefinition,
element: &ElementDefinition,
) -> StringExpand 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. string → FHIRString).
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:
- The root [
StructureDefinition] does not have anid. - A non-root [
ElementDefinition] does not have anid.
§Arguments
sd- The [StructureDefinition] containing the element.element- The [ElementDefinition] for which to generate a struct name.
§Returns
A String containing the generated Rust struct name.