private void populateAdviceLeaflets(AdviceLeafletConfigDisplayVoCollection adviceLeaflets) { // Clear advice leaflet grid form.lyrAdviceMobility().tabAdvice().grdAdviceLeflet().getRows().clear(); // Check advice collection parameter if (adviceLeaflets == null) return; for (AdviceLeafletConfigDisplayVo advice : adviceLeaflets) { ims.emergency.forms.dischargeplanning_advicemobilityequipment.GenForm.lyrAdviceMobilityLayer.tabAdviceContainer.grdAdviceLefletRow row = form.lyrAdviceMobility().tabAdvice().grdAdviceLeflet().getRows().newRow(); row.setColAdvice(advice.getTemplate().getName()); row.setColSelect(false); row.setColumnGiven(isAdiceLeafletsPrinted(advice,form.getLocalContext().getRecord(),row)); row.setValue(advice); } }
/** * Function used to populate the Advice Leaflets */ private void populateAdviceLeaflets(AdviceLeafletConfigDisplayVoCollection adviceLeaflets) { // Clear advice leaflet grid form.grdAdviceLeflet().getRows().clear(); // Check advice collection parameter if (adviceLeaflets == null) return; for (AdviceLeafletConfigDisplayVo advice : adviceLeaflets) { grdAdviceLefletRow row = form.grdAdviceLeflet().getRows().newRow(); row.setColAdvice(advice.getTemplate().getName()); row.setColSelect(false); row.setValue(advice); } }
public AdviceLeafletConfigDisplayVoCollection getAdviceLeaflets(ClinicalProblemRefVo clinicalProblem) { StringBuilder query = new StringBuilder(); query.append("SELECT advice FROM AdviceLeafletsConfig AS advice LEFT JOIN advice.problems AS problem "); query.append("LEFT JOIN advice.template AS template "); query.append("WHERE advice.isGenericAdviceLeaflet = 1 "); if (clinicalProblem != null && clinicalProblem.getID_ClinicalProblem() != null) { query.append("OR problem.id = ").append(clinicalProblem.getID_ClinicalProblem()); } query.append(" ORDER BY UPPER(template.name) ASC "); return AdviceLeafletConfigDisplayVoAssembler.createAdviceLeafletConfigDisplayVoCollectionFromAdviceLeafletsConfig(getDomainFactory().find(query.toString())); }
private void printSelectedAdviceLeaflets() { try { // Get selected advice leaflets AdviceLeafletConfigDisplayVoCollection selectedAdviceLeaflets = new AdviceLeafletConfigDisplayVoCollection(); for (int i = 0; i < form.grdAdviceLeflet().getRows().size(); i++) { grdAdviceLefletRow adviceRow = form.grdAdviceLeflet().getRows().get(i); if (adviceRow.getColSelect()) selectedAdviceLeaflets.add(adviceRow.getValue()); } // For each selected advice leaflet for (AdviceLeafletConfigDisplayVo adviceLeaflet : selectedAdviceLeaflets) { // Get Report and Template from database String report[] = domain.getReportAndTemplate(adviceLeaflet.getTemplate()); // Check for valid report and template if (report == null) { engine.showMessage("No report found for selected advice leaflet"); return; } // Create a query builder client instance QueryBuilderClient client = new QueryBuilderClient(ConfigFlag.GEN.QUERY_SERVER_URL.getValue(), engine.getSessionId()); // Attempt to build report and print it to printer String printerName = form.getGlobalContext().Admin.getSelectedPrinter() != null ? form.getGlobalContext().Admin.getSelectedPrinter().getIPrinterName() : null; client.buildReport(report[0], report[1], ConfigFlag.GEN.REPORT_SERVER_URL.getValue(), "PDF", printerName, 1); } } catch (QueryBuilderClientException exception) { exception.printStackTrace(); } }
private AdviceLeafletConfigDisplayVoCollection getPrePrintedAdvLeafletsMarkedAsGiven() { // Get selected PrePrintedAdviceLeaflets AdviceLeafletConfigDisplayVoCollection selectedAdviceLeaflets = new AdviceLeafletConfigDisplayVoCollection(); for (int i = 0; i < form.lyrAdviceMobility().tabAdvice().grdAdviceLeflet().getRows().size(); i++) { ims.emergency.forms.dischargeplanning_advicemobilityequipment.GenForm.lyrAdviceMobilityLayer.tabAdviceContainer.grdAdviceLefletRow adviceRow = form.lyrAdviceMobility().tabAdvice().grdAdviceLeflet().getRows().get(i); if (adviceRow.getColumnGiven()) selectedAdviceLeaflets.add(adviceRow.getValue()); } return selectedAdviceLeaflets; }
private void populateAdviceLeaflets(AdviceLeafletConfigDisplayVoCollection adviceLeaflets) { // Clear advice leaflet grid form.lyrAdviceMobility().tabAdvice().grdAdviceLeflet().getRows().clear(); // Check advice collection parameter if (adviceLeaflets == null) return; adviceLeaflets.sort(new AdviceLeafletComparator(SortOrder.ASCENDING)); //WDEV-20437 for (AdviceLeafletConfigDisplayVo advice : adviceLeaflets) { ims.emergency.forms.dischargeplanning_advicemobilityequipment.GenForm.lyrAdviceMobilityLayer.tabAdviceContainer.grdAdviceLefletRow row = form.lyrAdviceMobility().tabAdvice().grdAdviceLeflet().getRows().newRow(); row.setColAdvice(advice.getTemplate()!=null ? advice.getTemplate().getName() : advice.getAdviceLeafletName()); //WDEV-20437 row.setCellColAdviceTooltip(advice.getTemplate()!=null ? advice.getTemplate().getName() : advice.getAdviceLeafletName()); //WDEV-20437 row.setColSelect(false); //WDEV-20437 if (advice.getTemplate()!=null) { row.setColumnGiven(isAdiceLeafletsPrinted(advice,form.getLocalContext().getRecord(),row)); row.setColumnGivenReadOnly(true); } else { boolean isPrePrintedGiven = isPrePrintedAdviceLeafletGiven(advice,form.getLocalContext().getRecord(),row); row.setColumnGiven(isPrePrintedGiven); row.setColumnGivenReadOnly(isPrePrintedGiven); } if (advice.getTemplate()==null) //WDEV-20437 { row.setCellColSelectTooltip("This is Pre-Printed Advice Leaflet and cannot be printed. "); row.setColSelectReadOnly(true); } row.setValue(advice); } }