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

RM-48543 always generate identifiers property for Social History #15

Merged
Merged
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
3 changes: 3 additions & 0 deletions lib/parser/ccda/sections/social_history.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ var exportSocialHistorySection = function (version) {
}
delete this.js.nullCodeReplacementText;
}
if (!_.has(this, "js.identifiers")) {
this.js.identifiers = [{"identifier": null}];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey I'm just curious because I don't really understand what I'm reading here
https://github.com/search?q=repo%3Aelationemr%2Fblue-button%20identifiers&type=code
It looks like "identifiers" is defined as "0..*" field in this file (line 23). Should it be changed as well ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, when the xml has nullFlavor it'll get ignored <id nullFlavor="UNK"/>, it won't get parsed. This code is in another blue-button-xml repo.

}
})
// custom step to put null flavor name on value field if present
.cleanupStep(cleanup.replaceStringFieldWithNullFlavorName("value"));
Expand Down
24 changes: 24 additions & 0 deletions test/fixtures/parser-ccda/CCD_SocialHistory_PQ_value.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3027,6 +3027,11 @@ https://github.com/HL7/C-CDA-Examples/blob/master/Documents/CCD/CCD%201/CCD.XML
<td>12</td>
<td>Since February, 2012</td>
</tr>
<tr ID="SexualOrientation21">
<td>Sexual Orientation</td>
<td ID="SexualOrientation21Value">Not on file</td>
<td/>
</tr>
</tbody>
</table>
</text>
Expand Down Expand Up @@ -3054,6 +3059,25 @@ https://github.com/HL7/C-CDA-Examples/blob/master/Documents/CCD/CCD%201/CCD.XML
</author>
</observation>
</entry>
<entry>
<observation classCode="OBS" moodCode="EVN">
<templateId extension="2022-06-01" root="2.16.840.1.113883.10.20.22.4.501"/>
<templateId root="2.16.840.1.113883.10.20.22.4.38"/>
<templateId extension="2015-08-01" root="2.16.840.1.113883.10.20.22.4.38"/>
<id nullFlavor="UNK"/>
<code code="76690-7" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Sexual orientation"/>
<text>
<reference value="#SexualOrientation21"/>
</text>
<statusCode code="completed"/>
<effectiveTime nullFlavor="UNK"/>
<value nullFlavor="UNK" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CD">
<originalText>
<reference value="#SexualOrientation21Value"/>
</originalText>
</value>
</observation>
</entry>
</section>
</component>
<!-- ************* VITAL SIGNS *************** -->
Expand Down
1 change: 1 addition & 0 deletions test/parser-ccda/test-parser-ccda.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ describe('parser.js', function () {

// social_history value was parsed
expect(result.data.social_history[0].value).toBe('12');
expect(result.data.social_history[1].identifiers[0].identifier).toBeDefined();

done();
});
Expand Down