cqframework/cqf-tooling

Add Grouping for test cases

jenseeman opened this issue · 2 comments

Add functionality in tooling so that test cases can be grouped by a measure when creating measure bundles.

Specifically, create a Group resource in the measure's test folder root with the same id as the measure. If one is already present, delete it.
Set the group to active.
Set the group type to "person"
Set the group as actual.
Set the name of the Group to the name of the measure.
For each test case, add a member.entity entry that references the Patient resource for the test case.
Add an extension to the Group to reference the measure: http://hl7.org/fhir/StructureDefinition/artifact-testArtifact, valueCanonical: Canonical url for the measure.

Note that there is a CRMI ticket to build this extension:
https://jira.hl7.org/browse/FHIR-41874

Example Group resource:

{
    "resourceType": "Group",
    "id": "DischargedonAntithromboticTherapyFHIR",
    "extension": [{
        "url": "http://hl7.org/fhir/StructureDefinition/artifact-testArtifact",
        "valueCanonical": "http://ecqi.healthit.gov/ecqms/Measure/DischargedonAntithromboticTherapyFHIR"
    }],
    "active": true,
    "type": "person",
    "actual": true,
    "member": [{
        "entity": { 
            "reference": "Patient/6129131702c62a011f2e59fa", 
            "display": "CMS104FHIR-v0.8.000-NUMERPass-2Enc3WithAntithrombotic"
        }
    }, {
        "entity": { 
            "reference": "Patient/6129131902c62a011f2e5b40", 
            "display": "CMS104FHIR-v0.8.000-DENEXCEPPass-MedDscPatRsnDTimeEQEncStartTime"
        }
    }, {
        "entity": { 
            "reference": "Patient/6129133702c62a011f2e66b1", 
            "display": "CMS104FHIR-v0.8.000-IPPass-age_eq18"
        }
    }, {
        "entity": { 
            "reference": "Patient/6129135502c62a011f2e752c", 
            "display": "CMS104FHIR-v0.8.000-DENEXPass-CMOdurDiffEDTestOccur"
        }
    }]
}