When we try to save patients to a temporary list we receive the following error:
ERROR: [2020-10-16T12:02:20,025] edu.umich.med.emerse.rest.AllPatientSearchController.log()83 StatementCallback; SQL [insert into patient_list_entry (id, patient_id, patient_list_id, marked) select entry_seq_id, patient.id,16059, 0 from pt_list_import imp inner join patient on imp.mrn=patient.external_id where imp.existing_flag='N' ]; ORA-00001: unique constraint (EMERSE.PK26) violated
; nested exception is java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (EMERSE.PK26) violated
I tried emptying all the patient_list_* and pt_list_* tables. After that, the first save works but then subsequent ones fail with the above error.
Here’s what I did to empty the lists:
TRUNCATE TABLE PT_LIST_IMPORT
TRUNCATE TABLE PATIENT_LIST_SNAPSHOT
TRUNCATE TABLE PATIENT_LIST_LAST_USED
TRUNCATE TABLE PATIENT_LIST_HISTORY
TRUNCATE TABLE PATIENT_LIST_ENTRY_COMMENT
DELETE FROM PATIENT_LIST_ENTRY
COMMIT
UPDATE LOGIN_ACCOUNT SET CURRENT_PT_LIST_ID=NULL
COMMIT
DELETE FROM PATIENT_LIST
COMMIT
It also works the first time after restarting tomcat, then fails after that. Any Ideas?