cda-fhir
Blue Button CDA Parser
Last updated 4 years ago by kachok .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install cda-fhir 
SYNC missed versions from official npm registry.

cda-fhir

Consolidated CDA (C-CDA) to FHIR converter

Convert C-CDA xml to FHIR bundle

NPM

Build Status Coverage Status Dependency Status

Consolidated CDA (C-CDA)

This library provides the following functionality

  • Parse XML document using sax js parser
  • Generate set of resources conformant to FHIR DSTU2

Usage example:

'use strict';

var _ = require('lodash');

var bbcms = require('./index');

// Make it transactional bundle
var 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;
};

var request = require('request');

// Get sample file from GitHub
var istream = request.get('https://raw.githubusercontent.com/chb/sample_ccdas/master/Vitera/Vitera_CCDA_SMART_Sample.xml');

istream
    .pipe(new bbcms.CcdaParserStream("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

Current Tags

  • 2.0.0                                ...           latest (4 years ago)

4 Versions

  • 2.0.0                                ...           4 years ago
  • 0.9.7                                ...           5 years ago
  • 0.9.5                                ...           5 years ago
  • 0.9.4                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (14)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |