sqltofhir
Visual Studio Code extension for writing FHIR resources with SQL.
sqltofhir
Provides snippets for easily writing FHIR resources with SQL queries.
Each snippet corresponds to a FHIR datatype.
How to use
In a SQL file, every command starts with the prefix fhir
.
fhirbuildobject
:
json_build_object()
fhirbuildarray
:
json_build_array()
fhirselect
:
SELECT
AS fhir
FROM
fhir{datatype}
to create a datatype. For exemple, with fhiridentifier
:
'identifier',
json_build_array(
json_build_object(
'use', ,
'type', json_build_object(
'text', ,
'coding',
json_build_array(
json_build_object(
'system', ,
'version', ,
'code', ,
'display', ,
'userSelected', ,
)
),
),
'system', ,
'value', ,
'period', json_build_object(
'start', ,
'end',
),
'assigner', ,
),
),
fhirRef{reference}
to create a reference. For exemple, with fhirRefsubject
:
'subject',
json_build_object(
,
,
:: TEXT
)
Snippets
General sqltofhir commands
Command name |
Utility |
fhirselect |
creates a sql SELECT request |
fhirbuildobject |
creates a fhir_build_object() |
fhirbuildarray |
creates a fhir_build_array() |
FHIR general-purpose data-types
* Defined variations on quantity
FHIR special purpose data-types
sqltofhir functions arkhn
Command name |
Data-type |
fhirRefsubject |
Subject |