Personal Health Records
1.0.0-ballot - ballot International flag

This page is part of the Standard Personal Health Record (v1.0.0-ballot: STU1 Ballot 1) based on FHIR (HL7® FHIR® Standard) R4. . For a full list of available versions, see the Directory of published versions

Operating Systems

Please find below documentation on implementing FHIR software in various operating systems.

MAC OS

UTIs and Launch Services

Where is the list of “known” file types stored?

The official term for "file types" is Uniform Type Identifiers (UTIs), and the database of UTIs is maintained by Launch Services. Using the Terminal, you can view the contents of the Launch Services database using the lsregister tool, which is stored at:

# the lsregister utility
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister 

# the raw file extention table
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump

Declaring the PHR Uniform Type Identifier

Is there a way to make OS X recognize new file types?

This Apple article, "Declaring New Uniform Type Identifiers", provides useful information on how to do this. Here's the complete process:

1. Create a dummy application

Create a dummy application to register with Launch Services:

  • Open AppleScript Editor (located in OS X's Utilities folder).
  • Save a new empty script somewhere (eg: on your Desktop), setting its File Format to Application.
2. Open its Info.plist file
  • Locate your new dummy application in the Finder.
  • Right-click on it, and select Show Package Contents from the popup menu.
  • Open its Contents folder.
  • Open the Info.plist file in a text editor (eg: TextEdit).
3. Add your new UTI

There's a choice of two keys:

  • UTExportedTypeDeclarations – for your own custom filename extensions.
  • UTImportedTypeDeclarations – for filename extensions which already exist but aren't recognised by OS X.

Choose the key which is most appropriate for your needs.

Then in the Info.plist file, before the final two lines (</dict></plist>), add this code:

<key>UTImportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeIdentifier</key>
        <string>org.hl7.fhir.phr</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <array>
                <string>phr</string>
            </array>
        </dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.data</string>
        </array>
        <key>UTTypeDescription</key>
        <string>Personal Health Record</string>
        <key>UTTypeIconFile</key>
        <string>FhirPHR.icns</string>
        <key>UTTypeReferenceURL</key>
        <string>https://build.fhir.org/ig/HL7/personal-health-record-format-ig/</string>
    </dict>
</array>
4. Register your new UTI with Launch Services

Run this command in the Terminal:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister <PATH_TO_APP>

replacing with the path to your dummy application, eg:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister ~/Desktop/SampleFhirApp.app 

If you now create a file with your new filename extension, and then select it in the Finder and hit Enter, the Finder should automatically select only the filename part, not the extension.

If you view the contents of the Launch Services database:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -dump

you should find your new UTI listed:

type    id:            50364
        bindableKey:   12608
        generation:    1
        uti:           com.idsoftware.wad
        description:   Doom WAD file
        flags:         imported  active  apple-internal  untrusted
        icon:          DoomWAD.icns
        conforms to:   public.data
        tags:          .wad

If you later want to unregister your new UTI, pass the -u option to lsregister:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -u ~/Desktop/SampleFhirApp.app 

iOS

Flutter

ECMAScript (Node.js, Javascript)

Library Vendor Description
fhirclient smarthealthit The official SMART on FHIR javascript client
fhir-kit-client Vermonster Modern FHIR client with ES6, SMART, cross-version support, etc
fhir-starter symptomatic FhirUtilities, FhirDehydrator, and template FHIR UI components.
fhir-react 1uphealth Multi use react component
json-schema-resource-validation VictorGus FHIR validator for R4
sof-scope-checker Asymmetrik Utility to check SMART on FHIR scope access
fhirpath HL7 The official FHIRPath parser
is-fhir-date HenrikJoreteg Checks if a date is FHIR compliant
ts-fhir-types Ahryman40k Typescript definitions
fhir-list-addresses careMESH Utility function for extracting addresses
hl7v2 panates HL7 v2 parser, serializer, validator and TCP client/server.
redox-hl7-v2 Redox This is Redox's battle-tested in-house HL7v2 parser/generator.