New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fhir

Package Overview
Dependencies
Maintainers
2
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fhir

Node.JS library for serializing/deserializing FHIR resources between JS/JSON and XML using various node.js XML libraries.

  • 4.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.7K
decreased by-23.41%
Maintainers
2
Weekly downloads
 
Created
Source

FHIR.js

Node.JS library for serializing/deserializing FHIR resources between JS and XML, and validating FHIR resources. The library uses technologies that are safe for use in browser-only applications (node.js is not required).

Build Status

Dependencies

  • q 1.4.1
  • underscore 1.8.3
  • path 0.12.7
  • xml-js 1.6.2

Installation

npm install fhir
or
bower install fhir-js

To use in a node.js application, require the "fhir" module.

var Fhir = require('fhir');

To use in a browser application, reference dist/bundle.js.

<script type="text/javascript" src="node_modules/fhir/dist/bundle.js"></script>
or
<script type="text/javascript" src="bower_components/fhir-js/dist/bundle.js"></script>

Basic Usage

var resource = {
  resourceType: 'Patient',
  ...
};
var fhir = new Fhir();
var xml = fhir.objToXml(resource);
var obj = fhir.xmlToObj(xml);
var results = fhir.validate(xml, { errorOnUnexpected: true });
results = fhir.validate(obj, {});

Documentation

API documentation can be found at http://lantanagroup.github.io/FHIR.js/

Implementation Notes

  • Compatible with FHIR Release 4 Candidate v3.2.0
  • FHIR profiles (within the "profiles" directory) are used to determine whether properties should be arrays, the data type and cardinality of each property, etc.. The profiles are first combined using packageProfiles.js into a single bundle of all profiles. A second pass over the profiles is performed to create a hierarchy (rather than a flat list) of the properties, and only includes information that validation is concerned about. The result of the second pass is stored in profiles/types.json and profiles/valueSets.json.

Test

npm test

Keywords

FAQs

Package last updated on 29 May 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc