Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. First creates a FHIR Profiling SQLite database (fhir_profiles.db) by parsing and storing JSON specification files uploaded to the project. By default, the tool generates resources according to FHIR v4.0.1, however this is configurable.

  2. Using this database, the FHIR Profiling tool generates the desired FHIR Resource JSON schema, which you can then use in other projects to create and map FHIR resources.

How to use it:

Expand
titleSTEP 1: Import the FHIR Profiling Tool

Using +COMPONENT, import the FHIR Profiling Tool

Expand
titleSTEP 2: Set the FHIR version in the component card

By default, the FHIR Profiling Tool is pre-loaded with the FHIR v4.0.1 resources. The component contains specifications for FHIR v4.0.0 and v4.0.1, so you can change the default configuration to use v4.0.0 by changing the custom field FhirVersion in the component card to “4.0.0”.

image-20240523-184909.png

Expand
title STEP 2a: Optionally, upload an additional FHIR version specification

If needed, you can expand the versions available in Need another FHIR Version?

This can be adapted by manually uploading the new FHIR specification to the component:

  1. Go to the official http://hl7.org/fhir/directory.html and download the FHIR specification for the version you need.

Screen Shot 2024-02-15 at 5.02.17 PM.png
  1. In the downloaded specification files, locate “profiles-resources.json” and “types-resources.json”. Create a new folder with your version name (ex. v3_0_0) under the Specifications folder and upload these files into your version’s folder with the names “resources.json” and “types.json” respectively.

Untitled 3.png
  1. Update the FhirVersion custom field value to your new version (ex. 3.0.0)

Expand
titleSTEP 3: Optionally, add any custom or extension profiles you wish to add on top of the standard specification

If any custom or extension profiles are needed, you can add the <custom_profiles>.json files to the Specifications/Custom folder. If no extensions are needed, the folder should be left empty.

Note that if the custom profile’s specification exists as a standalone resource, it will need to be nested within a larger bundle resource definition.

Let’s walk through this process using an example custom profile - De-Identified UDS Plus Patient.

  • Start with a bundle resource definition (sample:

    View file
    namebundle.json
    ). Notice that the fullUrl and resource tables are empty.

    Untitled 4.pngImage Removed
  • Go to your reference and copy the Canonical url and JSON specification

    image-20240524-182246.pngImage Removed

  • Update the fullUrl value and load the custom profile into the resource table. Note that you may need to remove an extra set of curly brackets as the resource table’s brackets are equivalent to the ones in the JSON specification from the screenshot in the previous step

    Untitled.pngImage Removed
  • Upload the finished JSON (sample:
    View file
    namede-identified_uds_plus_patient.json
    1. )

    into the Specifications/Custom folderimage-20240524-182716.pngImage Removed
    Expand
    titleSTEP 4: Set the component to refresh the database if using a new FHIR version OR custom profiles

    This component processes and stores specification data in a SQLite database (Specifications/fhir_profiles.db) for easy access. If you wish to update the FHIR version and/or load any custom profiles into that database, set the custom field Refresh in the component card to “true” before starting the component. This flag tells the component to reference the specified FHIR version and any files in the Specifications/Custom folder and refresh the database on startup.

    Expand
    titleSTEP 65: Start the component

    Now that the component card has been configured to the correct FhirVersion and Refresh details, you can start the component!

    If the component was set with Refresh as true, it will take some time to initialize and load the database. It will reset the Refresh flag to false when done.

    Once ready, the component will provide a URL in the component status:

    image-20240523-195851.png
    Expand
    titleSTEP 76: Click on the provided URL to use the tool

    Clicking on the provided URL will take you to the FHIR Profiling Tool’s menu which contains a list of all the FHIR resources and types available in the SQLite database.

    image-20240523-200128.png

    Clicking on any of the links will trigger the tool to generate a template JSON for the specified FHIR resource or type:

    image-20240523-200322.png

    You can now copy the template JSON and bring it over to your FHIR component to use in your interface. See https://interfaceware.atlassian.net/wiki/x/AgBbrg the FHIR Resource Creator for an example of how to use a FHIR JSON template to generate and map FHIR resources.

    Adapting the component:

    Expand
    titleAdd custom profiles or extensions on top of the standard specification

    If any custom profiles or extensions are needed, you can add the FHIR Profile Snapshot <custom_profiles>.json files to the Specifications/Custom folder. If no extensions are needed, the folder should be left empty.

    The custom profile must be:

    1. A Profile Snapshot (the complete definition of the resource profile). The FHIR Profiling Tool uses the snapshot to generate the FHIR resource. A resource cannot be generated from a differential profile.

    2. If the custom profile’s specification exists as a standalone resource, it will need to be nested within a bundle resource definition.

    Let’s walk through this process using an example custom profile - De-Identified UDS Plus Patient.

    1. Start with a bundle resource definition (sample:

      View file
      namebundle.json
      ). Notice that the fullUrl and resource tables are empty.

      Untitled 4.pngImage Added
    2. Go to your reference, copy the Canonical url and download the profile snapshot as JSON.

      Image Added
    3. Update the fullUrl value with the canonical URL and copy the custom profile into the resource table. Note that you may need to remove an extra set of curly brackets as the resource table’s brackets are equivalent to the ones in the JSON specification from the screenshot in the previous step.

      Untitled.pngImage Added
    4. Upload the finished JSON (sample:

      View file
      namede-identified-uds-plus-patient.json
      ) into the Specifications/Custom folder.

      image-20240524-182716.pngImage Added
    Expand
    titleModify the datatypes to simple IDs

    Custom FHIR profiles may use FHIRPath to define rules and relationships within the data. FHIRPath represents datatypes with fully-qualified URLs such as, http://hl7.org/fhirpath/System.String, however, these need to be mapped to the simple primitive datatype for the profiler to use.

    Additional datatypes used in custom profiles can be added to the mapping function replaceHttpIDwithID in the FHIRGENcreateResource.lua file:

    Image Added