private void setCsPrimaryProblem(PatientPresentingProblemsVo voPatientProblem, boolean isChkPrimaryChecked) { CSPrimaryProblemVo voCSPrimaryProcedure = getPrimaryProblemRecord(voPatientProblem); // Update only when checked or record existing if (voCSPrimaryProcedure != null || isChkPrimaryChecked) { if (voCSPrimaryProcedure == null) { voCSPrimaryProcedure = populatePrimaryProblemDataFromScreen(new CSPrimaryProblemVo(), voPatientProblem, isChkPrimaryChecked); if (voPatientProblem.getPrimaryForCareSpells() == null) voPatientProblem.setPrimaryForCareSpells(new CSPrimaryProblemVoCollection()); voPatientProblem.getPrimaryForCareSpells().add(voCSPrimaryProcedure); } else { int index = voPatientProblem.getPrimaryForCareSpells().indexOf(voCSPrimaryProcedure); if (index >= 0) { voCSPrimaryProcedure = populatePrimaryProblemDataFromScreen(voCSPrimaryProcedure, voPatientProblem, isChkPrimaryChecked); voPatientProblem.getPrimaryForCareSpells().set(index, voCSPrimaryProcedure); } } } }
private CSPrimaryProblemVo getPrimaryProblemRecord(PatientPresentingProblemsVo voPatientProblem) { if (voPatientProblem == null || voPatientProblem.getPrimaryForCareSpells() == null) return null; CSPrimaryProblemVoCollection voColl = voPatientProblem.getPrimaryForCareSpells(); for (int i = 0; voColl != null && i < voColl.size(); i++) { boolean sameProcedure = voColl.get(i).getPatientProblemIsNotNull() && voColl.get(i).getPatientProblem().equals(voPatientProblem); boolean sameCareContext = voColl.get(i).getCareContextIsNotNull() && voColl.get(i).getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext()); if (sameProcedure && sameCareContext) return voColl.get(i); } return null; }
private void populatePresentPatientProblemControls(PatientPresentingProblemsVo voPatientPresentingProblems) { GenForm.grdProblemsRow row = form.grdProblems().getRows().newRow(); row.setcolProblems(voPatientPresentingProblems.getProblem()); if (voPatientPresentingProblems.getPrimaryForCareSpellsIsNotNull()) row.setcolIsPrimary(isPrimaryProblem(voPatientPresentingProblems.getID_PatientProblem(), voPatientPresentingProblems.getPrimaryForCareSpells())); else row.setcolIsPrimary(false); row.setcolSelect(AbsentPresent.PRESENT); row.setcolOnset(voPatientPresentingProblems.getOnset()); row.setcolNotes(voPatientPresentingProblems.getProblemNote());// .getPatientProblem()); row.setValue(voPatientPresentingProblems); }
private PatientPresentingProblemsVo searchPresentPatientProblem(grdProblemsRow row) { PatientProblemVoCollection voColl = domain.listPatientProblemsByPatient(form.getGlobalContext().Core.getPatientShort()); if (voColl != null) { for (int i = 0; i < voColl.size(); i++) { // if was linked if (voColl.get(i).getProblemIsNotNull() && voColl.get(i).getProblem().equals(row.getValue()) && voColl.get(i).getCareContext().getID_CareContext().equals(form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext())) { return new PatientPresentingProblemsVo(); } else { PatientPresentingProblemsVo patientProblems = domain.getPatientProblems(voColl.get(i)); if (voColl.get(i).getProblemIsNotNull() && (!(voColl.get(i).getProblemIsNotNull() && voColl.get(i).getProblem().equals(row.getValue())) && row.getcolProblems().equals((patientProblems).getProblem()))) { return patientProblems; } else if (voColl.get(i).getProblemIsNotNull() && ((voColl.get(i).getProblemIsNotNull() && voColl.get(i).getProblem().equals(row.getValue())) && row.getcolProblems().equals((patientProblems).getProblem()) && !voColl.get(i).getCareContext().getID_CareContext().equals(form.getGlobalContext().Core.getCurrentCareContext().getID_CareContext()))) { return patientProblems; } } } } return new PatientPresentingProblemsVo(); }
public PatientPresentingProblemsVo getPatientProblems(PatientProblemRefVo voRef) { if(voRef == null) throw new DomainRuntimeException("Invalid record to get"); return PatientPresentingProblemsVoAssembler.create((PatientProblem) getDomainFactory().getDomainObject(PatientProblem.class, voRef.getID_PatientProblem())); }