You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have to do (seg.field || "").split(seg.item_delim) a lot, and it's pretty silly. What would a good API to do this from the gem look like?
Ideally it would be something like obx.units[4], but that would break the existing API and might be confusing when some fields are arrays and some are strings. So maybe this should be a new method.
What about something like HL7::Message::Segment.split_field(obx.units)? It's quite verbose but I'm not sure where else to hang the function. It should handle nil and return an empty array.
Does anyone have any thoughts about this?
The text was updated successfully, but these errors were encountered:
What do you think about something like obx.fetch_field(:units, 4)? With the option of sending a third parameter as a default value just like fetch. What you think?
We have to do
(seg.field || "").split(seg.item_delim)
a lot, and it's pretty silly. What would a good API to do this from the gem look like?Ideally it would be something like
obx.units[4]
, but that would break the existing API and might be confusing when some fields are arrays and some are strings. So maybe this should be a new method.What about something like
HL7::Message::Segment.split_field(obx.units)
? It's quite verbose but I'm not sure where else to hang the function. It should handlenil
and return an empty array.Does anyone have any thoughts about this?
The text was updated successfully, but these errors were encountered: