private void openOverview(MedicationOverViewVo voOverView) { //WDEV-6577 Fixes rie by doing another domain list on rie elements if (voOverView != null) domain.listMedications(voOverView); form.getLocalContext().setCurrentOverView(voOverView); MedicationDosesDynamicGridPopulation gridPopulation = getHelper(); if ( (voOverView != null) && (voOverView.getMedicationIsNotNull()) ) { if (form.chkFilter().getValue()) gridPopulation.populateHideDiscontinued(voOverView); else gridPopulation.populate(voOverView); //Defaulting Authoring HCP and Date form.customControlAuthoringInfo().setValue(voOverView.getAuthoringInformation()); } }
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); }
public void populateHideDiscontinued(MedicationOverViewVo voOverView) { this.grid.getRows().clear(); if ( (voOverView != null) && (voOverView.getMedicationIsNotNull()) ) { voOverView.getMedication().sort(); for (int i = 0 ; i < voOverView.getMedication().size() ; i++) { Color objColor = (i% 2) == 0 ? FIRST_COLOUR : SECOND_COLOUR; addMedicationRow(voOverView.getMedication().get(i), true, objColor); } } }
public MedicationOverViewVo saveMedicationOverviewVo(MedicationOverViewVo voMedicationOverviewVo, PatientRefVo patientRefVo) throws StaleObjectException { if(voMedicationOverviewVo == null) throw new CodingRuntimeException("Cannot save null value for MedicationOverViewVo"); if (!voMedicationOverviewVo.isValidated()) throw new CodingRuntimeException("Medication Overview has not been validated"); DomainFactory factory = getDomainFactory(); if (voMedicationOverviewVo.getID_MedicationOverview() == null)//Inserting a record { String hql = " from MedicationOverview mv where mv.careContext.id = :contextid and mv.type = :typeId"; List overs = factory.find(hql, new String[]{"contextid", "typeId"}, new Object[]{voMedicationOverviewVo.getCareContext().getID_CareContext(), getDomLookup(voMedicationOverviewVo.getType())}); if(overs.size() != 0) throw new StaleObjectException(null, "A Medication OverView record already exists for this Care Context and Overview Type, the screen will be refreshed."); } MedicationOverview domMed = MedicationOverViewVoAssembler.extractMedicationOverview(factory, voMedicationOverviewVo); factory.save(domMed); return MedicationOverViewVoAssembler.create(domMed); }
private void openOverview(MedicationOverViewVo voOverView) { if (voOverView != null) domain.listMedications(voOverView); form.getLocalContext().setCurrentOverView(voOverView); MedicationDosesDynamicGridPopulation gridPopulation = getHelper(); if ( (voOverView != null) && (voOverView.getMedicationIsNotNull()) ) { if (form.chkFilter().getValue()) gridPopulation.populateHideDiscontinued(voOverView); else gridPopulation.populate(voOverView); //Defaulting Authoring HCP and Date form.customControlAuthoringInfo().setValue(voOverView.getAuthoringInformation()); } }
protected void onRecbrOverviewsValueChanged() throws PresentationLogicException { MedicationOverViewVo voOverView = new MedicationOverViewVo(); voOverView = domain.getMedicationOverView(form.recbrOverviews().getValue()); if (voOverView != null) openOverview(voOverView); form.setMode(FormMode.VIEW); displayOrHideEnableDisableScreenSpecificControls(); }
public void populate(MedicationOverViewVo voOverView) { this.grid.getRows().clear(); if ( (voOverView != null) && (voOverView.getMedicationIsNotNull()) ) { voOverView.getMedication().sort(); for (int i = 0 ; i < voOverView.getMedication().size() ; i++) { Color objColor = (i% 2) == 0 ? FIRST_COLOUR : SECOND_COLOUR; addMedicationRow(voOverView.getMedication().get(i), false, objColor); } } }
public MedicationOverViewVo getMedicationOverView(MedicationOverviewRefVo voRefMedication) { if(voRefMedication == null) throw new DomainRuntimeException("Invalid Medication record to get"); return MedicationOverViewVoAssembler.create((MedicationOverview)getDomainFactory().getDomainObject(MedicationOverview.class, voRefMedication.getID_MedicationOverview())); }
protected void onRecbrOverviewsValueChanged() throws PresentationLogicException { MedicationOverViewVo voOverView = new MedicationOverViewVo(); voOverView = domain.getMedicationOverView(form.recbrOverviews().getValue()); if (voOverView != null) openOverview(voOverView); form.setMode(FormMode.VIEW); displayOrHideEnableDisableScreenSpecificControls(); form.getGlobalContext().Clinical.setMedMultipleDosesPatSearchCriteria(getSearchCriteria()); }
protected void onlyrDetailsTabChanged(LayerBridge tab) { if(tab.equals(form.lyrDetails().tabPreview()) && form.getLocalContext().getSelectedItem() != null && form.getLocalContext().getReportChangedIsNotNull() && form.getLocalContext().getReportChanged().booleanValue()) { form.lyrDetails().tabPreview().htmReport().setHTML(""); if(form.getLocalContext().getSelectedItem() != null && form.getLocalContext().getReportChangedIsNotNull() && form.getLocalContext().getReportChanged().booleanValue() && form.getLocalContext().getSelectedItem().getID_ClinicalCorrespondence() != null) { buildReport(); form.getLocalContext().setReportChanged(Boolean.FALSE); } } //WDEV-1039 - 3) We need to Display the Medication Overview record for this context, if the ClinicalCorrespondenceBo has not been saved for the context we are in we need to retrieve the Overview and display it. else if(tab.equals(form.lyrDetails().tabServices()) && !isMedicationDataLoaded()) { form.lyrDetails().tabServices().dyngrdMedication().clear(); MedicationOverViewFilterVo voFilter = new MedicationOverViewFilterVo(); voFilter.setType(MedicationSnapShot.DISCHARGE); voFilter.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voFilter.setPatientRef(form.getGlobalContext().Core.getPatientShort()); MedicationOverViewVo voOverView = domain.getLatestMedicationOverViewVo(voFilter); if (voOverView != null && voOverView.getMedicationIsNotNull()) { //WDEV-1039 - 2)We need to change the icons used in the medication preview to those used in the medication page MedicationDosesDynamicGridPopulation gridPopulation = new MedicationDosesDynamicGridPopulation(form.lyrDetails().tabServices().dyngrdMedication(), form.getImages().Admin.Activity, form.getImages().ICP.Child); gridPopulation.initializeGrid(); gridPopulation.populate(voOverView); form.getLocalContext().setIsMedicationDataLoaded(Boolean.TRUE); } } else if(tab.equals(form.lyrDetails().tabCommentsOPD()) && form.getLocalContext().getOutpatientSummaryChanged().booleanValue() && form.getMode().equals(FormMode.EDIT)) { if(form.getLocalContext().getSelectedItem() == null) { OutpatientNotesOutcomeVo voOPDSummary = domain.getOPDSummary(form.getGlobalContext().Core.getCurrentClinicalContact()); if(voOPDSummary != null && form.lyrDetails().tabCommentsOPD().grdClinicalNotes().getRows().size() == 3) { form.lyrDetails().tabCommentsOPD().grdClinicalNotes().getRows().get(0).setColText(voOPDSummary.getClinicalNote().getObjectiveNote()); form.lyrDetails().tabCommentsOPD().grdClinicalNotes().getRows().get(1).setColText(voOPDSummary.getClinicalNote().getPlanNote()); form.lyrDetails().tabCommentsOPD().grdClinicalNotes().getRows().get(2).setColText(voOPDSummary.getInstructionNextClinic()); form.lyrDetails().tabCommentsOPD().cmbOPFollowUp().setValue(voOPDSummary.getOutcome()); form.lyrDetails().tabCommentsOPD().intOPReviewIn().setValue(voOPDSummary.getReviewIn()); form.lyrDetails().tabCommentsOPD().cmbOPReviewIn().setValue(voOPDSummary.getReviewinUnits()); form.getLocalContext().setOutpatientSummaryChanged(Boolean.FALSE); } } } }
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); }
public MedicationOverViewVo getLatestMedicationOverViewVo(MedicationOverViewFilterVo filter) { MedicationMultipleDoses intf = (MedicationMultipleDoses) getDomainImpl(MedicationDosesImpl.class); return intf.getLatestMedicationOverViewVo(filter); }
private void open(Boolean search) { form.ctnDetails().setCollapsed(true); MedicationOverViewVo voOverView = new MedicationOverViewVo(); PatientRefVo voPat = new PatientRefVo(); voPat.setID_Patient(form.getGlobalContext().Core.getPatientShort().getID_Patient()); MedicationOverViewFilterVo voFilter = getSearchCriteria(); clearAll(); MedicationOverViewLiteVoCollection voColl = null; if (search) { voColl = domain.listMedicationOverviews(voFilter); if (voColl == null) { engine.showMessage("There is no current Medication Overview for this patient."); displayOrHideEnableDisableScreenSpecificControls(); return; } for (int i = 0 ; i < voColl.size() ; i++) { MedicationOverViewLiteVo voOverLite = voColl.get(i); StringBuffer sb = new StringBuffer(); sb.append(voOverLite.getTypeIsNotNull() ? voOverLite.getType().toString()+ ", " : ""); sb.append(voOverLite.getAuthoringInformationIsNotNull() ? voOverLite.getAuthoringInformation().toString(" - ") + ", " : ""); form.recbrOverviews().newRow(voOverLite, sb.toString()); } if (voColl.size() > 0) { form.recbrOverviews().setValue(voColl.get(0)); } } if (form.recbrOverviews().getValue() != null) { voOverView = domain.getMedicationOverView(form.recbrOverviews().getValue()); openOverview(voOverView); } form.setMode(FormMode.VIEW); displayOrHideEnableDisableScreenSpecificControls(); form.getLocalContext().setSelectedInstance(null); }