Could not resolve type CommunicationRequest.Payload
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
I am executing the above library in the online tool: https://cql-runner.dataphoria.org/
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.