Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModelInfo for observation-bp status binding is ambiguous #518

Open
brynrhodes opened this issue Mar 8, 2024 · 1 comment
Open

ModelInfo for observation-bp status binding is ambiguous #518

brynrhodes opened this issue Mar 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@brynrhodes
Copy link
Member

In profile-informed models, the mapping layer is intended to map all references to elements in profiles down to their base FHIR equivalents. In the case of a binding, the use of the element-binding-name extension is causing an ambiguity because the profile is overriding the element-binding-name. Specifically, for observation-bp, the status binding renames the base ObservationStatus to Status, resulting in an ambiguous type name.

Given the following expression (from https://github.com/cqframework/ecqm-content-qicore-2024/blob/main/input/cql/Status.cql#194):

define function "BloodPressure"(Obs List<"QICore.observation-bp">):
  Obs O
    where O.status in { 'final', 'amended', 'corrected' }

The ELM output is:

 "operand" : [ {
                     "locator" : "195:11-195:18",
                     "resultTypeName" : "{http:https://hl7.org/fhir}Status",
                     "path" : "value",
                     "type" : "Property",
                     "source" : {
                        "path" : "status",
                        "scope" : "O",
                        "type" : "Property"
                     }
                  },

As we can see, this refers to a FHIR binding {http:https://hl7.org/fhir}Status. This binding can indeed be found in the FHIR specification, but is used for VerificationResult.status. Since the CQL here is referring to Observation.status (for which the binding name is {http:https://hl7.org/fhir}ObservationStatus), our ELM->C# compiler reports a type error.

This is due to the elementdefinition-bindingname extension that appears on the binding of the status element in the profile (https://hl7.org/fhir/bp.profile.xml.html):

      <binding>
        <extension url="http:https://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="Status"/>
        </extension>
        <strength value="required"/>
        <valueSet value="http:https://hl7.org/fhir/ValueSet/observation-status"/>
      </binding>

The fix is most likely to use the elementdefinition-bindingname from the base resource definition, rather than the name of the binding in the profile.

@brynrhodes brynrhodes added the bug Something isn't working label Mar 8, 2024
@brynrhodes
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant