diff --git a/README.md b/README.md index 283156c0..6bb166c8 100644 --- a/README.md +++ b/README.md @@ -233,62 +233,6 @@ getting: See [/example](./example) for example above as well as how to parse individual sections. *** -## CCDA Generation: Introduction -This module converts data in JSON format (originally parsed from a CCDA) back to CCDA/blue-button format. It determines the section template (e.g. allergies, immunizations, etc) to which the JSON data belongs, runs the data through the appropriate templater, and generates the corresponding CCDA/blue-button section. An entire CCDA document can be generated by iteratively running the JSON data through the templaters for each section. - -The API exposes genWholeCCDA() for this purpose, which takes in CCDA data in JSON format as a parameter and converts it into CCDA/XML. - -The module uses libxmljs for its templaters and uses a JS XML DOM implementation (https://github.com/jindw/xmldom) to traverse the generated and expected XML documents for testing and compare them by node (tagName) and by attribute and value. - -## CCDA Generation: Testing -A suite of tests and a test class (test/test-generator and test/test-lib, respectively) help in verifying that the generated CCDA is accurate. Tests include: - - Parsing CCDA to JSON, regenerating the CCDA from the new JSON file, and comparing the original and generated CCDA files for differences. - - Parsing, generating, and parsing again, comparing the first parsed JSON data with the second parsed JSON data for equality. - - Comparing a specific, single section of CCDA to the original specific, single section, to achieve testing granularity. - - Testing the generator against the entire corpora of CCDA documents at: https://github.com/chb/sample_ccdas using the internal ccda_explorer module - -The testing class/library provides methods to compare two XML/CCDA documents by recursively walking the XML document tree and comparing the documents node-by-node. Assertion-based or diff-based testing can be used with this library by setting the appropriate flags. The default settings ignore comments, whitespace, newlines, tab or text nodes. Here is an example of diff-based testing output after testing the CCDA Procedures Section: - -```` -PROCESSING PROCEDURES -Error: Generated number of child nodes different from expected (generated: 0 at lineNumber: 8, expected: 1 at lineNumber:12 -Error: Generated number of child nodes different from expected (generated: 11 at lineNumber: 10, expected: 10 at lineNumber:32 -Attributes mismatch. Different lengths: 1 attributes but expected 0 attributes @ lineNumber: 70, 94 -Error: Generated number of child nodes different from expected (generated: 10 at lineNumber: 71, expected: 11 at lineNumber:95 -Attributes mismatch. Different lengths: 1 attributes but expected 0 attributes @ lineNumber: 119, 149 - -Error: Attributes mismatch: Encountered: moodCode="EVN" but expected: moodCode="INT" @ lineNumber: 120, 150 -Error: Encountered different tagNames: Encountered but expected , lineNumber: 130, 161 -Error: Generated number of child nodes different from expected (generated: 4 at lineNumber: 151, expected: 5 at lineNumber:182 -ERRORS: 8 -```` - - - -**Alterable flags (in test-lib.js)**: - -PROMPT_TO_SKIP: If set to true, will prompt the user to either skip or not skip the failed test. - -DIFF (default): If set to true, will continue execution even upon failing a test and will output all of the errors/differences to the console. This is the default setting. - -**Alterable settings (testXML.error_settings in test-lib.js)**: - -"silence_cap": If set to true, will silence the output of capitalization errors. False by default. - -"silence_len": If set to true, will silence the output of attribute length errors (i.e. actual node has 2 attributes but expected node has 3 attributes). False by default. - -**Test suite settings**: - -TEST_CCDA_SAMPLES: uses ccda-explorer to test against sample_ccdas - -TEST_CCD: tests against one generic sample ccda - -TEST_SECTIONS: tests each section individually - - -*** - - -## Link to data model docs in docs/model.md - -Detailed description of JSON based data model (tied to CCDA spec) - -[JSON based Blue Button data model](./docs/model.md) - -[CMS Documentation](./docs/cms.md) ## Goals @@ -301,21 +245,11 @@ Detailed description of JSON based data model (tied to CCDA spec) - Speed of parsing - Well tested on entire corpora of CCDA samples from https://github.com/jmandel/sample_ccdas -## Roadmap (End of May, Release 1.0) - -- First file format is the "Continuity of Care Document", a Blue Button format type that capture’s entire patients medical history.  The CCD is comprised of five required sections (allergies, medications, problems, procedures, lab results) and three optional sections (encounters, immunizations, vitals). -- CCDA JSON data model is fully defined as separate library with validation support -- bluebutton.js parser is rewriten for speed and support of updated CCDA JSON data model -- Uses libxmljs parser (under Node.js environment) or browser based parser for XML -- Comprehensive test for Node.js module (with Mocha/Chai) - ## Future Roadmap - C32 support reintroduced -- Full browser support for all functionality - Merge back into bluebutton.js repo -- Comprehensive test for browser environment -- After initial re-write we are planning to reintroduce this "fork" back into bluebutton.js community. +- Refactoring into smaller components (sub-modules) ## Contributing diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 596bee5a..d31bb2f1 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,7 +1,16 @@ # blue-button.js Release Notes # v.1.1.0 - September 2, 2014 -- +- Complete review and overhaul of Blue Button JSON data model + - Includes standard way to handle date_time and coded entries +- Implemented JSON Schema based model validation +- Sense method to detect variety of health record formats +- CCDA parser is updated for latest changes in data model +- CMS parser is updated for latest changes in data model +- CCDA generator update for latest model changes + - including data parsed from CMS (only sections covered by CCDA standard) +- Switched to blue-button-meta.js library for all standard lookups +- Simplified test harness # v1.0.4 - July 18, 2014 - Bug fix on handling null or UNK encounter in cleanup step diff --git a/docs/generator.md b/docs/generator.md new file mode 100644 index 00000000..26bef399 --- /dev/null +++ b/docs/generator.md @@ -0,0 +1,48 @@ +## CCDA Generation: Introduction +This module converts data in JSON format (originally parsed from a CCDA) back to CCDA/blue-button format. It determines the section template (e.g. allergies, immunizations, etc) to which the JSON data belongs, runs the data through the appropriate templater, and generates the corresponding CCDA/blue-button section. An entire CCDA document can be generated by iteratively running the JSON data through the templaters for each section. + +The API exposes genWholeCCDA() for this purpose, which takes in CCDA data in JSON format as a parameter and converts it into CCDA/XML. + +The module uses libxmljs for its templaters and uses a JS XML DOM implementation (https://github.com/jindw/xmldom) to traverse the generated and expected XML documents for testing and compare them by node (tagName) and by attribute and value. + +## CCDA Generation: Testing +A suite of tests and a test class (test/test-generator and test/test-lib, respectively) help in verifying that the generated CCDA is accurate. Tests include: + - Parsing CCDA to JSON, regenerating the CCDA from the new JSON file, and comparing the original and generated CCDA files for differences. + - Parsing, generating, and parsing again, comparing the first parsed JSON data with the second parsed JSON data for equality. + - Comparing a specific, single section of CCDA to the original specific, single section, to achieve testing granularity. + - Testing the generator against the entire corpora of CCDA documents at: https://github.com/chb/sample_ccdas using the internal ccda_explorer module + +The testing class/library provides methods to compare two XML/CCDA documents by recursively walking the XML document tree and comparing the documents node-by-node. Assertion-based or diff-based testing can be used with this library by setting the appropriate flags. The default settings ignore comments, whitespace, newlines, tab or text nodes. Here is an example of diff-based testing output after testing the CCDA Procedures Section: + +```` +PROCESSING PROCEDURES +Error: Generated number of child nodes different from expected (generated: 0 at lineNumber: 8, expected: 1 at lineNumber:12 +Error: Generated number of child nodes different from expected (generated: 11 at lineNumber: 10, expected: 10 at lineNumber:32 +Attributes mismatch. Different lengths: 1 attributes but expected 0 attributes @ lineNumber: 70, 94 +Error: Generated number of child nodes different from expected (generated: 10 at lineNumber: 71, expected: 11 at lineNumber:95 +Attributes mismatch. Different lengths: 1 attributes but expected 0 attributes @ lineNumber: 119, 149 + +Error: Attributes mismatch: Encountered: moodCode="EVN" but expected: moodCode="INT" @ lineNumber: 120, 150 +Error: Encountered different tagNames: Encountered but expected , lineNumber: 130, 161 +Error: Generated number of child nodes different from expected (generated: 4 at lineNumber: 151, expected: 5 at lineNumber:182 +ERRORS: 8 +```` + + + +**Alterable flags (in test-lib.js)**: + -PROMPT_TO_SKIP: If set to true, will prompt the user to either skip or not skip the failed test. + -DIFF (default): If set to true, will continue execution even upon failing a test and will output all of the errors/differences to the console. This is the default setting. + +**Alterable settings (testXML.error_settings in test-lib.js)**: + -"silence_cap": If set to true, will silence the output of capitalization errors. False by default. + -"silence_len": If set to true, will silence the output of attribute length errors (i.e. actual node has 2 attributes but expected node has 3 attributes). False by default. + +**Test suite settings**: + -TEST_CCDA_SAMPLES: uses ccda-explorer to test against sample_ccdas + -TEST_CCD: tests against one generic sample ccda + -TEST_SECTIONS: tests each section individually + + +*** + diff --git a/package.json b/package.json index 42fc3ba8..032b42da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blue-button", - "version": "1.1.0-beta.18", + "version": "1.1.0", "description": "Blue Button (CCDA) to JSON Parser.", "main": "/index.js", "directories": { @@ -22,7 +22,7 @@ "email": "afsin.ustundag@us.pwc.com" } ], - "license": "MIT", + "license": "Apache-2.0", "engines": { "node": ">= 0.10.0" },