ruby_astm 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/publisher/google_lab_interface.rb +4 -1
- data/lib/publisher/poller.rb +6 -2
- data/lib/ruby_astm/lab_interface.rb +3 -0
- data/lib/ruby_astm/result.rb +1 -1
- 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: 45a5db6505182ace88ffe6adb2c1b9595b432613
|
4
|
+
data.tar.gz: d111d2c14ba61ca507fc4f743e94d0578f4555f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfa51b7827945a702895e4c061697fc6b25862b918f2f4fdc098fc8e1a1513930eece5d39ff2c9a79d8c00a7bbc1ab3f28aa2f3df676d8fb071489ba3b3c0a36
|
7
|
+
data.tar.gz: b64b9600d4ed08846ff172fbe433b24886e2040f3802be08b961b06492d9512c2b29d47802a108ed4a7d1d2b066ebe317b3ba3cfc9120e9784c7bf0850dba8f1
|
@@ -101,6 +101,7 @@ class Google_Lab_Interface < Poller
|
|
101
101
|
# method overriden from adapter.
|
102
102
|
# data should be an array of objects.
|
103
103
|
# see adapter for the recommended structure.
|
104
|
+
# @return[Boolean] true/false : depending on if there was an error or not.
|
104
105
|
def update(data)
|
105
106
|
|
106
107
|
orders = JSON.generate(data)
|
@@ -121,13 +122,15 @@ class Google_Lab_Interface < Poller
|
|
121
122
|
if resp.error
|
122
123
|
AstmServer.log("Error updating results to LIS, message follows")
|
123
124
|
AstmServer.log("error: #{resp.error.message} : code: #{resp.error.code}")
|
124
|
-
|
125
|
+
false
|
125
126
|
else
|
126
127
|
AstmServer.log("Updating results to LIS successfull")
|
128
|
+
true
|
127
129
|
end
|
128
130
|
rescue => e
|
129
131
|
AstmServer.log("Error updating results to LIS, backtrace follows")
|
130
132
|
AstmServer.log(e.backtrace.to_s)
|
133
|
+
false
|
131
134
|
end
|
132
135
|
|
133
136
|
end
|
data/lib/publisher/poller.rb
CHANGED
@@ -230,8 +230,9 @@ class Poller
|
|
230
230
|
end
|
231
231
|
|
232
232
|
## override to define how the data is updated.
|
233
|
+
## expected to return Boolean value, depending on whether the update was successfull or not.
|
233
234
|
def update(data)
|
234
|
-
|
235
|
+
true
|
235
236
|
end
|
236
237
|
|
237
238
|
##@param[Array] data : array of objects.
|
@@ -333,8 +334,11 @@ class Poller
|
|
333
334
|
while patients_to_process == true
|
334
335
|
if patient_results = $redis.rpoplpush("patients","processing")
|
335
336
|
patient_results = JSON.parse(patient_results)
|
336
|
-
update
|
337
|
+
## do this before the update, so that we don't go into an endless loop if the current update fails.
|
337
338
|
patients_to_process = $redis.llen("patients") > 0
|
339
|
+
unless update(patient_results)
|
340
|
+
$redis.lpush("patients",JSON.generate(patient_results))
|
341
|
+
end
|
338
342
|
else
|
339
343
|
patients_to_process = false
|
340
344
|
end
|
@@ -37,10 +37,13 @@ module LabInterface
|
|
37
37
|
"L|1|N\r"
|
38
38
|
end
|
39
39
|
|
40
|
+
|
40
41
|
def checksum(input)
|
41
42
|
strString = input
|
42
43
|
checksum = strString.sum
|
44
|
+
#puts "checksum before to_s is: #{checksum}"
|
43
45
|
b = checksum.to_s(16)
|
46
|
+
#puts "b is: #{b}"
|
44
47
|
strCksm = b[-2..-1]
|
45
48
|
if strCksm.length < 2
|
46
49
|
for i in strString.length..1
|
data/lib/ruby_astm/result.rb
CHANGED
@@ -11,7 +11,7 @@ class Result
|
|
11
11
|
def initialize(args)
|
12
12
|
if args[:line]
|
13
13
|
line = args[:line]
|
14
|
-
line.fields[2].scan(/\^+(?<name>[A-Za-z0-9
|
14
|
+
line.fields[2].scan(/\^+(?<name>[A-Za-z0-9\%\#\-\_\?\/]+)\^?(?<dilution>\d+)?/) { |name,dilution|
|
15
15
|
self.name = lookup_mapping(name)
|
16
16
|
self.dilution = dilution
|
17
17
|
}
|