diff --git a/lib/adiwg/mdtranslator/readers/mdJson/modules/module_conformanceResult.rb b/lib/adiwg/mdtranslator/readers/mdJson/modules/module_conformanceResult.rb index 26f31847..c0076ff5 100644 --- a/lib/adiwg/mdtranslator/readers/mdJson/modules/module_conformanceResult.rb +++ b/lib/adiwg/mdtranslator/readers/mdJson/modules/module_conformanceResult.rb @@ -23,6 +23,11 @@ def self.unpack(hConformanceResult, responseObj) intConformanceResult[:scope] = Scope.unpack(hConformanceResult['scope'], responseObj) end + # name + if hConformanceResult.has_key?('name') + intConformanceResult[:name] = hConformanceResult['name'] + end + #specification if hConformanceResult.has_key?('specification') intConformanceResult[:specification] = Citation.unpack(hConformanceResult['specification'], responseObj) diff --git a/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageResult.rb b/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageResult.rb index db25b972..5bea7ebd 100644 --- a/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageResult.rb +++ b/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageResult.rb @@ -26,6 +26,10 @@ def self.unpack(hResult, responseObj) intResult[:scope] = Scope.unpack(hResult['scope'], responseObj) end + # name + if hResult.has_key?('name') + intResult[:name] = hResult['name'] + end # spatialRepresentationType if hResult.has_key?('spatialRepresentationType') diff --git a/lib/adiwg/mdtranslator/readers/mdJson/modules/module_descriptiveResult.rb b/lib/adiwg/mdtranslator/readers/mdJson/modules/module_descriptiveResult.rb index 62d6c73a..15da2128 100644 --- a/lib/adiwg/mdtranslator/readers/mdJson/modules/module_descriptiveResult.rb +++ b/lib/adiwg/mdtranslator/readers/mdJson/modules/module_descriptiveResult.rb @@ -25,6 +25,10 @@ def self.unpack(hResult, responseObj, inContext = nil) intResult[:scope] = Scope.unpack(hResult['scope'], responseObj) end + if hResult.has_key?('name') + intResult[:name] = hResult['name'] + end + if hResult.has_key?('statement') intResult[:statement] = hResult['statement'] end diff --git a/lib/adiwg/mdtranslator/readers/mdJson/modules/module_quantitativeResult.rb b/lib/adiwg/mdtranslator/readers/mdJson/modules/module_quantitativeResult.rb index 7e3000fb..8b44010e 100644 --- a/lib/adiwg/mdtranslator/readers/mdJson/modules/module_quantitativeResult.rb +++ b/lib/adiwg/mdtranslator/readers/mdJson/modules/module_quantitativeResult.rb @@ -25,6 +25,10 @@ def self.unpack(hResult, responseObj, inContext = nil) intResult[:scope] = Scope.unpack(hResult['scope'], responseObj) end + if hResult.has_key?('name') + intResult[:name] = hResult['name'] + end + if hResult.has_key?('value') intResult[:values] = hResult['value'] end diff --git a/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_conformanceResult.rb b/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_conformanceResult.rb index 7e7c13c7..af13418b 100644 --- a/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_conformanceResult.rb +++ b/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_conformanceResult.rb @@ -10,11 +10,12 @@ module MdJson module ConformanceResult def self.build(hConformanceResult) Jbuilder.new do |json| - json.dateTime hConformanceResult[:dateTime] - json.scope Scope.build(hConformanceResult[:scope]) - json.specification Citation.build(hConformanceResult[:specification]) - json.explanation hConformanceResult[:explanation] - json.pass hConformanceResult[:pass] + json.dateTime hConformanceResult[:dateTime] unless hConformanceResult[:dateTime].nil? + json.scope Scope.build(hConformanceResult[:scope]) unless hConformanceResult[:scope].empty? + json.name hConformanceResult[:name] unless hConformanceResult[:name].nil? + json.specification Citation.build(hConformanceResult[:specification]) unless hConformanceResult[:specification].empty? + json.explanation hConformanceResult[:explanation] unless hConformanceResult[:explanation].nil? + json.pass hConformanceResult[:pass] unless hConformanceResult[:pass].nil? end end end diff --git a/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageResult.rb b/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageResult.rb index 9249d6d4..14a392e1 100644 --- a/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageResult.rb +++ b/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageResult.rb @@ -15,6 +15,7 @@ def self.build(hCoverageResult) Jbuilder.new do |json| json.dateTime hCoverageResult[:dateTime] json.scope Scope.build(hCoverageResult[:scope]) unless hCoverageResult[:scope].empty? + json.name hCoverageResult[:name] unless hCoverageResult[:name].nil? json.spatialRepresentationType hCoverageResult[:spatialRepresentationType] json.spatialRepresentation SpatialRepresentation.build(hCoverageResult[:spatialRepresentation]) unless hCoverageResult[:spatialRepresentation].empty? json.resultContentDescription CoverageDescription.build(hCoverageResult[:resultContentDescription]) unless hCoverageResult[:resultContentDescription].empty? diff --git a/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb b/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb index 8c0810de..20d90a9a 100644 --- a/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb +++ b/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb @@ -11,6 +11,7 @@ def self.build(hResult) Jbuilder.new do |json| json.dateTime hResult[:dateTime] unless hResult[:dateTime].nil? json.scope Scope.build(hResult[:scope]) unless hResult[:scope].empty? + json.name hResult[:name] unless hResult[:name].nil? json.statement hResult[:statement] unless hResult[:statement].nil? end end diff --git a/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_quantitativeResult.rb b/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_quantitativeResult.rb index d7c7a4cd..9af7aebd 100644 --- a/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_quantitativeResult.rb +++ b/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_quantitativeResult.rb @@ -9,11 +9,12 @@ module MdJson module QuantitativeResult def self.build(hResult) Jbuilder.new do |json| - json.dateTime hResult[:dateTime] - json.scope Scope.build(hResult[:scope]) if hResult[:scope] - json.value hResult[:values] - json.valueUnits hResult[:valueUnits] - json.valueRecordType hResult[:valueRecordType] + json.dateTime hResult[:dateTime] unless hResult[:dateTime].nil? + json.scope Scope.build(hResult[:scope]) unless hResult[:scope].empty? + json.name hResult[:name] unless hResult[:name].nil? + json.value hResult[:values] unless hResult[:values].empty? + json.valueUnits hResult[:valueUnits] unless hResult[:valueUnits].nil? + json.valueRecordType hResult[:valueRecordType] unless hResult[:valueRecordType].nil? end end end