Skip to content

Commit

Permalink
Merge pull request #5 from amida-tech/afsin
Browse files Browse the repository at this point in the history
Add supported_sections to root
  • Loading branch information
au2 committed Jul 31, 2014
2 parents c181de3 + fa7fae9 commit f1fbaf1
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 18 deletions.
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: node_js
node_js:
- "0.10"

before_script:
- npm install -g [email protected]
- npm install --quiet
- npm install -g mocha
- npm install -g istanbul

script:
- grunt
- istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec --recursive && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
blue-button-meta
================

Metadata about Blue Button format (CCDA) internal structures
Metadata about Blue Button format internal structures

[![NPM](https://nodei.co/npm/blue-button-meta.png)](https://nodei.co/npm/blue-button-meta/)

[![Build Status](https://travis-ci.org/amida-tech/blue-button-meta.svg)](https://travis-ci.org/amida-tech/blue-button-meta)
[![Coverage Status](https://coveralls.io/repos/amida-tech/blue-button-meta/badge.png)](https://coveralls.io/r/amida-tech/blue-button-meta)

##Usage

``` javascript
var CCDA = require("blue-button-meta").CCDA;
var bbm = require("blue-button-meta");
var CCDA = bbm.CCDA;

//CCDA Document OID
console.log(CCDA.document.templateId);
Expand All @@ -24,4 +30,6 @@ console.log(CCDA.statements);
console.log(CCDA.constraints.templates);
console.log(CCDA.constraints.sections);

//list of supported master health record sections
console.log(bbm.supported_sections);
```
58 changes: 58 additions & 0 deletions gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
module.exports = function(grunt) {

grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');

grunt.registerTask('default', ['jshint', 'mochaTest']);

// Print a timestamp (useful for when watching)
grunt.registerTask('timestamp', function() {
grunt.log.subhead(Date());
});

grunt.initConfig({
jshint: {
files: ['./lib/*/*.js', 'test.js', 'gruntfile.js', 'package.json', 'index.js'],
options: {
browser: true,
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: false,
boss: true,
eqnull: true,
node: true,
expr: true,
globals: {
'xit': true,
'xdescribe': true,
'it': true,
'describe': true,
'before': true,
'after': true,
'done': true
}
}
},
watch: {
all: {
files: ['./lib/*/*.js', 'test.js', 'index.js', 'gruntfile.js'],
tasks: ['default']
}
},
mochaTest: {
test: {
options: {
reporter: 'spec',
timeout: '1000'
},
src: ['test.js']
}
}
});
};
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ var CCDA = require("./lib/CCDA/index.js");
var meta = {};
meta.CCDA = CCDA;

meta.supported_sections = ['allergies', 'procedures', 'immunizations', 'medications', 'encounters', 'vitals', 'results', 'social_history', 'demographics', 'problems'];

module.exports = exports = meta;
2 changes: 1 addition & 1 deletion lib/CCDA/code-systems.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ var codeSystems = {
"CPT-4": "2.16.840.1.113883.6.12",
"CVX": "2.16.840.1.113883.12.292",
"HL7ActCode": "2.16.840.1.113883.5.4"
}
};

module.exports = exports = codeSystems;
3 changes: 2 additions & 1 deletion lib/CCDA/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var statements = require("./clinicalstatements.js");

var templatesconstraints = require("./templates-constraints.js");
var sectionsconstraints = require("./sections-constraints.js");
var codeSystems = require("./code-systems.js");

//General Header Constraints
var CCDA = {
Expand Down Expand Up @@ -92,7 +93,7 @@ var CCDA = {
}
]
*/
}
};

//Good source http://cdatools.org/SectionMatrix.html
//and http://cdatools.org/ClinicalStatementMatrix.html
Expand Down
21 changes: 13 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "blue-button-meta",
"version": "0.1.0",
"version": "0.1.1",
"description": "Metadata about Blue Button format (CCDA) internal structures",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"bluebutton",
"metadata",
"ccda"
],
"author": "Dmitry Kachaev <[email protected]> (http://github.com/kachok)",
Expand All @@ -19,17 +20,21 @@
"type": "git",
"url": "https://github.com/amida-tech/blue-button-meta.git"
},
"keywords": [
"bluebutton", "metadata", "ccda"
],
"bugs": {
"url": "https://github.com/amida-tech/blue-button-meta/issues"
},
"homepage": "https://github.com/amida-tech/blue-button-meta",
"devDependencies": {
"should": "3.1.x",
"assert": "1.1.x",
"mocha": "1.17.x",
"chai": "1.8.x"
"grunt": "0.4.x",
"grunt-contrib-jshint": "0.8.x",
"grunt-contrib-watch": "0.6.x",
"grunt-mocha-test": "0.10.x",
"grunt-coveralls": "*",
"grunt-istanbul-coverage": "*",
"coveralls": "~2.10.0",
"mocha-lcov-reporter": "0.0.1",
"should": "3.1.x",
"mocha": "1.17.x",
"chai": "1.8.x"
}
}
16 changes: 10 additions & 6 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
var expect = require('chai').expect;
var assert = require('chai').assert;

var meta = require("./index.js").CCDA;
var bbm = require("./index.js");
var ccda = bbm.CCDA;

describe('blue-button-meta.js test', function(){


it('9 templates', function(){
expect(Object.keys(meta.templates)).to.have.length(9);
expect(Object.keys(ccda.templates)).to.have.length(9);
});

it('70 sections', function(){
expect(Object.keys(meta.sections)).to.have.length(70);
expect(Object.keys(ccda.sections)).to.have.length(70);
});

it('76 clinical statements', function(){
expect(Object.keys(meta.statements)).to.have.length(76);
expect(Object.keys(ccda.statements)).to.have.length(76);
});

it('10 supported sections', function(){
expect(Object.keys(bbm.supported_sections)).to.have.length(10);
});

});
});

0 comments on commit f1fbaf1

Please sign in to comment.