private void populateCareSpellRows(CareSpellVoCollection voCollCareSpells) { DynamicGridRow careSpellRow; for (int i = 0; i < voCollCareSpells.size(); i++) { careSpellRow = form.dyngrdList().getRows().newRow(); CareSpellVo careSpellVo = voCollCareSpells.get(i); setStartDateEndDateAndTooltip(careSpellRow, careSpellVo); careSpellRow.setCollapsedImage(form.getImages().Core.CareSpell); careSpellRow.setExpandedImage(form.getImages().Core.CareSpell); careSpellRow.setBackColor(Color.Bisque); careSpellRow.setBold(true); careSpellRow.setValue(careSpellVo); //cellCareSpell.setColumnHistoryEmpty(true); // wdev-13896 // wdev-13977 if (voCollCareSpells.get(i).getCurrentStatusIsNotNull() && voCollCareSpells.get(i).getCurrentStatus().getStatusIsNotNull() && voCollCareSpells.get(i).getCurrentStatus().getStatus().equals(ProblemGroupStatus.CANCELLED)) careSpellRow.setBackColor(ConfigFlag.UI.DISPLAY_COLOUR_FOR_CANCELLED_PROBLEM_GROUPS.getValue()); // ------- if (careSpellVo.getEndDateIsNotNull()) form.getLocalContext().setParentEnded(Boolean.TRUE); boolean bCollapseAll = populateEpisodeOfCareRows(careSpellVo.getEpisodes().sort(), careSpellRow); careSpellRow.setExpanded(!bCollapseAll); } }
protected boolean checkIfCareSpellCanBeCancelled(CareSpellVo careSpell) { boolean CareSpellItem = false; if (careSpell == null) return CareSpellItem; if (careSpell.getCurrentStatus() == null || ProblemGroupStatus.OPEN.equals(careSpell.getCurrentStatus().getStatus()))// WDEV-14910 { CareSpellItem = true; for (int i = 0; careSpell.getEpisodesIsNotNull() && i < careSpell.getEpisodes().size(); i++) { if (checkIfEpisodeOfCaresAreNotOpened(careSpell.getEpisodes().get(i)) == false) CareSpellItem = false; } } return CareSpellItem; }
protected boolean checkIfCareSpellCanBeCancelled(CareSpellVo careSpell) { boolean CareSpellItem = false; if( careSpell == null ) return CareSpellItem; if(careSpell.getCurrentStatus() == null || ProblemGroupStatus.OPEN.equals(careSpell.getCurrentStatus().getStatus()))// WDEV-14910 { CareSpellItem = true; for(int i = 0; careSpell.getEpisodesIsNotNull() && i < careSpell.getEpisodes().size();i++) { if( checkIfEpisodeOfCaresAreNotOpened(careSpell.getEpisodes().get(i)) == false) CareSpellItem = false; } } return CareSpellItem; }
/** * Function used to create the CareSpell for admission * @param patient * @param startDateTime * @return */ private CareSpellAdmitVo createCareSpell(PatientRefVo patient, DateTime startDateTime) { CareSpellAdmitVo careSpell = new CareSpellAdmitVo(); careSpell.setPatient(patient); careSpell.setStartDate(startDateTime.getDate()); careSpell.setEndDate(null); CareSpellStatusHistoryVo firstStatus = new CareSpellStatusHistoryVo(); firstStatus.setStatus(ProblemGroupStatus.OPEN); firstStatus.setStatusDateTime(startDateTime); careSpell.setCurrentStatus(firstStatus); careSpell.setStatusHistory(new CareSpellStatusHistoryVoCollection()); careSpell.getStatusHistory().add(firstStatus); return careSpell; }
private CareSpellRepatriationVo createCareSpell(PatientRefVo patient, PasEventRepatriationVo pasEvent, DateTime startDateTime, HcpLiteVo hcp, LocationRefVo location, ServiceLiteVo service, SourceOfReferral sourceOfReferral) { CareSpellRepatriationVo careSpell = new CareSpellRepatriationVo(); careSpell.setPatient(patient); careSpell.setStartDate(startDateTime.getDate()); careSpell.setEndDate(null); CareSpellStatusHistoryVo firstStatus = new CareSpellStatusHistoryVo(); firstStatus.setStatus(ProblemGroupStatus.OPEN); firstStatus.setStatusDateTime(startDateTime); careSpell.setCurrentStatus(firstStatus); careSpell.setStatusHistory(new CareSpellStatusHistoryVoCollection()); careSpell.getStatusHistory().add(firstStatus); careSpell.setEpisodes(new EpisodeOfCareRepatriationVoCollection()); careSpell.getEpisodes().add(createEpisodeOfCare(patient, careSpell, pasEvent, startDateTime, hcp, location, service, sourceOfReferral)); return careSpell; }
private boolean parentCancelled() { Object selectedValue = form.dyngrdList().getValue(); if (selectedValue instanceof EpisodeofCareVo) { CareSpellVo careSpell = (CareSpellVo) form.dyngrdList().getSelectedRow().getParent().getValue(); if (careSpell.getCurrentStatus() != null && ProblemGroupStatus.CANCELLED.equals(careSpell.getCurrentStatus().getStatus())) return true; } if (selectedValue instanceof CareContextVo) { EpisodeofCareVo episodeOfCare = (EpisodeofCareVo) form.dyngrdList().getSelectedRow().getParent().getValue(); if (episodeOfCare.getCurrentStatus() != null && EpisodeOfCareStatus.CANCELLED.equals(episodeOfCare.getCurrentStatus().getStatus())) return true; } if (selectedValue instanceof ClinicalContactShortVo) { CareContextVo careContext = (CareContextVo) form.dyngrdList().getSelectedRow().getParent().getValue(); if (careContext.getCurrentStatus() != null && CareContextStatus.CANCELLED.equals(careContext.getCurrentStatus().getStatus())) return true; } return false; }
private void populateCareSpellRows(CareSpellVoCollection voCollCareSpells) { grdListRow careSpellRow; for (int i = 0; i < voCollCareSpells.size(); i++) { careSpellRow = form.grdList().getRows().newRow(); CareSpellVo careSpellVo = voCollCareSpells.get(i); setStartDateEndDateAndTooltip(careSpellRow, careSpellVo); careSpellRow.setCollapsedImage(form.getImages().Core.CareSpell); careSpellRow.setExpandedImage(form.getImages().Core.CareSpell); careSpellRow.setBackColor(Color.Bisque); careSpellRow.setBold(true); careSpellRow.setValue(careSpellVo); careSpellRow.setColumnHistoryEmpty(true); //wdev-13896 //wdev-13977 if(voCollCareSpells.get(i).getCurrentStatusIsNotNull() && voCollCareSpells.get(i).getCurrentStatus().getStatusIsNotNull() && voCollCareSpells.get(i).getCurrentStatus().getStatus().equals(ProblemGroupStatus.CANCELLED)) careSpellRow.setBackColor(ConfigFlag.UI.DISPLAY_COLOUR_FOR_CANCELLED_PROBLEM_GROUPS.getValue()); //------- if (careSpellVo.getEndDateIsNotNull()) form.getLocalContext().setParentEnded(Boolean.TRUE); boolean bCollapseAll = populateEpisodeOfCareRows(careSpellVo.getEpisodes().sort(), careSpellRow); careSpellRow.setExpanded(!bCollapseAll); } }
private void updateContextMenuState() { form.getContextMenus().getClinicalContactsListViewCancelledContextsItem().setVisible(!ConfigFlag.UI.PATIENT_SUMMARY_SHOW_CANCELLED_CONTEXTS_BY_DEFAULT.getValue()); //wdev-13977 -> modified in WDEV-14909 form.getContextMenus().getClinicalContactsListHideCancelledContextsItem().setVisible(ConfigFlag.UI.PATIENT_SUMMARY_SHOW_CANCELLED_CONTEXTS_BY_DEFAULT.getValue()); // WDEV-14909 boolean isProblemGroupSelected = form.grdList().getSelectedRow() != null && form.grdList().getSelectedRow().getValue() instanceof CareSpellVo; boolean isProblemGroupCancelled = isProblemGroupSelected && ((CareSpellVo) form.grdList().getSelectedRow().getValue()).getCurrentStatus() != null && ProblemGroupStatus.CANCELLED.equals(((CareSpellVo) form.grdList().getSelectedRow().getValue()).getCurrentStatus().getStatus()); form.getContextMenus().getClinicalContactsListUndoCancelProblemGroupItem().setVisible(isProblemGroupSelected && isProblemGroupCancelled); boolean isEpisodeOfCareSelected = form.grdList().getSelectedRow() != null && form.grdList().getSelectedRow().getValue() instanceof EpisodeofCareVo; boolean isEpisodeOfCareCancelled = isEpisodeOfCareSelected && ((EpisodeofCareVo) form.grdList().getSelectedRow().getValue()).getCurrentStatus() != null && EpisodeOfCareStatus.CANCELLED.equals(((EpisodeofCareVo) form.grdList().getSelectedRow().getValue()).getCurrentStatus().getStatus()); form.getContextMenus().getClinicalContactsListUndoCancelEpisodeOfCareItem().setVisible(isEpisodeOfCareSelected && isEpisodeOfCareCancelled && !parentCancelled()); boolean isCareContextSelected = form.grdList().getSelectedRow() != null && form.grdList().getSelectedRow().getValue() instanceof CareContextVo; boolean isCareContextCancelled = isCareContextSelected && ((CareContextVo) form.grdList().getSelectedRow().getValue()).getCurrentStatus() != null && CareContextStatus.CANCELLED.equals(((CareContextVo) form.grdList().getSelectedRow().getValue()).getCurrentStatus().getStatus()); form.getContextMenus().getClinicalContactsListUndoCancelCareContextItem().setVisible(isCareContextSelected && isCareContextCancelled && !parentCancelled()); boolean isClinicalContactSelected = form.grdList().getSelectedRow() != null && form.grdList().getSelectedRow().getValue() instanceof ClinicalContactShortVo; boolean isClinicalContactCancelled = isClinicalContactSelected && ((ClinicalContactShortVo) form.grdList().getSelectedRow().getValue()).getCurrentStatus() != null && ClinicalContactStatus.CANCELLED.equals(((ClinicalContactShortVo) form.grdList().getSelectedRow().getValue()).getCurrentStatus().getStatus()); form.getContextMenus().getClinicalContactsListUndoCancelClinicalContactItem().setVisible(isClinicalContactSelected && isClinicalContactCancelled && !parentCancelled()); }
private boolean parentCancelled() { ValueObject selectedValue = form.grdList().getValue(); if (selectedValue instanceof EpisodeofCareVo) { CareSpellVo careSpell = (CareSpellVo) form.grdList().getSelectedRow().getParentRow().getValue(); if (careSpell.getCurrentStatus() != null && ProblemGroupStatus.CANCELLED.equals(careSpell.getCurrentStatus().getStatus())) return true; } if (selectedValue instanceof CareContextVo) { EpisodeofCareVo episodeOfCare = (EpisodeofCareVo) form.grdList().getSelectedRow().getParentRow().getValue(); if (episodeOfCare.getCurrentStatus() != null && EpisodeOfCareStatus.CANCELLED.equals(episodeOfCare.getCurrentStatus().getStatus())) return true; } if (selectedValue instanceof ClinicalContactShortVo) { CareContextVo careContext = (CareContextVo) form.grdList().getSelectedRow().getParentRow().getValue(); if (careContext.getCurrentStatus() != null && CareContextStatus.CANCELLED.equals(careContext.getCurrentStatus().getStatus())) return true; } return false; }
private CareSpellVo createCareSpellEpisodeCareContext(PatientShort patient, AdmissionDetailVo admission) { HcpLiteVo hcp = domain.getHcpFromIMos(form.ccConsultant().getValue()); BedSpaceStateLiteVo bedState = form.getGlobalContext().Core.getSelectedBedSpaceState(); CareSpellVo careSpell = new CareSpellVo(); careSpell.setStartDate(new Date()); careSpell.setEndDate(null); careSpell.setPatient(patient); EpisodeofCareVo episode = new EpisodeofCareVo(); episode.setCareSpell(careSpell); episode.setResponsibleHCP(hcp); episode.setSpecialty(form.cmbSpecialty().getValue()); episode.setRelationship(CareSpelltoEpisodeRelationship.PRIMARY); episode.setStartDate(new Date()); episode.setEndDate(null); CareContextVo careContext = new CareContextVo(); careContext.setPasEvent(null); careContext.setContext(ContextType.EMERGENCY_UNSCHEDULED); careContext.setEpisodeOfCare(episode); careContext.setOrderingHospital(null); careContext.setEstimatedDischargeDate(form.dteEstDischarge().getValue()); careContext.setStartDateTime(new DateTime()); careContext.setEndDateTime(null); careContext.setLocationType(null); careContext.setResponsibleHCP(hcp); careContext.setBedNumber((bedState != null && bedState.getBedSpace() != null) ? bedState.getBedSpace().getBedNumber() : null); careContext.setDischargeReason(null); careContext.setCareContextHistory(null); CareContextStatusHistoryVo contextStatus = new CareContextStatusHistoryVo(); contextStatus.setStatus(CareContextStatus.OPEN); contextStatus.setStatusDateTime(new DateTime()); careContext.setCurrentStatus(contextStatus); careContext.setStatusHistory(new CareContextStatusHistoryVoCollection()); careContext.getStatusHistory().add(contextStatus); episode.setCareContexts(new CareContextVoCollection()); episode.getCareContexts().add(careContext); episode.setLinkedReferrals(null); episode.setLinkedReferralsHistory(null); episode.setCurrentReferral(null); episode.setEpisodeOfCareHistory(null); EpisodeOfCareStatusHistoryVo episodeStatus = new EpisodeOfCareStatusHistoryVo(); episodeStatus.setStatus(EpisodeOfCareStatus.OPEN); episodeStatus.setStatusDateTime(new DateTime()); episode.setCurrentStatus(episodeStatus); episode.setStatusHistory(new EpisodeOfCareStatusHistoryVoCollection()); episode.getStatusHistory().add(episodeStatus); careSpell.setEpisodes(new EpisodeofCareVoCollection()); careSpell.getEpisodes().add(episode); CareSpellStatusHistoryVo careSpellStatus = new CareSpellStatusHistoryVo(); careSpellStatus.setStatus(ProblemGroupStatus.OPEN); careSpellStatus.setStatusDateTime(new DateTime()); careSpell.setCurrentStatus(careSpellStatus); careSpell.setStatusHistory(new CareSpellStatusHistoryVoCollection()); careSpell.getStatusHistory().add(careSpellStatus); return careSpell; }
private void updateContextMenuState() { form.getContextMenus().getClinicalContactsListViewCancelledContextsItem().setVisible(!ConfigFlag.UI.PATIENT_SUMMARY_SHOW_CANCELLED_CONTEXTS_BY_DEFAULT.getValue()); // wdev-13977 modified in WDEV-14909 form.getContextMenus().getClinicalContactsListHideCancelledContextsItem().setVisible(ConfigFlag.UI.PATIENT_SUMMARY_SHOW_CANCELLED_CONTEXTS_BY_DEFAULT.getValue()); // WDEV-14909 boolean isProblemGroupSelected = form.dyngrdList().getSelectedRow() != null && form.dyngrdList().getSelectedRow().getValue() instanceof CareSpellVo; boolean isProblemGroupCancelled = isProblemGroupSelected && ((CareSpellVo) form.dyngrdList().getSelectedRow().getValue()).getCurrentStatus() != null && ProblemGroupStatus.CANCELLED.equals(((CareSpellVo) form.dyngrdList().getSelectedRow().getValue()).getCurrentStatus().getStatus()); form.getContextMenus().getClinicalContactsListUndoCancelProblemGroupItem().setVisible(isProblemGroupSelected && isProblemGroupCancelled); boolean isEpisodeOfCareSelected = form.dyngrdList().getSelectedRow() != null && form.dyngrdList().getSelectedRow().getValue() instanceof EpisodeofCareVo; boolean isEpisodeOfCareCancelled = isEpisodeOfCareSelected && ((EpisodeofCareVo) form.dyngrdList().getSelectedRow().getValue()).getCurrentStatus() != null && EpisodeOfCareStatus.CANCELLED.equals(((EpisodeofCareVo) form.dyngrdList().getSelectedRow().getValue()).getCurrentStatus().getStatus()); form.getContextMenus().getClinicalContactsListUndoCancelEpisodeOfCareItem().setVisible(isEpisodeOfCareSelected && isEpisodeOfCareCancelled && !parentCancelled()); boolean isCareContextSelected = form.dyngrdList().getSelectedRow() != null && form.dyngrdList().getSelectedRow().getValue() instanceof CareContextVo; boolean isCareContextCancelled = isCareContextSelected && ((CareContextVo) form.dyngrdList().getSelectedRow().getValue()).getCurrentStatus() != null && CareContextStatus.CANCELLED.equals(((CareContextVo) form.dyngrdList().getSelectedRow().getValue()).getCurrentStatus().getStatus()); form.getContextMenus().getClinicalContactsListUndoCancelCareContextItem().setVisible(isCareContextSelected && isCareContextCancelled && !parentCancelled()); boolean isClinicalContactSelected = form.dyngrdList().getSelectedRow() != null && form.dyngrdList().getSelectedRow().getValue() instanceof ClinicalContactShortVo; boolean isClinicalContactCancelled = isClinicalContactSelected && ((ClinicalContactShortVo) form.dyngrdList().getSelectedRow().getValue()).getCurrentStatus() != null && ClinicalContactStatus.CANCELLED.equals(((ClinicalContactShortVo) form.dyngrdList().getSelectedRow().getValue()).getCurrentStatus().getStatus()); form.getContextMenus().getClinicalContactsListUndoCancelClinicalContactItem().setVisible(isClinicalContactSelected && isClinicalContactCancelled && !parentCancelled()); }