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 124 forks source link

Issue with cql-engine-fhir using Valueset/$expand as a POST, not a GET #1072

Closed MikeRileyGTRI closed 3 years ago

MikeRileyGTRI commented 5 years ago

Hi cql_engine team, I am having an issue with the fhir terminology provider. I have been using 1.2.45 but have recently moved to 1.2.52 as well.

When using a fhirterminologyserver to expand a valueset, FhirTerminologyProvider uses this hapi-fhir call. Parameters respParam = fhirClient .operation() .onInstance(new IdType("ValueSet", valueSet.getId())) .named("expand") .withNoParameters(Parameters.class) .execute(); Unfortunately, this generates a POST request. The terminology server I'm requesting now only supports GET requests. In other terminology helper functions, they include the .useHttpget() command that would fix my issue, and in my current branch I've added the builder tag and it fixes my issue. But there's a bigger issue at play here.

1) This function on it's own doesn't generate enough information on it's own, and should fail in most cases. According to the FHIR spec here: http://hl7.org/fhir/stu3/valueset-operations.html#expand the POST command is expecting a parameter body to be POSTed, but we provide no data to do it with (in fact, the client explicitedly said withNoParameter(). So even with a POST request there is not enough information for the server to act on. 2) Why does the in(Code code, ValueSetInfo valueSet) functino use useHttpGet() but this one does not? 3) Can you send me the url info of the terminology server you use to test against this? I have pulled and branched off of 1.2.52 to test the change myself, but primarily I would like to see a terminology server where this is correct. It could be entirely my terminology provider source that isn't following the specification correctly, and I could show them how this is a breaking change for cql.

If changing the expand call to force a GET is not too breaking as well, let me know and I can make a pull request as well.

JPercival commented 3 years ago

Resolved by cqframework/cql-engine#462