protected void onFormOpen() throws ims.framework.exceptions.PresentationLogicException { //Defaulting Authoring HCP and Date form.dteDate().setValue(new Date()); form.cmbDiscontinuedByType().setValue(MedciationCommencedDiscontinuedType.MOS); defaultHCP(); form.qmbHCP().setEnabled(true); if (form.getGlobalContext().Clinical.getDiscontinueMedicationReasonValuesIsNotNull()) { form.dteDate().setValue(form.getGlobalContext().Clinical.getDiscontinueMedicationReasonValues().getStoppedDate()); Hcp hcp = form.getGlobalContext().Clinical.getDiscontinueMedicationReasonValues().getStoppedHCP(); if(hcp!=null){ form.qmbHCP().newRow(hcp, hcp.toString()); form.qmbHCP().setValue(hcp); } form.cmbReasonDiscontinued().setValue(form.getGlobalContext().Clinical.getDiscontinueMedicationReasonValues().getStoppedReason()); form.txtReasonDesc().setValue(form.getGlobalContext().Clinical.getDiscontinueMedicationReasonValues().getStoppedReasonDesc()); } }
private void newMedicationInstance() { form.ctnDetails().setCollapsed(false); PatientMedicationVo voNewInstance = new PatientMedicationVo(); voNewInstance.setIsCopied(new Boolean(false)); voNewInstance.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voNewInstance.setPatient(form.getGlobalContext().Core.getPatientShort()); voNewInstance.setIsDiscontinued(Boolean.FALSE); // WDEV-13309 form.getLocalContext().setSelectedInstance(voNewInstance); clearInstanceControls(); setDefaultInstanceControls(); form.setMode(FormMode.EDIT); displayOrHideEnableDisableScreenSpecificControls(); allowEditingInstanceControls(true); //Defaulting Authoring HCP and Date form.ctnDetails().dteCommenced().setValue(new Date()); form.ctnDetails().cmbCommencedBy().setValue(MedciationCommencedDiscontinuedType.MOS); Hcp hcp = (Hcp) domain.getHcpUser(); if(hcp != null) { form.ctnDetails().qmbCommencedBy().newRow(hcp, hcp.toString()); form.ctnDetails().qmbCommencedBy().setValue(hcp); } //WDEV-2162 newMedicationDoseInstance(); updateDiscontinueDoseMenu();//WDEV-14928 }
protected void onCmbCommencedByValueChanged() throws PresentationLogicException { if ( (form.ctnDetails().cmbCommencedBy().getValue() != null) && (form.ctnDetails().cmbCommencedBy().getValue().equals(MedciationCommencedDiscontinuedType.MOS)) ) { form.ctnDetails().qmbCommencedBy().setEnabled(true); defaultHCP(); } else { form.ctnDetails().qmbCommencedBy().setEnabled(false); form.ctnDetails().qmbCommencedBy().setValue(null); } }
protected void onCmbDiscontinuedByTypeValueChanged() throws PresentationLogicException { if ( (form.cmbDiscontinuedByType().getValue() != null) && (form.cmbDiscontinuedByType().getValue().equals(MedciationCommencedDiscontinuedType.MOS)) ) { form.qmbHCP().setEnabled(true); defaultHCP(); } else { form.qmbHCP().setEnabled(false); form.qmbHCP().setValue(null); } }
private void newMedicationDoseInstance() { DynamicGridRow doseRow = form.ctnDetails().dyngrdDoses().getRows().newRow(); DynamicGridCell cell1 = doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSE), DynamicCellType.STRING); cell1.setStringMaxLength(255); cell1.setValidationMessage("This text is restricted to 255 characters"); cell1.setReadOnly(false); cell1.setTooltip("Please select a Dose"); cell1.setWidth(120); DynamicGridCell cell2= doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE), DynamicCellType.ENUMERATION); cell2.setReadOnly(false); bindCellToLookup(cell2, MedicationRoute.class); cell2.setTooltip("Please select a Route"); cell2.setWidth(120); DynamicGridCell cell3 = doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_TIMES), DynamicCellType.MULTISELECT); cell3.setReadOnly(false); bindCellToLookup(cell3, MedicationTimesOfAdministration.class); cell3.setTooltip("Please select Times"); cell3.setWidth(140); DynamicGridCell cell6= doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY_TYPE), DynamicCellType.ENUMERATION); cell6.setReadOnly(false); bindCellToLookup(cell6, MedciationCommencedDiscontinuedType.class); cell6.setValue(MedciationCommencedDiscontinuedType.MOS); cell6.setTooltip("Please select a Commenced by Type"); cell6.setAutoPostBack(true); cell6.setWidth(140); DynamicGridCell cell4 = doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.QUERYCOMBOBOX); Hcp hcp = (Hcp) domain.getHcpUser(); if(hcp != null) { cell4.getItems().newItem(hcp); cell4.setValue(hcp); } cell4.setReadOnly(false); cell4.setAutoPostBack(true); cell4.setTooltip("Please select a HCP"); cell4.setWidth(160); DynamicGridCell cell5 = doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.DATE); cell5.setValue(new Date()); cell5.setReadOnly(false); cell5.setTooltip("Please select a Date"); cell5.setWidth(-1); doseRow.setExpanded(true); MedicationDose voNewDose = new MedicationDose(); voNewDose.setIsCopied(new Boolean(false)); doseRow.setValue(voNewDose); //wdev-1873 form.ctnDetails().dyngrdDoses().setSelectedRow(doseRow); //added for WDEV-7307 if (!engine.isDialog()){ form.ctnDetails().dyngrdDoses().resetScrollPosition(); form.ctnDetails().dyngrdDoses().setSelectedRow(doseRow); } updateControlsState(); }