Skip to content

Commit 4a2f857

Browse files
committed
Fixed questionnaires
1 parent c92a8a2 commit 4a2f857

28 files changed

Lines changed: 1097 additions & 911 deletions

contrib/fhir-emr

Submodule fhir-emr updated 191 files

env/aidbox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ BOX_FEATURES_FTR_PULL_ENABLE=false
2626
AIDBOX_SDC_ENABLED=false
2727

2828
AIDBOX_FHIR_SCHEMA_VALIDATION=true
29-
AIDBOX_FHIR_PACKAGES=hl7.fhir.r4b.core#4.3.0:hl7.fhir.ph.core.r4b#0.1.0
29+
AIDBOX_FHIR_PACKAGES=hl7.fhir.r4b.core#4.3.0
3030
AIDBOX_TERMINOLOGY_SERVICE_BASE_URL="https://tx.health-samurai.io/fhir"
3131

3232
BOX_INIT_BUNDLE="file:///resources/seeds/initBundle.json"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
query: |-
2+
SELECT
3+
resource || jsonb_build_object('resourceType', 'Provenance', 'id', id)
4+
AS resource FROM provenance WHERE EXISTS (
5+
SELECT 1
6+
FROM jsonb_array_elements(resource->'entity') AS entity
7+
WHERE entity->'what'->>'uri' LIKE '%' || {{params.source}} || '%'
8+
OR
9+
(
10+
entity->'what'->>'id' LIKE '%' || split_part({{params.source}}, '/', 2) || '%'
11+
AND
12+
entity->'what'->>'resourceType' LIKE '%' || split_part({{params.source}}, '/', 1) || '%'
13+
)
14+
)
15+
params:
16+
source:
17+
type: string
18+
isRequired: true
19+
id: provenance-by-source
20+
resourceType: AidboxQuery
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
query: |-
2+
SELECT
3+
resource || jsonb_build_object('resourceType', 'Provenance', 'id', id) AS resource
4+
FROM provenance WHERE
5+
resource @> ('{"target":[{"id":"' || {{params.target}} || '"}]}')::jsonb
6+
ORDER BY resource#>>'{recorded}' DESC LIMIT 1
7+
params:
8+
target:
9+
type: string
10+
isRequired: true
11+
id: provenance-by-target-id
12+
resourceType: AidboxQuery
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
query: >-
2+
select resource || jsonb_build_object('resourceType', 'Provenance', 'id', id)
3+
as resource from provenance where
4+
array_to_string(knife_extract_text(resource,'[["target","uri"]]'),'') like
5+
{{params.target}}
6+
params:
7+
source:
8+
type: string
9+
format: "%%%s%%"
10+
isRequired: true
11+
id: provenance-by-target
12+
resourceType: AidboxQuery

resources/seeds/Patient/patient1.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

