HL7 / davinci-deqm

Data Exchange for Quality Measures
7 stars 18 forks source link

FIX MeasureReport-summ-contained-supplemental #186

Closed horsetriboulders closed 1 month ago

brynrhodes commented 1 month ago

Can you provide a description of what the reason for these changes was? It looks like there were just several deletions, but with those deletions, does the example still meet the intent? In other words, why is deleting these things the right fix?

horsetriboulders commented 1 month ago

Error #1: Constraint failed: popCount: 'The population must either have a count or an extension. not both' Fix # 1: Remove count from the population where there is an extension. Then Error #2: The population must either have a count or a countQuantity Fix # 2: add countQuantity where there was a count Then Error # 3 invalid property: countQuantity Look into the actual example page (MeasureReport-summ-contained-supplemental.html), the extensions under population don't show anywhere. So Fix # 3: remove all extensions under population. All errors are gone with them. Please let me know if this is NOT an acceptable fix and point me to an acceptable solution.

brynrhodes commented 1 month ago

Yeah, this definitely isn't the right fix because the point of this example is that's it is illustrating contained supplemental data, so the deletions are removing the whole point of the example. The real problem is that there are two extension elements in the JSON. So first, combine the extension elements (take all the extension elements that are defined in the second extension array and move them into the first extension element array, then remove the now empty second extension element.

horsetriboulders commented 1 month ago

The first thing I did was getting rid of the duplicate extension. However, that only took care of the first error. We still have all the following: MeasureReport.extension[1][url='http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description'] (l22/c4) error Extension url 'http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description' is not valid (invalid Element id 'MeasureReport.population.description')

MeasureReport.extension[1] (l22/c4) error The extension http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description could not be found so is not allowed here

MeasureReport.extension[2][url='http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.supplementalDataElement.reference'] (l25/c4) error Extension url 'http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.supplementalDataElement.reference' is not valid (invalid Element id 'MeasureReport.supplementalDataElement.reference')

MeasureReport.extension[2] (l25/c4) error The extension http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.supplementalDataElement.reference could not be found so is not allowed here

MeasureReport.extension[3][url='http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.supplementalDataElement.reference'] (l34/c4) error Extension url 'http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.supplementalDataElement.reference' is not valid (invalid Element id 'MeasureReport.supplementalDataElement.reference')

MeasureReport.extension[3] (l34/c4) error The extension http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.supplementalDataElement.reference could not be found so is not allowed here

MeasureReport.group[0].population[0] (l93/c6) error Constraint failed: popCount: 'The population must either have a count or an extension.'

MeasureReport.group[0].population[0].extension[0][url='http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description'] (l95/c8) error Extension url 'http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description' is not valid (invalid Element id 'MeasureReport.population.description')

MeasureReport.group[0].population[0].extension[0] (l95/c8) error The extension http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description could not be found so is not allowed here

MeasureReport.group[0].population[1] (l107/c6) error Constraint failed: popCount: 'The population must either have a count or an extension.'

MeasureReport.group[0].population[1].extension[0][url='http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description'] (l109/c8) error Extension url 'http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description' is not valid (invalid Element id 'MeasureReport.population.description')

MeasureReport.group[0].population[1].extension[0] (l109/c8) error The extension http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description could not be found so is not allowed here

MeasureReport.group[0].population[2] (l121/c6) error Constraint failed: popCount: 'The population must either have a count or an extension.'

MeasureReport.group[0].population[2].extension[0][url='http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description'] (l123/c8) error Extension url 'http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description' is not valid (invalid Element id 'MeasureReport.population.description')

MeasureReport.group[0].population[2].extension[0] (l123/c8) error The extension http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description could not be found so is not allowed here

MeasureReport.group[0].population[3] (l135/c6) error Constraint failed: popCount: 'The population must either have a count or an extension.'

MeasureReport.group[0].population[3].extension[0][url='http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description'] (l137/c8) error Extension url 'http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description' is not valid (invalid Element id 'MeasureReport.population.description')

MeasureReport.group[0].population[3].extension[0] (l137/c8) error The extension http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.population.description could not be found so is not allowed here

MeasureReport (l81/c65) warning The Measure 'https://madie.cms.gov/Measure/AlaraCTFHIR|0.1.001' could not be resolved, so no validation can be performed against the Measure

horsetriboulders commented 1 month ago

I've reverted the deletions that are removing the whole point of the example and committed some valid fixes. The remaining errors should be dealt with by suppression or rewriting of the example by someone who has a better understanding of the whole point. Please review.

brynrhodes commented 1 month ago

The reference to MeasureReport.population.description is invalid because that element hasn't been added to the MeasureReport in 5.0. So continue to use the DEQM extension:

https://build.fhir.org/ig/HL7/davinci-deqm/StructureDefinition-extension-populationDescription.html

Still looking at the others, but can you address that and then see how many that addresses?

brynrhodes commented 1 month ago

Another issue is that this url http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.supplementalDataElement.reference is wrong, it should not include the .reference, the extension is only defined for the element that was introduced in 5.0, so remove the .reference from all of those as well, and then see what errors remain.

horsetriboulders commented 1 month ago

I've done a commit about an hour ago (see my last commit). Here're what's left:

MeasureReport (l1/c2) | error | The extension http://hl7.org/fhir/StructureDefinition/measurereport-populationDescription is not allowed to be used at this point (allowed = e:MeasureReport.group, e:MeasureReport.group.population, e:MeasureReport.stratifier, e:MeasureReport.supplementalData; this element is [MeasureReport]) This probably needs to be suppressed for now

MeasureReport (l1/c2) | error | The extension http://hl7.org/fhir/StructureDefinition/cqf-criteriaReference is not allowed to be used at this point (allowed = e:Measure.group.population, e:Measure.group.stratifier, e:MeasureReport.supplementalData, e:MeasureReport.evaluatedResource; this element is [MeasureReport]) This probably needs to be suppressed for now

MeasureReport.extension[2] (l26/c3) | error | The Extension 'http://hl7.org/fhir/StructureDefinition/cqf-criteriaReference' definition allows for the types [string] but found type Reference

MeasureReport.extension[2].value.ofType(Reference).reference (l33/c57) | error | This element is not allowed by the profile http://hl7.org/fhir/StructureDefinition/string\|4.0.1

MeasureReport.extension[2].value.ofType(Reference) (l28/c4) | error | The extension http://hl7.org/fhir/us/davinci-deqm/StructureDefinition/extension-criteriaReference is not allowed to be used at this point (allowed = e:Reference; this element is [Extension.value, Extension.value.ofType(string), Extension.valuestring, MeasureReport.extension.value.ofType(Reference), string]) This probably needs to be suppressed for now

MeasureReport.extension[3] (l35/c5) | error | The Extension 'http://hl7.org/fhir/StructureDefinition/cqf-criteriaReference' definition allows for the types [string] but found type Reference

MeasureReport.extension[3].value.ofType(Reference).reference (l42/c57) | error | This element is not allowed by the profile http://hl7.org/fhir/StructureDefinition/string\|4.0.1

MeasureReport.extension[3].value.ofType(Reference) (l37/c4) | error | The extension http://hl7.org/fhir/us/davinci-deqm/StructureDefinition/extension-criteriaReference is not allowed to be used at this point (allowed = e:Reference; this element is [Extension.value, Extension.value.ofType(string), Extension.valuestring, MeasureReport.extension.value.ofType(Reference), string]) This probably needs to be suppressed for now

MeasureReport.group[0].population[0] (l95/c6) | error | Constraint failed: popCount: 'The population must either have a count or an extension.' MeasureReport.group[0].population[1] (l112/c6) | error | Constraint failed: popCount: 'The population must either have a count or an extension.' MeasureReport.group[0].population[2] (l127/c6) | error | Constraint failed: popCount: 'The population must either have a count or an extension.' MeasureReport.group[0].population[3] (l142/c6) | error | Constraint failed: popCount: 'The population must either have a count or an extension.'

horsetriboulders commented 1 month ago

The url is no longer there. See my commit (72fd8632e7ad3ab95090acc5e98ce2477755ce8f) today.

Another issue is that this url http://hl7.org/fhir/5.0/StructureDefinition/extension-MeasureReport.supplementalDataElement.reference is wrong, it should not include the .reference, the extension is only defined for the element that was introduced in 5.0, so remove the .reference from all of those as well, and then see what errors remain.

brynrhodes commented 1 month ago

It got to the point where I couldn't tell what was what, so I fixed the errors locally and committed. This PR is no longer required.