17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_orderProcess.rb', line 17
def self.unpack(hOrder, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hOrder.empty?
@MessagePath.issueWarning(610, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intOrder = intMetadataClass.newOrderProcess
if hOrder.has_key?('fees')
unless hOrder['fees'] == ''
intOrder[:fees] = hOrder['fees']
end
end
if hOrder.has_key?('plannedAvailability')
unless hOrder['plannedAvailability'].empty?
hDate = DateTime.unpack(hOrder['plannedAvailability'], responseObj)
unless hDate.nil?
intOrder[:plannedAvailability] = hDate
end
end
end
if hOrder.has_key?('orderingInstructions')
unless hOrder['orderingInstructions'] == ''
intOrder[:orderingInstructions] = hOrder['orderingInstructions']
end
end
if hOrder.has_key?('turnaround')
unless hOrder['turnaround'] == ''
intOrder[:turnaround] = hOrder['turnaround']
end
end
return intOrder
end
|