his_emr_api_lab 1.1.17 → 1.1.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9180f5367d311361a972c4ec15d72bbd6296731adf1bd71b4ae25a1ff58dc4b5
4
- data.tar.gz: d6b399321648924e31cecda13c4348b53370796a89344947b0932f0720ed0b11
3
+ metadata.gz: ecb22c6981cf4627f8b862fc958949e9d8bce3258533fc7369f5ecbb51f7e35f
4
+ data.tar.gz: f361eade238cfceb9fa6d8ac390166c8747d017755e6ce543bb8d2b1222277ba
5
5
  SHA512:
6
- metadata.gz: 284aab03e785c885b3e1a88f8fef8826c73c89b9f7436e17aa730d14c2f3fc5fe14cb65e2f29ce6171675a363c5945b73d547094f11a4187d67dbdfc9636c4dd
7
- data.tar.gz: 0c849e47f58c86fd221f9c97111c0028f3fafdad3cf07393baf64928ebd462008895550fd4ab754e2708654cde5867fb81abb07dcbdd289454e4da14bbafd4d2
6
+ metadata.gz: b5ac8fff26842cdec49086800174748e8fdc36c76c8843d03cc7da2f14dd068843854775c795682739dbcc6923c3afa6bcefa9a6d73f1dc590441cb971aed7e5
7
+ data.tar.gz: f4aa9129aa56bbc4aa6dff749511a6b15556adc91383bb0dfdc040f065817974e3e21ec8d0f6d8cc0716b5e4e1341c94024665a87a9bf33c9a1081e041180bea
@@ -377,7 +377,7 @@ class Lab::Lims::Api::RestApi
377
377
  orders_without_specimen(patient_id).each { |order| orders[order.order_id] = order }
378
378
  orders_without_results(patient_id).each { |order| orders[order.order_id] = order }
379
379
  orders_without_reason(patient_id).each { |order| orders[order.order_id] = order }
380
-
380
+
381
381
  orders.values
382
382
  end
383
383
 
@@ -394,8 +394,10 @@ class Lab::Lims::Api::RestApi
394
394
 
395
395
  def orders_without_results(patient_id = nil)
396
396
  Rails.logger.debug('Looking for orders without a result')
397
+ # Lab::OrdersSearchService.find_orders_without_results(patient_id: patient_id)
398
+ # .where.not(accession_number: Lab::LimsOrderMapping.select(:lims_id).where("pulled_at IS NULL"))
397
399
  Lab::OrdersSearchService.find_orders_without_results(patient_id: patient_id)
398
- .where.not(accession_number: Lab::LimsOrderMapping.select(:lims_id).where("pulled_at IS NULL"))
400
+ .where(order_id: Lab::LimsOrderMapping.select(:order_id))
399
401
  end
400
402
 
401
403
  def orders_without_reason(patient_id = nil)
@@ -45,7 +45,7 @@ module Lab
45
45
  end
46
46
 
47
47
  update_last_seq(context.current_seq)
48
- rescue DuplicateNHID
48
+ rescue Lab::Lims::DuplicateNHID
49
49
  logger.warn("Failed to import order due to duplicate patient NHID: #{order_dto[:patient][:id]}")
50
50
  save_failed_import(order_dto, "Duplicate local patient NHID: #{order_dto[:patient][:id]}")
51
51
  rescue MissingAccessionNumber
@@ -102,7 +102,7 @@ module Lab
102
102
  .distinct(:patient_id)
103
103
  .all
104
104
 
105
- raise DuplicateNHID, "Duplicate National Health ID: #{nhid}" if patients.size > 1
105
+ raise Lab::Lims::DuplicateNHID, "Duplicate National Health ID: #{nhid}" if patients.size > 1
106
106
 
107
107
  patients.first
108
108
  end
@@ -182,14 +182,14 @@ module Lab
182
182
 
183
183
  def update_results(order, lims_results)
184
184
  logger.debug("Updating results for order ##{order[:accession_number]}: #{lims_results}")
185
-
185
+
186
186
  lims_results.each do |test_name, test_results|
187
187
  test = find_test(order['id'], test_name)
188
188
  unless test
189
189
  logger.warn("Couldn't find test, #{test_name}, in order ##{order[:id]}")
190
190
  next
191
191
  end
192
-
192
+
193
193
  next if test.result || test_results['results'].blank?
194
194
 
195
195
  measures = test_results['results'].map do |indicator, value|
@@ -198,7 +198,7 @@ module Lab
198
198
 
199
199
  measure
200
200
  end
201
-
201
+
202
202
  measures = measures.compact
203
203
  next if measures.empty?
204
204
 
data/lib/lab/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lab
4
- VERSION = '1.1.17'
4
+ VERSION = '1.1.18'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: his_emr_api_lab
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.17
4
+ version: 1.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elizabeth Glaser Pediatric Foundation Malawi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-02 00:00:00.000000000 Z
11
+ date: 2021-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: couchrest
@@ -319,7 +319,7 @@ licenses:
319
319
  - MIT
320
320
  metadata:
321
321
  source_code_uri: https://github.com/EGPAFMalawiHIS/his_emr_api_lab
322
- post_install_message:
322
+ post_install_message:
323
323
  rdoc_options: []
324
324
  require_paths:
325
325
  - lib
@@ -334,8 +334,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
334
  - !ruby/object:Gem::Version
335
335
  version: '0'
336
336
  requirements: []
337
- rubygems_version: 3.2.3
338
- signing_key:
337
+ rubygems_version: 3.0.9
338
+ signing_key:
339
339
  specification_version: 4
340
340
  summary: Lab extension for the HIS-EMR-API
341
341
  test_files: []