Skip to content
This repository was archived by the owner on Dec 1, 2017. It is now read-only.
This repository was archived by the owner on Dec 1, 2017. It is now read-only.

Question: Removing hard-coded OIDs in entry population functions #161

@ewhitley

Description

@ewhitley

Hello -

I'm reviewing BlueButton.js and trying to use it to load a wide variety of CDA document types and versions I've seen. As I'm doing so, I'm reviewing the way the javascript incorporates fixed template ID references.

EX: AllergyObservation

  • In the C32 parser, it's 2.16.840.1.113883.3.88.11.83.6
  • In the CCDA parser, it's 2.16.840.1.113883.10.20.22.4.7

In the code for the CCDA entry parser, the ID reference is fixed ala...

el = entry.template('2.16.840.1.113883.10.20.22.4.7').tag('value');

In another project I've worked on,this has become problematic to maintain (for me, at least) as the various Template IDs are versioned (R1, R2, etc.). I'm wondering what people think about removing the fixed IDs and moving them to some sort of lookup functionality.

Example idea:

var CDA_ENTRY_MAP = {
  'AllergyObservation': [
      '2.16.840.1.113883.10.20.22.4.7',  //CCDA
      '2.16.840.1.113883.3.88.11.83.6'   //C32
  ]
};

As I've tinkered with the javascript on my own personal version, I've done this (just kicking the tires) and then also changed the related entry.template() function to allow either a single string or an array of values (so you can just say "go forth and find me stuff"). It's helped me, as I've just had to go through and manage a single reference to the IDs vs. the fixed versions in the code.

Thoughts? Good idea? Bad idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions