Skip to content

Commit

Permalink
Merge pull request #15 from elationemr/defect/RM-48543-always-generat…
Browse files Browse the repository at this point in the history
…e-identifiers-property

RM-48543 always generate identifiers property for Social History
  • Loading branch information
kin-lee-ELH authored Feb 29, 2024
2 parents c45b08c + 1b9ba6d commit 59536f9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
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}];
}
})
// 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

0 comments on commit 59536f9

Please sign in to comment.