Skip to content

Commit

Permalink
Update dev env and readme. Closes #87
Browse files Browse the repository at this point in the history
  • Loading branch information
ruscoder committed Oct 26, 2024
1 parent 3a305e8 commit bf715cd
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 40 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ coverage
htmlcov
examples/.env
.vscode
.history

# Project-specific files
sentry.properties
.env.test.local
sdc-qrf/lib/

zen-packages/
26 changes: 3 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
Reactive IDE for Advanced Clinical Forms Builder based on Structured Data Capture Implementation Guide from HL7 ([SDC](https://build.fhir.org/ig/HL7/sdc/))

Live demo http://sdc.beda.software/.
Devdays talk about SDC and SDC IDE https://www.youtube.com/watch?v=6zzpfb7az_c.
Devdays talk about SDC and SDC IDE https://www.youtube.com/watch?v=6zzpfb7az_c.

### local launch
To check the app please go to [examples](examples) folder and follow readme.
Mobile questionnaire tester app is WIP.
Exteranl plugable rendering is WIP.

To check the app please go to [examples](examples) folder and follow readme.

## Development mode

Expand All @@ -17,30 +16,11 @@ Exteranl plugable rendering is WIP.
```sh
yarn start # start watch all workspaces
yarn start:web # start watch web workspace
yarn start:mobile # start watch mobile workspace
```

### yarn test

```sh
yarn test # launch tests for all workspaces
yarn test:web # launch tests for web workspace
yarn test:mobile # launch tests for mobile workspace
```

## Troubleshooting

- Do not forget to add mobile native dependencies to `frontend/package.json` to workspaces/nohoist section

```json
"nohoist": [
"**/react-native",
"**/react-native/**",
"**/react-native-navigation",
"**/react-native-navigation/**"
]
```

You can see this error in cli in this case

`ERROR Invariant Violation: No callback found with cbID...`
3 changes: 1 addition & 2 deletions examples/.env.tpl
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
AIDBOX_LICENSE_ID=
AIDBOX_LICENSE_KEY=
AIDBOX_LICENSE=
10 changes: 3 additions & 7 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@
### Setup environment variables

- Copy .env.tpl to .env
- Specify **AIDBOX_LICENSE_ID** and **AIDBOX_LICENSE_KEY** (You can get key and id from the [https://license-ui.aidbox.app/](https://license-ui.aidbox.app/))
- Specify **AIDBOX_LICENSE** (You can get key and id from the [https://aidbox.app/](https://aidbox.app/))

## Development

```
docker-compose -f docker-compose.dev.yaml up
docker compose -f docker-compose.dev.yaml up
```

### Load demo data

```
curl -u root:secret 'http://localhost:9000/$load' -H 'content-type: application/json' --request POST --data '{"source":"https://sdc.beda.software/demo-data.ndjson.gz"}'
```
Open `http://localhost:3001` and follow the sign in process.
30 changes: 30 additions & 0 deletions examples/devenv/aidbox
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
AIDBOX_ZEN_DEV_MODE=enable
AIDBOX_ZEN_ENTRYPOINT=system/box
BOX_PROJECT_GIT_TARGET__PATH=/zenproject
AIDBOX_ZEN_PROJECT=/zenproject
AIDBOX_CORRECT_AIDBOX_FORMAT=true

AIDBOX_CLIENT_ID=root
AIDBOX_CLIENT_SECRET=secret
AIDBOX_ADMIN_PASSWORD=password

AIDBOX_BASE_URL=http://localhost:8080
AIDBOX_PORT=8080
AIDBOX_FHIR_VERSION=4.0.0

AIDBOX_STDOUT_PRETTY=all

BOX_FEATURES_FTR_PULL_ENABLE=false
AIDBOX_SDC_ENABLED=false

PGHOST=devbox-db
PGDATABASE=devbox
PGPORT=5432
PGUSER=postgres
PGPASSWORD=postgres

OPENID_RSA=/var/config/jwtRS256.key
OPENID_RSA_PUB=/var/config/jwtRS256.key.pub

SDC_IDE_AUTH_URL="http://localhost:3001/auth"

14 changes: 14 additions & 0 deletions examples/devenv/sdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
APP_INIT_CLIENT_ID=root
APP_INIT_CLIENT_SECRET=secret
APP_INIT_URL=http://devbox:8080

APP_ID=sdc
APP_SECRET=secret
APP_URL=http://sdc:8081
APP_PORT=8081
AIO_PORT=8081
AIO_HOST=0.0.0.0

CREATE_MANIFEST_ATTRS="False"

FHIRPATH_MAPPING_SERVICE=http://fhirpath_mapping:8090/parse-template
Binary file added examples/devzenproject/demo-data.ndjson.gz
Binary file not shown.
2 changes: 2 additions & 0 deletions examples/devzenproject/zen-package.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{:deps {beda-emr-core "https://github.com/beda-software/beda-emr-core.git"
hl7-fhir-r4-core "https://github.com/zen-fhir/hl7-fhir-r4-core.git"}}
31 changes: 31 additions & 0 deletions examples/devzenproject/zrc/system.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ns system
import #{aidbox
aidbox.rest
aidbox.search-parameter.v1
aidbox.repository.v1
beda-emr-core.questionnaire
hl7-fhir-r4-core
zen.fhir}

box
{:zen/tags #{aidbox/system}
:zen/desc "SDC IDE"
:services {:demo-data demo-data
:seed-fixtures seed-fixtures}}

demo-data
{:zen/tags #{aidbox/service}
:engine aidbox/seed
:files ["demo-data.ndjson.gz"]}

seed-fixtures
{:zen/tags #{aidbox/service}
:engine aidbox/seed-v2
:resources
{:Client {:sdc-ide {:auth {:implicit {:redirect_uri #env SDC_IDE_AUTH_URL}}
:first_party true
:grant_types [:implicit]}}
:Attribute {:Mapping.type {:type {:resourceType "Entity" :id "code"}
:path [:type]
:resource {:resourceType "Entity" :id "Mapping"}
:enum ["JUTE" "FHIRPath"]}}}}}
24 changes: 16 additions & 8 deletions examples/docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
version: '3.1'
services:
backend:
image: bedasoftware/aidbox-sdc:latest
sdc:
image: bedasoftware/fhir-sdc:latest
depends_on:
devbox-healthcheck:
condition:
service_healthy
links:
- devbox
env_file:
- .env.base
- .env
- devenv/sdc
volumes:
- ./config:/var/config:cached
# Colored logs
Expand All @@ -28,21 +27,30 @@ services:
timeout: 20s
retries: 100
devbox:
image: healthsamurai/devbox:edge
image: healthsamurai/aidboxone:stable
depends_on:
- devbox-db
links:
- devbox-db:database
env_file:
- .env.base
- devenv/aidbox
- .env
volumes:
- ./config:/var/config:cached
- ./devzenproject:/zenproject
ports:
- 9000:8080
- 8080:8080
devbox-db:
image: healthsamurai/aidboxdb:13.2
image: healthsamurai/aidboxdb:16.1
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: devbox
jute:
image: bedasoftware/jute-microservice:latest
ports:
- '8099:8090'
fhirpath_mapping:
image: bedasoftware/fhirpath-extract:main
ports:
- '8091:8090'

0 comments on commit bf715cd

Please sign in to comment.