WorldHealthOrganization / smart-emcare

Emergency Care - a digital platform/reference mobile application that is able to rapidly share WHO guidelines.
12 stars 2 forks source link

First qualifier always display with classification #7

Open delcroip opened 1 year ago

delcroip commented 1 year ago

it seems that we can have only one element with the extension "instructions" and it does not use the enableWhenExpression

{
    "resourceType": "Questionnaire",
    "id": "emcare.b23.classification",
    "meta": {
        "profile": [
            "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire"
        ]
    },
    "extension": [
        {
            "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-targetStructureMap",
            "valueCanonical": "https://fhir.dk.swisstph-mis.ch/matchbox/fhir/StructureMap/emcare.b23.classification"
        },
        {
            "url": "http://hl7.org/fhir/StructureDefinition/cqf-library",
            "valueCanonical": "https://fhir.dk.swisstph-mis.ch/matchbox/fhir/Library/emcareb23classification"
        }
    ],
    "url": "https://fhir.dk.swisstph-mis.ch/matchbox/fhir/Questionnaire/emcare.b23.classification",
    "name": "EmCare.B23.Classification",
    "title": "EmCare.B23.Classification",
    "status": "active",
    "experimental": false,
    "subjectType": [
        "Patient"
    ],
    "item": [
        {
            "extension": [
                {
                    "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression",
                    "valueExpression": {
                        "language": "text/fhirpath",
                        "expression": "%resource.repeat(item).where(linkId='DL-G-CL1-07').answer.first().value = true"
                    }
                }
            ],
            "linkId": "EmCare.B23.DE03",
            "text": "Severe Pneumonia or Very Severe Disease",
            "type": "boolean",
            "required": false,
            "repeats": false,
            "item": [
                {
                    "extension": [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-displayCategory",
                            "valueCodeableConcept": {
                                "coding": [
                                    {
                                        "system": "http://hl7.org/fhir/questionnaire-display-category",
                                        "code": "instructions"
                                    }
                                ]
                            }
                        },
                        {
                            "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression",
                            "valueExpression": {
                                "language": "text/fhirpath",
                                "expression": "false"
                            }
                        }
                    ],
                    "linkId": "EmCare.B23.DE04_l",
                    "text": "with low oxygen saturation (SPO2 < 90%)",
                    "type": "display",
                    "required": false,
                    "repeats": false
                },
                {
                    "extension": [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-displayCategory",
                            "valueCodeableConcept": {
                                "coding": [
                                    {
                                        "system": "http://hl7.org/fhir/questionnaire-display-category",
                                        "code": "instructions"
                                    }
                                ]
                            }
                        },
                        {
                            "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression",
                            "valueExpression": {
                                "language": "text/fhirpath",
                                "expression": "true"
                            }
                        }
                    ],
                    "linkId": "EmCare.B23.DE05_l",
                    "text": "with wheezing",
                    "type": "display",
                    "required": false,
                    "repeats": false
                }
            ]
        }
    ]
}
ppanchal-argus commented 1 year ago

You're right @delcroip I tested this in the demo app and it's not working as expected. Raised an issue for this

ppanchal-argus commented 1 year ago

This is now integrated to the SDK. Will be included in next release. @delcroip You might want to give a look at the modified questionnaire in comment: https://github.com/google/android-fhir/issues/1835