Coder Social home page Coder Social logo

Comments (7)

blacktm avatar blacktm commented on August 27, 2024

A few things. <participant> is mapped to device, from your earlier suggestion. This is what I have in bb.js:

// 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 participant tag, I should grab by templateId? That would look something like this (a snippet from problems):

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');

from bluebutton.js.

jmandel avatar jmandel commented on August 27, 2024

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. participant/participantRole/templateId[@root="..."]/../code" which could make the behavior more predictable.)

from bluebutton.js.

thetylerhayes avatar thetylerhayes commented on August 27, 2024

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:

... 
// sometimes results organizers contain non-results. we only want tests
    if (observation.template('2.16.840.1.113883.10.20.1.31').val()) {
        var date = parseDate(observation.tag('effectiveTime').attr('value'));
...

So some sorta kinda precedent exists.

from bluebutton.js.

sankarravi avatar sankarravi commented on August 27, 2024

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.

from bluebutton.js.

norlowski avatar norlowski commented on August 27, 2024

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?

from bluebutton.js.

sankarravi avatar sankarravi commented on August 27, 2024

@norlowski The code on master looks like this:

    // participant => device
    el = entry.template('2.16.840.1.113883.10.20.22.4.37').tag('code');
    var device_name = el.attr('displayName'),
        device_code = el.attr('code'),
        device_code_system = el.attr('codeSystem');

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)

from bluebutton.js.

norlowski avatar norlowski commented on August 27, 2024

Thanks for the updates!

from bluebutton.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.