Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
handlebars-helpers-fhir
Advanced tools
Helper functions for the Handlebars templating engine using fhirpath to reference HL7 FHIR resources from within templates.
Helper functions for the Handlebars templating engine using fhirpath to reference HL7 FHIR resources from within templates.
Handlebars!
$ npm install handlebars --save
Install package
$ npm install handlebars-helpers-fhir --save
Register helpers with handlebars
const Handlebars = require('handlebars');
require('handlebars-helpers-fhir').registerWith(Handlebars);
The if-fhir
block helper will conditionally render a block based on
a fhirpath expression. If the fhirpath expression returns an empty
array, Handlebars will not render the block.
{{#if-fhir . expression='Patient.address.where(use=\'temp\')'}}
<p>Patient has a temporary address.</p>
{{/if-fhir}}
The helper can render an {{else}}
section.
{{#if-fhir . expression='Patient.address.where(use=\'temp\')'}}
<p>Patient has a temporary address.</p>
{{else}}
<p>Patient does not have a temporary address.</p>
{{/if-fhir}}
The unless-fhir
block helper will conditionally render a block based on
a fhirpath expression. If the fhirpath expression returns an empty
array, Handlebars will render the block.
{{#unless-fhir . expression='Patient.address.where(use=\'temp\')'}}
<p class="button">Add temporary address</p>
{{/unless-fhir}}
The each-fhir
block helper will render a block for each item found
using a fhirpath expression.
{{#each-fhir . expression='Patient.address'}}
<p>{{use}}: {{text}}</p>
{{/each-fhir}}
You can optionally supply an {{else}}
section which will render only
if evaluating the fhirpath expression returns no matches.
{{#each-fhir . expression='Patient.address'}}
<p>{{use}}: {{text}}</p>
{{else}}
<p>No address found</p>
{{/each-fhir}}
The each-fhir
block helper supports the @index
, @key
, @first
and @last
loop variables.
The each-fhir
block helper does not support block parameters.
The with-fhir
block helper will render a block after switching context
to the first item found using a fhirpath expression.
{{#with-fhir . expression='Patient.address.first()'}}
<p>{{text}}</p>
{{/with-fhir}}
You can optionally supply an {{else}}
section which will render only
if evaluating the fhirpath expression returns no matches.
{{#with-fhir . expression='Patient.address.first()'}}
<p>{{text}}</p>
{{else}}
No address
{{/with-fhir}}
The resolve-fhir
block helper will render a block after switching
context to the first FHIR resource from the first reference found
by evaluating the fhirpath expression.
{{#resolve-fhir . expression='Patient.managingOrganization.reference'}}
<p>Healthcare provider is {{name}}</p>
{{/resolve-fhir}}
You can optionally supply an {{else}}
section which will render when
with the fhirpath expression returns no matches OR the referenced
FHIR resource cannot be found.
{{#resolve-fhir . expression='Patient.managingOrganization.reference'}}
<p>Healthcare provider is {{name}}</p>
{{else}}
<p>Healthcare provider unknown</p>
{{/resolve-fhir}}
The resolve-fhir
block helper suppports only internal references
(i.e. within @root.entry and @root.contained).
handlebars-helpers-fhir is free software: you can redistribute it and/or modify it under the terms of the MIT license.
Supported by Black Pear Software
FAQs
Helper functions for the Handlebars templating engine using fhirpath to reference HL7 FHIR resources from within templates.
The npm package handlebars-helpers-fhir receives a total of 34 weekly downloads. As such, handlebars-helpers-fhir popularity was classified as not popular.
We found that handlebars-helpers-fhir demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.