public ims.emergency.vo.TrackingForEDPartialAdmissionVo getTrackingForEdPartialAdmission(ims.emergency.vo.TrackingRefVo trackingRef) { if (trackingRef == null || trackingRef.getID_Tracking() == null) { throw new CodingRuntimeException("Cannot get TrackingAreaRefVo on null Id for Tracking "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select tracking from Tracking as tracking where tracking.id = :trackingID "); List<?> list = factory.find(hql.toString(), new String[] { "trackingID" }, new Object[] { trackingRef.getID_Tracking() }); if (list!=null && list.size()>0) { return TrackingForEDPartialAdmissionVoAssembler.create((Tracking) list.get(0)); } return null; }
private void newInstance() { clearControls(); form.cmbAdmissionStatus().setValue(AllocationStatus.ACTIVE); form.getLocalContext().setCurrentEDPartialAdmission(null); form.dtimDecisionToAdmit().setValue(new DateTime()); TrackingForEDPartialAdmissionVo currentTracking = form.getLocalContext().getCurrentTrackingForEdPartialAdmission(); form.cmbSpecialty().setValue(currentTracking!=null && currentTracking.getCurrentReferralIsNotNull() ? currentTracking.getCurrentReferral().getSpecialty() : null); form.cmbPatientStatus().setValue(currentTracking!=null && currentTracking.getAttendanceIsNotNull() ? currentTracking.getAttendance().getPatientAttendanceStatus() : null); form.cmbAccomodationTypeRequested().setValue(currentTracking!=null && currentTracking.getAttendanceIsNotNull() ? currentTracking.getAttendance().getAccomodationRequestedType() : null); form.ccAuthoringInfo().initializeComponent(); Object hcp = domain.getHcpUser(); if (hcp instanceof HcpLiteVo) { form.ccConsultant().setValue((HcpLiteVo) hcp); } form.setMode(FormMode.EDIT); }
private void populateScreenFromData(EDPartialAdmissionVo edPartialAdmissionVo) { if (edPartialAdmissionVo==null) return; form.dtimDecisionToAdmit().setValue(edPartialAdmissionVo.getDecisionToAdmitDateTime()); form.ccConsultant().setValue(edPartialAdmissionVo.getAdmittingConsultant()); form.cmbSpecialty().setValue(edPartialAdmissionVo.getSpecialty()); form.dtimBedAllocated().setValue(edPartialAdmissionVo.getAllocatedDateTime()); if (edPartialAdmissionVo.getAllocatedWard() != null) //WDEV-19336 { form.cmbBedAllocatedWard().newRow(edPartialAdmissionVo.getAllocatedWard(), edPartialAdmissionVo.getAllocatedWard().getName() != null ? edPartialAdmissionVo.getAllocatedWard().getName() : ""); form.cmbBedAllocatedWard().setValue(edPartialAdmissionVo.getAllocatedWard()); } form.cmbAdmissionStatus().setValue(edPartialAdmissionVo.getAllocatedStatus()); form.ccAuthoringInfo().setValue(edPartialAdmissionVo.getAuthoringInfo()); TrackingForEDPartialAdmissionVo currentTracking = form.getLocalContext().getCurrentTrackingForEdPartialAdmission(); form.cmbPatientStatus().setValue(currentTracking!=null && currentTracking.getAttendanceIsNotNull() ? currentTracking.getAttendance().getPatientAttendanceStatus() : null); form.cmbAccomodationTypeRequested().setValue(edPartialAdmissionVo.getAccomodationRequestedType()); }
public ims.emergency.vo.EDPartialAdmissionVo save(ims.emergency.vo.TrackingForEDPartialAdmissionVo trackingToSave, ims.emergency.vo.EDPartialAdmissionVo edPartialAdmissionToSave) throws ims.domain.exceptions.StaleObjectException { if (edPartialAdmissionToSave == null && trackingToSave == null) throw new CodingRuntimeException("Cannot save null EDPartialAdmissionVo or TrackingForEDPartialAdmissionVo "); DomainFactory factory = getDomainFactory(); if (edPartialAdmissionToSave != null && trackingToSave == null) { if (!edPartialAdmissionToSave.isValidated()) throw new DomainRuntimeException("EDPartialAdmissionVo Not Validated."); EDPartialAdmission domainEDPartialAdmissionToSave = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, edPartialAdmissionToSave); factory.save(domainEDPartialAdmissionToSave); return EDPartialAdmissionVoAssembler.create(domainEDPartialAdmissionToSave); } else if (edPartialAdmissionToSave == null && trackingToSave != null) { if (!trackingToSave.isValidated()) throw new DomainRuntimeException("TrackingForEDPartialAdmissionVo Not Validated."); Tracking domainTrackingforReferral = TrackingForEDPartialAdmissionVoAssembler.extractTracking(factory, trackingToSave); factory.save(domainTrackingforReferral); TrackingForEDPartialAdmissionVo track = TrackingForEDPartialAdmissionVoAssembler.create(domainTrackingforReferral); if (track != null) return track.getCurrentPartialAdmission(); } return null; }
private void initializeControls() { populateWardCombo();//WDEV-23273 form.ccConsultant().initializeResponsibleHcp(MosType.HCP, true); TrackingForEDPartialAdmissionVo currentTracking = form.getLocalContext().getCurrentTrackingForEdPartialAdmission(); form.cmbPatientStatus().setValue(currentTracking!=null && currentTracking.getAttendanceIsNotNull() ? currentTracking.getAttendance().getPatientAttendanceStatus() : null); }
private boolean save() { EDPartialAdmissionVo edPartialAdmissionToSave = populateDataFromScreen(form.getLocalContext().getCurrentEDPartialAdmission()); String[] errors = edPartialAdmissionToSave.validate(getUIErrors()); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } /* // Check SOE if (edPartialAdmissionToSave.getID_ReferralToSpecTeamIsNotNull() && domain.isStale(edPartialAdmissionToSave)) { 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 false; } */ TrackingForEDPartialAdmissionVo trackingToSave = null; // for a new EDPartialAdmissionVo set the current EdPartiqalAdmission in tracking and set Tracking.CurrentStatus if (edPartialAdmissionToSave.getID_EDPartialAdmission()==null) { trackingToSave = form.getLocalContext().getCurrentTrackingForEdPartialAdmission(); //TrackingAttendanceStatusVo trackingStatusToSave = populateTrackingAttendanceStatus(TrackingStatus.REFERRED_TO_OTHER_SPECIALITY); trackingToSave.setCurrentPartialAdmission(edPartialAdmissionToSave); //trackingToSave.setCurrentStatus(trackingStatusToSave); } try { if (trackingToSave != null ) { String[] errors1 = trackingToSave.validate(); if (errors1 != null && errors1.length > 0) { engine.showErrors(errors1); return false; } form.getLocalContext().setCurrentEDPartialAdmission(domain.save(trackingToSave,null)); form.getLocalContext().setCurrentTrackingForEdPartialAdmission(domain.getTrackingForEdPartialAdmission(trackingToSave)); } else form.getLocalContext().setCurrentEDPartialAdmission(domain.save(null,edPartialAdmissionToSave)); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); return false; } return true; }