his_emr_api_lab 2.3.0 → 2.3.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: 076c4e3c64155baece8e43499296d703578262b83b09bdb0adada71d3155613b
4
- data.tar.gz: 492212d77df9cec8c5639b6f097fd1f72180f9846b45b9909e49504eebd30ff1
3
+ metadata.gz: debfc9969148ec9c83430294499e332086ab828e9df994c1b5985ba816185ea0
4
+ data.tar.gz: '00199f3e5dba8bca20f639ffa2438349f534048bb8d154c0428c86e24b838530'
5
5
  SHA512:
6
- metadata.gz: f96be1635dc75fc9b8207c874ebd34e53dd8f86c650434ac1ea37a5d2a3ae810b4a18c672a3c732cd14de964ff8352f00584231342340e358668f68e11db0497
7
- data.tar.gz: 868ad9bd444b0afa72713576f5ed557dc3b32cb548fbaa0cab94c5129e2bfa83f7935a08c03876c08dc41f9258af7b886e1e7f0ee80ff728d8e52661fd47d6e8
6
+ metadata.gz: 858b1ec59b6462198a17ef52dd545146509c1369e0d9fcd80d2919b4704568d95476e231209d29a47276507cbac4623deeb2414665ac6253727c22164c1863b2
7
+ data.tar.gz: '039b886ed7cf128f7cc244a51ed598c6830fb86151b71cc9b1a4a97185acdae099d826a9d77cf91e2a281f510793fab6c457e1699189290123000867901e0e74'
@@ -25,7 +25,7 @@ module Lab
25
25
  end
26
26
 
27
27
  def index
28
- filters = params.permit(%i[patient_id patient accession_number date status])
28
+ filters = params.permit(%i[patient_id patient accession_number date status visit_id])
29
29
 
30
30
  id = filters[:patient_id] || filters[:patient]
31
31
 
@@ -5,7 +5,7 @@ module Lab
5
5
  module OrdersSearchService
6
6
  class << self
7
7
  def find_orders(filters)
8
- extra_filters = pop_filters(filters, :date, :end_date, :status)
8
+ extra_filters = pop_filters(filters, :date, :end_date, :status, :visit_id)
9
9
 
10
10
  uuid = filters.delete(:patient)
11
11
  patient = Patient.find(uuid) if uuid
@@ -19,6 +19,7 @@ module Lab
19
19
 
20
20
  orders = filter_orders_by_status(orders: orders, status: extra_filters[:status])
21
21
  orders = filter_orders_by_date(orders: orders, date: extra_filters[:date], end_date: extra_filters[:end_date])
22
+ orders = filter_orders_by_visit_id(orders: orders, visit_id: extra_filters[:visit_id])
22
23
 
23
24
  orders.map { |order| Lab::LabOrderSerializer.serialize_order(order) }
24
25
  end
@@ -54,6 +55,12 @@ module Lab
54
55
  end
55
56
  end
56
57
 
58
+ def filter_orders_by_visit_id(orders:, visit_id: nil)
59
+ return orders unless visit_id.present?
60
+
61
+ orders.joins(:encounter).where(encounter: { visit_id: visit_id })
62
+ end
63
+
57
64
  def unknown_concept_id
58
65
  ConceptName.find_by_name!('Unknown').concept_id
59
66
  end
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.3.0'
4
+ VERSION = '2.3.1'
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: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elizabeth Glaser Pediatric Foundation Malawi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-27 00:00:00.000000000 Z
11
+ date: 2026-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: couchrest