private CSPrimaryDiagnosisVo getPrimaryDiagnosisRecord(PatientDiagnosisEDischargeVo voPatDiagnosis) { if (voPatDiagnosis == null || voPatDiagnosis.getPrimaryForCareSpells() == null) return null; CSPrimaryDiagnosisVoCollection voColl = voPatDiagnosis.getPrimaryForCareSpells(); for (int i = 0; voColl != null && i < voColl.size(); i++) { boolean sameDiagnosis = voColl.get(i).getDiagnosisIsNotNull() && voColl.get(i).getDiagnosis().equals(voPatDiagnosis); boolean sameCareContext = voColl.get(i).getCareContextIsNotNull() && voColl.get(i).getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext()); if (sameDiagnosis && sameCareContext) return voColl.get(i); } return null; }
private void setCsPrimaryDiagnosis(PatientDiagnosisEDischargeVo voPatDiagnosis, boolean isChkPrimaryChecked) { CSPrimaryDiagnosisVo voCSPrimaryDiagnosis = getPrimaryDiagnosisRecord(voPatDiagnosis); if (voCSPrimaryDiagnosis != null || isChkPrimaryChecked) { if (voCSPrimaryDiagnosis == null) { voCSPrimaryDiagnosis = populatePrimaryDiagnosisDataFromScreen(new CSPrimaryDiagnosisVo(), voPatDiagnosis, isChkPrimaryChecked); if (voPatDiagnosis.getPrimaryForCareSpells() == null) voPatDiagnosis.setPrimaryForCareSpells(new CSPrimaryDiagnosisVoCollection()); voPatDiagnosis.getPrimaryForCareSpells().add(voCSPrimaryDiagnosis); } else { int index = voPatDiagnosis.getPrimaryForCareSpells().indexOf(voCSPrimaryDiagnosis); if (index >= 0) { voCSPrimaryDiagnosis = populatePrimaryDiagnosisDataFromScreen(voCSPrimaryDiagnosis, voPatDiagnosis, isChkPrimaryChecked); voPatDiagnosis.getPrimaryForCareSpells().set(index, voCSPrimaryDiagnosis); } } } }
private void setCsPrimaryDiagnosis(PatientDiagnosisEDischargeVo voPatDiagnosis, boolean isChkPrimaryChecked, boolean bDiagnosisContainer) { CSPrimaryDiagnosisVo voCSPrimaryDiagnosis = getPrimaryDiagnosisRecord(voPatDiagnosis); if (voCSPrimaryDiagnosis != null || isChkPrimaryChecked) { if (voCSPrimaryDiagnosis == null) { voCSPrimaryDiagnosis = populatePrimaryDiagnosisDataFromScreen(new CSPrimaryDiagnosisVo(), voPatDiagnosis, isChkPrimaryChecked, bDiagnosisContainer); if (voPatDiagnosis.getPrimaryForCareSpells() == null) voPatDiagnosis.setPrimaryForCareSpells(new CSPrimaryDiagnosisVoCollection()); voPatDiagnosis.getPrimaryForCareSpells().add(voCSPrimaryDiagnosis); } else { int index = voPatDiagnosis.getPrimaryForCareSpells().indexOf(voCSPrimaryDiagnosis); if (index >= 0) { voCSPrimaryDiagnosis = populatePrimaryDiagnosisDataFromScreen(voCSPrimaryDiagnosis, voPatDiagnosis, isChkPrimaryChecked, bDiagnosisContainer); voPatDiagnosis.getPrimaryForCareSpells().set(index, voCSPrimaryDiagnosis); } } } }
private boolean isPrimaryDiagnosisRecord(PatientDiagnosisOpNotesVo voPatDiagnosis) { if (voPatDiagnosis == null || voPatDiagnosis.getPrimaryForCareSpells() == null) return false; CSPrimaryDiagnosisVoCollection voColl = voPatDiagnosis.getPrimaryForCareSpells(); for (int i = 0; voColl != null && i < voColl.size(); i++) { CSPrimaryDiagnosisVo primaryDiagnosisVo = voColl.get(i); boolean sameDiagnosis = primaryDiagnosisVo.getDiagnosisIsNotNull() && primaryDiagnosisVo.getDiagnosis().equals(voPatDiagnosis); boolean sameCareContext = primaryDiagnosisVo.getCareContextIsNotNull() && primaryDiagnosisVo.getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext()); if (sameDiagnosis && sameCareContext && primaryDiagnosisVo.getIsActiveIsNotNull() && primaryDiagnosisVo.getIsActive()) return true; } return false; }
private void setCsPrimaryDiagnosis(PatientDiagnosisVo voPatDiagnosis, boolean isChkPrimaryChecked) { CSPrimaryDiagnosisVo voCSPrimaryDiagnosis = getPrimaryDiagnosisRecord(voPatDiagnosis); if (voCSPrimaryDiagnosis != null || isChkPrimaryChecked) { if (voCSPrimaryDiagnosis == null) { voCSPrimaryDiagnosis = populatePrimaryDiagnosisDataFromScreen(new CSPrimaryDiagnosisVo(), voPatDiagnosis, isChkPrimaryChecked); if (voPatDiagnosis.getPrimaryForCareSpells() == null) voPatDiagnosis.setPrimaryForCareSpells(new CSPrimaryDiagnosisVoCollection()); voPatDiagnosis.getPrimaryForCareSpells().add(voCSPrimaryDiagnosis); } else { int index = voPatDiagnosis.getPrimaryForCareSpells().indexOf(voCSPrimaryDiagnosis); if (index >= 0) { voCSPrimaryDiagnosis = populatePrimaryDiagnosisDataFromScreen(voCSPrimaryDiagnosis, voPatDiagnosis, isChkPrimaryChecked); voPatDiagnosis.getPrimaryForCareSpells().set(index, voCSPrimaryDiagnosis); } } } }
private boolean isPrimaryDiagnosisActive(PatientDiagnosisRefVo voPatDiagRef, CSPrimaryDiagnosisVoCollection voColl) { for (int i = 0; i < voColl.size(); i++) { CSPrimaryDiagnosisVo primary = voColl.get(i); boolean isActive = primary.getIsActiveIsNotNull() && primary.getIsActive().booleanValue(); boolean sameDiagnosis = primary.getDiagnosisIsNotNull() && primary.getDiagnosis().equals(voPatDiagRef); // WDEV-11693 - Also check for EpisodeOfCare - as now PatientDiagnosis & CSPrimaryDiagnosis are recorded at this level boolean sameEpisodeOfCare = primary.getEpisodeOfCareIsNotNull() && primary.getEpisodeOfCare().equals(form.getGlobalContext().Core.getEpisodeofCareShort()); boolean sameCareContext = (primary.getCareContextIsNotNull() && primary.getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext())) || (!form.getGlobalContext().Core.getCurrentCareContextIsNotNull() && !primary.getCareContextIsNotNull()); if (isActive && sameDiagnosis && sameEpisodeOfCare && sameCareContext) return true; } return false; }
private CSPrimaryDiagnosisVo getPrimaryDiagnosisRecord(PatientDiagnosisVo voPatDiagnosis) { if (voPatDiagnosis == null || voPatDiagnosis.getPrimaryForCareSpells() == null) return null; CSPrimaryDiagnosisVoCollection voColl = voPatDiagnosis.getPrimaryForCareSpells(); for (int i = 0; voColl != null && i < voColl.size(); i++) { boolean sameDiagnosis = voColl.get(i).getDiagnosisIsNotNull() && voColl.get(i).getDiagnosis().equals(voPatDiagnosis); // WDEV-11693 - Also check for EpisodeOfCare - as now PatientDiagnosis & CSPrimaryDiagnosis are recorded at this level boolean sameEpisodeOfCare = voColl.get(i).getEpisodeOfCareIsNotNull() && voColl.get(i).getEpisodeOfCare().equals(form.getGlobalContext().Core.getEpisodeofCareShort()); boolean sameCareContext = (voColl.get(i).getCareContextIsNotNull() && voColl.get(i).getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext())) || (!form.getGlobalContext().Core.getCurrentCareContextIsNotNull() && !voColl.get(i).getCareContextIsNotNull()); if (sameDiagnosis && sameEpisodeOfCare && sameCareContext) return voColl.get(i); } return null; }
private void setCsPrimaryDiagnosis(PatientDiagnosisOpNotesVo voPatDiagnosis, boolean isChkPrimaryChecked) { CSPrimaryDiagnosisVo voCSPrimaryDiagnosis = getPrimaryDiagnosisRecord(voPatDiagnosis); if (voCSPrimaryDiagnosis != null || isChkPrimaryChecked) { if (voCSPrimaryDiagnosis == null) { voCSPrimaryDiagnosis = populatePrimaryDiagnosisDataFromScreen(new CSPrimaryDiagnosisVo(), voPatDiagnosis, isChkPrimaryChecked); if (voPatDiagnosis.getPrimaryForCareSpells() == null) voPatDiagnosis.setPrimaryForCareSpells(new CSPrimaryDiagnosisVoCollection()); voPatDiagnosis.getPrimaryForCareSpells().add(voCSPrimaryDiagnosis); } else { int index = voPatDiagnosis.getPrimaryForCareSpells().indexOf(voCSPrimaryDiagnosis); if (index >= 0) { voCSPrimaryDiagnosis = populatePrimaryDiagnosisDataFromScreen(voCSPrimaryDiagnosis, voPatDiagnosis, isChkPrimaryChecked); voPatDiagnosis.getPrimaryForCareSpells().set(index, voCSPrimaryDiagnosis); } } } }
private CSPrimaryDiagnosisVo getPrimaryDiagnosisRecord(PatientDiagnosisOpNotesVo voPatDiagnosis) { if (voPatDiagnosis == null || voPatDiagnosis.getPrimaryForCareSpells() == null) return null; CSPrimaryDiagnosisVoCollection voColl = voPatDiagnosis.getPrimaryForCareSpells(); for (int i = 0; voColl != null && i < voColl.size(); i++) { boolean sameDiagnosis = voColl.get(i).getDiagnosisIsNotNull() && voColl.get(i).getDiagnosis().equals(voPatDiagnosis); boolean sameCareContext = voColl.get(i).getCareContextIsNotNull() && voColl.get(i).getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext()); if (sameDiagnosis && sameCareContext) return voColl.get(i); } return null; }
private CSPrimaryDiagnosisVo getPrimaryDiagnosisRecord(PatientDiagnosisEDischargeListVo voPatDiagnosis) { if (voPatDiagnosis == null || voPatDiagnosis.getPrimaryForCareSpells() == null) return null; CSPrimaryDiagnosisVoCollection voColl = voPatDiagnosis.getPrimaryForCareSpells(); for (int i = 0; voColl != null && i < voColl.size(); i++) { boolean sameDiagnosis = voColl.get(i).getDiagnosisIsNotNull() && voColl.get(i).getDiagnosis().equals(voPatDiagnosis); boolean sameCareContext = voColl.get(i).getCareContextIsNotNull() && voColl.get(i).getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext()); if (sameDiagnosis && sameCareContext) return voColl.get(i); } return null; }
private void setCsPrimaryDiagnosis(PatientDiagnosisEDischargeListVo voPatDiagnosis, boolean isChkPrimaryChecked, boolean bDiagnosisContainer) { CSPrimaryDiagnosisVo voCSPrimaryDiagnosis = getPrimaryDiagnosisRecord(voPatDiagnosis); if (voCSPrimaryDiagnosis != null || isChkPrimaryChecked) { if (voCSPrimaryDiagnosis == null) { voCSPrimaryDiagnosis = populatePrimaryDiagnosisDataFromScreen(new CSPrimaryDiagnosisVo(), voPatDiagnosis, isChkPrimaryChecked, bDiagnosisContainer); if (voPatDiagnosis.getPrimaryForCareSpells() == null) voPatDiagnosis.setPrimaryForCareSpells(new CSPrimaryDiagnosisVoCollection()); voPatDiagnosis.getPrimaryForCareSpells().add(voCSPrimaryDiagnosis); } else { int index = voPatDiagnosis.getPrimaryForCareSpells().indexOf(voCSPrimaryDiagnosis); if (index >= 0) { voCSPrimaryDiagnosis = populatePrimaryDiagnosisDataFromScreen(voCSPrimaryDiagnosis, voPatDiagnosis, isChkPrimaryChecked, bDiagnosisContainer); voPatDiagnosis.getPrimaryForCareSpells().set(index, voCSPrimaryDiagnosis); } } } }