amida-tech/c32-fhir

Name: c32-fhir

Owner: Amida Technology Solutions

Description: C32 to FHIR parser/converter

Created: 2015-09-18 17:28:18.0

Updated: 2015-09-25 14:37:32.0

Pushed: 2015-12-01 07:14:25.0

Homepage: null

Size: 36

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits
Dmitry Kachaev2015-12-01 07:10:41.01
Alexey Shchelokov2015-11-23 21:40:50.018

Other Committers

UserEmailMost Recent Commit# Commits

README

c32-fhir

C32 to FHIR parser/converter

Convert C32 xml to FHIR bundle

NPM

Build Status Coverage Status Dependency Status

This library provides the following functionality

Usage example:

 strict';

_ = require('lodash');

bbcms = require('./index');

ake it transactional bundle
makeTransactionalBundle = function (bundle, base, patientId) {
_.each(bundle.entry, function (value) {
    value.request = {
        'method': (value.resource.resourceType === 'Patient') ? 'PUT' : 'POST',
        'url': (value.resource.resourceType === 'Patient') ? 'Patient/' + patientId : value.resource.resourceType
    };
    value.base = base;
});
bundle.type = 'transaction';
return bundle;


request = require('request');

et sample file from GitHub
istream = request.get('https://raw.githubusercontent.com/amida-tech/blue-button/master/test/fixtures/parser-c32/VA_CCD_Sample_File_Version_12_5_1.xml');

eam
.pipe(new bbcms.C32ParserStream("test" /* PatientId */))
.on('data', function (data) {
    var bundle = JSON.stringify(makeTransactionalBundle(data), null, '  ');

    console.log(bundle); // Result bundle

})
.on('error', function (error) {
    console.log(error);
});
License

Licensed under Apache 2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.