Skip to content

Commit 9aadb83

Browse files
authored
Merge pull request #16 from mlaletina95/calculated-options
Add calculated-options
2 parents 79f9d28 + 5f4a987 commit 9aadb83

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
resourceType: Questionnaire
2+
id: calculated-options
3+
name: calculated-options
4+
title: Calculated options
5+
status: active
6+
url: "http://example.org/fhir/Questionnaire/calculated-options"
7+
meta:
8+
profile:
9+
- https://emr-core.beda.software/StructureDefinition/fhir-emr-questionnaire
10+
item:
11+
- linkId: calculated-section
12+
text: CalculatedExpression examples (different answer types)
13+
type: group
14+
item:
15+
- linkId: given-name
16+
text: Given name
17+
type: string
18+
entryFormat: Enter given name
19+
20+
- linkId: family-name
21+
text: Family name
22+
type: string
23+
entryFormat: Enter family name
24+
25+
- linkId: full-name
26+
text: Full name (calculated string)
27+
type: string
28+
readOnly: true
29+
calculatedExpression:
30+
language: text/fhirpath
31+
expression: >-
32+
%resource.repeat(item).where(linkId='given-name').answer.valueString.first() &
33+
' ' &
34+
%resource.repeat(item).where(linkId='family-name').answer.valueString.first()
35+
36+
- linkId: names-complete
37+
text: Both name fields answered (calculated boolean)
38+
type: boolean
39+
readOnly: true
40+
calculatedExpression:
41+
language: text/fhirpath
42+
expression: >-
43+
iif(
44+
%resource.repeat(item).where(linkId='given-name').answer.valueString.exists() and
45+
%resource.repeat(item).where(linkId='family-name').answer.valueString.exists(),
46+
true,
47+
false
48+
)

0 commit comments

Comments
 (0)