protected void onRadioButtongroupFilterValueChanged() throws PresentationLogicException { // List the Observation Forms based on the filter selected ObservationFormCollection voFormsCommencedColl; ObservationForm voObserForm = new ObservationForm(); voObserForm.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); if (form.groupFilter().getValue().equals(GenForm.groupFilterEnumeration.rdoActive)) voObserForm.setIsStopped(Boolean.FALSE); else voObserForm.setIsStopped(null); voFormsCommencedColl = domain.listFormsCommencement(voObserForm); populateGrid(voFormsCommencedColl); }
protected void onRadioButtongroupFilterValueChanged() throws PresentationLogicException { // List the Observation Forms based on the filter selected ObservationFormCollection voFormsCommencedColl; ObservationForm voObserForm = new ObservationForm(); voObserForm.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); if (form.groupFilter().getValue().equals(groupFilterEnumeration.rdoActive)) voObserForm.setIsStopped(Boolean.FALSE); else voObserForm.setIsStopped(null); form.getGlobalContext().Nursing.setObservationFormsSearchCriteria(voObserForm); voFormsCommencedColl = domain.listFormsCommencement(voObserForm); populateGrid(voFormsCommencedColl); }
private void doSort(SortOrder sortOrder,String sortByField) throws PresentationLogicException { ObservationFormCollection values = form.gridForms().getValues(); values.sort(new CustomFieldObservationFormComparator(sortOrder,sortByField)); ObservationForm selectionSave = form.gridForms().getValue(); populateGrid(values); form.gridForms().setValue(selectionSave); if (selectionSave != null) { form.gridForms().setValue(selectionSave); onGridFormsSelectionChanged(); } }
@SuppressWarnings("unchecked") public int compare(ObservationForm o1, ObservationForm o2) { Comparable c1 = (Comparable) o1.getFieldValueByFieldName(fieldName); Comparable c2 = (Comparable) o2.getFieldValueByFieldName(fieldName); if (c1 == null) return -1*direction; if (c2 == null) return direction; return c1.compareTo(c2)*direction; }
private void open() { //setMode(false); ObservationForm formsCommenced = form.getGlobalContext().COE.getFormCommenced(); // Populate controls with record data populateInstanceControlsFromData(formsCommenced); // Set form to EDIT mode form.setMode(FormMode.EDIT); }
private boolean save() { try { ObservationForm formCommenced; if (form.getGlobalContext().COE.getFormCommenced() == null) formCommenced = populateDataFromInstanceControls(null); else formCommenced = populateDataFromInstanceControls((ObservationForm) form.getGlobalContext().COE.getFormCommenced().clone()); String[] errors = formCommenced.validate(validateUI()); if (errors != null) { engine.showErrors(errors); return false; } form.getGlobalContext().COE.setFormCommenced(domain.saveFormsCommenced(formCommenced)); return true; } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); return false; } }
/** * List Forms Commencement */ public ObservationFormCollection listFormsCommencement(ObservationForm voObservationForm) { ObservationFormCollection voCollObservationForm = new ObservationFormCollection(); if (voCollObservationForm == null) return voCollObservationForm; DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from ObservationForm t "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (voObservationForm.getCareContextIsNotNull()) { hql.append(andStr + " t.careContext.id = :cc"); markers.add("cc"); values.add(voObservationForm.getCareContext().getID_CareContext()); andStr = " and "; if (voObservationForm.getIsStoppedIsNotNull()) { hql.append(andStr + " t.isStopped = :stopped"); markers.add("stopped"); values.add(voObservationForm.getIsStopped()); andStr = " and "; } } if (andStr.equals(" and ")) query += " where "; query += hql.toString(); List procs = factory.find(query, markers, values); return ObservationFormAssembler.createObservationFormCollectionFromObservationForm(procs).sort(SortOrder.DESCENDING); }
private void populateGrid(ObservationFormCollection voObserFormColl) { form.bUpdate().setEnabled(false); form.gridForms().getRows().clear(); form.gridForms().setValue(null); if (voObserFormColl != null) { form.gridForms().getRows().clear(); //for RIE - WDEV-7160 form.getLocalContext().setSelectedRecord(null); // Fill in the grid if there is any data GenForm.gridFormsRow row; for (int i = 0; i < voObserFormColl.size(); i++) { row = form.gridForms().getRows().newRow(); ObservationForm observation = voObserFormColl.get(i); row.setValue(observation); row.setColDetails(observation.getDetails()); row.setTooltipForColDetails(observation.getDetails()); if (observation.getFormType() != null) { row.setColFormsCommenced(observation.getFormType().toString()); row.setTooltipForColFormsCommenced(observation.getFormType().toString()); } if (observation.getHCPStart() != null) { row.setColStartBy(observation.getHCPStart().getName().toString()); row.setTooltipForColStartBy(observation.getHCPStart().getName().toString()); } if (observation.getDateTimeStart() != null) row.setColStartDate(observation.getDateTimeStart().toString()); if (observation.getDateTimeStop() != null) row.setColStopDate(observation.getDateTimeStop().toString()); if (observation.getHCPStop() != null) { row.setColCompleteBy(observation.getHCPStop().getName().toString()); row.setTooltipForColCompleteBy(observation.getHCPStop().getName().toString()); } if (!observation.getIsStopped().booleanValue()) row.setColIsActive(form.getImages().Core.AnswerBox_Yes); else row.setColIsActive(form.getImages().Core.AnswerBox_No); } } }
private void populateInstanceControlsFromData(ObservationForm formsCommenced) { // Clear instance controls clearInstanceControls(); // Populate controls with default values if (formsCommenced == null) { form.dteStartDate().setValue(new Date()); form.tmeStartTime().setValue(new Time()); HcpLiteVo userHCP = (HcpLiteVo) domain.getHcpLiteUser(); if (userHCP != null) { form.qmbStartHCP().newRow(userHCP, userHCP.toString()); form.qmbStartHCP().setValue(userHCP); } return; } // Populate controls with data from record form.dteStartDate().setValue(formsCommenced.getDateTimeStart().getDate()); form.tmeStartTime().setValue(formsCommenced.getDateTimeStart().getTime()); if (formsCommenced.getHCPStart() != null) { form.qmbStartHCP().newRow(formsCommenced.getHCPStart(), formsCommenced.getHCPStart().toString()); form.qmbStartHCP().setValue(formsCommenced.getHCPStart()); } form.comboBoxForms().setValue(formsCommenced.getFormType()); form.textBoxDetails().setValue(formsCommenced.getDetails()); if (Boolean.TRUE.equals(formsCommenced.getIsStopped())) { form.checkBoxComplete().setValue(formsCommenced.getIsStopped()); form.dteStopDate().setValue(formsCommenced.getDateTimeStop().getDate()); form.tmeStopTime().setValue(formsCommenced.getDateTimeStop().getTime()); if (formsCommenced.getHCPStop() != null) { form.qmbStopHCP().newRow(formsCommenced.getHCPStop(), formsCommenced.getHCPStop().toString()); form.qmbStopHCP().setValue(formsCommenced.getHCPStop()); } } }
private void setSearchCriteria(ObservationForm observationFormsSearchCriteria) { form.groupFilter().setValue(Boolean.FALSE.equals(observationFormsSearchCriteria.getIsStopped()) ? groupFilterEnumeration.rdoActive : groupFilterEnumeration.rdoAll); }
private void open() { form.groupFilter().setValue(GenForm.groupFilterEnumeration.rdoActive); ObservationFormCollection voCollFormsCommenced; ObservationForm voObservationForm = new ObservationForm(); voObservationForm.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voObservationForm.setIsStopped(Boolean.FALSE); voCollFormsCommenced = domain.listFormsCommencement(voObservationForm); populateGrid(voCollFormsCommenced); }