From 0e144a33865a77fb8a2351472bdfd0c18cbd9ada Mon Sep 17 00:00:00 2001 From: Rostislav Antonov Date: Mon, 2 Dec 2024 17:39:16 +0100 Subject: [PATCH] improve bundle data and ehr emulator --- smart-app-launch/README.md | 4 +- smart-app-launch/aidbox.json | 56 ++++++- smart-app-launch/docker-compose.yaml | 12 +- smart-app-launch/ehr.html | 214 +++++++++++---------------- 4 files changed, 150 insertions(+), 136 deletions(-) diff --git a/smart-app-launch/README.md b/smart-app-launch/README.md index df81214..ed56a9f 100644 --- a/smart-app-launch/README.md +++ b/smart-app-launch/README.md @@ -7,14 +7,14 @@ docker compose up ``` aidbox - http://localhost:8080 -keycloak - http://localhost:88888 +keycloak - http://localhost:8888 growth-chart - http://localhost:9000 ## EHR launch ### Patient launch -Open http://localhost:7070 (ehr emulator) +Open http://localhost:7070/ehr.html (ehr emulator) Need launch uri diff --git a/smart-app-launch/aidbox.json b/smart-app-launch/aidbox.json index 8c2c56e..1475f7b 100644 --- a/smart-app-launch/aidbox.json +++ b/smart-app-launch/aidbox.json @@ -1,5 +1,5 @@ { - "type": "transaction", + "type": "batch", "entry": [ { "request": { @@ -27,6 +27,41 @@ ] } }, + { + "request": { + "method": "PUT", + "url": "/Client/ehr" + }, + "resource": { + "id": "ehr", + "secret": "verysecret", + "grant_types": [ + "basic" + ], + "resourceType": "Client" + } + }, + { + "request": { + "method": "PUT", + "url": "/AccessPolicy/demo-clients-allow" + }, + "resource": { + "id": "demo-clients-allow", + "link": [ + { + "id": "ehr", + "resourceType": "Client" + }, + { + "id": "growth_chart", + "resourceType": "Client" + } + ], + "engine": "allow", + "resourceType": "AccessPolicy" + } + }, { "request": { "method": "PUT", @@ -51,6 +86,25 @@ "token_endpoint": "http://keycloak:8888/realms/patients/protocol/openid-connect/token", "userinfo-source": "id-token" } + }, + + { + "request": { + "method": "POST", + "url": "/Patient/$load" + }, + "resource": { + "source": "https://storage.googleapis.com/aidbox-public/synthea/v2/100/fhir/Patient.ndjson.gz" + } + }, + { + "request": { + "method": "POST", + "url": "/Observation/$load" + }, + "resource": { + "source": "https://storage.googleapis.com/aidbox-public/synthea/v2/100/fhir/Observation.ndjson.gz" + } } ] } diff --git a/smart-app-launch/docker-compose.yaml b/smart-app-launch/docker-compose.yaml index 8c698bf..f44f9ae 100644 --- a/smart-app-launch/docker-compose.yaml +++ b/smart-app-launch/docker-compose.yaml @@ -22,9 +22,17 @@ services: KC_BOOTSTRAP_ADMIN_USERNAME: admin KC_BOOTSTRAP_ADMIN_PASSWORD: admin command: start-dev --import-realm + + ehr: + image: nginx:alpine + ports: + - "7070:80" + volumes: + - ./ehr.html:/usr/share/nginx/html/ehr.html:ro aidbox_db: image: healthsamurai/aidboxdb:17 + pull_policy: always volumes: - aidbox_pg_data:/data:delegated environment: @@ -36,6 +44,7 @@ services: aidbox: image: healthsamurai/aidboxone:edge + pull_policy: always depends_on: - aidbox_db ports: @@ -44,17 +53,14 @@ services: - ./aidbox.json:/tmp/aidbox.json environment: BOX_INIT_BUNDLE: file:///tmp/aidbox.json - AIDBOX_TERMINOLOGY_SERVICE_BASE_URL: https://tx.fhir.org/r4 AIDBOX_FHIR_PACKAGES: hl7.fhir.r4.core#4.0.1 AIDBOX_FHIR_SCHEMA_VALIDATION: true AIDBOX_CREATED_AT_URL: https://aidbox.app/ex/createdAt AIDBOX_CLIENT_SECRET: vbDPgXnz0H - AIDBOX_CORRECT_AIDBOX_FORMAT: true AIDBOX_ADMIN_PASSWORD: password AIDBOX_COMPLIANCE: enabled BOX_SEARCH_FHIR__COMPARISONS: true PGHOST: aidbox_db - BOX_COMPATIBILITY_VALIDATION_JSON__SCHEMA_REGEX: '#{:fhir-datetime}' PGUSER: aidbox AIDBOX_PORT: 8080 PGDATABASE: aidbox diff --git a/smart-app-launch/ehr.html b/smart-app-launch/ehr.html index 886a5e2..0583b53 100644 --- a/smart-app-launch/ehr.html +++ b/smart-app-launch/ehr.html @@ -7,152 +7,106 @@

EHR Emulator

-
-

Login

-
-
- -
-