class ADIWG::Mdtranslator::Writers::Iso19115_1::MD_StandardOrderProcess

Public Class Methods

new(xml, hResponseObj) click to toggle source
# File lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_orderProcess.rb, line 14
def initialize(xml, hResponseObj)
   @xml = xml
   @hResponseObj = hResponseObj
end

Public Instance Methods

writeXML(hOrder) click to toggle source
# File lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_orderProcess.rb, line 19
def writeXML(hOrder)
   
   @xml.tag!('mrd:MD_StandardOrderProcess') do

      # order process - fees
      unless hOrder[:fees].nil?
         @xml.tag!('mrd:fees') do
            @xml.tag!('gco:CharacterString', hOrder[:fees])
         end
      end
      if hOrder[:fees].nil? && @hResponseObj[:writerShowTags]
         @xml.tag!('mrd:fees')
      end

      # order process - plannedAvailableDateTime {DateTime}
      hDateTime = hOrder[:plannedAvailability]
      unless hDateTime.empty?
         paDateTime = hDateTime[:dateTime]
         paDateRes = hDateTime[:dateResolution]
         @xml.tag!('mrd:plannedAvailableDateTime') do
            dateTimeStr =
               AdiwgDateTimeFun.stringDateTimeFromDateTime(paDateTime, paDateRes)
            @xml.tag!('gco:DateTime', dateTimeStr)
         end
      end
      if hDateTime.empty? && @hResponseObj[:writerShowTags]
         @xml.tag!('mrd:plannedAvailableDateTime')
      end

      # order process - orderingInstructions
      unless hOrder[:orderingInstructions].nil?
         @xml.tag!('mrd:orderingInstructions') do
            @xml.tag!('gco:CharacterString', hOrder[:orderingInstructions])
         end
      end
      if hOrder[:orderingInstructions].nil? && @hResponseObj[:writerShowTags]
         @xml.tag!('mrd:orderingInstructions')
      end

      # order process - turnaround
      unless hOrder[:turnaround].nil?
         @xml.tag!('mrd:turnaround') do
            @xml.tag!('gco:CharacterString', hOrder[:turnaround])
         end
      end
      if hOrder[:turnaround].nil? && @hResponseObj[:writerShowTags]
         @xml.tag!('mrd:turnaround')
      end

      # order process - orderOptions -  not implemented

      # order process - orderOptionsType -  not implemented

   end # mrd:MD_StandardOrderProcess tag
end