JavaScript library
BlueButton.js
Helps developers parse and generate health data formats such as C-CDA. Its npm package, bluebutton, was last published in September 2015.
C-CDA
@cosyte/ccda reads real, vendor-quirky C-CDA documents into typed clinical models and turns each deviation into a stable coded warning. Where a document contradicts itself, it withholds the value and says so instead of guessing.
npm install @cosyte/ccdaNeed it integrated? Talk to us.
The standard
@cosyte/ccda
A generic XML parser hands you a DOM and leaves every clinical judgement to you. A conformance validator rejects the document and returns nothing. This library reads what the sender produced and tells you what it had to tolerate.
import { buildCcda, parseCcda } from "@cosyte/ccda";
// A synthetic CCD, built here so the example stands on its own. In your integration this is the
// document a sending system handed you.
const xml = buildCcda({
patient: { mrn: "MRN001", given: ["Jane"], family: "Doe", gender: "F", birthTime: "19800101" },
problems: [{ problem: { code: "59621000", displayName: "Essential hypertension" } }],
medications: [
{
drug: { code: "314076", displayName: "Lisinopril 10 MG Oral Tablet" }, // RxNorm
dose: { value: 1, unit: "{tablet}" },
route: { code: "C38288", displayName: "Oral" }, // NCI Thesaurus
},
],
allergies: [
{
allergen: { code: "7980", displayName: "Penicillin G" }, // RxNorm
reaction: { code: "247472004", displayName: "Hives" }, // SNOMED CT
},
],
}).toString();
const doc = parseCcda(xml);
const problem = doc.getProblems()[0];
const allergen = doc.getAllergies()[0]?.allergies[0]?.allergen;
console.log(doc.documentType, doc.getMrn(), doc.getPatient()?.name?.family);
console.log("problem", problem?.problems[0]?.value?.code, problem?.status);
console.log("medication", doc.getMedications()[0]?.drug?.code);
console.log("allergy", allergen?.code, allergen?.displayName);
console.log("warnings", doc.warnings.length);
// The emit half is a fixed point: re-parsing and re-serializing changes nothing.
console.log("round trip unchanged", parseCcda(doc.toString()).toString() === xml);
// The values printed above, which the test suite asserts on every run:
doc.documentType; // => "ccd"
doc.getMrn(); // => "MRN001"
problem?.problems[0]?.value?.code; // => "59621000"
problem?.status; // => "active"
doc.getMedications()[0]?.drug?.code; // => "314076"
allergen?.code; // => "7980"
doc.warnings; // => []
parseCcda(doc.toString()).toString() === xml; // => trueFrom the @cosyte/ccda README on GitHub, verbatim. Every value in it is synthetic.
Limits
Its README lists every limit, stated plainly. The main ones:
Alternatives
Each description comes from the project’s own documentation or npm listing, linked below.
JavaScript library
Helps developers parse and generate health data formats such as C-CDA. Its npm package, bluebutton, was last published in September 2015.
Node.js library
An Apache-2.0 parser from Blue Button formats (CCDA, C32 and CMS) to JSON.
TypeScript converter
Converts between C-CDA and FHIR, using the International Patient Summary as a bridge. If FHIR is your target model, it goes there directly; @cosyte/ccda reads C-CDA into models of its own.
Converter
Converts C-CDA (and HL7 v2, JSON and FHIR STU3) to FHIR R4 with Liquid templates, through the $convert-data operation of Azure's FHIR service.
Works with
It is free and MIT-licensed. If it saves you a day, a star on GitHub helps other engineers find it.
Need it integrated? Talk to us, or see what our integration services cover.