FirelyTeam / firely-cql-sdk

BSD 3-Clause "New" or "Revised" License
26 stars 15 forks source link

2.0/Fix integration test - No conversion from FhirDateTime to Hl7.Fhir.Model.Quantity #362

Open baseTwo opened 1 month ago

baseTwo commented 1 month ago

See this page for most recent details

Library C# File: SevereObstetricComplicationsFHIR_0_1_000 Method : Risk_Variable_Heart_Rate_Value line 2055 Test Case ID = "6785c9c5-d58e-4e86-9f68-10c83597f8fb" Observation ID = "delivery-date-estimated-124b" Observation Value = "2025-01-31T08:00:00.000+00:00" (TypeName = dateTime)

Summary of Errors by Category

Unrecognized Guid format

No conversion from number to Hl7.Fhir.Model.Quantity is defined.

No conversion from date to Hl7.Fhir.Model.Quantity is defined.

Cannot check equivalence for type KeyValuePair`2

baseTwo commented 3 weeks ago

Slack reply from Rich Almeida

I think this is failing because there is no code filters on the observation, line 2016. These records shouldn't even be considered further in the code. The filter in the elm, line 7242 looks like this: "expression" : { "locator" : "359:31-359:55", "dataType" : "{http://hl7.org/fhir}Observation", "templateId" : "http://hl7.org/fhir/StructureDefinition/heartrate", "type" : "Retrieve", "resultTypeSpecifier" : { "type" : "ListTypeSpecifier", "elementType" : { "name" : "{http://hl7.org/fhir}Observation", "type" : "NamedTypeSpecifier" } } I knew at some point we might need to be using the data models, but I am not sure how that should be used or if there is enough info in the ELM to not worry about it. Do we attempt interpret templateId if it exists? Here is the data model link for this https://github.com/cqframework/clinical_quality_language/blob/master/Src/java/quick/src/main/resources/org/hl7/fhir/qicore-modelinfo-4.1.1.xml#L6202 You can see that the name "observation-heartrate" should translate to http://hl7.org/fhir/StructureDefinition/heartrate and that would be the filter on observations Then to retrieve value it provides the datatype. https://github.com/cqframework/clinical_quality_language/blob/a022fc510b8ee868cc6d[…]uick/src/main/resources/org/hl7/fhir/qicore-modelinfo-4.1.1.xml Here is a sample of a heart rate patient: https://github.com/cqframework/ecqm-content-qicore-2024/blob/389b55e7b9a71c78c960f[…]CMS1028FHIR-v0.1.000-RISKPass-RISKHR24hoursB4EDOTTriageEnc.json (edited)

Rich Almeida 15 hours ago This is not to say the measure is written correctly... I will try to run it other Java tooling, but its not a quick thing and last I checked there were some issues getting it off the ground.