-
Notifications
You must be signed in to change notification settings - Fork 102
Lack of consistent date fallback method #136
Comments
Yeah, I've definitely noticed this as well. Should absolutely be some shared code to process an |
FYI, we talked about the |
Go4it @blacktm |
@thetylerhayes Just the motivation I needed 🤘 |
I'm looking at this as well. One other thing I ran into recently (not bb.js) is the coded representations for nullFlavor. PINF, etc. In the event we get a nullFlavor, would we prefer to return that in place of the date? Or set it as its own value? EX:
Return....
or
? |
OK - I've got a version that handles this and returns back an interpreted form of "dates" based on the structure of the given element. EX:
Would be interpreted as a date range
Would be interpreted as a fixed date. I'm also returning the type of date ("date" or "date_range") in the response. To avoid breaking all other consumers of dates in bb.js I'm returning the same structure I've seen in other areas of the system. This is varied by the type of date returned. EX: Fixed date:
vs.
From there you can add this to your data collection in the caller. Only problem is since I'm using a variable key, you can't just neatly nest it in the data response. You have to create your data then directly add it using the variable key. EX:
I'm honestly not too sure about the approach. The other option is to provide an argument to the method and say "look, I really don't care what you have - just return this as a single fixed date, even if you're a range. You sort it out." That's another option. Or - have a uniform response in all bb.js date responses where bb.js responds with "here's all date information" and then we don't use variable keys, but have one "date" concept wrapper that incorporates the date type, date, start date, end date, etc. No matter what, addressing dates will probably break some things. I'm looking at Right now it does the following:
So there is no concept of a start/end - just a date. That's probably OK (but not idea) for outpatient visits, but for inpatient stays - problematic. I'd actually like to change that. I'm glad to run with this, but would really love any ideas on the topic. :) -Eric |
Looking through real-world CCDA files, I see a lot of switching back and forth between using
<effectiveTime value=...>
vs.<effectiveTime><low ...><high ...>
. Almost arbitrarily—tough to nail down when/why people use one vs. the other.I noticed ccda/immunizations.js falls back on the latter when the former doesn't exist. But no other CCDA parsers employ this.
I noticed this after submitting #135 which effectively updates ccda/results.js to include this fallback behavior too.
The text was updated successfully, but these errors were encountered: