-
Notifications
You must be signed in to change notification settings - Fork 100
Enhancement: Generalized "code" capture with translations #162
Description
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 embeddedtext
ororiginalText
ifdisplayName
is missing)code
: (String)code
code_system
: (String)codeSystem
OIDcode_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 ifcode
is left null, I don't see any harm in being explicit about why and addingnullFlavor
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 thecodeSystemName
toSNOMED 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 preferredSNOMED 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 :)