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

ccd-fhir

CDA R2 Continuity of Care Document (CCD) to FHIR converter

Convert CDA R2 CCD xml to FHIR bundle

NPM

Build Status Coverage Status dependencies status

CDA R2 CCD

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/amida-tech/blue-button/master/test/fixtures/parser-ccd/SampleCCDDocument.xml');

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

3 Versions

  • 2.0.0                                ...           4 years ago
  • 0.9.3                                ...           5 years ago
  • 0.9.2                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (12)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |