private void addGpRow(GpLiteVo gp, DynamicGridRow row) { if(gp == null) return; if(gp instanceof GPLiteWithPracticesVo) { GPLiteWithPracticesVo voGpWithPractice = (GPLiteWithPracticesVo)gp; DynamicGridRow gpRow = form.dynGrdGps().getRows().newRow(); gpRow.setSelectable(Boolean.TRUE); gpRow.setReadOnly(Boolean.TRUE); DynamicGridCell gpNmeCell = gpRow.getCells().newCell(getColumn(COL_GP_NAME), DynamicCellType.HTMLVIEW); gpNmeCell.setValue(voGpWithPractice.getName().toString() + (voGpWithPractice.getNationalCode() != null ? "<br/>" + voGpWithPractice.getNationalCode(): "")); //WDEV-18739 gpNmeCell.setTooltip("GP Name: " + voGpWithPractice.getName().toString() + "<br/>"+ (voGpWithPractice.getNationalCode() != null ? "National GP Code: " + voGpWithPractice.getNationalCode(): "")); gpRow.setValue(gp); gpRow.setIdentifier((GpRefVo)gp); populatePracticesInGrid (voGpWithPractice,gpRow); } }
private void filterPracticesForAddress(GPSearchCriteriaVo filter,GPLiteWithPracticesVo gpWithPractices) //WDEV-18377 { if (gpWithPractices ==null || gpWithPractices.getPractices() == null) return; if (!ConfigFlag.DOM.GP_USE_SURGERIES.getValue()) { for (int k=gpWithPractices.getPractices().size()-1;k>=0;k--) { if (gpWithPractices.getPractices().get(k) ==null || gpWithPractices.getPractices().get(k).getPractice() == null) continue; if (!isPracticeValidforAddress(filter, gpWithPractices.getPractices().get(k).getPractice())) { gpWithPractices.getPractices().remove(k); } } } }
public GPLiteWithPracticesVo listGPS(GpRefVo filter) { DomainFactory factory = getDomainFactory(); Gp doGP = (Gp) factory.getDomainObject(Gp.class, filter.getID_Gp()); return GPLiteWithPracticesVoAssembler.create(doGP); }
public void setValue(GpRefVo value) { GPLiteWithPracticesVo voGpLite = null; if (value != null) voGpLite = domain.getGpLite(value); setValueInGrid(voGpLite); }
private void populateGpRow(GpLiteVo voLiteVo, GenForm.grdGpsRow row) { if(voLiteVo == null) return; row.setGpName(voLiteVo.getNameIsNotNull()?voLiteVo.getName().toString():""); String strDisplay = ""; if(voLiteVo instanceof GPLiteWithPracticesVo) { GPLiteWithPracticesVo voGpWithPractice = (GPLiteWithPracticesVo)voLiteVo; if(voGpWithPractice.getPracticesIsNotNull() && voGpWithPractice.getPractices().size() > 0) { int count = 0; for(GpLiteToPracticeLiteVo voGpToPractice : voGpWithPractice.getPractices()) { if(voGpToPractice.getPracticeIsNotNull()) { count++; strDisplay += voGpToPractice.getPractice().getName(); strDisplay += count < (voGpWithPractice.getPractices().size()) ? "," : ""; } } } } row.setColPractice(strDisplay); row.setTooltipForColPractice(strDisplay); row.setNatCode(voLiteVo.getNationalCode()); row.setValue(voLiteVo); }
public GPLiteWithPracticesVo getGpLite(GpRefVo gpRefVo) { if(gpRefVo == null) throw new CodingRuntimeException("Cannot get GpLiteVo for null GpRefVo"); Gp doGp = (Gp)getDomainFactory().getDomainObject(Gp.class, gpRefVo.getID_Gp()); return GPLiteWithPracticesVoAssembler.create(doGp); }
private void populateSurgeriesInGrid(GPLiteWithPracticesVo voGpWithPractice, GpPracticeLiteVo gppractice, DynamicGridRow row) { String gMCCode = null; if (voGpWithPractice != null) { if(voGpWithPractice.getCodeMappingsIsNotNull()) { gMCCode = voGpWithPractice.getCodeMappings().getMappingValue(TaxonomyType.NAT_GP_CODE); } } if (gppractice.getSurgeries() != null && gppractice.getSurgeries().size() > 0) { LocSiteShortVoCollection heartsSurgeries = getHeartsSurgery(gppractice.getSurgeries(), gMCCode); if (heartsSurgeries != null && heartsSurgeries.size() > 0) { populateSurgeriesFromCollection(voGpWithPractice, gppractice, row, heartsSurgeries); } else { populateSurgeriesFromCollection(voGpWithPractice, gppractice, row, gppractice.getSurgeries()); } } }
private void populateSurgeriesFromCollection(GPLiteWithPracticesVo voGpWithPractice, GpPracticeLiteVo gppractice, DynamicGridRow row, LocSiteShortVoCollection surgeries) { for (LocSiteShortVo surgery : surgeries) { if (surgery == null || (surgery != null && !(Boolean.TRUE.equals(surgery.getIsActive())))) continue; addSurgeryRow(voGpWithPractice, gppractice, row, surgery); row = null; } }
private GPLiteWithPracticesVoCollection filterGpsForGMCNumberAndPasCode(GPLiteWithPracticesVoCollection gpColl) { if (gpColl == null || gpColl.size() == 0) return null; String gMCCode = null; GPLiteWithPracticesVoCollection filteredGps = new GPLiteWithPracticesVoCollection(); for (int i=0;i<gpColl.size();i++) { GPLiteWithPracticesVo voGpWithPractice = gpColl.get(i); if (voGpWithPractice != null) { if(voGpWithPractice.getCodeMappingsIsNotNull()) { gMCCode = voGpWithPractice.getCodeMappings().getMappingValue(TaxonomyType.NAT_GP_CODE); } GpLiteToPracticeLiteVoCollection voPractices = voGpWithPractice.getPractices(); for (int j=0;j<voPractices.size();j++) { GpLiteToPracticeLiteVo practiceWithSurg = voPractices.get(j); if (practiceWithSurg != null && practiceWithSurg.getPracticeIsNotNull() && practiceWithSurg.getPractice().getSurgeries() != null && practiceWithSurg.getPractice().getSurgeries().size() > 0) { LocSiteShortVoCollection heartsSurgeries = getHeartsSurgery(practiceWithSurg.getPractice().getSurgeries(), gMCCode); if (heartsSurgeries != null && heartsSurgeries.size() > 0) filteredGps.add(voGpWithPractice); } } } } return filteredGps; }
private void getAndListDetails(GpLiteVo gpLite) { //populate a minimal vo from the database GPLiteWithPracticesVo voGp = domain.listGPS(gpLite); populateGPPracticeParents(voGp); }
private void populateGPPracticeParents(GPLiteWithPracticesVo voGp) { clear(); String gMCCode=null; if (voGp != null) { if(voGp.getCodeMappingsIsNotNull()) { gMCCode=voGp.getCodeMappings().getMappingValue(TaxonomyType.NAT_GP_CODE); } if (voGp.getPractices() == null || voGp.getPractices().size() <= 0) { engine.showMessage("The GP has no associated practices."); return; } // populate the gp's practices on the tree for (int j = 0; j < voGp.getPractices().size(); j++) { GpPracticeLiteVo practice = voGp.getPractices().get(j).getPractice(); if (practice != null && practice.getIsActiveIsNotNull() && practice.getIsActive().equals(Boolean.TRUE)) { TreeNode node = form.trePracticesSurgeries().getNodes().add(practice, practice.getName() + displayPracticeAddress(practice.getAddress()), j + 1); if (ConfigFlag.DOM.GP_USE_SURGERIES.getValue()) // only list surgeries if config flag allows { node.setEnabled(false); populateSurgeryChildren(practice, node,gMCCode); } else { node.setEnabled(true); } } } form.trePracticesSurgeries().collapseAll(); } }
private void populatePracticesInGrid(GPLiteWithPracticesVo voGpWithPractice, DynamicGridRow gpRow) { if (voGpWithPractice.getPracticesIsNotNull() && voGpWithPractice.getPractices().size() > 0) { for (int i=0; i < voGpWithPractice.getPractices().size();i++) { if (voGpWithPractice.getPractices().get(i) == null) continue; if (voGpWithPractice.getPractices().get(i) != null && voGpWithPractice.getPractices().get(i).getPractice() != null) { if ((ConfigFlag.DOM.GP_USE_SURGERIES.getValue() && !hasActiveSurgeries(voGpWithPractice.getPractices().get(i).getPractice())) || !Boolean.TRUE.equals(voGpWithPractice.getPractices().get(i).getPractice().getIsActive())) continue; if (gpRow == null) { gpRow = form.dynGrdGps().getRows().newRow(); if (getColumn(COL_GP_NAME) != null) { DynamicGridCell gpNameCell = gpRow.getCells().newCell(getColumn(COL_GP_NAME), DynamicCellType.HTMLVIEW); String gpNameFormatted = "GP Name: " + voGpWithPractice.getName().toString() + "<br/>"+ (voGpWithPractice.getNationalCode() != null ? "National GP Code: " + voGpWithPractice.getNationalCode(): ""); gpNameCell.setValue(voGpWithPractice.getName().toString() + (voGpWithPractice.getNationalCode() != null ? "<br/>" + voGpWithPractice.getNationalCode(): "")); //WDEV-18739 gpNameCell.setTooltip(gpNameFormatted); } } if (getColumn(COL_GP_PRACTICE_CODE) != null) { DynamicGridCell gpPracticeCodeCell = gpRow.getCells().newCell(getColumn(COL_GP_PRACTICE_CODE), DynamicCellType.HTMLVIEW); String practiceCodeFormatted = voGpWithPractice.getPractices().get(i).getPractice().getNationalCode() != null ? voGpWithPractice.getPractices().get(i).getPractice().getNationalCode() :"" ; gpPracticeCodeCell.setValue(practiceCodeFormatted); gpPracticeCodeCell.setTooltip(practiceCodeFormatted); } if (getColumn(COL_PRACTICE_ADDR) != null) { DynamicGridCell practiceAddrCell = gpRow.getCells().newCell(getColumn(COL_PRACTICE_ADDR), DynamicCellType.HTMLVIEW); practiceAddrCell.setValue(buildPracticeDisplayData(voGpWithPractice.getPractices().get(i).getPractice(), false)); practiceAddrCell.setTooltip(buildPracticeDisplayData(voGpWithPractice.getPractices().get(i).getPractice(), true)); } gpRow.setSelectable(Boolean.TRUE); gpRow.setReadOnly(Boolean.TRUE); gpRow.setValue(voGpWithPractice.getPractices().get(i)); gpRow.setIdentifier((GpRefVo)voGpWithPractice); if (ConfigFlag.DOM.GP_USE_SURGERIES.getValue()) { populateSurgeriesInGrid(voGpWithPractice, voGpWithPractice.getPractices().get(i).getPractice(), gpRow); } gpRow = null; } } } }
private void addSurgeryRow(GPLiteWithPracticesVo voGpWithPractice,GpPracticeLiteVo gppractice, DynamicGridRow row, LocSiteShortVo surg) { if (row == null) { row = form.dynGrdGps().getRows().newRow(); if (getColumn(COL_GP_NAME) != null) { DynamicGridCell gpNameCell = row.getCells().newCell(getColumn(COL_GP_NAME), DynamicCellType.HTMLVIEW); String gpNameFormatted = "GP Name: " + voGpWithPractice.getName().toString() + "<br/>"+ (voGpWithPractice.getNationalCode() != null ? "National GP Code: " + voGpWithPractice.getNationalCode(): ""); //WDEV-18739 gpNameCell.setValue(voGpWithPractice.getName().toString() + (voGpWithPractice.getNationalCode() != null ? "<br/>" + voGpWithPractice.getNationalCode(): "")); //WDEV-18739 gpNameCell.setTooltip(gpNameFormatted); } if (getColumn(COL_GP_PRACTICE_CODE) != null) { DynamicGridCell gpCodeCell = row.getCells().newCell(getColumn(COL_GP_PRACTICE_CODE), DynamicCellType.HTMLVIEW); String practiceCodeFormatted = gppractice.getNationalCode() != null ? gppractice.getNationalCode() :"" ; gpCodeCell.setValue(practiceCodeFormatted); gpCodeCell.setTooltip(practiceCodeFormatted); } if (getColumn(COL_PRACTICE_ADDR) != null) { DynamicGridCell practAddressCell = row.getCells().newCell(getColumn(COL_PRACTICE_ADDR), DynamicCellType.HTMLVIEW); practAddressCell.setValue(buildPracticeDisplayData(gppractice, false)); practAddressCell.setTooltip(buildPracticeDisplayData(gppractice, true)); } } row.setReadOnly(Boolean.TRUE); if (getColumn(COL_SURGERY_ADDR) != null) { DynamicGridCell surgerycelladdr = row.getCells().newCell(getColumn(COL_SURGERY_ADDR), DynamicCellType.HTMLVIEW); surgerycelladdr.setValue(buildSurgeryDisplayData(surg,false)); surgerycelladdr.setTooltip(buildSurgeryDisplayData(surg,true)); } row.setIdentifier((GpRefVo)voGpWithPractice); row.setValue(surg); }
private GPLiteWithPracticesVoCollection getFilteredPracticesAndSurgeriesforAddress(GPSearchCriteriaVo filter,GPLiteWithPracticesVoCollection gpWithPractColl) //WDEV-18377 { for (int i=gpWithPractColl.size()-1; i>=0;i--) { if (gpWithPractColl.get(i) == null || gpWithPractColl.get(i).getPractices() == null) continue; if (!ConfigFlag.DOM.GP_USE_SURGERIES.getValue()) { filterPracticesForAddress(filter, gpWithPractColl.get(i)); } else { for (int x=gpWithPractColl.get(i).getPractices().size()-1; x>=0;x--) { if (gpWithPractColl.get(i).getPractices().get(x) ==null || gpWithPractColl.get(i).getPractices().get(x).getPractice() == null) continue; filterSurgeriesForAddress(filter,gpWithPractColl.get(i).getPractices().get(x).getPractice()); } Iterator<GpLiteToPracticeLiteVo> iteratorForPractices = gpWithPractColl.get(i).getPractices().iterator(); while (iteratorForPractices.hasNext()) { if (iteratorForPractices.next().getPractice().getSurgeries().size() == 0) { iteratorForPractices.remove(); } } } } Iterator<GPLiteWithPracticesVo> iteratorForGP = gpWithPractColl.iterator(); while (iteratorForGP.hasNext()) { if (iteratorForGP.next().getPractices().size() == 0) { iteratorForGP.remove(); } } return gpWithPractColl; }