ruby_astm 1.5.2 → 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f211891d302b07536fa0edbadcd5da4395f17627
4
- data.tar.gz: d803f0319f91c825ab9fa560c7dfe3ae7e08f9a7
3
+ metadata.gz: c048fb081850c73e0920aea67af6ba42022e3453
4
+ data.tar.gz: 447df9ea7aa6eaea6708b120d248af10664f78ae
5
5
  SHA512:
6
- metadata.gz: 6db8e7f19a9d7b4014c3e9f8ce18f4a7b89509d11a5121ca6935366cc671a4d88b03d2d2a37f4c83d1f5de4803f8ec27ee00ecc046fd22e54213252430c2f785
7
- data.tar.gz: 0dfbc2aad3bfac163e3121a0d501895775c1eec7f4c5d8f72b19df4fd8922e225bc01bd2f9b9a87af1560ed98972dbcbbad3d209feefcc2aacba475dad6f7951
6
+ metadata.gz: 5003ceacee31b6fd72a3e85cb2042bd312bb774ab158215c92fb11e0efcb894a0ab8e446035412fc4c43b193f5ece52140125955fd7f6b2f02880ee957aa63f2
7
+ data.tar.gz: e944a019d055a5fd14e64660a290ae07806a96793111b1b13a2a9563ed6db97051a9528c6a787a4e0f6741ffd6f887b4315031c26a4b650ba9feb5f1f019f5b6
@@ -204,8 +204,9 @@ class Poller
204
204
  #puts "inverted mappings"
205
205
  #puts $inverted_mappings
206
206
  component_machine_code = $inverted_mappings[component]
207
- #puts "component machine code: #{component_machine_code}"
208
-
207
+ if component == "UCRE"
208
+ puts "component machine code: #{component_machine_code}"
209
+ end
209
210
  ## for eg plasma tube can do all the tests
210
211
  ## so can serum
211
212
  ## but we use the plasma tube only for some.
@@ -381,7 +381,7 @@ module LabInterface
381
381
  self.headers[-1].patients << hl7_patient
382
382
  when "Hl7_Order"
383
383
  unless self.headers[-1].patients.blank?
384
- hl7_order = Hl7Order.new({:line => line, :patient_id => self.headers[-1].patients[-1].patient_id}, :machine_name => self.headers[-1].machine_name)
384
+ hl7_order = Hl7Order.new({:line => line, :patient_id => self.headers[-1].patients[-1].patient_id, :machine_name => self.headers[-1].machine_name})
385
385
  self.headers[-1].patients[-1].orders << hl7_order
386
386
  end
387
387
  when "Header"
@@ -50,10 +50,13 @@ module UsbModule
50
50
  ## like key -> value, score
51
51
  ## key(barcode) -> value(time) -> score(count)
52
52
  ## so we can zincrby, each time.
53
- def add_result?(barcode,result)
53
+ ## @param[String] barcode : the barcode of the result
54
+ ## @param[String]
55
+ def add_result?(barcode,result,existing_barcodes)
54
56
  begin
55
57
  Integer(result)
56
58
  #puts "result is: #{result}"
59
+ return false if existing_barcodes.include? barcode
57
60
  return false if result.to_i == 0
58
61
  #puts "the result is not zero"
59
62
  existing_result = $redis.hget(ESR_RESULTS_HASH,barcode)
@@ -62,9 +65,8 @@ module UsbModule
62
65
  true
63
66
  else
64
67
  if existing_result != result
65
- current_count = $redis.zincrby(ESR_SORTED_SET,1,barcode)
66
- current_count <= MAX_REPEAT_RESULT_COUNT
67
- end
68
+ true
69
+ end
68
70
  end
69
71
  rescue => e
70
72
  puts e.to_s
@@ -81,7 +83,11 @@ module UsbModule
81
83
  #puts self.usb_response_bytes.to_s
82
84
  if interpret?
83
85
  #puts "interpret"
86
+ barcodes = []
84
87
  if kk = self.usb_response_bytes[13..-4]
88
+ ## its going fresh -> old
89
+ ## so if the barcode has already come
90
+ ## we do not push it.
85
91
  kk.each_slice(32) do |patient_record|
86
92
  unless patient_record.blank?
87
93
  unless patient_record.size < 24
@@ -104,10 +110,11 @@ module UsbModule
104
110
  order.results << result
105
111
  #puts "barcode: #{bar_code}, result : #{result.value}"
106
112
  patient.orders << order
107
- if add_result?(bar_code,result.value)
113
+ if add_result?(bar_code,result.value,existing_barcodes)
108
114
  #puts patient.to_json
109
115
  $redis.lpush("patients",patient.to_json)
110
116
  $redis.hset(ESR_RESULTS_HASH,bar_code,result.value.to_i)
117
+ existing_barcodes << bar_code
111
118
  end
112
119
  end
113
120
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_astm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bhargav Raut