|
|
|
@ -1,6 +1,13 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/scheduler.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:intl/intl.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import '../../../config/size_config.dart';
|
|
|
|
|
import '../../../providers/patients_provider.dart';
|
|
|
|
@ -29,13 +36,22 @@ class _ReferPatientState extends State<ReferPatientScreen> {
|
|
|
|
|
var doctorsList;
|
|
|
|
|
var clinicsList;
|
|
|
|
|
var referralFrequancyList;
|
|
|
|
|
final _controller = TextEditingController();
|
|
|
|
|
final _remarksController = TextEditingController();
|
|
|
|
|
final _extController = TextEditingController();
|
|
|
|
|
var _isInit = true;
|
|
|
|
|
|
|
|
|
|
var clinicId;
|
|
|
|
|
var doctorId;
|
|
|
|
|
var freqId;
|
|
|
|
|
|
|
|
|
|
String _selectedClinic;
|
|
|
|
|
String _selectedDoctor;
|
|
|
|
|
String _selectedReferralFrequancy;
|
|
|
|
|
|
|
|
|
|
List<String> _priorities = ['Very Urgent', 'Urgent', 'Routine'];
|
|
|
|
|
int _activePriority = 2;
|
|
|
|
|
String _priorityTime;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void didChangeDependencies() {
|
|
|
|
|
super.didChangeDependencies();
|
|
|
|
@ -54,214 +70,410 @@ class _ReferPatientState extends State<ReferPatientScreen> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
appBarTitle: "Progress Note",
|
|
|
|
|
appBarTitle: "Refer Patient",
|
|
|
|
|
body: patientsProv.isLoading
|
|
|
|
|
? DrAppCircularProgressIndeicator()
|
|
|
|
|
: patientsProv.isError
|
|
|
|
|
? DrAppEmbeddedError(error: patientsProv.error)
|
|
|
|
|
: clinicsList == null
|
|
|
|
|
? DrAppEmbeddedError(
|
|
|
|
|
error: 'You don\'t have any Progress Note')
|
|
|
|
|
: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
margin: 0,
|
|
|
|
|
showBorder: true,
|
|
|
|
|
raduis: 30,
|
|
|
|
|
borderColor: Color(0xff707070),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
bottom: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
value: _selectedClinic,
|
|
|
|
|
iconSize: 40,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return patientsProv
|
|
|
|
|
error: 'Something Wrong!')
|
|
|
|
|
: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
"Clinic",
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
marginLeft: 15,
|
|
|
|
|
marginTop: 15,
|
|
|
|
|
),
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
margin: 10,
|
|
|
|
|
showBorder: true,
|
|
|
|
|
raduis: 30,
|
|
|
|
|
borderColor: Color(0xff707070),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
bottom: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
value: _selectedClinic,
|
|
|
|
|
iconSize: 40,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return patientsProv
|
|
|
|
|
.getClinicNameList()
|
|
|
|
|
.map((item) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
item,
|
|
|
|
|
fontSize:
|
|
|
|
|
SizeConfig.textMultiplier *
|
|
|
|
|
2.1,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged: (newValue) => {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedDoctor = null;
|
|
|
|
|
_selectedClinic = newValue;
|
|
|
|
|
var clinicInfo =
|
|
|
|
|
clinicsList.singleWhere((i) =>
|
|
|
|
|
i['ClinicDescription']
|
|
|
|
|
.toString()
|
|
|
|
|
.contains(_selectedClinic));
|
|
|
|
|
clinicId =
|
|
|
|
|
clinicInfo['ClinicID'].toString();
|
|
|
|
|
patientsProv.getDoctorsList(clinicId);
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
items: patientsProv
|
|
|
|
|
.getClinicNameList()
|
|
|
|
|
.map((item) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
item,
|
|
|
|
|
fontSize:
|
|
|
|
|
SizeConfig.textMultiplier *
|
|
|
|
|
2.1,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
value: item.toString(),
|
|
|
|
|
child: Text(
|
|
|
|
|
item,
|
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged: (newValue) => {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedDoctor = null;
|
|
|
|
|
_selectedClinic = newValue;
|
|
|
|
|
var clinicInfo =
|
|
|
|
|
clinicsList.singleWhere((i) =>
|
|
|
|
|
i['ClinicDescription']
|
|
|
|
|
.toString()
|
|
|
|
|
.contains(_selectedClinic));
|
|
|
|
|
var clinicId =
|
|
|
|
|
clinicInfo['ClinicID'].toString();
|
|
|
|
|
patientsProv.getDoctorsList(clinicId);
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
items: patientsProv
|
|
|
|
|
.getClinicNameList()
|
|
|
|
|
.map((item) {
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
value: item.toString(),
|
|
|
|
|
child: Text(
|
|
|
|
|
item,
|
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
//--------------------------------------------------------------------//
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
margin: 0,
|
|
|
|
|
showBorder: true,
|
|
|
|
|
raduis: 30,
|
|
|
|
|
borderColor: Color(0xff707070),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
bottom: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
value: _selectedDoctor,
|
|
|
|
|
iconSize: 40,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return patientsProv
|
|
|
|
|
//--------------------------------------------------------------------//
|
|
|
|
|
AppText(
|
|
|
|
|
"Doctor",
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
marginLeft: 15,
|
|
|
|
|
marginTop: 15,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
margin: 10,
|
|
|
|
|
showBorder: true,
|
|
|
|
|
raduis: 30,
|
|
|
|
|
borderColor: Color(0xff707070),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
bottom: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
value: _selectedDoctor,
|
|
|
|
|
iconSize: 40,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return patientsProv
|
|
|
|
|
.getDoctorNameList()
|
|
|
|
|
.map((item) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
item,
|
|
|
|
|
fontSize:
|
|
|
|
|
SizeConfig.textMultiplier *
|
|
|
|
|
2.1,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged: (newValue) => {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedDoctor = newValue;
|
|
|
|
|
var doctorInfo =
|
|
|
|
|
doctorsList.singleWhere((i) =>
|
|
|
|
|
i['DoctorName']
|
|
|
|
|
.toString()
|
|
|
|
|
.contains(_selectedDoctor));
|
|
|
|
|
doctorId =
|
|
|
|
|
doctorInfo['DoctorID'].toString();
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
items: patientsProv
|
|
|
|
|
.getDoctorNameList()
|
|
|
|
|
.map((item) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
item,
|
|
|
|
|
fontSize:
|
|
|
|
|
SizeConfig.textMultiplier *
|
|
|
|
|
2.1,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
value: item.toString(),
|
|
|
|
|
child: Text(
|
|
|
|
|
item,
|
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged: (newValue) => {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedDoctor = newValue;
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
items: patientsProv
|
|
|
|
|
.getDoctorNameList()
|
|
|
|
|
.map((item) {
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
value: item.toString(),
|
|
|
|
|
child: Text(
|
|
|
|
|
item,
|
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
), //-----------------------------///
|
|
|
|
|
AppText(
|
|
|
|
|
"Ext#",
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
marginLeft: 15,
|
|
|
|
|
marginTop: 15,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
hintText: "Ext#",
|
|
|
|
|
controller: _extController,
|
|
|
|
|
inputFormatter: ONLY_NUMBERS,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
onChanged: (value) => {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
), //-----------------------------///
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
margin: 0,
|
|
|
|
|
showBorder: true,
|
|
|
|
|
raduis: 30,
|
|
|
|
|
borderColor: Color(0xff707070),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
bottom: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
value: _selectedReferralFrequancy,
|
|
|
|
|
iconSize: 40,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return patientsProv
|
|
|
|
|
AppText(
|
|
|
|
|
"Priority",
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
marginLeft: 15,
|
|
|
|
|
marginTop: 15,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
priorityBar(context),
|
|
|
|
|
|
|
|
|
|
AppText(
|
|
|
|
|
"Replay Before: " + getPriority(),
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
marginLeft: 15,
|
|
|
|
|
marginTop: 15,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
AppText(
|
|
|
|
|
"Referral Frequency",
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
marginLeft: 15,
|
|
|
|
|
marginTop: 15,
|
|
|
|
|
),
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
margin: 10,
|
|
|
|
|
showBorder: true,
|
|
|
|
|
raduis: 30,
|
|
|
|
|
borderColor: Color(0xff707070),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
bottom: SizeConfig.widthMultiplier * 0.9,
|
|
|
|
|
right: SizeConfig.widthMultiplier * 3,
|
|
|
|
|
left: SizeConfig.widthMultiplier * 3),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
// add Expanded to have your dropdown button fill remaining space
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
value: _selectedReferralFrequancy,
|
|
|
|
|
iconSize: 40,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return patientsProv
|
|
|
|
|
.getReferralNamesList()
|
|
|
|
|
.map((item) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
item,
|
|
|
|
|
fontSize:
|
|
|
|
|
SizeConfig.textMultiplier *
|
|
|
|
|
2.1,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged: (newValue) => {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedReferralFrequancy = newValue;
|
|
|
|
|
var freqInfo =
|
|
|
|
|
referralFrequancyList.singleWhere((i) =>
|
|
|
|
|
i['Description']
|
|
|
|
|
.toString()
|
|
|
|
|
.contains(_selectedReferralFrequancy));
|
|
|
|
|
freqId =
|
|
|
|
|
freqInfo['ParameterCode'].toString();
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
items: patientsProv
|
|
|
|
|
.getReferralNamesList()
|
|
|
|
|
.map((item) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
item,
|
|
|
|
|
fontSize:
|
|
|
|
|
SizeConfig.textMultiplier *
|
|
|
|
|
2.1,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
value: item.toString(),
|
|
|
|
|
child: Text(
|
|
|
|
|
item,
|
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged: (newValue) => {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedReferralFrequancy = newValue;
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
items: patientsProv
|
|
|
|
|
.getReferralNamesList()
|
|
|
|
|
.map((item) {
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
value: item.toString(),
|
|
|
|
|
child: Text(
|
|
|
|
|
item,
|
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
"Clinical Details and Remarks",
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
marginLeft: 15,
|
|
|
|
|
marginTop: 15,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(10.0),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
hintText: "Remarks",
|
|
|
|
|
controller: _remarksController,
|
|
|
|
|
inputFormatter: ONLY_LETTERS,
|
|
|
|
|
textInputType: TextInputType.text,
|
|
|
|
|
onChanged: (value) => {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.all(20.0),
|
|
|
|
|
child: AppButton(title: "Send", color: Color(PRIMARY_COLOR),onPressed: ()=>{
|
|
|
|
|
referToDoctor()
|
|
|
|
|
},),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget priorityBar(BuildContext _context) {
|
|
|
|
|
return Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.065,
|
|
|
|
|
width: SizeConfig.screenWidth * 0.9,
|
|
|
|
|
margin: EdgeInsets.only(top: 10),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Color(0Xffffffff), borderRadius: BorderRadius.circular(20)),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: _priorities.map((item) {
|
|
|
|
|
bool _isActive = _priorities[_activePriority] == item ? true : false;
|
|
|
|
|
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
|
|
|
|
|
InkWell(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 40,
|
|
|
|
|
width: 90,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(50),
|
|
|
|
|
color: _isActive ? Hexcolor("#B8382B") : Colors.white,
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Text(
|
|
|
|
|
item,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: _isActive
|
|
|
|
|
? Colors.white
|
|
|
|
|
: Colors.black, //Colors.black,
|
|
|
|
|
// backgroundColor:_isActive
|
|
|
|
|
// ? Hexcolor("#B8382B")
|
|
|
|
|
// : Colors.white,//sideColor,
|
|
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
print(_priorities.indexOf(item));
|
|
|
|
|
setState(() {
|
|
|
|
|
_activePriority = _priorities.indexOf(item);
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
_isActive
|
|
|
|
|
? Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
height: 3,
|
|
|
|
|
width: 90,
|
|
|
|
|
)
|
|
|
|
|
: Container()
|
|
|
|
|
]);
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String getPriority() {
|
|
|
|
|
DateTime date = DateTime.now();
|
|
|
|
|
switch (_activePriority) {
|
|
|
|
|
case 0:
|
|
|
|
|
date = date.add(new Duration(hours: 3));
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
date = date.add(new Duration(hours: 6));
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
date = date.add(new Duration(days: 1));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
var format = DateFormat('yyyy/mm/dd HH:mm a');
|
|
|
|
|
var time = format.format(date);
|
|
|
|
|
print(time);
|
|
|
|
|
return time;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void referToDoctor(){
|
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
|
PatiantInformtion patient = routeArgs['patient'];
|
|
|
|
|
patientsProv.referToDoctor(
|
|
|
|
|
extension: _extController.value.text,
|
|
|
|
|
admissionNo:int.parse( patient.admissionNo),
|
|
|
|
|
referringDoctorRemarks: _remarksController.value.text,
|
|
|
|
|
frequency: freqId,
|
|
|
|
|
patientID: patient.patientId,
|
|
|
|
|
patientTypeID: patient.patientType,
|
|
|
|
|
priority: (_activePriority + 1).toString(),
|
|
|
|
|
roomID: patient.roomId,
|
|
|
|
|
selectedClinicID: clinicId.toString(),
|
|
|
|
|
selectedDoctorID: doctorId.toString(),
|
|
|
|
|
projectID: patient.projectId
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|