PatientGqlRepository class Null safety

Inheritance

Constructors

PatientGqlRepository(GraphQLClient graphQLClient, Logger? logger)

Properties

graphQLClient GraphQLClient
finalinherited
hashCode int
The hash code for this object.
read-onlyinherited
logger Logger?
finalinherited
patientUpdateStream Stream<StreamUpdate<Patient>>
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

createPatient({required String firebaseUid}) Future<Patient?>
Creates a new patient in the backend and returns the current instance. If a patient already exists, returns the existing instance. The patient is referenced by its Firebase uid. Throws an exception if an error occurred.
deletePatient({required Patient patient}) Future<bool>
deleteProfile() Future<bool>
Deletes our user profile in the backend Returns true on success, false on error.
inherited
dispose() Future<void>
fetchUserId(String firebaseUid) Future<String?>
Utility function that fetches a user's ID based on a given patient instance. This is required because Strapi does not support direct access to the underlying User instance by a where clause. This method can be removed as soon as Strapi exposes a custom resolver to store the unified data structure. Returns null if the user instance could not be found.
inherited
getPatient({String? firebaseUid, String? patientId}) Future<Patient?>
Retrieves a patient instance either by its Firebase uid or instance ID. Returns null if patient does not exist or an error occurred. Throws an exception if an error occurred.
getPatients({int offset = 0, int? limit, BuiltList<Organization>? organizations}) Future<BuiltList<Patient>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
refresh({required String patientId}) Future<Patient?>
Retrieves the current patient instance from the backend and publishes it. Returns the Patient instance on success or null on error.
removeSupporter({required Supporter supporter}) Future<Patient?>
Removes supporter from the list of supporters from the currently logged in patient. Returns a new Patient instance (and publishes it) if successful, otherwise returns null.
resolvePractitionerPatientRequest(String token) Future<Patient?>
Resolves a hcp request. Returns false if resolving failed. Returns true if resolving worked. In case of success, the currently logged in patient will be linked to the hcp who originally issued the token. This method can only be called when logged in as a patient.
setAvatar({required Patient patient, required MediaAsset asset}) Future<Patient?>
Sets the referenced asset as patient avatar. The asset already needs to be present in the CMS and must not be a local asset. When done, causes the repository to emit an updated patient instance with the avatar referenced as remote URL.
setConditions({required Patient patient, required BuiltSet<LocalizedType<Condition>> conditions}) Future<Patient?>
Writes the specified set of conditions to the patient profile. Overwrites all existing conditions.
setFcmToken({required Patient patient, required String token}) Future<bool>
setInterests({required Patient patient, required BuiltSet<LocalizedType<Interest>> interests}) Future<Patient?>
setUserAvatar({required User user, required MediaAsset asset}) Future<bool>
Sets the referenced asset as avatar. The asset needs to be present in the CMS already. INTERNAL USE ONLY
inherited
setUserFcmToken({required User user, required String token}) Future<bool>
Updates the Firebase Cloud Messaging token for user. Returns true on success and false on error.
inherited
setUserInterests({required User user, required BuiltSet<LocalizedType<Interest>> interests}) Future<bool>
inherited
toString() String
A string representation of this object.
inherited
updateProfile(Patient patient) Future<Patient?>
Updates the patient's profile data in the database, which is essentially all personal information except for linked data (such as supporters, interests, conditions).
updateUserProfile(User user) Future<bool>
Updates the patient or supporter's profile data in the database, which is essentially all personal information except for linked data (such as supporters, interests, conditions). INTERNAL USE ONLY
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited