/** * Delete family, modifying the both the family and patient records to reflect the change. * * @param familyId of the family to delete * @param deleteAllMembers indicator whether to delete all family member documents as well * @return true if successful; false if deletion failed or curent user has not enough rights */ public boolean deleteFamily(String familyId, boolean deleteAllMembers) { return this.familyTools.deleteFamily(familyId, deleteAllMembers); }
/** * Creates an empty family. * * @return Family object corresponding to the newly created family. */ public Family createFamily() { return this.familyTools.createFamily(); }
/** * Returns a family ID the patient belongs to. * * @param patientId id of the patient * @return Id of the, or null if patient does not belong to the family or current user has no view rights for the * patient. */ public Family getFamilyForPatient(String patientId) { return this.familyTools.getFamilyForPatient(patientId); }
@Override public boolean deleteFamily(String familyId, boolean deleteAllMembers) { Family family = this.familyRepository.get(familyId); if (family == null) { return false; } // the access rights checks are done in familyRepository.deleteFamily() return this.familyRepository.delete(family, deleteAllMembers); }
@Override public boolean familyExists(String familyId) { return this.familyRepository.get(familyId) != null; }
@Override public boolean familyExists(String familyId) { return this.familyRepository.getFamilyById(familyId) != null; }
/** * Returns family object, or null if doesn't exist or current user has no rights. * * @param familyId a PhenotTips family ID * @return Family object of the family with the given id, or null if familyId is not valid or current user does not * have permissions to view the family. */ public Family getFamilyById(String familyId) { return this.familyTools.getFamilyById(familyId); }
@Override public boolean removeMember(String patientId) { return this.familyTools.removeMember(patientId); }
/** * Adds a patient to the family, modifying both the family and patient records to reflect the change. * * @param patientId of the patient to add * @param familyId of the family to add patient to * @return true if patient was added. false if not, for example, if the patient is already in another family, * or if current user has no edit rights */ public boolean addMember(String patientId, String familyId) { return this.familyTools.addMember(patientId, familyId); }
@Override public Map<String, Map<String, String>> getMedicalReports() { return this.family.getMedicalReports(); }
@Override public String getWarningMessage() { return this.family.getWarningMessage(); }
@Override public boolean currentUserHasAccessRight(String familyId, Right right) { return this.familyTools.currentUserHasAccessRight(familyId, right); }
@Override public void setPedigree(Family family, Pedigree pedigree) throws PTException { this.familyTools.setPedigree(family, pedigree); }
/** * Returns family pedigree. Essentially this is a shortcut for getFamilyById().getPedigree() with a check that * family is not null. * * @param familyId must be a valid family id * @return pedigree object or null if no such family, no pedigree or no view rights for the family. */ public Pedigree getPedigreeForFamily(String familyId) { return this.familyTools.getPedigreeForFamily(familyId); }
@Override public List<String> getMembersIds() { return this.family.getMembersIds(); }
@Override public boolean containsSensitiveData() { return this.family.containsSensitiveData(); }
@Override public EntityReference getType() { return this.family.getType(); }
@Override public Document getSecureDocument() { return this.family.getSecureDocument(); }
@Override public String getName() { return this.family.getName(); }
/** * Removes a patient from the family, modifying the both the family and patient records to reflect the change. * * @param patientId of the patient to delete * @return true if patient was removed. false if not, for example, if the patient is not associated with a family, * or if current use rhas no delete rights */ public boolean removeMember(String patientId) { return this.familyTools.removeMember(patientId); }