Skip to content

Commit

Permalink
Merge branch 'dmitry-1.1.0-prerelease'
Browse files Browse the repository at this point in the history
  • Loading branch information
kachok committed Jul 14, 2014
2 parents 0ee1b60 + 3daa13e commit 7fed570
Show file tree
Hide file tree
Showing 346 changed files with 95,319 additions and 2,317 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ coverage
.project
.settings
*.md.html

# ccda-explorer
ccda-explorer/dump/
ccda-explorer/dump_gen_xml/
ccda-explorer/sample_ccdas/


34 changes: 32 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = function(grunt) {
files: ['*.js', './lib/*.js', './test/*.js'],
options: {
browser: true,
smarttabs: true,
curly: true,
eqeqeq: true,
immed: true,
Expand Down Expand Up @@ -45,9 +46,11 @@ module.exports = function(grunt) {
test: {
options: {
reporter: 'spec',
timeout: '10000'
timeout: '10000',
recursive:true
},
src: ['test/*.js']
src: ['test/*.js', 'test/**/*.js'],
generator: ['test/test-generator.js']
}
},
coveralls: {
Expand Down Expand Up @@ -88,4 +91,31 @@ module.exports = function(grunt) {
grunt.log.subhead(Date());
});

// Alias the `generator:ccda_samples` task to run `mocha test --recursive --grep generator` instead
grunt.registerTask('generator:ccda_samples', 'mocha test --recursive --grep [ccda_samples]', function () {
var done = this.async();
require('child_process').exec('mocha test --recursive --grep ccda_samples', function (err, stdout) {
grunt.log.write(stdout);
done(err);
});
});

// Alias the `generator:ccda_samples` task to run `mocha test --recursive --grep generator` instead
grunt.registerTask('generator:ccda', 'mocha test --recursive --grep ccda', function () {
var done = this.async();
require('child_process').exec('mocha test --recursive --grep ccda', function (err, stdout) {
grunt.log.write(stdout);
done(err);
});
});

// Alias the `generator:ccda_samples` task to run `mocha test --recursive --grep generator` instead
grunt.registerTask('generator:sections', 'mocha test --recursive --grep sections', function () {
var done = this.async();
require('child_process').exec('mocha test --recursive --grep sections', function (err, stdout) {
grunt.log.writeln(stdout);
done(err);
});
});

};
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,68 @@ getting type as well as parsed XML for later user:
//in case of JSON stringified input, it will return {type: 'json', json: [json object here]}
```

Sensing CMS Blue Button data in text file:

``` javascript
//get document type (e.g. CMS) of document from string (and return format version)
var result = bb.senseString(data);

//printing result:
console.log(result);
```
getting:

``` javascript
{ type: 'cms', version: '2.0' }
```

getting type as well as parsed XML for later user:

``` javascript

{ type: 'ccda', xml: { errors: [] } }
//xml "errors" is just default print of libxmljs parsed XML object

//in case of JSON stringified input, it will return {type: 'json', json: [json object here]}

```

Parsing into JSON data model from CMS text file

``` javascript
//read in the file
var textString = fs.readFileSync("cms_sample.txt").toString();

//convert the string text file into blue button model
var result = bb.parseText(textString);

console.log(result);
```
getting:

``` javascript

{ data:
{ demographics:
{ name: [Object],
dob: [Object],
email: [Object],
phone: [Object],
address: [Object] },
vitals: [ [Object], [Object] ],
results: [ [Object] ],
medications: [ [Object], [Object] ],
allergies: [ [Object], [Object] ],
immunizations: [ [Object], [Object], [Object] ],
problems: [ [Object], [Object] ],
insurance: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
claims: [ [Object], [Object], [Object], [Object], [Object] ] },
meta:
{ type: 'cms',
version: '2.0',
timestamp: { date: '2013-03-16T05:10:00.000Z', precision: 'minute' } } }

```

Parsing into JSON data model from XML or from string

Expand Down Expand Up @@ -157,6 +219,8 @@ 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

- Full support of CCDA
Expand Down
Binary file added a.out
Binary file not shown.
21 changes: 21 additions & 0 deletions ccda-explorer/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Amida Technology Solutions

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
22 changes: 22 additions & 0 deletions ccda-explorer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ccda-explorer
=============

Cycling through CCDA-samples with blue-button.js

## Running stuff

```
npm install
git clone https://github.com/chb/sample_ccdas.git
mkdir dump
node explorer.js
cp ./dump/stats.json ./explorer/stats.js
cd explorer
python index.py
```

- It will download sample_ccda repo
- Create dump folder
- Run bb test against all CCDAs and generate stuff in dump
- Copy dump results to explorer
- Run python script to generate explorer webpage with success/fail stats (index_py.html)
Loading

0 comments on commit 7fed570

Please sign in to comment.