protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException { if (form.getForms().RefMan.ElectiveListAddLaterDialog.equals(formName)) { if (DialogResult.OK.equals(result)) { PatientElectiveListAddLaterVo electiveListLater = form.getGlobalContext().RefMan.getPatientElectiveListAddLaterVo(); if (electiveListLater != null) { try { domain.savePatientElectiveList(electiveListLater); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); } catch (UniqueKeyViolationException e) { // TODO Auto-generated catch block e.printStackTrace(); engine.showMessage(e.getMessage()); } open(); } } else if (DialogResult.ABORT.equals(result)) { open(); } else if (DialogResult.CANCEL.equals(result)) // WDEV-22488 { open(); } } }
protected void onBtnSaveClick() throws PresentationLogicException { GaitReEducationVo voGait = form.getLocalContext().getGaitEducation(); if (voGait == null) voGait = new GaitReEducationVo(); voGait.setAuthoringCP(form.qmbAuthoringCP().getValue()); voGait.setAuthoringDateTime(form.dtimAuthoring().getValue()); if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull()) voGait.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); voGait.setDetails(form.txtDetails().getValue()); voGait.setGaitAspect(populateDataFromGrdAspect()); String[] uiErrors = getUiErrors(); String[] message = voGait.validate(uiErrors); if (message != null) { engine.showErrors("Validation errors", message); return; } try { domain.saveGaitReEducation(voGait); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return; } catch (UniqueKeyViolationException e) { engine.showMessage("A Gait Re-Education record already exists. " + e.getMessage()); open(); return; } open(); }
private boolean save() { if (!populateDataFromScreen()) return false; MassageVo voMassage = form.getLocalContext().getCurrentMassageVo(); String[] messages = voMassage.validate(); if (messages != null) { engine.showErrors("Validation Errors for MassageVo", messages); return false; } try { form.getLocalContext().setCurrentMassageVo(domain.saveMassageVo(voMassage)); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return false; } catch (UniqueKeyViolationException e) { engine.showMessage( "A Massage record already exists for this Clinical Contact. " + e.getMessage()); open(); return false; } catch (DomainRuntimeException e) { engine.showMessage(e.getMessage()); open(); return false; } return true; }
private void saveLocation(IfLocParentVo loc) throws HL7Exception { try { String[] errors = loc.validate(); if (errors != null) { throw new HL7Exception( "Validation of Location failed. " + VoMapper.toDisplayString(errors)); } ocsIfInbound.saveLocation(loc); } catch (StaleObjectException e) { LOG.error("StaleObjectException occurred saving location - " + e.getMessage(), e); throw new HL7Exception( "Location data has been updated by another user/process - please try again", e); } catch (UniqueKeyViolationException e) { LOG.error("UniqueKeyViolationException occurred saveLocationSite " + e.getMessage(), e); throw new HL7Exception( "UniqueKeyViolationException occurred saveLocationSite " + e.getMessage(), e); } }
public boolean save() throws ims.framework.exceptions.PresentationLogicException { ManchesterTriageProtocolConfigVo TriageToSave = populateDataFromScreen(form.getLocalContext().getSelectedTriageProtocol()); String[] errors = TriageToSave.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } if (form.cmbStatus().getValue().equals(PreActiveActiveInactiveStatus.ACTIVE)) { ManchesterTriageProtocolConfigLiteVoCollection TriageProtocol = domain.checkAlreadyActive(TriageToSave); if (TriageProtocol != null && TriageProtocol.getActiveCount() != 0 && !TriageProtocol.contains(TriageToSave)) { engine.showMessage( "An active Triage Protocol already exists for the selected Problem.", "", MessageButtons.OK, MessageIcon.WARNING); return false; } } try { TriageToSave = domain.saveTriage(TriageToSave); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return false; } catch (UniqueKeyViolationException e) { engine.showMessage(e.getMessage()); return false; } form.getLocalContext().setSelectedTriageProtocol(TriageToSave); form.txtName().setValue(TriageToSave.getProtocolName()); form.qmbProblemSearch() .newRow(TriageToSave.getProblem(), TriageToSave.getProblem().getPCName()); form.qmbProblemSearch().setValue(TriageToSave.getProblem()); form.cmbStatusSearch().setValue(TriageToSave.getActiveStatus()); return true; }
private boolean removeBed(TrackingAttendanceStatusVo newStatus) { try { if (form.getLocalContext().getcurrentTrackingIsNotNull()) { form.getLocalContext().getcurrentTracking().setCurrentStatus(newStatus); PendingEmergencyAdmissionShortVo temppend = null; if (form.getLocalContext() .getcurrentTracking() .getAssociatedPendingEmergencyAdmissionIsNotNull()) { temppend = form.getLocalContext().getcurrentTracking().getAssociatedPendingEmergencyAdmission(); temppend.setAdmissionStatus(EmergencyAdmissionStatus.CANCELLED); temppend.setAllocatedWard(null); } form.getLocalContext().getcurrentTracking().setBedAvailability(null); form.getLocalContext().getcurrentTracking().getAttendance().setConclusionDateTime(null); form.getLocalContext().getcurrentTracking().getAttendance().setBedTypeRequested(null); String[] errors = form.getLocalContext().getcurrentTracking().validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } domain.save(null, form.getLocalContext().getcurrentTracking()); return true; } } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); return true; } catch (UniqueKeyViolationException e) { engine.showMessage(e.getMessage()); return false; } return false; }
protected void onBtnSaveClicked() throws ims.framework.exceptions.PresentationLogicException { NAESReferralNoteVo referralNote = populateDataFromScreen(form.getGlobalContext().Naes.getReferralNote()); String[] errors = referralNote.validate(); if (errors != null) { engine.showErrors(errors); return; } try { domain.save(referralNote); } catch (DomainInterfaceException e) { engine.showMessage(e.getMessage()); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); } catch (ForeignKeyViolationException e) { engine.showMessage(e.getMessage()); } catch (UniqueKeyViolationException e) { engine.showMessage(e.getMessage()); } engine.close(DialogResult.OK); }
private boolean saveAdmission( PatientElectiveListBedAdmissionVo patientElectiveList, PatientElectiveListBedAdmissionVoCollection differentPatientElectiveListForService) { PasEventVo voPasEvent = new PasEventVo(); if (form.qmbConsultant().getValue() != null) { MedicWithMappingsLiteVo medLite = new MedicWithMappingsLiteVo( form.qmbConsultant().getValue().getID_Hcp(), form.qmbConsultant().getValue().getVersion_Hcp()); voPasEvent.setConsultant(medLite); } voPasEvent.setEventDateTime(form.dtimAdmDateTime().getValue()); voPasEvent.setEventType(PasEventType.INPATIENT); voPasEvent.setIsVip(false); voPasEvent.setLocation(form.cmbWard().getValue()); voPasEvent.setPatient(form.getGlobalContext().Core.getPatientShort()); voPasEvent.setSpecialty(form.cmbSpecialty().getValue()); voPasEvent.setPasEventId(new DateTime().toString()); InpatientEpisodeVo voInpatientEpis = new InpatientEpisodeVo(); voInpatientEpis.setIsOnLeave(false); voInpatientEpis.setAdmissionDateTime(form.dtimAdmDateTime().getValue()); voInpatientEpis.setEstDischargeDate(form.dteEstDischDate().getValue()); voInpatientEpis.setPasEvent(voPasEvent); voInpatientEpis.setBedNo(form.txtBedNo().getValue()); voInpatientEpis.setAdmissionType(AdmissionType.DAY_CASE); String[] arrErrors = voInpatientEpis.validate(validateUILogic()); if (arrErrors != null) { engine.showErrors(arrErrors); return false; } arrErrors = form.getGlobalContext().Core.getPatientShort().validate(arrErrors); if (arrErrors != null) { engine.showErrors(arrErrors); return false; } try { // CatsReferralWizardVo voCats = // domain.getCatsReferralWizardVoForCareContext(form.getGlobalContext().Core.getCurrentCareContext()); CatsReferralWizardVo voCats = domain.getCatsReferral(form.getGlobalContext().Scheduling.getBookingAppointmentRef()); if (voCats.getRequiresDischargeRep() == null) { voCats.setRequiresDischargeRep(null); String[] errors2 = voCats.validate(); if (errors2 != null && errors2.length > 0) { engine.showErrors(errors2); return false; } } CareContextShortVo voCC = domain.admitPatient( form.getGlobalContext().Core.getPatientShort(), voInpatientEpis, form.getGlobalContext().Scheduling.getBookingAppointmentRef(), voCats, patientElectiveList, differentPatientElectiveListForService); if (voCC != null) form.getGlobalContext().Core.setCurrentCareContext(voCC); return true; } catch (DomainInterfaceException e) { engine.showMessage(e.getMessage()); return false; } catch (StaleObjectException e) { engine.showMessage(e.getMessage()); return false; } catch (ForeignKeyViolationException e) { engine.showMessage(e.getMessage()); return false; } catch (UniqueKeyViolationException e) { engine.showMessage(e.getMessage()); return false; } }