public DischargedEpisodeForVTERiskAssessmentWorklistVo getDischargeEpisode(PASEventRefVo pasEvent) { if(pasEvent == null ) throw new CodingRuntimeException("Pas Event not provided"); DomainFactory factory = getDomainFactory(); List<?> dis = factory.find("select dis from DischargedEpisode as dis left join dis.pasEvent as pas where pas.id =:idPasEvent", new String[] {"idPasEvent"}, new Object[] {pasEvent.getID_PASEvent()}); if( dis != null && dis.size() > 0) { DischargedEpisodeForVTERiskAssessmentWorklistVoCollection tempColl = DischargedEpisodeForVTERiskAssessmentWorklistVoAssembler.createDischargedEpisodeForVTERiskAssessmentWorklistVoCollectionFromDischargedEpisode(dis).sort(SortOrder.DESCENDING); if(tempColl != null && tempColl.size() > 0) return tempColl.get(0); } return null; }
public DischargedEpisodeForVTERiskAssessmentWorklistVo getDischargedEpisodeForVTERiskAssessmentWorklistVo(DischargedEpisodeRefVo dischargeepisodeRef) { if( dischargeepisodeRef == null) throw new CodingRuntimeException("DischargeEpisode cannot be null"); DomainFactory factory = getDomainFactory(); DischargedEpisode doDischargedEpisode = (DischargedEpisode) factory.getDomainObject(DischargedEpisode.class, dischargeepisodeRef.getID_DischargedEpisode()); return DischargedEpisodeForVTERiskAssessmentWorklistVoAssembler.create(doDischargedEpisode); }
private void getEpisode()//WDEV-15414 { if( form.getGlobalContext().Core.getCurrentCareContext() == null) form.getLocalContext().setReadOnlyForm(Boolean.TRUE); //the form is redonly else { if(form.getGlobalContext().Core.getCurrentCareContext().getPasEventIsNotNull()) { InpatientEpisodeForVTERiskAsessmentVo tempVo = domain.getInpatientEpisodes(form.getGlobalContext().Core.getCurrentCareContext().getPasEvent()); if(tempVo != null) { form.getLocalContext().setInpatientEpisode(tempVo); form.getLocalContext().setDischargeEpisode(null);//WDEV-15414 } else//WDEV-15414 { DischargedEpisodeForVTERiskAssessmentWorklistVo dis = domain.getDischargeEpisode(form.getGlobalContext().Core.getCurrentCareContext().getPasEvent()); if(dis != null) { form.getLocalContext().setInpatientEpisode(null); form.getLocalContext().setDischargeEpisode(dis); } else { form.getLocalContext().setReadOnlyForm(Boolean.TRUE); //the form is redonly } } } else { form.getLocalContext().setReadOnlyForm(Boolean.TRUE); //the form is redonly } } }
public DischargedEpisodeForVTERiskAssessmentWorklistVo saveDischargeEpisode(DischargedEpisodeForVTERiskAssessmentWorklistVo discharge) throws StaleObjectException, UniqueKeyViolationException { if(discharge == null) throw new CodingRuntimeException("Cannot save a null Discharge Episode."); if(!discharge.isValidated()) throw new CodingRuntimeException("Discharge Episode is not validated."); DomainFactory factory = getDomainFactory(); DischargedEpisode doDischarge = DischargedEpisodeForVTERiskAssessmentWorklistVoAssembler.extractDischargedEpisode(factory, discharge); factory.save(doDischarge); return DischargedEpisodeForVTERiskAssessmentWorklistVoAssembler.create(doDischarge); }
public DischargedEpisodeForVTERiskAssessmentWorklistVo getDischargedEpisodeForVTERiskAssessmentWorklistVo(DischargedEpisodeRefVo dischargeRef) { if( dischargeRef == null) throw new CodingRuntimeException("DischargeEpisode cannot be null"); DomainFactory factory = getDomainFactory(); DischargedEpisode doDischargedEpisode = (DischargedEpisode) factory.getDomainObject(DischargedEpisode.class, dischargeRef.getID_DischargedEpisode()); return DischargedEpisodeForVTERiskAssessmentWorklistVoAssembler.create(doDischargedEpisode); }
public WasVTERiskAssessmentStatusChangedVo wasStatusChanged(IVTERiskAssessment episode, VTEAsessmentStatus currentStatus) { if(episode == null || episode.getId() == null) throw new CodingRuntimeException("Cannot check the status for a null Episode ID."); DomainFactory factory = getDomainFactory(); String query = null;//WDEV-15414 List<?> list = null;//WDEV-15414 //WDEV-15414 if(episode instanceof VTERiskAssessmentWorklistVo) { query = "select ie from InpatientEpisode as ie where ie.id = :EpisodeId"; } //WDEV-15414 else if(episode instanceof DischargedEpisodeForVTERiskAssessmentWorklistVo) { query = "select de from DischargedEpisode as de where de.id = :EpisodeId"; } list = factory.find(query, new String[] {"EpisodeId"}, new Object[] {episode.getId()});//WDEV-15414 IVTERiskAssessment currentEpisode = null; if(list != null && list.size() > 0) { if(episode instanceof VTERiskAssessmentWorklistVo) { currentEpisode = VTERiskAssessmentWorklistVoAssembler.create((InpatientEpisode) list.get(0)); } else if(episode instanceof DischargedEpisodeForVTERiskAssessmentWorklistVo) { currentEpisode = DischargedEpisodeForVTERiskAssessmentWorklistVoAssembler.create((DischargedEpisode) list.get(0)); } } if(currentEpisode == null || currentStatus == null) return null; WasVTERiskAssessmentStatusChangedVo wasChanged = new WasVTERiskAssessmentStatusChangedVo(); if(currentStatus.equals(currentEpisode.getVTEAssessmentStatus())) { wasChanged.setWasStatusChanged(false); wasChanged.setVTEStatus(null); } else { wasChanged.setWasStatusChanged(true); wasChanged.setVTEStatus(currentEpisode.getVTEAssessmentStatus()); } return wasChanged; }
public DischargedEpisodeForVTERiskAssessmentWorklistVo getDischargedEpisodeForRecord(VTERiskAssessmentRefVo vteAssessmentRef, PatientRefVo patientRef) { if (patientRef == null || vteAssessmentRef == null) return null; DomainFactory factory = getDomainFactory(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String hql = " select dischargeEp from DischargedEpisode as dischargeEp left join dischargeEp.pasEvent as pasEv left join pasEv.patient as pat left join dischargeEp.vTERiskAssessment as vte where pat.id = :patientID and vte.id = :vteID"; markers.add("patientID"); values.add(patientRef.getID_Patient()); markers.add("vteID"); values.add(vteAssessmentRef.getID_VTERiskAssessment()); List<?> list = factory.find(hql, markers, values); if (list != null && list.size() > 0) return DischargedEpisodeForVTERiskAssessmentWorklistVoAssembler.createDischargedEpisodeForVTERiskAssessmentWorklistVoCollectionFromDischargedEpisode(list).get(0); return null; }