|
|
|
|
@ -14,16 +14,29 @@ import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class RadiologyHomePage extends StatelessWidget {
|
|
|
|
|
class RadiologyHomePage extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
_RadiologyHomePageState createState() => _RadiologyHomePageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _RadiologyHomePageState extends State<RadiologyHomePage> {
|
|
|
|
|
String patientType;
|
|
|
|
|
PatiantInformtion patient;
|
|
|
|
|
String arrivalType;
|
|
|
|
|
bool isInpatient;
|
|
|
|
|
@override
|
|
|
|
|
void didChangeDependencies() {
|
|
|
|
|
super.didChangeDependencies();
|
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
|
PatiantInformtion patient = routeArgs['patient'];
|
|
|
|
|
String patientType = routeArgs['patientType'];
|
|
|
|
|
String arrivalType = routeArgs['arrivalType'];
|
|
|
|
|
bool isInpatient = routeArgs['isInpatient'];
|
|
|
|
|
patient = routeArgs['patient'];
|
|
|
|
|
patientType = routeArgs['patientType'];
|
|
|
|
|
arrivalType = routeArgs['arrivalType'];
|
|
|
|
|
isInpatient = routeArgs['isInpatient'];
|
|
|
|
|
print(arrivalType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return BaseView<ProcedureViewModel>(
|
|
|
|
|
onModelReady: (model) =>
|
|
|
|
|
model.getPatientRadOrders(patient, patientType: patientType, isInPatient: isInpatient),
|
|
|
|
|
@ -99,6 +112,42 @@ class RadiologyHomePage extends StatelessWidget {
|
|
|
|
|
},
|
|
|
|
|
label: 'Apply for Radiology Order',
|
|
|
|
|
),
|
|
|
|
|
if(!isInpatient)
|
|
|
|
|
Container(
|
|
|
|
|
width: double.maxFinite,
|
|
|
|
|
margin: EdgeInsets.only(right: 8),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: (){
|
|
|
|
|
setState(() {
|
|
|
|
|
isInpatient = true;
|
|
|
|
|
});
|
|
|
|
|
model.getPatientRadOrders(patient, patientType: patientType, isInPatient: true);
|
|
|
|
|
},
|
|
|
|
|
child: Align(
|
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
|
child: AppText('View Inpatient Lab Result',
|
|
|
|
|
textDecoration:TextDecoration.underline,color: Colors.red,),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if(isInpatient)
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(right: 8),
|
|
|
|
|
width: double.maxFinite,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: (){
|
|
|
|
|
setState(() {
|
|
|
|
|
isInpatient = false;
|
|
|
|
|
});
|
|
|
|
|
model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false);
|
|
|
|
|
},
|
|
|
|
|
child: Align(
|
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
|
child: AppText('View Outpatient Lab Result',
|
|
|
|
|
textDecoration:TextDecoration.underline,color: Colors.red,),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
...List.generate(
|
|
|
|
|
model.radiologyList.length,
|
|
|
|
|
(index) => InkWell(
|
|
|
|
|
|