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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b1cea09e0f3c6bc1311b62f5cd219a870f0966b9d8b07bcc8f892724afa17ed
4
- data.tar.gz: 8eab8423833ab366c13b753793607dd7ec5f9c068b744a0c7e2a6a816e3583e2
3
+ metadata.gz: 991f9ab4aaf486c50137bd472f03d80b8ab12d09a01a020fa0d5f2cd469bc771
4
+ data.tar.gz: 617e5482ada6f17c4daaef81e884b5496f04fb39b8fa0cb60be2b66aaf391612
5
5
  SHA512:
6
- metadata.gz: 66ef6d1e98b76bd663f1364a36744c11964dbb51642123a8d38d23ff18e66262e5f65a932978ce7fb80f7eaa469934360f7de1f219292f4579ef0d454ef65f2c
7
- data.tar.gz: 71131470f173b0179c94e6aacf4737576ae0543636ea6fab3140c61525980045504365147951f8c64881661f0572893c6d598854468b53c7ff13901f5c8bfdc6
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lab
4
- VERSION = '2.4.0'
4
+ VERSION = '2.4.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: his_emr_api_lab
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elizabeth Glaser Pediatric Foundation Malawi