Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added extraction for Code for Problem section. #255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/parser/ccda/sections/problems.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var exportProblemsSection = function (version) {
//["nullFlavor", "0..1", "@nullFlavor"],
["code", "0..1", "h:value", shared.ConceptDescriptor],
["date_time", "0..1", "h:effectiveTime", shared.EffectiveTime],
["type", "0..1", "h:code", shared.ConceptTypes]
]);
//.cleanupStep(cleanup.augmentConcept).cleanupStep(cleanup.removeField('system'));

Expand Down
41 changes: 25 additions & 16 deletions lib/parser/ccda/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,36 @@ var shared = module.exports = Object.create(commonShared);

var TextWithReference = shared.TextWithReference = component.define("TextWithReference");
TextWithReference.fields([
["text", "0..*", "text()"],
["reference", "0..1", "./h:reference/@value"],
])
["text", "0..*", "text()"],
["reference", "0..1", "./h:reference/@value"],
])
.cleanupStep(cleanup.resolveReference);

var NegationIndicator = shared.NegationIndicator = component.define("NegationIndicator");
NegationIndicator.fields([
["negation_indicator", "0..1", "@negationInd", processor.asBoolean]
]).cleanupStep(function () {
//Flag missing negations as false.
if (this.js) {
if (!common.exists(this.js)) {
this.js.negation_indicator = false;
}
if (this.js.negation_indicator === 'true') {
this.js.negation_indicator = true;
}
["negation_indicator", "0..1", "@negationInd", processor.asBoolean]
]).cleanupStep(function () {
//Flag missing negations as false.
if (this.js) {
if (!common.exists(this.js)) {
this.js.negation_indicator = false;
}
if (this.js.negation_indicator === 'true') {
this.js.negation_indicator = true;
}
})
}
})
.cleanupStep(cleanup.replaceWithField('negation_indicator'));

// Getting code element detail to differentiate b/w Condition/Diagnosis
var ConceptTypes = shared.ConceptTypes = component.define("ConceptTypes")
.fields([
["name", "0..1", "@displayName"],
["code", "1..1", "@code"],
["system", "1..1", "@codeSystem"],
["code_system_name", "0..1", "@codeSystemName"]
]);

var conceptWoutTranslation = component.define("conceptWoutTranslation");
conceptWoutTranslation.fields([
["name", "0..1", "@displayName"],
Expand All @@ -53,8 +62,8 @@ ConceptDescriptor.fields([

var AgeDescriptor = shared.AgeDescriptor = component.define("AgeDescriptor");
AgeDescriptor.fields([
["units", "0..1", "@unit"],
])
["units", "0..1", "@unit"],
])
.cleanupStep(cleanup.augmentAge);

var SimplifiedCode = shared.SimplifiedCode = ConceptDescriptor.define("SimpifiedCode")
Expand Down