|
|
|
|
@ -12,18 +12,30 @@ 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),
|
|
|
|
|
builder: (context, ProcedureViewModel model, widget) => AppScaffold(
|
|
|
|
|
@ -93,6 +105,42 @@ class LabsHomePage extends StatelessWidget {
|
|
|
|
|
)),
|
|
|
|
|
);
|
|
|
|
|
},label: 'Apply for New Lab Order',),
|
|
|
|
|
if(!isInpatient)
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(right: 8),
|
|
|
|
|
width: double.maxFinite,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: (){
|
|
|
|
|
setState(() {
|
|
|
|
|
isInpatient= true;
|
|
|
|
|
});
|
|
|
|
|
model.getLabs(patient, isInpatient: true);
|
|
|
|
|
},
|
|
|
|
|
child: Align(
|
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
|
child: AppText('View Inpatient Lab Result',
|
|
|
|
|
textDecoration:TextDecoration.underline,color: Colors.red,),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if(isInpatient)
|
|
|
|
|
Container(
|
|
|
|
|
width: double.maxFinite,
|
|
|
|
|
margin: EdgeInsets.only(right: 8),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: (){
|
|
|
|
|
setState(() {
|
|
|
|
|
isInpatient= false;
|
|
|
|
|
});
|
|
|
|
|
model.getLabs(patient, isInpatient: false);
|
|
|
|
|
},
|
|
|
|
|
child: Align(
|
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
|
child: AppText('View Outpatient Lab Result',
|
|
|
|
|
textDecoration:TextDecoration.underline,color: Colors.red,),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.patientLabOrdersList.length,
|
|
|
|
|
(index) => Column(
|
|
|
|
|
@ -120,6 +168,7 @@ class LabsHomePage extends StatelessWidget {
|
|
|
|
|
clinic: labOrder.clinicDescription,
|
|
|
|
|
appointmentDate: labOrder.orderDate,
|
|
|
|
|
orderNo: labOrder.orderNo,
|
|
|
|
|
isShowTime: false,
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
|