/** * 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); }
/** * Returns family object, or null if doesn't exist or current user has no rights. * * @param id 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 get(String id) { return this.familyTools.getFamilyById(id); }
@Override public Family getFamilyById(String familyId) { return this.createSecureFamily(this.familyTools.getFamilyById(familyId)); }
private JSONObject getFullFamilyJSON(String familyID, Object[] summaryData, UriInfo uriInfo) { Family family = this.familyTools.getFamilyById(familyID); if (family != null) { JSONObject familyJSON = family.toJSON(); addMetadata(familyJSON, summaryData); return familyJSON; } return null; }
private JSONObject getFullFamilyJSON(String familyID, Object[] summaryData, UriInfo uriInfo) { Family family = this.familyTools.getFamilyById(familyID); if (family != null) { JSONObject familyJSON = family.toJSON(); addMetadata(familyJSON, summaryData); return familyJSON; } return null; }
/** * Checks if a patient can be linked to a family. The id of the patient to link is patientItLinkId. The family is * given by documentId: If document is a family id, it is read directly by its id. If it's a patient id, the family * is the one associated with the patient. * * @param familyId a valid family id * @param patientToLinkId id of a patient to link to family * @return JSONObject see {@link JSONResponse} */ public JSONResponse canPatientBeLinked(String familyId, String patientToLinkId) { try { if (!this.familyTools.familyExists(familyId)) { return new InvalidFamilyIdResponse(); } Family family = this.familyTools.getFamilyById(familyId); Patient patient = this.patientRepository.get(patientToLinkId); // an exception will be thrown in case of any errors this.familyTools.canAddToFamily(family, patient, true); return new ValidLinkJSONResponse(); } catch (Exception ex) { return this.convertExceptionIntoJSONResponse(ex); } }
/** * Checks if a patient can be linked to a family. The id of the patient to link is patientItLinkId. The family is * given by documentId: If document is a family id, it is read directly by its id. If it's a patient id, the family * is the one associated with the patient. * * @param familyId a valid family id * @param patientToLinkId id of a patient to link to family * @return JSONObject see {@link JSONResponse} */ public JSONResponse canPatientBeLinked(String familyId, String patientToLinkId) { try { if (!this.familyTools.familyExists(familyId)) { return new InvalidFamilyIdResponse(); } Family family = this.familyTools.getFamilyById(familyId); Patient patient = this.patientRepository.get(patientToLinkId); // an exception will be thrown in case of any errors this.familyTools.canAddToFamily(family, patient, true); return new ValidLinkJSONResponse(); } catch (Exception ex) { return this.convertExceptionIntoJSONResponse(ex); } }
Family family = this.familyTools.getFamilyById(familyId);
Family family = this.familyTools.getFamilyById(familyId);
Family family = this.familyTools.getFamilyById(documentId); if (family != null) { this.familyTools.forceRemoveAllMembers(family);
Family family = this.familyTools.getFamilyById(documentId); if (family != null) { this.familyTools.forceRemoveAllMembers(family);
family = this.familyTools.getFamilyById(documentId); if (family == null) { return new InvalidFamilyIdResponse();
family = this.familyTools.getFamilyById(documentId); if (family == null) { return new InvalidFamilyIdResponse();