Merge remote-tracking branch 'origin/master' into appointment_filter
# Conflicts: # assets/langs/ar-SA.json # lib/generated/locale_keys.g.dart # lib/presentation/lab/lab_orders_page.dart # lib/presentation/lab/lab_results/lab_result_details.dartpull/71/head
commit
483a1571d9
@ -0,0 +1,32 @@
|
|||||||
|
class PatientLabSpecialResult {
|
||||||
|
String? invoiceNo;
|
||||||
|
String? moduleID;
|
||||||
|
String? resultData;
|
||||||
|
String? resultDataHTML;
|
||||||
|
dynamic resultDataTxt;
|
||||||
|
|
||||||
|
PatientLabSpecialResult(
|
||||||
|
{this.invoiceNo,
|
||||||
|
this.moduleID,
|
||||||
|
this.resultData,
|
||||||
|
this.resultDataHTML,
|
||||||
|
this.resultDataTxt});
|
||||||
|
|
||||||
|
PatientLabSpecialResult.fromJson(Map<String, dynamic> json) {
|
||||||
|
invoiceNo = json['InvoiceNo'];
|
||||||
|
moduleID = json['ModuleID'];
|
||||||
|
resultData = json['ResultData'];
|
||||||
|
resultDataHTML = json['ResultDataHTML'];
|
||||||
|
resultDataTxt = json['ResultDataTxt'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['InvoiceNo'] = this.invoiceNo;
|
||||||
|
data['ModuleID'] = this.moduleID;
|
||||||
|
data['ResultData'] = this.resultData;
|
||||||
|
data['ResultDataHTML'] = this.resultDataHTML;
|
||||||
|
data['ResultDataTxt'] = this.resultDataTxt;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,69 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart'
|
||||||
|
show tr, StringTranslateExtension;
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_widget_from_html/flutter_widget_from_html.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/extensions/widget_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart';
|
||||||
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
||||||
|
import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart';
|
||||||
|
import 'package:hmg_patient_app_new/presentation/lab/lab_result_via_hospital/LabResultList.dart';
|
||||||
|
import 'package:hmg_patient_app_new/presentation/lab/lab_result_via_hospital/lab_order_specialResult.dart';
|
||||||
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class LabResultByHospitals extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return CollapsingListView(
|
||||||
|
title: LocaleKeys.labResults.tr(),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
spacing: 8.h,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Selector<LabViewModel, bool>(
|
||||||
|
selector: (_, model) => model.isLabResultByHospitalLoading,
|
||||||
|
builder: (_, isLoading, __) {
|
||||||
|
if (isLoading) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
LabResultItemView(
|
||||||
|
onTap: () {},
|
||||||
|
labOrder: null,
|
||||||
|
index: 0,
|
||||||
|
isLoading: true,
|
||||||
|
),
|
||||||
|
LabResultItemView(
|
||||||
|
onTap: () {},
|
||||||
|
labOrder: null,
|
||||||
|
index: 0,
|
||||||
|
isLoading: true,
|
||||||
|
),
|
||||||
|
LabResultItemView(
|
||||||
|
onTap: () {},
|
||||||
|
labOrder: null,
|
||||||
|
index: 0,
|
||||||
|
isLoading: true,
|
||||||
|
),
|
||||||
|
LabResultItemView(
|
||||||
|
onTap: () {},
|
||||||
|
labOrder: null,
|
||||||
|
index: 0,
|
||||||
|
isLoading: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return LabResultList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
LabOrderSpecialResult()
|
||||||
|
],
|
||||||
|
).paddingAll(24.h),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/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/lab_result.dart';
|
||||||
|
import 'package:hmg_patient_app_new/presentation/lab/lab_result_via_hospital/lab_order_result_item.dart';
|
||||||
|
import 'package:provider/provider.dart' show Selector, Provider;
|
||||||
|
|
||||||
|
class LabResultList extends StatelessWidget {
|
||||||
|
late LabViewModel model;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
model = Provider.of<LabViewModel>(context);
|
||||||
|
return Selector<LabViewModel, List<LabResult>>(
|
||||||
|
selector: (_, model) => model.mainLabResultsByHospitals,
|
||||||
|
builder: (__, list, ___) {
|
||||||
|
if (list.isEmpty) {
|
||||||
|
return Utils.getNoDataWidget(context,
|
||||||
|
noDataText: "You don't have any lab results yet."
|
||||||
|
.needTranslation);
|
||||||
|
} else {
|
||||||
|
return ListView.builder(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
shrinkWrap: true,itemCount: list.length,itemBuilder: (____, index) {
|
||||||
|
var labItem = list[index];
|
||||||
|
return LabOrderResultItem(onTap: () {
|
||||||
|
model.getPatientLabResult(model.currentlySelectedPatientOrder!, labItem.description??"");
|
||||||
|
},
|
||||||
|
tests: labItem,
|
||||||
|
index: index,
|
||||||
|
iconColor: model.getColor(labItem.calculatedResultFlag ?? "N"),
|
||||||
|
severityText: model.getSeverityText(labItem.calculatedResultFlag ?? "N"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,96 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_export.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/enums.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/features/lab/models/resp_models/lab_result.dart';
|
||||||
|
import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_orders_response_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';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/chip/custom_chip_widget.dart';
|
||||||
|
|
||||||
|
class LabOrderResultItem extends StatelessWidget {
|
||||||
|
final VoidCallback onTap;
|
||||||
|
final int index;
|
||||||
|
final LabResult? tests;
|
||||||
|
final String severityText;
|
||||||
|
final bool isLoading;
|
||||||
|
final bool isExpanded;
|
||||||
|
final Color iconColor;
|
||||||
|
|
||||||
|
const LabOrderResultItem({super.key, required this.onTap, this.tests, required this.index, this.isLoading = false, this.isExpanded = false,required this.iconColor, required this.severityText});
|
||||||
|
|
||||||
|
@override
|
||||||
|
build(BuildContext context) {
|
||||||
|
return AnimatedContainer(
|
||||||
|
duration: Duration(milliseconds: 300),
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 8.h),
|
||||||
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.h, hasShadow: true),
|
||||||
|
child: Container(
|
||||||
|
key: ValueKey<int>(index),
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 16.h),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// ...labOrder!.testDetails!.map((detail) {
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(bottom: 8.h),
|
||||||
|
child: '${tests!.description}'.toText14(weight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
'${tests!.packageShortDescription}'.toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
|
||||||
|
//
|
||||||
|
SizedBox(height: 24.h),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
spacing: 6.h,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
|
||||||
|
Text(severityText.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
fontSize: 10.fSize,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.greyTextColor
|
||||||
|
)),
|
||||||
|
Utils.buildSvgWithAssets(
|
||||||
|
icon: AppAssets.lab_result_indicator,
|
||||||
|
width: 21,
|
||||||
|
height: 23,
|
||||||
|
iconColor: iconColor
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
CustomButton(
|
||||||
|
icon: AppAssets.view_report_icon,
|
||||||
|
iconColor: AppColors.primaryRedColor,
|
||||||
|
iconSize: 16.h,
|
||||||
|
text: LocaleKeys.viewReport.tr(context: context),
|
||||||
|
onPressed: () {
|
||||||
|
onTap();
|
||||||
|
},
|
||||||
|
backgroundColor: AppColors.secondaryLightRedColor,
|
||||||
|
borderColor: AppColors.secondaryLightRedColor,
|
||||||
|
textColor: AppColors.primaryRedColor,
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
borderRadius: 12,
|
||||||
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||||
|
height: 40.h,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,120 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_widget_from_html/flutter_widget_from_html.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/extensions/widget_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart';
|
||||||
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
||||||
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class LabOrderSpecialResult extends StatelessWidget {
|
||||||
|
const LabOrderSpecialResult({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Selector<LabViewModel, bool>(
|
||||||
|
selector: (_, model) => model.isSpecialResultsLoading,
|
||||||
|
builder: (_, isLoading, __) {
|
||||||
|
return Selector<LabViewModel, String>(
|
||||||
|
selector: (_, model) => model.labSpecialResult,
|
||||||
|
builder: (_, data, __) {
|
||||||
|
if(isLoading){
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 8.h),
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 16.h, vertical: 16.h),
|
||||||
|
width: MediaQuery.sizeOf(context).width - 24,
|
||||||
|
decoration: RoundedRectangleBorder()
|
||||||
|
.toSmoothCornerDecoration(
|
||||||
|
color: AppColors.whiteColor,
|
||||||
|
borderRadius: 20.h,
|
||||||
|
hasShadow: true),
|
||||||
|
child:Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
spacing: 12.h,
|
||||||
|
children: [
|
||||||
|
"loading".toText14().toShimmer2(isShow: isLoading),
|
||||||
|
"loading".toText14().toShimmer2(isShow: isLoading),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if(data.isNotEmpty ) {
|
||||||
|
return AnimatedContainer(
|
||||||
|
duration: Duration(milliseconds: 300),
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 8.h),
|
||||||
|
decoration: RoundedRectangleBorder()
|
||||||
|
.toSmoothCornerDecoration(
|
||||||
|
color: AppColors.whiteColor,
|
||||||
|
borderRadius: 20.h,
|
||||||
|
hasShadow: true),
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 16.h, vertical: 16.h),
|
||||||
|
width: MediaQuery.sizeOf(context).width - 24,
|
||||||
|
child: Column(
|
||||||
|
spacing: 8.h,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// ...labOrder!.testDetails!.map((detail) {
|
||||||
|
LocaleKeys.specialResult
|
||||||
|
.tr()
|
||||||
|
.toText14(weight: FontWeight.w500)
|
||||||
|
.toShimmer2(isShow: isLoading),
|
||||||
|
|
||||||
|
data.isEmpty
|
||||||
|
? LocaleKeys.noSpecialResult
|
||||||
|
.tr()
|
||||||
|
.toText12(
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.textColorLight)
|
||||||
|
.toShimmer2(isShow: isLoading)
|
||||||
|
: HtmlWidget(data).toShimmer2(isShow: isLoading)
|
||||||
|
|
||||||
|
//
|
||||||
|
],
|
||||||
|
),
|
||||||
|
));
|
||||||
|
} return SizedBox.shrink();
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Text(
|
||||||
|
"Special Results",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.fSize,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: AppColors.blackColor),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||||
|
color: AppColors.whiteColor,
|
||||||
|
borderRadius: 20.h,
|
||||||
|
hasShadow: true
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.all(16.h),
|
||||||
|
width: MediaQuery.sizeOf(context).width-24,
|
||||||
|
child: Selector<LabViewModel, bool>(
|
||||||
|
selector: (_, model) =>
|
||||||
|
model.isLabResultByHospitalLoading,
|
||||||
|
builder: (_, isLoading, __) {
|
||||||
|
return Selector<LabViewModel, String>(
|
||||||
|
selector: (_, model) => model.labSpecialResult,
|
||||||
|
builder: (_, data, __) {
|
||||||
|
return (data.isEmpty)
|
||||||
|
? Text("No result available".needTranslation,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.fSize,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: AppColors.textColorLight))
|
||||||
|
.toShimmer2(isShow: isLoading)
|
||||||
|
: HtmlWidget(data)
|
||||||
|
.toShimmer2(isShow: isLoading);
|
||||||
|
});
|
||||||
|
}))*/
|
||||||
Loading…
Reference in New Issue