sdc-qrf 0.1.3 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/lib/components.d.ts +3 -3
  2. package/lib/components.js +12 -12
  3. package/lib/components.js.map +1 -1
  4. package/lib/context.d.ts +0 -1
  5. package/lib/converter/extensions.d.ts +35 -0
  6. package/lib/converter/extensions.js +128 -0
  7. package/lib/converter/extensions.js.map +1 -0
  8. package/lib/converter/fceToFhir/index.d.ts +4 -0
  9. package/lib/converter/fceToFhir/index.js +15 -0
  10. package/lib/converter/fceToFhir/index.js.map +1 -0
  11. package/lib/converter/fceToFhir/questionnaire/index.d.ts +3 -0
  12. package/lib/converter/fceToFhir/questionnaire/index.js +17 -0
  13. package/lib/converter/fceToFhir/questionnaire/index.js.map +1 -0
  14. package/lib/converter/fceToFhir/questionnaire/processExtensions.d.ts +3 -0
  15. package/lib/converter/fceToFhir/questionnaire/processExtensions.js +61 -0
  16. package/lib/converter/fceToFhir/questionnaire/processExtensions.js.map +1 -0
  17. package/lib/converter/fceToFhir/questionnaire/processItems.d.ts +3 -0
  18. package/lib/converter/fceToFhir/questionnaire/processItems.js +144 -0
  19. package/lib/converter/fceToFhir/questionnaire/processItems.js.map +1 -0
  20. package/lib/converter/fceToFhir/questionnaire/processMeta.d.ts +3 -0
  21. package/lib/converter/fceToFhir/questionnaire/processMeta.js +20 -0
  22. package/lib/converter/fceToFhir/questionnaire/processMeta.js.map +1 -0
  23. package/lib/converter/fceToFhir/questionnaireResponse/index.d.ts +3 -0
  24. package/lib/converter/fceToFhir/questionnaireResponse/index.js +20 -0
  25. package/lib/converter/fceToFhir/questionnaireResponse/index.js.map +1 -0
  26. package/lib/converter/fceToFhir/questionnaireResponse/processAnswers.d.ts +2 -0
  27. package/lib/converter/fceToFhir/questionnaireResponse/processAnswers.js +48 -0
  28. package/lib/converter/fceToFhir/questionnaireResponse/processAnswers.js.map +1 -0
  29. package/lib/converter/fceToFhir/questionnaireResponse/processMeta.d.ts +3 -0
  30. package/lib/converter/fceToFhir/questionnaireResponse/processMeta.js +18 -0
  31. package/lib/converter/fceToFhir/questionnaireResponse/processMeta.js.map +1 -0
  32. package/lib/converter/fceToFhir/questionnaireResponse/processReference.d.ts +3 -0
  33. package/lib/converter/fceToFhir/questionnaireResponse/processReference.js +19 -0
  34. package/lib/converter/fceToFhir/questionnaireResponse/processReference.js.map +1 -0
  35. package/lib/converter/fhirToFce/index.d.ts +4 -0
  36. package/lib/converter/fhirToFce/index.js +15 -0
  37. package/lib/converter/fhirToFce/index.js.map +1 -0
  38. package/lib/converter/fhirToFce/questionnaire/index.d.ts +3 -0
  39. package/lib/converter/fhirToFce/questionnaire/index.js +21 -0
  40. package/lib/converter/fhirToFce/questionnaire/index.js.map +1 -0
  41. package/lib/converter/fhirToFce/questionnaire/processExtensions.d.ts +8 -0
  42. package/lib/converter/fhirToFce/questionnaire/processExtensions.js +89 -0
  43. package/lib/converter/fhirToFce/questionnaire/processExtensions.js.map +1 -0
  44. package/lib/converter/fhirToFce/questionnaire/processItems.d.ts +3 -0
  45. package/lib/converter/fhirToFce/questionnaire/processItems.js +131 -0
  46. package/lib/converter/fhirToFce/questionnaire/processItems.js.map +1 -0
  47. package/lib/converter/fhirToFce/questionnaire/processMeta.d.ts +32 -0
  48. package/lib/converter/fhirToFce/questionnaire/processMeta.js +14 -0
  49. package/lib/converter/fhirToFce/questionnaire/processMeta.js.map +1 -0
  50. package/lib/converter/fhirToFce/questionnaireResponse/index.d.ts +3 -0
  51. package/lib/converter/fhirToFce/questionnaireResponse/index.js +20 -0
  52. package/lib/converter/fhirToFce/questionnaireResponse/index.js.map +1 -0
  53. package/lib/converter/fhirToFce/questionnaireResponse/processAnswers.d.ts +2 -0
  54. package/lib/converter/fhirToFce/questionnaireResponse/processAnswers.js +46 -0
  55. package/lib/converter/fhirToFce/questionnaireResponse/processAnswers.js.map +1 -0
  56. package/lib/converter/fhirToFce/questionnaireResponse/processMeta.d.ts +3 -0
  57. package/lib/converter/fhirToFce/questionnaireResponse/processMeta.js +15 -0
  58. package/lib/converter/fhirToFce/questionnaireResponse/processMeta.js.map +1 -0
  59. package/lib/converter/fhirToFce/questionnaireResponse/processReference.d.ts +3 -0
  60. package/lib/converter/fhirToFce/questionnaireResponse/processReference.js +18 -0
  61. package/lib/converter/fhirToFce/questionnaireResponse/processReference.js.map +1 -0
  62. package/lib/converter/fhirToFce/utils.d.ts +3 -0
  63. package/lib/converter/fhirToFce/utils.js +37 -0
  64. package/lib/converter/fhirToFce/utils.js.map +1 -0
  65. package/lib/converter/index.d.ts +12 -0
  66. package/lib/converter/index.js +84 -0
  67. package/lib/converter/index.js.map +1 -0
  68. package/lib/index.d.ts +1 -0
  69. package/lib/index.js +1 -0
  70. package/lib/index.js.map +1 -1
  71. package/lib/setupTests.d.ts +1 -0
  72. package/lib/setupTests.js +4 -0
  73. package/lib/setupTests.js.map +1 -0
  74. package/lib/types.d.ts +10 -10
  75. package/lib/utils.d.ts +4 -1
  76. package/lib/utils.js +9 -2
  77. package/lib/utils.js.map +1 -1
  78. package/package.json +4 -5
  79. package/src/components.tsx +12 -12
  80. package/src/converter/__tests__/fce.test.ts +224 -0
  81. package/src/converter/__tests__/resources/questionnaire_fce/allergies.json +405 -0
  82. package/src/converter/__tests__/resources/questionnaire_fce/beverages.json +72 -0
  83. package/src/converter/__tests__/resources/questionnaire_fce/choice_answer_option.json +53 -0
  84. package/src/converter/__tests__/resources/questionnaire_fce/consent.json +86 -0
  85. package/src/converter/__tests__/resources/questionnaire_fce/enable_when.json +103 -0
  86. package/src/converter/__tests__/resources/questionnaire_fce/encounter_create.json +126 -0
  87. package/src/converter/__tests__/resources/questionnaire_fce/gad_7.json +459 -0
  88. package/src/converter/__tests__/resources/questionnaire_fce/immunization.json +182 -0
  89. package/src/converter/__tests__/resources/questionnaire_fce/medication.json +189 -0
  90. package/src/converter/__tests__/resources/questionnaire_fce/multiple_type_launch_context.json +406 -0
  91. package/src/converter/__tests__/resources/questionnaire_fce/patient_create.json +84 -0
  92. package/src/converter/__tests__/resources/questionnaire_fce/patient_edit.json +125 -0
  93. package/src/converter/__tests__/resources/questionnaire_fce/phq_2_phq_9.json +552 -0
  94. package/src/converter/__tests__/resources/questionnaire_fce/physicalexam.json +385 -0
  95. package/src/converter/__tests__/resources/questionnaire_fce/practitioner_create.json +90 -0
  96. package/src/converter/__tests__/resources/questionnaire_fce/practitioner_create_structure_map.json +91 -0
  97. package/src/converter/__tests__/resources/questionnaire_fce/practitioner_edit.json +144 -0
  98. package/src/converter/__tests__/resources/questionnaire_fce/practitioner_role_create.json +37 -0
  99. package/src/converter/__tests__/resources/questionnaire_fce/public_appointment.json +91 -0
  100. package/src/converter/__tests__/resources/questionnaire_fce/review_of_systems.json +389 -0
  101. package/src/converter/__tests__/resources/questionnaire_fce/source_queries.json +34 -0
  102. package/src/converter/__tests__/resources/questionnaire_fce/vitals.json +234 -0
  103. package/src/converter/__tests__/resources/questionnaire_fhir/allergies.json +433 -0
  104. package/src/converter/__tests__/resources/questionnaire_fhir/beverages.json +99 -0
  105. package/src/converter/__tests__/resources/questionnaire_fhir/choice_answer_option.json +49 -0
  106. package/src/converter/__tests__/resources/questionnaire_fhir/consent.json +119 -0
  107. package/src/converter/__tests__/resources/questionnaire_fhir/enable_when.json +87 -0
  108. package/src/converter/__tests__/resources/questionnaire_fhir/encounter_create.json +171 -0
  109. package/src/converter/__tests__/resources/questionnaire_fhir/gad_7.json +489 -0
  110. package/src/converter/__tests__/resources/questionnaire_fhir/immunization.json +215 -0
  111. package/src/converter/__tests__/resources/questionnaire_fhir/medication.json +226 -0
  112. package/src/converter/__tests__/resources/questionnaire_fhir/multiple_type_launch_context.json +416 -0
  113. package/src/converter/__tests__/resources/questionnaire_fhir/patient_create.json +97 -0
  114. package/src/converter/__tests__/resources/questionnaire_fhir/patient_edit.json +183 -0
  115. package/src/converter/__tests__/resources/questionnaire_fhir/phq_2_phq_9.json +580 -0
  116. package/src/converter/__tests__/resources/questionnaire_fhir/physicalexam.json +544 -0
  117. package/src/converter/__tests__/resources/questionnaire_fhir/practitioner_create.json +87 -0
  118. package/src/converter/__tests__/resources/questionnaire_fhir/practitioner_create_structure_map.json +91 -0
  119. package/src/converter/__tests__/resources/questionnaire_fhir/practitioner_edit.json +193 -0
  120. package/src/converter/__tests__/resources/questionnaire_fhir/practitioner_role_create.json +44 -0
  121. package/src/converter/__tests__/resources/questionnaire_fhir/public_appointment.json +116 -0
  122. package/src/converter/__tests__/resources/questionnaire_fhir/review_of_systems.json +368 -0
  123. package/src/converter/__tests__/resources/questionnaire_fhir/source_queries.json +37 -0
  124. package/src/converter/__tests__/resources/questionnaire_fhir/vitals.json +317 -0
  125. package/src/converter/__tests__/resources/questionnaire_response_fce/allergies_inprogress.json +78 -0
  126. package/src/converter/__tests__/resources/questionnaire_response_fce/cardiology.json +96 -0
  127. package/src/converter/__tests__/resources/questionnaire_response_fce/few_answers.json +48 -0
  128. package/src/converter/__tests__/resources/questionnaire_response_fce/gad_7.json +165 -0
  129. package/src/converter/__tests__/resources/questionnaire_response_fce/immunization.json +86 -0
  130. package/src/converter/__tests__/resources/questionnaire_response_fce/medication.json +116 -0
  131. package/src/converter/__tests__/resources/questionnaire_response_fce/new_appointment.json +96 -0
  132. package/src/converter/__tests__/resources/questionnaire_response_fce/patient.json +87 -0
  133. package/src/converter/__tests__/resources/questionnaire_response_fce/phq_2_phq_9.json +193 -0
  134. package/src/converter/__tests__/resources/questionnaire_response_fce/physicalexam.json +187 -0
  135. package/src/converter/__tests__/resources/questionnaire_response_fce/practitioner.json +57 -0
  136. package/src/converter/__tests__/resources/questionnaire_response_fce/reference_answer_with_assoc.json +147 -0
  137. package/src/converter/__tests__/resources/questionnaire_response_fce/review_of_systems.json +129 -0
  138. package/src/converter/__tests__/resources/questionnaire_response_fce/vitals.json +168 -0
  139. package/src/converter/__tests__/resources/questionnaire_response_fhir/allergies_inprogress.json +73 -0
  140. package/src/converter/__tests__/resources/questionnaire_response_fhir/cardiology.json +87 -0
  141. package/src/converter/__tests__/resources/questionnaire_response_fhir/few_answers.json +46 -0
  142. package/src/converter/__tests__/resources/questionnaire_response_fhir/gad_7.json +146 -0
  143. package/src/converter/__tests__/resources/questionnaire_response_fhir/immunization.json +77 -0
  144. package/src/converter/__tests__/resources/questionnaire_response_fhir/medication.json +101 -0
  145. package/src/converter/__tests__/resources/questionnaire_response_fhir/new_appointment.json +86 -0
  146. package/src/converter/__tests__/resources/questionnaire_response_fhir/patient.json +78 -0
  147. package/src/converter/__tests__/resources/questionnaire_response_fhir/phq_2_phq_9.json +170 -0
  148. package/src/converter/__tests__/resources/questionnaire_response_fhir/physicalexam.json +158 -0
  149. package/src/converter/__tests__/resources/questionnaire_response_fhir/practitioner.json +54 -0
  150. package/src/converter/__tests__/resources/questionnaire_response_fhir/reference_answer_with_assoc.json +86 -0
  151. package/src/converter/__tests__/resources/questionnaire_response_fhir/review_of_systems.json +118 -0
  152. package/src/converter/__tests__/resources/questionnaire_response_fhir/vitals.json +145 -0
  153. package/src/converter/extensions.ts +149 -0
  154. package/src/converter/fceToFhir/index.ts +27 -0
  155. package/src/converter/fceToFhir/questionnaire/index.ts +15 -0
  156. package/src/converter/fceToFhir/questionnaire/processExtensions.ts +75 -0
  157. package/src/converter/fceToFhir/questionnaire/processItems.ts +194 -0
  158. package/src/converter/fceToFhir/questionnaire/processMeta.ts +19 -0
  159. package/src/converter/fceToFhir/questionnaireResponse/index.ts +21 -0
  160. package/src/converter/fceToFhir/questionnaireResponse/processAnswers.ts +53 -0
  161. package/src/converter/fceToFhir/questionnaireResponse/processMeta.ts +16 -0
  162. package/src/converter/fceToFhir/questionnaireResponse/processReference.ts +24 -0
  163. package/src/converter/fhirToFce/index.ts +27 -0
  164. package/src/converter/fhirToFce/questionnaire/index.ts +25 -0
  165. package/src/converter/fhirToFce/questionnaire/processExtensions.ts +113 -0
  166. package/src/converter/fhirToFce/questionnaire/processItems.ts +159 -0
  167. package/src/converter/fhirToFce/questionnaire/processMeta.ts +17 -0
  168. package/src/converter/fhirToFce/questionnaireResponse/index.ts +21 -0
  169. package/src/converter/fhirToFce/questionnaireResponse/processAnswers.ts +53 -0
  170. package/src/converter/fhirToFce/questionnaireResponse/processMeta.ts +14 -0
  171. package/src/converter/fhirToFce/questionnaireResponse/processReference.ts +20 -0
  172. package/src/converter/fhirToFce/utils.ts +36 -0
  173. package/src/converter/index.ts +106 -0
  174. package/src/index.ts +1 -0
  175. package/src/setupTests.ts +1 -0
  176. package/src/utils.ts +13 -2
