@Override protected void onCcTrackingLookupValueChanged() throws PresentationLogicException { if(form.ccTrackingLookup().getValue() == null) return; AppointmentTrackingstatusColourConfigVo colorConfig = domain.getColorConfig(form.ccTrackingLookup().getValue()); form.getLocalContext().setCurrentRecord(colorConfig); if(colorConfig == null) populateScreenFromLookupInstVo(form.ccTrackingLookup().getValue()); else populateScreenFromColorConfig(colorConfig); updateControlsState(); }
private AppointmentTrackingstatusColourConfigVo getTrackingStatusColorConfigForAppointment(AppointmentTrackingstatusColourConfigVoCollection trackingStatusColorConfig, AppointmentForOutpatientClinicListManualCustomClassVo appointment) { if (appointment == null || appointment.getTrackingStatusID() == null) return null; if (trackingStatusColorConfig == null) return null; for (AppointmentTrackingstatusColourConfigVo configuration : trackingStatusColorConfig) { if (appointment.getTrackingStatusID().equals(configuration.getTrackingStatus().getId())) return configuration; } return null; }
private void populateScreenFromColorConfig(AppointmentTrackingstatusColourConfigVo colorConfig) { if(colorConfig == null || colorConfig.getTrackingStatus() == null) return; form.intId().setValue(colorConfig.getTrackingStatus().getID()); form.txtName().setValue(colorConfig.getTrackingStatus().getText()); form.cmbColor().setValue(colorConfig.getColour()); form.intIdleMinutes().setValue(colorConfig.getIdleTimeInMins()); form.cmbIdleColour().setValue(colorConfig.getIdleColour()); }
public AppointmentTrackingstatusColourConfigVo getTrackingColorConfig(LookupInstVo trackingStatus) { if(trackingStatus == null) throw new CodingRuntimeException("Can not get AppointmentTrackingColorConfigVo for null LookupInstVo."); DomainFactory factory = getDomainFactory(); return AppointmentTrackingstatusColourConfigVoAssembler.create((AppointmentTrackingstatusColourConfig) factory.findFirst("from AppointmentTrackingstatusColourConfig as atsc where atsc.trackingStatus.id = :statusLookup and atsc.isRIE is null", new String[] {"statusLookup"}, new Object[] {trackingStatus.getID()})); }