Skip to content

Commit

Permalink
Merge branch '1.1.0-beta' into mm-sprint3
Browse files Browse the repository at this point in the history
  • Loading branch information
mmccall committed Jul 24, 2014
2 parents 7d740a0 + 7e66ea2 commit b62b542
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 4 deletions.
48 changes: 48 additions & 0 deletions lib/validator/schemas/payers.json
@@ -0,0 +1,48 @@
{
"type": "array",
"$schema": "http://json-schema.org/draft-04/schema",
"properties": {
"identifiers": {
"type": "array",
"items": {
"$ref": "http://local.com/common_models#/properties/cda_id"
},
"minItems": 1
},
"policy": {
"type": "object",
"properties": {

"$ref": "http://local.com/common_models#/properties/cda_coded_entry"
}
},
"guarantor": {
"type": "object",
"properties": {
"$ref": "http://local.com/common_models#/properties/cda_coded_entry"
}
},
"participant": {
"type": "object",
"properties": {
"$ref": "http://local.com/common_models#/properties/cda_coded_entry"
}
},
"policy_holder": {
"type": "object",
"properties": {
"$ref": "http://local.com/common_models#/properties/cda_coded_entry"
}
},
"authorization": {
"type": "object",
"properties": {
"$ref": "http://local.com/common_models#/properties/cda_coded_entry"
}
}
},
"required": [
"policy"
],
"additionalProperties": false
}
8 changes: 4 additions & 4 deletions test/ccda-sections/test-payers.js
Expand Up @@ -11,20 +11,20 @@ describe('payers parser', function () {
var payers = null;
before(function (done) {

var filepath = path.join(__dirname, '../fixtures/file-snippets/CCD_1_payers.xml');
var filepath = path.join(__dirname, '../fixtures/file-snippets/CCD_1_Payers.xml');
var xml = fs.readFileSync(filepath, 'utf-8');
payers = bb.parseString(xml, {
component: 'ccda_payers'
}).data;
var writeFilePath = path.join(__dirname, '../fixtures/file-snippets/generatedJSON/CCD_1_payers.json');
var writeFilePath = path.join(__dirname, '../fixtures/file-snippets/generatedJSON/CCD_1_Payers.json');
fs.writeFileSync(writeFilePath, JSON.stringify(payers, null, 4), 'utf-8');
done();
});

it('full deep check', function (done) {
expect(payers).to.exist;
console.log(JSON.stringify(payers, null, 10));
var filepath = path.join(__dirname, '../fixtures/file-snippets/json/CCD_1_payers.json');
// console.log(JSON.stringify(payers, null, 10));
var filepath = path.join(__dirname, '../fixtures/file-snippets/json/CCD_1_Payers.json');
var json2Read = fs.readFileSync(filepath, 'utf-8');
var expected = jsutil.jsonParseWithDate(json2Read);
expect(payers).to.deep.equal(expected);
Expand Down

0 comments on commit b62b542

Please sign in to comment.