ruby_astm 1.3.2 → 1.3.3
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/mappings.json +109 -3
- data/lib/publisher/poller.rb +45 -16
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 70259b1a5a922424fe4dc0886811a9d4f5949e46bfb5c2b7d24e17bc530d28ce
|
|
4
|
+
data.tar.gz: 3f30af3c5ef76ed6d50d586ab33d05585fa336cb5194b26db60a7ca542ccb28b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62dba1276ae50712b154c388b55fd7c33c37be247c1be354edef6096d0f28eceb412d3749e214b6c3f1620a227b73df2c5c8155da1f5dec7e63bd1fcdf574708
|
|
7
|
+
data.tar.gz: d8837dbf234a679a43c419297c8b6d93cf16fff3bd4c7c1702dcf9a20e054bb1696a2f52c3e4daeaf5c300b666a00440c2ca44d0396bde44347d05aefd9b821e
|
data/lib/mappings.json
CHANGED
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
"TUBE" : "SERUM",
|
|
171
171
|
"REPORT_NAME" : "GGT"
|
|
172
172
|
},
|
|
173
|
-
"
|
|
173
|
+
"BIDDY" : {
|
|
174
174
|
"LIS_CODE" : "BID",
|
|
175
175
|
"TUBE" : "SERUM",
|
|
176
176
|
"REPORT_NAME" : "Direct Bilirubin"
|
|
@@ -180,12 +180,12 @@
|
|
|
180
180
|
"TUBE" : "SERUM",
|
|
181
181
|
"REPORT_NAME" : "Serum Calcium"
|
|
182
182
|
},
|
|
183
|
-
"
|
|
183
|
+
"BITDY" : {
|
|
184
184
|
"LIS_CODE" : "BIT",
|
|
185
185
|
"TUBE" : "SERUM",
|
|
186
186
|
"REPORT_NAME" : "Total Bilirubin"
|
|
187
187
|
},
|
|
188
|
-
"
|
|
188
|
+
"INBILDY" : {
|
|
189
189
|
"LIS_CODE" : "BII",
|
|
190
190
|
"TUBE" : "SERUM",
|
|
191
191
|
"REPORT_NAME" : "Indirect Bilirubin"
|
|
@@ -210,6 +210,66 @@
|
|
|
210
210
|
"TUBE" : "SERUM",
|
|
211
211
|
"REPORT_NAME" : "Homocysteine"
|
|
212
212
|
},
|
|
213
|
+
"SIRON" : {
|
|
214
|
+
"LIS_CODE" : "SIRON",
|
|
215
|
+
"TUBE" : "SERUM",
|
|
216
|
+
"REPORT_NAME" : "Serum Iron"
|
|
217
|
+
},
|
|
218
|
+
"SUIBC" : {
|
|
219
|
+
"LIS_CODE" : "SUIBC",
|
|
220
|
+
"TUBE" : "SERUM",
|
|
221
|
+
"REPORT_NAME" : "Serum UIBC"
|
|
222
|
+
},
|
|
223
|
+
"STIBC" : {
|
|
224
|
+
"LIS_CODE" : "STIBC",
|
|
225
|
+
"TUBE" : "SERUM",
|
|
226
|
+
"REPORT_NAME" : "Serum TIBC"
|
|
227
|
+
},
|
|
228
|
+
"SURIC" : {
|
|
229
|
+
"LIS_CODE" : "SURIC",
|
|
230
|
+
"TUBE" : "SERUM",
|
|
231
|
+
"REPORT_NAME" : "Serum Uric Acid"
|
|
232
|
+
},
|
|
233
|
+
"SPHOS" : {
|
|
234
|
+
"LIS_CODE" : "SPHOS",
|
|
235
|
+
"TUBE" : "SERUM",
|
|
236
|
+
"REPORT_NAME" : "Serum Phosphorous"
|
|
237
|
+
},
|
|
238
|
+
"SMAG" : {
|
|
239
|
+
"LIS_CODE" : "SMAG",
|
|
240
|
+
"TUBE" : "SERUM",
|
|
241
|
+
"REPORT_NAME" : "Serum Magnesium"
|
|
242
|
+
},
|
|
243
|
+
"SNATRIUM" : {
|
|
244
|
+
"LIS_CODE" : "SNATRIUM",
|
|
245
|
+
"TUBE" : "SERUM",
|
|
246
|
+
"REPORT_NAME" : "Sodium"
|
|
247
|
+
},
|
|
248
|
+
"SPOTASSIUM" : {
|
|
249
|
+
"LIS_CODE" : "SPOTASSIUM",
|
|
250
|
+
"TUBE" : "SERUM",
|
|
251
|
+
"REPORT_NAME" : "Potassium"
|
|
252
|
+
},
|
|
253
|
+
"SCHLORIDE" : {
|
|
254
|
+
"LIS_CODE" : "SCHLORIDE",
|
|
255
|
+
"TUBE" : "SERUM",
|
|
256
|
+
"REPORT_NAME" : "Chloride"
|
|
257
|
+
},
|
|
258
|
+
"11" : {
|
|
259
|
+
"LIS_CODE" : "SIGE",
|
|
260
|
+
"TUBE" : "SERUM",
|
|
261
|
+
"REPORT_NAME" : "Serum IgE"
|
|
262
|
+
},
|
|
263
|
+
"10" : {
|
|
264
|
+
"LIS_CODE" : "SPSA",
|
|
265
|
+
"TUBE" : "SERUM",
|
|
266
|
+
"REPORT_NAME" : "Prostate Specific Antigen"
|
|
267
|
+
},
|
|
268
|
+
"9" : {
|
|
269
|
+
"LIS_CODE" : "SFER",
|
|
270
|
+
"TUBE" : "SERUM",
|
|
271
|
+
"REPORT_NAME" : "Serum Ferretin"
|
|
272
|
+
},
|
|
213
273
|
"8" : {
|
|
214
274
|
"LIS_CODE" : "TSH",
|
|
215
275
|
"TUBE" : "SERUM",
|
|
@@ -314,5 +374,51 @@
|
|
|
314
374
|
"LIS_CODE" : "CLA",
|
|
315
375
|
"TUBE" : "URINE_CONTAINER",
|
|
316
376
|
"REPORT_NAME" : "Urine Routine"
|
|
377
|
+
},
|
|
378
|
+
"UA" : {
|
|
379
|
+
"LIS_CODE" : "SURIC",
|
|
380
|
+
"TUBE" : "SERUM",
|
|
381
|
+
"REPORT_NAME" : "Serum Uric Acid"
|
|
382
|
+
},
|
|
383
|
+
"PHOS" : {
|
|
384
|
+
"LIS_CODE" : "SPHOS",
|
|
385
|
+
"TUBE" : "SERUM",
|
|
386
|
+
"REPORT_NAME" : "Serum Phosphorous"
|
|
387
|
+
},
|
|
388
|
+
"MG" : {
|
|
389
|
+
"LIS_CODE" : "SMAG",
|
|
390
|
+
"TUBE" : "SERUM",
|
|
391
|
+
"REPORT_NAME" : "Serum Magnesium"
|
|
392
|
+
},
|
|
393
|
+
"FULL_BODY_PACKAGE" : {
|
|
394
|
+
"LIS_CODE" : "full_body_package",
|
|
395
|
+
"TUBE" : "",
|
|
396
|
+
"REPORT_NAME" : "full body package",
|
|
397
|
+
"PACKAGE_COMPONENTS" : ["HBA1C", "TLCparam", "RBCparam", "HBparam", "HCTparam", "MCVparam", "MCHparam", "MCHCparam", "PCparam", "Nparam", "Lparam", "Mparam", "Eparam", "BASOparam", "ANCparam", "ALCparam", "AMCparam", "AECparam", "ABCparam", "RDWCVparam", "GLUR", "GLUPP", "GLUF", "CHOL", "TRIG", "HDLC", "LDL", "VLDL", "CRE", "UREA", "BUN", "ALB", "GGT", "BID", "CA", "BIT", "BII", "ALPU", "GOTHL", "GPTHL", "HOMCY", "SIRON", "SUIBC", "STIBC", "SURIC", "SPHOS", "SMAG", "SNATRIUM", "SPOTASSIUM", "SCHLORIDE", "SIGE", "SPSA", "SFER", "TSH", "T4", "T3", "HIV", "HBS", "VITD", "HCV", "B12", "ESR", "GLU", "BIL", "KET", "SG", "BLO", "pH", "PRO", "URO", "NIT", "LEU", "COL", "CLA"]
|
|
398
|
+
},
|
|
399
|
+
"PRE_OP_PACKAGE" : {
|
|
400
|
+
"LIS_CODE" : "pre_op_package",
|
|
401
|
+
"TUBE" : "",
|
|
402
|
+
"REPORT_NAME" : "pre_op_package",
|
|
403
|
+
"PACKAGE_COMPONENTS" : ["TLCparam", "RBCparam", "HBparam", "HCTparam", "MCVparam", "MCHparam", "MCHCparam", "PCparam", "Nparam", "Lparam", "Mparam", "Eparam", "BASOparam", "ANCparam", "ALCparam", "AMCparam", "AECparam", "ABCparam", "RDWCVparam", "GLUR","ESR", "GLU", "BIL", "KET", "SG", "BLO", "pH", "PRO", "URO", "NIT", "LEU", "COL", "CLA"]
|
|
404
|
+
},
|
|
405
|
+
"LIPID_PROFILE" : {
|
|
406
|
+
"LIS_CODE" : "lipid_profile",
|
|
407
|
+
"TUBE" : "",
|
|
408
|
+
"REPORT_NAME" : "lipid profile",
|
|
409
|
+
"PACKAGE_COMPONENTS" : ["CHOL", "TRIG", "HDLC", "LDL", "VLDL"]
|
|
410
|
+
},
|
|
411
|
+
"LIVER_FUNCTION_TESTS" : {
|
|
412
|
+
"LIS_CODE" : "liver_function_tests",
|
|
413
|
+
"TUBE" : "",
|
|
414
|
+
"REPORT_NAME" : "liver function tests",
|
|
415
|
+
"PACKAGE_COMPONENTS" : ["ALB", "GGT", "BID", "CA", "BIT", "BII", "ALPU", "GOTHL", "GPTHL"]
|
|
416
|
+
},
|
|
417
|
+
"KIDNEY_FUNCTION_TESTS" : {
|
|
418
|
+
"LIS_CODE" : "kidney_function_tests",
|
|
419
|
+
"TUBE" : "",
|
|
420
|
+
"REPORT_NAME" : "kidney_function_tests",
|
|
421
|
+
"PACKAGE_COMPONENTS" : ["CRE", "UREA", "BUN"]
|
|
317
422
|
}
|
|
423
|
+
|
|
318
424
|
}
|
data/lib/publisher/poller.rb
CHANGED
|
@@ -105,11 +105,12 @@ class Poller
|
|
|
105
105
|
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
+
## first we have to test the packages.
|
|
109
|
+
|
|
108
110
|
def build_tests_hash(record)
|
|
109
111
|
#puts "Record is ---------------------------------------------"
|
|
110
112
|
#puts record
|
|
111
113
|
tests_hash = {}
|
|
112
|
-
|
|
113
114
|
## key -> TUBE_NAME : eg: EDTA
|
|
114
115
|
## value -> its barcode id.
|
|
115
116
|
tube_ids = {}
|
|
@@ -152,27 +153,55 @@ class Poller
|
|
|
152
153
|
|
|
153
154
|
tests = record[7].split(",").compact
|
|
154
155
|
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
## these test names are whatever are coming
|
|
157
|
+
## from
|
|
158
|
+
|
|
159
|
+
|
|
157
160
|
return tests_hash if tests_hash.empty?
|
|
161
|
+
|
|
162
|
+
#puts "inverted mappings are:"
|
|
163
|
+
#puts $inverted_mappings.keys.to_s
|
|
164
|
+
#exit(1)
|
|
165
|
+
#exit(1)
|
|
166
|
+
|
|
158
167
|
tests.each do |test|
|
|
159
168
|
## use the inverted mappings to
|
|
160
169
|
if machine_code = $inverted_mappings[test]
|
|
170
|
+
puts "machine code is: #{machine_code}"
|
|
161
171
|
## now get its tube type
|
|
162
172
|
## mappings have to match the tubes defined in this file.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
|
|
174
|
+
if package_components = $mappings[machine_code]["PACKAGE_COMPONENTS"]
|
|
175
|
+
|
|
176
|
+
puts package_components.to_s
|
|
177
|
+
|
|
178
|
+
package_components.each do |component|
|
|
179
|
+
puts "doing component: #{component}"
|
|
180
|
+
## these are the machine codes.
|
|
181
|
+
## so to get the tube, you have to get it from the inverted mappings.
|
|
182
|
+
## cant get directly like this.
|
|
183
|
+
component_machine_code = $inverted_mappings[component]
|
|
184
|
+
puts "component machine code: #{component_machine_code}"
|
|
185
|
+
|
|
186
|
+
tube = $mappings[component_machine_code]["TUBE"]
|
|
187
|
+
tube_key = nil
|
|
188
|
+
unless tests_hash.keys.select{|c| c=~/#{tube}/ }.blank?
|
|
189
|
+
tube_key = tests_hash.keys.select{|c| c=~/#{tube}/ }[0]
|
|
190
|
+
tests_hash[tube_key] << component_machine_code
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
else
|
|
195
|
+
## here also it is the same problem.
|
|
196
|
+
tube = $mappings[machine_code]["TUBE"]
|
|
197
|
+
tube_key = nil
|
|
198
|
+
unless tests_hash.keys.select{|c| c=~/#{tube}/ }.blank?
|
|
199
|
+
tube_key = tests_hash.keys.select{|c| c=~/#{tube}/ }[0]
|
|
200
|
+
tests_hash[tube_key] << machine_code
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
|
|
176
205
|
|
|
177
206
|
else
|
|
178
207
|
AstmServer.log("ERROR: Test: #{test} does not have an LIS code")
|