|
|
|
|
@ -3,6 +3,7 @@ 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/screens/procedures/add_lab_orders.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
@ -12,20 +13,32 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
class LabsHomePage extends StatelessWidget {
|
|
|
|
|
class LabsHomePage extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
|
_LabsHomePageState createState() => _LabsHomePageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _LabsHomePageState extends State<LabsHomePage> {
|
|
|
|
|
String patientType;
|
|
|
|
|
|
|
|
|
|
String arrivalType;
|
|
|
|
|
PatiantInformtion patient;
|
|
|
|
|
bool isInpatient;
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
void didChangeDependencies() {
|
|
|
|
|
super.didChangeDependencies();
|
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
|
|
|
|
|
|
PatiantInformtion patient = routeArgs['patient'];
|
|
|
|
|
patient = routeArgs['patient'];
|
|
|
|
|
patientType = routeArgs['patientType'];
|
|
|
|
|
arrivalType = routeArgs['arrivalType'];
|
|
|
|
|
bool isInpatient = routeArgs['isInpatient'];
|
|
|
|
|
isInpatient = routeArgs['isInpatient'];
|
|
|
|
|
print(arrivalType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return BaseView<ProcedureViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getLabs(patient, isInpatient: isInpatient),
|
|
|
|
|
onModelReady: (model) => model.getLabs(patient, isInpatient: false),
|
|
|
|
|
builder: (context, ProcedureViewModel model, widget) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
backgroundColor: Colors.grey[100],
|
|
|
|
|
@ -93,6 +106,7 @@ class LabsHomePage extends StatelessWidget {
|
|
|
|
|
)),
|
|
|
|
|
);
|
|
|
|
|
},label: 'Apply for New Lab Order',),
|
|
|
|
|
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.patientLabOrdersList.length,
|
|
|
|
|
(index) => Column(
|
|
|
|
|
@ -101,25 +115,80 @@ class LabsHomePage extends StatelessWidget {
|
|
|
|
|
children: model
|
|
|
|
|
.patientLabOrdersList[index].patientLabOrdersList
|
|
|
|
|
.map((labOrder) {
|
|
|
|
|
return DoctorCard(
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: LaboratoryResultPage(
|
|
|
|
|
patientLabOrders: labOrder,
|
|
|
|
|
patient: patient,
|
|
|
|
|
arrivalType: arrivalType,
|
|
|
|
|
patientType: patientType,
|
|
|
|
|
return 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: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: 20,
|
|
|
|
|
height: 160,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
//Colors.red[900] Color(0xff404545)
|
|
|
|
|
color: labOrder.isLiveCareAppointment
|
|
|
|
|
? Colors.red[900]
|
|
|
|
|
: !labOrder.isInOutPatient
|
|
|
|
|
? Colors.black
|
|
|
|
|
: Color(0xffa9a089),
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(8),
|
|
|
|
|
bottomLeft: Radius.circular(8),
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: RotatedBox(
|
|
|
|
|
quarterTurns: 3,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Text(
|
|
|
|
|
labOrder.isLiveCareAppointment
|
|
|
|
|
? TranslationBase.of(context)
|
|
|
|
|
.liveCare
|
|
|
|
|
.toUpperCase()
|
|
|
|
|
: !labOrder.isInOutPatient
|
|
|
|
|
? TranslationBase.of(context)
|
|
|
|
|
.inPatient
|
|
|
|
|
.toUpperCase()
|
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
|
.outpatient
|
|
|
|
|
.toUpperCase(),
|
|
|
|
|
style: TextStyle(color: Colors.white),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: DoctorCard(
|
|
|
|
|
isNoMargin: true,
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: LaboratoryResultPage(
|
|
|
|
|
patientLabOrders: labOrder,
|
|
|
|
|
patient: patient,
|
|
|
|
|
arrivalType: arrivalType,
|
|
|
|
|
patientType: patientType,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
doctorName: labOrder.doctorName,
|
|
|
|
|
invoiceNO: ' ${labOrder.invoiceNo}',
|
|
|
|
|
profileUrl: labOrder.doctorImageURL,
|
|
|
|
|
branch: labOrder.projectName,
|
|
|
|
|
clinic: labOrder.clinicDescription,
|
|
|
|
|
appointmentDate: labOrder.orderDate,
|
|
|
|
|
orderNo: labOrder.orderNo,
|
|
|
|
|
isShowTime: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
doctorName: labOrder.doctorName,
|
|
|
|
|
invoiceNO: ' ${labOrder.invoiceNo}',
|
|
|
|
|
profileUrl: labOrder.doctorImageURL,
|
|
|
|
|
branch: labOrder.projectName,
|
|
|
|
|
clinic: labOrder.clinicDescription,
|
|
|
|
|
appointmentDate: labOrder.orderDate,
|
|
|
|
|
orderNo: labOrder.orderNo,
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
|