resources/seeds/Practitioner/practitioner-single-ex.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
resourceType: Practitioner
22
id: practitioner-single-ex
3+
active: true
34
meta:
45
profile:
56
- "urn://example.com/ph-core/fhir/StructureDefinition/ph-core-practitioner"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
code:
2+
- coding:
3+
- code: "6868009"
4+
system: http://snomed.info/sct
5+
display: Hospital administrator
6+
practitioner:
7+
reference: Practitioner/practitioner-single-ex
8+
id: receptionist
9+
resourceType: PractitionerRole
Lines changed: 71 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,80 @@
1-
id: encounter-create-connectathon
2-
resourceType: Questionnaire
3-
name: encounter-create-connectathon
4-
title: Encounter create PH
5-
url: encounter-create
6-
status: active
71
subjectType:
82
- Patient
9-
# mapping:
10-
# - id: encounter-create
11-
# resourceType: Mapping
12-
launchContext:
13-
- name:
14-
code: Patient
15-
type:
16-
- Patient
3+
meta:
4+
profile:
5+
- https://emr-core.beda.software/StructureDefinition/fhir-emr-questionnaire
6+
name: encounter-create-connectathon
177
item:
18-
- linkId: patientId
19-
text: PatientId
20-
type: string
21-
hidden: true
22-
initialExpression:
23-
language: text/fhirpath
24-
expression: "%Patient.id"
25-
- linkId: patientName
26-
text: PatientName
27-
type: string
28-
readOnly: true
29-
initialExpression:
30-
language: text/fhirpath
31-
expression: "%Patient.name.first().given.first() + ' ' + %Patient.name.first().family"
32-
- linkId: practitioner-role
33-
text: Practitioner
8+
- text: Patient
9+
type: reference
10+
linkId: patient
11+
extension:
12+
- url: >-
13+
http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-choiceColumn
14+
extension:
15+
- url: path
16+
valueString: >-
17+
name.given.first() + ' ' + name.family
18+
- url: forDisplay
19+
valueBoolean: true
20+
- url: >-
21+
http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-answerExpression
22+
valueExpression:
23+
language: application/x-fhir-query
24+
expression: Patient
25+
- url: >-
26+
http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource
27+
valueCode: Patient
28+
- text: Practitioner
3429
type: reference
35-
referenceResource:
36-
- PractitionerRole
30+
linkId: practitioner-role
3731
required: true
38-
answerExpression:
39-
language: application/x-fhir-query
40-
expression: "PractitionerRole?_assoc=practitioner"
41-
choiceColumn:
42-
- forDisplay: true
43-
path: >-
44-
practitioner.resource.name.given.first() + ' ' +
45-
practitioner.resource.name.family + ' - ' + specialty.first().coding.display
46-
- linkId: service
47-
text: Service
32+
extension:
33+
- url: >-
34+
http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-choiceColumn
35+
extension:
36+
- url: path
37+
valueString: >-
38+
practitioner.resource.name.given.first() + ' ' +
39+
practitioner.resource.name.family
40+
- url: forDisplay
41+
valueBoolean: true
42+
- url: >-
43+
http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-answerExpression
44+
valueExpression:
45+
language: application/x-fhir-query
46+
expression: PractitionerRole?_assoc=practitioner
47+
- url: >-
48+
http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource
49+
valueCode: PractitionerRole
50+
- text: Service
4851
type: choice
49-
required: true
52+
linkId: service
5053
repeats: false
54+
required: true
5155
answerOption:
52-
- value:
53-
Coding:
54-
system: http://fhir.org/guides/argonaut-scheduling/CodeSystem/visit-type
55-
code: consultation
56-
display: The first appointment
57-
- value:
58-
Coding:
59-
system: http://fhir.org/guides/argonaut-scheduling/CodeSystem/visit-type
60-
code: follow-up
61-
display: A follow up visit
62-
- linkId: date
63-
text: Date
56+
- valueCoding:
57+
code: consultation
58+
system: http://fhir.org/guides/argonaut-scheduling/CodeSystem/visit-type
59+
display: The first appointment
60+
- valueCoding:
61+
code: follow-up
62+
system: http://fhir.org/guides/argonaut-scheduling/CodeSystem/visit-type
63+
display: A follow up visit
64+
- text: Date
6465
type: dateTime
65-
initialExpression:
66-
language: text/fhirpath
67-
expression: "now()"
68-
# meta:
69-
# profile:
70-
# - https://emr-core.beda.software/StructureDefinition/fhir-emr-questionnaire
66+
linkId: date
67+
extension:
68+
- url: >-
69+
http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression
70+
valueExpression:
71+
language: text/fhirpath
72+
expression: now()
73+
resourceType: Questionnaire
74+
title: Encounter create PH
75+
# - url: http://beda.software/fhir-extensions/questionnaire-mapper
76+
# valueReference:
77+
# reference: Mapping/encounter-create-connectathon
78+
status: active
79+
id: encounter-create-connectathon
80+
url: encounter-create

0 commit comments

Comments
 (0)