ruby_astm 1.2.1 → 1.2.2

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
  SHA256:
3
- metadata.gz: 7c86edc30a8aa2f89b804e0dbb28d2727d63b15cc5dd0e113bf04df2f9fcc769
4
- data.tar.gz: 8ce45624e70cf7b8c1338f8b21eadbef19ac44781f16f46dabb0f27dc7960901
3
+ metadata.gz: 4f3ba60a24419e04369920eb8f6ee0a465c9962b989bd6e17ae19eef14541d2d
4
+ data.tar.gz: 8d27244ac7b92f552733aad743ebb9777eea930f0c0f0b44dc08ba2b4aa7d9de
5
5
  SHA512:
6
- metadata.gz: 7c35e684f3affb40bbe3d2178f6585d1a199b7d7325bebffbe3c5af4087fab9ec86bd694658fe7aed242fbb39d97334efa1a482cae7b3ac06ae2804e7520b835
7
- data.tar.gz: f163dd00c01a3dd5b793ec1625b6f3ce323e27b52c7a08efb9c9d9ce50c07e7508249603791be5906da3cac43b023bf47561f1507f2f55f12aaf203d3dc3ae14
6
+ metadata.gz: 843087dedee93ba8361371dcfbdca936c8f8b3de4085cca8f438330c4d7e903430895abd8f414daee1fef053ac3c6c690119740dfd09b4421799d8e019b541a2
7
+ data.tar.gz: 4a24373742aed3f8df00ec5c68c7eb8298bf4b76fa88eacb895cd3a355998d85cbcb995c9e1fbd30b9efaee2031048ee9d2c79ea16f5eabf6c42ff11740f2dcf
data/lib/mappings.json CHANGED
@@ -1,5 +1,9 @@
1
1
  {
2
2
  "_comment" : "key -> code sent by analyzer, eg sysmex sends WBC count under the code 'WBC'. value -> object. Object structure: 'LIS_CODE': in the google lab interface, this code is present in two places on google drive. one) in the name of the file, two) inside the file, where the test result value should be added. For eg in the hemogram report, TLCparam, is present in the name of the file, as well as inside the file, so the google script will update it with the relevant value. 'TUBE' stands for the type of tube in which this test has to be performed. This should match the constants in the Google Lab Interface.rb file. Now there is another problem that we have to deal with here. When going bidirectional, in some machines like Roche Cobas e411, the test codes come in as numbers, and not letters, so the keys here in this file are numbers, for those tests. Because Roche is a bitch basically.",
3
+ "A1c" : {
4
+ "LIS_CODE" : "HBA1C",
5
+ "REPORT_NAME" : "Glycosylated Hemoglobin"
6
+ },
3
7
  "WBC" :
4
8
  {
5
9
  "LIS_CODE" : "TLCparam",
@@ -176,6 +180,11 @@
176
180
  "TUBE" : "SERUM",
177
181
  "REPORT_NAME" : "Total Bilirubin"
178
182
  },
183
+ "INBIL" : {
184
+ "LIS_CODE" : "BII",
185
+ "TUBE" : "SERUM",
186
+ "REPORT_NAME" : "Indirect Bilirubin"
187
+ },
179
188
  "ALPU" : {
180
189
  "LIS_CODE" : "ALPU",
181
190
  "TUBE" : "SERUM",
@@ -52,4 +52,6 @@ class AstmServer
52
52
  }
53
53
  end
54
54
 
55
- end
55
+ end
56
+
57
+ #sudham61@gmail.com
@@ -83,7 +83,7 @@ module LabInterface
83
83
 
84
84
  def receive_data(data)
85
85
 
86
- begin
86
+ #begin
87
87
 
88
88
  self.data_buffer ||= ''
89
89
 
@@ -158,8 +158,12 @@ module LabInterface
158
158
  else
159
159
  puts "NO HEADERS PRESENT --- "
160
160
  end
161
+ elsif data.bytes.to_a[0] == 255
162
+ puts " ----------- got 255 data -----------, not sending anything back. "
161
163
  else
162
- puts self.data_buffer.gsub(/\r/,'\n').to_s
164
+ unless self.data_buffer.blank?
165
+ puts self.data_buffer.gsub(/\r/,'\n').to_s
166
+ end
163
167
  ## send the header
164
168
  #puts "--------- SENT ACK -----------"
165
169
  if self.data_buffer =~ /MSH\|/
@@ -175,11 +179,11 @@ module LabInterface
175
179
  send_data(ACK)
176
180
  end
177
181
  end
178
- rescue => e
179
- self.headers = []
180
- AstmServer.log("data was: " + self.data_buffer + "error is:" + e.backtrace.to_s)
181
- send_data(EOT)
182
- end
182
+ #rescue => e
183
+ # self.headers = []
184
+ # AstmServer.log("data was: " + self.data_buffer + "error is:" + e.backtrace.to_s)
185
+ # send_data(EOT)
186
+ #end
183
187
  end
184
188
 
185
189
  def send_enq
@@ -202,14 +206,20 @@ module LabInterface
202
206
  self.headers ||= []
203
207
  self.headers << hl7_header
204
208
  when "Hl7_Observation"
205
- hl7_observation = Hl7Observation.new({:line => line})
206
- self.headers[-1].patients[-1].orders[-1].results[hl7_observation.name] = hl7_observation
209
+ unless self.headers[-1].patients.blank?
210
+ unless self.headers[-1].patients[-1].orders[-1].blank?
211
+ hl7_observation = Hl7Observation.new({:line => line})
212
+ self.headers[-1].patients[-1].orders[-1].results[hl7_observation.name] ||= hl7_observation
213
+ end
214
+ end
207
215
  when "Hl7_Patient"
208
216
  hl7_patient = Hl7Patient.new({:line => line})
209
217
  self.headers[-1].patients << hl7_patient
210
218
  when "Hl7_Order"
211
- hl7_order = Hl7Order.new({:line => line, :patient_id => self.headers[-1].patients[-1].patient_id})
212
- self.headers[-1].patients[-1].orders << hl7_order
219
+ unless self.headers[-1].patients.blank?
220
+ hl7_order = Hl7Order.new({:line => line, :patient_id => self.headers[-1].patients[-1].patient_id})
221
+ self.headers[-1].patients[-1].orders << hl7_order
222
+ end
213
223
  when "Header"
214
224
  puts "got header"
215
225
  header = Header.new({:line => line})
@@ -228,7 +238,7 @@ module LabInterface
228
238
  self.headers[-1].patients[-1].orders << order
229
239
  when "Result"
230
240
  result = Result.new({:line => line})
231
- self.headers[-1].patients[-1].orders[-1].results[result.name] = result
241
+ self.headers[-1].patients[-1].orders[-1].results[result.name] ||= result
232
242
  when "Terminator"
233
243
  ## it didn't terminate so there was no commit being called.
234
244
  puts "got terminator."
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.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bhargav Raut