In this guide we will generate synthea data and load it into aidbox
Generate synthea data
We are going to generate synthetic data with synthea project:
# brew install gradlegitclonehttps://github.com/synthetichealth/syntheacdsynthea# edit src/main/resources/synthea.properties# set exporter.fhir.bulk_data = true# generate 100 pts./run_synthea-p100cdoutput/fhirls-lah# create all.ndjsoncat*.ndjson>all.ndjson# gzip all ndjsongzip*.ndjsonls-lah#load to storagegsutilcp*.ndjson.gzgs://your-bucket/dir/
Load by Resource Type
Now we can load for example Patients and Observations into your box:
POST /fhir/Patient/$loadAccept:text/yamlContent-Type:text/yamlsource:'https://storage.googleapis.com/aidbox-public/synthea/100/Patient.ndjson.gz'#resp{total:124}
POST /fhir/Observation/$loadAccept:text/yamlContent-Type:text/yamlsource:'https://storage.googleapis.com/aidbox-public/synthea/100/Observation.ndjson.gz'#resp{total:20382}
Let see the data in Aidbox:
GET /Patient?_ilike=John&_revinclude=Observation:patient
Load all at once with $load
Using /fhir/$load you can load ndjson file with multiple resource types in one step:
SELECT relname, reltuples FROM pg_class r JOIN pg_namespace n ON (relnamespace = n.oid) WHERE relkind ='r'AND n.nspname ='public'order by reltuples descLIMIT20--- observation 20382attribute 7257claim 4488encounter 3460