Skip to content

Commit

Permalink
release time!
Browse files Browse the repository at this point in the history
  • Loading branch information
kachok committed Sep 2, 2014
1 parent dd84df0 commit dd4a2bc
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 70 deletions.
68 changes: 1 addition & 67 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <code> but expected <priorityCode>, 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

Expand All @@ -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

Expand Down
11 changes: 10 additions & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
48 changes: 48 additions & 0 deletions docs/generator.md
Original file line number Diff line number Diff line change
@@ -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 <code> but expected <priorityCode>, 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


***

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -22,7 +22,7 @@
"email": "[email protected]"
}
],
"license": "MIT",
"license": "Apache-2.0",
"engines": {
"node": ">= 0.10.0"
},
Expand Down

0 comments on commit dd4a2bc

Please sign in to comment.