private void setMedications(PatientMedicationVoCollection patientMedicationVoCollection) { form.lyrContent().tabNursing().grdMedications().getRows().clear(); if (patientMedicationVoCollection == null) return; patientMedicationVoCollection.sort(new MedicationComparator(SortOrder.ASCENDING)); for (int i = 0; i < patientMedicationVoCollection.size(); i++) { PatientMedicationVo medication = patientMedicationVoCollection.get(i); if (medication == null) continue; setMedicationRow(form.lyrContent().tabNursing().grdMedications().getRows().newRow(), medication); } }
public int compare(PatientMedicationVo medication1, PatientMedicationVo medication2) { if (medication1 != null && medication2 != null) { return medication1.getSysInfo().getCreationDateTime().compareTo(medication2.getSysInfo().getCreationDateTime()) * direction; } if (medication1 != null && medication2 == null) { return direction; } if (medication1 == null && medication2 != null) { return (-1) * direction; } return 0; }
private void populateScreenFromInstance(PatientMedicationVo patientMedication) { clearInstanceControls(); if (patientMedication == null) return; form.ccMedication().setValue(patientMedication); form.cmbCommencedBy().setValue(patientMedication.getCommencedByType()); if (patientMedication.getHcpCommenced() != null) { form.qmbCommencedByHcp().newRow(patientMedication.getHcpCommenced(), patientMedication.getHcpCommenced().getMosIsNotNull() ? patientMedication.getHcpCommenced().getMos().toString() : "HCP name not available"); form.qmbCommencedByHcp().setValue(patientMedication.getHcpCommenced()); } form.dteCommencedDate().setValue(patientMedication.getCommencedDate()); form.cmbFrequency().setValue(patientMedication.getFrequency()); form.cmbSource().setValue(patientMedication.getSourceofInformation()); setDoses(patientMedication.getPrescribedDoses()); form.chkIncludeInDrugOrder().setValue(patientMedication.getIsCopied()); form.intNumberOfDaysSupply().setValue(patientMedication.getNoDaysSupply()); }
private void setReturnToFormDescription(PatientMedicationVo voOverView) { if ( (form.getGlobalContext().Clinical.getReturnToFormNameIsNotNull()) && (form.getGlobalContext().Clinical.getReturnToFormName().equals(engine.getPreviousNonDialogFormName())) ) { //Set the CDI Description for the return to form link String str = form.getGlobalContext().Clinical.getReturnToFormCDIDescriptionIsNotNull() ? form.getGlobalContext().Clinical.getReturnToFormCDIDescription() : ""; StringBuffer sb = new StringBuffer(); sb.append(str); if (sb.length() > 0) sb.append(", "); sb.append(voOverView.getOtherMedicationText()); form.getGlobalContext().Clinical.setReturnToFormCDIDescription(sb.toString()); form.getGlobalContext().Clinical.setReturnToFormMode(FormMode.EDIT); } }
protected void onDyngrdMedicationRowSelectionChanged(ims.framework.controls.DynamicGridRow row) { if(form.getMode().equals(FormMode.EDIT)) return; form.ctnDetails().setCollapsed(false); updateControlsState(); if (form.dyngrdMedication().getSelectedRow().getValue() instanceof PatientMedicationVo) { form.getLocalContext().setSelectedInstance((PatientMedicationVo)form.dyngrdMedication().getSelectedRow().getValue()); populateInstanceControls((PatientMedicationVo)form.dyngrdMedication().getSelectedRow().getValue()); PatientMedicationVo voMed = (PatientMedicationVo)form.dyngrdMedication().getSelectedRow().getValue(); if ( (voMed.getIsDiscontinuedIsNotNull()) && (voMed.getIsDiscontinued().booleanValue()) ) form.getContextMenus().getMedicationMultipleDISCONTINUE_MEDICATIONItem().setVisible(false); } }
private void populateInstanceControls(PatientMedicationVo voSelectedInstance) { form.ctnDetails().customControlCodingItem().setValue(voSelectedInstance); form.ctnDetails().cmbSource().setValue(voSelectedInstance.getSourceofInformation()); form.ctnDetails().cmbFrequency().setValue(voSelectedInstance.getFrequency()); form.ctnDetails().chkTTO().setValue(voSelectedInstance.getIsInTTOIsNotNull() ? voSelectedInstance.getIsInTTO().booleanValue() : false); form.ctnDetails().intNumDays().setValue(voSelectedInstance.getNoDaysSupply()); form.ctnDetails().cmbCommencedBy().setValue(voSelectedInstance.getCommencedByType()); if (voSelectedInstance.getHcpCommencedIsNotNull()) { form.ctnDetails().qmbCommencedBy().newRow(voSelectedInstance.getHcpCommenced(), voSelectedInstance.getHcpCommenced().getName().toString()); form.ctnDetails().qmbCommencedBy().setValue(voSelectedInstance.getHcpCommencedIsNotNull() ? voSelectedInstance.getHcpCommenced() : null); } else form.ctnDetails().qmbCommencedBy().setValue(null); form.ctnDetails().dteCommenced().setValue(voSelectedInstance.getCommencedDate() != null ? new Date(voSelectedInstance.getCommencedDate()) : null); //WDEV-7141 fillDosesGridReadOnly(voSelectedInstance.getPrescribedDoses()); }
private void save() { PatientMedicationVoCollection voCopyColl = new PatientMedicationVoCollection(); DynamicGridColumn colCopy = form.dyngrdMedicationOverView().getColumns().getByIdentifier(new Integer(9)); for (int i = 0 ; i < form.dyngrdMedicationOverView().getRows().size() ; i++) { if (form.dyngrdMedicationOverView().getRows().get(i).getValue() instanceof PatientMedicationVo) { DynamicGridCell cellCopy = form.dyngrdMedicationOverView().getRows().get(i).getCells().get(colCopy); if (cellCopy != null && cellCopy.getType() == DynamicCellType.BOOL && ((Boolean)cellCopy.getValue()) == Boolean.TRUE ) voCopyColl.add((PatientMedicationVo)form.dyngrdMedicationOverView().getRows().get(i).getValue()); } } MedicationOverViewVo voMedOver = form.getGlobalContext().Clinical.getCurrentMedicationOverView(); if (voCopyColl.size() > 0) { voMedOver.setMedication(voCopyColl); voMedOver.setCorrectness(form.cmbCorrectness().getValue()); form.getGlobalContext().Clinical.setCurrentMedicationOverView(voMedOver); } else form.getGlobalContext().Clinical.setCurrentMedicationOverView(null); }
private void setReturnToFormDescription(PatientMedicationVo voMed) { if ( (form.getGlobalContext().Clinical.getReturnToFormNameIsNotNull()) && (form.getGlobalContext().Clinical.getReturnToFormName().equals(engine.getPreviousNonDialogFormName())) ) { //Set the CDI Description for the return to form link String str = form.getGlobalContext().Clinical.getReturnToFormCDIDescriptionIsNotNull() ? form.getGlobalContext().Clinical.getReturnToFormCDIDescription() : ""; StringBuffer sb = new StringBuffer(); sb.append(str); if (sb.length() > 0) sb.append(", "); if (voMed.getMedicationIsNotNull()) sb.append(voMed.getMedicationIsNotNull() ? voMed.getMedication().getMedicationName() : ""); else sb.append(voMed.getOtherMedicationText()); form.getGlobalContext().Clinical.setReturnToFormCDIDescription(sb.toString()); form.getGlobalContext().Clinical.setReturnToFormMode(FormMode.EDIT); } }
private void newInstance() { clearFields(); form.setMode(FormMode.EDIT); form.btnInactivate().setEnabled(false); form.btnUpdate().setEnabled(false); form.ctnDetails().customControlCodingItem().setClinicalTermMandatory(true); form.ctnDetails().customControlCodingItem().setDescriptionMandatory(true); PatientMedicationVo voMed = new PatientMedicationVo(); form.getLocalContext().setRecord(voMed); form.ctnDetails().setCollapsed(false); form.ctnDetails().setcustomControlAuthorEnabled(true); setAuthoringInfo(); Object mos = domain.getMosUser(); if(mos != null){ form.ctnDetails().cmbRecordingHCP().newRow((MemberOfStaffLiteVo)mos, mos.toString()); form.ctnDetails().cmbRecordingHCP().setValue((MemberOfStaffLiteVo)mos); } form.ctnDetails().dtimRecordingDateTime().setValue(new DateTime()); }
protected void onGrdMedicationSelectionChanged() throws PresentationLogicException { clearFields(); PatientMedicationVo voMed = null; if(form.grdMedication().getValue() instanceof PatientMedicationVo) voMed = domain.getPatientMedication(form.grdMedication().getValue()); form.getLocalContext().setRecord(voMed); showDetails(voMed); form.btnUpdate().setEnabled(true); if(voMed != null && voMed.getIsDiscontinuedIsNotNull() && !voMed.getIsDiscontinued()){ form.btnInactivate().setEnabled(true); form.btnUpdate().setEnabled(true); } else{ form.btnInactivate().setEnabled(false); form.btnUpdate().setEnabled(false); } updateControlsState(); }
private void populateMedicationsGrid(PatientMedicationVoCollection medications) { // Clear dynamic grid form.dyngrdMedications().getRows().clear(); // Check medication collection if (medications == null) return; for (int i = 0; i < medications.size(); i++) { PatientMedicationVo patientMedication = medications.get(i); if (patientMedication == null) continue; populateMedicationRow(form.dyngrdMedications().getRows().newRow(), patientMedication); } }
private PatientMedicationVoCollection getSelectedMedications() { if (form.dyngrdMedications().getRows().size() == 0) return null; PatientMedicationVoCollection medications = new PatientMedicationVoCollection(); DynamicGridColumn column = form.dyngrdMedications().getColumns().getByIdentifier(COL_SELECT); for (int i = 0; i < form.dyngrdMedications().getRows().size(); i++) { DynamicGridRow row = form.dyngrdMedications().getRows().get(i); if (row == null || !(row.getValue() instanceof PatientMedicationVo) || !Boolean.TRUE.equals(row.getCells().get(column).getValue())) continue; medications.add((PatientMedicationVo) row.getValue()); } return medications; }
private String getDrugsFromPrescription() { StringBuilder sb = new StringBuilder(); String comma = ""; for(int i=0; i<form.lyrContent().tabNursing().grdMedications().getRows().size(); i++) { PatientMedicationVo drug = (PatientMedicationVo) form.lyrContent().tabNursing().grdMedications().getRows().get(i).getValue(); sb.append(comma); comma=", "; sb.append(drug.getMedication().getID_Medication().intValue()); } String result = sb.toString(); if (result == null || result.trim().length() == 0) return null; return result; }
private void populateInstanceControls(PatientMedicationVo voSelectedInstance) { form.ctnDetails().customControlCodingItem().setValue(voSelectedInstance); form.ctnDetails().cmbSource().setValue(voSelectedInstance.getSourceofInformation()); form.ctnDetails().cmbFrequency().setValue(voSelectedInstance.getFrequency()); form.ctnDetails().chkTTO().setValue(voSelectedInstance.getIsInTTOIsNotNull() ? voSelectedInstance.getIsInTTO().booleanValue() : false); form.ctnDetails().intNumDays().setValue(voSelectedInstance.getNoDaysSupply()); form.ctnDetails().cmbCommencedBy().setValue(voSelectedInstance.getCommencedByType()); if (voSelectedInstance.getHcpCommencedIsNotNull()) { form.ctnDetails().qmbCommencedBy().newRow(voSelectedInstance.getHcpCommenced(), voSelectedInstance.getHcpCommenced().getName().toString()); form.ctnDetails().qmbCommencedBy().setValue(voSelectedInstance.getHcpCommencedIsNotNull() ? voSelectedInstance.getHcpCommenced() : null); } else form.ctnDetails().qmbCommencedBy().setValue(null); form.ctnDetails().dteCommenced().setValue(voSelectedInstance.getCommencedDate() != null ? new Date(voSelectedInstance.getCommencedDate()) : null); //WDEV-7141 form.ctnDetails().txtComment().setValue(voSelectedInstance.getComment()); //WDEV-20591 fillDosesGridReadOnly(voSelectedInstance.getPrescribedDoses()); }
private void populateInstanceControls(PatientMedicationVo voSelectedInstance) { form.ctnDetails().customControlCodingItem().setValue(voSelectedInstance); form.ctnDetails().cmbSource().setValue(voSelectedInstance.getSourceofInformation()); form.ctnDetails().cmbFrequency().setValue(voSelectedInstance.getFrequency()); form.ctnDetails().chkTTO().setValue(voSelectedInstance.getIsInTTOIsNotNull() ? voSelectedInstance.getIsInTTO().booleanValue() : false); form.ctnDetails().intNumDays().setValue(voSelectedInstance.getNoDaysSupply()); form.ctnDetails().cmbCommencedBy().setValue(voSelectedInstance.getCommencedByType()); if (voSelectedInstance.getHcpCommencedIsNotNull()) { form.ctnDetails().qmbCommencedBy().newRow(voSelectedInstance.getHcpCommenced(), voSelectedInstance.getHcpCommenced().getName().toString()); form.ctnDetails().qmbCommencedBy().setValue(voSelectedInstance.getHcpCommencedIsNotNull() ? voSelectedInstance.getHcpCommenced() : null); } else { form.ctnDetails().qmbCommencedBy().setValue(null); } form.ctnDetails().dteCommenced().setValue(voSelectedInstance.getCommencedDate() != null ? new Date(voSelectedInstance.getCommencedDate()) : null); //WDEV-7141 form.ctnDetails().txtComment().setValue(voSelectedInstance.getComment()); fillDosesGridReadOnly(voSelectedInstance.getPrescribedDoses()); }