|
|
|
|
@ -5,6 +5,8 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
|
|
|
|
|
@ -20,94 +22,61 @@ class LabsHomePage extends StatelessWidget {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
|
PatiantInformtion patient = routeArgs['patient'];
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
String patientType = routeArgs['patient-type'];
|
|
|
|
|
String arrivalType = routeArgs['arrival-type'];
|
|
|
|
|
return BaseView<LabsViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getLabs(patient),
|
|
|
|
|
builder: (context, LabsViewModel model, widget) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).labOrders,
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
widthFactor: 1.0,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () => model.setFilterType(FilterType.Clinic),
|
|
|
|
|
child: ListTile(
|
|
|
|
|
title: Text(TranslationBase.of(context).clinic),
|
|
|
|
|
leading: Radio(
|
|
|
|
|
value: FilterType.Clinic,
|
|
|
|
|
groupValue: model.filterType,
|
|
|
|
|
onChanged: (FilterType value) {
|
|
|
|
|
model.setFilterType(value);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () => model.setFilterType(FilterType.Hospital),
|
|
|
|
|
child: ListTile(
|
|
|
|
|
title: Text(TranslationBase.of(context).hospital),
|
|
|
|
|
leading: Radio(
|
|
|
|
|
value: FilterType.Hospital,
|
|
|
|
|
groupValue: model.filterType,
|
|
|
|
|
onChanged: (FilterType value) =>
|
|
|
|
|
model.setFilterType(value),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType),
|
|
|
|
|
SizedBox(height: 12,),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts('Lab',style: "caption2",color: Colors.black,fontSize: 13,),
|
|
|
|
|
Texts('Result',bold: true,fontSize: 22,),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.patientLabOrdersList.length,
|
|
|
|
|
(index) => Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: model
|
|
|
|
|
.patientLabOrdersList[index].patientLabOrdersList
|
|
|
|
|
.map((labOrder) {
|
|
|
|
|
return DoctorCard(
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: LaboratoryResultPage(
|
|
|
|
|
patientLabOrders: labOrder,
|
|
|
|
|
patient: patient,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
doctorName: labOrder.doctorName,
|
|
|
|
|
invoiceNO: ' ${labOrder.invoiceNo}',
|
|
|
|
|
profileUrl: labOrder.doctorImageURL,
|
|
|
|
|
branch: labOrder.projectName,
|
|
|
|
|
appointmentDate: labOrder.orderDate,
|
|
|
|
|
orderNo: labOrder.orderNo,
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.patientLabOrdersList.length,
|
|
|
|
|
(index) => AppExpandableNotifier(
|
|
|
|
|
title: model.patientLabOrdersList[index].filterName,
|
|
|
|
|
bodyWidget: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: model
|
|
|
|
|
.patientLabOrdersList[index].patientLabOrdersList
|
|
|
|
|
.map((labOrder) {
|
|
|
|
|
return DoctorCard(
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: LaboratoryResultPage(
|
|
|
|
|
patientLabOrders: labOrder,
|
|
|
|
|
patient: patient,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
isInOutPatient: labOrder.isInOutPatient,
|
|
|
|
|
name: labOrder.doctorName,
|
|
|
|
|
billNo: ' ${labOrder.invoiceNo}',
|
|
|
|
|
profileUrl: labOrder.doctorImageURL,
|
|
|
|
|
subName: labOrder.projectName,
|
|
|
|
|
isLiveCareAppointment:
|
|
|
|
|
labOrder.isLiveCareAppointment,
|
|
|
|
|
date: projectViewModel.isArabic
|
|
|
|
|
? DateUtils.getMonthDayYearDateFormattedAr(
|
|
|
|
|
labOrder.orderDate)
|
|
|
|
|
: DateUtils.getMonthDayYearDateFormatted(
|
|
|
|
|
labOrder.orderDate),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|