emr_ohsp_interface 2.2.1 → 2.2.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ca9634e36555a67204142daadaef5e7c15c390654d5481ee41c753c8b040e33
|
4
|
+
data.tar.gz: f12fa09bf6867abff6f52e31902989b6d16cb5938644fc2095417186c48074d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb7b7599d5c501e5784b5ee039df5eb04f4c8b417aaf9049648436e2d67d1b435d6b9cfd4c63e4b007c6db410f1f712e5387e4731a512daed54f820b1f5a3d83
|
7
|
+
data.tar.gz: 076bee885a2a2c8634ac7a81676be77dd32f2b7d8acf459b10163e3de435ada2de4885492d00f2c43cb9de8bde517021a26b22f57105b4fcd5202d9982666cd7
|
@@ -170,7 +170,7 @@ module EmrOhspInterface
|
|
170
170
|
"SELECT * FROM temp_earliest_start_date
|
171
171
|
WHERE date_enrolled BETWEEN '#{start_date}' AND '#{end_date}'
|
172
172
|
AND date_enrolled = earliest_start_date
|
173
|
-
GROUP BY patient_id" )
|
173
|
+
GROUP BY patient_id" )
|
174
174
|
|
175
175
|
under_five = data.select{|record| calculate_age(record["birthdate"]) < 5 }.\
|
176
176
|
collect{|record| record["patient_id"]}
|
@@ -349,7 +349,7 @@ module EmrOhspInterface
|
|
349
349
|
"SELECT * FROM temp_earliest_start_date
|
350
350
|
WHERE date_enrolled BETWEEN '#{start_date}' AND '#{end_date}'
|
351
351
|
AND date_enrolled = earliest_start_date
|
352
|
-
GROUP BY patient_id" )
|
352
|
+
GROUP BY patient_id" )
|
353
353
|
|
354
354
|
over_and_15_49 = data.select{|record| calculate_age(record["birthdate"]) >= 15 && calculate_age(record["birthdate"]) <=49 }.\
|
355
355
|
collect{|record| record["patient_id"]}
|
@@ -464,12 +464,12 @@ module EmrOhspInterface
|
|
464
464
|
|
465
465
|
reg_data = registration_report(start_date,end_date)
|
466
466
|
|
467
|
-
data =Observation.where("obs_datetime BETWEEN
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
467
|
+
data =Observation.where(Arel.sql("obs_datetime BETWEEN '#{start_date.to_date.strftime('%Y-%m-%d 00:00:00')}' AND '#{end_date.to_date.strftime('%Y-%m-%d 23:59:59')}' AND c.voided = 0 AND obs.concept_id IN (6543, 6542) "))\
|
468
|
+
.joins(Arel.sql('INNER JOIN concept_name c ON c.concept_id = obs.value_coded
|
469
|
+
INNER JOIN person p ON p.person_id = obs.person_id'))\
|
470
|
+
.pluck(Arel.sql("c.name, CASE WHEN (SELECT timestampdiff(year, birthdate, '#{end_date.to_date.strftime('%Y-%m-%d')}')) >= 5 THEN 'more_than_5'
|
471
|
+
ELSE 'less_than_5' END AS age_group,p.person_id")).group_by(&:shift)
|
472
|
+
|
473
473
|
|
474
474
|
diag_map.each do |key, value|
|
475
475
|
collection[key] = { "ids" => [] }
|
@@ -478,7 +478,7 @@ module EmrOhspInterface
|
|
478
478
|
else
|
479
479
|
if key.eql?("Referals from other institutions")
|
480
480
|
reg_data = reg_data.rows.group_by(&:shift)
|
481
|
-
collection[key]["ids"]= reg_data['Referral'].flatten
|
481
|
+
collection[key]["ids"]= reg_data['Referral'] ? reg_data['Referral'].flatten : []
|
482
482
|
end
|
483
483
|
end
|
484
484
|
data.each do |phrase, counts|
|
@@ -502,7 +502,7 @@ module EmrOhspInterface
|
|
502
502
|
def registration_report(start_date=nil,end_date=nil)
|
503
503
|
ActiveRecord::Base.connection.select_all <<~SQL
|
504
504
|
SELECT
|
505
|
-
|
505
|
+
MIN(IFNULL(c.name, 'Unidentified')) AS visit_type,
|
506
506
|
obs.person_id
|
507
507
|
FROM `encounter`
|
508
508
|
LEFT JOIN obs ON obs.encounter_id = encounter.encounter_id AND obs.voided = 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emr_ohsp_interface
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Manda, Petros Kayange, Dominic Kasanga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
134
|
- !ruby/object:Gem::Version
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
|
-
rubygems_version: 3.4.
|
137
|
+
rubygems_version: 3.4.1
|
138
138
|
signing_key:
|
139
139
|
specification_version: 4
|
140
140
|
summary: This in a gem that facilitates interfacing of EMR, One Health Surveillance
|