We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi everyone, I am a novice of ruby-hl7 but I was wondering which is the preferred way to work with dates elements.
When saving I can set to DateTime like this:
segment.patient_dob = DateTime.now
but when reading, I get a string:
puts segment.patient_dob "20160624155955"
I have to manually convert from String to DateTime everytime. Is it the standard approach?
The text was updated successfully, but these errors were encountered:
DateTime casting to String is also missing the time zone (%z).
Sorry, something went wrong.
To set the date we are patching Date, Time and DateTime to add the .to_hl7 method:
Date
Time
DateTime
.to_hl7
Time.parse('01:23').to_hl7 => "20151202012300" Time.now.to_hl7(3) => "20151202153652.302"
There is a comment on this file: https://github.com/ruby-hl7/ruby-hl7/blob/master/lib/core_ext/date_time.rb about adding a method Date.from_hl7( hl7_date ) to return a date from the hl7 format. Feel free to create a PR to solve this method, let me know if you need help with that.
Date.from_hl7( hl7_date )
No branches or pull requests
Hi everyone,
I am a novice of ruby-hl7 but I was wondering which is the preferred way to work with dates elements.
When saving I can set to DateTime like this:
but when reading, I get a string:
I have to manually convert from String to DateTime everytime. Is it the standard approach?
The text was updated successfully, but these errors were encountered: