Conversation
| }; | ||
|
|
||
| export const DATETIME_CONCEPTS = [ | ||
| "6234d61b-4c77-4af6-9bbb-533e44c03f24" // Date specimen received at laboratory |
There was a problem hiding this comment.
Obviously if we were supporting this long term, we wouldn't do this, but this works for now
There was a problem hiding this comment.
Fair.
Can we add a comment noting this on the odd chance this OWA sticks around for a bit and we forget why we did this?
| else { | ||
| val = val.substring(0, 10) | ||
| } | ||
| } |
There was a problem hiding this comment.
This whole thing should really be unnecessary, but I'd rather hack here than in the REST module, just to get this working. That said, the REST module seems a bit...odd. Basically, the REST module uses the obs.setValueFromString method to set datetime values, which are required to be yyyy-MM-dd if the concept datatype is date, and required to be (very strangely) yyyy-MM-dd hh:mm if the concept datatype is a datetime/timestamp. That just doesn't seem right, but I'd rather we ticket / discuss separately from this. So here, I'm just hacking in some handling where - if a date value is coming through with the full date/time/timezone information as is currently happening, just reformat it to those expected formats. Hopefully this works for as long as we need it to, before we put this out to pasture.
There was a problem hiding this comment.
Yeah, that seems wrong for the datetime use case... I feel like I might have ran into this recently, but a quick OpenMRS Jira search didn't turn up anything.
Overall, for date-only, I do think this is the correct behavior.
mogoodrich
left a comment
There was a problem hiding this comment.
A couple comments but LGTM, thanks @mseaton !
| else { | ||
| val = val.substring(0, 10) | ||
| } | ||
| } |
There was a problem hiding this comment.
Yeah, that seems wrong for the datetime use case... I feel like I might have ran into this recently, but a quick OpenMRS Jira search didn't turn up anything.
Overall, for date-only, I do think this is the correct behavior.
| }; | ||
|
|
||
| export const DATETIME_CONCEPTS = [ | ||
| "6234d61b-4c77-4af6-9bbb-533e44c03f24" // Date specimen received at laboratory |
There was a problem hiding this comment.
Fair.
Can we add a comment noting this on the odd chance this OWA sticks around for a bit and we forget why we did this?
No description provided.