@@ -0,0 +1,125 @@
1
+ {
2
+ "meta": {
3
+ "profile": ["https://beda.software/beda-emr-questionnaire"],
4
+ "lastUpdated": "2023-04-10T03:43:34.792167Z",
5
+ "createdAt": "2023-04-05T05:22:35.752466Z",
6
+ "versionId": "694"
7
+ },
8
+ "launchContext": [
9
+ {
10
+ "name": {
11
+ "code": "Patient",
12
+ "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext"
13
+ },
14
+ "type": ["Patient"]
15
+ }
16
+ ],
17
+ "name": "edit-patient",
18
+ "item": [
19
+ {
20
+ "text": "patientId",
21
+ "type": "string",
22
+ "hidden": true,
23
+ "linkId": "patient-id",
24
+ "readOnly": true,
25
+ "initialExpression": {
26
+ "language": "text/fhirpath",
27
+ "expression": "%Patient.id"
28
+ }
29
+ },
30
+ {
31
+ "text": "Last name",
32
+ "type": "string",
33
+ "linkId": "last-name",
34
+ "required": true,
35
+ "initialExpression": {
36
+ "language": "text/fhirpath",
37
+ "expression": "%Patient.name.family"
38
+ }
39
+ },
40
+ {
41
+ "text": "First name",
42
+ "type": "string",
43
+ "linkId": "first-name",
44
+ "initialExpression": {
45
+ "language": "text/fhirpath",
46
+ "expression": "%Patient.name.given[0]"
47
+ }
48
+ },
49
+ {
50
+ "text": "Middle name",
51
+ "type": "string",
52
+ "linkId": "middle-name",
53
+ "initialExpression": {
54
+ "language": "text/fhirpath",
55
+ "expression": "%Patient.name.given[1]"
56
+ }
57
+ },
58
+ {
59
+ "text": "Birth date",
60
+ "type": "date",
61
+ "linkId": "birth-date",
62
+ "initialExpression": {
63
+ "language": "text/fhirpath",
64
+ "expression": "%Patient.birthDate"
65
+ }
66
+ },
67
+ {
68
+ "text": "Gender",
69
+ "type": "choice",
70
+ "linkId": "gender",
71
+ "answerOption": [
72
+ {
73
+ "value": {
74
+ "string": "male"
75
+ }
76
+ },
77
+ {
78
+ "value": {
79
+ "string": "female"
80
+ }
81
+ }
82
+ ],
83
+ "initialExpression": {
84
+ "language": "text/fhirpath",
85
+ "expression": "%Patient.gender"
86
+ }
87
+ },
88
+ {
89
+ "text": "SSN",
90
+ "type": "string",
91
+ "linkId": "ssn",
92
+ "initialExpression": {
93
+ "language": "text/fhirpath",
94
+ "expression": "%Patient.identifier.where(system='1.2.643.100.3').value"
95
+ }
96
+ },
97
+ {
98
+ "text": "Phone number",
99
+ "type": "string",
100
+ "linkId": "mobile",
101
+ "itemControl": {
102
+ "coding": [
103
+ {
104
+ "code": "phoneWidget"
105
+ }
106
+ ]
107
+ },
108
+ "initialExpression": {
109
+ "language": "text/fhirpath",
110
+ "expression": "%Patient.telecom.where(system='phone').value"
111
+ }
112
+ }
113
+ ],
114
+ "mapping": [
115
+ {
116
+ "id": "patient-create",
117
+ "resourceType": "Mapping"
118
+ }
119
+ ],
120
+ "resourceType": "Questionnaire",
121
+ "title": "Edit patient",
122
+ "status": "active",
123
+ "id": "patient-edit",
124
+ "url": "https://aidbox.emr.beda.software/ui/console#/entities/Questionnaire/patient-edit"
125
+ }
@@ -0,0 +1,552 @@
1
+ {
2
+ "subjectType": ["Encounter", "Patient"],
3
+ "meta": {
4
+ "profile": ["https://beda.software/beda-emr-questionnaire"],
5
+ "lastUpdated": "2023-04-10T03:43:34.792167Z",
6
+ "createdAt": "2023-04-05T05:22:35.752466Z",
7
+ "versionId": "694"
8
+ },
9
+ "launchContext": [
10
+ {
11
+ "name": {
12
+ "code": "Patient",
13
+ "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext"
14
+ },
15
+ "type": ["Patient"]
16
+ },
17
+ {
18
+ "name": {
19
+ "code": "Author",
20
+ "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext"
21
+ },
22
+ "type": ["Resource"]
23
+ }
24
+ ],
25
+ "name": "PHQ-2/PHQ-9 Depression Screening",
26
+ "item": [
27
+ {
28
+ "text": "DateTime",
29
+ "type": "dateTime",
30
+ "hidden": true,
31
+ "linkId": "dateTime",
32
+ "initialExpression": {
33
+ "language": "text/fhirpath",
34
+ "expression": "now()"
35
+ }
36
+ },
37
+ {
38
+ "text": "PatientId",
39
+ "type": "string",
40
+ "hidden": true,
41
+ "linkId": "patientId",
42
+ "initialExpression": {
43
+ "language": "text/fhirpath",
44
+ "expression": "%Patient.id"
45
+ }
46
+ },
47
+ {
48
+ "text": "PatientName",
49
+ "type": "string",
50
+ "hidden": true,
51
+ "linkId": "patientName",
52
+ "initialExpression": {
53
+ "language": "text/fhirpath",
54
+ "expression": "%Patient.name.given[0] + ' ' + %Patient.name.family"
55
+ }
56
+ },
57
+ {
58
+ "item": [
59
+ {
60
+ "text": "Little interest or pleasure in doing things",
61
+ "type": "choice",
62
+ "linkId": "44250-9",
63
+ "required": true,
64
+ "itemControl": {
65
+ "coding": [
66
+ {
67
+ "code": "inline-choice"
68
+ }
69
+ ]
70
+ },
71
+ "answerOption": [
72
+ {
73
+ "value": {
74
+ "Coding": {
75
+ "code": "LA6568-5",
76
+ "system": "http://loinc.org",
77
+ "display": "Not at all"
78
+ }
79
+ }
80
+ },
81
+ {
82
+ "value": {
83
+ "Coding": {
84
+ "code": "LA6569-3",
85
+ "system": "http://loinc.org",
86
+ "display": "Several days"
87
+ }
88
+ }
89
+ },
90
+ {
91
+ "value": {
92
+ "Coding": {
93
+ "code": "LA6570-1",
94
+ "system": "http://loinc.org",
95
+ "display": "More than half the days"
96
+ }
97
+ }
98
+ },
99
+ {
100
+ "value": {
101
+ "Coding": {
102
+ "code": "LA6571-9",
103
+ "system": "http://loinc.org",
104
+ "display": "Nearly every day"
105
+ }
106
+ }
107
+ }
108
+ ]
109
+ },
110
+ {
111
+ "text": "Feeling down, depressed, or hopeless",
112
+ "type": "choice",
113
+ "linkId": "44255-8",
114
+ "required": true,
115
+ "itemControl": {
116
+ "coding": [
117
+ {
118
+ "code": "inline-choice"
119
+ }
120
+ ]
121
+ },
122
+ "answerOption": [
123
+ {
124
+ "value": {
125
+ "Coding": {
126
+ "code": "LA6568-5",
127
+ "system": "http://loinc.org",
128
+ "display": "Not at all"
129
+ }
130
+ }
131
+ },
132
+ {
133
+ "value": {
134
+ "Coding": {
135
+ "code": "LA6569-3",
136
+ "system": "http://loinc.org",
137
+ "display": "Several days"
138
+ }
139
+ }
140
+ },
141
+ {
142
+ "value": {
143
+ "Coding": {
144
+ "code": "LA6570-1",
145
+ "system": "http://loinc.org",
146
+ "display": "More than half the days"
147
+ }
148
+ }
149
+ },
150
+ {
151
+ "value": {
152
+ "Coding": {
153
+ "code": "LA6571-9",
154
+ "system": "http://loinc.org",
155
+ "display": "Nearly every day"
156
+ }
157
+ }
158
+ }
159
+ ]
160
+ },
161
+ {
162
+ "text": "Trouble falling or staying asleep, or sleeping too much",
163
+ "type": "choice",
164
+ "linkId": "44259-0",
165
+ "required": true,
166
+ "itemControl": {
167
+ "coding": [
168
+ {
169
+ "code": "inline-choice"
170
+ }
171
+ ]
172
+ },
173
+ "answerOption": [
174
+ {
175
+ "value": {
176
+ "Coding": {
177
+ "code": "LA6568-5",
178
+ "system": "http://loinc.org",
179
+ "display": "Not at all"
180
+ }
181
+ }
182
+ },
183
+ {
184
+ "value": {
185
+ "Coding": {
186
+ "code": "LA6569-3",
187
+ "system": "http://loinc.org",
188
+ "display": "Several days"
189
+ }
190
+ }
191
+ },
192
+ {
193
+ "value": {
194
+ "Coding": {
195
+ "code": "LA6570-1",
196
+ "system": "http://loinc.org",
197
+ "display": "More than half the days"
198
+ }
199
+ }
200
+ },
201
+ {
202
+ "value": {
203
+ "Coding": {
204
+ "code": "LA6571-9",
205
+ "system": "http://loinc.org",
206
+ "display": "Nearly every day"
207
+ }
208
+ }
209
+ }
210
+ ]
211
+ },
212
+ {
213
+ "text": "Feeling tired or having little energy",
214
+ "type": "choice",
215
+ "linkId": "44254-1",
216
+ "required": true,
217
+ "itemControl": {
218
+ "coding": [
219
+ {
220
+ "code": "inline-choice"
221
+ }
222
+ ]
223
+ },
224
+ "answerOption": [
225
+ {
226
+ "value": {
227
+ "Coding": {
228
+ "code": "LA6568-5",
229
+ "system": "http://loinc.org",
230
+ "display": "Not at all"
231
+ }
232
+ }
233
+ },
234
+ {
235
+ "value": {
236
+ "Coding": {
237
+ "code": "LA6569-3",
238
+ "system": "http://loinc.org",
239
+ "display": "Several days"
240
+ }
241
+ }
242
+ },
243
+ {
244
+ "value": {
245
+ "Coding": {
246
+ "code": "LA6570-1",
247
+ "system": "http://loinc.org",
248
+ "display": "More than half the days"
249
+ }
250
+ }
251
+ },
252
+ {
253
+ "value": {
254
+ "Coding": {
255
+ "code": "LA6571-9",
256
+ "system": "http://loinc.org",
257
+ "display": "Nearly every day"
258
+ }
259
+ }
260
+ }
261
+ ]
262
+ },
263
+ {
264
+ "text": "Poor appetite or overeating",
265
+ "type": "choice",
266
+ "linkId": "44251-7",
267
+ "required": true,
268
+ "itemControl": {
269
+ "coding": [
270
+ {
271
+ "code": "inline-choice"
272
+ }
273
+ ]
274
+ },
275
+ "answerOption": [
276
+ {
277
+ "value": {
278
+ "Coding": {
279
+ "code": "LA6568-5",
280
+ "system": "http://loinc.org",
281
+ "display": "Not at all"
282
+ }
283
+ }
284
+ },
285
+ {
286
+ "value": {
287
+ "Coding": {
288
+ "code": "LA6569-3",
289
+ "system": "http://loinc.org",
290
+ "display": "Several days"
291
+ }
292
+ }
293
+ },
294
+ {
295
+ "value": {
296
+ "Coding": {
297
+ "code": "LA6570-1",
298
+ "system": "http://loinc.org",
299
+ "display": "More than half the days"
300
+ }
301
+ }
302
+ },
303
+ {
304
+ "value": {
305
+ "Coding": {
306
+ "code": "LA6571-9",
307
+ "system": "http://loinc.org",
308
+ "display": "Nearly every day"
309
+ }
310
+ }
311
+ }
312
+ ]
313
+ },
314
+ {
315
+ "text": "Feeling bad about yourself-or that you are a failure or have let yourself or your family down",
316
+ "type": "choice",
317
+ "linkId": "44258-2",
318
+ "required": true,
319
+ "itemControl": {
320
+ "coding": [
321
+ {
322
+ "code": "inline-choice"
323
+ }
324
+ ]
325
+ },
326
+ "answerOption": [
327
+ {
328
+ "value": {
329
+ "Coding": {
330
+ "code": "LA6568-5",
331
+ "system": "http://loinc.org",
332
+ "display": "Not at all"
333
+ }
334
+ }
335
+ },
336
+ {
337
+ "value": {
338
+ "Coding": {
339
+ "code": "LA6569-3",
340
+ "system": "http://loinc.org",
341
+ "display": "Several days"
342
+ }
343
+ }
344
+ },
345
+ {
346
+ "value": {
347
+ "Coding": {
348
+ "code": "LA6570-1",
349
+ "system": "http://loinc.org",
350
+ "display": "More than half the days"
351
+ }
352
+ }
353
+ },
354
+ {
355
+ "value": {
356
+ "Coding": {
357
+ "code": "LA6571-9",
358
+ "system": "http://loinc.org",
359
+ "display": "Nearly every day"
360
+ }
361
+ }
362
+ }
363
+ ]
364
+ },
365
+ {
366
+ "text": "Trouble concentrating on things, such as reading the newspaper or watching television",
367
+ "type": "choice",
368
+ "linkId": "44252-5",
369
+ "required": true,
370
+ "itemControl": {
371
+ "coding": [
372
+ {
373
+ "code": "inline-choice"
374
+ }
375
+ ]
376
+ },
377
+ "answerOption": [
378
+ {
379
+ "value": {
380
+ "Coding": {
381
+ "code": "LA6568-5",
382
+ "system": "http://loinc.org",
383
+ "display": "Not at all"
384
+ }
385
+ }
386
+ },
387
+ {
388
+ "value": {
389
+ "Coding": {
390
+ "code": "LA6569-3",
391
+ "system": "http://loinc.org",
392
+ "display": "Several days"
393
+ }
394
+ }
395
+ },
396
+ {
397
+ "value": {
398
+ "Coding": {
399
+ "code": "LA6570-1",
400
+ "system": "http://loinc.org",
401
+ "display": "More than half the days"
402
+ }
403
+ }
404
+ },
405
+ {
406
+ "value": {
407
+ "Coding": {
408
+ "code": "LA6571-9",
409
+ "system": "http://loinc.org",
410
+ "display": "Nearly every day"
411
+ }
412
+ }
413
+ }
414
+ ]
415
+ },
416
+ {
417
+ "text": "Moving or speaking so slowly that other people could have noticed. Or the opposite-being so fidgety or restless that you have been moving around a lot more than usual",
418
+ "type": "choice",
419
+ "linkId": "44253-3",
420
+ "required": true,
421
+ "itemControl": {
422
+ "coding": [
423
+ {
424
+ "code": "inline-choice"
425
+ }
426
+ ]
427
+ },
428
+ "answerOption": [
429
+ {
430
+ "value": {
431
+ "Coding": {
432
+ "code": "LA6568-5",
433
+ "system": "http://loinc.org",
434
+ "display": "Not at all"
435
+ }
436
+ }
437
+ },
438
+ {
439
+ "value": {
440
+ "Coding": {
441
+ "code": "LA6569-3",
442
+ "system": "http://loinc.org",
443
+ "display": "Several days"
444
+ }
445
+ }
446
+ },
447
+ {
448
+ "value": {
449
+ "Coding": {
450
+ "code": "LA6570-1",
451
+ "system": "http://loinc.org",
452
+ "display": "More than half the days"
453
+ }
454
+ }
455
+ },
456
+ {
457
+ "value": {
458
+ "Coding": {
459
+ "code": "LA6571-9",
460
+ "system": "http://loinc.org",
461
+ "display": "Nearly every day"
462
+ }
463
+ }
464
+ }
465
+ ]
466
+ },
467
+ {
468
+ "text": "Thoughts that you would be better off dead, or of hurting yourself in some way",
469
+ "type": "choice",
470
+ "linkId": "44260-8",
471
+ "required": true,
472
+ "itemControl": {
473
+ "coding": [
474
+ {
475
+ "code": "inline-choice"
476
+ }
477
+ ]
478
+ },
479
+ "answerOption": [
480
+ {
481
+ "value": {
482
+ "Coding": {
483
+ "code": "LA6568-5",
484
+ "system": "http://loinc.org",
485
+ "display": "Not at all"
486
+ }
487
+ }
488
+ },
489
+ {
490
+ "value": {
491
+ "Coding": {
492
+ "code": "LA6569-3",
493
+ "system": "http://loinc.org",
494
+ "display": "Several days"
495
+ }
496
+ }
497
+ },
498
+ {
499
+ "value": {
500
+ "Coding": {
501
+ "code": "LA6570-1",
502
+ "system": "http://loinc.org",
503
+ "display": "More than half the days"
504
+ }
505
+ }
506
+ },
507
+ {
508
+ "value": {
509
+ "Coding": {
510
+ "code": "LA6571-9",
511
+ "system": "http://loinc.org",
512
+ "display": "Nearly every day"
513
+ }
514
+ }
515
+ }
516
+ ]
517
+ },
518
+ {
519
+ "text": "PHQ2/PHQ-9 Depression Severity Score",
520
+ "type": "integer",
521
+ "linkId": "phq9-total-score",
522
+ "readOnly": true,
523
+ "required": true,
524
+ "itemControl": {
525
+ "coding": [
526
+ {
527
+ "code": "depression-score"
528
+ }
529
+ ]
530
+ },
531
+ "calculatedExpression": {
532
+ "language": "text/fhirpath",
533
+ "expression": "%QuestionnaireResponse.item.item.answer.children().children().where(code='LA6569-3').count() + %QuestionnaireResponse.item.item.answer.children().children().where(code='LA6570-1').count() * 2 + %QuestionnaireResponse.item.item.answer.children().children().where(code='LA6571-9').count() * 3"
534
+ }
535
+ }
536
+ ],
537
+ "text": "Over the past 2 weeks, how often have you been bothered by:",
538
+ "type": "group",
539
+ "linkId": "phq2phq9"
540
+ }
541
+ ],
542
+ "mapping": [
543
+ {
544
+ "id": "phq2phq9-extract",
545
+ "resourceType": "Mapping"
546
+ }
547
+ ],
548
+ "resourceType": "Questionnaire",
549
+ "status": "active",
550
+ "id": "phq2phq9",
551
+ "url": "https://aidbox.emr.beda.software/ui/console#/entities/Questionnaire/phq2phq9"
552
+ }