his_emr_api_lab 2.1.7.pre.beta.1 → 2.1.8

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: 0d877b48426a5796cb14b763cb35844b3456c7682a45b42a5e23b0de5695da42
4
- data.tar.gz: 96863f1a68b0b36f0e078294811886361ed1ed24780744e0976385814b029edf
3
+ metadata.gz: 44e72036503453b83d8f3cfcdff281e1085e461c476a8f793e24a3d72f12f223
4
+ data.tar.gz: 0100d95046a1a81db0fc8b7eace3e9fa02dc2f9be6f396f073954bbfa5578993
5
5
  SHA512:
6
- metadata.gz: 3db7243ec7d3ebaa12a9202b8ecd07ac4198e52aa5bc120dc4c8dbcabaa385e458381240a89a458e6876ed932b66f43bedcd2c7ebf47abe02219581a2d601190
7
- data.tar.gz: 67e61249cd7e3078f1ed00d7f94efa2ce31af43f23111a1c322e47a002cd7f9933bfae164ad573ea4d81aa537d2842755de2b5177f98fe0dbe2ea6bdfbbd5262
6
+ metadata.gz: 25cb61dabafa209680d649747e35a06e19ed3685c7730bc0c539a35357e9e9529794ed180714c626125ec6ab8104b107e90e6ad0ab0cbebfcaee2ae728ea7815
7
+ data.tar.gz: 0da64fc5aa9647ffcc3252ae597b0492bacb3b77ec97064c4433f72bcd122431e04114323f7f13dc602faa0ccdc7c2f836b098a1090e9a56fa8cae774503101f
data/README.md CHANGED
@@ -22,25 +22,25 @@ For details on how to perform these operations please see the
22
22
  Add this line to your application's Gemfile:
23
23
 
24
24
  ```ruby
25
- gem 'lab', git: 'https://github.com/EGPAFMalawiHIS/HIS-EMR-API-Lab', branch: 'development'
25
+ gem 'his_emr_api_lab', git: 'https://github.com/EGPAFMalawiHIS/HIS-EMR-API-Lab', branch: 'development'
26
26
  ```
27
27
 
28
28
  And then execute:
29
29
 
30
30
  ```bash
31
- $ bundle install lab
31
+ $ bundle install
32
32
  ```
33
33
 
34
34
  Or install it yourself as:
35
35
 
36
36
  ```bash
37
- $ gem install lab
37
+ $ gem install his_emr_api_lab
38
38
  ```
39
39
 
40
40
  Finally run:
41
41
 
42
42
  ```bash
43
- $ bundle exec rails lab:install
43
+ $ bundle exec rails his_emr_api_lab:install
44
44
  ```
45
45
 
46
46
  ## Configuration
@@ -66,6 +66,19 @@ but too much a departure from it is frowned upon. For example, you will be forgi
66
66
  for writing a method with 15 to 20 lines if you clearly justify why you couldn't
67
67
  break that method into multiple smaller methods.
68
68
 
69
+ ## Publishing
70
+
71
+ To publish a new version of the gem, first update the version number in
72
+ `lib/lab/version.rb` and then run the following command:
73
+
74
+ ```bash
75
+ $ gem build his_emr_api_lab.gemspec
76
+ $ gem push his_emr_api_lab-<version>.gem
77
+ ```
78
+ Make sure to replace `<version>` with the version number you set in `lib/lab/version.rb`.
79
+
80
+ NB: You need to have an account on [rubygems.org](https://rubygems.org/) and permission to publish gems.
81
+
69
82
  ## License
70
83
 
71
84
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -7,7 +7,7 @@ module Lab
7
7
  queue_as :default
8
8
  def perform(results_obs_id, serializer, result_enter_by)
9
9
  Rails.logger.info("Lab::ProcessLabResultJob: Processing result completion for #{serializer}")
10
- results_obs = Lab::LabResult.unscoped.find(results_obs_id)
10
+ results_obs = Lab::LabResult.find(results_obs_id)
11
11
  Lab::ResultsService.process_result_completion(results_obs, serializer, result_enter_by)
12
12
  end
13
13
  end
@@ -34,11 +34,10 @@ module Lab
34
34
 
35
35
  unless specimen_type
36
36
  return ActiveRecord::Base.connection.select_all <<~SQL
37
- SELECT ca.concept_id, ca.value_reference as name, ca2.value_reference as nlims_code, c.uuid
37
+ SELECT ca.concept_id, ca.value_reference as name, ca2.value_reference as nlims_code
38
38
  FROM concept_attribute ca
39
39
  INNER JOIN concept_attribute ca2 ON ca.concept_id = ca2.concept_id
40
40
  AND ca2.attribute_type_id = #{ConceptAttributeType.nlims_code.concept_attribute_type_id}
41
- INNER JOIN concept c ON c.concept_id = ca.concept_id
42
41
  WHERE ca.attribute_type_id = #{ConceptAttributeType.test_catalogue_name.concept_attribute_type_id}
43
42
  AND ca.concept_id IN (#{test_types.select(:concept_id).to_sql})
44
43
  GROUP BY ca.concept_id
@@ -57,11 +56,10 @@ module Lab
57
56
  )
58
57
 
59
58
  return ActiveRecord::Base.connection.select_all <<~SQL
60
- SELECT ca.concept_id, ca.value_reference as name, ca2.value_reference as nlims_code, c.uuid
59
+ SELECT ca.concept_id, ca.value_reference as name, ca2.value_reference as nlims_code
61
60
  FROM concept_attribute ca
62
61
  INNER JOIN concept_attribute ca2 ON ca.concept_id = ca2.concept_id
63
62
  AND ca2.attribute_type_id = #{ConceptAttributeType.nlims_code.concept_attribute_type_id}
64
- INNER JOIN concept c ON c.concept_id = ca.concept_id
65
63
  WHERE ca.attribute_type_id = #{ConceptAttributeType.test_catalogue_name.concept_attribute_type_id}
66
64
  AND ca.concept_id IN (#{concept_set.select(:concept_set).to_sql})
67
65
  GROUP BY ca.concept_id
@@ -74,11 +72,10 @@ module Lab
74
72
 
75
73
  unless test_type
76
74
  return ActiveRecord::Base.connection.select_all <<~SQL
77
- SELECT ca.concept_id, ca.value_reference as name, ca2.value_reference as nlims_code, c.uuid
75
+ SELECT ca.concept_id, ca.value_reference as name, ca2.value_reference as nlims_code
78
76
  FROM concept_attribute ca
79
77
  INNER JOIN concept_attribute ca2 ON ca.concept_id = ca2.concept_id
80
78
  AND ca2.attribute_type_id = #{ConceptAttributeType.nlims_code.concept_attribute_type_id}
81
- INNER JOIN concept c ON c.concept_id = ca.concept_id
82
79
  WHERE ca.attribute_type_id = #{ConceptAttributeType.test_catalogue_name.concept_attribute_type_id}
83
80
  AND ca.concept_id IN (#{specimen_types.select(:concept_id).to_sql})
84
81
  GROUP BY ca.concept_id
@@ -97,11 +94,10 @@ module Lab
97
94
  )
98
95
 
99
96
  return ActiveRecord::Base.connection.select_all <<~SQL
100
- SELECT ca.concept_id, ca.value_reference as name, ca2.value_reference as nlims_code, c.uuid
97
+ SELECT ca.concept_id, ca.value_reference as name, ca2.value_reference as nlims_code
101
98
  FROM concept_attribute ca
102
99
  INNER JOIN concept_attribute ca2 ON ca.concept_id = ca2.concept_id
103
100
  AND ca2.attribute_type_id = #{ConceptAttributeType.nlims_code.concept_attribute_type_id}
104
- INNER JOIN concept c ON c.concept_id = ca.concept_id
105
101
  WHERE ca.attribute_type_id = #{ConceptAttributeType.test_catalogue_name.concept_attribute_type_id}
106
102
  AND ca.concept_id IN (#{concept_set.pluck(:concept_id).push(0).join(',')})
107
103
  GROUP BY ca.concept_id
@@ -118,16 +114,15 @@ module Lab
118
114
  measures = ConceptSet.find_members_by_name(Lab::Metadata::TEST_RESULT_INDICATOR_CONCEPT_NAME)
119
115
  .select(:concept_id)
120
116
 
121
- sets = ConceptSet.where(concept_set: test, concept_id: measures)
117
+ sets = ConceptSet.where(concept_set: measures, concept_id: test)
122
118
 
123
119
  return ActiveRecord::Base.connection.select_all <<~SQL
124
- SELECT ca.concept_id, ca.value_reference as name, ca2.value_reference as nlims_code, c.uuid
120
+ SELECT ca.concept_id, ca.value_reference as name, ca2.value_reference as nlims_code
125
121
  FROM concept_attribute ca
126
122
  INNER JOIN concept_attribute ca2 ON ca.concept_id = ca2.concept_id
127
123
  AND ca2.attribute_type_id = #{ConceptAttributeType.nlims_code.concept_attribute_type_id}
128
- INNER JOIN concept c ON c.concept_id = ca.concept_id
129
124
  WHERE ca.attribute_type_id = #{ConceptAttributeType.test_catalogue_name.concept_attribute_type_id}
130
- AND ca.concept_id IN (#{sets.pluck(:concept_id).push(0).join(',')})
125
+ AND ca.concept_id IN (#{sets.pluck(:concept_set).push(0).join(',')})
131
126
  GROUP BY ca.concept_id
132
127
  SQL
133
128
  end
@@ -247,6 +247,7 @@ module Lab
247
247
 
248
248
  concept = params.dig(:specimen, :concept)
249
249
  concept ||= params.dig(:specimen, :concept_id)
250
+ concept ||= unknown_concept_id
250
251
 
251
252
  order_type = nil
252
253
  order_type = OrderType.find_by_order_type_id!(params[:order_type_id])&.id if params[:order_type_id].present?
@@ -259,8 +260,7 @@ module Lab
259
260
  order.date_created = params[:date]&.to_date || Date.today if order.respond_to?(:date_created)
260
261
  order.start_date = params[:date]&.to_date || Date.today if order.respond_to?(:start_date)
261
262
  order.auto_expire_date = params[:end_date]
262
- # Note: comment_to_fulfiller is a has_one association, not a field
263
- # It will be created via add_comment_to_fulfiller method
263
+ order.comment_to_fulfiller = params[:comment_to_fulfiller] if params[:comment_to_fulfiller]
264
264
  order.accession_number = access_number
265
265
  order.orderer = User.current&.user_id
266
266
 
@@ -348,7 +348,7 @@ module Lab
348
348
  end
349
349
 
350
350
  def unknown_concept_id
351
- ConceptName.find_by_name!('Unknown').concept
351
+ ConceptName.find_by_name!('Unknown').concept_id
352
352
  end
353
353
 
354
354
  def update_reason_for_test(order, concept_id, force_update: false)
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.1.7-beta.1'
4
+ VERSION = '2.1.8'
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.1.7.pre.beta.1
4
+ version: 2.1.8
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-02-19 00:00:00.000000000 Z
11
+ date: 2026-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: couchrest
@@ -340,9 +340,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
340
340
  version: '0'
341
341
  required_rubygems_version: !ruby/object:Gem::Requirement
342
342
  requirements:
343
- - - ">"
343
+ - - ">="
344
344
  - !ruby/object:Gem::Version
345
- version: 1.3.1
345
+ version: '0'
346
346
  requirements: []
347
347
  rubygems_version: 3.4.1
348
348
  signing_key: