cqframework / clinical_quality_language

Clinical Quality Language (CQL) is an HL7 specification for the expression of clinical knowledge that can be used within both the Clinical Decision Support (CDS) and Clinical Quality Measurement (CQM) domains. This repository contains complementary tooling in support of that specification.
https://confluence.hl7.org/display/CDS/Clinical+Quality+Language
Apache License 2.0
266 stars 123 forks source link

Unable to read narrative xhtml from a resource #1157

Open adamzkover opened 1 year ago

adamzkover commented 1 year ago

Running the CQL in the VS Code plugin, the error message is: Could not resolve data provider for package 'org.hl7.fhir.utilities.xhtml'.

Sample repository based on content-ig-walkthrough: https://github.com/felleskatalogen/content-ig-walkthrough/commit/5501e9f07174f29fda1c7a9e07c0b94a5b477e71

ddieppois commented 1 year ago

Hey @adamzkover what command on which file exactly did you get your error ?

adamzkover commented 10 months ago

Hi @ddieppois,

In the example repository above there is one Observation that has Narrative, it is in file observation-mom-without-anaemia-hb.json. Reading it is in ANCRecommendationA2.cql with this function:

define function narrativeOfObservation(O FHIR.Observation):
  if O.text is null then
    ''
  else
    O.text.div

The complete output (with some of the directory path removed) from running the CQL file in the VSCode plugin is:

Executing CQL...
CQL path: /Users/.../content-ig-walkthrough-resource-narrative/input/cql
Data path: /Users/.../content-ig-walkthrough-resource-narrative/input/tests/ANCRecommendationA2
Terminology path: /Users/.../content-ig-walkthrough-resource-narrative/input/vocabulary/valueset

Evaluation logs:
11:46:42.643 [pool-2-thread-1] INFO  ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [R4]
11:46:42.741 [pool-2-thread-1] WARN  o.o.c.c.e.e.terminology.BundleTerminologyProvider - Codes expanded without a terminology server, some results may not be correct.
11:46:42.741 [pool-2-thread-1] WARN  o.o.c.c.e.e.terminology.BundleTerminologyProvider - Codes expanded without a terminology server, some results may not be correct.
Could not resolve data provider for package 'org.hl7.fhir.utilities.xhtml'.
elapsed: 0.105 seconds

Having O.text in the else branch gives a Narrative, but I did not find a way to get the text or markup from the Narrative.