Skip to content

Commit

Permalink
Merge branch 'js-problem-severity'
Browse files Browse the repository at this point in the history
Conflicts:
	package.json
	test/fixtures/json/CCD_1.json
  • Loading branch information
jsachs committed Mar 30, 2015
1 parent 80369ae commit c0624fc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ This approach is an alternative to direct programming or text based templates su
* Required elements are specified in the template and get `nullFlavor` automatically when no data exists.
* No coding required to add new templates.
* It is also a step in the right direction for the possible future directions
* Factoring out data model dependencies so that blue-button](https://github.com/amida-tech/blue-button) data model changes or other data models can be accomodated more easily
* Automatic generation of templates from [blue-button](https://github.com/amida-tech/blue-button) like CCDA parsers.
* Factoring out data model dependencies so that blue-button](https://github.com/amida-tech/blue-button) data model changes or other data models can be accomodated more easily
* Automatic generation of templates from [blue-button](https://github.com/amida-tech/blue-button) like CCDA parsers.

### Template Structure

Expand All @@ -91,7 +91,7 @@ The following are the properties of the templates
* `attributes`: This describes the attributes of the element. `attributes` can be an object of with `key` and `value` pairs for each attribute or it can be an array of such objects. Each attribute object or can be a function with `input` argument that returns attributes.
* `text`: This is a function with `input` attribute that returns text value of the element.
* `content`: This is an array of other templates that describe the children of the element. For a single child an object can be used.
* `dataKey`: This is the property of `input` that serves as the date for the template.
* `dataKey`: This is the property of `input` that serves as the data for the template.
* `required`: This identifies if template is required or not. If template is required and there is not value in the `input` a `nullFlavor` node is created.
* `dataTransform`: This is a function to transform the input.
* `existWhen`: This is a boolean function with `input` argument to describe it the elements should exists or not.
11 changes: 11 additions & 0 deletions lib/entryLevel/problemEntryLevel.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ var problemObservation = {
[healthStatusObservation, required]
],
existsWhen: condition.keyExists("patient_status")
}, {
key: "entryRelationship",
attributes: {
"typeCode": "SUBJ",
"inversionInd": "true"
},
content: [
[sharedEntryLevel.severityObservation]
],
dataKey: "problem",
existsWhen: condition.keyExists("severity")
}
],
notImplemented: [
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/json/CCD_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2019,4 +2019,4 @@
"nullFlavor alert: missing but required code in participant -> entry -> payers_section -> CCD",
"cardinality error: found 2 when expecting 1..1 at h:entryRelationship/h:act/h:participant"
]
}
}
8 changes: 7 additions & 1 deletion test/fixtures/json/sample.JSON
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,12 @@
"code_system_name": "SNOMED CT",
"code": "195967001",
"name": "Asthma"
},
"severity": {
"code": {
"code": "L",
"name": "Low"
}
}
},
"negation_indicator": false,
Expand Down Expand Up @@ -3731,4 +3737,4 @@
}
}
]
}
}
2 changes: 1 addition & 1 deletion test/sample_runs/test-gen-parse-gen.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('parse generate parse generate', function () {

var data = fs.readFileSync(__dirname + "/../fixtures/json/sample.JSON");

//convert string into JSON
//convert string into JSON
var result = JSON.parse(data);

// check validation
Expand Down

0 comments on commit c0624fc

Please sign in to comment.