You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following Library which translated with elm-to-cql v1.3.15 but doesn't in v1.4.6:
library Retrieve
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0'
codesystem gender: 'http://hl7.org/fhir/administrative-gender'
context Patient
define InInitialPopulation:
Patient.gender ~ Code 'male' from gender
The error is:
Could not resolve call to operator Equivalent with signature (FHIR.AdministrativeGender,System.Code).
I know that the type checks are stricter in v1.4.x but shouldn't is possible to compare codes directly? I know that ToString works like in this library:
library Retrieve
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0'
context Patient
define InInitialPopulation:
Patient.gender = 'male'
But than I only compare the code value and not the code + system.
Also this example from the Authors Guide translates:
library Retrieve
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0'
valueset "Female Administrative Sex": 'urn:oid:2.16.840.1.113883.3.560.100.2'
context Patient
define InInitialPopulation:
Patient.gender in "Female Administrative Sex"
But in the ELM, I see that ToString is called on gender although the type of the value set ref is List(System.Code). How is the InValueSet Operator supposed to compare strings with codes?
At the end, why is FHIR.AdministrativeGender at type at all? Are there types for codes from most common code systems or has it something to do with the ValueSet binding of Patient.gender? If all codes would have just the type System.Code, comparison would be easy.
The text was updated successfully, but these errors were encountered:
I made one observation: It is possible to compare a FHIR.Coding with a System.Code because an implicit type conversion with the function ToCode is made. So Patient.gender isn't a FHIR.Coding but it would be possible to have an overload of ToCode for FHIR.AdministrativeGender.
Now I also understand why FHIR.AdministrativeGender is it's own type. Because in FHIR the code type doesn't carry any code system information. The standalone code-typed data elements can only be interpreted using the value set binding. In my server, I resolve such codes like in Patient.gender to an actual coding at data ingest and safe a reference to that coding in my database. So actually I have the full coding information for all Patient.gender values and can compare them with another codings.
In the FHIR models for CQL, there is really a separate type for each of the code-typed data elements? How can I extend the model if a use my own code-typed data elements say in an extension?
I have the following Library which translated with elm-to-cql v1.3.15 but doesn't in v1.4.6:
The error is:
Could not resolve call to operator Equivalent with signature (FHIR.AdministrativeGender,System.Code).
I know that the type checks are stricter in v1.4.x but shouldn't is possible to compare codes directly? I know that
ToString
works like in this library:But than I only compare the code value and not the code + system.
Also this example from the Authors Guide translates:
But in the ELM, I see that
ToString
is called on gender although the type of the value set ref isList(System.Code)
. How is theInValueSet
Operator supposed to compare strings with codes?At the end, why is
FHIR.AdministrativeGender
at type at all? Are there types for codes from most common code systems or has it something to do with the ValueSet binding ofPatient.gender
? If all codes would have just the typeSystem.Code
, comparison would be easy.The text was updated successfully, but these errors were encountered: