-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for displaying display items based on conditions. (#1898)
* ac * Review changes and updated kdoc * Espresso test for enabled display items * Added unit test for enabledDisplayItems * modified test for initial value set to true
- Loading branch information
Showing
27 changed files
with
687 additions
and
326 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
datacapture/sampledata/questionnaire_with_enabled_display_items.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"resourceType": "Questionnaire", | ||
"id": "questionnaire.enabled.display", | ||
"name": "Questionnaire Enabled Display", | ||
"title": "Questionnaire Enabled Display", | ||
"status": "active", | ||
"item": [ | ||
{ | ||
"linkId": "1", | ||
"text": "Questionnaire Text", | ||
"type": "boolean", | ||
"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": "%resource.repeat(item).where(linkId='1' and answer.empty().not()).select(answer.value) = false" | ||
} | ||
} | ||
], | ||
"linkId": "1.1", | ||
"text": "Text when no is selected", | ||
"type": "display" | ||
}, | ||
{ | ||
"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": "%resource.repeat(item).where(linkId='1' and answer.empty().not()).select(answer.value) = true" | ||
} | ||
} | ||
], | ||
"linkId": "1.2", | ||
"text": "Text when yes is selected", | ||
"type": "display" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.