This file contains 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 detect_bad_item_rows(input) | |
ids = [] | |
input.each_with_index do |data, i| | |
if source = data["source_attributes"] | |
if rows = source["row_attributes"] | |
rows.each_with_index do |r, j| | |
if r["type"] == "ItemRow" && r["mandatory"] == false && r.keys.count == 3 | |
ids << {array_index: i, row_attributes_index: j} | |
end | |
end |
This file contains 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 diagnoses_belongs_to_me | |
diagnoses_ids = [] | |
rows_array = form.rows.to_a[0...self.position - 1].reverse | |
rows_array.each do |r| | |
next if r.id == self.id | |
break if r.kind_of?(Journal::FormRow::ItemRow) or (r.kind_of?(Journal::FormRow::LabSampleRow) and r.billing_record_rows.any?) | |
if r.kind_of?(Journal::FormRow::DiagnosisRow) && r.diagnosis_id | |
diagnoses_ids << r.diagnosis_id |
This file contains 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
=> Booting Thin | |
=> Rails 4.2.1 application starting in development on http://localhost:3000 | |
=> Run `rails server -h` for more startup options | |
=> Ctrl-C to shutdown server | |
Thin web server (v1.6.3 codename Protein Powder) | |
Maximum connections set to 1024 | |
Listening on localhost:3000, CTRL+C to stop | |
Started GET "/" for 127.0.0.1 at 2015-06-01 11:49:34 +0200 |
This file contains 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
2202 I, [2015-06-04T13:51:11.230236 #8457] INFO -- : Started GET "/labels/232.pdf" for 213.180.87.134 at 2015-06-04 13:51:11 +0200 | |
2203 I, [2015-06-04T13:51:11.237208 #8457] INFO -- : Processing by LabelsController#show as PDF | |
2204 I, [2015-06-04T13:51:11.237313 #8457] INFO -- : Parameters: {"id"=>"232"} | |
2205 D, [2015-06-04T13:51:11.240117 #8457] DEBUG -- : User Load (0.7ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 42 ORDER BY `users`.`id` ASC LIMIT 1 | |
2206 D, [2015-06-04T13:51:11.261844 #8457] DEBUG -- : TransportLabel Load (16.6ms) SELECT `transport_labels`.* FROM `transport_labels` WHERE `transport_labels`.`id` = 232 LIMIT 1 | |
2207 D, [2015-06-04T13:51:11.277864 #8457] DEBUG -- : Address Load (0.7ms) SELECT `addresses`.* FROM `addresses` WHERE `addresses`.`owner_id` = 232 AND `addresses`.`owner_type` = 'TransportLabel' LIMIT 1 | |
2208 I, [2015-06-04T13:51:11.297387 #8457] INFO -- : ***************WICKED*************** | |
2209 D, [2015-06-04T13:51:11.461020 #8457] |
This file contains 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
# A pouch order is ordered to a ward for a patient from a prescriber. These | |
# will be produces as pouches through the HD-Medi system. | |
class PouchOrder < ActiveRecord::Base | |
include Workflow | |
belongs_to :ward | |
belongs_to :patient | |
belongs_to :file, class_name: 'MachineFile', foreign_key: 'machine_file_id' | |
belongs_to :transport_label |
This file contains 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
# A pouch order is ordered to a ward for a patient from a prescriber. These | |
# will be produces as pouches through the HD-Medi system. | |
class PouchOrder < ActiveRecord::Base | |
# Workflow is handled in library module | |
include PouchOrder::WorkflowManager | |
include DatetimeChange | |
belongs_to :ward | |
belongs_to :patient |
This file contains 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
module PouchOrder::WorkflowManager | |
extend ActiveSupport::Concern | |
included do | |
include Workflow | |
workflow_column :status | |
workflow do | |
state :new do | |
event :receive, transitions_to: :received |
This file contains 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
class PouchOrder::FromAttachment | |
include DatetimeChange | |
def initialize(attachment: attachment) | |
@attachment = attachment | |
@pouch_order = PouchOrder.new( | |
number: @attachment.header.order_number, | |
phone_number: @attachment.contact_telephone, | |
issued_at: @attachment.issued_at, | |
delivery_at: @attachment.delivery_at, |
This file contains 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
## With ruby kafka 0.4.4 | |
# | |
~ src phobos debug-0.5.x-issues ✎ docker-compose run -e DEFAULT_TIMEOUT=30 --rm test rspec spec/lib/phobos/listener_spec.rb:54 | |
Starting phobos_zookeeper_1 ... done | |
Starting phobos_kafka_1 ... done | |
Run options: include {:locations=>{"./spec/lib/phobos/listener_spec.rb"=>[54]}} | |
Randomized with seed 16222 | |
Phobos::Listener |
This file contains 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
## With Ruby kafka 0.5.1 | |
# | |
~ src phobos debug-0.5.x-issues docker-compose run -e DEFAULT_TIMEOUT=30 --rm test rspec spec/lib/phobos/listener_spec.rb:54 | |
Starting phobos_zookeeper_1 ... done | |
Starting phobos_kafka_1 ... done | |
Run options: include {:locations=>{"./spec/lib/phobos/listener_spec.rb"=>[54]}} | |
Randomized with seed 7064 | |
Phobos::Listener |
OlderNewer