private boolean isPrimary(PatientDiagnosisAtConsultationVo diagnose) { if(diagnose == null || diagnose.getPrimaryForCareSpells() == null || diagnose.getPrimaryForCareSpells().size() == 0) return false; for(CSPrimaryDiagnosisShortVo primary : diagnose.getPrimaryForCareSpells()) { if(primary == null || primary.getCareContext() == null) continue; if(primary.getCareContext().equals(form.getLocalContext().getCareContext()) && Boolean.TRUE.equals(primary.getIsActive()))//WDEV-17356 return true; } return false; }
private boolean isPrimary(PatientDiagnosisAtConsultationVo diagnose) { if(diagnose == null || diagnose.getPrimaryForCareSpells() == null || diagnose.getPrimaryForCareSpells().size() == 0) return false; for(CSPrimaryDiagnosisShortVo primary : diagnose.getPrimaryForCareSpells()) { if(primary == null || primary.getCareContext() == null) continue; if(primary.getCareContext().equals(diagnose.getCareContext()) && Boolean.TRUE.equals(primary.getIsActive())) return true; } return false; }
private void clearPreviousPrimaryDiagnosis(PatientDiagnosisAtConsultationVo diagnosisVo) { if(diagnosisVo == null) return; if(form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList() == null || form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList().size() == 0) return; if(!form.chkMain().getValue()) return; for(PatientDiagnosisAtConsultationVo diag : form.getGlobalContext().Core.getPatientDiagnosisAtConsultationList()) { if(diag == null || diag.equals(diagnosisVo)) continue; CSPrimaryDiagnosisShortVoCollection primaryColl = diag.getPrimaryForCareSpells(); if(primaryColl == null || primaryColl.size() == 0) continue; for(CSPrimaryDiagnosisShortVo primary : primaryColl) { if(primary == null) continue; if(primary.getCareContextIsNotNull() && primary.getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext())) { primaryColl.remove(primary); diag.setPrimaryForCareSpells(primaryColl); break; } } } }