-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathatomic-ehr-codegen-python-us-core-profiles.yaml
More file actions
122 lines (104 loc) · 3.46 KB
/
Copy pathatomic-ehr-codegen-python-us-core-profiles.yaml
File metadata and controls
122 lines (104 loc) · 3.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: atomic-ehr-codegen-python-us-core-profiles
on:
push:
branches:
- main
paths:
- 'developer-experience/atomic-ehr-codegen-python-us-core-profiles/**'
- '.github/workflows/atomic-ehr-codegen-python-us-core-profiles.yaml'
pull_request:
paths:
- 'developer-experience/atomic-ehr-codegen-python-us-core-profiles/**'
- '.github/workflows/atomic-ehr-codegen-python-us-core-profiles.yaml'
workflow_dispatch:
defaults:
run:
working-directory: developer-experience/atomic-ehr-codegen-python-us-core-profiles
jobs:
test:
runs-on: ubuntu-latest
services:
aidbox_db:
image: healthsamurai/aidboxdb:17
env:
POSTGRES_USER: aidbox
POSTGRES_PASSWORD: aidboxpwd
POSTGRES_DB: aidbox
options: >-
--health-cmd "pg_isready -U aidbox"
--health-interval 10s
--health-timeout 5s
--health-retries 10
aidbox:
image: healthsamurai/aidboxone:edge
ports:
- 8080:8080
env:
AIDBOX_LICENSE: ${{ secrets.AIDBOX_LICENSE }}
AIDBOX_CLIENT_ID: root
AIDBOX_CLIENT_SECRET: secret
AIDBOX_ADMIN_PASSWORD: secret
AIDBOX_PORT: 8080
AIDBOX_FHIR_PACKAGES: hl7.fhir.r4.core#4.0.1
AIDBOX_FHIR_SCHEMA_VALIDATION: true
BOX_SETTINGS_MODE: read-write
PGHOST: aidbox_db
PGPORT: 5432
PGUSER: aidbox
PGPASSWORD: aidboxpwd
PGDATABASE: aidbox
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.12.0'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Node dependencies
run: npm install
- name: Install @atomic-ehr/codegen 0.0.17
run: npm install --save-dev @atomic-ehr/codegen@0.0.17
- name: Regenerate fhir_types
run: npx tsx generate.ts
- name: Check generated fhir_types are up to date
run: |
if [ -n "$(git status --porcelain -- fhir_types)" ]; then
echo "::error::fhir_types/ changed after regeneration. Run 'npx tsx generate.ts' and commit the result."
git status --porcelain -- fhir_types
git diff -- fhir_types
exit 1
fi
- name: Install Python dependencies
run: pip install -r fhir_types/requirements.txt
- name: Typecheck
run: mypy .
- name: Build bundle
run: |
out=$(python load.py)
echo "$out"
echo "$out" | grep -qF 'Wrote bundle with 10 entries'
- name: Compute average BP and check output
run: |
out=$(python avg.py)
echo "$out"
echo "$out" | grep -qF 'Avg BP: 125.2/82.0 mmHg (n=5)'
- name: Wait for Aidbox
run: |
for i in $(seq 1 60); do
if curl -fsS http://localhost:8080/health >/dev/null 2>&1; then
echo "Aidbox is up"; exit 0
fi
echo "waiting for Aidbox ($i)"; sleep 3
done
echo "Aidbox did not become healthy in time"; exit 1
- name: POST bundle to Aidbox with fhirpy and read it back
env:
AIDBOX_URL: http://localhost:8080/fhir
AIDBOX_SECRET: secret
run: |
out=$(python post.py)
echo "$out"
echo "$out" | grep -qF 'Stored BP observations: 5'