Skip to content

HealthSamurai/sql-on-fhir.clj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sql-on-fhir.clj

Reference implementation of SQL on FHIR in clojure

Transformation

  • reference transformation
  • extensions transformation
  • codes materialization

Getting started

cd ~/synthea && ./run_synthea --exporter.baseDirectory="<DATADIR>" --exporter.fhir.bulk_data=true -p 100

git clone [email protected]:HealthSamurai/sql-on-fhir.clj.git

cd sql-on-fhir.clj

# run transformation of ndjson file
clj -M -m sql-on-fhir.core tx <DATADIR>/fhir/Patient.ndjson.gz <DATADIR>/sof/Patient.ndjson.gz

# transform folder of ndjson files
clj -M -m sql-on-fhir.core tx <DATADIR>/fhir/ <DATADIR>/sof

Play with duckdb

cd <DATADIR>/sof/

duckdb fhir.duckdb

D select * from read_json_auto('Patient.ndjson.gz') limit 10;
D CREATE TABLE patient AS select * from read_json_auto('Patient.ndjson.gz');
D PRAGMA show('patient');
D select gender, sof_extension.us_core_race[1].sof_extension.text[1].valueString, count(*) from patient group by 1,2 limit 10;

# generate parquet

D COPY (SELECT * FROM patient) TO 'Patient.parquet' (FORMAT 'parquet');


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published