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 +4 -4
- data/lib/publisher/poller.rb +3 -2
- data/lib/ruby_astm/lab_interface.rb +1 -1
- data/lib/ruby_astm/usb_module.rb +12 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c048fb081850c73e0920aea67af6ba42022e3453
|
4
|
+
data.tar.gz: 447df9ea7aa6eaea6708b120d248af10664f78ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5003ceacee31b6fd72a3e85cb2042bd312bb774ab158215c92fb11e0efcb894a0ab8e446035412fc4c43b193f5ece52140125955fd7f6b2f02880ee957aa63f2
|
7
|
+
data.tar.gz: e944a019d055a5fd14e64660a290ae07806a96793111b1b13a2a9563ed6db97051a9528c6a787a4e0f6741ffd6f887b4315031c26a4b650ba9feb5f1f019f5b6
|
data/lib/publisher/poller.rb
CHANGED
@@ -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
|
-
|
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
|
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"
|
data/lib/ruby_astm/usb_module.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
66
|
-
|
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
|