Skip to content

arkhn/sqltofhir-vscode

Repository files navigation

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.

how to use

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

Command name Data-type
fhiridentifier Identifier
fhircoding Coding
fhirratio Ratio
fhirperiod Period
fhirrange Range
fhirratioRange RatioRange
fhirattachement Attachement
fhirannotation Annotation
fhirhumanName HumanName
fhircodeableConcept CodeableConcept
fhirtiming Timing
fhirmoney Money
fhiraddress Address
fhirquantity Quantity
fhirsimpleQuantity SimpleQuantity*
fhirmoneyQuantity MoneyQuantity*
fhircount Count*
fhirduration Duration*
fhirdistance Distance*
fhirage Age*
fhirsampledData SampledData
fhirsignature Signature
fhircontactPoint ContactPoint
* Defined variations on quantity

FHIR special purpose data-types

Command name Data-type
fhirExtension Extension
fhirMeta Meta

sqltofhir functions arkhn

Command name Data-type
fhirRefsubject Subject

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published