Skip to content

Commit

Permalink
everything but allergies and social history is clean
Browse files Browse the repository at this point in the history
  • Loading branch information
kachok committed Aug 20, 2014
1 parent 909237e commit 2efd689
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 120 deletions.
90 changes: 8 additions & 82 deletions example/cms.json
Expand Up @@ -297,7 +297,9 @@
"problems": [
{
"problem": {
"name": "Arthritis"
"code": {
"name": "Arthritis"
}
},
"date_time": {
"low": {
Expand All @@ -312,7 +314,9 @@
},
{
"problem": {
"name": "Asthma"
"code": {
"name": "Asthma"
}
},
"date_time": {
"low": {
Expand Down Expand Up @@ -1678,85 +1682,7 @@
---
false
{
"valid": false,
"errors": [
{
"code": "OBJECT_ADDITIONAL_PROPERTIES",
"message": "Additional properties not allowed",
"path": "#/data/claims/[0]/lines/[0]",
"params": {
"properties": [
"line",
"modifier",
"type"
]
}
},
{
"code": "OBJECT_ADDITIONAL_PROPERTIES",
"message": "Additional properties not allowed",
"path": "#/data/claims/[1]/lines/[0]",
"params": {
"properties": [
"line"
]
}
},
{
"code": "OBJECT_ADDITIONAL_PROPERTIES",
"message": "Additional properties not allowed",
"path": "#/data/claims/[1]/lines/[1]",
"params": {
"properties": [
"line"
]
}
},
{
"code": "OBJECT_ADDITIONAL_PROPERTIES",
"message": "Additional properties not allowed",
"path": "#/data/claims/[1]/lines/[2]",
"params": {
"properties": [
"line",
"modifier"
]
}
},
{
"code": "OBJECT_ADDITIONAL_PROPERTIES",
"message": "Additional properties not allowed",
"path": "#/data/claims/[1]/lines/[3]",
"params": {
"properties": [
"line"
]
}
},
{
"code": "OBJECT_ADDITIONAL_PROPERTIES",
"message": "Additional properties not allowed",
"path": "#/data/claims/[2]/lines/[0]",
"params": {
"properties": [
"line",
"modifier",
"type"
]
}
},
{
"code": "OBJECT_ADDITIONAL_PROPERTIES",
"message": "Additional properties not allowed",
"path": "#/data/claims/[2]/lines/[1]",
"params": {
"properties": [
"line",
"modifier",
"type"
]
}
}
],
"valid": true,
"errors": [],
"warnings": []
}
31 changes: 18 additions & 13 deletions example/example3.json
Expand Up @@ -498,15 +498,17 @@
"identifier": "db734647-fc99-424c-a864-7e3cda82e703",
"extension": "45665"
}],
"value": {
"name": "Pneumonia",
"code": "233604007",
"code_system_name": "SNOMED CT"
},
"date_time": {
"low": {
"date": "2007-01-03T00:00:00Z",
"precision": "day"
}
},
"name": "Pneumonia",
"code": "233604007",
"code_system_name": "SNOMED CT"
}
}]
}],
"allergies": [{
Expand All @@ -528,7 +530,6 @@
"date_time": {
"low": {
"date": "2007-05-01T00:00:00Z",

"precision": "day"
}
},
Expand Down Expand Up @@ -1038,8 +1039,11 @@
}],
"negation_indicator": false,
"problem": {
"name": "Pneumonia",
"code": "233604007",
"code": {
"name": "Pneumonia",
"code": "233604007",
"code_system_name": "SNOMED CT"
},
"date_time": {
"low": {
"date": "2008-01-03T00:00:00Z",
Expand All @@ -1049,8 +1053,7 @@
"date": "2008-01-03T00:00:00Z",
"precision": "day"
}
},
"code_system_name": "SNOMED CT"
}
},
"onset_age": "57",
"onset_age_unit": "Year",
Expand Down Expand Up @@ -1087,8 +1090,11 @@
}],
"negation_indicator": false,
"problem": {
"name": "Asthma",
"code": "195967001",
"code": {
"name": "Asthma",
"code": "195967001",
"code_system_name": "SNOMED CT"
},
"date_time": {
"low": {
"date": "2007-01-03T00:00:00Z",
Expand All @@ -1098,8 +1104,7 @@
"date": "2008-01-03T00:00:00Z",
"precision": "day"
}
},
"code_system_name": "SNOMED CT"
}
},
"onset_age": "57",
"onset_age_unit": "Year",
Expand Down
2 changes: 1 addition & 1 deletion lib/parser/ccda/sections/encounters.js
Expand Up @@ -16,7 +16,7 @@ var exportEncountersSection = function (version) {
["value", "1..1", "h:value", shared.ConceptDescriptor],
["date_time", "1..1", "h:effectiveTime", shared.EffectiveTime]
]);
finding.cleanupStep(cleanup.extractAllFields(['value']));
//finding.cleanupStep(cleanup.extractAllFields(['value']));

// Iff needed add this later by refactoring Problem Observation from Problems. They should share.
//var diagnosis = component.define("diagnosis");
Expand Down
14 changes: 8 additions & 6 deletions lib/parser/ccda/sections/problems.js
Expand Up @@ -25,13 +25,15 @@ var exportProblemsSection = function (version) {

var ProblemObservation = component.define("ProblemObservation2")
.fields([
["name", "0..1", "@displayName"],
["code", "1..1", "@code"],
["system", "1..1", "@codeSystem"],
["code_system_name", "0..1", "@codeSystemName"],
["nullFlavor", "0..1", "@nullFlavor"],
//["name", "0..1", "@displayName"],
//["code", "1..1", "@code"],
//["system", "1..1", "@codeSystem"],
//["code_system_name", "0..1", "@codeSystemName"],
//["nullFlavor", "0..1", "@nullFlavor"],
["code", "0..1", "../h:value", shared.ConceptDescriptor],
["date_time", "0..1", "../h:effectiveTime", shared.EffectiveTime],
]).cleanupStep(cleanup.augmentConcept).cleanupStep(cleanup.removeField('system'));
]);
//.cleanupStep(cleanup.augmentConcept).cleanupStep(cleanup.removeField('system'));

//TODO: Cleanup/investigate negation status.
var ProblemConcernAct = component.define("ProblemConcernAct")
Expand Down
3 changes: 2 additions & 1 deletion lib/parser/cms/sections/problems.js
Expand Up @@ -22,7 +22,8 @@ function processProblemChild(rawChildObj) {
continue;
} else if (key.indexOf('name') >= 0) {
var processFunction = commonFunctions.getFunction('cda_coded_entry');
childObj.problem = processFunction(value);
var pr = childObj.problem = {};
pr.code = processFunction(value);
} else if (key.indexOf('start date') >= 0) {
var processDate = commonFunctions.getFunction('cda_date');
dateArray["low"] = processDate(value);
Expand Down
11 changes: 1 addition & 10 deletions lib/validator/schemas/encounter.json
Expand Up @@ -12,16 +12,7 @@
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"code": {
"type": "string"
},
"code_system_name": {
"type": "string"
},
"properties": {
"value": {
"$ref": "http://local.com/common_models#/properties/cda_coded_entry"
},
Expand Down
8 changes: 1 addition & 7 deletions lib/validator/schemas/problem.json
Expand Up @@ -14,14 +14,8 @@
"problem": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"code": {
"type": "string"
},
"code_system_name": {
"type": "string"
"$ref": "http://local.com/common_models#/properties/cda_coded_entry"
},
"date_time": {
"$ref": "http://local.com/common_models#/properties/cda_date"
Expand Down

0 comments on commit 2efd689

Please sign in to comment.