Skip to content

Commit

Permalink
Merge branch 'master' of github.com:beda-software/fhir-emr
Browse files Browse the repository at this point in the history
  • Loading branch information
ir4y committed Oct 5, 2023
2 parents 354f016 + c26258b commit bcc1427
Show file tree
Hide file tree
Showing 100 changed files with 1,947 additions and 463 deletions.
2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ services:
- ./zenproject:/app/zenproject
- ./resources/seeds:/app/resources/seeds
scheduling:
image: bedasoftware/aidbox-scheduling-node-app
image: bedasoftware/aidbox-scheduling-node-app:develop
depends_on:
devbox-healthcheck:
condition: service_healthy
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@sentry/browser": "^7.57.0",
"aidbox-react": "^1.7.1",
"antd": "^5.6.4",
"antd-phone-input": "^0.2.2",
"classnames": "^2.3.2",
"fhir-react": "https://github.com/beda-software/fhir-react.git",
"fullcalendar": "^6.1.8",
Expand All @@ -42,7 +43,6 @@
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.2.0",
"react-hook-form": "^7.45.1",
"react-phone-input-2": "^2.15.1",
"react-router-dom": "^6.14.1",
"react-select": "^5.7.3",
"sass": "^1.63.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
patient:
id: patient-1
display: First Patient
resourceType: Patient
category:
- coding:
- code: data-sharing
system: http://terminology.hl7.org/CodeSystem/v3-ActCode
provision:
type: permit
actor:
- role:
coding:
- code: PROV
system: http://terminology.hl7.org/CodeSystem/v3-RoleClass
reference:
id: practitioner1
display: Basic-1 Practitioner
resourceType: Practitioner
action:
- coding:
- code: access
system: http://terminology.hl7.org/CodeSystem/consentaction
period:
start: '2023-09-24'
end: '2030-09-21'
purpose:
- code: CAREMGT
system: http://terminology.hl7.org/CodeSystem/v3-ActReason
display: care management
resourceType: Consent
source:
Reference:
id: patient-1-practitioner1-data-sharing-consent
resourceType: QuestionnaireResponse
scope:
coding:
- code: patient-privacy
system: http://terminology.hl7.org/CodeSystem/consentscope
id: patient-1-practitioner1-data-sharing-consent
status: active
performer:
- id: practitioner
display: John Practitioner
resourceType: Practitioner
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
patient:
id: patient-2
display: Second Patient
resourceType: Patient
category:
- coding:
- code: data-sharing
system: http://terminology.hl7.org/CodeSystem/v3-ActCode
provision:
type: permit
actor:
- role:
coding:
- code: PROV
system: http://terminology.hl7.org/CodeSystem/v3-RoleClass
reference:
id: practitioner2
display: Basic-2 Practitioner
resourceType: Practitioner
action:
- coding:
- code: access
system: http://terminology.hl7.org/CodeSystem/consentaction
period:
start: '2023-09-24'
end: '2030-09-21'
purpose:
- code: CAREMGT
system: http://terminology.hl7.org/CodeSystem/v3-ActReason
display: care management
resourceType: Consent
source:
Reference:
id: patient-2-practitioner2-data-sharing-consent
resourceType: QuestionnaireResponse
scope:
coding:
- code: patient-privacy
system: http://terminology.hl7.org/CodeSystem/consentscope
id: patient-2-practitioner2-data-sharing-consent
status: active
performer:
- id: practitioner
display: John Practitioner
resourceType: Practitioner
13 changes: 9 additions & 4 deletions resources/seeds/HealthCareService/consultation.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
resourceType: HealthcareService
active: true
meta:
profile:
- https://beda.software/beda-emr-healthcare-service
type:
- text: The first appointment
coding:
- code: consultation
system: http://fhir.org/guides/argonaut-scheduling/CodeSystem/visit-type
system: http://beda.software/custom-healthcare-service-list
display: The first appointment
active: true
comment: "A first appointment, often called an initial consultation, is the preliminary meeting between an individual and a professional. This session allows both parties to get acquainted, assess the individual's needs and goals, and set expectations for future interactions. It's a crucial step in building trust and outlining the course of action or treatment. The specifics of the appointment can vary based on the context, from medical assessments to financial planning discussions."
duration: 45
appointmentRequired: true
duration: 45
id: consultation
resourceType: HealthcareService
6 changes: 5 additions & 1 deletion resources/seeds/HealthCareService/follow-up.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ type:
- code: follow-up
system: http://fhir.org/guides/argonaut-scheduling/CodeSystem/visit-type
display: A follow up visit
comment: "A follow-up appointment is a subsequent meeting after an initial consultation or session. It allows professionals and individuals to review progress, address any concerns, and adjust plans or treatments as necessary. These appointments are essential for ensuring continuity of care, monitoring outcomes, and reinforcing the steps or actions discussed during the first meeting. They often serve as checkpoints to gauge effectiveness and make informed decisions moving forward."
appointmentRequired: true
duration: 30
duration: 30
meta:
profile:
- https://beda.software/beda-emr-healthcare-service
5 changes: 4 additions & 1 deletion resources/seeds/Mapping/allergy-extract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ body:
- who:
id: $ author.id
resourceType: $ author.resourceType
display: $ author.name.0.given.0 + " " + author.name.0.family
display:
$switch: $ author.resourceType
Organization: $ author.name
$default: $ author.name.0.given.0 + " " + author.name.0.family
entity:
- role: source
what:
Expand Down
5 changes: 4 additions & 1 deletion resources/seeds/Mapping/consent-extract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ body:
display: $ Patient.name.0.given.0 + ' ' + Patient.name.0.family
author:
reference: $ Author.resourceType + "/" + Author.id
display: $ Author.name.0.given.0 + " " + Author.name.0.family
display:
$switch: $ Author.resourceType
Organization: $ Author.name
$default: $ Author.name.0.given.0 + " " + Author.name.0.family
provision: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='provision').answer.valueCoding").0
$body:
type: transaction
Expand Down
98 changes: 98 additions & 0 deletions resources/seeds/Mapping/data-sharing-consent-extract.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
body:
$let:
qrId: $ fhirpath("QuestionnaireResponse.id")
qrVersion: $ fhirpath("QuestionnaireResponse.meta.versionId")
qrLastUpdated: $ fhirpath("QuestionnaireResponse.meta.lastUpdated")
consentID: $ fhirpath("Provenance.target.where(resourceType='Consent').id").0
practitioner: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='practitioner').answer.valueReference").0
dateStart: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='date-start').answer.valueDate").0
dateEnd: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='date-end').answer.valueDate").0
patient:
reference: $ "Patient/" + Patient.id
display: $ Patient.name.0.given.0 + ' ' + Patient.name.0.family
author:
reference: $ Author.resourceType + "/" + Author.id
display:
$switch: $ Author.resourceType
Organization: $ Author.name
$default: $ Author.name.0.given.0 + " " + Author.name.0.family
provision: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='provision').answer.valueCoding").0
$body:
type: transaction
entry:
- request:
$if: $ consentID
$then:
url: $ "/fhir/Consent/" + consentID
method: PUT
$else:
url: /fhir/Consent
method: POST
fullUrl: urn:uuid:cf3923f0-2eaa-4feb-94eb-3a3db62f0705
resource:
resourceType: Consent
status:
$switch: $ provision.code
permit: active
$default: inactive
patient: $ patient
scope:
coding:
- code: patient-privacy
system: http://terminology.hl7.org/CodeSystem/consentscope
performer:
- $ author
sourceReference:
reference: $ "QuestionnaireResponse/" + qrId
category:
- coding:
- code: data-sharing
system: http://terminology.hl7.org/CodeSystem/v3-ActCode
provision:
period:
start: $ dateStart
end: $ dateEnd
type: $ provision.code
actor:
- role:
coding:
- code: PROV
system: http://terminology.hl7.org/CodeSystem/v3-RoleClass
reference: $ practitioner
action:
- coding:
- code: access
system: http://terminology.hl7.org/CodeSystem/consentaction
purpose:
- code: CAREMGT
system: http://terminology.hl7.org/CodeSystem/v3-ActReason
display: care management
- request:
url: /fhir/Provenance
method: POST
resource:
resourceType: Provenance
target:
- uri: urn:uuid:cf3923f0-2eaa-4feb-94eb-3a3db62f0705
recorded: $ qrLastUpdated
activity:
$if: $ consentID
$then:
coding:
- code: 'UPDATE'
display: 'revise'
system: 'http://terminology.hl7.org/CodeSystem/v3-DataOperation'
$else:
coding:
- code: 'CREATE'
display: 'create'
system: 'http://terminology.hl7.org/CodeSystem/v3-DataOperation'
agent:
- who: $ author
entity:
- role: source
what:
uri: $ "QuestionnaireResponse/" + qrId + "/_history/" + qrVersion
resourceType: Bundle
id: data-sharing-consent-extract
resourceType: Mapping
39 changes: 28 additions & 11 deletions resources/seeds/Mapping/edit-appointment-extract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ body:
selectedPatientReference: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='patient').answer.valueReference").0
selectedPractitionerRoleReference: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='practitioner-role').answer.valueReference").0
startDateTime: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='start-datetime').answer.valueDateTime").0
serviceTypeCoding: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='service-type').answer.valueCoding").0
selectedHealthcareServiceReference: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='service-type').answer.valueReference").0
$body:
$let:
selectedPatientReferenceSplit:
Expand All @@ -19,6 +19,11 @@ body:
$args:
- $ selectedPractitionerRoleReference.reference
- "/"
selectedHealthcareServiceReferenceSplit:
$call: splitStr
$args:
- $ selectedHealthcareServiceReference.reference
- "/"
$body:
resourceType: Bundle
type: batch
Expand All @@ -38,18 +43,30 @@ body:
resourceType: Appointment
participant:
- actor:
resourceType: $ selectedPatientReferenceSplit.0
id: $ selectedPatientReferenceSplit.1
display: $ selectedPatientReference.display
$if: $ selectedPatientReference
$then:
resourceType: $ selectedPatientReferenceSplit.0
id: $ selectedPatientReferenceSplit.1
display: $ selectedPatientReference.display
$else:
id: $ patientId
resourceType: Patient
status: accepted
- actor:
$if: $ selectedPractitionerRoleReference
$then:
resourceType: $ selectedPractitionerRoleReferenceSplit.0
id: $ selectedPractitionerRoleReferenceSplit.1
display: $ selectedPractitionerRoleReference.display
$else:
resourceType: PractitionerRole
id: $ practitionerRoleId
display: $ predefinedPractitionerRoleDisplay
status: accepted
- actor:
resourceType: $ selectedPractitionerRoleReferenceSplit.0
id: $ selectedPractitionerRoleReferenceSplit.1
display: $ selectedPractitionerRoleReference.display
resourceType: $ selectedHealthcareServiceReferenceSplit.0
id: $ selectedHealthcareServiceReferenceSplit.1
display: $ selectedHealthcareServiceReference.display
status: accepted
serviceType:
- text: $ serviceTypeCoding.display
coding:
- $ serviceTypeCoding
status: pending
start: $ startDateTime
5 changes: 4 additions & 1 deletion resources/seeds/Mapping/gad-7-extract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ body:
- who:
id: $ author.id
resourceType: $ author.resourceType
display: $ author.name.0.given.0 + " " + author.name.0.family
display:
$switch: $ author.resourceType
Organization: $ author.name
$default: $ author.name.0.given.0 + " " + author.name.0.family
entity:
- role: source
what:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
body:
$let:
healthcareServiceId: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='healthcareServiceId').answer.valueString").0
activity: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='activity').answer.valueBoolean").0
$body:
type: transaction
entry:
- request:
url: $ "/HealthcareService/" + healthcareServiceId
method: PATCH
resource:
active:
$switch: $ activity
true: false
false: true
resourceType: Bundle
id: healthcare-service-change-activity-extract
resourceType: Mapping

0 comments on commit bcc1427

Please sign in to comment.