blue-button / bluebutton.js

The Blue Button JavaScript Library
blue-button.github.io/bluebutton.js
Other
152 stars 102 forks source link

Free-floating "translation" elements don't make sense #12

Closed jmandel closed 11 years ago

jmandel commented 11 years ago

Translations are translations of codes, so they should be attached to codes. The following free-floating translation attached to your encounter example doesn't make sense to me:

{
    "date": "2000-05-07T05:00:00.000Z",
    "name": "Office consultation - 15 minutes",
    "code": "99241",
    "code_system": "2.16.840.1.113883.6.12",
    "code_system_name": "CPT",
    "code_system_version": "4",
    "finding": {
      "name": "Bronchitis",
      "code": "32398004",
      "code_system": "2.16.840.1.113883.6.96"
    },
    "translation": {
      "name": "Ambulatory",
      "code": "AMB",
      "code_system": "2.16.840.1.113883.5.4",
      "code_system_name": "HL7 ActEncounterCode"
    }, 
...

This should probably read:

 {
    "date": "2000-05-07T05:00:00.000Z",
    "encounter_type": {
        "name": "Office consultation - 15 minutes",
        "code": "99241",
        "code_system": "2.16.840.1.113883.6.12",
        "code_system_name": "CPT",
        "code_system_version": "4",
        "translations": [{
            "name": "Ambulatory",
            "code": "AMB",
            "code_system": "2.16.840.1.113883.5.4",
            "code_system_name": "HL7 ActEncounterCode"
        }],

Also note that translations are multiple cardinality.

robdodson commented 11 years ago

It looks like these also appear in immunizations and medications and possibly other places. So would we also do immunization_type, medication_type?

I also noticed that according to the HL7 spec translations are allowed inside Immunizations Medication (5.35) and Medication Information (5.41). However there's no mention of translations under Encounter Activities (5.21). If you look at the HL7 sample CCD.xml it uses the proper templateId's in Medications and Immunizations to allow for translation elements. But in their Encounters section they just throw a translation in there. Do you know if there's a section in the docs which explains if/why that is ok?

jmandel commented 11 years ago

Basically anywhere a CD appears, translations are allowed inside the CD. So for practical purposes, nearly every code can have a translation.

In the SMART JSON representation of CCDA, we include a translations array inside each code. (We also define each element in terms of consistent building blocks like 'code' and 'physical quantity', which means we don't have to reproduce the extraction logic.) On Jul 28, 2013 3:11 PM, "Rob Dodson" notifications@github.com wrote:

It looks like these also appear in immunizations and medications and possibly other places. So would we also do immunization_type, medication_type?

I also noticed that according to the HL7 spec translations are allowed inside Immunizations Medication (5.35) and Medication Information (5.41). However there's no mention of translations under Encounter Activities (5.21). If you look at the HL7 sample CCD.xml it uses the proper templateId's in Medications and Immunizations to allow for translation elements. But in their Encounters section they just throw a translation in there. Do you know if there's a section in the docs which explains if/why that is ok?

— Reply to this email directly or view it on GitHubhttps://github.com/blue-button/bluebutton.js/issues/12#issuecomment-21689007 .

robdodson commented 11 years ago

Two newb questions: Can you define the term CD (care document?) and point me to the SMART JSON?

robdodson commented 11 years ago

Otherwise that seems to make sense. I just looked through section 1.8.6 again to brush up on the translation stuff.

jmandel commented 11 years ago

Sorry for the sketched-out response -- that's what I get for trying to answer on my phone.

The SMART C-CDA Receiver includes logic for generating JSON representation of C-CDA (which is similar to BB.js's representation). Here's a direct link to the "browserifying" branch which was an experiment to make the logic run browser-side: https://github.com/chb/ccdaReceiver/blob/browserifying/lib/ccda/ccd.js#L28

Brief documentation of the JSON definitions here: https://github.com/chb/ccdaReceiver/wiki/Data-Types-and-Payloads

Re: "CD": the following table is from the Keith Boone's The CDA Book: image

Effectively, "CD" means "concept descriptor". It's the full-fledged, all-the-bells-and-whistles representation of a code in a CDA (including display name, translations, qualifiers, etc). "CE" (Coded with equivalents) is slightly constrained to eliminate qualifiers, but can still have translations.

In C-CDA, the major entry-level codes (answering questions "Which medication?", "which immunization?", "which allergen?" etc.) permit translations. (I'm not totally clear on whether they're CD or CE, or on where this is defined -- I believe there is an open issue to clarify this.)

robdodson commented 11 years ago

Wow thanks for the thorough response. I just looked through the ccdaReceiver stuff, it's really cool and I get what you're saying about not duplicating the extraction logic. I've been kind of wondering to myself how to make bb.js handle the xml in a more general way instead of really specific sections. But I think I need to understand the C-CDA material better before I can do anything in that space.

For now I think I see a way forward on this particular ticket, so thanks again. I'll try to put together a PR at some point.

blacktm commented 11 years ago

This issue has been documented (#15 and #36), and we'll resolve it while reviewing the BB JSON more broadly.