private String getMedicationName(T med) { if (med instanceof TTAMedicationVo) { TTAMedicationVo ttamed = (TTAMedicationVo) med; return ttamed.getMedicationIsNotNull()?ttamed.getMedication():""; } if (med instanceof AdmissionMedicationChangesVo) { AdmissionMedicationChangesVo amc = (AdmissionMedicationChangesVo) med; return amc.getMedicationIsNotNull()?amc.getMedication():""; } return ""; }
protected void onDynGrdJACCellButtonClicked(DynamicGridCell cell) { DynamicGridRow row = cell.getRow(); if (row != null && row.getValue() != null && row.getValue() instanceof TTAMedicationVo) { TTAMedicationVo medication = (TTAMedicationVo) row.getValue(); if (medication.getMedComments() != null && medication.getMedComments().size() > 0) engine.open(form.getForms().Clinical.TTANotesDialog, new Object[] {medication}, false); } }
@Override protected void onFormOpen(Object[] args) throws PresentationLogicException { TTANoteRefVoCollection comments = null; // Get notes from argument if (args != null && args.length > 0) { if (args[0] instanceof DischargeMedicationDetailsVo) { DischargeMedicationDetailsVo dischargeMedication = (DischargeMedicationDetailsVo) args[0]; comments = dischargeMedication.getTTAComments(); } else if (args[0] instanceof TTAMedicationVo) { TTAMedicationVo medication = (TTAMedicationVo) args[0]; comments = new TTANoteRefVoCollection(); if (medication.getMedComments() != null) { for (TTANoteVo note : medication.getMedComments()) comments.add(note); } } } // Refresh the screen open(comments); }
private void populateScreenFromData(DischargeMedicationDetailsVo voMeds) { clearInstanceControls(); //WDEV-8183 form.grdMedication().getRows().clear(); //Should clear even if the new value is null form.grdJAC().getRows().clear(); if (voMeds == null) return; form.cmbRequired().setValue(voMeds.getTTARequired()); //----------------------------------------------------- if (form.getMode().equals(FormMode.EDIT)) form.btnOrderTTO().setVisible(TTORequired.REQUIRED.equals(form.cmbRequired().getValue())?true:false); //-------------------------------------------------------- if (voMeds.getTTAsIsNotNull() ) { // WDEV-9537 TTAMedicationVoCollection ttas = voMeds.getTTAs(); ttas.sort(new TTANameCaseInsensitiveComparator<TTAMedicationVo>() ); for ( int i = 0 ; i < ttas.size() ; i++) { TTAMedicationVo voTTA = ttas.get(i); grdJACRow row = form.grdJAC().getRows().newRow(); row.setColMedication(voTTA.getMedication()); //------------------ row.setTooltipForColMedication(voTTA.getMedication()); //------------------ row.setColDose(voTTA.getDoseAmount().toString() + " " + (voTTA.getDoseUnitIsNotNull() ? voTTA.getDoseUnit().toString() : "")); //------------ row.setTooltipForColDose(voTTA.getDoseAmount().toString() + " " + (voTTA.getDoseUnitIsNotNull() ? voTTA.getDoseUnit().toString() : "")); //------------- row.setColRoute(voTTA.getRouteIsNotNull() ? voTTA.getRoute().toString() : null); row.setTooltipForColRoute(voTTA.getRouteIsNotNull() ? voTTA.getRoute().toString() : ""); row.setColUFreq(voTTA.getFrequency()); row.setTooltipForColUFreq(voTTA.getFrequency()); row.setColDays(voTTA.getDaysSupply().toString()); //------ row.setTooltipForColDays(voTTA.getDaysSupply().toString()); //---------- row.setColGpCont(voTTA.getGpToContinueIsNotNull() ? voTTA.getGpToContinue().toString() : null); //--------------- row.setTooltipForColGpCont(voTTA.getGpToContinueIsNotNull() ? voTTA.getGpToContinue().toString() : ""); //--------- row.setValue(voTTA); form.lblRefreshDateTime().setValue(voTTA.getSysInfoIsNotNull() ? voTTA.getSysInfo().getCreationDateTime().toString() : ""); } } //form.grdJAC().sort(0); if (voMeds.getAdmissionMedicationChangesIsNotNull()) { // WDEV-9537 AdmissionMedicationChangesVoCollection admissionMedicationChanges = voMeds.getAdmissionMedicationChanges(); admissionMedicationChanges.sort(new TTANameCaseInsensitiveComparator<AdmissionMedicationChangesVo>()); for ( int i = 0 ;i < admissionMedicationChanges.size() ; i++) { AdmissionMedicationChangesVo voChanges = admissionMedicationChanges.get(i); grdMedicationRow rowMeds = form.grdMedication().getRows().newRow(); rowMeds.setcolAdm(voChanges.getMedication()); rowMeds.setcolChange(voChanges.getMedicationChanges()); rowMeds.setValue(voChanges); } //form.grdMedication().sort(0); } form.txtMedicationRecommendations().setValue(voMeds.getMedicationRecommendations()); }
private void populateTTAsFromData(TTAMedicationVoCollection ttas) { for ( int i = 0 ; i < ttas.size() ; i++) { TTAMedicationVo voTTA = ttas.get(i); DynamicGridRow tTARow = form.dynGrdJAC().getRows().newRow(); tTARow.setSelectable(Boolean.FALSE); DynamicGridCell medNameCell = tTARow.getCells().newCell(getColumn(COL_MEDICATION_NAME), DynamicCellType.STRING); medNameCell.setReadOnly(Boolean.TRUE); medNameCell.setValue(voTTA.getMedication()); medNameCell.setTooltip(voTTA.getMedication()); DynamicGridCell doseCell = tTARow.getCells().newCell(getColumn(COL_MEDICATION_DOSE), DynamicCellType.STRING); doseCell.setReadOnly(Boolean.TRUE); doseCell.setValue(voTTA.getDoseAmount().toString() + " " + (voTTA.getDoseUnitIsNotNull() ? voTTA.getDoseUnit().toString() : "")); doseCell.setTooltip(voTTA.getDoseAmount().toString() + " " + (voTTA.getDoseUnitIsNotNull() ? voTTA.getDoseUnit().toString() : "")); DynamicGridCell routeCell = tTARow.getCells().newCell(getColumn(COL_MEDICATION_ROUTE), DynamicCellType.STRING); routeCell.setReadOnly(Boolean.TRUE); routeCell.setValue(voTTA.getRouteIsNotNull() ? voTTA.getRoute().toString() : null); routeCell.setTooltip(voTTA.getRouteIsNotNull() ? voTTA.getRoute().toString() : ""); DynamicGridCell freqCell = tTARow.getCells().newCell(getColumn(COL_MEDICATION_FREQUENCY), DynamicCellType.STRING); freqCell.setReadOnly(Boolean.TRUE); freqCell.setValue(voTTA.getFrequency()); freqCell.setTooltip(voTTA.getFrequency()); DynamicGridCell daysSuppliedCell = tTARow.getCells().newCell(getColumn(COL_MEDICATION_DAYS_SUPPLIED), DynamicCellType.STRING); daysSuppliedCell.setReadOnly(Boolean.TRUE); daysSuppliedCell.setValue(voTTA.getDaysSupply().toString()); daysSuppliedCell.setTooltip(voTTA.getDaysSupply().toString()); DynamicGridCell gpToContCell = tTARow.getCells().newCell(getColumn(COL_GP_CONT), DynamicCellType.STRING); gpToContCell.setReadOnly(Boolean.TRUE); gpToContCell.setValue(voTTA.getGpToContinueIsNotNull() ? voTTA.getGpToContinue().toString() : null); gpToContCell.setTooltip(voTTA.getGpToContinueIsNotNull() ? voTTA.getGpToContinue().toString() : ""); if (voTTA.getMedComments() != null && voTTA.getMedComments().size() > 0) { DynamicGridCell commentsCell = tTARow.getCells().newCell(getColumn(COL_MEDICATION_COMMENTS), DynamicCellType.IMAGEBUTTON); commentsCell.setValue(form.getImages().Core.Memo); commentsCell.setReadOnly(Boolean.FALSE); commentsCell.setAutoPostBack(Boolean.TRUE); commentsCell.setTooltip(getTooltipForMedComments(voTTA.getMedComments())); } tTARow.setValue(voTTA); form.lblRefreshDateTime().setValue(voTTA.getSysInfoIsNotNull() ? voTTA.getSysInfo().getCreationDateTime().toString() : ""); } }