From 137197b919affdbc42f3dddfcfad1ee5a1b5c702 Mon Sep 17 00:00:00 2001 From: SteveGT96 Date: Thu, 3 Oct 2024 16:55:52 +0100 Subject: [PATCH 01/11] update(OP-1351): Change operation opeFor field to enum --- sql/load_demo_data.sql | 102 +++++++++--------- ...perations_table_change_ope_for_to_enum.sql | 11 ++ .../isf/operation/enums/OperationTarget.java | 5 + .../org/isf/operation/model/Operation.java | 19 ++-- src/test/java/org/isf/operation/Tests.java | 84 ++++++++------- 5 files changed, 118 insertions(+), 103 deletions(-) create mode 100644 sql/step_a110_update_operations_table_change_ope_for_to_enum.sql create mode 100644 src/main/java/org/isf/operation/enums/OperationTarget.java diff --git a/sql/load_demo_data.sql b/sql/load_demo_data.sql index 5f3dda4ed..ae8f075fa 100644 --- a/sql/load_demo_data.sql +++ b/sql/load_demo_data.sql @@ -3545,57 +3545,57 @@ UNLOCK TABLES; LOCK TABLES `oh_operation` WRITE; /*!40000 ALTER TABLE `oh_operation` DISABLE KEYS */; -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('1','OB','Caesarian section',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('10','OB','Septic abortion',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('11','OB','Dilatation and curettage',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('12','OB','Repair of vesico-vaginal fistula (vvf)',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('13','GY','Acute abdomen',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('14','GY','Ectopic pregnancy',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('15','GY','Peritonitis',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('16','GY','Pelvic abscess',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('17','GY','Uterine fibroids',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('18','GY','Ovarian tumours',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('19','GY','Uterine prolapse',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('2','OB','emergency',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('20','GY','Cystorele',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('21','MG','circumcision',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('22','MG','phimosis',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('23','MG','paraphimosis',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('24','MG','dorsal slit-paraphimosis',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('25','MG','uretheral stricture-bougienage',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('26','MG','Hydroceletomy',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('27','MG','Testicular tumours',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('28','MG','Prostatectomy',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('29','MG','Prostate biopsy',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('3','OB','elective',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('30','MG','Bladder biopsy',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('31','AG','Hernia (inguinal & femoral)',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('32','AG','Strangulated',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('33','AG','Non strangulated',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('34','AG','Epigastrical Hernia',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('37','AG','Intestinal obstruction',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('38','AG','Mechanical',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('39','AG','Volvulus',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('4','OB','Hysterectomy',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('40','AG','Laparatomy',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('41','AG','Penetrating abdominal injuries',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('42','AG','Peritonitis',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('43','AG','Appendicitis',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('44','AG','Cholecystitis',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('45','AG','Abdominal Tumours',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('46','OR','Reduction of fractures',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('47','OR','Upper limb',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('48','OR','Lower limb',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('49','OR','Osteomyelitis - sequestrectomy',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('5','OB','Ruptured uterus',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('50','OS','Incission & drainage',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('51','OS','Debridement',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('52','OS','Mise -a- plat',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('53','OS','Surgical toilet & suture',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('6','OB','Injured uterus',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('7','OB','Hysterectomy',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('8','OB','Evacuations',1,'1',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('9','OB','Incomplete abortion',1,'1',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('1','OB','Caesarian section',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('10','OB','Septic abortion',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('11','OB','Dilatation and curettage',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('12','OB','Repair of vesico-vaginal fistula (vvf)',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('13','GY','Acute abdomen',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('14','GY','Ectopic pregnancy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('15','GY','Peritonitis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('16','GY','Pelvic abscess',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('17','GY','Uterine fibroids',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('18','GY','Ovarian tumours',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('19','GY','Uterine prolapse',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('2','OB','emergency',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('20','GY','Cystorele',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('21','MG','circumcision',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('22','MG','phimosis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('23','MG','paraphimosis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('24','MG','dorsal slit-paraphimosis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('25','MG','uretheral stricture-bougienage',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('26','MG','Hydroceletomy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('27','MG','Testicular tumours',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('28','MG','Prostatectomy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('29','MG','Prostate biopsy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('3','OB','elective',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('30','MG','Bladder biopsy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('31','AG','Hernia (inguinal & femoral)',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('32','AG','Strangulated',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('33','AG','Non strangulated',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('34','AG','Epigastrical Hernia',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('37','AG','Intestinal obstruction',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('38','AG','Mechanical',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('39','AG','Volvulus',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('4','OB','Hysterectomy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('40','AG','Laparatomy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('41','AG','Penetrating abdominal injuries',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('42','AG','Peritonitis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('43','AG','Appendicitis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('44','AG','Cholecystitis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('45','AG','Abdominal Tumours',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('46','OR','Reduction of fractures',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('47','OR','Upper limb',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('48','OR','Lower limb',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('49','OR','Osteomyelitis - sequestrectomy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('5','OB','Ruptured uterus',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('50','OS','Incission & drainage',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('51','OS','Debridement',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('52','OS','Mise -a- plat',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('53','OS','Surgical toilet & suture',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('6','OB','Injured uterus',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('7','OB','Hysterectomy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('8','OB','Evacuations',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('9','OB','Incomplete abortion',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); /*!40000 ALTER TABLE `oh_operation` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/step_a110_update_operations_table_change_ope_for_to_enum.sql b/sql/step_a110_update_operations_table_change_ope_for_to_enum.sql new file mode 100644 index 000000000..afb24f916 --- /dev/null +++ b/sql/step_a110_update_operations_table_change_ope_for_to_enum.sql @@ -0,0 +1,11 @@ +ALTER TABLE OH_OPERATION MODIFY COLUMN OPE_FOR VARCHAR(20); + +UPDATE OH_OPERATION + SET OPE_FOR='OPD_ADMISSION' WHERE OPE_FOR='1'; +UPDATE OH_OPERATION + SET OPE_FOR='ADMISSION' WHERE OPE_FOR='2'; +UPDATE OH_OPERATION + SET OPE_FOR='OPD' WHERE OPE_FOR='3'; + +ALTER TABLE OH_OPERATION + MODIFY COLUMN OPE_FOR ENUM('OPD', 'ADMISSION', 'OPD_ADMISSION') DEFAULT 'OPD_ADMISSION'; \ No newline at end of file diff --git a/src/main/java/org/isf/operation/enums/OperationTarget.java b/src/main/java/org/isf/operation/enums/OperationTarget.java new file mode 100644 index 000000000..0320cdb4e --- /dev/null +++ b/src/main/java/org/isf/operation/enums/OperationTarget.java @@ -0,0 +1,5 @@ +package org.isf.operation.enums; + +public enum OperationTarget { + OPD, ADMISSION, OPD_ADMISSION; +} diff --git a/src/main/java/org/isf/operation/model/Operation.java b/src/main/java/org/isf/operation/model/Operation.java index 2d12e6ca7..8003a6a4d 100644 --- a/src/main/java/org/isf/operation/model/Operation.java +++ b/src/main/java/org/isf/operation/model/Operation.java @@ -33,6 +33,7 @@ import jakarta.persistence.Version; import jakarta.validation.constraints.NotNull; +import org.isf.operation.enums.OperationTarget; import org.isf.opetype.model.OperationType; import org.isf.utils.db.Auditable; import org.springframework.data.jpa.domain.support.AuditingEntityListener; @@ -64,14 +65,8 @@ public class Operation extends Auditable { @Column(name="OPE_STAT") private Integer major; - /* - * //TODO: replace "integers" values with mnemonic ones, CHAR(1) -> VARCHAR(10) - * "1" = OPD / ADMISSION - * "2" = ADMISSION - * "3" = OPD - */ @Column(name="OPE_FOR") - private String operFor; + private OperationTarget opeFor; @Version @@ -104,11 +99,11 @@ public String getCode() { public void setCode(String aCode) { this.code = aCode; } - public void setOpeFor(String operFor) { - this.operFor = operFor; + public void setOpeFor(OperationTarget opeFor) { + this.opeFor = opeFor; } - public String getOpeFor() { - return this.operFor; + public OperationTarget getOpeFor() { + return this.opeFor; } @@ -158,6 +153,7 @@ public boolean equals(Object anObject) { return (this.getCode().equals(operation.getCode()) && this.getDescription().equalsIgnoreCase(operation.getDescription()) && this.getType().equals(operation.getType()) && + this.getOpeFor().equals(operation.getOpeFor()) && this.getMajor().equals(operation.getMajor())); } @@ -170,6 +166,7 @@ public int hashCode() { c = m * c + ((code == null) ? 0 : code.hashCode()); c = m * c + ((description == null) ? 0 : description.hashCode()); c = m * c + ((type == null) ? 0 : type.hashCode()); + c = m * c + ((opeFor == null) ? 0 : opeFor.hashCode()); c = m * c + ((major == null) ? 0 : major); c = m * c + ((lock == null) ? 0 : lock); diff --git a/src/test/java/org/isf/operation/Tests.java b/src/test/java/org/isf/operation/Tests.java index 3a6eb6db4..3e3de4812 100644 --- a/src/test/java/org/isf/operation/Tests.java +++ b/src/test/java/org/isf/operation/Tests.java @@ -54,6 +54,7 @@ import org.isf.opd.TestOpd; import org.isf.opd.model.Opd; import org.isf.opd.service.OpdIoOperationRepository; +import org.isf.operation.enums.OperationTarget; import org.isf.operation.manager.OperationBrowserManager; import org.isf.operation.manager.OperationRowBrowserManager; import org.isf.operation.model.Operation; @@ -223,7 +224,7 @@ void testIoGetOperationByTypeDescriptionNull() throws Exception { void testIoGetOperationOpdOpdAdmission() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor("1"); // "1" = OPD / ADMISSION + operation.setOpeFor(OperationTarget.OPD_ADMISSION); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationIoOperations.getOperationOpd()).isNotEmpty(); @@ -233,7 +234,7 @@ void testIoGetOperationOpdOpdAdmission() throws Exception { void testIoGetOperationOpdOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor("3"); // "3" = OPD + operation.setOpeFor(OperationTarget.OPD); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationIoOperations.getOperationOpd()).isNotEmpty(); @@ -243,7 +244,7 @@ void testIoGetOperationOpdOpd() throws Exception { void testIoGetOperationOpdNotOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor("2"); // "2" = ADMISSION + operation.setOpeFor(OperationTarget.ADMISSION); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationIoOperations.getOperationOpd()).isEmpty(); @@ -253,7 +254,7 @@ void testIoGetOperationOpdNotOpd() throws Exception { void testIoGetOperationAdmOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor("1"); // "1" = OPD / ADMISSION + operation.setOpeFor(OperationTarget.OPD_ADMISSION); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationIoOperations.getOperationAdm()).isNotEmpty(); @@ -263,7 +264,7 @@ void testIoGetOperationAdmOpd() throws Exception { void testIoGetOperationAdmAdmission() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor("2"); // "2" = ADMISSION + operation.setOpeFor(OperationTarget.ADMISSION); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationIoOperations.getOperationAdm()).isNotEmpty(); @@ -273,7 +274,7 @@ void testIoGetOperationAdmAdmission() throws Exception { void testIoGetOperationAdmNotOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor("3"); // "3" = OPD + operation.setOpeFor(OperationTarget.OPD); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationIoOperations.getOperationAdm()).isEmpty(); @@ -369,7 +370,7 @@ void testGetOperationPageable() throws Exception { void testMgrGetOperationOpdOpdAdmission() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor("1"); // "1" = OPD / ADMISSION + operation.setOpeFor(OperationTarget.OPD_ADMISSION); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationBrowserManager.getOperationOpd()).isNotEmpty(); @@ -379,7 +380,7 @@ void testMgrGetOperationOpdOpdAdmission() throws Exception { void testMgrGetOperationOpdOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor("3"); // "3" = OPD + operation.setOpeFor(OperationTarget.OPD); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationBrowserManager.getOperationOpd()).isNotEmpty(); @@ -389,7 +390,7 @@ void testMgrGetOperationOpdOpd() throws Exception { void testMgrGetOperationOpdNotOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor("2"); // "2" = ADMISSION + operation.setOpeFor(OperationTarget.ADMISSION); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationBrowserManager.getOperationOpd()).isEmpty(); @@ -399,7 +400,7 @@ void testMgrGetOperationOpdNotOpd() throws Exception { void testMgrGetOperationAdmOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor("1"); // "1" = OPD / ADMISSION + operation.setOpeFor(OperationTarget.OPD_ADMISSION); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationBrowserManager.getOperationAdm()).isNotEmpty(); @@ -409,7 +410,7 @@ void testMgrGetOperationAdmOpd() throws Exception { void testMgrGetOperationAdmAdmission() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor("2"); // "2" = ADMISSION + operation.setOpeFor(OperationTarget.ADMISSION); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationBrowserManager.getOperationAdm()).isNotEmpty(); @@ -419,7 +420,7 @@ void testMgrGetOperationAdmAdmission() throws Exception { void testMgrGetOperationAdmNotOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor("3"); // "3" = OPD + operation.setOpeFor(OperationTarget.OPD); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationBrowserManager.getOperationAdm()).isEmpty(); @@ -569,8 +570,8 @@ void testRowIoGetRowByAdmission() throws Exception { DeliveryResultType deliveryResult = testDeliveryResultType.setup(false); Admission admission = testAdmission.setup(ward, patient, admissionType, diseaseIn, diseaseOut1, - diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, - deliveryType, deliveryResult, false); + diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, + deliveryType, deliveryResult, false); operationRow.setAdmission(admission); wardIoOperationRepository.saveAndFlush(ward); @@ -620,8 +621,8 @@ void testRowIoGetRowByAdmissionNotFound() throws Exception { DeliveryResultType deliveryResult = testDeliveryResultType.setup(false); Admission admission = testAdmission.setup(ward, patient, admissionType, diseaseIn, diseaseOut1, - diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, - deliveryType, deliveryResult, false); + diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, + deliveryType, deliveryResult, false); // Don't set admission; leave it as default value of null; operationRow.setAdmission(admission); wardIoOperationRepository.saveAndFlush(ward); @@ -758,8 +759,8 @@ void testMgrRowGetRowByAdmission() throws Exception { DeliveryResultType deliveryResult = testDeliveryResultType.setup(false); Admission admission = testAdmission.setup(ward, patient, admissionType, diseaseIn, diseaseOut1, - diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, - deliveryType, deliveryResult, false); + diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, + deliveryType, deliveryResult, false); operationRow.setAdmission(admission); wardIoOperationRepository.saveAndFlush(ward); @@ -809,8 +810,8 @@ void testMgrRowGetRowByAdmissionNotFound() throws Exception { DeliveryResultType deliveryResult = testDeliveryResultType.setup(false); Admission admission = testAdmission.setup(ward, patient, admissionType, diseaseIn, diseaseOut1, - diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, - deliveryType, deliveryResult, false); + diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, + deliveryType, deliveryResult, false); // Don't set admission; leave it as default value of null; operationRow.setAdmission(admission); wardIoOperationRepository.saveAndFlush(ward); @@ -933,8 +934,8 @@ void testMgrRowNewOperationRow() throws Exception { DeliveryResultType deliveryResult = testDeliveryResultType.setup(false); Admission admission = testAdmission.setup(ward, patient, admissionType, diseaseIn, diseaseOut1, - diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, - deliveryType, deliveryResult, false); + diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, + deliveryType, deliveryResult, false); operationRow.setAdmission(admission); wardIoOperationRepository.saveAndFlush(ward); @@ -971,8 +972,8 @@ void testOperationGettersSetters() throws Exception { operation.setLock(-1); assertThat(operation.getLock()).isEqualTo(-1); - operation.setOpeFor("some new string"); - assertThat(operation.getOpeFor()).isEqualTo("some new string"); + operation.setOpeFor(OperationTarget.ADMISSION); + assertThat(operation.getOpeFor()).isEqualTo(OperationTarget.ADMISSION); } @Test @@ -981,9 +982,9 @@ void testOperationEquals() throws Exception { Operation operation = testOperation.setup(operationType, true); assertThat(operation) - .isEqualTo(operation) - .isNotNull() - .isNotEqualTo("a string"); + .isEqualTo(operation) + .isNotNull() + .isNotEqualTo("a string"); OperationType operationType1 = testOperationType.setup(false); Operation operation1 = testOperation.setup(operationType, true); @@ -1050,14 +1051,15 @@ void testOperationRowConstructors() throws Exception { DeliveryResultType deliveryResult = testDeliveryResultType.setup(false); Admission admission = testAdmission.setup(ward, patient, admissionType, diseaseIn, diseaseOut1, - diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, - deliveryType, deliveryResult, false); + diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, + deliveryType, deliveryResult, false); - OperationRow operationRow1 = new OperationRow(operation, "prescriber", "opResult", LocalDateTime.of(2021, 1, 1, 0, 0, 0), "remarks", admission, new Opd(), - null, 10.0f); + OperationRow operationRow1 = new OperationRow(operation, "prescriber", "opResult", LocalDateTime.of(2021, 1, 1, 0, 0, 0), "remarks", admission, + new Opd(), + null, 10.0f); OperationRow operationRow2 = new OperationRow(1, operation, "prescriber", "opResult", LocalDateTime.of(2021, 1, 1, 0, 0, 0), "remarks", admission, - new Opd(), null, 10.0f); + new Opd(), null, 10.0f); operationRow1.setId(1); assertThat(operationRow1).isEqualTo(operationRow2); @@ -1070,9 +1072,9 @@ void testOperationRowEquals() throws Exception { OperationRow operationRow = testOperationRow.setup(operation, false); assertThat(operationRow) - .isEqualTo(operationRow) - .isNotNull() - .isNotEqualTo("some string"); + .isEqualTo(operationRow) + .isNotNull() + .isNotEqualTo("some string"); } @Test @@ -1096,8 +1098,8 @@ void testOperationRowToString() throws Exception { Patient patient = testPatient.setup(false); Admission admission = testAdmission.setup(null, patient, null, null, null, - null, null, operation, null, null, - null, null, false); + null, null, operation, null, null, + null, null, false); admission.setUserID("UserID"); operationRow.setAdmission(admission); @@ -1107,7 +1109,7 @@ void testOperationRowToString() throws Exception { private String setupTestOperation(boolean usingSet) throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, usingSet); - operation.setOpeFor("1"); + operation.setOpeFor(OperationTarget.OPD_ADMISSION); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); return operation.getCode(); @@ -1150,8 +1152,8 @@ private int setupTestOperationRowWithAdmission(boolean usingSet) throws Exceptio DeliveryResultType deliveryResult = testDeliveryResultType.setup(false); Admission admission = testAdmission.setup(ward, patient, admissionType, diseaseIn, diseaseOut1, - diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, - deliveryType, deliveryResult, false); + diseaseOut2, diseaseOut3, operation, dischargeType, pregTreatmentType, + deliveryType, deliveryResult, false); operationRow.setAdmission(admission); wardIoOperationRepository.saveAndFlush(ward); @@ -1175,7 +1177,7 @@ private int setupTestOperationRowWithAdmission(boolean usingSet) throws Exceptio operationRowIoOperationRepository.saveAndFlush(operationRow); return operationRow.getId(); } - + private void checkOperationRowIntoDb(int id) throws Exception { OperationRow foundOperationRow = operationRowIoOperationRepository.findById(id); testOperationRow.check(foundOperationRow); From 05e6c8e3aae14ed62cdefc24480896056a0f3c08 Mon Sep 17 00:00:00 2001 From: SteveGT96 Date: Thu, 3 Oct 2024 16:58:36 +0100 Subject: [PATCH 02/11] chore: Update migration steps --- sql/step_04_all_following_steps.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/step_04_all_following_steps.sql b/sql/step_04_all_following_steps.sql index 66ea4529a..1db4b32c6 100644 --- a/sql/step_04_all_following_steps.sql +++ b/sql/step_04_all_following_steps.sql @@ -103,3 +103,4 @@ source step_a106_medicaldsrstock_control.sql; source step_a107_add_permission_admin_access.sql; source step_a108_audit_dicom_type_and_dicom_data.sql; source step_a109_update_user_settings_table_constraints_and_add_usergroups_permissions.sql; +source step_a110_update_operations_table_change_ope_for_to_enum.sql; From 82a17bb3125bbb55a25a75dd01dd66dca242bd53 Mon Sep 17 00:00:00 2001 From: SteveGT96 Date: Thu, 3 Oct 2024 18:07:57 +0100 Subject: [PATCH 03/11] chore: Update OperationIoOperations repository and add license header to OperationTarget --- .../isf/operation/enums/OperationTarget.java | 21 ++++ .../OperationIoOperationRepository.java | 112 +++++++++--------- 2 files changed, 77 insertions(+), 56 deletions(-) diff --git a/src/main/java/org/isf/operation/enums/OperationTarget.java b/src/main/java/org/isf/operation/enums/OperationTarget.java index 0320cdb4e..67bc5a4cc 100644 --- a/src/main/java/org/isf/operation/enums/OperationTarget.java +++ b/src/main/java/org/isf/operation/enums/OperationTarget.java @@ -1,3 +1,24 @@ +/* + * Open Hospital (www.open-hospital.org) + * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) + * + * Open Hospital is a free and open source software for healthcare data management. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * https://www.gnu.org/licenses/gpl-3.0-standalone.html + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package org.isf.operation.enums; public enum OperationTarget { diff --git a/src/main/java/org/isf/operation/service/OperationIoOperationRepository.java b/src/main/java/org/isf/operation/service/OperationIoOperationRepository.java index 795e7d2e7..48371ecc6 100644 --- a/src/main/java/org/isf/operation/service/OperationIoOperationRepository.java +++ b/src/main/java/org/isf/operation/service/OperationIoOperationRepository.java @@ -1,56 +1,56 @@ -/* - * Open Hospital (www.open-hospital.org) - * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) - * - * Open Hospital is a free and open source software for healthcare data management. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * https://www.gnu.org/licenses/gpl-3.0-standalone.html - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.isf.operation.service; - -import java.util.List; - -import org.isf.operation.model.Operation; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - -public interface OperationIoOperationRepository extends JpaRepository { - - @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OPE_FOR LIKE 1 OR OPE_FOR LIKE 3 OR OPE_FOR LIKE 2 ORDER BY OPE_DESC", nativeQuery = true) - List findByOrderByDescriptionAsc(); - - List findAllByDescriptionContainsOrderByDescriptionDesc(String description); - - Operation findOneByDescriptionAndType_Code(String description, String type); - - Operation findByCode(String code); - - @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OPE_FOR LIKE 1 OR OPE_FOR LIKE 3 ORDER BY OPE_DESC", nativeQuery = true) - List findAllWithoutDescriptionOpd(); - - @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OPE_FOR LIKE 1 OR OPE_FOR LIKE 2 ORDER BY OPE_DESC", nativeQuery = true) - List findAllWithoutDescriptionAdm(); - - @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OCL_DESC LIKE :desc AND (OPE_FOR LIKE 1 OR OPE_FOR LIKE 2 OR OPE_FOR LIKE 3) ORDER BY OPE_DESC", nativeQuery = true) - List findAllByType_DescriptionContainsOrderByDescriptionAsc(@Param("desc") String typeDescription); - - @Query(value = "SELECT * FROM OH_OPERATION ORDER BY OPE_DESC", nativeQuery = true) - Page findAllPageable(Pageable pageable); - -} +/* + * Open Hospital (www.open-hospital.org) + * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) + * + * Open Hospital is a free and open source software for healthcare data management. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * https://www.gnu.org/licenses/gpl-3.0-standalone.html + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.isf.operation.service; + +import java.util.List; + +import org.isf.operation.model.Operation; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +public interface OperationIoOperationRepository extends JpaRepository { + + @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OPE_FOR LIKE 1 OR OPE_FOR='OPD' OR OPE_FOR='ADMISSION' ORDER BY OPE_DESC", nativeQuery = true) + List findByOrderByDescriptionAsc(); + + List findAllByDescriptionContainsOrderByDescriptionDesc(String description); + + Operation findOneByDescriptionAndType_Code(String description, String type); + + Operation findByCode(String code); + + @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OPE_FOR='OPD_ADMISSION' OR OPE_FOR='OPD' ORDER BY OPE_DESC", nativeQuery = true) + List findAllWithoutDescriptionOpd(); + + @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OPE_FOR='OPD_ADMISSION' OR OPE_FOR='ADMISSION' ORDER BY OPE_DESC", nativeQuery = true) + List findAllWithoutDescriptionAdm(); + + @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OCL_DESC LIKE :desc AND (OPE_FOR='OPD_ADMISSION' OR OPE_FOR='ADMISSION' OR OPE_FOR='OPD') ORDER BY OPE_DESC", nativeQuery = true) + List findAllByType_DescriptionContainsOrderByDescriptionAsc(@Param("desc") String typeDescription); + + @Query(value = "SELECT * FROM OH_OPERATION ORDER BY OPE_DESC", nativeQuery = true) + Page findAllPageable(Pageable pageable); + +} From 3671c8285c54a5fcf6c0d7a7f40eb0e7823aaa41 Mon Sep 17 00:00:00 2001 From: SteveGT96 Date: Fri, 4 Oct 2024 08:50:05 +0100 Subject: [PATCH 04/11] chore: Fix opeFor field and getOperation method --- .../org/isf/operation/model/Operation.java | 187 +++++++++--------- .../OperationIoOperationRepository.java | 4 +- 2 files changed, 96 insertions(+), 95 deletions(-) diff --git a/src/main/java/org/isf/operation/model/Operation.java b/src/main/java/org/isf/operation/model/Operation.java index 8003a6a4d..83cfa0aa5 100644 --- a/src/main/java/org/isf/operation/model/Operation.java +++ b/src/main/java/org/isf/operation/model/Operation.java @@ -25,6 +25,8 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; import jakarta.persistence.Id; import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToOne; @@ -39,7 +41,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener; @Entity -@Table(name="OH_OPERATION") +@Table(name = "OH_OPERATION") @EntityListeners(AuditingEntityListener.class) @AttributeOverride(name = "createdBy", column = @Column(name = "OPE_CREATED_BY", updatable = false)) @AttributeOverride(name = "createdDate", column = @Column(name = "OPE_CREATED_DATE", updatable = false)) @@ -49,33 +51,33 @@ public class Operation extends Auditable { @Id - @Column(name="OPE_ID_A") - private String code; + @Column(name = "OPE_ID_A") + private String code; @NotNull - @Column(name="OPE_DESC") - private String description; + @Column(name = "OPE_DESC") + private String description; @NotNull @ManyToOne - @JoinColumn(name="OPE_OCL_ID_A") - private OperationType type; + @JoinColumn(name = "OPE_OCL_ID_A") + private OperationType type; @NotNull - @Column(name="OPE_STAT") - private Integer major; + @Column(name = "OPE_STAT") + private Integer major; + + @Column(name = "OPE_FOR", columnDefinition = "VARCHAR(20)") + @Enumerated(EnumType.STRING) + private OperationTarget opeFor; - @Column(name="OPE_FOR") - private OperationTarget opeFor; - - @Version - @Column(name="OPE_LOCK") - private Integer lock; + @Column(name = "OPE_LOCK") + private Integer lock; @Transient - private volatile int hashCode; - + private volatile int hashCode; + public Operation() { super(); } @@ -86,97 +88,96 @@ public Operation() { * @param aType */ public Operation(String aCode, String aDescription, OperationType aType, Integer major) { + this(aCode, aDescription, aType, major, OperationTarget.OPD_ADMISSION); + } + + public Operation(String aCode, String aDescription, OperationType aType, Integer major, OperationTarget opeFor) { super(); this.code = aCode; this.description = aDescription; this.type = aType; this.major = major; + this.opeFor = opeFor; } - - public String getCode() { - return this.code; - } - public void setCode(String aCode) { - this.code = aCode; - } - public void setOpeFor(OperationTarget opeFor) { - this.opeFor = opeFor; - } - public OperationTarget getOpeFor() { - return this.opeFor; - } - - - public String getDescription() { - return this.description; - } - - public void setDescription(String aDescription) { - this.description = aDescription; - } - - public void setMajor(Integer major) { - this.major = major; + + public String getCode() { + return this.code; + } + public void setCode(String aCode) { + this.code = aCode; + } + public OperationTarget getOpeFor() { + return this.opeFor; + } + public void setOpeFor(OperationTarget opeFor) { + this.opeFor = opeFor; + } + public String getDescription() { + return this.description; + } + + public void setDescription(String aDescription) { + this.description = aDescription; } - public Integer getMajor() { return major; } - + public void setMajor(Integer major) { + this.major = major; + } public Integer getLock() { - return this.lock; - } - - public void setLock(Integer aLock) { - this.lock = aLock; - } - - public OperationType getType() { - return this.type; - } - - public void setType(OperationType aType) { - this.type = aType; - } - - @Override - public boolean equals(Object anObject) { - if (this == anObject) { + return this.lock; + } + + public void setLock(Integer aLock) { + this.lock = aLock; + } + + public OperationType getType() { + return this.type; + } + + public void setType(OperationType aType) { + this.type = aType; + } + + @Override + public boolean equals(Object anObject) { + if (this == anObject) { return true; } - - if (!(anObject instanceof Operation)) { + + if (!(anObject instanceof Operation operation)) { return false; } - - Operation operation = (Operation)anObject; + return (this.getCode().equals(operation.getCode()) && - this.getDescription().equalsIgnoreCase(operation.getDescription()) && - this.getType().equals(operation.getType()) && - this.getOpeFor().equals(operation.getOpeFor()) && - this.getMajor().equals(operation.getMajor())); - } - - @Override + this.getDescription().equalsIgnoreCase(operation.getDescription()) && + this.getType().equals(operation.getType()) && + this.getOpeFor().equals(operation.getOpeFor()) && + this.getMajor().equals(operation.getMajor())); + } + + @Override public int hashCode() { - if (this.hashCode == 0) { - final int m = 23; - int c = 133; - - c = m * c + ((code == null) ? 0 : code.hashCode()); - c = m * c + ((description == null) ? 0 : description.hashCode()); - c = m * c + ((type == null) ? 0 : type.hashCode()); - c = m * c + ((opeFor == null) ? 0 : opeFor.hashCode()); - c = m * c + ((major == null) ? 0 : major); - c = m * c + ((lock == null) ? 0 : lock); - - this.hashCode = c; - } - return this.hashCode; - } - - @Override - public String toString() { - return this.description; - } + if (this.hashCode == 0) { + final int m = 23; + int c = 133; + + c = m * c + ((code == null) ? 0 : code.hashCode()); + c = m * c + ((description == null) ? 0 : description.hashCode()); + c = m * c + ((type == null) ? 0 : type.hashCode()); + c = m * c + ((opeFor == null) ? 0 : opeFor.hashCode()); + c = m * c + ((major == null) ? 0 : major); + c = m * c + ((lock == null) ? 0 : lock); + + this.hashCode = c; + } + return this.hashCode; + } + + @Override + public String toString() { + return this.description; + } } diff --git a/src/main/java/org/isf/operation/service/OperationIoOperationRepository.java b/src/main/java/org/isf/operation/service/OperationIoOperationRepository.java index 48371ecc6..b29463fed 100644 --- a/src/main/java/org/isf/operation/service/OperationIoOperationRepository.java +++ b/src/main/java/org/isf/operation/service/OperationIoOperationRepository.java @@ -32,7 +32,7 @@ public interface OperationIoOperationRepository extends JpaRepository { - @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OPE_FOR LIKE 1 OR OPE_FOR='OPD' OR OPE_FOR='ADMISSION' ORDER BY OPE_DESC", nativeQuery = true) + @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OPE_FOR='OPD_ADMISSION' OR OPE_FOR='OPD' OR OPE_FOR='ADMISSION' ORDER BY OPE_DESC", nativeQuery = true) List findByOrderByDescriptionAsc(); List findAllByDescriptionContainsOrderByDescriptionDesc(String description); @@ -49,7 +49,7 @@ public interface OperationIoOperationRepository extends JpaRepository findAllByType_DescriptionContainsOrderByDescriptionAsc(@Param("desc") String typeDescription); - + @Query(value = "SELECT * FROM OH_OPERATION ORDER BY OPE_DESC", nativeQuery = true) Page findAllPageable(Pageable pageable); From 9228b9f9aedb2b3d07adcd36f909722256556fd2 Mon Sep 17 00:00:00 2001 From: SteveGT96 Date: Fri, 4 Oct 2024 08:53:55 +0100 Subject: [PATCH 05/11] update: Update opeFor column definition --- src/main/java/org/isf/operation/model/Operation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/isf/operation/model/Operation.java b/src/main/java/org/isf/operation/model/Operation.java index 83cfa0aa5..94be6fe4c 100644 --- a/src/main/java/org/isf/operation/model/Operation.java +++ b/src/main/java/org/isf/operation/model/Operation.java @@ -67,7 +67,7 @@ public class Operation extends Auditable { @Column(name = "OPE_STAT") private Integer major; - @Column(name = "OPE_FOR", columnDefinition = "VARCHAR(20)") + @Column(name = "OPE_FOR", columnDefinition = "ENUM('OPD', 'ADMISSION', 'OPD_ADMISSION')") @Enumerated(EnumType.STRING) private OperationTarget opeFor; From fcef0d2709d325438d842126cc6ffe0917f4b8e8 Mon Sep 17 00:00:00 2001 From: SteveGT96 Date: Fri, 4 Oct 2024 09:43:22 +0100 Subject: [PATCH 06/11] update: Update opeFor field and fix operation tests --- ...perations_table_change_ope_for_to_enum.sql | 8 ++-- .../converters/OperationTargetConverter.java | 41 +++++++++++++++++++ .../org/isf/operation/model/Operation.java | 10 ++--- .../OperationIoOperationRepository.java | 8 ++-- src/test/java/org/isf/operation/Tests.java | 3 -- 5 files changed, 54 insertions(+), 16 deletions(-) create mode 100644 src/main/java/org/isf/operation/converters/OperationTargetConverter.java diff --git a/sql/step_a110_update_operations_table_change_ope_for_to_enum.sql b/sql/step_a110_update_operations_table_change_ope_for_to_enum.sql index afb24f916..84398f3a5 100644 --- a/sql/step_a110_update_operations_table_change_ope_for_to_enum.sql +++ b/sql/step_a110_update_operations_table_change_ope_for_to_enum.sql @@ -1,11 +1,11 @@ ALTER TABLE OH_OPERATION MODIFY COLUMN OPE_FOR VARCHAR(20); UPDATE OH_OPERATION - SET OPE_FOR='OPD_ADMISSION' WHERE OPE_FOR='1'; + SET OPE_FOR='opd_admission' WHERE OPE_FOR='1'; UPDATE OH_OPERATION - SET OPE_FOR='ADMISSION' WHERE OPE_FOR='2'; + SET OPE_FOR='admission' WHERE OPE_FOR='2'; UPDATE OH_OPERATION - SET OPE_FOR='OPD' WHERE OPE_FOR='3'; + SET OPE_FOR='opd' WHERE OPE_FOR='3'; ALTER TABLE OH_OPERATION - MODIFY COLUMN OPE_FOR ENUM('OPD', 'ADMISSION', 'OPD_ADMISSION') DEFAULT 'OPD_ADMISSION'; \ No newline at end of file + MODIFY COLUMN OPE_FOR ENUM('opd', 'admission', 'opd_admission') DEFAULT 'opd_admission'; \ No newline at end of file diff --git a/src/main/java/org/isf/operation/converters/OperationTargetConverter.java b/src/main/java/org/isf/operation/converters/OperationTargetConverter.java new file mode 100644 index 000000000..749597734 --- /dev/null +++ b/src/main/java/org/isf/operation/converters/OperationTargetConverter.java @@ -0,0 +1,41 @@ +/* + * Open Hospital (www.open-hospital.org) + * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) + * + * Open Hospital is a free and open source software for healthcare data management. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * https://www.gnu.org/licenses/gpl-3.0-standalone.html + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.isf.operation.converters; + +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; + +import org.isf.operation.enums.OperationTarget; + +@Converter +public class OperationTargetConverter implements AttributeConverter { + + @Override + public String convertToDatabaseColumn(OperationTarget opFor) { + return opFor == null ? null : opFor.toString().toLowerCase(); + } + + @Override + public OperationTarget convertToEntityAttribute(String dbData) { + return dbData == null ? null : OperationTarget.valueOf(dbData.toUpperCase()); + } +} diff --git a/src/main/java/org/isf/operation/model/Operation.java b/src/main/java/org/isf/operation/model/Operation.java index 94be6fe4c..d178259be 100644 --- a/src/main/java/org/isf/operation/model/Operation.java +++ b/src/main/java/org/isf/operation/model/Operation.java @@ -23,10 +23,9 @@ import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; +import jakarta.persistence.Convert; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; -import jakarta.persistence.EnumType; -import jakarta.persistence.Enumerated; import jakarta.persistence.Id; import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToOne; @@ -35,6 +34,7 @@ import jakarta.persistence.Version; import jakarta.validation.constraints.NotNull; +import org.isf.operation.converters.OperationTargetConverter; import org.isf.operation.enums.OperationTarget; import org.isf.opetype.model.OperationType; import org.isf.utils.db.Auditable; @@ -67,8 +67,8 @@ public class Operation extends Auditable { @Column(name = "OPE_STAT") private Integer major; - @Column(name = "OPE_FOR", columnDefinition = "ENUM('OPD', 'ADMISSION', 'OPD_ADMISSION')") - @Enumerated(EnumType.STRING) + @Convert(converter = OperationTargetConverter.class) + @Column(name = "OPE_FOR", columnDefinition = "ENUM('opd', 'admission', 'opd_admission')") private OperationTarget opeFor; @Version @@ -154,7 +154,7 @@ public boolean equals(Object anObject) { return (this.getCode().equals(operation.getCode()) && this.getDescription().equalsIgnoreCase(operation.getDescription()) && this.getType().equals(operation.getType()) && - this.getOpeFor().equals(operation.getOpeFor()) && + this.getOpeFor() == operation.getOpeFor() && this.getMajor().equals(operation.getMajor())); } diff --git a/src/main/java/org/isf/operation/service/OperationIoOperationRepository.java b/src/main/java/org/isf/operation/service/OperationIoOperationRepository.java index b29463fed..13c0d94d7 100644 --- a/src/main/java/org/isf/operation/service/OperationIoOperationRepository.java +++ b/src/main/java/org/isf/operation/service/OperationIoOperationRepository.java @@ -32,7 +32,7 @@ public interface OperationIoOperationRepository extends JpaRepository { - @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OPE_FOR='OPD_ADMISSION' OR OPE_FOR='OPD' OR OPE_FOR='ADMISSION' ORDER BY OPE_DESC", nativeQuery = true) + @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OPE_FOR='opd_admission' OR OPE_FOR='opd' OR OPE_FOR='admission' ORDER BY OPE_DESC", nativeQuery = true) List findByOrderByDescriptionAsc(); List findAllByDescriptionContainsOrderByDescriptionDesc(String description); @@ -41,13 +41,13 @@ public interface OperationIoOperationRepository extends JpaRepository findAllWithoutDescriptionOpd(); - @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OPE_FOR='OPD_ADMISSION' OR OPE_FOR='ADMISSION' ORDER BY OPE_DESC", nativeQuery = true) + @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OPE_FOR='opd_admission' OR OPE_FOR='admission' ORDER BY OPE_DESC", nativeQuery = true) List findAllWithoutDescriptionAdm(); - @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OCL_DESC LIKE :desc AND (OPE_FOR='OPD_ADMISSION' OR OPE_FOR='ADMISSION' OR OPE_FOR='OPD') ORDER BY OPE_DESC", nativeQuery = true) + @Query(value = "SELECT * FROM OH_OPERATION JOIN OH_OPERATIONTYPE ON OPE_OCL_ID_A = OCL_ID_A WHERE OCL_DESC LIKE :desc AND (OPE_FOR='opd_admission' OR OPE_FOR='admission' OR OPE_FOR='opd') ORDER BY OPE_DESC", nativeQuery = true) List findAllByType_DescriptionContainsOrderByDescriptionAsc(@Param("desc") String typeDescription); @Query(value = "SELECT * FROM OH_OPERATION ORDER BY OPE_DESC", nativeQuery = true) diff --git a/src/test/java/org/isf/operation/Tests.java b/src/test/java/org/isf/operation/Tests.java index 3e3de4812..d7d65412f 100644 --- a/src/test/java/org/isf/operation/Tests.java +++ b/src/test/java/org/isf/operation/Tests.java @@ -971,9 +971,6 @@ void testOperationGettersSetters() throws Exception { operation.setLock(-1); assertThat(operation.getLock()).isEqualTo(-1); - - operation.setOpeFor(OperationTarget.ADMISSION); - assertThat(operation.getOpeFor()).isEqualTo(OperationTarget.ADMISSION); } @Test From ce5657c9a6aede2ce3e091ab0a4c8e9d8e9d0cd3 Mon Sep 17 00:00:00 2001 From: SteveGT96 Date: Fri, 4 Oct 2024 09:47:24 +0100 Subject: [PATCH 07/11] update: Update demo data --- sql/load_demo_data.sql | 102 ++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/sql/load_demo_data.sql b/sql/load_demo_data.sql index ae8f075fa..69658e4ad 100644 --- a/sql/load_demo_data.sql +++ b/sql/load_demo_data.sql @@ -3545,57 +3545,57 @@ UNLOCK TABLES; LOCK TABLES `oh_operation` WRITE; /*!40000 ALTER TABLE `oh_operation` DISABLE KEYS */; -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('1','OB','Caesarian section',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('10','OB','Septic abortion',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('11','OB','Dilatation and curettage',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('12','OB','Repair of vesico-vaginal fistula (vvf)',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('13','GY','Acute abdomen',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('14','GY','Ectopic pregnancy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('15','GY','Peritonitis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('16','GY','Pelvic abscess',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('17','GY','Uterine fibroids',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('18','GY','Ovarian tumours',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('19','GY','Uterine prolapse',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('2','OB','emergency',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('20','GY','Cystorele',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('21','MG','circumcision',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('22','MG','phimosis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('23','MG','paraphimosis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('24','MG','dorsal slit-paraphimosis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('25','MG','uretheral stricture-bougienage',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('26','MG','Hydroceletomy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('27','MG','Testicular tumours',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('28','MG','Prostatectomy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('29','MG','Prostate biopsy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('3','OB','elective',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('30','MG','Bladder biopsy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('31','AG','Hernia (inguinal & femoral)',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('32','AG','Strangulated',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('33','AG','Non strangulated',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('34','AG','Epigastrical Hernia',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('37','AG','Intestinal obstruction',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('38','AG','Mechanical',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('39','AG','Volvulus',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('4','OB','Hysterectomy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('40','AG','Laparatomy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('41','AG','Penetrating abdominal injuries',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('42','AG','Peritonitis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('43','AG','Appendicitis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('44','AG','Cholecystitis',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('45','AG','Abdominal Tumours',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('46','OR','Reduction of fractures',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('47','OR','Upper limb',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('48','OR','Lower limb',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('49','OR','Osteomyelitis - sequestrectomy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('5','OB','Ruptured uterus',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('50','OS','Incission & drainage',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('51','OS','Debridement',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('52','OS','Mise -a- plat',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('53','OS','Surgical toilet & suture',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('6','OB','Injured uterus',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('7','OB','Hysterectomy',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('8','OB','Evacuations',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); -INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('9','OB','Incomplete abortion',1,'OPD_ADMISSION',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('1','OB','Caesarian section',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('10','OB','Septic abortion',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('11','OB','Dilatation and curettage',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('12','OB','Repair of vesico-vaginal fistula (vvf)',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('13','GY','Acute abdomen',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('14','GY','Ectopic pregnancy',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('15','GY','Peritonitis',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('16','GY','Pelvic abscess',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('17','GY','Uterine fibroids',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('18','GY','Ovarian tumours',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('19','GY','Uterine prolapse',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('2','OB','emergency',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('20','GY','Cystorele',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('21','MG','circumcision',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('22','MG','phimosis',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('23','MG','paraphimosis',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('24','MG','dorsal slit-paraphimosis',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('25','MG','uretheral stricture-bougienage',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('26','MG','Hydroceletomy',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('27','MG','Testicular tumours',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('28','MG','Prostatectomy',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('29','MG','Prostate biopsy',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('3','OB','elective',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('30','MG','Bladder biopsy',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('31','AG','Hernia (inguinal & femoral)',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('32','AG','Strangulated',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('33','AG','Non strangulated',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('34','AG','Epigastrical Hernia',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('37','AG','Intestinal obstruction',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('38','AG','Mechanical',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('39','AG','Volvulus',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('4','OB','Hysterectomy',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('40','AG','Laparatomy',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('41','AG','Penetrating abdominal injuries',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('42','AG','Peritonitis',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('43','AG','Appendicitis',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('44','AG','Cholecystitis',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('45','AG','Abdominal Tumours',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('46','OR','Reduction of fractures',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('47','OR','Upper limb',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('48','OR','Lower limb',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('49','OR','Osteomyelitis - sequestrectomy',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('5','OB','Ruptured uterus',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('50','OS','Incission & drainage',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('51','OS','Debridement',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('52','OS','Mise -a- plat',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('53','OS','Surgical toilet & suture',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('6','OB','Injured uterus',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('7','OB','Hysterectomy',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('8','OB','Evacuations',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); +INSERT INTO `oh_operation` (`OPE_ID_A`, `OPE_OCL_ID_A`, `OPE_DESC`, `OPE_STAT`, `OPE_FOR`, `OPE_LOCK`, `OPE_CREATED_BY`, `OPE_CREATED_DATE`, `OPE_LAST_MODIFIED_BY`, `OPE_LAST_MODIFIED_DATE`, `OPE_ACTIVE`) VALUES ('9','OB','Incomplete abortion',1,'opd_admission',0,NULL,NULL,NULL,NULL,1); /*!40000 ALTER TABLE `oh_operation` ENABLE KEYS */; UNLOCK TABLES; From 1283b4a607a8f680fbffa079fcc669d8b957a590 Mon Sep 17 00:00:00 2001 From: SteveGT96 Date: Fri, 4 Oct 2024 10:49:46 +0100 Subject: [PATCH 08/11] update: Update operation target enum --- .../converters/OperationTargetConverter.java | 41 ------------------- .../isf/operation/enums/OperationTarget.java | 2 +- .../org/isf/operation/model/Operation.java | 5 +-- src/test/java/org/isf/operation/Tests.java | 29 +++++++------ 4 files changed, 18 insertions(+), 59 deletions(-) delete mode 100644 src/main/java/org/isf/operation/converters/OperationTargetConverter.java diff --git a/src/main/java/org/isf/operation/converters/OperationTargetConverter.java b/src/main/java/org/isf/operation/converters/OperationTargetConverter.java deleted file mode 100644 index 749597734..000000000 --- a/src/main/java/org/isf/operation/converters/OperationTargetConverter.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Open Hospital (www.open-hospital.org) - * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) - * - * Open Hospital is a free and open source software for healthcare data management. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * https://www.gnu.org/licenses/gpl-3.0-standalone.html - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.isf.operation.converters; - -import jakarta.persistence.AttributeConverter; -import jakarta.persistence.Converter; - -import org.isf.operation.enums.OperationTarget; - -@Converter -public class OperationTargetConverter implements AttributeConverter { - - @Override - public String convertToDatabaseColumn(OperationTarget opFor) { - return opFor == null ? null : opFor.toString().toLowerCase(); - } - - @Override - public OperationTarget convertToEntityAttribute(String dbData) { - return dbData == null ? null : OperationTarget.valueOf(dbData.toUpperCase()); - } -} diff --git a/src/main/java/org/isf/operation/enums/OperationTarget.java b/src/main/java/org/isf/operation/enums/OperationTarget.java index 67bc5a4cc..b0378c654 100644 --- a/src/main/java/org/isf/operation/enums/OperationTarget.java +++ b/src/main/java/org/isf/operation/enums/OperationTarget.java @@ -22,5 +22,5 @@ package org.isf.operation.enums; public enum OperationTarget { - OPD, ADMISSION, OPD_ADMISSION; + opd, admission, opd_admission; } diff --git a/src/main/java/org/isf/operation/model/Operation.java b/src/main/java/org/isf/operation/model/Operation.java index d178259be..6d7408865 100644 --- a/src/main/java/org/isf/operation/model/Operation.java +++ b/src/main/java/org/isf/operation/model/Operation.java @@ -23,7 +23,6 @@ import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; -import jakarta.persistence.Convert; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; import jakarta.persistence.Id; @@ -34,7 +33,6 @@ import jakarta.persistence.Version; import jakarta.validation.constraints.NotNull; -import org.isf.operation.converters.OperationTargetConverter; import org.isf.operation.enums.OperationTarget; import org.isf.opetype.model.OperationType; import org.isf.utils.db.Auditable; @@ -67,7 +65,6 @@ public class Operation extends Auditable { @Column(name = "OPE_STAT") private Integer major; - @Convert(converter = OperationTargetConverter.class) @Column(name = "OPE_FOR", columnDefinition = "ENUM('opd', 'admission', 'opd_admission')") private OperationTarget opeFor; @@ -88,7 +85,7 @@ public Operation() { * @param aType */ public Operation(String aCode, String aDescription, OperationType aType, Integer major) { - this(aCode, aDescription, aType, major, OperationTarget.OPD_ADMISSION); + this(aCode, aDescription, aType, major, OperationTarget.opd_admission); } public Operation(String aCode, String aDescription, OperationType aType, Integer major, OperationTarget opeFor) { diff --git a/src/test/java/org/isf/operation/Tests.java b/src/test/java/org/isf/operation/Tests.java index d7d65412f..951f28a9b 100644 --- a/src/test/java/org/isf/operation/Tests.java +++ b/src/test/java/org/isf/operation/Tests.java @@ -224,7 +224,7 @@ void testIoGetOperationByTypeDescriptionNull() throws Exception { void testIoGetOperationOpdOpdAdmission() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor(OperationTarget.OPD_ADMISSION); + operation.setOpeFor(OperationTarget.opd_admission); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationIoOperations.getOperationOpd()).isNotEmpty(); @@ -234,7 +234,7 @@ void testIoGetOperationOpdOpdAdmission() throws Exception { void testIoGetOperationOpdOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor(OperationTarget.OPD); + operation.setOpeFor(OperationTarget.opd); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationIoOperations.getOperationOpd()).isNotEmpty(); @@ -244,7 +244,7 @@ void testIoGetOperationOpdOpd() throws Exception { void testIoGetOperationOpdNotOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor(OperationTarget.ADMISSION); + operation.setOpeFor(OperationTarget.admission); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationIoOperations.getOperationOpd()).isEmpty(); @@ -254,7 +254,7 @@ void testIoGetOperationOpdNotOpd() throws Exception { void testIoGetOperationAdmOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor(OperationTarget.OPD_ADMISSION); + operation.setOpeFor(OperationTarget.opd_admission); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationIoOperations.getOperationAdm()).isNotEmpty(); @@ -264,7 +264,7 @@ void testIoGetOperationAdmOpd() throws Exception { void testIoGetOperationAdmAdmission() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor(OperationTarget.ADMISSION); + operation.setOpeFor(OperationTarget.admission); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationIoOperations.getOperationAdm()).isNotEmpty(); @@ -274,7 +274,7 @@ void testIoGetOperationAdmAdmission() throws Exception { void testIoGetOperationAdmNotOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor(OperationTarget.OPD); + operation.setOpeFor(OperationTarget.opd); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationIoOperations.getOperationAdm()).isEmpty(); @@ -370,7 +370,7 @@ void testGetOperationPageable() throws Exception { void testMgrGetOperationOpdOpdAdmission() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor(OperationTarget.OPD_ADMISSION); + operation.setOpeFor(OperationTarget.opd_admission); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationBrowserManager.getOperationOpd()).isNotEmpty(); @@ -380,7 +380,7 @@ void testMgrGetOperationOpdOpdAdmission() throws Exception { void testMgrGetOperationOpdOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor(OperationTarget.OPD); + operation.setOpeFor(OperationTarget.opd); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationBrowserManager.getOperationOpd()).isNotEmpty(); @@ -390,7 +390,7 @@ void testMgrGetOperationOpdOpd() throws Exception { void testMgrGetOperationOpdNotOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor(OperationTarget.ADMISSION); + operation.setOpeFor(OperationTarget.admission); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationBrowserManager.getOperationOpd()).isEmpty(); @@ -400,7 +400,7 @@ void testMgrGetOperationOpdNotOpd() throws Exception { void testMgrGetOperationAdmOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor(OperationTarget.OPD_ADMISSION); + operation.setOpeFor(OperationTarget.opd_admission); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationBrowserManager.getOperationAdm()).isNotEmpty(); @@ -410,7 +410,7 @@ void testMgrGetOperationAdmOpd() throws Exception { void testMgrGetOperationAdmAdmission() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor(OperationTarget.ADMISSION); + operation.setOpeFor(OperationTarget.admission); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationBrowserManager.getOperationAdm()).isNotEmpty(); @@ -420,7 +420,7 @@ void testMgrGetOperationAdmAdmission() throws Exception { void testMgrGetOperationAdmNotOpd() throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, false); - operation.setOpeFor(OperationTarget.OPD); + operation.setOpeFor(OperationTarget.opd); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); assertThat(operationBrowserManager.getOperationAdm()).isEmpty(); @@ -971,6 +971,9 @@ void testOperationGettersSetters() throws Exception { operation.setLock(-1); assertThat(operation.getLock()).isEqualTo(-1); + + operation.setOpeFor(OperationTarget.admission); + assertThat(operation.getOpeFor()).isEqualTo(OperationTarget.admission); } @Test @@ -1106,7 +1109,7 @@ void testOperationRowToString() throws Exception { private String setupTestOperation(boolean usingSet) throws Exception { OperationType operationType = testOperationType.setup(false); Operation operation = testOperation.setup(operationType, usingSet); - operation.setOpeFor(OperationTarget.OPD_ADMISSION); + operation.setOpeFor(OperationTarget.opd_admission); operationTypeIoOperationRepository.saveAndFlush(operationType); operationIoOperationRepository.saveAndFlush(operation); return operation.getCode(); From 14f186dee67dce5500404172d683abd50ec61f04 Mon Sep 17 00:00:00 2001 From: SteveGT96 Date: Fri, 4 Oct 2024 10:57:30 +0100 Subject: [PATCH 09/11] fix: Update opeFor field metadata --- src/main/java/org/isf/operation/model/Operation.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/isf/operation/model/Operation.java b/src/main/java/org/isf/operation/model/Operation.java index 6d7408865..104c93223 100644 --- a/src/main/java/org/isf/operation/model/Operation.java +++ b/src/main/java/org/isf/operation/model/Operation.java @@ -25,6 +25,8 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; import jakarta.persistence.Id; import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToOne; @@ -65,6 +67,7 @@ public class Operation extends Auditable { @Column(name = "OPE_STAT") private Integer major; + @Enumerated(EnumType.STRING) @Column(name = "OPE_FOR", columnDefinition = "ENUM('opd', 'admission', 'opd_admission')") private OperationTarget opeFor; From fc10c961959cee836f28e753d1a3d1d273fbf8f4 Mon Sep 17 00:00:00 2001 From: SteveGT96 Date: Fri, 4 Oct 2024 11:49:40 +0100 Subject: [PATCH 10/11] chore: Change enumeration order --- ...step_a110_update_operations_table_change_ope_for_to_enum.sql | 2 +- src/main/java/org/isf/operation/enums/OperationTarget.java | 2 +- src/main/java/org/isf/operation/model/Operation.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/step_a110_update_operations_table_change_ope_for_to_enum.sql b/sql/step_a110_update_operations_table_change_ope_for_to_enum.sql index 84398f3a5..d98271184 100644 --- a/sql/step_a110_update_operations_table_change_ope_for_to_enum.sql +++ b/sql/step_a110_update_operations_table_change_ope_for_to_enum.sql @@ -8,4 +8,4 @@ UPDATE OH_OPERATION SET OPE_FOR='opd' WHERE OPE_FOR='3'; ALTER TABLE OH_OPERATION - MODIFY COLUMN OPE_FOR ENUM('opd', 'admission', 'opd_admission') DEFAULT 'opd_admission'; \ No newline at end of file + MODIFY COLUMN OPE_FOR ENUM('opd_admission', 'admission', 'opd') DEFAULT 'opd_admission'; \ No newline at end of file diff --git a/src/main/java/org/isf/operation/enums/OperationTarget.java b/src/main/java/org/isf/operation/enums/OperationTarget.java index b0378c654..20f7b389d 100644 --- a/src/main/java/org/isf/operation/enums/OperationTarget.java +++ b/src/main/java/org/isf/operation/enums/OperationTarget.java @@ -22,5 +22,5 @@ package org.isf.operation.enums; public enum OperationTarget { - opd, admission, opd_admission; + opd_admission, admission, opd; } diff --git a/src/main/java/org/isf/operation/model/Operation.java b/src/main/java/org/isf/operation/model/Operation.java index 104c93223..315d1b4e1 100644 --- a/src/main/java/org/isf/operation/model/Operation.java +++ b/src/main/java/org/isf/operation/model/Operation.java @@ -68,7 +68,7 @@ public class Operation extends Auditable { private Integer major; @Enumerated(EnumType.STRING) - @Column(name = "OPE_FOR", columnDefinition = "ENUM('opd', 'admission', 'opd_admission')") + @Column(name = "OPE_FOR", columnDefinition = "ENUM('opd_admission', 'admission', 'opd')") private OperationTarget opeFor; @Version From d5f3ffbaf653f8ed10e845001b74bafae5e1a72f Mon Sep 17 00:00:00 2001 From: SteveGT96 Date: Fri, 4 Oct 2024 14:31:12 +0100 Subject: [PATCH 11/11] fix: Remove duplicate column definition --- src/main/java/org/isf/operation/model/Operation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/isf/operation/model/Operation.java b/src/main/java/org/isf/operation/model/Operation.java index 315d1b4e1..82ca62b05 100644 --- a/src/main/java/org/isf/operation/model/Operation.java +++ b/src/main/java/org/isf/operation/model/Operation.java @@ -67,8 +67,8 @@ public class Operation extends Auditable { @Column(name = "OPE_STAT") private Integer major; + @Column(name = "OPE_FOR") @Enumerated(EnumType.STRING) - @Column(name = "OPE_FOR", columnDefinition = "ENUM('opd_admission', 'admission', 'opd')") private OperationTarget opeFor; @Version