clinical_quality_language
clinical_quality_language copied to clipboard
Support for CQL manipulating BackboneElement types
Not sure if this is still an issue. Please just close if the issue is resolved/fixed...
In CQL, we want to be able to return BackboneElement and child element types from (at least) functions. For example:
define function "MedicationRequestResource"(medicationRequest MedicationRequest, profileURLs List<FHIR.canonical>):
medicationRequest m
return MedicationRequest{
id: FHIR.id {value: 'LCR-' + m.id},
meta: MetaElement(medicationRequest, profileURLs),
dosageInstruction: DosageInstructionElement(m.dosageInstruction),
dispenseRequest: DispenseRequestElement(m.dispenseRequest)
}
define function "DosageInstructionElement"(dosageInstruction Dosage):
return Dosage {
...
}
define function "DispenseRequestElement"(dispenseRequest BackboneElement):
return BackboneElement {
dispenseInterval: ...
validityPeriod: ...
}
Last I heard, there were issues dealing with these types of child elements and backbone elements.
BackboneElements are generally abstract types in the FHIR spec, and are declared implicitly as part of an overall Resource definition. IOW, it's probably not valid to work with BackboneElement directly. I'll do a bit more research on this.