JSPM

fhir-sdc-helpers

0.1.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 586
    • Score
      100M100P100Q112257F
    • License BSD-3-Clause

    FHIR SDC Extension helper methods

    Package Exports

    • fhir-sdc-helpers
    • fhir-sdc-helpers/dist/structureddatacapture-r4.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fhir-sdc-helpers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    FHIR SDC (Structured Data Capture) Extension Helpers

    Introduction

    This is an unofficial set of helper functions to ease working with the FHIR R4 Structured Data Capture Extensions in Javascript and TypeScript.

    This pacakge leverages the npm pacakge fhir-extension-helpers for extension wrangling.

    Example Usage

    Setting a specific SDC extension value (e.g. hidden)

    import structuredDataCapture from 'fhir-sdc-helpers';
    
    var item = { type: 'string', linkId: 's', text: 'Smile' };
    structuredDataCapture.setHidden(item, true);

    Reading a specific extension value

    import structuredDataCapture from 'fhir-sdc-helpers';
    
    // This item would usually be read from an existing questionnaire
    var item = { type: 'string', linkId: 's', text: 'Smile', extension:[{url:"http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",valueBoolean:true}] };
    var hidden = structuredDataCapture.getHidden(item);
    console.log(hidden); // this will be a true|false|undefined(if the extension did not exist)

    Removing a specific SDC extension

    import exHelpers from 'fhir-extension-helpers';
    import structuredDataCapture from 'fhir-sdc-helpers';
    
    exHelpers.clearExtension(item, structuredDataCapture.exturl_Hidden); // removes the hidden extension from the item

    Support

    TBD - there's not really much here... For questions and broader discussions, use the FHIR Implementers chat on Zulip.

    Contributing

    I'm welcoming contributors from the FHIR community!