private void addOrUpdateAssociationRecord(ClinicalDIAssociationVoCollection newResult, ClinicalDIAssociationVoCollection result, ValueObject value, CDIAssociationDescription relationship) { if(value != null) { boolean found = false; for(int y = 0; y < result.size(); y++) { ClinicalDIAssociationVo record = result.get(y); ValueObject assocRec = null; if(record.getAssocDiagnosisIsNotNull()) assocRec = record.getAssocDiagnosis(); else if(record.getAssocProcedureIsNotNull()) assocRec = record.getAssocProcedure(); else if(record.getAssocProblemIsNotNull()) assocRec = record.getAssocProblem(); if(assocRec != null && assocRec.equals(value)) { //When relationship is removed we inactivate the record if(relationship == null) record.setIsActive(new Boolean(false)); else record.setIsActive(new Boolean(true)); record.setAssociationDescription(relationship); found = true; break; } } if(!found && relationship != null) { ClinicalDIAssociationVo newRecord = getNewAssociationRecord(value, relationship); newResult.add(newRecord); } } }
private ClinicalDIAssociationVo getNewAssociationRecord(ValueObject value, CDIAssociationDescription relationship) { ClinicalDIAssociationVo newRecord = setPrimary(new ClinicalDIAssociationVo()); newRecord.setAssociationDescription(relationship); newRecord.setIsActive(new Boolean(true)); if(value instanceof PatientDiagnosisRefVo) { newRecord.setAssocDiagnosis((PatientDiagnosisRefVo)value); } else if(value instanceof PatientProcedureRefVo) { newRecord.setAssocProcedure((PatientProcedureRefVo)value); } else if(value instanceof PatientProblemRefVo) { newRecord.setAssocProblem((PatientProblemRefVo)value); } return newRecord; }
private String getAssociationTooltip(CDIAssociationDescription description, String association, String text, String headerTooltip) { StringBuffer tooltip = new StringBuffer(headerTooltip); if (description != null) { tooltip.append(new Textile().process("*" + association + "*" + " " + description.toString() + " " + "*" + text + "*")); } return tooltip.toString(); }
private boolean isAtLeastOneComplication() { ClinicalDIAssociationVoCollection voColl = form.getGlobalContext().Clinical.getClinicalDIAssociationVoCollection(); for (int i = 0; voColl != null && i < voColl.size(); i++) { if (voColl.get(i).getAssociationDescription() != null && voColl.get(i).getAssociationDescription().equals(CDIAssociationDescription.ISACOMPLICATIONOF)) return true; } return false; }