his_emr_api_lab 1.0.2 → 1.0.3

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: 161acee8f4fa0bf2c8d1de7d31135bbfd59ba4b4fd0809af0ef1c72a8a555316
4
- data.tar.gz: 14c9fb56e9e626d4daa2a00d646918a1b65dfd580c83a4e9652f06bab21c6ee6
3
+ metadata.gz: 2df320fe6cce133cd3cd516aebd842d8a9ab7320cb9cb5e2e79340f60b49539f
4
+ data.tar.gz: 3d6ce39059259b7ce8cf6d7c0bc8c80ebf6d5ffc8866acdf1eebe31fa525d4d1
5
5
  SHA512:
6
- metadata.gz: 3f17e146fe31982f7e4cf9a892730119dcc49e48ab6f02bc1ac8f8588d45bdaa692cb5daadf994762773ced9eaa285746b8356f4e5452e38e1b68daada0c80e4
7
- data.tar.gz: ffadcbfb0dc76d6ccbd93aa3cd21a8aa0787148391622b6034d47d8e076c2b8ecb49641feea3f9fb7be8562e0aeb73ca3576b2172ca1aa0cf9547cf608ab3717
6
+ metadata.gz: 6aa3de66346efe68f9fd54cc1bea99867a7db756788d05e3e5bf642c5d4bd6ae54b50c075e99d8819f309e4649edfdbcda7cb9ff7130fa6175e29d2b585aa55d
7
+ data.tar.gz: ae44bc491a32582b695aad56c0abfbb21cbd4b1f40843ad9f17cd2ff4d05205fbb5226c1e1cedb24eab9d3700ac6d0e54ba5256f8abb99796cc7827772ff47ec
@@ -83,9 +83,9 @@ module Lab
83
83
 
84
84
  # Translates a LIMS sample priority to a concept_id
85
85
  def reason_for_test
86
- return unknown_concept.concept_id unless self['sample_priority']
86
+ return unknown_concept.concept_id unless self['priority']
87
87
 
88
- ConceptName.find_by_name!(self['sample_priority']).concept_id
88
+ ConceptName.find_by_name!(self['priority']).concept_id
89
89
  end
90
90
 
91
91
  def lab_program
@@ -313,7 +313,7 @@ module Lab
313
313
  end
314
314
 
315
315
  def guess_result_datatype(result)
316
- return 'numeric' if result.strip.match?(/^[+-]?(\d+(\.\d+)|\.\d+)?$/)
316
+ return 'numeric' if result.strip.match?(/^[+-]?((\d+(\.\d+)?)|\.\d+)$/)
317
317
 
318
318
  'text'
319
319
  end
@@ -0,0 +1,20 @@
1
+ class FixNumericResultsValueType < ActiveRecord::Migration[5.2]
2
+ def up
3
+ results = Lab::LabResult.all.includes(:children)
4
+
5
+ ActiveRecord::Base.connection.transaction do
6
+ results.each do |result|
7
+ result.children.each do |measure|
8
+ next unless measure.value_text&.match?(/^[+-]?((\d+(\.\d+)?)|\.\d+)$/)
9
+
10
+ puts "Updating result value type for result measure ##{measure.obs_id}"
11
+ measure.value_numeric = measure.value_text
12
+ measure.value_text = nil
13
+ measure.save!
14
+ end
15
+ end
16
+ end
17
+ end
18
+
19
+ def down; end
20
+ 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 = '1.0.2'
4
+ VERSION = '1.0.3'
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.0.2
4
+ version: 1.0.3
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: 2021-06-08 00:00:00.000000000 Z
11
+ date: 2021-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: couchrest
@@ -270,6 +270,7 @@ files:
270
270
  - db/migrate/20210323080140_change_lims_id_to_string_in_lims_order_mapping.rb
271
271
  - db/migrate/20210326195504_add_order_revision_to_lims_order_mapping.rb
272
272
  - db/migrate/20210407071728_create_lab_lims_failed_imports.rb
273
+ - db/migrate/20210610095024_fix_numeric_results_value_type.rb
273
274
  - lib/auto12epl.rb
274
275
  - lib/couch_bum/couch_bum.rb
275
276
  - lib/generators/lab/install/USAGE