@Override protected void onBtnTransferClick() throws PresentationLogicException { //wdev-16867 TrackingWithPartialAdmissionVo trackingWithDNW = domain.getTrackingWithEDPartialAdmission((TrackingVo) form.dyngrdTrack().getValue()); if( trackingWithDNW != null ) form.getGlobalContext().Emergency.setEDTransferVo(trackingWithDNW.getCurrentTransferRecord()); if( trackingWithDNW.getCurrentPartialAdmissionIsNotNull() && !AllocationStatus.CANCELLED_ADMISSION.equals(trackingWithDNW.getCurrentPartialAdmission().getAllocatedStatus())) { form.getLocalContext().setPartialAdmissionForTrackingVo(trackingWithDNW.getCurrentPartialAdmission()); form.getLocalContext().setDTAWithTransferMessageId(engine.showMessage("A decision to admit record exists for this patient. If you proceed to Transfer the patient, the record will be cancelled on the ED system and the PAS system. Are you sure you want to continue?","Confirm Transfer" ,MessageButtons.YESNO, MessageIcon.QUESTION)); } else engine.open(form.getForms().Emergency.TransferDialog); //------------ }
public TrackingWithPartialAdmissionVo getTrackingWithEDPartialAdmission(TrackingRefVo trackRef) { if(trackRef == null || trackRef.getID_Tracking() == null) throw new CodingRuntimeException("Cannot get Tracking record on null Tracking Id."); DomainFactory factory = getDomainFactory(); Tracking doTracking = (Tracking) factory.getDomainObject(Tracking.class, trackRef.getID_Tracking()); return TrackingWithPartialAdmissionVoAssembler.create(doTracking); }
@Override protected void onBtnTransferClick() throws PresentationLogicException { if(!(form.dyngrdTrack().getValue() instanceof TrackingVo)) return; //wdev-16867 TrackingWithPartialAdmissionVo trackingWithPatialAdmission = domain.getTrackingWithEDPartialAdmission((TrackingVo) form.dyngrdTrack().getValue()); if (trackingWithPatialAdmission == null) return; form.getGlobalContext().Emergency.setEDTransferVo(trackingWithPatialAdmission.getCurrentTransferRecord()); if( trackingWithPatialAdmission.getCurrentPartialAdmissionIsNotNull() && AllocationStatus.ACTIVE.equals(trackingWithPatialAdmission.getCurrentPartialAdmission().getAllocatedStatus()) && (!trackingWithPatialAdmission.getCurrentTransferRecordIsNotNull() || (trackingWithPatialAdmission.getCurrentTransferRecordIsNotNull() && (trackingWithPatialAdmission.getCurrentTransferRecord().getAcceptedDateTimeIsNotNull() || Boolean.TRUE.equals(trackingWithPatialAdmission.getCurrentTransferRecord().getNotAccepted())) ))) { form.getLocalContext().setPartialAdmissionForTrackingVo(trackingWithPatialAdmission); form.getLocalContext().setDTAWithTransferMessageId(engine.showMessage("A decision to admit record exists for this patient. If you proceed to Transfer the patient, the record will be cancelled on the ED system and the PAS system. Are you sure you want to continue?","Confirm Transfer" ,MessageButtons.YESNO, MessageIcon.QUESTION)); } else { form.getLocalContext().setPartialAdmissionForTrackingVo(null); engine.open(form.getForms().Emergency.TransferDialog); } //------------ }
public TrackingWithPartialAdmissionVo cancelCurrentPartialAdmission(TrackingWithPartialAdmissionVo trWithPartialAdmission, EDPartialAdmissionVo partialAdmission) throws StaleObjectException, UniqueKeyViolationException { if(trWithPartialAdmission == null || partialAdmission== null) throw new CodingRuntimeException("Cannot save a null tracking record."); if(!trWithPartialAdmission.isValidated() || !trWithPartialAdmission.isValidated()) throw new CodingRuntimeException("tracking record is not validated."); DomainFactory factory = getDomainFactory(); EDPartialAdmission doPartialAdmission = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, partialAdmission); factory.save(doPartialAdmission); Tracking doTracking = TrackingWithPartialAdmissionVoAssembler.extractTracking(factory, trWithPartialAdmission); factory.save(doTracking); EDPartialAdmissionDialog dom = (EDPartialAdmissionDialog) getDomainImpl(EDPartialAdmissionDialogImpl.class); try { dom.triggerCancelPartialAdmission(trWithPartialAdmission.getAttendance(), trWithPartialAdmission.getCurrentPartialAdmission()); } catch (DomainInterfaceException e) { e.printStackTrace(); } return TrackingWithPartialAdmissionVoAssembler.create(doTracking); }
public TrackingWithPartialAdmissionVo getTrackingWithEDPartialAdmission(TrackingRefVo trackingRef) { if(trackingRef == null || trackingRef.getID_Tracking() == null) throw new CodingRuntimeException("Cannot get Tracking record on null Tracking Id."); DomainFactory factory = getDomainFactory(); Tracking doTracking = (Tracking) factory.getDomainObject(Tracking.class, trackingRef.getID_Tracking()); return TrackingWithPartialAdmissionVoAssembler.create(doTracking); }
@Override protected void onBtnTransferClick() throws PresentationLogicException { //WDEV-19006 - start form.getLocalContext().setSelectedEvent(EDReferralToSpecialtyEvent.TRANSFER); form.dtimCompletion().setValue(new DateTime()); ReferralToSpecialtyTeamVo referralToSave = populateDataFromScreen(form.getLocalContext().getSelectedReferralToSpecialty()); form.getGlobalContext().Emergency.setReferralToSpecialtyTeam(referralToSave); String[] errors = referralToSave.validate(getUIErrors()); if (errors != null && errors.length > 0) { engine.showErrors(errors); return ; } // Check SOE if (referralToSave.getID_ReferralToSpecTeamIsNotNull() && domain.isStale(referralToSave)) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); if (form.getLocalContext().getSelectedReferralToSpecialtyIsNotNull()) { form.getLocalContext().setSelectedReferralToSpecialty(domain.getReferralToSpecialty(form.getLocalContext().getSelectedReferralToSpecialty())); } if (form.getLocalContext().getTrackingForReferralIsNotNull()) { form.getLocalContext().setTrackingForReferral(domain.getTrackingForReferral(form.getLocalContext().getTrackingForReferral())); } open(); return ; } TrackingWithPartialAdmissionVo trackingwithPartialAdmission = domain.getTrackingWithEDPartialAdmission(form.getGlobalContext().Emergency.getTracking()); Boolean newTransfer = isNewTransfer(trackingwithPartialAdmission.getCurrentTransferRecord()); if( trackingwithPartialAdmission != null && newTransfer && trackingwithPartialAdmission.getCurrentPartialAdmissionIsNotNull() && AllocationStatus.ACTIVE.equals(trackingwithPartialAdmission.getCurrentPartialAdmission().getAllocatedStatus())) { form.getLocalContext().setlcCurrentPartialAdmission(trackingwithPartialAdmission.getCurrentPartialAdmission()); form.getLocalContext().setlcDTAWithTransferMessageId(engine.showMessage("A decision to admit record exists for this patient. If you proceed to Transfer the patient, the record will be cancelled on the ED system and the PAS system. Are you sure you want to continue?","Confirm Transfer" ,MessageButtons.YESNO, MessageIcon.QUESTION)); } else engine.open(form.getForms().Emergency.TransferDialog); }