module Qrda
module Export
module Helper
module DateHelper
def value_or_null_flavor(time)
# this is a bit of a hack for a defineded undefined date
if time && DateTime.parse(time).year < 3000
"value='#{DateTime.parse(time).utc.to_formatted_s(:number)}'"
else
"nullFlavor='UNK'"
end
end
def performance_period_start
@performance_period_start.to_formatted_s(:number)
end
def performance_period_end
@performance_period_end.to_formatted_s(:number)
end
def current_time
Time.now.utc.to_formatted_s(:number)
end
def sent_date_time
""
end
def received_date_time
""
end
def active_date_time
""
end
def author_time
""
end
def author_effective_time
""
end
def birth_date_time
""
end
def result_date_time?
!self['resultDatetime'].nil?
end
def result_date_time
""
end
def expired_date_time
""\
""\
""
end
def medication_supply_request_period
""\
""\
""\
""
end
def medication_duration_author_effective_time
""\
""\
""\
""
end
def prevalence_period
""\
""\
""\
""
end
def relevant_period
""\
""\
""\
""
end
def participation_period
""\
""\
""\
""
end
def relevant_period_as_value
""
end
def relevant_date_time_low
""\
""\
""
end
def relevant_date_time_value
""
end
def medication_duration_effective_time
""\
""\
""\
""
end
def facility_period
""\
""
end
def incision_datetime
""
end
def completed_prevalence_period
self['prevalencePeriod']['high'] ? true : false
end
end
end
end
end