-
Notifications
You must be signed in to change notification settings - Fork 102
Not all of a procedures's participants are "device"s. #17
Comments
A few things. // participant => device
el = entry.tag('participant').tag('code');
var device_name = el.attr('displayName'),
device_code = el.attr('code'),
device_code_system = el.attr('codeSystem'); Designed to parse: <participant typeCode="LOC">
<participantRole classCode="SDLOC">
<templateId root="2.16.840.1.113883.10.20.22.4.32"/>
<!-- Service Delivery Location template -->
<code code="GACH" codeSystem="2.16.840.1.113883.5.111" codeSystemName="HL7 RoleCode" displayName="General Acute Care Hospital"/> Instead of grabbing the el = entry.template('2.16.840.1.113883.10.20.22.4.4').tag('code');
var name = el.attr('displayName'),
code = el.attr('code'),
code_system = el.attr('codeSystem'); |
Yes -- going on participant is picking up not only devices, but also service delivery locations. (Ideally you'd define the entire path segment, e.g. |
FWIW we already do something similar to this in the C32 results parser: https://github.com/blue-button/bluebutton.js/blob/master/lib/parsers/c32/results.js#L36:
So some sorta kinda precedent exists. |
Yep, I have a fix for this on https://github.com/blue-button/bluebutton.js/pull/127/files#diff-e8efe13f6db4f401b317888b6d6cc9f4R39. Working on getting that PR ready for merge. |
Was this merged into master? I still see the above code with "participant => device". Is the example @jmandel mentioned just a data problem in the official example ccda? |
@norlowski The code on master looks like this:
So it now looks specifically for a tag that identifies a device. This should mean that only actual devices get parsed as devices. You can see in 79042f5#diff-46f39fe99505a71da1d296e1f8f3969eR640 that Josh's specific example is no longer parsed as a device (or technically that the tests, which pass, had to adjust for that expectation) |
Thanks for the updates! |
For example the following is silly:
The hospital isn't listed as a device; it's listed as Service Delivery Location (
templateId = 2.16.840.1.113883.10.20.22.4.32
). You'll want to identify devices by[@templateId = '2.16.840.1.113883.10.20.22.4.37']/../playingDevice/code...
(This appears to stem from the use of
getElementsByTag
at https://github.com/blue-button/bluebutton.js/blob/master/src/core.js#L45, which recurses and finds nested elements, not just direct-children -- which can make the convenience wrappers fail in surprising ways when it doesn't find what it expects at the top of the hierarchy.)The text was updated successfully, but these errors were encountered: