Closed lmd59 closed 1 year ago
St.:grey_question: |
Category | Percentage | Covered / Total |
---|---|---|---|
π’ | Statements | 85.95% (-0.37% π») |
2307/2684 |
π‘ | Branches | 72.97% (-2.55% π») |
2122/2908 |
π’ | Functions | 89.1% (-0.33% π») |
425/477 |
π’ | Lines | 86.28% (-0.36% π») |
2227/2581 |
431 tests passing in 31 suites.
Report generated by π§ͺjest coverage report action from 9d411923f75d3c634d6c90d47842477f1e392295
This fails when running with an old connectathon bundle:
In this case, resourceType
is actually Coding
. Are we assuming that we always have a FHIR resource by the time we access the primaryCodePath
? Or is this just identifying an edge-case that we aren't handling?
EDIT: This also happens with the ColorectalCancerScreeningsFHIR bundle in ecqm-content-r4-2021:
This fails when running with an old connectathon bundle:
In this case,
resourceType
is actuallyCoding
. Are we assuming that we always have a FHIR resource by the time we access theprimaryCodePath
? Or is this just identifying an edge-case that we aren't handling?EDIT: This also happens with the ColorectalCancerScreeningsFHIR bundle in ecqm-content-r4-2021:
I have this fixed, but I'm looking into some other code-like types handling based on some additional discussion with @hossenlopp .
Great stuff! Some small inline comments and some open questions. I tested this on all the ecqm-content-r4-2021 and connectathon measures and found two things I wasn't completely sure about:
- It looks like medication request looks doesn't have a space between the two words:
Not sure if this even matters but I thought I would point it out. Relevant measure is EXM105-8.2.000 & the numerator patient.
- Sometimes the observation statement pretty result isn't in square brackets. An example of it without square brackets can be seen in the DiabetesHemoglobinA1cHbA1cPoorControl9FHIR measure & denom patient (with measurementPeriodStart: 2019-01-01 and measurementPeriodEnd: 2019-12-31):
Nice! Great additions. Just one inline suggestion. Also, I noticed that
buildStatementAndClauseResults
hasdoPretty
as a parameter, even though I think it is always set to true. Do we still want this?
Hmm- yeah looks like buildStatementAndClauseResults()
is only ever called with doPretty: true
. It certainly isn't hurting anything. Maybe we were thinking of making this configurable at a higher level at some point?
Summary
Previously, statement results for FHIR would default to json-like appearances for objects. They now show the most relevant fields for FHIR objects and use mappings to identify more useful information and labels (such as displays for code systems and relevant path properties).
New behavior
Statement results have improved
pretty
field for results that are objects or codesCode changes
parse-code-systems
script topackage.json
, which uses theparseCodeSystems.ts
script to create the code system URL to pretty code system mapping. This leverages the files in thecode-systems
folder as input and output to go from thects-metadata
file to the easily consumablesystem-map
file.code-attributes/codePaths.ts
taken from fqm-testify for easy identification of primary code pathClauseResultBuilder.ts
system-map
, show array elements as singular if there isn't more than one, remove unused QDM logic, and handle FHIR objectlogicprettyFHIRObject
for base FHIRObjectsprettyFHIRObject
to work with FHIRObjects that come from the calculation results to identify the resource type and component pieces in a human readable (similar to Bonnie) formatratio-Encounter-reuseObservationFunction
) have pretty resultsTesting guidance
npm run check
npm run test:integration
Play around with different calculations with interesting FHIR results. Some examples are included in the integration tests:
npm run cli -- -p "test/integration/proportion-Encounter-tuple/patients/patient-2Enc-1day-3day.json" -m "test/integration/proportion-Encounter-tuple/proportion-Encounter-tuple-bundle.json" -o --debug -s 2022-01-01 -e 2022-12-31
creates tuple outputs (look for "Enc with Durations" in the statement results), which you can compare to Bonnie tuple outputs (some differences exist in how intervals are rendered):npm run cli -- -p "test/integration/ratio-Encounter-reuseObservationFunction/patients/patient-3enc-1in-all-2in-denom.json" -m "test/integration/ratio-Encounter-reuseObservationFunction/ratio-Encounter-reuseObservationFunction-bundle.json" -o --debug -s 2022-01-01 -e 2022-12-31
creates results with multiple FHIRObjects (look for the "denom" statement) or results with a single FHIR object (look for the "numer" statement). This could be compared with a simple FHIR object in Bonnie:ecqm-content-r4-2021/bundles/measure/CervicalCancerScreeningFHIR/CervicalCancerScreeningFHIR-bundle.json
may have an encounter result for the statementQualifying Encounters
or an observation result for the statementCervical Cytology Within 3 Years
. As a note, this measure uses outdated gender administration code system URLs, so the human-readable code system lookup does not work (and the URL is shown instead).