private void populateGridAppointmentOutcomeConfig(boolean active) { AppointmentOutcomeConfigVoCollection collAppointmentOutcomeConfig = domain.listAppointmentsOutcomeConfig(null); for (int i=0;i<form.grdAppOutcomeConfig().getRows().size();i++) { AppointmentOutcomeConfigVo apptOutcomeConfig=null; if (form.grdAppOutcomeConfig().getRows().get(i).getValue() instanceof ApptOutcome) { apptOutcomeConfig=getApptOutcomeConfig((ApptOutcome)form.grdAppOutcomeConfig().getRows().get(i).getValue(),collAppointmentOutcomeConfig); } else if(form.grdAppOutcomeConfig().getRows().get(i).getValue() instanceof AppointmentOutcomeConfigVo) { apptOutcomeConfig=getApptOutcomeConfig(((AppointmentOutcomeConfigVo)form.grdAppOutcomeConfig().getRows().get(i).getValue()).getAppointmentOutcome(),collAppointmentOutcomeConfig); } if (apptOutcomeConfig!=null) { updateApptOutcomeConfigRow(form.grdAppOutcomeConfig().getRows().get(i),apptOutcomeConfig); } } form.grdAppOutcomeConfig().setValue(form.getLocalContext().getSelectedRecord()); populateInstanceControls(form.getLocalContext().getSelectedRecord()); }
private void bindAppointmentOutcomes(Status_Reason status) { AppointmentOutcomeConfigVoCollection appointmentOutcomes = domain.listAppointmentOutcomeByAppointmentStatus(status); form.cmbOutcome().clear(); if (appointmentOutcomes == null) { updateOutcomeSelection(null); return; } for (AppointmentOutcomeConfigVo outcome : appointmentOutcomes) { form.cmbOutcome().newRow(outcome.getAppointmentOutcome(), outcome.getAppointmentOutcome().getText()); } if (appointmentOutcomes.size() == 1) { form.cmbOutcome().setValue(appointmentOutcomes.get(0).getAppointmentOutcome()); updateOutcomeSelection(form.cmbOutcome().getValue()); } }
/** * Function used to populate the 'Appointment Outcomes' configured for the selected appointment status (DNA, Not Seen, Seen) * @param status * @param rttStatusPoint */ private void bindAppointmentOutcomes(Status_Reason status, RTTStatusPointRefVo rttStatusPoint) { // TEST: WDEV-20332 - Check if the appointment outcome values retrieved now correspond to the initial issue and configuration AppointmentOutcomeConfigVoCollection appointmentOutcomes = domain.listAppointmentOutcomeByAppointmentStatusAndRTTSTatus(status, rttStatusPoint); form.cmbOutcome().clear(); if (appointmentOutcomes == null) { updateOutcomeSelection(null); return; } for (AppointmentOutcomeConfigVo outcome : appointmentOutcomes) { form.cmbOutcome().newRow(outcome.getAppointmentOutcome(), outcome.getAppointmentOutcome().getText()); } if (appointmentOutcomes.size() == 1) { form.cmbOutcome().setValue(appointmentOutcomes.get(0).getAppointmentOutcome()); updateOutcomeSelection(form.cmbOutcome().getValue()); } }
public AppointmentOutcomeConfigVoCollection listAppointmentOutcomeByAppointmentStatus(Status_Reason status) { if (status == null || !(Status_Reason.DNA.equals(status) || Status_Reason.NOT_SEEN.equals(status) || Status_Reason.SEEN.equals(status))) return null; StringBuilder query = new StringBuilder("SELECT outcomeConfig FROM AppointmentOutcomeConfig AS outcomeConfig "); if (Status_Reason.DNA.equals(status)) query.append("WHERE outcomeConfig.usedForDNA = 1"); else if (Status_Reason.NOT_SEEN.equals(status)) query.append("WHERE outcomeConfig.usedForNotSeen = 1"); else if (Status_Reason.SEEN.equals(status)) query.append("WHERE outcomeConfig.usedForSeen = 1"); return AppointmentOutcomeConfigVoAssembler.createAppointmentOutcomeConfigVoCollectionFromAppointmentOutcomeConfig(getDomainFactory().find(query.toString())); }
private AppointmentOutcomeConfigVo getApptOutcomeConfig(ApptOutcome value, AppointmentOutcomeConfigVoCollection collAppointmentOutcomeConfig) { if (collAppointmentOutcomeConfig==null || collAppointmentOutcomeConfig.size()==0) return null; for (int i=0;i<collAppointmentOutcomeConfig.size();i++) { if (collAppointmentOutcomeConfig.get(i).getAppointmentOutcome().getID()==value.getID()) return collAppointmentOutcomeConfig.get(i); } return null; }
public AppointmentOutcomeConfigVoCollection listAppointmentsOutcomeConfig(Boolean active) { StringBuilder hqlBuilder = new StringBuilder("from AppointmentOutcomeConfig as appOutcomeConfig "); List <?> list = getDomainFactory().find(hqlBuilder.toString()); return AppointmentOutcomeConfigVoAssembler.createAppointmentOutcomeConfigVoCollectionFromAppointmentOutcomeConfig(list); }
/** * WDEV-20332 * List Appointment Outcomes based on current appointment status and current RTT status */ public AppointmentOutcomeConfigVoCollection listAppointmentOutcomeByAppointmentStatusAndRTTSTatus(Status_Reason status, RTTStatusPointRefVo rttStatusPoint) { if (status == null || !(Status_Reason.DNA.equals(status) || Status_Reason.NOT_SEEN.equals(status) || Status_Reason.SEEN.equals(status))) return null; ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); StringBuilder query = new StringBuilder("SELECT outcomeConfig FROM AppointmentOutcomeConfig AS outcomeConfig "); query.append(" LEFT JOIN outcomeConfig.appointmentOutcome AS appointmentOutcome "); if (Status_Reason.DNA.equals(status)) query.append("WHERE outcomeConfig.usedForDNA = 1"); else if (Status_Reason.NOT_SEEN.equals(status)) query.append("WHERE outcomeConfig.usedForNotSeen = 1"); else if (Status_Reason.SEEN.equals(status)) query.append("WHERE outcomeConfig.usedForSeen = 1"); query.append(" AND appointmentOutcome.active = 1 "); //WDEV-23584 if (rttStatusPoint != null && rttStatusPoint.getID_RTTStatusPoint() != null) { query.append(" AND appointmentOutcome.id IN ("); query.append("SELECT outcome.id "); query.append(" FROM RTTStatusPoint AS rtt "); query.append(" LEFT JOIN rtt.appointmentOutcomes AS outcomeRef "); query.append(" LEFT JOIN outcomeRef.instance AS outcome "); query.append(" WHERE rtt.id = :RTT_STATUS_POINT"); query.append(")"); paramNames.add("RTT_STATUS_POINT"); paramValues.add(rttStatusPoint.getID_RTTStatusPoint()); } return AppointmentOutcomeConfigVoAssembler.createAppointmentOutcomeConfigVoCollectionFromAppointmentOutcomeConfig(getDomainFactory().find(query.toString(), paramNames, paramValues)); }
public AppointmentOutcomeConfigVoCollection listAppointmentOutcomeByAppointmentStatus(Status_Reason status) { AppointmentOutcomeDialog impl = (AppointmentOutcomeDialog)getDomainImpl(AppointmentOutcomeDialogImpl.class); return impl.listAppointmentOutcomeByAppointmentStatus(status); }