mahis_emr_api_lab 1.2.4 → 1.2.5

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: 1564986977bbbb02dab3359307faa412965cecb2a0aaa3d0cc97b9e2ef068f92
4
- data.tar.gz: 42fcee721977f3cbc1fd29f8f184b23e532cde82bf9846494c90bf1285f0d773
3
+ metadata.gz: 0b93353e9b867677abd45317e32291dcbd53d68e328cb2ac7cc2e294d719b71f
4
+ data.tar.gz: 22fcdf2407609885b81df63de7be75ff20156f6b0b6d8de6a6eb8974d54915ae
5
5
  SHA512:
6
- metadata.gz: 91179c762c1d91c33d6ca6c6c751ff73102b8a4e8ac9f191e3eb2aa00e0ccfa9a1e16f69accb3f19ec9d1a54f25b0066f17de4d47560c0c976d47859ad9240b9
7
- data.tar.gz: f91bb3ab835a5ec653fdaa9666475b2d26f1e0acc2d43d8d753456c748137051d6ef364bf5709bc9569f774ecd0758022f798f1a5786b59c638d878c473b2fac
6
+ metadata.gz: e95ee315519fcf1d77d9b337b449921c05489cf7842bf2f74e730f61fd298233aba7b87c0a819b6bcac9f39c58c87703c5ed76a9b7b1f31b60573d3fcceb8b14
7
+ data.tar.gz: 3326b887701a0fdf285bb37f2a2daa56500f4b81875080cb711bc25b046370e94c6e198c837e7521415b69ccc0cbfe01cb0c18096e09196f2b79468eaf15fbba
@@ -2,7 +2,8 @@
2
2
 
3
3
  module Lab
4
4
  class LabelsController < ApplicationController
5
- skip_before_action :authenticate
5
+ _callbacks = _process_action_callbacks.map(&:filter)
6
+ skip_before_action :authenticate if _callbacks.include?(:authenticate)
6
7
 
7
8
  def print_order_label
8
9
  order_id = params.require(:order_id)
@@ -3,7 +3,8 @@
3
3
  # This controller handles creation and authentication of LIMS User
4
4
  module Lab
5
5
  class UsersController < ::ApplicationController
6
- skip_before_action :authenticate
6
+ _callbacks = _process_action_callbacks.map(&:filter)
7
+ skip_before_action :authenticate if _callbacks.include?(:authenticate)
7
8
  # create a LIMS User that will be responsible for sending lab results
8
9
  def create
9
10
  user_params = params.permit(:username, :password)
@@ -2,6 +2,10 @@
2
2
 
3
3
  module Lab
4
4
  class LabResult < Observation
5
+ def children
6
+ Observation.where(obs_group_id: obs_id, voided: 0)
7
+ end
8
+
5
9
  alias measures children
6
10
 
7
11
  default_scope do
@@ -33,7 +33,7 @@ module Lab
33
33
  bum.binge_changes(since: from, limit: limit, include_docs: true) do |change|
34
34
  next unless change['doc']['type']&.casecmp?('Order')
35
35
 
36
- yield OrderDTO.new(change['doc']), self
36
+ yield OrderDto.new(change['doc']), self
37
37
  end
38
38
  end
39
39
 
@@ -162,7 +162,7 @@ module Lab
162
162
  drawn_by_first_name, drawn_by_last_name = specimen['drawn_by_name']&.split
163
163
  patient_first_name, patient_last_name = patient['name'].split
164
164
 
