Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
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 0 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.