clinical_quality_language icon indicating copy to clipboard operation
clinical_quality_language copied to clipboard

Support for CQL manipulating BackboneElement types

Open JPercival opened this issue 2 years ago • 1 comments

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.

JPercival avatar Oct 18 '23 16:10 JPercival

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.

JPercival avatar Oct 20 '23 16:10 JPercival