165
- OrderDTO.new(
165
+ OrderDto.new(
166
166
  _id: specimen['doc_id'].blank? ? SecureRandom.uuid : specimen['doc_id'],
167
167
  _rev: '0',
168
168
  tracking_number: specimen['tracking_number'],
@@ -198,7 +198,7 @@ class Lab::Lims::Api::RestApi
198
198
  end
199
199
 
200
200
  ##
201
- # Converts an OrderDTO to parameters for POST /create_order
201
+ # Converts an OrderDto to parameters for POST /create_order
202
202
  def make_create_params(order_dto)
203
203
  {
204
204
  tracking_number: order_dto.fetch(:tracking_number),
@@ -227,7 +227,7 @@ class Lab::Lims::Api::RestApi
227
227
  end
228
228
 
229
229
  ##
230
- # Converts an OrderDTO to parameters for POST /update_order
230
+ # Converts an OrderDto to parameters for POST /update_order
231
231
  def make_update_params(order_dto)
232
232
  date_updated, status = sample_drawn_status(order_dto)
233
233
 
@@ -255,7 +255,7 @@ class Lab::Lims::Api::RestApi
255
255
  end
256
256
 
257
257
  ##
258
- # Extracts sample drawn status from an OrderDTO
258
+ # Extracts sample drawn status from an OrderDto
259
259
  def sample_drawn_status(order_dto)
260
260
  order_dto[:sample_statuses].each do |trail_entry|
261
261
  date, status = trail_entry.each_pair.find { |_date, status| status['status'].casecmp?('Drawn') }
@@ -268,13 +268,13 @@ class Lab::Lims::Api::RestApi
268
268
  end
269
269
 
270
270
  ##
271
- # Extracts a sample drawn date from a LIMS OrderDTO.
271
+ # Extracts a sample drawn date from a LIMS OrderDto.
272
272
  def sample_drawn_date(order_dto)
273
273
  sample_drawn_status(order_dto).first
274
274
  end
275
275
 
276
276
  ##
277
- # Extracts the requesting clinician from a LIMS OrderDTO
277
+ # Extracts the requesting clinician from a LIMS OrderDto
278
278
  def requesting_clinician(order_dto)
279
279
  orderer = order_dto[:who_order_test]
280
280
 
@@ -2,10 +2,12 @@
2
2
 
3
3
  module Lab
4
4
  module Lims
5
- class LimsException < StandardError; end
6
- class DuplicateNHID < LimsException; end
7
- class MissingAccessionNumber < LimsException; end
8
- class UnknownSpecimenType < LimsException; end
9
- class UnknownTestType < LimsException; end
5
+ module Exceptions
6
+ class LimsException < StandardError; end
7
+ class DuplicateNHID < LimsException; end
8
+ class MissingAccessionNumber < LimsException; end
9
+ class UnknownSpecimenType < LimsException; end
10
+ class UnknownTestType < LimsException; end
11
+ end
10
12
  end
11
13
  end
@@ -29,7 +29,7 @@ require 'lab/lab_test'
29
29
  require 'lab/lims_order_mapping'
30
30
  require 'lab/lims_failed_import'
31
31
 
32
- require_relative './api/couchdb_api'
32
+ require_relative './api/couch_db_api'
33
33
  require_relative './config'
34
34
  require_relative './pull_worker'
35
35
  require_relative './utils'
@@ -82,7 +82,7 @@ module Lab
82
82
  next unless row['doc']['type']&.casecmp?('Order')
83
83
 
84
84
  User.current = Utils.lab_user
85
- yield OrderDTO.new(row['doc']), OpenStruct.new(last_seq: (from || 0) + limit, current_seq: from)
85
+ yield OrderDto.new(row['doc']), OpenStruct.new(last_seq: (from || 0) + limit, current_seq: from)
86
86
  end
87
87
 
88
88
  from += orders.size
@@ -6,7 +6,7 @@ module Lab
6
6
  module Lims
7
7
  ##
8
8
  # LIMS' Data Transfer Object for orders
9
- class OrderDTO < ActiveSupport::HashWithIndifferentAccess
9
+ class OrderDto < ActiveSupport::HashWithIndifferentAccess
10
10
  include Utils
11
11
 
12
12
  ##
@@ -7,14 +7,14 @@ require_relative './utils'
7
7
  module Lab
8
8
  module Lims
9
9
  ##
10
- # Serializes a LabOrder into a LIMS OrderDTO.
10
+ # Serializes a LabOrder into a LIMS OrderDto.
11
11
  module OrderSerializer
12
12
  class << self
13
13
  include Utils
14
14
 
15
15
  def serialize_order(order)
16
16
  serialized_order = Lims::Utils.structify(Lab::LabOrderSerializer.serialize_order(order))
17
- Lims::OrderDTO.new(
17
+ Lims::OrderDto.new(
18
18
  _id: Lab::LimsOrderMapping.find_by(order: order)&.lims_id || serialized_order.accession_number,
19
19
  tracking_number: serialized_order.accession_number,
20
20
  sending_facility: current_facility_name,
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'logger_multiplexor'
4
4
 
5
- require_relative './api/couchdb_api'
5
+ require_relative './api/couch_db_api'
6
6
 
7
7
  module Lab
8
8
  module Lims
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.2.4'
4
+ VERSION = '1.2.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mahis_emr_api_lab
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
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: 2024-09-06 00:00:00.000000000 Z
11
+ date: 2025-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: couchrest
@@ -254,7 +254,7 @@ files:
254
254
  - app/services/lab/lims/acknowledgement_serializer.rb
255
255
  - app/services/lab/lims/acknowledgement_worker.rb
256
256
  - app/services/lab/lims/api/blackhole_api.rb
257
- - app/services/lab/lims/api/couchdb_api.rb
257
+ - app/services/lab/lims/api/couch_db_api.rb
258
258
  - app/services/lab/lims/api/mysql_api.rb
259
259
  - app/services/lab/lims/api/rest_api.rb
260
260
  - app/services/lab/lims/api/ws_api.rb
@@ -309,7 +309,7 @@ licenses:
309
309
  - MIT
310
310
  metadata:
311
311
  source_code_uri: https://github.com/EGPAFMalawiHIS/his_emr_api_lab
312
- post_install_message:
312
+ post_install_message:
313
313
  rdoc_options: []
314
314
  require_paths:
315
315
  - lib
@@ -324,8 +324,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
324
324
  - !ruby/object:Gem::Version
325
325
  version: '0'
326
326
  requirements: []
327
- rubygems_version: 3.4.17
328
- signing_key:
327
+ rubygems_version: 3.4.1
328
+ signing_key:
329
329
  specification_version: 4
330
330
  summary: Lab extension for the HIS-EMR-API
331
331
  test_files: []