Changes for AI Lab analysis

haroon_dev
Haroon Amjad 14 hours ago
parent 30bdfac442
commit 657f886391

File diff suppressed because it is too large Load Diff

@ -199,8 +199,8 @@ class ApiClientImp implements ApiClient {
body['TokenID'] = "@dm!n";
}
body['TokenID'] = "@dm!n";
body['PatientID'] = 2007395;
// body['TokenID'] = "@dm!n";
// body['PatientID'] = 2007395;
// body['PatientTypeID'] = 1;
// body['PatientOutSA'] = 0;
// body['SessionID'] = "45786230487560q";

@ -106,6 +106,11 @@ class LabViewModel extends ChangeNotifier {
notifyListeners();
}
closeAILabResultAnalysis() {
labOrderResponseByAi = null;
notifyListeners();
}
void setIsSortByClinic(bool value) {
isSortByClinic = value;
patientLabOrdersViewList = isSortByClinic ? patientLabOrdersByClinic : patientLabOrdersByHospital;

@ -1,4 +1,3 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
@ -101,18 +100,12 @@ class DoctorProfilePage extends StatelessWidget {
children: [
Column(
children: [
Utils.buildSvgWithAssets(
icon: AppAssets.doctor_profile_rating_icon,
width: 48.w,
height: 48.h,
fit: BoxFit.contain,
applyThemeColor: false
),
Utils.buildSvgWithAssets(icon: AppAssets.doctor_profile_rating_icon, width: 48.w, height: 48.h, fit: BoxFit.contain, applyThemeColor: false),
SizedBox(height: 16.h),
"Ratings".toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
bookAppointmentsViewModel.doctorsProfileResponseModel.decimalDoctorRate
.toString()
.toText16(isBold: true, color: AppColors.textColor, isUnderLine: true, decorationColor: AppColors.textColor),
.toText16(isBold: true, color: AppColors.textColor, isUnderLine: true, decorationColor: AppColors.textColor, fontFamily: "Poppins"),
],
).onPress(() {
bookAppointmentsViewModel.getDoctorRatingDetails();
@ -128,18 +121,12 @@ class DoctorProfilePage extends StatelessWidget {
SizedBox(width: 36.w),
Column(
children: [
Utils.buildSvgWithAssets(
icon: AppAssets.doctor_profile_reviews_icon,
width: 48.w,
height: 48.h,
fit: BoxFit.contain,
applyThemeColor: false
),
Utils.buildSvgWithAssets(icon: AppAssets.doctor_profile_reviews_icon, width: 48.w, height: 48.h, fit: BoxFit.contain, applyThemeColor: false),
SizedBox(height: 16.h),
"Reviews".toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
bookAppointmentsViewModel.doctorsProfileResponseModel.noOfPatientsRate
.toString()
.toText16(isBold: true, color: AppColors.textColor, isUnderLine: true, decorationColor: AppColors.textColor),
.toText16(isBold: true, color: AppColors.textColor, isUnderLine: true, decorationColor: AppColors.textColor, fontFamily: "Poppins"),
],
).onPress(() {
bookAppointmentsViewModel.getDoctorRatingDetails();

@ -164,7 +164,7 @@ class LabResultByClinic extends StatelessWidget {
padding: EdgeInsets.only(right: 4.w, left: 4.w),
child: Utils.buildSvgWithAssets(icon: AppAssets.aiOverView, width: 16.h, height: 16.h, iconColor: Colors.white),
),
LocaleKeys.generateAiAnalysis.tr(context: context).toText16(isBold: true)
LocaleKeys.generateAiAnalysis.tr(context: context).toText16(isBold: true, color: Colors.white)
],
),
).paddingSymmetrical(24.h, 24.h).onPress(() async {

@ -2,11 +2,14 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart';
import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_order_response_by_ai_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
class AiAnalysisWidget extends StatelessWidget {
final LabOrderResponseByAi data;
@ -71,6 +74,14 @@ class AiAnalysisWidget extends StatelessWidget {
),
],
),
SizedBox(height: 16.h),
CustomButton(
height: 50.h,
text: LocaleKeys.close.tr(context: context),
onPressed: () {
getIt.get<LabViewModel>().closeAILabResultAnalysis();
},
),
],
),
),

@ -35,97 +35,99 @@ class LabResultDetails extends StatelessWidget {
LabViewModel labViewModel = Provider.of<LabViewModel>(context, listen: false);
final appState = getIt.get<AppState>();
return Scaffold(
body: Column(
children: [
Expanded(
child: CollapsingListView(
title: LocaleKeys.labResultDetails.tr(context: context),
// aiOverview: () async {
// final _dialogService = getIt.get<DialogService>();
// await _dialogService.showCommonBottomSheetWithoutH(
// message: LocaleKeys.aiDisclaimer.tr(),
// label: LocaleKeys.consent.tr(),
// okLabel: LocaleKeys.acceptLbl.tr(),
// cancelLabel: LocaleKeys.rejectView.tr(),
// onOkPressed: () {
// context.pop();
// labViewModel.getAiOverviewSingleLabResult(langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context));
// },
// onCancelPressed: () {
// context.pop();
// });
// },
child: SingleChildScrollView(
child: Column(
spacing: 16.h,
children: [
LabNameAndStatus(context),
getLabDescription(context),
LabGraph(context),
Selector<LabViewModel, LabOrderResponseByAi?>(
selector: (_, model) => model.labOrderResponseByAi,
builder: (_, aiData, __) {
if (aiData != null) {
return AiAnalysisWidget(data: aiData).paddingOnly(bottom: 16.h);
}
return const SizedBox.shrink();
},
),
],
).paddingAll(24.h),
body: Consumer<LabViewModel>(builder: (context, labVM, child) {
return Column(
children: [
Expanded(
child: CollapsingListView(
title: LocaleKeys.labResultDetails.tr(context: context),
// aiOverview: () async {
// final _dialogService = getIt.get<DialogService>();
// await _dialogService.showCommonBottomSheetWithoutH(
// message: LocaleKeys.aiDisclaimer.tr(),
// label: LocaleKeys.consent.tr(),
// okLabel: LocaleKeys.acceptLbl.tr(),
// cancelLabel: LocaleKeys.rejectView.tr(),
// onOkPressed: () {
// context.pop();
// labViewModel.getAiOverviewSingleLabResult(langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context));
// },
// onCancelPressed: () {
// context.pop();
// });
// },
child: SingleChildScrollView(
child: Column(
spacing: 16.h,
children: [
LabNameAndStatus(context),
getLabDescription(context),
LabGraph(context),
Selector<LabViewModel, LabOrderResponseByAi?>(
selector: (_, model) => model.labOrderResponseByAi,
builder: (_, aiData, __) {
if (aiData != null) {
return AiAnalysisWidget(data: aiData).paddingOnly(bottom: 16.h);
}
return const SizedBox.shrink();
},
),
],
).paddingAll(24.h),
),
),
),
),
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: true,
),
child: Container(
height: 56.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12.r),
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
stops: [0.236, 1.0], // 53.6% and 100%
colors: [
Color(0xFF8A38F5), // Transparent
Color(0xFFE20BBB), // Solid #F8F8F8
],
),
labVM.labOrderResponseByAi == null ? Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
hasShadow: true,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.only(right: 4.w, left: 4.w),
child: Utils.buildSvgWithAssets(icon: AppAssets.aiOverView, width: 16.h, height: 16.h, iconColor: Colors.white),
child: Container(
height: 56.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12.r),
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
stops: [0.236, 1.0], // 53.6% and 100%
colors: [
Color(0xFF8A38F5), // Transparent
Color(0xFFE20BBB), // Solid #F8F8F8
],
),
LocaleKeys.generateAiAnalysisResult.tr(context: context).toText16(isBold: true)
],
),
).paddingSymmetrical(24.h, 24.h).onPress(() async {
final _dialogService = getIt.get<DialogService>();
await _dialogService.showCommonBottomSheetWithoutH(
message: LocaleKeys.aiDisclaimer.tr(),
label: LocaleKeys.consent.tr(),
okLabel: LocaleKeys.acceptLbl.tr(),
cancelLabel: LocaleKeys.rejectView.tr(),
onOkPressed: () {
context.pop();
labViewModel.getAiOverviewSingleLabResult(
langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context));
},
onCancelPressed: () {
context.pop();
});
}),
),
],
),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.only(right: 4.w, left: 4.w),
child: Utils.buildSvgWithAssets(icon: AppAssets.aiOverView, width: 16.h, height: 16.h, iconColor: Colors.white),
),
LocaleKeys.generateAiAnalysisResult.tr(context: context).toText16(isBold: true, color: Colors.white)
],
),
).paddingSymmetrical(24.h, 24.h).onPress(() async {
final _dialogService = getIt.get<DialogService>();
await _dialogService.showCommonBottomSheetWithoutH(
message: LocaleKeys.aiDisclaimer.tr(),
label: LocaleKeys.consent.tr(),
okLabel: LocaleKeys.acceptLbl.tr(),
cancelLabel: LocaleKeys.rejectView.tr(),
onOkPressed: () {
context.pop();
labViewModel.getAiOverviewSingleLabResult(
langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context));
},
onCancelPressed: () {
context.pop();
});
}),
) : SizedBox.shrink(),
],
);
}),
);
}

Loading…
Cancel
Save