From d2d53a2d5c7a92a503468a5b26f66b9691aa348e Mon Sep 17 00:00:00 2001 From: fikrimilano Date: Wed, 2 Aug 2023 14:25:31 +0700 Subject: [PATCH] WIP --- .../assets/dynamic-answer-expression.json | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 demo/src/main/assets/dynamic-answer-expression.json diff --git a/demo/src/main/assets/dynamic-answer-expression.json b/demo/src/main/assets/dynamic-answer-expression.json new file mode 100644 index 0000000000..ca55a031fe --- /dev/null +++ b/demo/src/main/assets/dynamic-answer-expression.json @@ -0,0 +1,134 @@ +{ + "resourceType": "Questionnaire", + "id": "client-registration-sample", + "language": "en", + "status": "active", + "date": "2020-11-18T07:24:47.111Z", + "subjectType": [ + "Patient" + ], + "extension": [ + { + "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext", + "extension": [ + { + "url": "name", + "valueCoding": { + "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext", + "code": "giga-chada", + "display": "Giga Chad" + } + }, + { + "url": "type", + "valueCode": "Patient" + } + ] + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/variable", + "valueExpression": { + "name": "selected-answer", + "language": "text/fhirpath", + "expression": "%resource.descendants().where(linkId='1').answer.value" + } + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/variable", + "valueExpression": { + "name": "city", + "language": "text/fhirpath", + "expression": "iif(%selected-answer.exists(), %selected-answer.code, 'NOTHING')" + } + } + ], + "item": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://hl7.org/fhir/questionnaire-item-control", + "code": "drop-down", + "display": "Drop down" + } + ], + "text": "Drop down" + } + } + ], + "linkId": "1", + "text": "Select City", + "type": "choice", + "required": true, + "answerOption": [ + { + "valueCoding": { + "code": "JAKARTA", + "display": "JAKARTA" + } + }, + { + "valueCoding": { + "code": "NAIROBI", + "display": "NAIROBI" + } + } + ] + }, + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://hl7.org/fhir/questionnaire-item-control", + "code": "drop-down", + "display": "Drop down" + } + ], + "text": "Drop down" + } + }, + { + "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-answerExpression", + "valueExpression": { + "expression": "Patient?name={{%giga-chad.name.given}}", + "language": "application/x-fhir-query" + } + }, + { + "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-choiceColumn", + "extension": [ + { + "url": "path", + "valueString": "id" + }, + { + "url": "forDisplay", + "valueBoolean": true + } + ] + } + ], + "linkId": "2", + "text": "Find Patient From: X City", + "_text": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/cqf-expression", + "valueExpression": { + "language": "text/fhirpath", + "expression": "'Find Patient From: ' + %city + ' City'" + } + } + ] + }, + "type": "reference", + "required": true + } + ] +} \ No newline at end of file