Class: HQMF::DocumentConverter
- Inherits:
-
Object
- Object
- HQMF::DocumentConverter
- Defined in:
- lib/hqmf-parser/converter/pass1/document_converter.rb
Overview
Class for converting an HQMF 1.0 representation to an HQMF 2.0 representation
Constant Summary collapse
- BIRTHTIME_CODE_LIST =
{'LOINC'=>['21112-8']}
Class Method Summary collapse
Class Method Details
.convert(json, codes) ⇒ Object
7 8 9 10 11 12 13 14 15 16 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 |
# File 'lib/hqmf-parser/converter/pass1/document_converter.rb', line 7 def self.convert(json, codes) title = json[:title] description = json[:description] = json[:metadata] .keys.each {|key| [key.to_s] = [key]; .delete(key.to_sym)} id = ["NQF_ID_NUMBER"][:value] if ["NQF_ID_NUMBER"] attributes = parse_attributes() hqmf_id = json[:hqmf_id] hqmf_set_id = json[:hqmf_set_id] hqmf_version_number = json[:hqmf_version_number] measure_period = parse_measure_period(json) @data_criteria_converter = DataCriteriaConverter.new(json, measure_period) # source data criteria are the original unmodified v2 data criteria source_data_criteria = [] @data_criteria_converter.v2_data_criteria.each {|criteria| source_data_criteria << criteria} # PASS 1 @population_criteria_converter = PopulationCriteriaConverter.new(json, @data_criteria_converter) population_criteria = @population_criteria_converter.population_criteria # PASS 2 comparison_converter = HQMF::ComparisonConverter.new(@data_criteria_converter) comparison_converter.convert_comparisons(population_criteria) # PASS 3 # specific_occurrence_converter = HQMF::SpecificOccurrenceConverter.new(@data_criteria_converter) # specific_occurrence_converter.convert_specific_occurrences(population_criteria) data_criteria = @data_criteria_converter.final_v2_data_criteria populations = @population_criteria_converter.sub_measures doc = HQMF::Document.new(id, hqmf_id, hqmf_set_id, hqmf_version_number, title, description, population_criteria, data_criteria, source_data_criteria, attributes, measure_period, populations) backfill_patient_characteristics_with_codes(doc, codes) HQMF::DocumentConverter.validate(doc, codes) doc end |