Skip to content

Commit

Permalink
Merge pull request #421 from makombe/update-2.6
Browse files Browse the repository at this point in the history
Update 2.6
  • Loading branch information
makombe authored Feb 21, 2024
2 parents 5f3782e + e313d82 commit 2dcdd8e
Show file tree
Hide file tree
Showing 8 changed files with 675 additions and 29 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/maven_cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Publish to Nexus

on:
# Manually triggered workflow using the "Run workflow" button
workflow_dispatch:
push:
branches: [ master ]

jobs:
publish:
runs-on: ubuntu-latest

#set up the build enviroment
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'

- name: Build with Maven
run: mvn -B package -DskipTests

- name: Set settings.xml
uses: s4u/[email protected]
with:
servers: |
[{
"id": "mks-repo",
"username": "${{ secrets.MAVEN_USERNAME }}",
"password": "${{ secrets.MAVEN_TOKEN }}"
},
{
"id": "mks-repo-snapshots",
"username": "${{ secrets.MAVEN_USERNAME }}",
"password": "${{ secrets.MAVEN_TOKEN }}"
}]
- name: Publish
run: mvn --batch-mode clean deploy -DskipTests
44 changes: 44 additions & 0 deletions omod/src/main/resources/sql/DDL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ DROP TABLE IF EXISTS kenyaemr_etl.etl_drug_order;
DROP TABLE IF EXISTS kenyaemr_etl.etl_preventive_services;
DROP TABLE IF EXISTS kenyaemr_etl.etl_overdose_reporting;
DROP TABLE IF EXISTS kenyaemr_etl.etl_art_fast_track;
DROP TABLE IF EXISTS kenyaemr_etl.etl_clinical_encounter;

-- create table etl_patient_demographics
create table kenyaemr_etl.etl_patient_demographics (
Expand Down Expand Up @@ -1569,6 +1570,8 @@ SELECT "Successfully created etl_ART_preparation table";
date_created DATETIME NOT NULL,
date_last_modified DATETIME,
visit_reason VARCHAR(255),
complaint_today varchar(10),
complaint_duration DOUBLE,
weight DOUBLE,
height DOUBLE,
systolic_pressure DOUBLE,
Expand Down Expand Up @@ -2905,6 +2908,9 @@ allergy_causative_agent INT(11),
allergy_reaction INT(11),
allergy_severity INT(11),
allergy_onset_date DATE,
complaint INT(11),
complaint_date DATE,
complaint_duration int(11),
voided int(11),
date_created DATETIME NOT NULL,
date_last_modified DATETIME,
Expand Down Expand Up @@ -3429,6 +3435,44 @@ CREATE TABLE kenyaemr_etl.etl_art_fast_track
);
SELECT "Successfully created etl_art_fast_track table";

-- Create etl_clinical_encounter table";
CREATE TABLE kenyaemr_etl.etl_clinical_encounter (
patient_id INT(11) NOT NULL,
visit_id INT(11) DEFAULT NULL,
encounter_id INT(11) NOT NULL PRIMARY KEY,
uuid CHAR(38) NOT NULL,
location_id INT(11) NOT NULL,
provider INT(11) NOT NULL,
visit_date DATE,
visit_type VARCHAR(100),
therapy_ordered VARCHAR(100),
other_therapy_ordered VARCHAR(100),
counselling_ordered VARCHAR(100),
other_counselling_ordered VARCHAR(100),
procedures_prescribed INT(11),
procedures_ordered VARCHAR(100),
admission_needed INT(11),
date_of_patient_admission DATE,
admission_reason VARCHAR(100),
admission_type VARCHAR(100),
priority_of_admission VARCHAR(100),
admission_ward VARCHAR(100),
hospital_stay VARCHAR(100),
referral_needed VARCHAR(100),
refferal_ordered VARCHAR(100),
referral_to VARCHAR(100),
other_facility VARCHAR(100),
this_facility VARCHAR(100),
voided INT(11),
CONSTRAINT FOREIGN KEY (patient_id)
REFERENCES kenyaemr_etl.etl_patient_demographics (patient_id),
CONSTRAINT unique_uuid UNIQUE (uuid),
INDEX (patient_id),
INDEX (visit_id),
INDEX (visit_date)
);
SELECT "Successfully created etl_clinical_encounter table";

UPDATE kenyaemr_etl.etl_script_status SET stop_time=NOW() where id= script_id;

END $$
178 changes: 163 additions & 15 deletions omod/src/main/resources/sql/DML.sql

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions omod/src/main/resources/sql/DataTools.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2949,6 +2949,43 @@ ALTER TABLE kenyaemr_datatools.art_fast_track
ADD INDEX (visit_date);
SELECT "Successfully created art_fast_track table";

-- Create table Clinical Encounter
create table kenyaemr_datatools.clinical_encounter as
select patient_id,
visit_id,
encounter_id,
location_id,
provider,
visit_date,
visit_type,
therapy_ordered,
other_therapy_ordered ,
counselling_ordered ,
other_counselling_ordered,
procedures_prescribed,
procedures_ordered,
admission_needed,
date_of_patient_admission,
admission_reason,
admission_type,
priority_of_admission,
admission_ward,
hospital_stay,
referral_needed,
refferal_ordered,
referral_to,
other_facility,
this_facility,
voided
from kenyaemr_etl.etl_clinical_encounter;
ALTER TABLE kenyaemr_datatools.clinical_encounter
ADD FOREIGN KEY (patient_id) REFERENCES kenyaemr_datatools.patient_demographics (patient_id);
ALTER TABLE kenyaemr_datatools.clinical_encounter
ADD INDEX (patient_id);
ALTER TABLE kenyaemr_datatools.clinical_encounter
ADD INDEX (visit_date);
SELECT "Successfully created clinical_encounter table";

UPDATE kenyaemr_etl.etl_script_status SET stop_time=NOW() where id= script_id;

END $$
Expand Down
Loading

0 comments on commit 2dcdd8e

Please sign in to comment.