|
|
|
|
@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrde
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
@ -63,149 +64,152 @@ class _LabsHomePageState extends State<LabsHomePage> {
|
|
|
|
|
// isInpatient: isInpatient!,
|
|
|
|
|
// ),
|
|
|
|
|
// body:
|
|
|
|
|
Material(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
PatientProfileAppBar(
|
|
|
|
|
patient!,
|
|
|
|
|
isInpatient: isInpatient!,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
widthFactor: 1.0,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
if ((model.patientLabOrdersList.isNotEmpty && patient!.patientStatusType != 43) || (patient!.patientStatusType != null && patient!.patientStatusType == 43))
|
|
|
|
|
ServiceTitle(
|
|
|
|
|
title: TranslationBase.of(context).lab,
|
|
|
|
|
subTitle: TranslationBase.of(context).result,
|
|
|
|
|
Material(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
PatientProfileAppBar(
|
|
|
|
|
patient!,
|
|
|
|
|
isInpatient: isInpatient!,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
widthFactor: 1.0,
|
|
|
|
|
child: NetworkBaseView(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
child:Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
!model.isPrincipalCovered_
|
|
|
|
|
? Center(
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context).principalCoveredOrNot,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
))
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
if ((patient!.patientStatusType != null && patient!.patientStatusType == 43) || (isFromLiveCare! && patient!.appointmentNo != null))
|
|
|
|
|
AddNewOrder(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => BaseAddProcedureTabPage(
|
|
|
|
|
patient: patient!,
|
|
|
|
|
previousProcedureViewModel: model,
|
|
|
|
|
procedureType: ProcedureType.LAB_RESULT,
|
|
|
|
|
),
|
|
|
|
|
settings: RouteSettings(name: 'AddProcedureTabPage'),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
label: TranslationBase.of(context).applyForNewLabOrder,
|
|
|
|
|
if ((model.patientLabOrdersList.isNotEmpty && patient!.patientStatusType != 43) || (patient!.patientStatusType != null && patient!.patientStatusType == 43))
|
|
|
|
|
ServiceTitle(
|
|
|
|
|
title: TranslationBase.of(context).lab,
|
|
|
|
|
subTitle: TranslationBase.of(context).result,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.patientLabOrdersList.length,
|
|
|
|
|
(index) => Container(
|
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 0.5,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(8.0),
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
Positioned(
|
|
|
|
|
bottom: 1,
|
|
|
|
|
top: 1,
|
|
|
|
|
left: 1,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 20,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: model.patientLabOrdersList![index].isLiveCareAppointment!
|
|
|
|
|
? Colors.red[900]
|
|
|
|
|
: !model.patientLabOrdersList[index].isInOutPatient!
|
|
|
|
|
? Colors.black
|
|
|
|
|
: Color(0xffa9a089),
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
|
|
|
|
|
bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
|
|
|
|
|
topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
|
|
|
|
|
bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)),
|
|
|
|
|
!model.isPrincipalCovered_
|
|
|
|
|
? Center(
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context).principalCoveredOrNot,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
))
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
if ((patient!.patientStatusType != null && patient!.patientStatusType == 43) || (isFromLiveCare! && patient!.appointmentNo != null))
|
|
|
|
|
AddNewOrder(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => BaseAddProcedureTabPage(
|
|
|
|
|
patient: patient!,
|
|
|
|
|
previousProcedureViewModel: model,
|
|
|
|
|
procedureType: ProcedureType.LAB_RESULT,
|
|
|
|
|
),
|
|
|
|
|
child: RotatedBox(
|
|
|
|
|
quarterTurns: 3,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Text(
|
|
|
|
|
model.patientLabOrdersList[index].isLiveCareAppointment!
|
|
|
|
|
? TranslationBase.of(context).liveCare.toUpperCase()
|
|
|
|
|
: !model.patientLabOrdersList[index].isInOutPatient!
|
|
|
|
|
? TranslationBase.of(context).inPatientLabel.toUpperCase()
|
|
|
|
|
: TranslationBase.of(context).outpatient.toUpperCase(),
|
|
|
|
|
style: TextStyle(color: Colors.white),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
settings: RouteSettings(name: 'AddProcedureTabPage'),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
label: TranslationBase.of(context).applyForNewLabOrder,
|
|
|
|
|
),
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.patientLabOrdersList.length,
|
|
|
|
|
(index) => Container(
|
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 0.5,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(8.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
padding: EdgeInsets.all(0),
|
|
|
|
|
margin: EdgeInsets.only(left: 20),
|
|
|
|
|
child: DoctorCard(
|
|
|
|
|
isNoMargin: true,
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: LaboratoryResultPage(
|
|
|
|
|
patientLabOrders: model.patientLabOrdersList[index],
|
|
|
|
|
patient: patient!,
|
|
|
|
|
isInpatient: isInpatient!,
|
|
|
|
|
arrivalType: arrivalType!,
|
|
|
|
|
patientType: patientType!,
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
Positioned(
|
|
|
|
|
bottom: 1,
|
|
|
|
|
top: 1,
|
|
|
|
|
left: 1,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: 20,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: model.patientLabOrdersList![index].isLiveCareAppointment!
|
|
|
|
|
? Colors.red[900]
|
|
|
|
|
: !model.patientLabOrdersList[index].isInOutPatient!
|
|
|
|
|
? Colors.black
|
|
|
|
|
: Color(0xffa9a089),
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
|
|
|
|
|
bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
|
|
|
|
|
topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
|
|
|
|
|
bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)),
|
|
|
|
|
),
|
|
|
|
|
child: RotatedBox(
|
|
|
|
|
quarterTurns: 3,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Text(
|
|
|
|
|
model.patientLabOrdersList[index].isLiveCareAppointment!
|
|
|
|
|
? TranslationBase.of(context).liveCare.toUpperCase()
|
|
|
|
|
: !model.patientLabOrdersList[index].isInOutPatient!
|
|
|
|
|
? TranslationBase.of(context).inPatientLabel.toUpperCase()
|
|
|
|
|
: TranslationBase.of(context).outpatient.toUpperCase(),
|
|
|
|
|
style: TextStyle(color: Colors.white),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
padding: EdgeInsets.all(0),
|
|
|
|
|
margin: EdgeInsets.only(left: 20),
|
|
|
|
|
child: DoctorCard(
|
|
|
|
|
isNoMargin: true,
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: LaboratoryResultPage(
|
|
|
|
|
patientLabOrders: model.patientLabOrdersList[index],
|
|
|
|
|
patient: patient!,
|
|
|
|
|
isInpatient: isInpatient!,
|
|
|
|
|
arrivalType: arrivalType!,
|
|
|
|
|
patientType: patientType!,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
doctorName: Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName),
|
|
|
|
|
invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}',
|
|
|
|
|
profileUrl: model.patientLabOrdersList[index].doctorImageURL,
|
|
|
|
|
branch: model.patientLabOrdersList[index].projectName,
|
|
|
|
|
clinic: Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription),
|
|
|
|
|
appointmentDate: model.patientLabOrdersList[index].createdOn,
|
|
|
|
|
orderNo: model.patientLabOrdersList[index].orderNo,
|
|
|
|
|
isShowTime: false,
|
|
|
|
|
),
|
|
|
|
|
doctorName: Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName),
|
|
|
|
|
invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}',
|
|
|
|
|
profileUrl: model.patientLabOrdersList[index].doctorImageURL,
|
|
|
|
|
branch: model.patientLabOrdersList[index].projectName,
|
|
|
|
|
clinic: Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription),
|
|
|
|
|
appointmentDate: model.patientLabOrdersList[index].createdOn,
|
|
|
|
|
orderNo: model.patientLabOrdersList[index].orderNo,
|
|
|
|
|
isShowTime: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (model.patientLabOrdersList.isEmpty && patient!.patientStatusType != 43)
|
|
|
|
|
Center(
|
|
|
|
|
child: ErrorMessage(
|
|
|
|
|
error: TranslationBase.of(context).noDataAvailable,
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
if (model.patientLabOrdersList.isEmpty && patient!.patientStatusType != 43)
|
|
|
|
|
Center(
|
|
|
|
|
child: ErrorMessage(
|
|
|
|
|
error: TranslationBase.of(context).noDataAvailable,
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
),)
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|