public DischargedEpisodeADTVo getDischargedEpisodeADT(PASEventRefVo pasEventRef) { if (pasEventRef == null) throw new CodingRuntimeException("Cannot get DischargeEpisode on null PASEventRef"); DomainFactory factory = getDomainFactory(); ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); String query = "SELECT dis FROM DischargedEpisode AS dis LEFT JOIN dis.pasEvent AS pasev WHERE pasev.id = :ID_PASEV"; paramNames.add("ID_PASEV"); paramValues.add(pasEventRef.getID_PASEvent()); DischargedEpisodeADTVoCollection dischargeEpisode = DischargedEpisodeADTVoAssembler.createDischargedEpisodeADTVoCollectionFromDischargedEpisode(factory.find(query.toString(), paramNames, paramValues)); if (dischargeEpisode != null && dischargeEpisode.size() > 0) { return dischargeEpisode.get(0); } return null; }
private void updateDischargeDetails(DischargedEpisodeADTVo dischargeEpisodeADT) { form.lyrDetail().tabDischarge().cmbMethodDischarge().setValue(dischargeEpisodeADT.getMethodOfDischarge()); updateDischargeDateTimeControls(); form.lyrDetail().tabDischarge().cmbDischargeDestination().setValue(dischargeEpisodeADT.getDischargeDestination()); form.lyrDetail().tabDischarge().dtimDischarge().setValue(dischargeEpisodeADT.getDischargeDateTime()); if (Boolean.TRUE.equals(dischargeEpisodeADT.getWasTreatmentDeferred())) { form.lyrDetail().tabDischarge().grpDeferred().setValue(grpDeferredEnumeration.rdoYesDeferred); } else if (Boolean.FALSE.equals(dischargeEpisodeADT.getWasTreatmentDeferred())) { form.lyrDetail().tabDischarge().grpDeferred().setValue(grpDeferredEnumeration.rdoNoDeferred); } form.lyrDetail().tabDischarge().cmbDeferredReason().setValue(dischargeEpisodeADT.getDeferredReasonConfig()); }
private void updateDischargeDetails(DischargedEpisodeADTVo dischargeEpisodeADT) { form.lyrDetail().tabDischarge().cmbMethodDischarge().setValue(dischargeEpisodeADT.getMethodOfDischarge()); updateDischargeDateTimeControls(); form.lyrDetail().tabDischarge().cmbDischargeDestination().setValue(dischargeEpisodeADT.getDischargeDestination()); form.lyrDetail().tabDischarge().dtimDischarge().setValue(dischargeEpisodeADT.getDischargeDateTime()); showHide18WeekClockStopped(false); if (Boolean.TRUE.equals(dischargeEpisodeADT.getWasTreatmentDeferred())) { form.lyrDetail().tabDischarge().grpTreatmentPostponed().setValue(grpTreatmentPostponedEnumeration.rdoYesTreat); } else if (Boolean.FALSE.equals(dischargeEpisodeADT.getWasTreatmentDeferred())) { form.lyrDetail().tabDischarge().grpTreatmentPostponed().setValue(grpTreatmentPostponedEnumeration.rdoNoTreat); if (form.getLocalContext().getRtpStat() != null && form.getLocalContext().getRtpStat().equals(TREATMENT) && form.lyrDetail().tabDischarge().grpTreatmentPostponed().getValue().equals(GenForm.lyrDetailLayer.tabDischargeContainer.grpTreatmentPostponedEnumeration.rdoNoTreat)) { showHide18WeekClockStopped(true); } } if (dischargeEpisodeADT.getEighteenWeekClockStopped() == null) { form.lyrDetail().tabDischarge().grp18Stopped().setValue(grp18StoppedEnumeration.rdoYesStopped); form.lyrDetail().tabDischarge().grp18Running().setValue(grp18RunningEnumeration.rdoYesRunning); } else if (Boolean.TRUE.equals(dischargeEpisodeADT.getEighteenWeekClockStopped())) { form.lyrDetail().tabDischarge().grp18Running().setValue(grp18RunningEnumeration.rdoNoRunning); } else if (Boolean.FALSE.equals(dischargeEpisodeADT.getEighteenWeekClockStopped())) { form.lyrDetail().tabDischarge().grp18Stopped().setValue(grp18StoppedEnumeration.rdoNoStopped); } form.lyrDetail().tabDischarge().cmbReason().setValue(dischargeEpisodeADT.getTreatmentDeferredReason()); }
private DischargedEpisodeADTVo createInfantDischarge(InpatientEpisodeLiteVo voInpat) { DischargedEpisodeADTVo voDischargedEpisode = new DischargedEpisodeADTVo(); voDischargedEpisode.setDischargeDateTime(form.lyrDetail().tabDischarge().dtimDischarge().getValue()); voDischargedEpisode.setDischargeDestination(form.lyrDetail().tabDischarge().cmbDischargeDestination().getValue()); voDischargedEpisode.setMethodOfDischarge(form.lyrDetail().tabDischarge().cmbMethodDischarge().getValue()); BedSpaceStateLiteVo voBedSpaceState = domain.getBedSpaceStateByInpatientEpisode(voInpat); if (voBedSpaceState != null && voBedSpaceState.getInpatientEpisodeIsNotNull()) { voDischargedEpisode.setPasEvent(voBedSpaceState.getInpatientEpisode().getPasEvent()); voDischargedEpisode.setConsultantStays(voBedSpaceState.getInpatientEpisode().getConsultantStays()); voDischargedEpisode.setWardStays(voBedSpaceState.getInpatientEpisode().getWardStays()); } else voDischargedEpisode.setPasEvent(voInpat.getPasEvent()); // move to previous if (voBedSpaceState != null && voBedSpaceState.getCurrentBedStatusIsNotNull()) { voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone()); voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo()); voBedSpaceState.getCurrentBedStatus().setStatusDateTime(new DateTime()); voBedSpaceState.getCurrentBedStatus().setBedStatus(form.lyrDetail().tabDischarge().chkAllocateForCleaning().getValue() ? BedStatus.FOR_CLEANING : BedStatus.AVAILABLE); } voDischargedEpisode.setIsActive(true); voDischargedEpisode.setBedSpaceForInfant(voBedSpaceState); return voDischargedEpisode; }
public ims.core.vo.DischargedEpisodeADTVo saveDischarge(DischargedEpisodeADTVo dischargedEpisode, BedSpaceStateLiteVo voBedSpacState) throws StaleObjectException, DomainInterfaceException, ForeignKeyViolationException { if(dischargedEpisode.getPasEventIsNotNull() && dischargedEpisode.getPasEvent().getPatientIsNotNull()) return dischargePatient(dischargedEpisode.getPasEvent().getPatient(), dischargedEpisode, voBedSpacState, false, null); return null; }
public ims.core.vo.DischargedEpisodeADTVo saveDischarge(DischargedEpisodeADTVo dischargedEpisode, BedSpaceStateLiteVo voBedSpacState, DeathDetailsVo deathDetailsVo, Boolean cancelApptsForDeceasedPatient, Boolean checkPatientsGender) throws StaleObjectException, DomainInterfaceException, ForeignKeyViolationException { if(dischargedEpisode.getPasEventIsNotNull() && dischargedEpisode.getPasEvent().getPatientIsNotNull()) return dischargePatient(dischargedEpisode.getPasEvent().getPatient(), dischargedEpisode, voBedSpacState, false, null, deathDetailsVo, cancelApptsForDeceasedPatient, checkPatientsGender); return null; }
public DischargedEpisodeADTVo getDischargedEpisodeADT(PASEventRefVo pasEventRef) { if (pasEventRef == null) throw new CodingRuntimeException("Cannot get DischargeEpisode on null PASEventRef"); DomainFactory factory = getDomainFactory(); ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); String query = "SELECT dis FROM DischargedEpisode AS dis LEFT JOIN dis.pasEvent AS pasev WHERE pasev.id = :ID_PASEV"; paramNames.add("ID_PASEV"); paramValues.add(pasEventRef.getID_PASEvent()); DischargedEpisodeADTVoCollection dischargeEpisode = DischargedEpisodeADTVoAssembler.createDischargedEpisodeADTVoCollectionFromDischargedEpisode(factory.find(query.toString(), paramNames, paramValues)); if (dischargeEpisode != null && dischargeEpisode.size() > 0) { if (dischargeEpisode.get(0) != null && dischargeEpisode.get(0).getDeferredReasonIsNotNull()) { dischargeEpisode.get(0).setDeferredReasonConfig(getDeferredReason(dischargeEpisode.get(0).getDeferredReason())); } return dischargeEpisode.get(0); } return null; }