Skip to content

Equivalent between FHIR.AdministrativeGender System.Code #448

@alexanderkiel

Description

@alexanderkiel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions