public Boolean isStaleSurgicalAuditRecovery(SurgicalAuditRecoveryVo surgAuditRecoveryToSave) { if (surgAuditRecoveryToSave == null || surgAuditRecoveryToSave.getID_SurgicalAuditRecovery() == null) { throw new CodingRuntimeException("Cannot get SurgicalAuditRecoveryVo on null Id "); } DomainFactory factory = getDomainFactory(); SurgicalAuditRecovery domainSurgAuditRecovery = (SurgicalAuditRecovery) factory.getDomainObject(SurgicalAuditOperationDetail.class, surgAuditRecoveryToSave.getID_SurgicalAuditRecovery()); if(domainSurgAuditRecovery==null) { return true; } if (domainSurgAuditRecovery.getVersion() > surgAuditRecoveryToSave.getVersion_SurgicalAuditRecovery()) { return true; } return false; }
private void populateScreenFromData(SurgicalAuditRecoveryVo recovery) { clearInstanceControls(); if (recovery == null) return; // Recovery Room Nurse form.chkRecoveryLocum().setValue(recovery.getRecoveryLocumBool()); form.txtRecoveryLocumNurse().setValue(recovery.getRecoveryLocumNurse()); form.ccRecoveryRoomNurse().setValue(recovery.getRecoveryRoomNurse()); form.grpConfirmPatientArrival().setValue(recovery.getConfirmPatientArrival().equals(YesNo.YES) ? grpConfirmPatientArrivalEnumeration.rdoConfirmYes : grpConfirmPatientArrivalEnumeration.rdoConfirmNo); form.dtimArivesInRecovery().setValue(recovery.getTimeArrivesInRecovery()); form.dtimWardNotified().setValue(recovery.getTimeWardNotified()); form.dtimLeavesRecovery().setValue(recovery.getTimeLeavesRecovery()); ArrayList<?> sentTo = form.cmbSentTo().getValues(); if (sentTo != null && recovery.getSentToIsNotNull() && !sentTo.contains(recovery.getSentTo())) form.cmbSentTo().newRow(recovery.getSentTo(), recovery.getSentTo().getName()); form.cmbSentTo().setValue(recovery.getSentTo()); // Hand Over From Recovery Nurse form.chkRecoveryHandoverLocum().setValue(recovery.getRecoveryHandoverLocumBool()); form.txtRecoveryHandoverLocumNurse().setValue(recovery.getRecoveryHandoverLocumNurse()); form.ccHandOverFromRecoveryNurse().setValue(recovery.getHandoverfromRecoveryNurse()); // Ward Unit Nurse receiving Handover: form.chkWardLocum().setValue(recovery.getWardLocumBool()); form.txtWardLocumNurse().setValue(recovery.getWardLocumNurse()); form.ccWardUnitNurse().setValue(recovery.getWardUnitNurse()); }
public SurgicalAuditRecoveryVo saveSurgicalAuditRecovery(SurgicalAuditRecoveryVo surgicalAuditRecoveryToSave) throws StaleObjectException { if (surgicalAuditRecoveryToSave == null ) { throw new CodingRuntimeException("Cannot get SurgicalAuditRecoveryVo on null Id "); } DomainFactory factory = getDomainFactory(); SurgicalAuditRecovery domainSurgicalAuditRecovery = SurgicalAuditRecoveryVoAssembler.extractSurgicalAuditRecovery(factory, surgicalAuditRecoveryToSave); factory.save(domainSurgicalAuditRecovery); return SurgicalAuditRecoveryVoAssembler.create(domainSurgicalAuditRecovery); }
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; }