clinical_quality_language icon indicating copy to clipboard operation
clinical_quality_language copied to clipboard

Could not resolve type CommunicationRequest.Payload

Open contactkuchi opened this issue 4 years ago • 2 comments

Hi, I am trying to create a CommunicationRequest resource in CQL to pass it back to cqf-ruler for a workflow process. I have defined a library as below:

library FMCNAActivityDefinition version '1.0.0' using FHIR version '4.0.1' include "FHIRHelpers" version '4.0.1' called FHIRHelpers define "comm": CommunicationRequest { id: id { value: '123' }, priority: CommunicationPriority { value: 'routine' }, payload : { FHIR.CommunicationRequest.Payload { content : string { value: 'some sample text' } } } }

I am getting the below error when I execute:

comm [10:1] Could not resolve type CommunicationRequest.Payload. Primary package for this resolver is org.hl7.fhir.r4.model

contactkuchi avatar Jun 17 '21 22:06 contactkuchi

I am executing the above library in the online tool: https://cql-runner.dataphoria.org/

contactkuchi avatar Jun 17 '21 22:06 contactkuchi

The fix for this is probably either adding a specific resolution for that type here: https://github.com/DBCG/cql_engine/blob/master/engine.fhir/src/main/java/org/opencds/cqf/cql/engine/fhir/model/R4FhirModelResolver.java#L129

Or generalizing the mapping logic to support inner types here: https://github.com/DBCG/cql_engine/blob/master/engine.fhir/src/main/java/org/opencds/cqf/cql/engine/fhir/model/FhirModelResolver.java#L199

I need to look at the logic that the translator is using to generate type names. I'll follow-up once I have the chance to do that.

JPercival avatar Jul 12 '21 20:07 JPercival