Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library $evaluate unable to handle returned sets #622

Open
Capt-Mac opened this issue Jan 7, 2025 · 1 comment
Open

Library $evaluate unable to handle returned sets #622

Capt-Mac opened this issue Jan 7, 2025 · 1 comment
Labels
bug Something isn't working dQM

Comments

@Capt-Mac
Copy link
Contributor

Capt-Mac commented Jan 7, 2025

Problem:

When running Library $evaluate for specific expression return types it appears that the operation is unable to render the results into a FHIR parameter component.

This is a problem because the operation is fully unusable without these types of scenarios.

example CQL:

define "Related Encounters":
  from
   [Encounter] Encounter,
    [Condition] Pregnancy
        where AC.ActiveDiagnosisPeriod(Encounter, Condition) overlaps Encounter.period
            and AgeInYearsAt(start of Encounter.period) between 14 and 50
    return { condition: Condition, ed: Encounter }

Error returned when evaluating CQL with this type of expression within it:

{
    "resourceType": "Parameters",
    "parameter": [
        {
            "name": "evaluation error",
            "resource": {
                "resourceType": "OperationOutcome",
                "issue": [
                    {
                        "severity": "error",
                        "code": "exception",
                        "diagnostics": "unknown type when trying to convert to parameters: ParametersParameterComponent"
                    }
                ]
            }
        }
    ]
}

Scope:

Allow the output of sets of resources like the example above to populate in a parameter component. Choose a format that would indicate the expression the result is sourced from and the alias related to the displayed result

@Capt-Mac Capt-Mac added dQM bug Something isn't working labels Jan 7, 2025
@JPercival
Copy link
Contributor

JPercival commented Jan 7, 2025

CQL is able to represent a broader of set of types than FHIR (since CQL is not FHIR-specific). The Using CQL with FHIR IG specifies the set of types that can be used in FHIR-based CQL (and, transitively, with operations such as $evaluate):

https://build.fhir.org/ig/HL7/cql-ig/conformance.html#conformance-requirement-4-3

Essentially, even though you can write the CQL above it's not valid for FHIR use-cases.

IOW, this is something to take up as standards feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dQM
Projects
None yet
Development

No branches or pull requests

2 participants