his_emr_api_lab 2.1.2 → 2.1.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/app/services/lab/lims/exceptions.rb +11 -0
- data/app/services/lab/lims/utils.rb +2 -3
- data/app/services/lab/results_service.rb +8 -2
- 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: c71682551eb38f2c025993390d6d32f064be0fd35da372dede313882f12c6ad8
|
|
4
|
+
data.tar.gz: f59352b4aceb5d7cf891cb094ef9b213f7e191d453936ca97396101d789e3846
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2db7d3ee59f9cd0e94c2eccc5f7a4514d9c25479e6e31dcce709aa3005934b6c3a2b794fa8e297e86a792f9c311a12628bd1c117d8202aafe49da6c72606643a
|
|
7
|
+
data.tar.gz: 025253b76aa0cb65c237e03aecbcf7010a9a847b7c249d46af7c51330fdbf6ef03b6ee82051aa12271984511091a6d639e46b61c9ca51a3714f1b30b806ba623
|
|
@@ -11,3 +11,14 @@ module Lab
|
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
module Lab
|
|
17
|
+
module Lims
|
|
18
|
+
class LimsException < StandardError; end
|
|
19
|
+
class DuplicateNHID < LimsException; end
|
|
20
|
+
class MissingAccessionNumber < LimsException; end
|
|
21
|
+
class UnknownSpecimenType < LimsException; end
|
|
22
|
+
class UnknownTestType < LimsException; end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -78,9 +78,8 @@ module Lab
|
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
def self.find_concept_by_name(name)
|
|
81
|
-
ConceptName.joins(
|
|
82
|
-
.
|
|
83
|
-
.where(name: CGI.unescapeHTML(name))
|
|
81
|
+
ConceptName.joins("INNER JOIN concept_attribute ON concept_attribute.concept_id = concept_name.concept_id")
|
|
82
|
+
.where("concept_attribute.value_reference = ?", CGI.unescapeHTML(name))
|
|
84
83
|
.first
|
|
85
84
|
end
|
|
86
85
|
end
|
|
@@ -35,7 +35,11 @@ module Lab
|
|
|
35
35
|
serializer = Lab::ResultSerializer.serialize(results_obs)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
# force commit all transactions
|
|
39
|
+
ActiveRecord::Base.connection.commit_db_transaction
|
|
40
|
+
|
|
41
|
+
# delay job by a second
|
|
42
|
+
ProcessLabResultJob.set(wait: 1.second).perform_later(results_obs.id, serializer, result_enter_by)
|
|
39
43
|
|
|
40
44
|
Rails.logger.info("Lab::ResultsService: Result created for test #{test_id} #{serializer}")
|
|
41
45
|
serializer
|
|
@@ -78,12 +82,14 @@ module Lab
|
|
|
78
82
|
def find_encounter(test, encounter_id: nil, encounter_uuid: nil, date: nil, provider_id: nil)
|
|
79
83
|
return Encounter.find(encounter_id) if encounter_id
|
|
80
84
|
return Encounter.find_by_uuid(encounter_uuid) if encounter_uuid
|
|
85
|
+
encounter_type = EncounterType.find_by_name!(Lab::Metadata::ENCOUNTER_TYPE_NAME)
|
|
81
86
|
|
|
82
87
|
encounter = Encounter.new
|
|
83
88
|
encounter.patient_id = test.person_id
|
|
84
89
|
encounter.program_id = test.encounter.program_id if Encounter.column_names.include?('program_id')
|
|
85
90
|
encounter.visit_id = test.encounter.visit_id if Encounter.column_names.include?('visit_id')
|
|
86
|
-
encounter.
|
|
91
|
+
encounter.type = encounter_type
|
|
92
|
+
encounter.encounter_type = encounter_type if (encounter&.encounter_type.nil? || encounter&.type.nil?)
|
|
87
93
|
encounter.encounter_datetime = date || Date.today
|
|
88
94
|
encounter.provider_id = provider_id || User.current.user_id if Encounter.column_names.include?('provider_id')
|
|
89
95
|
|
data/lib/lab/version.rb
CHANGED