application/core/services/helpers
library
Functions
-
addNHIF({required BuildContext context, required NHIFInformationObject nhifInformation})
→ Future<void>
-
-
captureException(String? message, {String? query, Map<String, dynamic>? variables, dynamic response, dynamic error})
→ Future<void>
-
Used to capture User Exceptions and logged to BeWell Sentry
-
checkData({required dynamic data, required BuildContext context, required String successMsg, required String errorMsg, required BehaviorSubject<bool> listener, required bool listenerValue, required bool popContext, required Function? successCallback})
→ void
-
checkData checks the validity of the data returned from the api
and proceeds if successful or shows an error message if there are any errors
-
checkProfileProgress(BuildContext context)
→ String
-
-
clinicalRetireFunctionHelper({required GlobalKey<FormState> formKey, required VoidCallback? onProblemRetireCallback, required VoidCallback? onAllergiesRetireCallback, required VoidCallback? onTestRetireCallback, required VoidCallback? onMedicationRetireCallback, required VoidCallback? onDiagnosisRetireCallback, required VoidCallback? onRetireReviewOfSystemCallback, required VoidCallback? onRetireGeneralExamCallback, required SectionType section})
→ Future<void>
-
-
formatKEPhoneNumber(String searchParam)
→ String
-
Formats Kenyan phone numbers with the prefixes ('+254', '254', '07' and '7')
to international format
+2547xxx
-
generateProblemAllergySummary(List<String?>? data, String dataItem)
→ GenerateProblemAllergySummaryData
-
Processes a list of problems or allergies and outputs a data class
GenerateProblemAllergySummaryData that contains the summary
-
genericSearchFunction({required String searchParam, required ConceptClass conceptClass, required IGraphQlClient client, required StreamController streamController})
→ Future<void>
-
A generic search function for searching for, and listing problems, allergies
medications, tests and diagnoses
-
getAppContext(List<AppContext> contexts)
→ String
-
-
getAuthTokenStatus({required BuildContext context})
→ Future<AuthTokenStatus>
-
getAuthTokenStatus is used to check if the Auth Token has expired or if it needs refreshing
-
getGenderFromString(String genderString)
→ Gender
-
-
getInitialRoute({required BuildContext context})
→ Future<String>
-
Gets initial route based on the authToken status
-
getPatientInfo()
→ PatientInfo
-
getPatientInfo retrieves the patient's information including
the
Patient ID
, Patient Reference
, Name
, Encounter ID
and
Encounter Reference
-
getRecordingDoctor(BuildContext context)
→ String?
-
Access the user profile to get the
First Name
and Last Name
of the current recording doctor,
-
getRelationFromString(String nextOfKinString)
→ NextOfKinRelation
-
-
getResponsivePadding({required BuildContext context})
→ double
-
-
logoutUser(BuildContext context, {String? customSignOutMsg, ReduxAction<CoreState>? logoutAction})
→ Future<void>
-
-
navigateToProfileItemPage({required BuildContext context, required ProfileItem profileItem})
→ Future<void>
-
navigateToProfileItemPage function is used to validate routes in user profile page,
If route is provided, it navigates to the specified page and if route is null it displays
A coming soon snack bar
-
openPatientExamDrawer({required BuildContext context, required ReviewSystems system})
→ void
-
-
postVisitSurveyCompleteButton(Function callback, BuildContext context)
→ SILPrimaryButton
-
-
resetPatientData()
→ void
-
Clears all behavior subjects that contain the current patient's data
this is normally called when a visit is ended to prevent corrupt data when
a visit for a new patient is started
-
saveDeviceToken({required IGraphQlClient client, required SILFCM fcm})
→ Future<void>
-
Resets device token and gets a new one to ensure token is always valid
saves token to the backend
-
saveVital({required BuildContext context, required Map<String, dynamic> data, required String successMsg, bool shouldPop = true})
→ Future<void>
-
Saves a vital by calling the graphQL endpoint using the variables provided
in the form of a
Map<String, dynamic> data
-
searchPatientFunction(BuildContext context, String searchParam)
→ Future<void>
-
-
sendOtpRequest({required IGraphQlClient graphQlClient, required String phoneNumber})
→ Future<String?>
-
Sends an otp request.
Returns the otp fetched or null if there was an error with request
-
showAlertSnackBar({BuildContext? context, String? message, String? title})
→ void
-
-
showDebugModeBanner(List<AppContext> appContexts)
→ bool
-
Decides whether to show the debug mode banner based on the environment
that the app is running.
-
showInfoBottomSheet({required BuildContext context, required Widget modalContent, required String imagePath})
→ Future
-
-
triggerEvent(String eventName, BuildContext context, {String? route})
→ void
-
-
triggerNavigationEvent({required BuildContext context, required String route, String? event, bool shouldReplace = false, Object? args, bool shouldRemoveUntil = false})
→ Future<void>
-
Triggers Navigation event by sending a log to firebase