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:
POST /fhir/$loadAccept:text/yamlContent-Type:text/yamlsource:'https://storage.googleapis.com/aidbox-public/synthea/100/all.ndjson.gz'# resp{CarePlan:356,Observation:20382,MedicationAdministration:150,Goal:301,Patient:124,DiagnosticReport:1430,Practitioner:181,ExplanationOfBenefit:3460,Immunization:1636,Claim:4488,MedicationRequest:1028,Encounter:3460,Condition:871,Procedure:2854,Organization:181,AllergyIntolerance:40,ImagingStudy:134}
Let's see database stats:
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