Class: Renalware::UKRDC::CreatePatientXMLFile::Payload
- Inherits:
-
Object
- Object
- Renalware::UKRDC::CreatePatientXMLFile::Payload
- Defined in:
- app/models/renalware/ukrdc/create_patient_xml_file.rb
Instance Method Summary collapse
-
#time_neutral_payload ⇒ Object
Remove the time elements from SendingFacility e.g.
- #to_md5_hash ⇒ Object
Instance Method Details
#time_neutral_payload ⇒ Object
Remove the time elements from SendingFacility e.g.
<SendingFacility channelName='Renalware' time='2018-02-26T13:18:02+00:00'/>
becomes
<SendingFacility channelName='Renalware'/>
This allows us to do payload comparisons independent of the time they were sent.
119 120 121 122 123 124 |
# File 'app/models/renalware/ukrdc/create_patient_xml_file.rb', line 119 def time_neutral_payload payload .gsub(%r{<Stream>[^<]*<\/Stream>}, "<Stream>removed</Stream>") .gsub(/ (time|start|stop)=["'][^'"]*['"]/, "") .gsub(%r{<UpdatedOn>[^<]*<\/UpdatedOn>}, "<UpdatedOn>removed</UpdatedOn>") end |
#to_md5_hash ⇒ Object
109 110 111 |
# File 'app/models/renalware/ukrdc/create_patient_xml_file.rb', line 109 def to_md5_hash @to_md5_hash ||= Digest::MD5.hexdigest(time_neutral_payload) end |