# fhir-sdc-helpers

> FHIR SDC Extension helper methods

Latest version **0.1.0** (published 2022-02-08) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install fhir-sdc-helpers
pnpm add fhir-sdc-helpers
yarn add fhir-sdc-helpers
bun add fhir-sdc-helpers
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2022-02-08 |
| First published | 2022-02-08 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 156.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Brian Postlethwaite |
| Maintainers | brianpos |
| Keywords | fhir, sdc, structured data capture, extensions |

## Links

- npm: https://www.npmjs.com/package/fhir-sdc-helpers
- npm.io page: https://npm.io/package/fhir-sdc-helpers

## Dependencies (1)

- [fhir-extension-helpers](https://npm.io/package/fhir-extension-helpers.md) ^0.3.0

## Recent versions

- 0.1.0 (latest) — 2022-02-08

## README

| FHIR SDC (Structured Data Capture) Extension Helpers |
|---|

## Introduction ##

This is an unofficial set of helper functions to ease working with the [FHIR R4][r4-spec] [Structured Data Capture][sdc-spec] 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)
``` javascript
import structuredDataCapture from 'fhir-sdc-helpers';

var item = { type: 'string', linkId: 's', text: 'Smile' };
structuredDataCapture.setHidden(item, true);
```

Reading a specific extension value
``` javascript
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
``` javascript
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][javascript-zulip].

## Contributing ##
I'm welcoming contributors from the FHIR community!

[javascript-zulip]: https://chat.fhir.org/#narrow/stream/179169-javascript
[r4-spec]: http://www.hl7.org/fhir/r4
[sdc-spec]: http://build.fhir.org/ig/HL7/sdc

---
_Source: https://npm.io/package/fhir-sdc-helpers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
