lib/hqmf-model/document.rb in health-data-standards-3.7.0 vs lib/hqmf-model/document.rb in health-data-standards-4.0.0

- old
+ new

@@ -7,11 +7,11 @@ STRATIFIED_POPULATION_TEMPLATE_ID = '2.16.840.1.113883.3.100.1.2' STRATIFIED_POPULATION_TEMPLATE_TITLE = 'Stratified' include HQMF::Conversion::Utilities - attr_reader :id, :title, :description, :measure_period, :attributes, :populations, :source_data_criteria, :hqmf_id, :hqmf_set_id, :hqmf_version_number, :cms_id + attr_reader :id, :title, :description, :measure_period, :attributes, :populations, :source_data_criteria, :hqmf_id, :hqmf_set_id, :hqmf_version_number, :cms_id, :populations_cql_map, :cql_measure_library, :observations # Create a new HQMF::Document which can be converted to JavaScript # @param [String] id # @param [String] hqmf_id # @param [String] hqmf_set_id @@ -22,11 +22,11 @@ # @param [Array#DataCriteria] data_criteria # @param [Array#DataCriteria] source_data_criteria # @param [Array#Attribute] attributes # @param [Array#Hash] populations # @param [Range] measure_period - def initialize(id, hqmf_id, hqmf_set_id, hqmf_version_number, cms_id, title, description, population_criteria, data_criteria, source_data_criteria, attributes, measure_period, populations=nil) + def initialize(id, hqmf_id, hqmf_set_id, hqmf_version_number, cms_id, title, description, population_criteria, data_criteria, source_data_criteria, attributes, measure_period, populations=nil, populations_cql_map=nil, cql_measure_library=nil, observations=nil) @id = id @hqmf_id = hqmf_id @hqmf_set_id = hqmf_set_id @hqmf_version_number = hqmf_version_number @cms_id = cms_id @@ -44,10 +44,13 @@ HQMF::PopulationCriteria::DENEXCEP => HQMF::PopulationCriteria::DENEXCEP, HQMF::PopulationCriteria::DENEX => HQMF::PopulationCriteria::DENEX } ] @measure_period = measure_period + @populations_cql_map = populations_cql_map + @cql_measure_library = cql_measure_library + @observations = observations end # Create a new HQMF::Document from a JSON hash keyed with symbols def self.from_json(json) id = json["id"] @@ -102,9 +105,15 @@ x = nil json[:attributes] = x if x = json_array(@attributes) json[:populations] = @populations + json[:populations_cql_map] = @populations_cql_map + + json[:observations] = @observations + + json[:cql_measure_library] = @cql_measure_library + json[:measure_period] = @measure_period.to_json json end