FHIR Chat · model of examples in CQL documentation · cql

Stream: cql

Topic: model of examples in CQL documentation


view this post on Zulip Georg Fette (Oct 25 2018 at 08:34):

Hi @Bryn Rhodes,
I am trying to parse all queries that appear in the CQL documentation on http://cql.hl7.org/index.html. I managed to parse some examples using the QUICK model, but some have a different model. Does there exist a publicly available model file that can be used to parse all statements from the documentation ? That would make experiments with the language much easier.
Greetings
Georg

view this post on Zulip Bryn Rhodes (Oct 26 2018 at 18:22):

Hi @Georg Fette, the examples should all parse with the current translator. Are there specific examples you are having trouble with?

view this post on Zulip Georg Fette (Nov 02 2018 at 12:37):

Hi, @Bryn Rhodes
The query
[CommunicationRequest] C where C.mode = 'ordered' and C.sender.role = 'nurse' and C.recipient.role = 'doctor' and C.indication in "Fever"
for example uses a "CommunicationRequest" definition that does not seem to correspond to the definition in https://www.hl7.org/fhir/communicationrequest.html.
C.mode and C.indication appear to be missing. Furthermore do the sender and the recipient be implicitely typed to Practitioner. Wher does this type inference come from, because in the QUICK model sender and recipient are defined as one of a list of types (Practitioner | Patient | Device | RelatedPerson | Organization). In the QUICK model file I am currently using these elements are defined as "System.Any". How does such a selection from a list of possible types look like in a proper model file ?
Greetings
Georg

view this post on Zulip Bryn Rhodes (Nov 05 2018 at 16:53):

The QUICK model that is included with the CQL-to-ELM translator is based on an interim release of FHIR, 1.6 IIRC. The QUICK model is derived from the QI-Core profiles, and the tooling to do that automatically is still in flight, what's there in QUICK currently was built manually and it hasn't been updated for subsequent releases of the QI-Core profiles.

view this post on Zulip Bryn Rhodes (Nov 05 2018 at 16:55):

Further, when that manual model was produced, the model info didn't support Choice Types, so choices were modeled as Any. Newer model infos use Choice Types to model those. If it's modeled as an Any, then you would have to use a type cast to get the value to be treated as the appropriate type. With Choice Types, the translator will attempt to resolve based on any of the types in the choice type.

view this post on Zulip Bryn Rhodes (Nov 05 2018 at 16:55):

So if you look at the later FHIR model infos, they use choice types to model choices in FHIR.


Last updated: Apr 12 2022 at 19:14 UTC