private BodySystemCollection getSystemsForCreation(SystemReviewVoCollection currentActiveNotes, SystemReviewForPresentingProblemConfigVo systemsReviewForproblem) { if (systemsReviewForproblem == null) return null; BodySystemCollection systemCollection = systemsReviewForproblem.getSystem(); if (currentActiveNotes == null) { return systemsReviewForproblem.getSystem(); } if (systemsReviewForproblem.getSystem() != null && systemsReviewForproblem.getSystem().size() > 0 && currentActiveNotes.size() > 0) { for (int i = 0; i < currentActiveNotes.size(); i++) { if (systemsReviewForproblem.getSystem().contains(currentActiveNotes.get(i).getSystems())) { systemCollection.remove(currentActiveNotes.get(i).getSystems()); } } } return systemCollection; }
private SystemReviewForPresentingProblemConfigVo populateDataFromScreen(SystemReviewForPresentingProblemConfigVo record) { if( record == null) return null; if( record.getProblem() == null) record.setProblem(form.grdProblem().getSelectedRow().getValue()); BodySystemCollection symColl = new BodySystemCollection(); for(int i = 0; i < form.grdSymptoms().getRows().size();i++) { if( form.grdSymptoms().getRows().get(i).getColumnSelect() == true) symColl.add(form.grdSymptoms().getRows().get(i).getValue()); } record.setSystem(symColl); return record; }
protected void onBtnNewClick() throws ims.framework.exceptions.PresentationLogicException { //form.getGlobalContext().Emergency.setAddEditForSystemsReviewDlg(Boolean.FALSE); //WDEV-17118 SystemReviewVoCollection currentActiveNotes = domain.getAllActiveSystemNotes(form.getLocalContext().getCareContextRef()); SystemReviewForPresentingProblemConfigVo systemsReviewForproblem = domain.getSystemReviewForPresentingProblem(form.getLocalContext().getClinicalProblemRef()); BodySystemCollection newSystems = getSystemsForCreation(currentActiveNotes, systemsReviewForproblem); SystemReviewVoCollection newSystemReviewColl = new SystemReviewVoCollection(); for (int i = 0; i < newSystems.size(); i++) { SystemReviewVo tempVo = new SystemReviewVo(); tempVo.setPatient(form.getLocalContext().getPatientRef()); tempVo.setAttendance(form.getLocalContext().getCareContextRef()); tempVo.setEpisode(form.getLocalContext().getEpisodeOfCareRef()); tempVo.setSystems(newSystems.get(i)); newSystemReviewColl.add(tempVo); } //engine.open(form.getForms().Emergency.SystemsReviewDialog, new Object[]{tempVo, form.getLocalContext().getClinicalProblemRef()}); if (newSystemReviewColl.size() == 0) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); updateControlsState(); return; } form.getGlobalContext().Emergency.setSystemReviewCollection(newSystemReviewColl); engine.open(form.getForms().Emergency.SystemReviewNotesDialog); }
private void populateSymptomGrid(SystemReviewForPresentingProblemConfigVo tempVo) { form.grdSymptoms().getRows().clear(); BodySystemCollection symptomsCollection = LookupHelper.getBodySystem(domain.getLookupService()); if(symptomsCollection != null) { for(int i = 0;i < symptomsCollection.size();i++) { ims.emergency.forms.systemreviewconfiguration.GenForm.grdSymptomsRow row = form.grdSymptoms().getRows().newRow(); row.setColumnSymptom(symptomsCollection.get(i).getText()); row.setColumnSelect(false); row.setValue(symptomsCollection.get(i)); } } if(tempVo != null && tempVo.getSystemIsNotNull()) { for(int j = 0; j < tempVo.getSystem().size();j++) { for(int k = 0; k < form.grdSymptoms().getRows().size();k++) { if(form.grdSymptoms().getRows().get(k).getValue().equals(tempVo.getSystem().get(j))) { form.grdSymptoms().getRows().get(k).setColumnSelect(true); } } } } }
private Boolean checkIsEnabled(SystemReviewVoCollection currentActiveNotes) { SystemReviewForPresentingProblemConfigVo systemsReviewForProblem = null; Boolean isOk = Boolean.FALSE; if (form.getLocalContext().getClinicalProblemRef() != null) { systemsReviewForProblem = domain.getSystemReviewForPresentingProblem(form.getLocalContext().getClinicalProblemRef()); } if (currentActiveNotes == null && systemsReviewForProblem != null && systemsReviewForProblem.getSystem() != null && systemsReviewForProblem.getSystem().size() > 0) { isOk = Boolean.TRUE; } else if (currentActiveNotes != null && systemsReviewForProblem != null && systemsReviewForProblem.getSystem() != null) { if (currentActiveNotes.size() != systemsReviewForProblem.getSystem().size() && systemsReviewForProblem.getSystem().size() > currentActiveNotes.size()) { isOk = Boolean.TRUE; } else { BodySystemCollection clone = (BodySystemCollection) systemsReviewForProblem.getSystem().clone(); for (int x = 0; x < currentActiveNotes.size(); x++) { for (int y = 0; y < systemsReviewForProblem.getSystem().size(); y++) { if (currentActiveNotes.get(x).getSystems().equals(systemsReviewForProblem.getSystem().get(y))) { clone.remove(systemsReviewForProblem.getSystem().get(y)); } } } isOk = (clone.size() > 0); } } return isOk; }