private SurgicalAuditOperationDetailVo populateDataFromScreen(SurgicalAuditOperationDetailVo surgicalAuditOpDetail) { if (surgicalAuditOpDetail == null) return null; SurgicalAuditRecoveryVo surgAuditRecovery = populateDataFromRecoveryTab(surgicalAuditOpDetail.getRecovery()); surgicalAuditOpDetail.setRecovery(surgAuditRecovery); // The current status will be modified only when saving for the first time on a tab. // The records will be added to history also only when saving for the first time if (surgAuditRecovery!=null && surgAuditRecovery.getID_SurgicalAuditRecovery()==null && surgicalAuditOpDetail.getCurrentStatus() != null && !SurgicalAuditOperationDetailStatus.CANCELLED_OPERATIONS.equals(surgicalAuditOpDetail.getCurrentStatus().getOperationStatus()) && (SurgicalAuditOperationDetailStatus.LEFT_HOLDING_BAY.equals(surgicalAuditOpDetail.getCurrentStatus().getOperationStatus()) || SurgicalAuditOperationDetailStatus.ENTERED_OPERATING_THEATRE.equals(surgicalAuditOpDetail.getCurrentStatus().getOperationStatus()) || SurgicalAuditOperationDetailStatus.LEFT_OPERATING_THEATRE.equals(surgicalAuditOpDetail.getCurrentStatus().getOperationStatus()))) { MemberOfStaffLiteVo statusAuthoringUser = null; Object mos = domain.getMosUser(); if (mos instanceof MemberOfStaffLiteVo) statusAuthoringUser = (MemberOfStaffLiteVo) mos; SurgicalAuditOperationDetailStatusVo tempCurrentStatus = populateStatus(ims.clinical.vo.lookups.SurgicalAuditOperationDetailStatus.HAND_OVER_FROM_RECOVERY_NURSE, new DateTime(), statusAuthoringUser); surgicalAuditOpDetail.setCurrentStatus(tempCurrentStatus); SurgicalAuditOperationDetailStatusVoCollection tempStatusHistory = surgicalAuditOpDetail.getStatusHistory(); tempStatusHistory.add(populateStatus(ims.clinical.vo.lookups.SurgicalAuditOperationDetailStatus.PATIENT_ARRIVED_IN_RECOVERY, new DateTime(), statusAuthoringUser)); tempStatusHistory.add(populateStatus(ims.clinical.vo.lookups.SurgicalAuditOperationDetailStatus.TIME_WARD_OR_UNIT_NOTIFIED, new DateTime(), statusAuthoringUser)); tempStatusHistory.add(populateStatus(ims.clinical.vo.lookups.SurgicalAuditOperationDetailStatus.PATIENT_LEFT_RECOVERY, new DateTime(), statusAuthoringUser)); tempStatusHistory.add(tempCurrentStatus); surgicalAuditOpDetail.setStatusHistory(tempStatusHistory); } return surgicalAuditOpDetail; }