Skip to content

brianpos/fhir-sdc-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

FHIR SDC (Structured Data Capture) Extension Helpers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published