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.

Enhancement: Generalized "code" capture with translations #162

@ewhitley

Description

@ewhitley

Hello -

I'm submitting this as an advanced "I'd like to work on this" enhancement so I can get feedback on whether it's worthwhile.

I'm seeing repeated capture of code/codeSystem elements ala:

// performer
el = entry.tag('performer').tag('code');
var performer_name = el.attr('displayName'),
    performer_code = el.attr('code'),
    performer_code_system = el.attr('codeSystem'),
    performer_code_system_name = el.attr('codeSystemName');

In some places translations are applied. In others, not.

I'd like to introduce a generalized getCodedEntry(el) method that would uniformly return the following:

  • name : (String) displayName (or the appropriate embedded text or originalText if displayName is missing)
  • code : (String) code
  • code_system : (String) codeSystem OID
  • code_system_name : (String) codeSystemName
  • code_system_version : (String) codeSystemVersion
  • null_flavor : (String) nullFlavor (I've seen this a lot in systems without vocabulary mappings). Case in point <code codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" nullFlavor="UNK"> Even if code is left null, I don't see any harm in being explicit about why and adding nullFlavor
  • translations : (Array) List of all child translation coded entries. This would be present in all results.

From there it would be used like...

el = entry.tag('performer').tag('code');
var performer = getCodedEntry(el)

and magically handle obtaining all code data and any/all nested translation values in a single data gathering function.

I'm also suggesting to take it one step further. In the data capture process, I'd like to have a reference set for all vocabulary OIDs. With a given OID, we could...

  • Emit a vocabulary code system name for any not provided in the code (if they're missing). EX: OID 2.16.840.1.113883.6.96 is found with a null (absent) codeSystemName - we would resolve the codeSystemName to SNOMED CT
  • Optionally, uniformly replace all code system names with a uniform string bb.js provides. EX: We find OID 2.16.840.1.113883.6.96 with one of a given set of codeSystemName variants - "SNOMED-CT" vs. "SNOMED" vs. "SNOMED CT". We would elect to uniformly replace that with the bb.js preferred SNOMED CT.

I think this would help simplify code and present a uniform way to also handle translation capture - and all with zero impact to the existing response body.

Anyhoo - I'd like to get cracking on that :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions