lib/generator/codes_to_json.rb in hqmf2js-1.1.0 vs lib/generator/codes_to_json.rb in hqmf2js-1.2.0

- old
+ new

@@ -14,13 +14,13 @@ # make sure we have a string keyed hash value_sets = JSON.parse(value_sets.to_json) translation = {} value_sets.each do |value_set| code_sets = {} - value_set["code_sets"].each do |code_set| - code_sets[code_set["code_set"]] ||= [] - code_sets[code_set["code_set"]].concat(code_set["codes"]) + value_set["concepts"].each do |code_set| + code_sets[code_set["code_system_name"]] ||= [] + code_sets[code_set["code_system_name"]].concat(code_set["code"].to_a) end translation[value_set["oid"]] = code_sets end @@ -33,10 +33,11 @@ # Originally formatted like this: # <CodeSystems> # <ValueSet id="2.16.840.1.113883.3.464.1.14" displayName="birth date"> # <ConceptList xml:lang="en-US"> # <Concept code="00110" codeSystemName="HL7" displayName="Date/Time of birth (TS)" + # codeSystemVersion="3"/> # </ConceptList> # </ValueSet> # </CodeSystems> # @@ -76,6 +77,6 @@ doc = Nokogiri::XML(File.new(path)) end end end -end \ No newline at end of file +end