This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| i="[cp_id]" | |
| echo "splitting care provider: $i" | |
| echo "splitting care provider: $i" >> /var/www/banff/patient_splitting_output.log | |
| date >> /var/www/banff/patient_splitting_output.log | |
| bin/rake "migrate:split_patients[$i]" >> /var/www/banff/patient_splitting_output.log | |
| echo "done" >> /var/www/banff/patient_splitting_output.log | |
| echo "" >> /var/www/banff/patient_splitting_output.log | |
| echo "" >> /var/www/banff/patient_splitting_output.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def sanity_check(cp_id) | |
| patient_count = Patient.where(care_provider_ids: cp_id).count | |
| encounter_count = Encounter.where(care_provider_id: cp_id).count | |
| patient_interaction_count = PatientInteraction.where(care_provider_id: cp_id).count | |
| patient_issue_count = PatientIssue.where(care_provider_id: cp_id).count | |
| archived_call_attempt_count = ArchivedCallAttempt.where(care_provider_id: cp_id).count | |
| puts "#{patient_count}\t#{encounter_count}\t#{patient_interaction_count}\t#{patient_issue_count}\t#{archived_call_attempt_count}" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cps=( | |
| 560188d45241493461290200 # example, can have more | |
| ) | |
| for i in "${cps[@]}" | |
| do | |
| echo "splitting care provider: $i" | |
| echo "splitting care provider: $i" >> /var/www/banff/patient_splitting_output.log | |
| date >> /var/www/banff/patient_splitting_output.log | |
| bin/rake "migrate:split_patients[$i, 1.5]" >> /var/www/banff/patient_splitting_output.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| hfhs-dcc-1 | |
| ============= | |
| 2018-04-22 17:09:29 UTC | |
| 2018-04-22 18:09:29 UTC | |
| 2018-04-22 19:09:29 UTC | |
| 2018-04-22 20:09:29 UTC | |
| 2018-04-22 21:09:29 UTC | |
| 2018-04-22 22:09:29 UTC | |
| 2018-04-22 23:09:29 UTC | |
| 2018-04-23 00:09:29 UTC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| hfhs-dcc-1 | |
| ============= | |
| 2018-04-24 03:09:31 UTC | |
| 2018-04-24 04:09:31 UTC | |
| 2018-04-24 05:09:31 UTC | |
| 2018-04-24 06:09:31 UTC | |
| 2018-04-24 07:09:32 UTC | |
| 2018-04-24 08:09:31 UTC | |
| 2018-04-24 09:09:31 UTC | |
| 2018-04-24 10:09:31 UTC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [31] pry(main)> CallHourInfo.where(date: Date.today, hour: 16).sum(:scheduled_count) | |
| 7315 | |
| [32] pry(main)> CallHourInfo.where(date: Date.today, hour: 16).sum(:launched_count) | |
| 2324 | |
| [33] pry(main)> CallHourInfo.where(date: Date.today, hour: 16).sum(:launched_count) | |
| 3350 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bin/rake locations_migrations:setup_script | |
| bin/rake orchid:patients_as_units_to_locations['54de417552414945b5070000'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [18] pry(main)> SurveyDeviceQuery.in(cp).non_patient_devices.active.gt(last_login_at: 7.days.ago).each do |device| | |
| [18] pry(main)* puts device.name | |
| [18] pry(main)* puts "=============" | |
| [18] pry(main)* puts Ahoy::Event.where(survey_device_id: device.id, name: "surveys#sync").gt(time: 120.hours.ago).map(&:time) | |
| [18] pry(main)* puts "=============" | |
| [18] pry(main)* puts "" | |
| [18] pry(main)* end | |
| hfhs-dnw-2 | |
| ============= | |
| 2018-03-26 11:31:48 UTC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| hfhs = CareProvider.find('54130e4261706f24c3040000') | |
| devices = SurveyDeviceQuery.in(hfhs).non_patient_devices.active.distinct(:_id.to_s) | |
| devices_set = Set.new(devices.map(&:to_s)) | |
| sessions = MongoidSessionStore::Session.all.each_with_index.select { |session, i| | |
| puts i if i % 10_000 == 0 | |
| devices_set.member?(session.data['current_survey_device_id'].to_s) | |
| }.map(&:first) | |
| sessions.map { |session| session.set(updated_at: Time.now + 2.weeks) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [38] pry(main)> MongoidSessionStore::Session.first | |
| #<MongoidSessionStore::Session:0x0001004c60caa0> { | |
| :_id => "0000003be350a2878805642c498689d6", | |
| :created_at => 2018-03-21 15:08:15 UTC, | |
| :data => <BSON::Binary:0x550396521800 type=generic data=0x04087b0649221a63...>, | |
| :updated_at => 2018-03-21 15:08:15 UTC | |
| } | |
| [39] pry(main)> MongoidSessionStore::Session.first.data | |
| { | |
| "current_care_provider" => BSON::ObjectId('59516787d27cbede1924d757') |
NewerOlder