Sha256: 9d1d347e44a1d3d6445b2a5b54bb40a6c5d5662f9ac78d61bb3ba79e3e0a3d69

Contents?: true

Size: 757 Bytes

Versions: 1

Compression:

Stored size: 757 Bytes

Contents

module QME
  module Bundle
    class EHPatientImporter
      def self.load(db, spreadsheet, effective_date=nil)
        spreadsheet.worksheets.each do |worksheet|
          ms = EHMeasureSheet.new(db, worksheet, effective_date)
          ms.parse
          qc_document = ms.query_cache_document
          db['query_cache'].insert(qc_document)
          ms.patient_cache_documents.each do |pcd|
            db['patient_cache'].insert(pcd)
          end
          ms.patient_updates.each do |patient_update|
            db['records'].find('medical_record_number' => patient_update['medical_record_number']).update(
                               '$push' => {'measure_ids' => patient_update['measure_id']})
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quality-measure-engine-2.1.0 lib/qme/bundle/eh_patient_importer.rb