diff --git a/sql/load_demo_data.sql b/sql/load_demo_data.sql
index 364e0be04..a67476cf9 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_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;
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..d98271184
--- /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', '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
new file mode 100644
index 000000000..20f7b389d
--- /dev/null
+++ b/src/main/java/org/isf/operation/enums/OperationTarget.java
@@ -0,0 +1,26 @@
+/*
+ * 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 {
+ 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 2d12e6ca7..82ca62b05 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;
@@ -33,12 +35,13 @@
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;
@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))
@@ -48,39 +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;
-
- /*
- * //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;
-
-
+ @Column(name = "OPE_STAT")
+ private Integer major;
+
+ @Column(name = "OPE_FOR")
+ @Enumerated(EnumType.STRING)
+ 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();
}
@@ -91,95 +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(String operFor) {
- this.operFor = operFor;
- }
- public String getOpeFor() {
- return this.operFor;
- }
-
-
- 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.getMajor().equals(operation.getMajor()));
- }
-
- @Override
+ this.getDescription().equalsIgnoreCase(operation.getDescription()) &&
+ this.getType().equals(operation.getType()) &&
+ this.getOpeFor() == 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 + ((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 795e7d2e7..13c0d94d7 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='opd_admission' 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);
+
+}
diff --git a/src/test/java/org/isf/operation/Tests.java b/src/test/java/org/isf/operation/Tests.java
index 3a6eb6db4..951f28a9b 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);