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.
As we can see, this refers to a FHIR binding {http://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://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):
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):
The ELM output is:
As we can see, this refers to a FHIR binding {http://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://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):
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.