private SelectItemVoCollection chooseInfantsToDischarge() { SelectItemVoCollection voCollItems = new SelectItemVoCollection(); InpatientEpisodeLiteVoCollection voCollInfants = form.getLocalContext().getInfants(); if (voCollInfants != null) { // go through collection creating discharge records for each infant for (InpatientEpisodeLiteVo voInpat : voCollInfants) { SelectItemVo voSelectItem = new SelectItemVo(); voSelectItem.setItem(createInfantDischarge(voInpat)); voSelectItem.setSelected(Boolean.FALSE); voCollItems.add(voSelectItem); } } return voCollItems.size() > 0 ? voCollItems : null; }
private void populateInfantsTabFromData() { form.lyrDetail().tabInfants().grdInfants().getRows().clear(); enableInfantControls(false); Object mos = domain.getMosUser(); //Mos Label if(mos != null) form.lyrDetail().tabInfants().lyrInfants().tabInfantTransfer().lblInfantMos().setValue(((MemberOfStaffLiteVo)mos).getIMosName()); if (form.getGlobalContext().Core.getSelectedBedSpaceState() == null || form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode() == null || form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode().getPasEvent() == null || form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode().getPasEvent().getPatient() == null) return; InpatientEpisodeLiteVoCollection voCollInpatient = domain.listInfantsForSelectedPatient(form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode().getPasEvent().getPatient()); form.getLocalContext().setInfants(voCollInpatient); populateInfantsToGrid(voCollInpatient); updateInfantDischargeDateTimeControls(); }
private void populateBedMoveTabFromData(boolean bCalledOnInitialise) { if (form.getGlobalContext().Core.getADTWard() == null) throw new CodingRuntimeException("Ward not set in populateBedMoveTabFromData"); InpatientEpisodeLiteVoCollection voCollInpatients = domain.listInpatientEpisodeByWard(form.getGlobalContext().Core.getADTWard(), form.getGlobalContext().Core.getPatientShort()); if (voCollInpatients != null && voCollInpatients.size() >= 2) { if (bCalledOnInitialise) //WDEV-21014 { form.getLocalContext().setSortOrderBedNo(SortOrder.ASCENDING); } if (form.getLocalContext().getSortOrderBedNoIsNotNull()) { voCollInpatients.sort(InpatientEpisodeLiteVo.getBedNumberComparator(form.getLocalContext().getSortOrderBedNo())); } } populateBedMoveGridFromData(voCollInpatients); form.lyrDetail().tabBedMove().btnInternalTransfer().setEnabled(false); form.lyrDetail().tabBedMove().btnSwitchBeds().setEnabled(false); }
@Override protected void onGrdInfantsGridHeaderClicked(int column) throws PresentationLogicException { InpatientEpisodeLiteVoCollection vals = form.lyrDetail().tabInfants().grdInfants().getValues(); if (vals.size() < 2) return; form.getLocalContext().setSortOrderInfantsDOB(SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrderInfantsDOB()) ? SortOrder.DESCENDING : SortOrder.ASCENDING); InpatientEpisodeLiteVo selVal = form.lyrDetail().tabInfants().grdInfants().getValue(); if (COL_INFANT_AGE == column) { vals.sort(new ims.core.forms.bedadmissioncomponent.Logic.BedAdmissionAgeComparator(form.getLocalContext().getSortOrderBedMoveDOB())); } populateInfantsToGrid(vals); if (selVal != null) { form.lyrDetail().tabInfants().grdInfants().setValue(selVal); } }
private void populatehomeLeaveTabFromData() { form.getLocalContext().setRecordSelected(false); form.lyrAdmission().tabHomeLeave().grdHomeLeave().getRows().clear(); BedSpaceStateLiteVo voBed = form.getGlobalContext().Core.getSelectedBedSpaceState(); if (voBed == null) { form.fireCustomControlValueChanged(); return; } InpatientEpisodeLiteVoCollection voColl = domain.listHomeLeavesByWard(voBed.getWard()); if(voColl == null || voColl.size() == 0) { form.fireCustomControlValueChanged(); return; } populateHomeLeavesToGrid(voColl); form.fireCustomControlValueChanged(); }
@Override protected void onGrdInWaitingGridHeaderClicked(int column) throws PresentationLogicException { InpatientEpisodeLiteVoCollection vals = form.lyrAdmission().tabInWaiting().grdInWaiting().getValues(); if (vals.size() <2) return; InpatientEpisodeLiteVo selVal = form.lyrAdmission().tabInWaiting().grdInWaiting().getValue(); toggleSortOrder(form.lyrAdmission().tabInWaiting().grdInWaiting(), column); if (COL_AGE == column) { vals.sort(new BedAdmissionAgeComparator(form.getLocalContext().getSortOrderAwaitingBedAge())); } else if (COL_DOB == column) { vals.sort(new BedAdmissionDOBComparator(form.getLocalContext().getSortOrderAwaitingBedDOB())); } populateInWaitingGridFromData(vals); if (selVal != null) { form.lyrAdmission().tabInWaiting().grdInWaiting().setValue(selVal); } }
@Override protected void onGrdHomeLeaveGridHeaderClicked(int column) throws PresentationLogicException { InpatientEpisodeLiteVoCollection vals = form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValues(); if (vals.size() < 2) return; InpatientEpisodeLiteVo selectedHl = form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue(); toggleSortOrder(form.lyrAdmission().tabHomeLeave().grdHomeLeave(), column); if (COL_AGE == column) { vals.sort(new BedAdmissionAgeComparator(form.getLocalContext().getSortOrderHomeLeaveAge())); } else if (COL_DOB == column) { vals.sort(new BedAdmissionDOBComparator(form.getLocalContext().getSortOrderHomeLeaveDOB())); } populateHomeLeavesToGrid(vals); if (selectedHl != null) { form.lyrAdmission().tabHomeLeave().grdHomeLeave().setValue(selectedHl); } }
public InpatientEpisodeLiteVoCollection listInpatientEpisodeByWard(LocationRefVo ward, PatientRefVo patient) { if(ward == null || ward.getID_Location() == null) throw new CodingRuntimeException("ward is null or id not provide in method listInpatientEpisodeByWard"); ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); String hql = "from InpatientEpisode inpat join fetch inpat.bed as bed where inpat.pasEvent.location.id = :idWard and bed is not null"; paramNames.add("idWard"); paramValues.add(ward.getID_Location()); if(patient != null && patient.getID_Patient() != null) { hql += " and inpat.pasEvent.patient.id <> :PatientId"; paramNames.add("PatientId"); paramValues.add(patient.getID_Patient()); } hql += " order by bed.bay asc, inpat.pasEvent.patient.name.upperSurname asc,inpat.pasEvent.patient.name.upperForename asc"; List inpatEpis = getDomainFactory().find(hql, paramNames, paramValues); return InpatientEpisodeLiteVoAssembler.createInpatientEpisodeLiteVoCollectionFromInpatientEpisode(inpatEpis); }
private SelectItemVoCollection chooseInfantsToTransfer() { SelectItemVoCollection voCollItems = new SelectItemVoCollection(); boolean isMaternityInpatient = form.getGlobalContext().Core.getSelectedBedSpaceStateIsNotNull() && form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisodeIsNotNull() && form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode().getIsMaternityInpatientIsNotNull() ? form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode().getIsMaternityInpatient() : false; if (isMaternityInpatient) { PatientShort voPatient = form.getGlobalContext().Core.getSelectedBedSpaceStateIsNotNull() && form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisodeIsNotNull() && form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode().getPasEventIsNotNull() && form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode().getPasEvent().getPatientIsNotNull() ? form.getGlobalContext().Core.getSelectedBedSpaceState().getInpatientEpisode().getPasEvent().getPatient() : null; if (voPatient != null) { InpatientEpisodeLiteVoCollection voCollInfants = form.getLocalContext().getInfants(); if (voCollInfants != null) { // go through collection creating transfer records for each // infant for (InpatientEpisodeLiteVo voInpat : voCollInfants) { SelectItemVo voSelectItem = new SelectItemVo(); voSelectItem.setItem(createInfantTransfer(voInpat)); voSelectItem.setSelected(Boolean.FALSE); voCollItems.add(voSelectItem); } } } } return voCollItems.size() > 0 ? voCollItems : null; }
private void populateBedMoveTabFromData() { if (form.getGlobalContext().Core.getADTWard() == null) throw new CodingRuntimeException("Ward not set in populateBedMoveTabFromData"); form.lyrDetail().tabBedMove().grdPatients().getRows().clear(); InpatientEpisodeLiteVoCollection voCollInpatient = domain.listInpatientEpisodeByWard(form.getGlobalContext().Core.getADTWard()); if (voCollInpatient != null && voCollInpatient.size() > 0) { for (InpatientEpisodeLiteVo voInpat : voCollInpatient) { grdPatientsRow row = form.lyrDetail().tabBedMove().grdPatients().getRows().newRow(); PatientShort voPatient = (voInpat.getPasEventIsNotNull() && voInpat.getPasEvent().getPatientIsNotNull()) ? voInpat.getPasEvent().getPatient() : null; if (voPatient != null) { if (voPatient.getNameIsNotNull()) { row.setColForename(voPatient.getName().getForename()); row.setColSurname(voPatient.getName().getSurname()); } //WDEV-14525 if(voPatient.getAge() == null) voPatient.calculateAge(); PatientId patId = voPatient.getDisplayId(); row.setColDisplayId(patId != null ? patId.getValue() : null); row.setColSex(voPatient.getSexIsNotNull() ? voPatient.getSex().toString() : null); row.setColAge(voPatient.getAgeText()); row.setColDOB(voPatient.getDobIsNotNull() ? voPatient.getDob().toString() : null); } row.setValue(voInpat); } } form.lyrDetail().tabBedMove().btnInternalTransfer().setEnabled(false); }
public InpatientEpisodeLiteVo getInpatientEpisodes(PatientRefVo patientId) { DomainFactory factory = getDomainFactory(); String hql; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); hql = " from InpatientEpisode ip "; StringBuffer condStr = new StringBuffer(); String andStr = " "; if (patientId != null) { condStr.append(andStr + " ip.pasEvent.patient.id = :patient"); markers.add("patient"); values.add(patientId.getID_Patient()); andStr = " and "; } if (andStr.equals(" and ")) { hql += " where "; } hql += condStr.toString(); List ips = factory.find(hql, markers, values); if(ips != null && ips.size() > 0) { InpatientEpisodeLiteVoCollection tempColl = InpatientEpisodeLiteVoAssembler.createInpatientEpisodeLiteVoCollectionFromInpatientEpisode(ips); if(tempColl != null && tempColl.size() > 0) return tempColl.get(0); else return null; } else return null; }
public InpatientEpisodeLiteVoCollection listInfantsForSelectedPatient(PatientRefVo patient) { if (patient == null || patient.getID_Patient() == null) throw new CodingRuntimeException("patient is null or id not provided in method countInfants"); String hql = "select inpatEpis from InpatientEpisode as inpatEpis left join inpatEpis.pasEvent as pE where (pE.patient.id in (select pat.id from Patient as pat where (pat.clientParent.id = " + patient.getID_Patient() + ")))"; List lstEpisodes = getDomainFactory().find(hql); if(lstEpisodes != null) return InpatientEpisodeLiteVoAssembler.createInpatientEpisodeLiteVoCollectionFromInpatientEpisode(lstEpisodes); return null; }
public InpatientEpisodeLiteVoCollection listHomeLeavesByWard(LocationRefVo ward) { if(ward == null || ward.getID_Location() == null) throw new CodingRuntimeException("ward is null or id not provide in method listInpatientEpisodeByWard"); String hql = getHomeLeavesQuery(false);// WDEV-14563 List<?> inpatEpis = getDomainFactory().find(hql, new String[]{"idWard", "bTRUE","idWard2", "status"}, new Object[]{ward.getID_Location(), Boolean.TRUE, ward.getID_Location(),getDomLookup(TransferStatus.PENDING) }); return InpatientEpisodeLiteVoAssembler.createInpatientEpisodeLiteVoCollectionFromInpatientEpisode(inpatEpis); }
public InpatientEpisodeLiteVoCollection listInpatientEpisodeByWard(LocationRefVo ward) { if(ward == null || ward.getID_Location() == null) throw new CodingRuntimeException("ward is null or id not provide in method listInpatientEpisodeByWard"); String hql = "from InpatientEpisode inpat join fetch inpat.bed as bed where (inpat.pasEvent.location.id = :idWard and bed is not null) order by bed.bay asc, inpat.pasEvent.patient.name.upperSurname asc,inpat.pasEvent.patient.name.upperForename asc"; List inpatEpis = getDomainFactory().find(hql, new String[]{"idWard"}, new Object[]{ward.getID_Location()}); return InpatientEpisodeLiteVoAssembler.createInpatientEpisodeLiteVoCollectionFromInpatientEpisode(inpatEpis); }
public InpatientEpisodeLiteVoCollection listWaitingAreaPatientsByWard(LocationRefVo ward) { if(ward == null || ward.getID_Location() == null) throw new CodingRuntimeException("ward is null or id not provided in method listWaitingAreaPatientsByWard"); String hql = "from InpatientEpisode inpat left join fetch inpat.bed as bedspace where inpat.pasEvent.location.id = :idWard and bedspace is null and (inpat.isOnHomeLeave is null or inpat.isOnHomeLeave = :bFalse) order by inpat.pasEvent.patient.name.upperSurname "; List inpatEpis = getDomainFactory().find(hql, new String[]{"idWard", "bFalse"}, new Object[]{ward.getID_Location(), Boolean.FALSE}); return InpatientEpisodeLiteVoAssembler.createInpatientEpisodeLiteVoCollectionFromInpatientEpisode(inpatEpis); }
private void populateInfantsToGrid(InpatientEpisodeLiteVoCollection voCollInpatient) { form.lyrDetail().tabInfants().grdInfants().getRows().clear(); if (voCollInpatient == null) return; if (voCollInpatient != null && voCollInpatient.size() > 0) { for (InpatientEpisodeLiteVo voInpat : voCollInpatient) { grdInfantsRow row = form.lyrDetail().tabInfants().grdInfants().getRows().newRow(); if(voInpat.getPasEventIsNotNull() && voInpat.getPasEvent().getLocationIsNotNull()) row.setColLocation(voInpat.getPasEvent().getLocation().getName()); PatientLite_IdentifiersVo voPatient = (voInpat.getPasEventIsNotNull() && voInpat.getPasEvent().getPatientIsNotNull()) ? voInpat.getPasEvent().getPatient() : null; if (voPatient != null) { if (voPatient.getNameIsNotNull()) { row.setColForename(voPatient.getName().getForename()); row.setColSurname(voPatient.getName().getSurname()); } PatientId patId = voPatient.getDisplayId(); row.setColDisplayId(patId != null ? patId.getValue() : null); row.setColSex(voPatient.getSexIsNotNull() ? voPatient.getSex().toString() : null); row.setColDOB(voPatient.getDobIsNotNull() ? voPatient.getDob().toString() : null); } row.setValue(voInpat); } } }
private void populateInWaitingTabFromData() { form.getLocalContext().setRecordSelected(false); //load list of waiting area patients for ward form.getLocalContext().setAdmissionDetail(null); InpatientEpisodeLiteVoCollection voCollPatients = domain.listWaitingAreaPatientsByWard(form.getGlobalContext().Core.getADTWard()); populateInWaitingGridFromData(voCollPatients); form.fireCustomControlValueChanged(); }
public InpatientEpisodeLiteVoCollection listHomeLeavesByWard(LocationRefVo ward) { if(ward == null || ward.getID_Location() == null) throw new CodingRuntimeException("ward is null or id not provide in method listInpatientEpisodeByWard"); String hql = getHomeLeavesQuery(false, true);// WDEV-14563 List<?> inpatEpis = getDomainFactory().find(hql, new String[]{"idWard", "bTRUE","idWard2", "status"}, new Object[]{ward.getID_Location(), Boolean.TRUE, ward.getID_Location(),getDomLookup(TransferStatus.PENDING) }); return InpatientEpisodeLiteVoAssembler.createInpatientEpisodeLiteVoCollectionFromInpatientEpisode(inpatEpis); }
public InpatientEpisodeLiteVoCollection listWaitingAreaPatientsByWard(LocationRefVo ward) { if(ward == null || ward.getID_Location() == null) throw new CodingRuntimeException("ward is null or id not provided in method listWaitingAreaPatientsByWard"); String hql = "from InpatientEpisode inpat left join fetch inpat.bed as bedspace where inpat.pasEvent.location.id = :idWard and bedspace is null and (inpat.isOnHomeLeave is null or inpat.isOnHomeLeave = :bFalse) and (inpat.isReadyToLeave is null or inpat.isReadyToLeave = :bFalse) and inpat.id not in (select inp.id from PendingTransfers pt left join pt.inpatientEpisode as inp where inp.pasEvent.location.id = :idWard) order by inpat.pasEvent.patient.name.upperSurname "; List<?> inpatEpis = getDomainFactory().find(hql, new String[]{"idWard", "bFalse"}, new Object[]{ward.getID_Location(), Boolean.FALSE}); return InpatientEpisodeLiteVoAssembler.createInpatientEpisodeLiteVoCollectionFromInpatientEpisode(inpatEpis); }
private void fillGridFromHomeLeaveANDInpatRecords() { InpatientEpisodeLiteVoCollection voCollHL = form.getLocalContext().getOnHomeLeave(); for (int i=0; i < voCollHL.size() ; i++ ) { InpatientEpisodeLiteVo voHLInpatEpis = voCollHL.get(i); grdInpatientsRow row = form.grdInpatients().getRows().newRow(); PatientShort voPatient = voHLInpatEpis.getPasEvent().getPatient(); if(voPatient != null) { if(voPatient.getNameIsNotNull()) { row.setColForename(voPatient.getName().getForename()); row.setColSurname(voPatient.getName().getSurname()); } PatientId patId = voPatient.getDisplayId(); row.setColDisplayId(patId != null ? patId.getValue() : null); Integer age = voPatient.calculateAge(); if(age != null) row.setColAge(String.valueOf(age)); if(voPatient.getHasActiveAlertsIsNotNull() && voPatient.getHasActiveAlerts()) //wdev-11083 row.setColAlert(form.getImages().Core.Alert16); //WDEV-18011 row.setColInfant(calculateInfants(voPatient)); } //wdev-14784 if( voHLInpatEpis != null && voHLInpatEpis.getVTEAssessmentStatusIsNotNull() && ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true ) //wdev-15062 { row.setColVTEStatus(VTEAsessmentStatus.REQUIRED.equals(voHLInpatEpis.getVTEAssessmentStatus()) ? form.getImages().OCRR.Requested : (VTEAsessmentStatus.INPROGRESS.equals(voHLInpatEpis.getVTEAssessmentStatus()) ? form.getImages().OCRR.InProgress : null)); } else { row.setColVTEStatus(null); } //---------- row.setColBay(""); row.setColBedNumber("(H)"); row.setColPasEventHidden(voHLInpatEpis.getPasEvent()); row.setTooltip(buildRowTooltip(voHLInpatEpis.getPasEvent(),voHLInpatEpis)); //wdev-14784 row.setValue(voHLInpatEpis.getPasEvent().getPatient()); } fillFromInpatRecords(); form.grdInpatients().sort(0); }