private MedicationDose getDoseRowValue(DynamicGridRow row) { if (row == null) throw new CodingRuntimeException("Major Logical Error - Can not read a value from null row"); if (row.getValue() == null || !(row.getValue() instanceof MedicationDose)) { row.setValue(new MedicationDose()); } MedicationDose dose = (MedicationDose) row.getValue(); DynamicGridCell cell = row.getCells().get(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSENAME)); dose.setDose(cell.getValue() != null ? cell.getValue().toString() : null); cell = row.getCells().get(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE)); dose.setAdminRoute(cell.getValue() != null ? (MedicationRoute) (cell.getValue()) : null); cell = row.getCells().get(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY)); dose.setDoseStartHcp(cell.getIdentifier()!= null ? (Hcp) (cell.getIdentifier()) : null); cell = row.getCells().get(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_DATE)); dose.setDoseStartDate(cell.getValue() != null ? (Date) (cell.getValue()) : null); return dose; }
private void discontinueMedicationDoseInstance() { DiscontinueMedicationReasonValuesVo voReason = new DiscontinueMedicationReasonValuesVo(); if (form.ctnDetails().dyngrdDoses().getSelectedRow().getValue() instanceof MedicationDose) { MedicationDose voDose = (MedicationDose)form.ctnDetails().dyngrdDoses().getSelectedRow().getValue(); voReason.setStoppedDate(voDose.getIsStoppedDate()); voReason.setStoppedHCP(voDose.getIsStoppedHcp()); voReason.setStoppedReason(voDose.getIsStoppedReason()); voReason.setStoppedReasonDesc(voDose.getIsStoppedReasonText()); if ((voDose.getIsStoppedIsNotNull()) && (voDose.getIsStopped().booleanValue()) ) form.getGlobalContext().Clinical.setDiscontinueMedicationReasonValues(voReason); else form.getGlobalContext().Clinical.setDiscontinueMedicationReasonValues(null); } form.getLocalContext().setbDiscontinueDose(Boolean.TRUE); form.getLocalContext().setbDiscontinueMed(Boolean.FALSE); engine.open(form.getForms().Clinical.MedicationDiscontinue, "Discontinue Dose"); }
private void updateContextMenuState() { form.getContextMenus().getMedicationMultipleDosesNEW_DOSEItem().setVisible(FormMode.EDIT.equals(form.getMode())); form.getContextMenus().getMedicationMultipleDosesDISCONTINUE_DOSEItem().setVisible(FormMode.EDIT.equals(form.getMode()) && form.dyngrdDoses().getValue() instanceof MedicationDose); form.getContextMenus().getMedicationMultipleDosesUPDATE_DOSEItem().setVisible(FormMode.EDIT.equals(form.getMode()) && form.dyngrdDoses().getValue() instanceof MedicationDose && form.dyngrdDoses().getSelectedRow() != null && ROW_STATE_NOT_EDITABLE.equals(form.dyngrdDoses().getSelectedRow().getIdentifier())); }
private void updateDiscontinueDoseMenu() { if (form.ctnDetails().dyngrdDoses().getSelectedRow().getValue() instanceof MedicationDose) { MedicationDose voDose = (MedicationDose)form.ctnDetails().dyngrdDoses().getSelectedRow().getValue(); if ( (!voDose.getID_PatientMedicationDoseIsNotNull()) || (voDose != null && voDose.getIsStopped() != null && voDose.getIsStopped().booleanValue())) form.getContextMenus().getMedicationMultipleDosesDISCONTINUE_DOSEItem().setVisible(false); } }
private void showDetails(PatientMedicationVo voMed) { if(voMed == null) return; if (voMed.getFrequency() != null) form.ctnDetails().cmbFrequency().setValue(voMed.getFrequency()); if(voMed.getAuthoringInformationIsNotNull()) form.ctnDetails().customControlAuthor().setValue(voMed.getAuthoringInformation()); else form.ctnDetails().customControlAuthor().setValue(null); form.ctnDetails().customControlCodingItem().setValue(voMed); if (voMed.getPrescribedDoses() != null && voMed.getPrescribedDoses().size() > 0) { MedicationDose dose = voMed.getPrescribedDoses().get(0); form.ctnDetails().txtDose().setValue(dose.getDose()); form.ctnDetails().cmbRoute().setValue(dose.getAdminRoute()); form.ctnDetails().txtTakenWhen().setValue(dose.getWhenTaken()); } form.ctnDetails().txtDifficulties().setValue(voMed.getDifficultiesWithMed()); //wdev-12768 form.ctnDetails().chkSelfMedicating().setValue(voMed.getSelfMedicating()); //------------ form.ctnDetails().setCollapsed(false); if(voMed.getRecordingInformationIsNotNull()){ MemberOfStaffLiteVo mos = voMed.getRecordingInformation().getRecordingUser(); if(mos!=null){ form.ctnDetails().cmbRecordingHCP().newRow(mos, mos.toString()); form.ctnDetails().cmbRecordingHCP().setValue(mos); } form.ctnDetails().dtimRecordingDateTime().setValue(voMed.getRecordingInformation().getRecordingDateTime()); } }
private void setDoseRowValue(DynamicGridRow row, MedicationDose dose) { if (row == null) throw new CodingRuntimeException("Major Logical Error - Can not set a dose to null row"); row.setValue(dose); if (dose == null) return; DynamicGridCell cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSENAME), DynamicCellType.STRING); cell.setValidationMessage("Dose length is restricted to 255 characters."); cell.setValue(dose.getDose()); cell.setWidth(120); cell.setReadOnly(true); cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE), DynamicCellType.ENUMERATION); // bind to lookup cell.getItems().clear(); MedicationRouteCollection medicationRouteCollection = LookupHelper.getMedicationRoute(domain.getLookupService()); for (int i = 0; i < medicationRouteCollection.size(); i++) { MedicationRoute route = medicationRouteCollection.get(i); cell.getItems().newItem(route, route.getText()); } cell.setValue(dose.getAdminRoute()); cell.setWidth(120); cell.setReadOnly(true); cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.STRING); cell.setIdentifier(dose.getDoseStartHcp()); cell.setValue(dose.getDoseStartHcp() != null ? dose.getDoseStartHcp().toString() : ""); cell.setWidth(200); cell.setReadOnly(true); cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.DATE); cell.setValue(dose.getDoseStartDate()); cell.setWidth(-1); cell.setReadOnly(true); row.setIdentifier(ROW_STATE_NOT_EDITABLE); }
private void newDose() { DynamicGridRow row = form.dyngrdDoses().getRows().newRow(); DynamicGridCell cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSENAME), DynamicCellType.STRING); cell.setReadOnly(false); cell.setStringMaxLength(255); cell.setValidationMessage("Dose length is restricted to 255 characters."); cell.setWidth(120); cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE), DynamicCellType.ENUMERATION); cell.setReadOnly(false); // bind to lookup cell.getItems().clear(); MedicationRouteCollection medicationRouteCollection = LookupHelper.getMedicationRoute(domain.getLookupService()); for (int i = 0; i < medicationRouteCollection.size(); i++) { MedicationRoute route = medicationRouteCollection.get(i); cell.getItems().newItem(route, route.getText()); } cell.setWidth(120); cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.STRING); cell.setReadOnly(true); cell.setIdentifier(domain.getHcpUser()); cell.setValue(domain.getHcpUser() != null ? domain.getHcpUser().toString() : ""); cell.setWidth(200); cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.DATE); cell.setReadOnly(true); cell.setValue(new Date()); cell.setWidth(-1); row.setValue(new MedicationDose()); row.setIdentifier(ROW_STATE_EDITABLE); // Update grid selection form.dyngrdDoses().setSelectedRow(row); }
private void copyMedicationOverViewDropAuthoringHCPAndDiscontinuedMeds(MedicationOverViewVo currentMedicationOverView) { currentMedicationOverView.setAuthoringInformation(null); PatientMedicationVoCollection copyOfMeds = new PatientMedicationVoCollection(); for(int i = 0 ; i < currentMedicationOverView.getMedication().size() ; i++) { PatientMedicationVo voMed = currentMedicationOverView.getMedication().get(i); if ( (voMed.getIsDiscontinued() == null) || (voMed.getIsDiscontinuedIsNotNull() && (voMed.getIsDiscontinued().booleanValue() == false)) && (voMed.getPrescribedDosesIsNotNull())) { MedicationDoseCollection copyOfDoses = new MedicationDoseCollection(); boolean bAllDosesAreDiscontinued = true; MedicationDose voDose = null; //Loop thru to see if collection has any non-discontinued Doses. for (int k = 0 ; k < voMed.getPrescribedDoses().size() ; k++) { voDose = voMed.getPrescribedDoses().get(k); if ((voDose.getIsStopped() == null) || (voDose.getIsStoppedIsNotNull() && (voDose.getIsStopped().booleanValue() == false)) ) bAllDosesAreDiscontinued = false; } //If there is then copy valid doses and the med itself. if (!bAllDosesAreDiscontinued) { for(int j = 0 ; j < voMed.getPrescribedDoses().size() ; j++) { voDose = voMed.getPrescribedDoses().get(j); if ((voDose.getIsStopped() == null) || (voDose.getIsStoppedIsNotNull() && (voDose.getIsStopped().booleanValue() == false)) ) { voDose.setID_PatientMedicationDose(null); voDose.setAuthoringInformation(form.customControlAuthoringInfo().getValue()); voDose.setIsCopied(new Boolean(true)); copyOfDoses.add(voDose); } } voMed.setPrescribedDoses(copyOfDoses); voMed.setID_PatientMedication(null); voMed.setAuthoringInformation(form.customControlAuthoringInfo().getValue()); voMed.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voMed.setNoDaysSupply(null);//wdev-1462 voMed.setIsInTTO(null);//wdev-1462 voMed.setIsCopied(new Boolean(true)); copyOfMeds.add(voMed); } } } currentMedicationOverView.setMedication(copyOfMeds); currentMedicationOverView.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); form.getLocalContext().setCurrentOverView(currentMedicationOverView); }
private void fillDosesGridReadOnly(MedicationDoseCollection prescribedDoses) { form.ctnDetails().dyngrdDoses().getRows().clear(); for(int i = 0 ; i < prescribedDoses.size() ; i++) { DynamicGridRow childRow = form.ctnDetails().dyngrdDoses().getRows().newRow(); MedicationDose voDose = prescribedDoses.get(i); DynamicGridCell cell1 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSE), DynamicCellType.LABEL); cell1.setValue(voDose.getDoseIsNotNull() ? voDose.getDose() : ""); cell1.setTooltip(voDose.getDiscontinuedTooltip()); cell1.setIdentifier(voDose.getDose()); cell1.setWidth(120); DynamicGridCell cell2 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE), DynamicCellType.LABEL); cell2.setValue(voDose.getAdminRouteIsNotNull() ? voDose.getAdminRoute().toString() : ""); cell2.setIdentifier(voDose.getAdminRoute()); cell2.setWidth(120); DynamicGridCell cell3 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_TIMES), DynamicCellType.LABEL); cell3.setValue(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : ""); cell3.setTooltip(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : ""); cell3.setIdentifier(voDose.getAdminTimes()); cell3.setWidth(140); DynamicGridCell cell6 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY_TYPE), DynamicCellType.LABEL); cell6.setValue(voDose.getCommencedByTypeIsNotNull() ? voDose.getCommencedByType().toString() : ""); cell6.setIdentifier(voDose.getCommencedByType()); cell6.setWidth(140); DynamicGridCell cell4 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.LABEL); cell4.setValue(voDose.getDoseStartHcpIsNotNull() ? voDose.getDoseStartHcp().toString() : ""); cell4.setIdentifier(voDose.getDoseStartHcp()); cell4.setWidth(160); DynamicGridCell cell5 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.LABEL); cell5.setValue(voDose.getDoseStartDateIsNotNull() ? voDose.getDoseStartDate().toString() : null); cell5.setIdentifier(voDose.getDoseStartDate()); cell5.setWidth(-1); childRow.setValue(voDose); childRow.setExpanded(true); if ( (voDose.getIsStoppedIsNotNull()) && (voDose.getIsStopped().booleanValue()) ) childRow.setBold(false); else childRow.setBold(true); } }
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(); }
private boolean addDoseRow(DynamicGridRow row, MedicationDose voDose, boolean bHideDiscontinued, Color objColor) { if(voDose == null || row == null) throw new CodingRuntimeException("Dose or Row not sent - Coding Error"); if ( (bHideDiscontinued) && (voDose.getIsStoppedIsNotNull()) && (voDose.getIsStopped().booleanValue())) return false; DynamicGridRow childRow = row.getRows().newRow(); DynamicGridCell cell1 = childRow.getCells().newCell(getColByIdentifier(COL_DOSE_DOSE), DynamicCellType.LABEL); cell1.setValue(voDose.getDoseIsNotNull() ? voDose.getDose() : ""); cell1.setIdentifier(voDose.getDose()); cell1.setTooltip(voDose.getDiscontinuedTooltip()); DynamicGridCell cell2= childRow.getCells().newCell(getColByIdentifier(COL_DOSE_ROUTE), DynamicCellType.LABEL); cell2.setValue(voDose.getAdminRouteIsNotNull() ? voDose.getAdminRoute().toString() : ""); cell2.setIdentifier(voDose.getAdminRoute()); DynamicGridCell cell3 = childRow.getCells().newCell(getColByIdentifier(COL_DOSE_TIMES), DynamicCellType.LABEL); cell3.setValue(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : ""); cell3.setTooltip(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : ""); cell3.setIdentifier(voDose.getAdminTimes()); DynamicGridCell cell4 = childRow.getCells().newCell(getColByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.LABEL); cell4.setValue(voDose.getDoseStartHcpIsNotNull() ? voDose.getDoseStartHcp().toString() : ""); cell4.setIdentifier(voDose.getDose()); DynamicGridCell cell5 = childRow.getCells().newCell(getColByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.LABEL); cell5.setValue(voDose.getDoseStartDateIsNotNull() ? voDose.getDoseStartDate().toString() : ""); cell5.setIdentifier(voDose.getDose()); childRow.setValue(voDose); childRow.setExpanded(true); childRow.setSelectable(false); childRow.setBackColor(objColor); childRow.setExpandedImage(this.tabletdoseImage); childRow.setCollapsedImage(this.tabletdoseImage); if ( (voDose.getIsStoppedIsNotNull()) && (voDose.getIsStopped().booleanValue()) ) childRow.setBold(false); else childRow.setBold(true); return true; }
private void fillDosesGridReadOnly(MedicationDoseCollection prescribedDoses) { form.ctnDetails().dyngrdDoses().getRows().clear(); for(int i = 0 ; i < prescribedDoses.size() ; i++) { DynamicGridRow childRow = form.ctnDetails().dyngrdDoses().getRows().newRow(); MedicationDose voDose = prescribedDoses.get(i); DynamicGridCell cell1 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSE), DynamicCellType.LABEL); cell1.setValue(voDose.getDoseIsNotNull() ? voDose.getDose() : ""); cell1.setTooltip(voDose.getDiscontinuedTooltip()); cell1.setIdentifier(voDose.getDose()); cell1.setWidth(120); DynamicGridCell cell2 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE), DynamicCellType.LABEL); cell2.setValue(voDose.getAdminRouteIsNotNull() ? voDose.getAdminRoute().toString() : ""); cell2.setIdentifier(voDose.getAdminRoute()); cell2.setWidth(120); DynamicGridCell cell3 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_TIMES), DynamicCellType.LABEL); cell3.setValue(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : ""); cell3.setTooltip(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : ""); cell3.setIdentifier(voDose.getAdminTimes()); cell3.setWidth(140); DynamicGridCell cell6 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY_TYPE), DynamicCellType.LABEL); cell6.setValue(voDose.getCommencedByTypeIsNotNull() ? voDose.getCommencedByType().toString() : ""); cell6.setIdentifier(voDose.getCommencedByType()); cell6.setWidth(140); DynamicGridCell cell4 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.LABEL); cell4.setValue(voDose.getDoseStartHcpIsNotNull() ? voDose.getDoseStartHcp().toString() : ""); cell4.setIdentifier(voDose.getDoseStartHcp()); cell4.setWidth(160); DynamicGridCell cell5 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.LABEL); cell5.setValue(voDose.getDoseStartDateIsNotNull() ? voDose.getDoseStartDate().toString() : null); cell5.setIdentifier(voDose.getDoseStartDate()); //WDEV-20591 // cell5.setWidth(-1); cell5.setWidth(80); //WDEV-20591 DynamicGridCell cell7 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENT), DynamicCellType.LABEL); cell7.setValue(voDose.getCommentIsNotNull() ? voDose.getComment() : null); cell7.setIdentifier(voDose.getComment()); cell7.setWidth(-1); childRow.setValue(voDose); childRow.setExpanded(true); if ( (voDose.getIsStoppedIsNotNull()) && (voDose.getIsStopped().booleanValue()) ) childRow.setBold(false); else childRow.setBold(true); } }
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, MedicationCommencedDiscontinuedType.class); cell6.setValue(MedicationCommencedDiscontinuedType.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"); //WDEV-20591 // cell5.setWidth(-1); cell5.setWidth(80); //WDEV-20591 DynamicGridCell cell7 = doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENT), DynamicCellType.STRING); cell7.setStringMaxLength(255); cell7.setValidationMessage("This text is restricted to 255 characters"); cell7.setReadOnly(false); cell7.setTooltip("Please enter a Comment"); cell7.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(); }
private void fillDosesGridReadOnly(MedicationDoseCollection prescribedDoses) { form.ctnDetails().dyngrdDoses().getRows().clear(); for(int i = 0 ; i < prescribedDoses.size() ; i++) { DynamicGridRow childRow = form.ctnDetails().dyngrdDoses().getRows().newRow(); MedicationDose voDose = prescribedDoses.get(i); DynamicGridCell cell1 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSE), DynamicCellType.LABEL); cell1.setValue(voDose.getDoseIsNotNull() ? voDose.getDose() : ""); cell1.setTooltip(voDose.getDiscontinuedTooltip()); cell1.setIdentifier(voDose.getDose()); // cell1.setWidth(120); cell1.setWidth(60); //WDEV-21114 DynamicGridCell cell2 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE), DynamicCellType.LABEL); cell2.setValue(voDose.getAdminRouteIsNotNull() ? voDose.getAdminRoute().toString() : ""); cell2.setIdentifier(voDose.getAdminRoute()); // cell2.setWidth(120); cell2.setWidth(100); //WDEV-21114 DynamicGridCell cell3 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_TIMES), DynamicCellType.LABEL); cell3.setValue(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : ""); cell3.setTooltip(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : ""); cell3.setIdentifier(voDose.getAdminTimes()); cell3.setWidth(140); DynamicGridCell cell6 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY_TYPE), DynamicCellType.LABEL); cell6.setValue(voDose.getCommencedByTypeIsNotNull() ? voDose.getCommencedByType().toString() : ""); cell6.setIdentifier(voDose.getCommencedByType()); cell6.setWidth(140); DynamicGridCell cell4 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.LABEL); cell4.setValue(voDose.getDoseStartHcpIsNotNull() ? voDose.getDoseStartHcp().toString() : ""); cell4.setIdentifier(voDose.getDoseStartHcp()); cell4.setWidth(160); DynamicGridCell cell5 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.LABEL); cell5.setValue(voDose.getDoseStartDateIsNotNull() ? voDose.getDoseStartDate().toString() : null); cell5.setIdentifier(voDose.getDoseStartDate()); cell5.setWidth(80); DynamicGridCell cell7 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENT), DynamicCellType.LABEL); cell7.setValue(voDose.getCommentIsNotNull() ? voDose.getComment() : null); cell7.setIdentifier(voDose.getComment()); cell7.setWidth(-1); childRow.setValue(voDose); childRow.setExpanded(true); if ( (voDose.getIsStoppedIsNotNull()) && (voDose.getIsStopped().booleanValue()) ) { childRow.setBold(false); } else { childRow.setBold(true); } } }
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); cell1.setWidth(60); //WDEV-21114 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); cell2.setWidth(100); //WDEV-21114 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, MedicationCommencedDiscontinuedType.class); cell6.setValue(MedicationCommencedDiscontinuedType.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(80); DynamicGridCell cell7 = doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENT), DynamicCellType.STRING); cell7.setStringMaxLength(255); cell7.setValidationMessage("This text is restricted to 255 characters"); cell7.setReadOnly(false); cell7.setTooltip("Please enter a Comment"); cell7.setWidth(-1); doseRow.setExpanded(true); MedicationDose voNewDose = new MedicationDose(); voNewDose.setIsCopied(new Boolean(false)); doseRow.setValue(voNewDose); if (!engine.isDialog()){ form.ctnDetails().dyngrdDoses().resetScrollPosition(); form.ctnDetails().dyngrdDoses().setSelectedRow(doseRow); } updateControlsState(); }
private boolean addDoseRow(DynamicGridRow row, MedicationDose voDose, boolean bHideDiscontinued, Color objColor) { if(voDose == null || row == null) throw new CodingRuntimeException("Dose or Row not sent - Coding Error"); if ( (bHideDiscontinued) && (voDose.getIsStoppedIsNotNull()) && (voDose.getIsStopped().booleanValue())) return false; DynamicGridRow childRow = row.getRows().newRow(); DynamicGridCell cell1 = childRow.getCells().newCell(getColByIdentifier(COL_DOSE_DOSE), DynamicCellType.LABEL); cell1.setValue(voDose.getDoseIsNotNull() ? voDose.getDose() : ""); cell1.setIdentifier(voDose.getDose()); cell1.setTooltip(voDose.getDiscontinuedTooltip()); DynamicGridCell cell2= childRow.getCells().newCell(getColByIdentifier(COL_DOSE_ROUTE), DynamicCellType.LABEL); cell2.setValue(voDose.getAdminRouteIsNotNull() ? voDose.getAdminRoute().toString() : ""); cell2.setIdentifier(voDose.getAdminRoute()); cell2.setTooltip(voDose.getDiscontinuedTooltip()); DynamicGridCell cell3 = childRow.getCells().newCell(getColByIdentifier(COL_DOSE_TIMES), DynamicCellType.LABEL); cell3.setValue(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : ""); cell3.setTooltip(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : ""); cell3.setIdentifier(voDose.getAdminTimes()); cell3.setTooltip(voDose.getDiscontinuedTooltip()); DynamicGridCell cell4 = childRow.getCells().newCell(getColByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.LABEL); cell4.setValue(voDose.getDoseStartHcpIsNotNull() ? voDose.getDoseStartHcp().toString() : ""); cell4.setIdentifier(voDose.getDose()); cell4.setTooltip(voDose.getDiscontinuedTooltip()); DynamicGridCell cell5 = childRow.getCells().newCell(getColByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.LABEL); cell5.setValue(voDose.getDoseStartDateIsNotNull() ? voDose.getDoseStartDate().toString() : ""); cell5.setIdentifier(voDose.getDose()); cell5.setTooltip(voDose.getDiscontinuedTooltip()); //WDEV-20591 DynamicGridCell cell6 = childRow.getCells().newCell(getColByIdentifier(COL_DOSE_COMMENT), DynamicCellType.LABEL); cell6.setValue(voDose.getCommentIsNotNull() ? voDose.getComment().toString() : ""); cell6.setIdentifier(voDose.getComment()); cell6.setTooltip(voDose.getDiscontinuedTooltip()); childRow.setValue(voDose); childRow.setExpanded(true); childRow.setSelectable(false); childRow.setBackColor(objColor); childRow.setExpandedImage(this.tabletdoseImage); childRow.setCollapsedImage(this.tabletdoseImage); if ( (voDose.getIsStoppedIsNotNull()) && (voDose.getIsStopped().booleanValue()) ) childRow.setBold(false); else childRow.setBold(true); return true; }