@Unstable
@Role
public interface ConsentManager
Consent) at once; for example loading all consents
from a patient and converting them to JSON.| Modifier and Type | Method and Description |
|---|---|
Set<Consent> |
fromJSON(org.json.JSONArray consentsJSON)
A convenience function that allows for conversion of JSON representing several consents.
|
Set<Consent> |
getAllConsentsForPatient(Patient patient)
Returns the list of all consents configured in the system, with "granted"/"not granted" status
for the given patient for each consent.
|
Set<Consent> |
getAllConsentsForPatient(String patientId)
Same as
getAllConsentsForPatient(Patient), for the exception that the patient record
lookup happens internally. |
Set<Consent> |
getMissingConsentsForPatient(Patient patient)
Returns the list of consents configured in the system but NOT granted for the patient.
|
Set<Consent> |
getMissingConsentsForPatient(String patientId)
Same as
getMissingConsentsForPatient(Patient), for the exception that the patient record
lookup happens internally. |
Set<Consent> |
getSystemConsents()
The underlying system should have a configuration of different consents available.
|
boolean |
grantConsent(Patient patient,
String consentId)
Grants a specific consent in a patient record.
|
boolean |
hasConsent(Patient patient,
String consentId)
Checks if a specific consent is given for the patient record.
|
boolean |
hasConsent(String patientId,
String consentId)
Same as
hasConsent(Patient,String), for the exception that the patient record
lookup happens internally. |
boolean |
isValidConsentId(String consentId)
Checks if passed in consent id is actually configured (in the system).
|
boolean |
revokeConsent(Patient patient,
String consentId)
Revokes a specific consent in a patient record.
|
boolean |
setPatientConsents(Patient patient,
Iterable<String> consents)
Determines if the given ids are present in the system, and grants them on the given patient record.
|
org.json.JSONArray |
toJSON(Collection<Consent> consents)
A convenience function that allows for conversion of a list of consents into a
JSONArray containing JSON representations of all consents. |
Set<Consent> getSystemConsents()
boolean isValidConsentId(String consentId)
consentId - of consent which is to be testedtrue if consentId is a valid consent configure din the systemSet<Consent> getAllConsentsForPatient(Patient patient)
patient - record on which consents are granted (or not granted)Set<Consent> getAllConsentsForPatient(String patientId)
getAllConsentsForPatient(Patient), for the exception that the patient record
lookup happens internally.patientId - for which a patient record is to be looked upgetAllConsentsForPatient(Patient). Returns null if patientId is not a valid id.Set<Consent> getMissingConsentsForPatient(Patient patient)
patient - record on which consents are checkedSet<Consent> getMissingConsentsForPatient(String patientId)
getMissingConsentsForPatient(Patient), for the exception that the patient record
lookup happens internally.patientId - for which a patient record is to be looked upgetMissingConsentsForPatient(Patient). Returns null if patientId is not a valid id.boolean setPatientConsents(Patient patient, Iterable<String> consents)
patient - record in which consents will be grantedconsents - list of consent idstrue if the operation was successful, otherwise falseboolean hasConsent(Patient patient, String consentId)
false regardless of patient consent status.patient - record in which to test consentconsentId - of consent which is to be checkedtrue if the consent was granted for the patient, otherwise falseboolean hasConsent(String patientId, String consentId)
hasConsent(Patient,String), for the exception that the patient record
lookup happens internally.patientId - for which a patient record is to be looked upconsentId - of consent which is to be checkedtrue if the consent was granted for the patient, otherwise falseboolean grantConsent(Patient patient, String consentId)
patient - record in which to grant a consentconsentId - of consent which is to be grantedtrue if the operation was successful, otherwise falseboolean revokeConsent(Patient patient, String consentId)
patient - record in which a consent is to be removedconsentId - of consent to be removedtrue if the operation was successful, otherwise falseorg.json.JSONArray toJSON(Collection<Consent> consents)
JSONArray containing JSON representations of all consents.consents - to be converted into JSON representationCopyright © 2011–2018 University of Toronto, Computational Biology Lab. All rights reserved.