his_emr_api_lab 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/lab/labelling_service/order_label.rb +20 -2
- data/app/services/lab/lims/worker.rb +3 -1
- data/lib/lab/version.rb +1 -1
- 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: 7b410e215fad55950c150d2ec7a82bda3f434cca4cc287e0d4fca2a9116e9182
|
4
|
+
data.tar.gz: 6b3a0c75c303c2139c1f6f963875667c4606bce42d23f6a22c277412e24db960
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f6068aecbc02d5c3df75ac422c4d4f9baeac86c6559a1e75078ef68088b4e6702239a366fb5e5879a2925592e3440a2880668bcc50f4730c9d2051f522ac94a
|
7
|
+
data.tar.gz: 5e3b4d61f507f2de7847951dcdd738a50dd29ba4ae5f981ce8284f3ba11c35d6d1c337787c1b78154b96eb318fc5343d404a3827fd02c89ffc3da60eb2d617c3
|
@@ -27,7 +27,7 @@ module Lab
|
|
27
27
|
'',
|
28
28
|
drawer,
|
29
29
|
'',
|
30
|
-
|
30
|
+
tests,
|
31
31
|
reason_for_test,
|
32
32
|
order.accession_number,
|
33
33
|
order.accession_number)
|
@@ -36,7 +36,7 @@ module Lab
|
|
36
36
|
def reason_for_test
|
37
37
|
return 'Unknown' unless order.reason_for_test
|
38
38
|
|
39
|
-
|
39
|
+
short_concept_name(order.reason_for_test.value_coded) || 'Unknown'
|
40
40
|
end
|
41
41
|
|
42
42
|
def patient
|
@@ -73,6 +73,24 @@ module Lab
|
|
73
73
|
ConceptName.find_by_concept_id(order.concept_id)&.name || 'Unknown'
|
74
74
|
end
|
75
75
|
|
76
|
+
def tests
|
77
|
+
tests = order.tests.map do |test|
|
78
|
+
name = short_concept_name(test.value_coded) || 'Unknown'
|
79
|
+
|
80
|
+
next 'VL' if name.match?(/Viral load/i)
|
81
|
+
|
82
|
+
name.size > 7 ? name[0..6] : name
|
83
|
+
end
|
84
|
+
|
85
|
+
tests.join(', ')
|
86
|
+
end
|
87
|
+
|
88
|
+
def short_concept_name(concept_id)
|
89
|
+
ConceptName.where(concept_id: concept_id)
|
90
|
+
.min_by { |concept| concept.name.size }
|
91
|
+
&.name
|
92
|
+
end
|
93
|
+
|
76
94
|
def unknown_concept
|
77
95
|
ConceptName.find_by_name('Unknown')
|
78
96
|
end
|
@@ -28,7 +28,9 @@ module Lab
|
|
28
28
|
fout.write("Worker ##{Process.pid} started at #{Time.now}")
|
29
29
|
worker = new(Api.new)
|
30
30
|
worker.pull_orders
|
31
|
-
|
31
|
+
# TODO: Verify that names being pushed to LIMS are of the correct format (ie matching
|
32
|
+
# LIMS naming conventions). Enable pushing when that is done
|
33
|
+
# worker.push_orders
|
32
34
|
end
|
33
35
|
end
|
34
36
|
|
data/lib/lab/version.rb
CHANGED