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

Filter Qualitative Values without Version #117

Open
juliangruendner opened this issue Apr 17, 2024 · 3 comments
Open

Filter Qualitative Values without Version #117

juliangruendner opened this issue Apr 17, 2024 · 3 comments
Assignees
Labels
blocked Blocked by something enhancement New feature or request
Milestone

Comments

@juliangruendner
Copy link
Contributor

IS:

Qualitative values are currently filtered for with the version, as the generated cql query uses "contains", which compares using equal.

SHOULD:

Qualitative values should be filtered for without the version.
The generated cql query should then use "equivalent" instead of "contains.

Examples

CQL with contains (IS)

using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0'

codesystem loinc: 'http://loinc.org/'
codesystem uiccstadiumcs: 'http://dktk.dkfz.de/fhir/onco/core/CodeSystem/UiccstadiumCS'

context Patient

define Criterion:
exists (from [Observation: Code '21908-9' from loinc] O
where O.value.as(CodeableConcept).coding contains Code 'IIA' from uiccstadiumcs)

define InInitialPopulation:
Criterion

CQL with equivalent (SHOULD)

using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0'

codesystem loinc: 'http://loinc.org'
codesystem uiccstadiumcs: 'http://dktk.dkfz.de/fhir/onco/core/CodeSystem/UiccstadiumCS'

context Patient

define Criterion:
exists (from [Observation: Code '21908-9' from loinc] O
where exists (from O.value.coding C where C ~ Code 'IIA' from uiccstadiumcs))

define InInitialPopulation:
Criterion

Example FHIR resource as json which contains value code

{
    "resourceType": "Observation",
    "component": [
        {
            "extension": [
                {
                    "url": "http://dktk.dkfz.de/fhir/StructureDefinition/onco-core-Extension-TNMcpuPraefix",
                    "valueCodeableConcept": {
                        "coding": [
                            {
                                "system": "http://dktk.dkfz.de/fhir/onco/core/CodeSystem/TNMcpuPraefixTCS",
                                "code": "c",
                                "display": "Kategorie wurde durch klinische Angaben festgestellt, bzw. erfüllt die Kriterien für p nicht"
                            }
                        ]
                    }
                }
            ],
            "code": {
                "coding": [
                    {
                        "system": "http://loinc.org",
                        "code": "21905-5",
                        "display": "Primary tumor.clinical Cancer"
                    }
                ]
            },
            "valueCodeableConcept": {
                "coding": [
                    {
                        "system": "http://dktk.dkfz.de/fhir/onco/core/CodeSystem/TNMTCS",
                        "code": "0",
                        "display": "0"
                    }
                ]
            }
        },
        {
            "extension": [
                {
                    "url": "http://dktk.dkfz.de/fhir/StructureDefinition/onco-core-Extension-TNMcpuPraefix",
                    "valueCodeableConcept": {
                        "coding": [
                            {
                                "system": "http://dktk.dkfz.de/fhir/onco/core/CodeSystem/TNMcpuPraefixTCS",
                                "code": "c",
                                "display": "Kategorie wurde durch klinische Angaben festgestellt, bzw. erfüllt die Kriterien für p nicht"
                            }
                        ]
                    }
                }
            ],
            "code": {
                "coding": [
                    {
                        "system": "http://loinc.org",
                        "code": "21906-3",
                        "display": "Regional lymph nodes.clinical"
                    }
                ]
            },
            "valueCodeableConcept": {
                "coding": [
                    {
                        "system": "http://dktk.dkfz.de/fhir/onco/core/CodeSystem/TNMNCS",
                        "code": "1",
                        "display": "1"
                    }
                ]
            }
        },
        {
            "extension": [
                {
                    "url": "http://dktk.dkfz.de/fhir/StructureDefinition/onco-core-Extension-TNMcpuPraefix",
                    "valueCodeableConcept": {
                        "coding": [
                            {
                                "system": "http://dktk.dkfz.de/fhir/onco/core/CodeSystem/TNMcpuPraefixTCS",
                                "code": "c",
                                "display": "Kategorie wurde durch klinische Angaben festgestellt, bzw. erfüllt die Kriterien für p nicht"
                            }
                        ]
                    }
                }
            ],
            "code": {
                "coding": [
                    {
                        "system": "http://loinc.org",
                        "code": "21907-1",
                        "display": "Distant metastases.clinical [Class] Cancer"
                    }
                ]
            },
            "valueCodeableConcept": {
                "coding": [
                    {
                        "system": "http://dktk.dkfz.de/fhir/onco/core/CodeSystem/TNMMCS",
                        "code": "0",
                        "display": "0"
                    }
                ]
            }
        }
    ],
    "effectiveDateTime": "2021-10-21T00:00:00+02:00",
    "status": "final",
    "id": "9f9de0ce0f243936181f4a13362af10d2d3c1431b3dcbf204ce417974bfe8a5f",
    "code": {
        "coding": [
            {
                "system": "http://loinc.org",
                "code": "21908-9",
                "display": "Stage group.clinical Cancer"
            }
        ]
    },
    "valueCodeableConcept": {
        "coding": [
            {
                "system": "http://dktk.dkfz.de/fhir/onco/core/CodeSystem/UiccstadiumCS",
                "version": "2",
                "code": "IIA"
            }
        ]
    },
    "subject": {
        "reference": "Patient/40066cb1cce93d76636b482b3eddbad2d711fa90c709cf209879572113c26aea",
        "identifier": {
            "type": {
                "coding": [
                    {
                        "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
                        "code": "MR"
                    }
                ]
            },
            "system": "https://fhir.diz.uk-erlangen.de/identifiers/patient-id",
            "value": "105555588"
        }
    }
}
@juliangruendner juliangruendner added this to the v0.2.17 milestone May 31, 2024
@juliangruendner juliangruendner removed this from the v0.2.17 milestone Jun 10, 2024
@juliangruendner juliangruendner added this to the v0.4.0 milestone Jul 2, 2024
@alexanderkiel
Copy link
Member

alexanderkiel commented Jul 5, 2024

I found a simpler way to test via equivalence:

using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0'

codesystem loinc: 'http://loinc.org/'
codesystem uiccstadiumcs: 'http://dktk.dkfz.de/fhir/onco/core/CodeSystem/UiccstadiumCS'

context Patient

define Criterion:
  exists (from [Observation: Code '21908-9' from loinc] O
    where O.value ~ Code 'IIA' from uiccstadiumcs)

define InInitialPopulation:
  Criterion

It's just possible to apply the equivalence operator to a FHIR CodeableConcept and a CQL Code.

@alexanderkiel
Copy link
Member

We have to wait until all sites have at least the v0.29 of Blaze deployed.

@juliangruendner juliangruendner added the enhancement New feature or request label Jul 11, 2024
@alexanderkiel alexanderkiel added the blocked Blocked by something label Jul 15, 2024
@alexanderkiel alexanderkiel modified the milestones: v0.4.0, v0.5.0 Jul 15, 2024
@alexanderkiel alexanderkiel modified the milestones: v0.5.0, v0.6.0 Sep 4, 2024
@alexanderkiel alexanderkiel modified the milestones: v0.6.0, v0.7.0 Nov 27, 2024
@alexanderkiel
Copy link
Member

I already changes the test in Blaze: samply/blaze#2229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked by something enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants