Skip to content

Commit

Permalink
Merge pull request #6 from esaude/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
joaomachiana authored Oct 31, 2019
2 parents 6535d3a + 2a1a5c5 commit 33e4f34
Show file tree
Hide file tree
Showing 43 changed files with 352 additions and 0 deletions.
Binary file added Openelis_war/openelis.war
Binary file not shown.
Binary file not shown.
Binary file added Openmrs_Modules/appframework-2.10.0.omod
Binary file not shown.
Binary file added Openmrs_Modules/appointments-1.1-SNAPSHOT.omod
Binary file not shown.
Binary file added Openmrs_Modules/auditlog-1.1-SNAPSHOT.omod
Binary file not shown.
Binary file added Openmrs_Modules/bacteriology-1.1.omod
Binary file not shown.
Binary file added Openmrs_Modules/bahmni.ie.apps-0.91-SNAPSHOT.omod
Binary file not shown.
Binary file not shown.
Binary file added Openmrs_Modules/bedmanagement-5.10.0.omod
Binary file not shown.
Binary file added Openmrs_Modules/calculation-1.2.omod
Binary file not shown.
Binary file added Openmrs_Modules/emrapi-1.28.0-SNAPSHOT.omod
Binary file not shown.
Binary file added Openmrs_Modules/episodes-1.0-SNAPSHOT.omod
Binary file not shown.
Binary file added Openmrs_Modules/event-2.5.omod
Binary file not shown.
Binary file added Openmrs_Modules/htmlwidgets-1.8.0.omod
Binary file not shown.
Binary file added Openmrs_Modules/idgen-4.4.1.omod
Binary file not shown.
Binary file not shown.
Binary file added Openmrs_Modules/initializer-1.2.0-SNAPSHOT.omod
Binary file not shown.
Binary file added Openmrs_Modules/legacyui-1.3.3.omod
Binary file not shown.
Binary file added Openmrs_Modules/metadatamapping-1.3.1.omod
Binary file not shown.
Binary file added Openmrs_Modules/metadatasharing-1.2.2.omod
Binary file not shown.
Binary file not shown.
Binary file added Openmrs_Modules/openmrs-atomfeed-2.5.6.omod
Binary file not shown.
Binary file added Openmrs_Modules/operationtheater-1.2.1.omod
Binary file not shown.
Binary file added Openmrs_Modules/owa-1.9.0.omod
Binary file not shown.
Binary file added Openmrs_Modules/providermanagement-2.5.0.omod
Binary file not shown.
Binary file not shown.
Binary file added Openmrs_Modules/reporting-1.16.0.omod
Binary file not shown.
Binary file added Openmrs_Modules/reportingrest-1.10.0.omod
Binary file not shown.
Binary file added Openmrs_Modules/rulesengine-0.91-SNAPSHOT.omod
Binary file not shown.
Binary file added Openmrs_Modules/serialization.xstream-0.2.12.omod
Binary file not shown.
Binary file added Openmrs_Modules/uicommons-2.0.omod
Binary file not shown.
Binary file added Openmrs_Modules/uiframework-3.8.omod
Binary file not shown.
Binary file added Openmrs_Modules/uilibrary-2.0.5.omod
Binary file not shown.
Binary file not shown.
80 changes: 80 additions & 0 deletions deletePatientData/deletePatientData.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#GITHUB_URL="https://raw.githubusercontent.com/Bahmni/bahmni-scripts/master/deletePatientData/0.91"

OPENMRS_SQL_FILE="deletePatientDataForOpenMRS.sql"
OPENELIS_SQL_FILE="deletePatientDataForOpenElis.sql"
OPENERP_SQL_FILE="deletePatientDataForOpenERP.sql"
CURDIR=$(pwd)


RED='\033[0;31m'
GREEN='\033[0;32m'
CYAN='\033[0;36m'
NOCOLOR='\033[0m'

stop_all_bahmni_services()
{

echo -e "${CYAN}Stopping all bahmni related services${NOCOLOR}"
bahmni -i $INVENTORY_FILE stop

}

download_and_delete_openmrs_patient_data(){
echo -e "${CYAN}downloading openmrs delete patient data sql file${NOCOLOR}"
if [ -z $OPENMRS_DB_USER ];then
echo -e "${RED}OPENMRS_DB_USER is unset.Please set the ENVIRONMENT VARIABLE OPENMRS_DB_USER ${NOCOLOR}"
else
echo -e "${CYAN} deleting openmrs patient data${NOCOLOR}"
mysql -u$OPENMRS_DB_USER -p$PASSWORD openmrs < $OPENMRS_SQL_FILE
exitcode=$?
if [ $exitcode -ne 0 ]; then
echo -e "${RED}Failed to delete the openmrs patient data${NOCOLOR}"
else
echo -e "${GREEN} Successfully deleted the openmrs patient data${NOCOLOR}"
fi
fi
}

download_and_delete_openelis_patient_data(){
echo -e "${CYAN}downloading openelis delete patient data sql file${NOCOLOR}"
if [ -z "$OPENELIS_DB_USER" ];
then echo -e "${RED}OPENELIS_DB_USER is unset. Please set the ENVIRONMENT VARIABLE OPENELIS_DB_USER${NOCOLOR}"
else
echo -e "${CYAN}deleting openelis patient data ${NOCOLOR}"
psql -U$OPENELIS_DB_USER clinlims < $OPENELIS_SQL_FILE
exitcode=$?
if [ $exitcode -ne 0 ]; then
echo -e "${RED}Failed to delete the openelis patient data${NOCOLOR}"
else
echo -e "${GREEN} Successfully deleted the openelis patient data${NOCOLOR}"
fi
fi
}

download_and_delete_openerp_patient_data(){
echo -e "${CYAN}downloading openerp delete patient data sql file${NOCOLOR}"
if [ -z "$OPENERP_DB_USER" ];
then echo -e "${RED}OPENERP_DB_USER is unset. Please set the ENVIRONMENT VARIABLE OPENERP_DB_USER${NOCOLOR}"
else
echo -e "${CYAN}deleting openerp patient data${NOCOLOR}"
psql -U$OPENERP_DB_USER openerp < $OPENERP_SQL_FILE
exitcode=$?
if [ $exitcode -ne 0 ]; then
echo -e "${RED}Failed to delete the openerp patient data${NOCOLOR}"
else
echo -e "${GREEN} Successfully deleted the openerp patient data${NOCOLOR}"
fi
fi
}

start_all_bahmni_services()
{
echo -e "${CYAN}Starting all bahmni related services${NOCOLOR}"
bahmni -i $INVENTORY_FILE start
}

stop_all_bahmni_services
download_and_delete_openmrs_patient_data
download_and_delete_openelis_patient_data
download_and_delete_openerp_patient_data
start_all_bahmni_services
64 changes: 64 additions & 0 deletions deletePatientData/deletePatientDataForOpenERP.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
truncate table
sale_order,
sale_order_line,
sale_make_invoice,
sale_order_invoice_rel,
sale_order_line_invoice_rel,
sale_order_line_make_invoice,
sale_order_line_property_rel,
sale_order_tax,

sale_order_group,
account_invoice_line,
ledger_journal_rel,
reconcile_account_rel,
validate_account_move,
procurement_order,
purchase_order,
purchase_order_line,
purchase_invoice_rel,
stock_picking,
stock_partial_picking,
stock_partial_picking_line,
stock_partial_move,
stock_partial_move_line,
stock_move,
stock_move_split,
stock_move_split_lines,
stock_return_picking_memory,
stock_inventory_move_rel,
stock_move_history_ids,

account_invoice_line_tax,
account_invoice,
account_invoice_refund,
account_invoice_tax,
account_invoice_cancel,
account_invoice_confirm,

purchase_order_line_invoice_rel,
stock_warehouse_orderpoint,
purchase_order_taxe,

account_voucher,
account_bank_statement_line,
account_voucher_line,
account_bank_statement_line_move_rel,

account_move_line,
account_move_line_relation,
account_analytic_line,
hr_analytic_timesheet;

truncate table
res_partner_attributes,
res_partner_address,
res_partner_bank_type_field,
res_partner_res_partner_category_rel,
res_partner_category;

delete from res_partner where not exists (select ru.partner_id from res_users ru where ru.partner_id = res_partner.id) and id != 1;
delete from markers where feed_uri like '%atomfeed/encounter/recent%' OR feed_uri like '%atomfeed/patient/recent%';
delete from event_records where category = 'product';

truncate table event_records_offset_marker;
37 changes: 37 additions & 0 deletions deletePatientData/deletePatientDataForOpenElis.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
truncate table result_signature,
referral_result,
referral,
result_inventory,
result,
worksheet_analyte,
note,
report_external_export,
report_external_import,
analysis_qaevent,
analysis_storages,
analysis_users,
analysis,
sample_qaevent,
sample_requester,
sample_human,
sample_newborn,
sample_animal,
sample_environmental,
sample_item,
sample_organization,
sample_projects,
sample,
observation_history,
patient,
patient_identity,
patient_occupation,
person_address,
patient_patient_type,
patient_relations,
organization_contact;

delete from person where not exists (select p.person_id from provider p where p.person_id = person.id);
delete from markers where feed_uri like '%atomfeed/encounter/recent%' OR feed_uri like '%atomfeed/patient/recent%';
delete from event_records where category = 'patient';

truncate table event_records_offset_marker;
52 changes: 52 additions & 0 deletions deletePatientData/deletePatientDataForOpenMRS.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
set foreign_key_checks=0;

truncate table test_order;
truncate table drug_order;
truncate table note;
truncate table obs_relationship;
truncate table concept_proposal;
truncate table concept_proposal_tag_map;
truncate table obs;
truncate table orders;
truncate table drug_order;
truncate table test_order;
truncate table relationship;
truncate table visit_attribute;
truncate table bed_patient_assignment_map;
truncate table encounter_provider;
truncate table episode_encounter;
truncate table order_group;
truncate table encounter;
truncate table appointmentscheduling_appointment;
truncate table appointmentscheduling_appointment_status_history;
truncate table patient_appointment;
truncate table visit_attribute;
truncate table visit;
truncate table patient_identifier;
truncate table appointmentscheduling_appointment_request;
truncate table conditions;
truncate table cohort_member;
truncate table patient_program;
truncate table episode_patient_program;
truncate table patient_program_attribute;
truncate table patient_state;
truncate table patient;
truncate table episode;
truncate table audit_log;
delete from person_address where person_id <> 1;
delete from person_attribute where person_id <> 1;
delete from person_name where not exists
(select u.person_id from users u where person_name.person_id = u.person_id or person_name.person_id = 1)
and not exists (select p.person_id from provider p where person_name.person_id = p.person_id or person_name.person_id = 1);
delete from person where not exists
(select u.person_id from users u where person.person_id = u.person_id or person.person_id = 1)
and not exists (select p.person_id from provider p where person.person_id = p.person_id or person.person_id = 1);

delete from event_records where category = 'patient' OR category = 'Encounter';
delete from markers where feed_uri like '%feed/patient/recent%' ;

truncate table event_records_offset_marker;

update bed set status="AVAILABLE";

set foreign_key_checks=1;
11 changes: 11 additions & 0 deletions deletePatientData/sesp_delete_patient_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Set environment variables required for the scripts
export OPENMRS_DB_USER=openmrs-user
export OPENELIS_DB_USER=clinlims
export OPENERP_DB_USER=openerp
export INVENTORY_FILE=local

# Add executable permission for the scripts
chmod a+x *

# Start the script execution
sh deletePatientData.sh
35 changes: 35 additions & 0 deletions script/MOZ_clonRepos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# Create Directory
cd /opt
sudo mkdir sesp_poc_repositories

# Clone Repos

cd /opt/sesp_poc_repositories

# Bahmni-config
sudo git clone https://github.com/esaude/esaude-poc-config.git --branch develop

# Openmrs-module-bahmniapps
sudo git clone https://github.com/esaude/openmrs-module-bahmniapps.git --branch develop

# Metadata
sudo git clone https://github.com/esaude/sesp-bahmni-metadata.git --branch develop

# Openerp-module
sudo git clone https://github.com/esaude/openerp-modules.git --branch develop

# Patient-status-scheduler
sudo git clone https://github.com/esaude/patient-status-scheduler.git --branch develop

# Bahmni-emr-hospital-service
sudo git clone https://github.com/esaude/bahmni-emr-hospital-service.git --branch develop

# Sesp-infrastructure
sudo git clone https://github.com/esaude/sesp-infrastructure.git --branch develop





53 changes: 53 additions & 0 deletions script/MOZ_dev_server_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

# Link the app folder
sudo mv /opt/bahmni-web/etc/bahmniapps /opt/bahmni-web/etc/bahmniapps-original
sudo ln -s /opt/sesp_poc_repositories/openmrs-module-bahmniapps/ui/app /opt/bahmni-web/etc/bahmniapps
sudo chown -h bahmni:bahmni /opt/bahmni-web/etc/bahmniapps

# Link the config folder
sudo mv -b /opt/bahmni-web/etc/bahmni_config /opt/bahmni-web/etc/bahmni_config-original
sudo ln -s /opt/sesp_poc_repositories/esaude-poc-config /opt/bahmni-web/etc/bahmni_config
sudo chown -h bahmni:bahmni /opt/bahmni-web/etc/bahmni_config

# Link the metadata folder
sudo ln -s /opt/sesp_poc_repositories/sesp-bahmni-metadata/configuration /opt/openmrs/configuration
sudo chown -h bahmni:bahmni /opt/openmrs/configuration

# Link the module folder
sudo mv /opt/openmrs/modules /opt/openmrs/modules-original
sudo ln -s /opt/sesp_poc_repositories/sesp-infrastructure/Openmrs_Modules /opt/openmrs/modules
sudo chown -h bahmni:bahmni /opt/openmrs/modules

# Link the HTML folder
sudo mv -b /var/www/html /var/www/html-original
sudo ln -s /opt/sesp_poc_repositories/bahmni-emr-hospital-service/html /var/www/html
sudo chown -h bahmni:bahmni /var/www/html

# Link the Openerp-Modules
sudo mv -b /opt/bahmni-erp/bahmni-addons /opt/bahmni-erp/bahmni-addons-original
sudo ln -s /opt/sesp_poc_repositories/modules /opt/bahmni-erp/bahmni-addons
sudo chown -h bahmni:bahmni /opt/bahmni-erp/bahmni-addons


# Run sql scripts
mysql -uroot -ppassword openmrs < /opt/sesp_poc_repositories/sesp-bahmni-metadata/sql/mySQL/alter_visit_locatiion.sql
mysql -uroot -ppassword openmrs < /opt/sesp_poc_repositories/sesp-bahmni-metadata/sql/mySQL/person_attribute_alter_value_column.sql

# Run postgresql scripts
#OpenElis
psql -Uclinlims clinlims < /opt/sesp_poc_repositories/sesp-bahmni-metadata/sql/elisPostgresql/1_openElisUesrRole.sql
psql -Uclinlims clinlims < /opt/sesp_poc_repositories/sesp-bahmni-metadata/sql/elisPostgresql/2_removeHomeIcon.sql
psql -Uclinlims clinlims < /opt/sesp_poc_repositories/sesp-bahmni-metadata/sql/elisPostgresql/3_UpdateTestName.sql
psql -Uclinlims clinlims < /opt/sesp_poc_repositories/sesp-bahmni-metadata/sql/elisPostgresql/4_hideDepartment.sql
psql -Uclinlims clinlims < /opt/sesp_poc_repositories/sesp-bahmni-metadata/sql/elisPostgresql/5_hideSampleType.sql
psql -Uclinlims clinlims < /opt/sesp_poc_repositories/sesp-bahmni-metadata/sql/elisPostgresql/6_unitRanges.sql
psql -Uclinlims clinlims < /opt/sesp_poc_repositories/sesp-bahmni-metadata/sql/elisPostgresql/7_visitType.sql
# OpenERP
psql -Uopenerp openerp < /opt/sesp_poc_repositories/sesp-bahmni-metadata/sql/erpPostgresql/categoryNameUpdate.sql
psql -Uopenerp openerp < /opt/sesp_poc_repositories/sesp-bahmni-metadata/sql/erpPostgresql/currencyUpdate.sql
psql -Uopenerp openerp < /opt/sesp_poc_repositories/sesp-bahmni-metadata/sql/erpPostgresql/syncable_units.sql


# Restart OpenMRS
sudo service openmrs restart
11 changes: 11 additions & 0 deletions startopenerp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Automatically run script at boot time
# Following are simple instructions
# Make /etc/rc.d/rc.local executable, by using this command:
chmod +x /etc/rc.d/rc.local
# Edit the file /etc/rc.local and to the bottom of it simply add the line pointing to your shell script:
/path/MyShScript.sh
# And then to make it executable, run:
chmod +x /path/MyShScript.sh
# DONE!


9 changes: 9 additions & 0 deletions startopenerp/startopenerp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Stop OpenERP service
sudo service openerp stop
# Start OpenERP service
sudo su - openerp -c "cd /opt/bahmni-erp/ && nohup ./openerp-server --addons-path=/opt/bahmni-erp/bahmni-addons,/usr/lib/python2.6/site-packages/openerp-7.0_20130301_002301-py2.6.egg/openerp/addons &"
echo "OpenERP started"


0 comments on commit 33e4f34

Please sign in to comment.