diff --git a/README.md b/README.md
index 1a459e3..3fea310 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,11 @@
+# Translation prompt & Command
+
+Read the context for both files & generate translations strings in the en-US.json & ar-SA.json files for the strings containing "needTranslation". Also replace the strings in the dart with the generated Strings. Also do not remove existing properties & do no generate duplicate strings in the json files
+
+flutter3_32 pub run easy_localization:generate -O ./lib/generated -f keys -o locale_keys.g.dart --source-dir ./assets/langs
+
+
+
# HMG Patient App
A comprehensive Flutter-based mobile application for HMG (Habib Medical Group) patients,
diff --git a/assets/images/svg/ar_lang_icon.svg b/assets/images/svg/ar_lang_icon.svg
new file mode 100644
index 0000000..d1c2be0
--- /dev/null
+++ b/assets/images/svg/ar_lang_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/svg/colored_dots_icon.svg b/assets/images/svg/colored_dots_icon.svg
new file mode 100644
index 0000000..7f05dc5
--- /dev/null
+++ b/assets/images/svg/colored_dots_icon.svg
@@ -0,0 +1,5 @@
+
diff --git a/assets/images/svg/en_lang_icon.svg b/assets/images/svg/en_lang_icon.svg
new file mode 100644
index 0000000..fa1c143
--- /dev/null
+++ b/assets/images/svg/en_lang_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json
index 9c1c962..3ceb2e9 100644
--- a/assets/langs/ar-SA.json
+++ b/assets/langs/ar-SA.json
@@ -1377,6 +1377,18 @@
"suggestions": "الاقتراحات",
"pleaseGoBackAndSelectOrgansFirst": "يرجى العودة واختيار الأعضاء أولاً",
"symptomsSelector": "محدد الأعراض",
+ "possibleSymptomsRelatedTo": "الأعراض المحتملة المتعلقة بـ",
+ "suggestionAIListDescription": "هذه قائمة بالأعراض المقترحة من قبل الذكاء الاصطناعي، بناءً على المعلومات التي تم جمعها حتى الآن خلال المقابلة",
+ "analyzing": "جاري التحليل...",
+ "seekMedicalAdvice": "اطلب المشورة الطبية",
+ "monitorDescription": "لا حاجة لطلب المشورة الطبية. فقط حافظ على روتين صحي.",
+ "seekMedicalAdviceDescription": "ليست حالة طوارئ ولكن من الأفضل مراقبة الأعراض.",
+ "emergencyDescription": "تحتاج إلى استشارة الطبيب في أقرب وقت ممكن قبل فوات الأوان.",
+ "colorScience": "دلالات الألوان",
+ "noNeedToVisitDoctor": "لا حاجة لزي��رة الطبيب",
+ "commonSymptom": "الأعراض الشائعة",
+ "bookAppointment": "احجز موعد",
+ "notApplicable": "لا ينطبق",
"emergencyTriage": "طوارئ",
"emergencyEvidenceDetected": "تم اكتشاف دليل طوارئ. يرجى طلب العناية الطبية.",
"noQuestionItemsAvailable": "لا توجد عناصر أسئلة متاحة",
@@ -1499,5 +1511,20 @@
"selectTime": "حدد الوقت",
"pleaseWaitYouWillBeCalledForVitalSigns": "يرجى الانتظار! سيتم استدعاؤك لقياس العلامات الحيوية",
"pleaseVisitRoomForVitalSigns": "يرجى زيارة الغرفة {roomNumber} لقياس العلامات الحيوية",
- "pleaseVisitRoomToTheDoctor": "يرجى زيارة الغرفة {roomNumber} لمقابلة الطبيب"
+ "pleaseVisitRoomToTheDoctor": "يرجى زيارة الغرفة {roomNumber} لمقابلة الطبيب",
+ "erOnlineCheckInRequest": "طلب تسجيل الوصول عبر الإنترنت لقسم الطوارئ",
+ "indoor": "داخلي",
+ "navigation": "الملاحة",
+ "health": "الصحة",
+ "calculators": "الحاسبات",
+ "converters": "المحولات",
+ "guide": "الدليل",
+ "liveCareServiceDesc": "احصل على استشارة طبية من طبيب متخصص عبر مكالمة فيديو",
+ "bloodGroup": "فصيلة الدم: {bloodType}",
+ "medicalServices": "الخدمات الطبية",
+ "insuranceAndPayments": "التأمين والمدفوعات",
+ "trackerAndOthers": "المتتبع وأخرى",
+ "bmi": "مؤشر كتلة الجسم"
+
+
}
diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json
index 5f356ba..50d4481 100644
--- a/assets/langs/en-US.json
+++ b/assets/langs/en-US.json
@@ -1367,6 +1367,18 @@
"suggestions": "Suggestions",
"pleaseGoBackAndSelectOrgansFirst": "Please go back and select organs first",
"symptomsSelector": "Symptoms Selector",
+ "possibleSymptomsRelatedTo": "Possible symptoms related to",
+ "suggestionAIListDescription": "This is a list of symptoms suggested by our AI, based on the information gathered so far during the interview",
+ "analyzing": "Analyzing...",
+ "seekMedicalAdvice": "Seek Medical Advice",
+ "monitorDescription": "No need to seek medical advice. Just keep healthy routine.",
+ "seekMedicalAdviceDescription": "Not emergency but better to monitor the symptoms.",
+ "emergencyDescription": "Need to consult doctor as soon as possible before getting too late.",
+ "colorScience": "Color Science",
+ "noNeedToVisitDoctor": "No need to visit doctor",
+ "commonSymptom": "Common Symptom",
+ "bookAppointment": "Book Appointment",
+ "notApplicable": "Not Applicable",
"emergencyTriage": "Emergency",
"emergencyEvidenceDetected": "Emergency evidence detected. Please seek medical attention.",
"noQuestionItemsAvailable": "No question items available",
@@ -1490,5 +1502,20 @@
"selectTime": "Select Time",
"pleaseWaitYouWillBeCalledForVitalSigns": "Please wait! you will be called for vital signs",
"pleaseVisitRoomForVitalSigns": "Please visit Room {roomNumber} for vital signs",
- "pleaseVisitRoomToTheDoctor": "Please visit Room {roomNumber} to the Doctor"
+ "pleaseVisitRoomToTheDoctor": "Please visit Room {roomNumber} to the Doctor",
+ "erOnlineCheckInRequest": "ER Online Check-In Request",
+ "indoor": "Indoor",
+ "navigation": "Navigation",
+ "health": "Health",
+ "calculators": "Calculators",
+ "converters": "Converters",
+ "guide": "Guide",
+ "liveCareServiceDesc": "Get medical advice with a specialist doctor Via a video call",
+ "bloodGroup": "Blood: {bloodType}",
+ "medicalServices": "Medical Services",
+ "insuranceAndPayments": "Insurance & Payments",
+ "trackerAndOthers": "Tracker & Others",
+ "bmi": "BMI"
+
+
}
diff --git a/convert_json.dart b/convert_json.dart
index 08f344d..af5c594 100644
--- a/convert_json.dart
+++ b/convert_json.dart
@@ -1,73 +1,73 @@
-import 'dart:convert';
-import 'dart:io';
-
-void main() async {
- final file = File('assets/json/body_symptoms_data.json');
- final content = await file.readAsString();
-
- print('File size: ${content.length} characters');
-
- // Split into two parts
- final parts = content.split('export const SymptomsData = [');
- if (parts.length != 2) {
- print('ERROR: Could not split file properly');
- exit(1);
- }
-
- print('Split into ${parts.length} parts');
-
- // Process BodySymptomsData
- var bodyPart = parts[0]
- .replaceAll('export const BodySymptomsData = ', '')
- .trim()
- .replaceAll(RegExp(r';$'), '');
-
- print('Parsing body symptoms...');
- Map bodySymptomsData;
- try {
- bodySymptomsData = json.decode(bodyPart);
- print('✅ Body symptoms parsed: ${bodySymptomsData.length} body parts');
- } catch (e) {
- print('❌ Error parsing body symptoms: $e');
- exit(1);
- }
-
- // Process SymptomsData
- print('Processing symptoms data...');
- var symptomsPart = parts[1]
- .trim()
- .replaceAll(RegExp(r'\];$'), '')
- .replaceAllMapped(RegExp(r'\n(\s*)id:'), (m) => '\n${m.group(1)}"id":')
- .replaceAllMapped(RegExp(r'\n(\s*)type:'), (m) => '\n${m.group(1)}"type":')
- .replaceAllMapped(RegExp(r'\n(\s*)name:'), (m) => '\n${m.group(1)}"name":')
- .replaceAllMapped(RegExp(r'\n(\s*)common_name:'), (m) => '\n${m.group(1)}"common_name":');
-
- print('Parsing symptoms...');
- List symptomsData;
- try {
- symptomsData = json.decode('[$symptomsPart]');
- print('✅ Symptoms parsed: ${symptomsData.length} symptoms');
- } catch (e) {
- print('❌ Error parsing symptoms: $e');
- print('First 1000 chars:');
- print('[$symptomsPart]'.substring(0, 1000));
- exit(1);
- }
-
- // Create final JSON
- print('Creating final JSON structure...');
- final jsonStructure = {
- 'bodySymptoms': bodySymptomsData,
- 'symptoms': symptomsData,
- };
-
- // Write to file
- print('Writing to file...');
- final encoder = JsonEncoder.withIndent(' ');
- await file.writeAsString(encoder.convert(jsonStructure));
-
- print('\n✅ SUCCESS! File converted to proper JSON');
- print('✅ Body parts: ${bodySymptomsData.length}');
- print('✅ Symptoms: ${symptomsData.length}');
-}
-
+// import 'dart:convert';
+// import 'dart:io';
+//
+// void main() async {
+// final file = File('assets/json/body_symptoms_data.json');
+// final content = await file.readAsString();
+//
+// print('File size: ${content.length} characters');
+//
+// // Split into two parts
+// final parts = content.split('export const SymptomsData = [');
+// if (parts.length != 2) {
+// print('ERROR: Could not split file properly');
+// exit(1);
+// }
+//
+// print('Split into ${parts.length} parts');
+//
+// // Process BodySymptomsData
+// var bodyPart = parts[0]
+// .replaceAll('export const BodySymptomsData = ', '')
+// .trim()
+// .replaceAll(RegExp(r';$'), '');
+//
+// print('Parsing body symptoms...');
+// Map bodySymptomsData;
+// try {
+// bodySymptomsData = json.decode(bodyPart);
+// print('✅ Body symptoms parsed: ${bodySymptomsData.length} body parts');
+// } catch (e) {
+// print('❌ Error parsing body symptoms: $e');
+// exit(1);
+// }
+//
+// // Process SymptomsData
+// print('Processing symptoms data...');
+// var symptomsPart = parts[1]
+// .trim()
+// .replaceAll(RegExp(r'\];$'), '')
+// .replaceAllMapped(RegExp(r'\n(\s*)id:'), (m) => '\n${m.group(1)}"id":')
+// .replaceAllMapped(RegExp(r'\n(\s*)type:'), (m) => '\n${m.group(1)}"type":')
+// .replaceAllMapped(RegExp(r'\n(\s*)name:'), (m) => '\n${m.group(1)}"name":')
+// .replaceAllMapped(RegExp(r'\n(\s*)common_name:'), (m) => '\n${m.group(1)}"common_name":');
+//
+// print('Parsing symptoms...');
+// List symptomsData;
+// try {
+// symptomsData = json.decode('[$symptomsPart]');
+// print('✅ Symptoms parsed: ${symptomsData.length} symptoms');
+// } catch (e) {
+// print('❌ Error parsing symptoms: $e');
+// print('First 1000 chars:');
+// print('[$symptomsPart]'.substring(0, 1000));
+// exit(1);
+// }
+//
+// // Create final JSON
+// print('Creating final JSON structure...');
+// final jsonStructure = {
+// 'bodySymptoms': bodySymptomsData,
+// 'symptoms': symptomsData,
+// };
+//
+// // Write to file
+// print('Writing to file...');
+// final encoder = JsonEncoder.withIndent(' ');
+// await file.writeAsString(encoder.convert(jsonStructure));
+//
+// print('\n✅ SUCCESS! File converted to proper JSON');
+// print('✅ Body parts: ${bodySymptomsData.length}');
+// print('✅ Symptoms: ${symptomsData.length}');
+// }
+//
diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart
index 722a45e..39a6177 100644
--- a/lib/core/api/api_client.dart
+++ b/lib/core/api/api_client.dart
@@ -189,6 +189,8 @@ class ApiClientImp implements ApiClient {
// body['SessionID'] = "45786230487560q";
}
+ // body['IsNewFlutterApp'] = true;
+
body.removeWhere((key, value) => value == null);
}
diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart
index de750ad..f715305 100644
--- a/lib/core/api_consts.dart
+++ b/lib/core/api_consts.dart
@@ -841,7 +841,7 @@ class ApiConsts {
static final String getRiskFactors = '$symptomsCheckerApi/GetRiskFactors';
static final String getSuggestions = '$symptomsCheckerApi/GetSuggestion';
static final String diagnosis = '$symptomsCheckerApi/GetDiagnosis';
- static final String explain = '$symptomsCheckerApi/explain';
+ static final String explain = '$symptomsCheckerApi/ExplainDiagnosisResult';
//E-REFERRAL SERVICES
static final getAllRelationshipTypes = "Services/Patients.svc/REST/GetAllRelationshipTypes";
diff --git a/lib/core/app_assets.dart b/lib/core/app_assets.dart
index 17422a6..e0a99a7 100644
--- a/lib/core/app_assets.dart
+++ b/lib/core/app_assets.dart
@@ -254,6 +254,7 @@ class AppAssets {
static const String homeBorderedIcon = '$svgBasePath/home_bordered.svg';
static const String symptomCheckerIcon = '$svgBasePath/symptom_checker_icon.svg';
static const String symptomCheckerBottomIcon = '$svgBasePath/symptom_bottom_icon.svg';
+ static const String coloredDotsIcon = '$svgBasePath/colored_dots_icon.svg';
// Water Monitor
static const String waterBottle = '$svgBasePath/water_bottle.svg';
@@ -306,6 +307,9 @@ class AppAssets {
static const String bloodPressure = '$svgBasePath/blood_pressure.svg';
static const String temperature = '$svgBasePath/temperature.svg';
+ static const String arLangIcon = '$svgBasePath/ar_lang_icon.svg';
+ static const String enLangIcon = '$svgBasePath/en_lang_icon.svg';
+
// PNGS //
static const String hmgLogo = '$pngBasePath/hmg_logo.png';
static const String liveCareService = '$pngBasePath/livecare_service.png';
@@ -353,4 +357,3 @@ class AppAnimations {
static const String ambulanceAlert = '$lottieBasePath/ambulance_alert.json';
static const String rrtAmbulance = '$lottieBasePath/rrt_ambulance.json';
}
-
diff --git a/lib/core/enums.dart b/lib/core/enums.dart
index 6dc3bf6..6613702 100644
--- a/lib/core/enums.dart
+++ b/lib/core/enums.dart
@@ -311,3 +311,150 @@ extension ServiceTypeEnumExt on ServiceTypeEnum {
enum PossibleConditionsSeverityEnum { seekMedicalAdvice, monitorOnly, emergency }
enum HealthTrackerTypeEnum { bloodSugar, bloodPressure, weightTracker }
+
+// Severity Enum
+enum SeverityEnum { mild, moderate, severe }
+
+extension SeverityEnumExtension on SeverityEnum {
+ int get toInt {
+ switch (this) {
+ case SeverityEnum.mild:
+ return 0;
+ case SeverityEnum.moderate:
+ return 1;
+ case SeverityEnum.severe:
+ return 2;
+ }
+ }
+
+ String get displayName {
+ AppState appState = getIt.get();
+ bool isArabic = appState.getLanguageID() == 1 ? true : false;
+ switch (this) {
+ case SeverityEnum.mild:
+ return isArabic ? 'خفيف' : 'Mild';
+ case SeverityEnum.moderate:
+ return isArabic ? 'متوسط' : 'Moderate';
+ case SeverityEnum.severe:
+ return isArabic ? 'شديد' : 'Severe';
+ }
+ }
+
+ static SeverityEnum? fromInt(int value) {
+ switch (value) {
+ case 0:
+ return SeverityEnum.mild;
+ case 1:
+ return SeverityEnum.moderate;
+ case 2:
+ return SeverityEnum.severe;
+ default:
+ return null;
+ }
+ }
+}
+
+// Triage Level Enum
+enum TriageLevelEnum { emergencyAmbulance, emergency, consultation24, consultation, selfCare }
+
+extension TriageLevelEnumExtension on TriageLevelEnum {
+ int get toInt {
+ switch (this) {
+ case TriageLevelEnum.emergencyAmbulance:
+ return 0;
+ case TriageLevelEnum.emergency:
+ return 1;
+ case TriageLevelEnum.consultation24:
+ return 2;
+ case TriageLevelEnum.consultation:
+ return 3;
+ case TriageLevelEnum.selfCare:
+ return 4;
+ }
+ }
+
+ String get displayName {
+ AppState appState = getIt.get();
+ bool isArabic = appState.getLanguageID() == 1 ? true : false;
+ switch (this) {
+ case TriageLevelEnum.emergencyAmbulance:
+ return isArabic ? 'طوارئ - إسعاف' : 'Emergency - Ambulance';
+ case TriageLevelEnum.emergency:
+ return isArabic ? 'طوارئ' : 'Emergency';
+ case TriageLevelEnum.consultation24:
+ return isArabic ? 'استشارة خلال 24 ساعة' : 'Consultation within 24 hours';
+ case TriageLevelEnum.consultation:
+ return isArabic ? 'استشارة' : 'Consultation';
+ case TriageLevelEnum.selfCare:
+ return isArabic ? 'رعاية ذاتية' : 'Self Care';
+ }
+ }
+
+ static TriageLevelEnum? fromInt(int value) {
+ switch (value) {
+ case 0:
+ return TriageLevelEnum.emergencyAmbulance;
+ case 1:
+ return TriageLevelEnum.emergency;
+ case 2:
+ return TriageLevelEnum.consultation24;
+ case 3:
+ return TriageLevelEnum.consultation;
+ case 4:
+ return TriageLevelEnum.selfCare;
+ default:
+ return null;
+ }
+ }
+}
+
+// Question Type Enum
+enum QuestionTypeEnum { single, groupSingle, groupMultiple, duration }
+
+extension QuestionTypeEnumExtension on QuestionTypeEnum {
+ int get toInt {
+ switch (this) {
+ case QuestionTypeEnum.single:
+ return 0;
+ case QuestionTypeEnum.groupSingle:
+ return 1;
+ case QuestionTypeEnum.groupMultiple:
+ return 2;
+ case QuestionTypeEnum.duration:
+ return 3;
+ }
+ }
+
+ String get displayName {
+ AppState appState = getIt.get();
+ bool isArabic = appState.getLanguageID() == 1 ? true : false;
+ switch (this) {
+ case QuestionTypeEnum.single:
+ return isArabic ? 'سؤال واحد' : 'Single';
+ case QuestionTypeEnum.groupSingle:
+ return isArabic ? 'مجموعة - اختيار واحد' : 'Group Single';
+ case QuestionTypeEnum.groupMultiple:
+ return isArabic ? 'مجموعة - اختيار متعدد' : 'Group Multiple';
+ case QuestionTypeEnum.duration:
+ return isArabic ? 'المدة' : 'Duration';
+ }
+ }
+
+ static QuestionTypeEnum? fromInt(int value) {
+ switch (value) {
+ case 0:
+ return QuestionTypeEnum.single;
+ case 1:
+ return QuestionTypeEnum.groupSingle;
+ case 2:
+ return QuestionTypeEnum.groupMultiple;
+ case 3:
+ return QuestionTypeEnum.duration;
+ default:
+ return null;
+ }
+ }
+}
+
+
+
diff --git a/lib/core/utils/utils.dart b/lib/core/utils/utils.dart
index e5b0ca4..5995438 100644
--- a/lib/core/utils/utils.dart
+++ b/lib/core/utils/utils.dart
@@ -814,7 +814,8 @@ class Utils {
child: Utils.buildSvgWithAssets(icon: AppAssets.saudi_riyal_icon, width: iconSize.h, height: iconSize.h, iconColor: iconColor),
),
TextSpan(
- text: NumberFormat.currency(locale: 'en_US', symbol: " ", decimalDigits: 0).format(habibWalletAmount),
+ // text: NumberFormat.currency(locale: 'en_US', symbol: " ", decimalDigits: 0).format(habibWalletAmount),
+ text: " ${habibWalletAmount.toStringAsFixed(2)}",
style: TextStyle(
color: textColor,
fontSize: fontSize ?? 32.f,
diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart
index 7ac2ae5..f1182e0 100644
--- a/lib/features/authentication/authentication_view_model.dart
+++ b/lib/features/authentication/authentication_view_model.dart
@@ -571,7 +571,7 @@ class AuthenticationViewModel extends ChangeNotifier {
MedicalFileViewModel medicalVm = getIt();
if (!_appState.getIsChildLoggedIn) {
await medicalVm.getFamilyFiles(status: 0);
- await medicalVm.getAllPendingRecordsByResponseId();
+ // await medicalVm.getAllPendingRecordsByResponseId();
_navigationService.replaceAllRoutesAndNavigateToLanding();
}
} else {
@@ -610,7 +610,7 @@ class AuthenticationViewModel extends ChangeNotifier {
MedicalFileViewModel medicalVm = getIt();
insertPatientIMEIData(loginTypeEnum.toInt);
medicalVm.getFamilyFiles(status: 0); //TODO: Remove status: 1 by Aamir Need to Discuss With Sultan
- medicalVm.getAllPendingRecordsByResponseId();
+ // medicalVm.getAllPendingRecordsByResponseId();
}
await clearDefaultInputValues();
if (isUserAgreedBefore) {
diff --git a/lib/features/authentication/widgets/otp_verification_screen.dart b/lib/features/authentication/widgets/otp_verification_screen.dart
index e33222c..7ddccda 100644
--- a/lib/features/authentication/widgets/otp_verification_screen.dart
+++ b/lib/features/authentication/widgets/otp_verification_screen.dart
@@ -545,20 +545,20 @@ class _OTPVerificationScreenState extends State {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 10.h),
- LocaleKeys.otpVerification.tr().toText24(isBold: true),
+ LocaleKeys.otpVerification.tr(context: context).toText24(isBold: true),
SizedBox(height: 20.h),
Wrap(
spacing: 2.h,
runSpacing: 2.h,
children: [
- LocaleKeys.weHaveSendOTP.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4),
+ LocaleKeys.weHaveSendOTP.tr(context: context).toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4),
_getMaskedPhoneNumber().toText15(color: AppColors.inputLabelTextColor, isBold: true),
- LocaleKeys.via.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4),
+ LocaleKeys.via.tr(context: context).toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4),
(widget.isFormFamilyFile ? LoginTypeEnum.sms.displayName : authVM.loginTypeEnum.displayName)
.toText15(color: AppColors.inputLabelTextColor, isBold: true, letterSpacing: -0.4),
appState.getUserRegistrationPayload.isRegister != null && appState.getUserRegistrationPayload.isRegister == true
- ? LocaleKeys.forRegistrationVerification.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4)
- : LocaleKeys.forLoginVerification.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4),
+ ? LocaleKeys.forRegistrationVerification.tr(context: context).toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4)
+ : LocaleKeys.forLoginVerification.tr(context: context).toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4),
],
),
@@ -590,7 +590,7 @@ class _OTPVerificationScreenState extends State {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
- LocaleKeys.didntReceiveIt.tr().toText16(color: AppColors.inputLabelTextColor),
+ LocaleKeys.didntReceiveIt.tr(context: context).toText16(color: AppColors.inputLabelTextColor),
SizedBox(width: 5.h),
if (_resendTime > 0)
Builder(
@@ -599,7 +599,7 @@ class _OTPVerificationScreenState extends State {
final seconds = (_resendTime % 60).toString().padLeft(2, '0');
return Row(
children: [
- LocaleKeys.resendIn.tr().toText16(color: AppColors.inputLabelTextColor),
+ LocaleKeys.resendIn.tr(context: context).toText16(color: AppColors.inputLabelTextColor),
SizedBox(width: 2.h),
' ($minutes:$seconds). '.toText16(color: AppColors.inputLabelTextColor)
],
@@ -609,7 +609,7 @@ class _OTPVerificationScreenState extends State {
else
GestureDetector(
onTap: _resendOtp,
- child: LocaleKeys.resendOTP.tr().toText16(color: AppColors.primaryRedColor),
+ child: LocaleKeys.resendOTP.tr(context: context).toText16(color: AppColors.primaryRedColor),
),
],
),
diff --git a/lib/features/immediate_livecare/immediate_livecare_view_model.dart b/lib/features/immediate_livecare/immediate_livecare_view_model.dart
index 1baa81b..ffa0b00 100644
--- a/lib/features/immediate_livecare/immediate_livecare_view_model.dart
+++ b/lib/features/immediate_livecare/immediate_livecare_view_model.dart
@@ -45,9 +45,7 @@ class ImmediateLiveCareViewModel extends ChangeNotifier {
initImmediateLiveCare() {
_appState = getIt();
immediateLiveCareClinicsList = [];
- patientLiveCareHistoryList = [];
isImmediateLiveCareClinicsLoading = true;
- patientHasPendingLiveCareRequest = false;
liveCareSelectedCallType = 0; // 1- Video, 2- Audio, 3- Phone
immediateLiveCareSelectedClinic = GetLiveCareClinicListResponseModel();
liveCareImmediateAppointmentFeesList = LiveCareImmediateAppointmentFeesList();
@@ -136,6 +134,10 @@ class ImmediateLiveCareViewModel extends ChangeNotifier {
}
Future getPatientLiveCareHistory({Function(dynamic)? onSuccess, Function(String)? onError}) async {
+ patientLiveCareHistoryList = [];
+ patientHasPendingLiveCareRequest = false;
+ notifyListeners();
+
final result = await immediateLiveCareRepo.getPatientLiveCareHistory();
result.fold(
diff --git a/lib/features/my_appointments/my_appointments_view_model.dart b/lib/features/my_appointments/my_appointments_view_model.dart
index 96340a7..f287803 100644
--- a/lib/features/my_appointments/my_appointments_view_model.dart
+++ b/lib/features/my_appointments/my_appointments_view_model.dart
@@ -220,6 +220,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}
Future getPatientAppointments(bool isActiveAppointment, bool isArrivedAppointments, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
+ isPatientHasQueueAppointment = false;
if (!isAppointmentDataToBeLoaded) return;
filteredAppointmentList.clear();
@@ -727,6 +728,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
Future getPatientAppointmentQueueDetails({Function(dynamic)? onSuccess, Function(String)? onError}) async {
//TODO: Discuss With Haroon, Is the User Has no data it return No Element Bad State;
+ isPatientHasQueueAppointment = false;
isAppointmentQueueDetailsLoading = true;
notifyListeners();
final result = await myAppointmentsRepo.getPatientAppointmentQueueDetails(
diff --git a/lib/features/symptoms_checker/data/organ_mapping_data.dart b/lib/features/symptoms_checker/data/organ_mapping_data.dart
index 6b50b25..c338a94 100644
--- a/lib/features/symptoms_checker/data/organ_mapping_data.dart
+++ b/lib/features/symptoms_checker/data/organ_mapping_data.dart
@@ -8,28 +8,36 @@ class OrganData {
OrganModel(
id: 'head',
name: 'whole_head',
+ nameAr: 'الرأس_كامل',
description: 'Head',
+ descriptionAr: 'الرأس',
bodyView: BodyView.front,
position: OrganPosition(x: 0.50, y: 0.03),
),
OrganModel(
id: 'left_eye',
name: 'eyes',
+ nameAr: 'العيون',
description: 'Left Eye',
+ descriptionAr: 'العين اليسرى',
bodyView: BodyView.front,
position: OrganPosition(x: 0.43, y: 0.07),
),
OrganModel(
id: 'right_eye',
name: 'eyes',
+ nameAr: 'العيون',
description: 'Right Eye',
+ descriptionAr: 'العين اليمنى',
bodyView: BodyView.front,
position: OrganPosition(x: 0.57, y: 0.07),
),
OrganModel(
id: 'nose_mouth',
name: 'oral_cavity',
+ nameAr: 'تجويف_الفم',
description: 'Nose/Mouth',
+ descriptionAr: 'الأنف/الفم',
bodyView: BodyView.front,
position: OrganPosition(x: 0.50, y: 0.09),
),
@@ -38,7 +46,9 @@ class OrganData {
OrganModel(
id: 'throat',
name: 'neck_or_throat',
+ nameAr: 'الرقبة_أو_الحلق',
description: 'Throat',
+ descriptionAr: 'الحلق',
bodyView: BodyView.front,
position: OrganPosition(x: 0.50, y: 0.15),
),
@@ -47,14 +57,18 @@ class OrganData {
OrganModel(
id: 'left_shoulder',
name: 'upper_arm',
+ nameAr: 'الذراع_العلوي',
description: 'Left Shoulder',
+ descriptionAr: 'الكتف الأيسر',
bodyView: BodyView.front,
position: OrganPosition(x: 0.22, y: 0.22),
),
OrganModel(
id: 'right_shoulder',
name: 'upper_arm',
+ nameAr: 'الذراع_العلوي',
description: 'Right Shoulder',
+ descriptionAr: 'الكتف الأيمن',
bodyView: BodyView.front,
position: OrganPosition(x: 0.8, y: 0.22),
),
@@ -63,21 +77,27 @@ class OrganData {
OrganModel(
id: 'left_chest',
name: 'chest',
+ nameAr: 'الصدر',
description: 'Left Chest',
+ descriptionAr: 'الصدر الأيسر',
bodyView: BodyView.front,
position: OrganPosition(x: 0.38, y: 0.22),
),
OrganModel(
id: 'center_chest',
name: 'chest',
+ nameAr: 'الصدر',
description: 'Center Chest',
+ descriptionAr: 'وسط الصدر',
bodyView: BodyView.front,
position: OrganPosition(x: 0.52, y: 0.25),
),
OrganModel(
id: 'right_chest',
name: 'chest',
+ nameAr: 'الصدر',
description: 'Right Chest',
+ descriptionAr: 'الصدر الأيمن',
bodyView: BodyView.front,
position: OrganPosition(x: 0.65, y: 0.22),
),
@@ -86,14 +106,18 @@ class OrganData {
OrganModel(
id: 'left_ribs',
name: 'chest',
+ nameAr: 'الصدر',
description: 'Left Ribs',
+ descriptionAr: 'الأضلاع اليسرى',
bodyView: BodyView.front,
position: OrganPosition(x: 0.38, y: 0.35),
),
OrganModel(
id: 'right_ribs',
name: 'chest',
+ nameAr: 'الصدر',
description: 'Right Ribs',
+ descriptionAr: 'الأضلاع اليمنى',
bodyView: BodyView.front,
position: OrganPosition(x: 0.64, y: 0.35),
),
@@ -102,21 +126,27 @@ class OrganData {
OrganModel(
id: 'upper_abdomen',
name: 'upper_abdomen',
+ nameAr: 'البطن_العلوي',
description: 'Upper Abdomen',
+ descriptionAr: 'أعلى البطن',
bodyView: BodyView.front,
position: OrganPosition(x: 0.51, y: 0.31),
),
OrganModel(
id: 'navel',
name: 'mid_abdomen',
+ nameAr: 'البطن_الأوسط',
description: 'Navel',
+ descriptionAr: 'السرة',
bodyView: BodyView.front,
position: OrganPosition(x: 0.51, y: 0.38),
),
OrganModel(
id: 'lower_abdomen',
name: 'lower_abdomen',
+ nameAr: 'البطن_السفلي',
description: 'Lower Abdomen',
+ descriptionAr: 'أسفل البطن',
bodyView: BodyView.front,
position: OrganPosition(x: 0.51, y: 0.44),
),
@@ -125,14 +155,18 @@ class OrganData {
OrganModel(
id: 'left_groin',
name: 'sexual_organs',
+ nameAr: 'الأعضاء_التناسلية',
description: 'Left Groin',
+ descriptionAr: 'الفخذ الأيسر',
bodyView: BodyView.front,
position: OrganPosition(x: 0.42, y: 0.49),
),
OrganModel(
id: 'right_groin',
name: 'sexual_organs',
+ nameAr: 'الأعضاء_التناسلية',
description: 'Right Groin',
+ descriptionAr: 'الفخذ الأيمن',
bodyView: BodyView.front,
position: OrganPosition(x: 0.59, y: 0.49),
),
@@ -142,21 +176,27 @@ class OrganData {
OrganModel(
id: 'left_elbow',
name: 'elbow',
+ nameAr: 'الكوع',
description: 'Left Elbow',
+ descriptionAr: 'الكوع الأيسر',
bodyView: BodyView.front,
position: OrganPosition(x: 0.21, y: 0.35),
),
OrganModel(
id: 'left_forearm',
name: 'forearm',
+ nameAr: 'الساعد',
description: 'Left Forearm',
+ descriptionAr: 'الساعد الأيسر',
bodyView: BodyView.front,
position: OrganPosition(x: 0.19, y: 0.43),
),
OrganModel(
id: 'left_wrist',
name: 'hand',
+ nameAr: 'اليد',
description: 'Left Wrist',
+ descriptionAr: 'المعصم الأيسر',
bodyView: BodyView.front,
position: OrganPosition(x: 0.14, y: 0.5),
),
@@ -166,21 +206,27 @@ class OrganData {
OrganModel(
id: 'right_elbow',
name: 'elbow',
+ nameAr: 'الكوع',
description: 'Right Elbow',
+ descriptionAr: 'الكوع الأيمن',
bodyView: BodyView.front,
position: OrganPosition(x: 0.79, y: 0.35),
),
OrganModel(
id: 'right_forearm',
name: 'forearm',
+ nameAr: 'الساعد',
description: 'Right Forearm',
+ descriptionAr: 'الساعد الأيمن',
bodyView: BodyView.front,
position: OrganPosition(x: 0.81, y: 0.43),
),
OrganModel(
id: 'right_wrist',
name: 'hand',
+ nameAr: 'اليد',
description: 'Right Wrist',
+ descriptionAr: 'المعصم الأيمن',
bodyView: BodyView.front,
position: OrganPosition(x: 0.85, y: 0.5),
),
@@ -189,28 +235,36 @@ class OrganData {
OrganModel(
id: 'left_thigh',
name: 'thigh',
+ nameAr: 'الفخذ',
description: 'Left Thigh',
+ descriptionAr: 'الفخذ الأيسر',
bodyView: BodyView.front,
position: OrganPosition(x: 0.4, y: 0.60),
),
OrganModel(
id: 'left_knee',
name: 'knee',
+ nameAr: 'الركبة',
description: 'Left Knee',
+ descriptionAr: 'الركبة اليسرى',
bodyView: BodyView.front,
position: OrganPosition(x: 0.4, y: 0.72),
),
OrganModel(
id: 'left_shin',
name: 'lower_leg',
+ nameAr: 'الساق_السفلي',
description: 'Left Shin',
+ descriptionAr: 'الساق اليسرى',
bodyView: BodyView.front,
position: OrganPosition(x: 0.41, y: 0.82),
),
OrganModel(
id: 'left_ankle',
name: 'foot',
+ nameAr: 'القدم',
description: 'Left Ankle',
+ descriptionAr: 'الكاحل الأيسر',
bodyView: BodyView.front,
position: OrganPosition(x: 0.43, y: 0.91),
),
@@ -219,28 +273,36 @@ class OrganData {
OrganModel(
id: 'right_thigh',
name: 'thigh',
+ nameAr: 'الفخذ',
description: 'Right Thigh',
+ descriptionAr: 'الفخذ الأيمن',
bodyView: BodyView.front,
position: OrganPosition(x: 0.65, y: 0.60),
),
OrganModel(
id: 'right_knee',
name: 'knee',
+ nameAr: 'الركبة',
description: 'Right Knee',
+ descriptionAr: 'الركبة اليمنى',
bodyView: BodyView.front,
position: OrganPosition(x: 0.6, y: 0.72),
),
OrganModel(
id: 'right_shin',
name: 'lower_leg',
+ nameAr: 'الساق_السفلي',
description: 'Right Shin',
+ descriptionAr: 'الساق اليمنى',
bodyView: BodyView.front,
position: OrganPosition(x: 0.57, y: 0.82),
),
OrganModel(
id: 'right_ankle',
name: 'foot',
+ nameAr: 'القدم',
description: 'Right Ankle',
+ descriptionAr: 'الكاحل الأيمن',
bodyView: BodyView.front,
position: OrganPosition(x: 0.57, y: 0.91),
),
@@ -252,14 +314,18 @@ class OrganData {
OrganModel(
id: 'back_of_head',
name: 'whole_head',
+ nameAr: 'الرأس_كامل',
description: 'Back of Head',
+ descriptionAr: 'مؤخرة الرأس',
bodyView: BodyView.back,
position: OrganPosition(x: 0.50, y: 0.04),
),
OrganModel(
id: 'neck_back',
name: 'nape_of_neck',
+ nameAr: 'مؤخرة_الرقبة',
description: 'Neck',
+ descriptionAr: 'الرقبة',
bodyView: BodyView.back,
position: OrganPosition(x: 0.50, y: 0.14),
),
@@ -268,14 +334,18 @@ class OrganData {
OrganModel(
id: 'left_shoulder_back',
name: 'upper_arm',
+ nameAr: 'الذراع_العلوي',
description: 'Left Shoulder',
+ descriptionAr: 'الكتف الأيسر',
bodyView: BodyView.back,
position: OrganPosition(x: 0.33, y: 0.19),
),
OrganModel(
id: 'right_shoulder_back',
name: 'upper_arm',
+ nameAr: 'الذراع_العلوي',
description: 'Right Shoulder',
+ descriptionAr: 'الكتف الأيمن',
bodyView: BodyView.back,
position: OrganPosition(x: 0.67, y: 0.19),
),
@@ -284,21 +354,27 @@ class OrganData {
OrganModel(
id: 'upper_spine',
name: 'back',
+ nameAr: 'الظهر',
description: 'Upper Spine',
+ descriptionAr: 'العمود الفقري العلوي',
bodyView: BodyView.back,
position: OrganPosition(x: 0.50, y: 0.23),
),
OrganModel(
id: 'left_upper_back',
name: 'back',
+ nameAr: 'الظهر',
description: 'Left Upper Back',
+ descriptionAr: 'أعلى الظهر الأيسر',
bodyView: BodyView.back,
position: OrganPosition(x: 0.38, y: 0.28),
),
OrganModel(
id: 'right_upper_back',
name: 'back',
+ nameAr: 'الظهر',
description: 'Right Upper Back',
+ descriptionAr: 'أعلى الظهر الأيمن',
bodyView: BodyView.back,
position: OrganPosition(x: 0.62, y: 0.28),
),
@@ -307,21 +383,27 @@ class OrganData {
OrganModel(
id: 'mid_spine',
name: 'back',
+ nameAr: 'الظهر',
description: 'Mid Spine',
+ descriptionAr: 'العمود الفقري الأوسط',
bodyView: BodyView.back,
position: OrganPosition(x: 0.50, y: 0.35),
),
OrganModel(
id: 'left_mid_back',
name: 'back',
+ nameAr: 'الظهر',
description: 'Left Mid Back',
+ descriptionAr: 'وسط الظهر الأيسر',
bodyView: BodyView.back,
position: OrganPosition(x: 0.38, y: 0.35),
),
OrganModel(
id: 'right_mid_back',
name: 'back',
+ nameAr: 'الظهر',
description: 'Right Mid Back',
+ descriptionAr: 'وسط الظهر الأيمن',
bodyView: BodyView.back,
position: OrganPosition(x: 0.62, y: 0.35),
),
@@ -330,21 +412,27 @@ class OrganData {
OrganModel(
id: 'lower_spine',
name: 'lower_back',
+ nameAr: 'أسفل_الظهر',
description: 'Lower Back',
+ descriptionAr: 'أسفل الظهر',
bodyView: BodyView.back,
position: OrganPosition(x: 0.50, y: 0.43),
),
OrganModel(
id: 'left_lower_back',
name: 'lower_back',
+ nameAr: 'أسفل_الظهر',
description: 'Left Lower Back',
+ descriptionAr: 'أسفل الظهر الأيسر',
bodyView: BodyView.back,
position: OrganPosition(x: 0.40, y: 0.43),
),
OrganModel(
id: 'right_lower_back',
name: 'lower_back',
+ nameAr: 'أسفل_الظهر',
description: 'Right Lower Back',
+ descriptionAr: 'أسفل الظهر الأيمن',
bodyView: BodyView.back,
position: OrganPosition(x: 0.60, y: 0.43),
),
@@ -353,21 +441,27 @@ class OrganData {
OrganModel(
id: 'sacrum',
name: 'lower_back',
+ nameAr: 'أسفل_الظهر',
description: 'Sacrum',
+ descriptionAr: 'العجز',
bodyView: BodyView.back,
position: OrganPosition(x: 0.50, y: 0.52),
),
OrganModel(
id: 'left_glute',
name: 'buttocks',
+ nameAr: 'الأرداف',
description: 'Left Glute',
+ descriptionAr: 'الأرداف اليسرى',
bodyView: BodyView.back,
position: OrganPosition(x: 0.45, y: 0.56),
),
OrganModel(
id: 'right_glute',
name: 'buttocks',
+ nameAr: 'الأرداف',
description: 'Right Glute',
+ descriptionAr: 'الأرداف اليمنى',
bodyView: BodyView.back,
position: OrganPosition(x: 0.55, y: 0.56),
),
@@ -376,28 +470,36 @@ class OrganData {
OrganModel(
id: 'left_hamstring',
name: 'thigh',
+ nameAr: 'الفخذ',
description: 'Left Hamstring',
+ descriptionAr: 'عضلة الفخذ الخلفية اليسرى',
bodyView: BodyView.back,
position: OrganPosition(x: 0.43, y: 0.65),
),
OrganModel(
id: 'right_hamstring',
name: 'thigh',
+ nameAr: 'الفخذ',
description: 'Right Hamstring',
+ descriptionAr: 'عضلة الفخذ الخلفية اليمنى',
bodyView: BodyView.back,
position: OrganPosition(x: 0.57, y: 0.65),
),
OrganModel(
id: 'left_calf',
name: 'lower_leg',
+ nameAr: 'الساق_السفلي',
description: 'Left Calf',
+ descriptionAr: 'ربلة الساق اليسرى',
bodyView: BodyView.back,
position: OrganPosition(x: 0.43, y: 0.79),
),
OrganModel(
id: 'right_calf',
name: 'lower_leg',
+ nameAr: 'الساق_السفلي',
description: 'Right Calf',
+ descriptionAr: 'ربلة الساق اليمنى',
bodyView: BodyView.back,
position: OrganPosition(x: 0.57, y: 0.79),
),
diff --git a/lib/features/symptoms_checker/models/conditions_model.dart b/lib/features/symptoms_checker/models/conditions_model.dart
index 774d8c3..af66c21 100644
--- a/lib/features/symptoms_checker/models/conditions_model.dart
+++ b/lib/features/symptoms_checker/models/conditions_model.dart
@@ -1,97 +1,97 @@
-import 'package:flutter/material.dart';
-import 'package:hmg_patient_app_new/core/enums.dart';
-
-class ConditionsModel {
- final IconData icon;
- final String title;
- final int percentage;
- final String tagText;
- final String clinic;
- final List symptoms;
- final String description;
- final String? monitorNote;
- final String? appointmentLabel;
- final PossibleConditionsSeverityEnum possibleConditionsSeverityEnum;
-
- ConditionsModel({
- required this.icon,
- required this.title,
- required this.percentage,
- required this.tagText,
- required this.clinic,
- required this.symptoms,
- required this.description,
- required this.possibleConditionsSeverityEnum,
- this.monitorNote,
- this.appointmentLabel,
- });
-}
-
-List dummyConditions = [
- ConditionsModel(
- icon: Icons.psychology_alt,
- possibleConditionsSeverityEnum: PossibleConditionsSeverityEnum.seekMedicalAdvice,
- title: "Migraine",
- percentage: 87,
- tagText: "Seek Medical Advice",
- clinic: "Internal Medicine Clinic",
- symptoms: ["Headache", "Nausea", "Sensitivity to light"],
- description: "A migraine is a type of headache that can cause severe throbbing pain, usually on one side of the head.",
- appointmentLabel: "Book Appointment",
- ),
- ConditionsModel(
- icon: Icons.deblur,
- title: "Tension Headache",
- percentage: 37,
- tagText: "Monitor",
- monitorNote: "No need to visit doctor",
- clinic: "GP Clinic",
- symptoms: ["Mild head pressure", "Scalp tenderness"],
- description: "A tension-type headache is generally a mild to moderate pain that feels like a tight band around your head.",
- possibleConditionsSeverityEnum: PossibleConditionsSeverityEnum.monitorOnly,
- ),
- ConditionsModel(
- icon: Icons.medication_liquid,
- title: "Meningitis",
- percentage: 28,
- tagText: "Emergency",
- clinic: "Neurology Clinic",
- symptoms: ["Mild head pressure", "Scalp tenderness"],
- description: "A tension-type headache is generally a mild to moderate pain that feels like a tight band around your head.",
- appointmentLabel: "Book Appointment",
- possibleConditionsSeverityEnum: PossibleConditionsSeverityEnum.emergency,
- ),
- ConditionsModel(
- icon: Icons.psychology_alt,
- title: "Migraine",
- percentage: 87,
- tagText: "Seek Medical Advice",
- clinic: "Internal Medicine Clinic",
- symptoms: ["Headache", "Nausea", "Sensitivity to light"],
- description: "A migraine is a type of headache that can cause severe throbbing pain, usually on one side of the head.",
- appointmentLabel: "Book Appointment",
- possibleConditionsSeverityEnum: PossibleConditionsSeverityEnum.seekMedicalAdvice,
- ),
- ConditionsModel(
- icon: Icons.deblur,
- title: "Tension Headache",
- percentage: 37,
- tagText: "Monitor",
- monitorNote: "No need to visit doctor",
- clinic: "GP Clinic",
- symptoms: ["Mild head pressure", "Scalp tenderness"],
- description: "A tension-type headache is generally a mild to moderate pain that feels like a tight band around your head.",
- possibleConditionsSeverityEnum: PossibleConditionsSeverityEnum.monitorOnly,
- ),
- ConditionsModel(
- icon: Icons.medication_liquid,
- title: "Meningitis",
- percentage: 28,
- tagText: "Emergency",
- clinic: "Neurology Clinic",
- symptoms: ["Mild head pressure", "Scalp tenderness"],
- description: "A tension-type headache is generally a mild to moderate pain that feels like a tight band around your head.",
- appointmentLabel: "Book Appointment",
- possibleConditionsSeverityEnum: PossibleConditionsSeverityEnum.emergency,
- ),
-];
+// import 'package:flutter/material.dart';
+// import 'package:hmg_patient_app_new/core/enums.dart';
+//
+// class ConditionsModel {
+// final IconData icon;
+// final String title;
+// final int percentage;
+// final String tagText;
+// final String clinic;
+// final List symptoms;
+// final String description;
+// final String? monitorNote;
+// final String? appointmentLabel;
+// final PossibleConditionsSeverityEnum possibleConditionsSeverityEnum;
+//
+// ConditionsModel({
+// required this.icon,
+// required this.title,
+// required this.percentage,
+// required this.tagText,
+// required this.clinic,
+// required this.symptoms,
+// required this.description,
+// required this.possibleConditionsSeverityEnum,
+// this.monitorNote,
+// this.appointmentLabel,
+// });
+// }
+//
+// List dummyConditions = [
+// ConditionsModel(
+// icon: Icons.psychology_alt,
+// possibleConditionsSeverityEnum: PossibleConditionsSeverityEnum.seekMedicalAdvice,
+// title: "Migraine",
+// percentage: 87,
+// tagText: "Seek Medical Advice",
+// clinic: "Internal Medicine Clinic",
+// symptoms: ["Headache", "Nausea", "Sensitivity to light"],
+// description: "A migraine is a type of headache that can cause severe throbbing pain, usually on one side of the head.",
+// appointmentLabel: "Book Appointment",
+// ),
+// ConditionsModel(
+// icon: Icons.deblur,
+// title: "Tension Headache",
+// percentage: 37,
+// tagText: "Monitor",
+// monitorNote: "No need to visit doctor",
+// clinic: "GP Clinic",
+// symptoms: ["Mild head pressure", "Scalp tenderness"],
+// description: "A tension-type headache is generally a mild to moderate pain that feels like a tight band around your head.",
+// possibleConditionsSeverityEnum: PossibleConditionsSeverityEnum.monitorOnly,
+// ),
+// ConditionsModel(
+// icon: Icons.medication_liquid,
+// title: "Meningitis",
+// percentage: 28,
+// tagText: "Emergency",
+// clinic: "Neurology Clinic",
+// symptoms: ["Mild head pressure", "Scalp tenderness"],
+// description: "A tension-type headache is generally a mild to moderate pain that feels like a tight band around your head.",
+// appointmentLabel: "Book Appointment",
+// possibleConditionsSeverityEnum: PossibleConditionsSeverityEnum.emergency,
+// ),
+// ConditionsModel(
+// icon: Icons.psychology_alt,
+// title: "Migraine",
+// percentage: 87,
+// tagText: "Seek Medical Advice",
+// clinic: "Internal Medicine Clinic",
+// symptoms: ["Headache", "Nausea", "Sensitivity to light"],
+// description: "A migraine is a type of headache that can cause severe throbbing pain, usually on one side of the head.",
+// appointmentLabel: "Book Appointment",
+// possibleConditionsSeverityEnum: PossibleConditionsSeverityEnum.seekMedicalAdvice,
+// ),
+// ConditionsModel(
+// icon: Icons.deblur,
+// title: "Tension Headache",
+// percentage: 37,
+// tagText: "Monitor",
+// monitorNote: "No need to visit doctor",
+// clinic: "GP Clinic",
+// symptoms: ["Mild head pressure", "Scalp tenderness"],
+// description: "A tension-type headache is generally a mild to moderate pain that feels like a tight band around your head.",
+// possibleConditionsSeverityEnum: PossibleConditionsSeverityEnum.monitorOnly,
+// ),
+// ConditionsModel(
+// icon: Icons.medication_liquid,
+// title: "Meningitis",
+// percentage: 28,
+// tagText: "Emergency",
+// clinic: "Neurology Clinic",
+// symptoms: ["Mild head pressure", "Scalp tenderness"],
+// description: "A tension-type headache is generally a mild to moderate pain that feels like a tight band around your head.",
+// appointmentLabel: "Book Appointment",
+// possibleConditionsSeverityEnum: PossibleConditionsSeverityEnum.emergency,
+// ),
+// ];
diff --git a/lib/features/symptoms_checker/models/organ_model.dart b/lib/features/symptoms_checker/models/organ_model.dart
index fab7dff..9a871f3 100644
--- a/lib/features/symptoms_checker/models/organ_model.dart
+++ b/lib/features/symptoms_checker/models/organ_model.dart
@@ -3,29 +3,47 @@ import 'package:hmg_patient_app_new/core/enums.dart';
class OrganModel {
final String id;
final String name;
+ final String nameAr;
final String description;
+ final String descriptionAr;
final BodyView bodyView;
final OrganPosition position;
const OrganModel({
required this.id,
required this.name,
+ required this.nameAr,
required this.description,
+ required this.descriptionAr,
required this.bodyView,
required this.position,
});
+ /// Get localized name based on isArabic flag
+ String getLocalizedName(bool isArabic) {
+ return isArabic ? nameAr : name;
+ }
+
+ /// Get localized description based on isArabic flag
+ String getLocalizedDescription(bool isArabic) {
+ return isArabic ? descriptionAr : description;
+ }
+
OrganModel copyWith({
String? id,
String? name,
+ String? nameAr,
String? description,
+ String? descriptionAr,
BodyView? bodyView,
OrganPosition? position,
}) {
return OrganModel(
id: id ?? this.id,
name: name ?? this.name,
+ nameAr: nameAr ?? this.nameAr,
description: description ?? this.description,
+ descriptionAr: descriptionAr ?? this.descriptionAr,
bodyView: bodyView ?? this.bodyView,
position: position ?? this.position,
);
diff --git a/lib/features/symptoms_checker/models/resp_models/risk_and_suggestions_response_model.dart b/lib/features/symptoms_checker/models/resp_models/risk_and_suggestions_response_model.dart
index b2be4a2..9928d78 100644
--- a/lib/features/symptoms_checker/models/resp_models/risk_and_suggestions_response_model.dart
+++ b/lib/features/symptoms_checker/models/resp_models/risk_and_suggestions_response_model.dart
@@ -22,6 +22,8 @@ class RiskAndSuggestionsItemModel {
final String? type;
final String? name;
final String? commonName;
+ final String? nameAr;
+ final String? commonNameAr;
final String? language;
RiskAndSuggestionsItemModel({
@@ -29,6 +31,8 @@ class RiskAndSuggestionsItemModel {
this.type,
this.name,
this.commonName,
+ this.nameAr,
+ this.commonNameAr,
this.language,
});
@@ -38,6 +42,8 @@ class RiskAndSuggestionsItemModel {
type: json['type'],
name: json['name'],
commonName: json['common_name'],
+ nameAr: json['nameAr'],
+ commonNameAr: json['common_nameAr'],
language: json['language'],
);
}
@@ -48,12 +54,17 @@ class RiskAndSuggestionsItemModel {
'type': type,
'name': name,
'common_name': commonName,
+ 'nameAr': nameAr,
+ 'common_nameAr': commonNameAr,
'language': language,
};
}
- // Helper method to get display name
- String getDisplayName() {
+ // Helper method to get display name based on locale
+ String getDisplayName({bool isArabic = false}) {
+ if (isArabic) {
+ return commonNameAr ?? nameAr ?? commonName ?? name ?? '';
+ }
return commonName ?? name ?? '';
}
}
diff --git a/lib/features/symptoms_checker/models/resp_models/triage_response_model.dart b/lib/features/symptoms_checker/models/resp_models/triage_response_model.dart
index f0d7e90..da0f4b6 100644
--- a/lib/features/symptoms_checker/models/resp_models/triage_response_model.dart
+++ b/lib/features/symptoms_checker/models/resp_models/triage_response_model.dart
@@ -1,3 +1,5 @@
+import 'package:hmg_patient_app_new/core/enums.dart';
+
class TriageDataDetails {
final TriageQuestion? question;
final List? conditions;
@@ -170,13 +172,17 @@ class TriageCondition {
final String? id;
final String? name;
final String? commonName;
+ final String? nameAr;
+ final String? commonNameAr;
final double? probability;
- final dynamic conditionDetails;
+ final ConditionDetails? conditionDetails;
TriageCondition({
this.id,
this.name,
this.commonName,
+ this.nameAr,
+ this.commonNameAr,
this.probability,
this.conditionDetails,
});
@@ -186,8 +192,10 @@ class TriageCondition {
id: json['id'],
name: json['name'],
commonName: json['common_name'],
+ nameAr: json['nameAr'],
+ commonNameAr: json['common_nameAr'],
probability: json['probability']?.toDouble(),
- conditionDetails: json['condition_details'],
+ conditionDetails: json['condition_details'] != null ? ConditionDetails.fromJson(json['condition_details']) : null,
);
}
@@ -196,14 +204,96 @@ class TriageCondition {
'id': id,
'name': name,
'common_name': commonName,
+ 'nameAr': nameAr,
+ 'common_nameAr': commonNameAr,
'probability': probability,
- 'condition_details': conditionDetails,
+ 'condition_details': conditionDetails?.toJson(),
};
}
+ /// Get display name based on locale
+ String getDisplayName({bool isArabic = false}) {
+ if (isArabic) {
+ return commonNameAr ?? nameAr ?? commonName ?? name ?? '';
+ }
+ return commonName ?? name ?? '';
+ }
+
/// Get probability as percentage
String getProbabilityPercentage() {
if (probability == null) return '0%';
return '${(probability! * 100).toStringAsFixed(1)}%';
}
}
+
+class ConditionDetails {
+ final String? icd10Code;
+ final ConditionCategory? category;
+ final SeverityEnum? severity;
+ final TriageLevelEnum? triageLevel;
+ final String? hint;
+ final bool? hasPatientEducation;
+ final String? prevalence;
+ final String? acuteness;
+
+ ConditionDetails({
+ this.icd10Code,
+ this.category,
+ this.severity,
+ this.triageLevel,
+ this.hint,
+ this.hasPatientEducation,
+ this.prevalence,
+ this.acuteness,
+ });
+
+ factory ConditionDetails.fromJson(Map json) {
+ return ConditionDetails(
+ icd10Code: json['icd10_code'],
+ category: json['category'] != null ? ConditionCategory.fromJson(json['category']) : null,
+ severity: json['severity'] != null ? SeverityEnumExtension.fromInt(json['severity']) : null,
+ triageLevel: json['triage_level'] != null ? TriageLevelEnumExtension.fromInt(json['triage_level']) : null,
+ hint: json['hint'],
+ hasPatientEducation: json['has_patient_education'],
+ prevalence: json['prevalence'],
+ acuteness: json['acuteness'],
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'icd10_code': icd10Code,
+ 'category': category?.toJson(),
+ 'severity': severity?.toInt,
+ 'triage_level': triageLevel?.toInt,
+ 'hint': hint,
+ 'has_patient_education': hasPatientEducation,
+ 'prevalence': prevalence,
+ 'acuteness': acuteness,
+ };
+ }
+}
+
+class ConditionCategory {
+ final String? id;
+ final String? name;
+
+ ConditionCategory({
+ this.id,
+ this.name,
+ });
+
+ factory ConditionCategory.fromJson(Map json) {
+ return ConditionCategory(
+ id: json['id'],
+ name: json['name'],
+ );
+ }
+
+ Map toJson() {
+ return {
+ 'id': id,
+ 'name': name,
+ };
+ }
+}
diff --git a/lib/features/symptoms_checker/symptoms_checker_repo.dart b/lib/features/symptoms_checker/symptoms_checker_repo.dart
index c55c2f0..c0214e1 100644
--- a/lib/features/symptoms_checker/symptoms_checker_repo.dart
+++ b/lib/features/symptoms_checker/symptoms_checker_repo.dart
@@ -12,50 +12,42 @@ import 'package:hmg_patient_app_new/features/symptoms_checker/models/resp_models
import 'package:hmg_patient_app_new/services/logger_service.dart';
abstract class SymptomsCheckerRepo {
- Future>>
- getUserDetails({
+ Future>> getUserDetails({
required String userName,
required String password,
});
- Future>>
- getBodySymptomsByName({
+ Future>> getBodySymptomsByName({
required List organNames,
required String userSessionToken,
required int gender,
});
- Future>>
- getRiskFactors({
+ Future>> getRiskFactors({
required int age,
- required String sex,
+ required int gender,
required List evidenceIds,
required String language,
required String userSessionToken,
- required int gender,
required String sessionId,
});
- Future>>
- getSuggestions({
+ Future>> getSuggestions({
required int age,
- required String sex,
+ required int gender,
required List evidenceIds,
required String language,
required String userSessionToken,
required String sessionId,
- required int gender,
});
- Future>>
- getDiagnosisForTriage({
+ Future>> getDiagnosisForTriage({
required int age,
- required String sex,
+ required int gender,
required List evidenceIds,
List