his_emr_api_lab 2.4.0 → 2.4.1
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/app/serializers/lab/result_serializer.rb +16 -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: 991f9ab4aaf486c50137bd472f03d80b8ab12d09a01a020fa0d5f2cd469bc771
|
|
4
|
+
data.tar.gz: 617e5482ada6f17c4daaef81e884b5496f04fb39b8fa0cb60be2b66aaf391612
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9a8ffca6167d119463b70f17b76576aa843b7015f0fc9ae8d4f252f0a249089c07e4acb731e7d7ac657235bb7ff8f4674cbe3a99888f863eff6ad7d7764ad537
|
|
7
|
+
data.tar.gz: 41d6799ca76f3727c87f70836417564a1459a7f327d5576ffe115d696bd111f04f756d702ed00122d16b40e26d4bb070fc66d8bf4eefdc35aff69625f1633e30
|
|
@@ -34,7 +34,22 @@ module Lab
|
|
|
34
34
|
def self.get_test_catalog_concept_name(concept_id)
|
|
35
35
|
return nil unless concept_id
|
|
36
36
|
|
|
37
|
-
::ConceptAttribute.find_by(concept_id:, attribute_type: ConceptAttributeType.test_catalogue_name)&.value_reference
|
|
37
|
+
concept_name = ::ConceptAttribute.find_by(concept_id:, attribute_type: ConceptAttributeType.test_catalogue_name)&.value_reference
|
|
38
|
+
return concept_name if concept_name.present?
|
|
39
|
+
|
|
40
|
+
# If the concept does not have a test catalog name, check if it is UA or HCT and return the appropriate name
|
|
41
|
+
# Otherwise, return the first concept name associated with the concept_id
|
|
42
|
+
# Handles the case where a concept has multiple names, such as UA and HCT, which are both associated with the same concept_id
|
|
43
|
+
# NB: Mostly for Old Lab tests that have been migrated to the new system, where the concept_id is the same for both UA and HCT, but the concept_name is different
|
|
44
|
+
# A Case of AETC - Name was not present in the concept attribute table, but was present in the concept name table, so we need to check both tables to get the correct name
|
|
45
|
+
concepts = %w[UA HCT]
|
|
46
|
+
concept_names = ::ConceptName.where(concept_id: concept_id)
|
|
47
|
+
if concept_names.any? { |cn| concepts.include?(cn.name) }
|
|
48
|
+
concept_name = concept_names.find { |cn| concepts.include?(cn.name) }&.name
|
|
49
|
+
else
|
|
50
|
+
concept_name = concept_names.first&.name
|
|
51
|
+
end
|
|
52
|
+
concept_name
|
|
38
53
|
end
|
|
39
54
|
|
|
40
55
|
def self.read_value(measure)
|
data/lib/lab/version.rb
CHANGED