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
User | Most Recent Commit | # Commits |
---|---|---|
Dmitry Kachaev | 2015-12-01 07:10:41.0 | 1 |
Alexey Shchelokov | 2015-11-23 21:40:50.0 | 18 |
Other Committers
User | Most Recent Commit | # Commits |
---|
C32 to FHIR parser/converter
Convert C32 xml to FHIR bundle
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);
});
Licensed under Apache 2.0