|
|
|
@ -95,19 +95,15 @@ class _ReferPatientState extends State<ReferPatientScreen> {
|
|
|
|
value: _selectedClinic,
|
|
|
|
value: _selectedClinic,
|
|
|
|
iconSize: 40,
|
|
|
|
iconSize: 40,
|
|
|
|
elevation: 16,
|
|
|
|
elevation: 16,
|
|
|
|
selectedItemBuilder:
|
|
|
|
selectedItemBuilder: (BuildContext context) {
|
|
|
|
(BuildContext context) {
|
|
|
|
return model.getClinicNameList().map((item) {
|
|
|
|
return model
|
|
|
|
|
|
|
|
.getClinicNameList()
|
|
|
|
|
|
|
|
.map((item) {
|
|
|
|
|
|
|
|
return Row(
|
|
|
|
return Row(
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
item,
|
|
|
|
item,
|
|
|
|
fontSize:
|
|
|
|
fontSize:
|
|
|
|
SizeConfig.textMultiplier *
|
|
|
|
SizeConfig.textMultiplier * 2.1,
|
|
|
|
2.1,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -117,24 +113,19 @@ class _ReferPatientState extends State<ReferPatientScreen> {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
_selectedDoctor = null;
|
|
|
|
_selectedDoctor = null;
|
|
|
|
_selectedClinic = newValue;
|
|
|
|
_selectedClinic = newValue;
|
|
|
|
var clinicInfo = model
|
|
|
|
var clinicInfo = model.clinicsList
|
|
|
|
.clinicsList
|
|
|
|
.where((i) => i['ClinicDescription']
|
|
|
|
.where((i) =>
|
|
|
|
|
|
|
|
i['ClinicDescription']
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
.toString()
|
|
|
|
.contains(
|
|
|
|
.contains(_selectedClinic))
|
|
|
|
_selectedClinic))
|
|
|
|
|
|
|
|
.toList();
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
|
|
|
|
clinicId = clinicInfo[0]['ClinicID']
|
|
|
|
clinicId =
|
|
|
|
.toString();
|
|
|
|
clinicInfo[0]['ClinicID'].toString();
|
|
|
|
|
|
|
|
|
|
|
|
model.getDoctorsList(clinicId);
|
|
|
|
model.getDoctorsList(clinicId);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
items: model
|
|
|
|
items: model.getClinicNameList().map((item) {
|
|
|
|
.getClinicNameList()
|
|
|
|
|
|
|
|
.map((item) {
|
|
|
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
return DropdownMenuItem(
|
|
|
|
value: item.toString(),
|
|
|
|
value: item.toString(),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
@ -180,19 +171,15 @@ class _ReferPatientState extends State<ReferPatientScreen> {
|
|
|
|
value: _selectedDoctor,
|
|
|
|
value: _selectedDoctor,
|
|
|
|
iconSize: 40,
|
|
|
|
iconSize: 40,
|
|
|
|
elevation: 16,
|
|
|
|
elevation: 16,
|
|
|
|
selectedItemBuilder:
|
|
|
|
selectedItemBuilder: (BuildContext context) {
|
|
|
|
(BuildContext context) {
|
|
|
|
return model.getDoctorNameList().map((item) {
|
|
|
|
return model
|
|
|
|
|
|
|
|
.getDoctorNameList()
|
|
|
|
|
|
|
|
.map((item) {
|
|
|
|
|
|
|
|
return Row(
|
|
|
|
return Row(
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
item,
|
|
|
|
item,
|
|
|
|
fontSize:
|
|
|
|
fontSize:
|
|
|
|
SizeConfig.textMultiplier *
|
|
|
|
SizeConfig.textMultiplier * 2.1,
|
|
|
|
2.1,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -201,21 +188,18 @@ class _ReferPatientState extends State<ReferPatientScreen> {
|
|
|
|
onChanged: (newValue) => {
|
|
|
|
onChanged: (newValue) => {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
_selectedDoctor = newValue;
|
|
|
|
_selectedDoctor = newValue;
|
|
|
|
doctorsList =
|
|
|
|
doctorsList = model.doctorsList;
|
|
|
|
model.doctorsList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var doctorInfo = doctorsList
|
|
|
|
var doctorInfo = doctorsList
|
|
|
|
.where((i) => i['DoctorName']
|
|
|
|
.where((i) => i['DoctorName']
|
|
|
|
.toString()
|
|
|
|
.toString()
|
|
|
|
.contains(_selectedDoctor))
|
|
|
|
.contains(_selectedDoctor))
|
|
|
|
.toList();
|
|
|
|
.toList();
|
|
|
|
doctorId = doctorInfo[0]['DoctorID']
|
|
|
|
doctorId =
|
|
|
|
.toString();
|
|
|
|
doctorInfo[0]['DoctorID'].toString();
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
items: model
|
|
|
|
items: model.getDoctorNameList().map((item) {
|
|
|
|
.getDoctorNameList()
|
|
|
|
|
|
|
|
.map((item) {
|
|
|
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
return DropdownMenuItem(
|
|
|
|
value: item.toString(),
|
|
|
|
value: item.toString(),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
@ -294,8 +278,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
|
|
|
|
value: _selectedReferralFrequancy,
|
|
|
|
value: _selectedReferralFrequancy,
|
|
|
|
iconSize: 40,
|
|
|
|
iconSize: 40,
|
|
|
|
elevation: 16,
|
|
|
|
elevation: 16,
|
|
|
|
selectedItemBuilder:
|
|
|
|
selectedItemBuilder: (BuildContext context) {
|
|
|
|
(BuildContext context) {
|
|
|
|
|
|
|
|
return model
|
|
|
|
return model
|
|
|
|
.getReferralNamesList()
|
|
|
|
.getReferralNamesList()
|
|
|
|
.map((item) {
|
|
|
|
.map((item) {
|
|
|
|
@ -305,8 +288,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
item,
|
|
|
|
item,
|
|
|
|
fontSize:
|
|
|
|
fontSize:
|
|
|
|
SizeConfig.textMultiplier *
|
|
|
|
SizeConfig.textMultiplier * 2.1,
|
|
|
|
2.1,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -315,21 +297,17 @@ class _ReferPatientState extends State<ReferPatientScreen> {
|
|
|
|
onChanged: (newValue) => {
|
|
|
|
onChanged: (newValue) => {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
_selectedReferralFrequancy = newValue;
|
|
|
|
_selectedReferralFrequancy = newValue;
|
|
|
|
var freqInfo = model
|
|
|
|
var freqInfo = model.referalFrequancyList
|
|
|
|
.referalFrequancyList
|
|
|
|
.singleWhere((i) => i['Description']
|
|
|
|
.singleWhere((i) => i[
|
|
|
|
|
|
|
|
'Description']
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
.toString()
|
|
|
|
.contains(
|
|
|
|
.contains(
|
|
|
|
_selectedReferralFrequancy));
|
|
|
|
_selectedReferralFrequancy));
|
|
|
|
freqId = freqInfo['ParameterCode']
|
|
|
|
freqId =
|
|
|
|
.toString();
|
|
|
|
freqInfo['ParameterCode'].toString();
|
|
|
|
myFocusNode.requestFocus();
|
|
|
|
myFocusNode.requestFocus();
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
items: model
|
|
|
|
items: model.getReferralNamesList().map((item) {
|
|
|
|
.getReferralNamesList()
|
|
|
|
|
|
|
|
.map((item) {
|
|
|
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
return DropdownMenuItem(
|
|
|
|
value: item.toString(),
|
|
|
|
value: item.toString(),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
@ -371,29 +349,21 @@ class _ReferPatientState extends State<ReferPatientScreen> {
|
|
|
|
color: Colors.red,
|
|
|
|
color: Colors.red,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
margin: 10,
|
|
|
|
margin: 10,
|
|
|
|
visibility:
|
|
|
|
visibility: isValid == null ? false : !isValid,
|
|
|
|
isValid == null ? false : !isValid,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// TODO replace AppButton with secondary button and add loading
|
|
|
|
// TODO replace AppButton with secondary button and add loading
|
|
|
|
AppButton(
|
|
|
|
AppButton(
|
|
|
|
title: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.send,
|
|
|
|
|
|
|
|
color: Color(PRIMARY_COLOR),
|
|
|
|
|
|
|
|
onPressed: () =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
referToDoctor(context, model)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
title: TranslationBase.of(context).send,
|
|
|
|
title: TranslationBase.of(context).send,
|
|
|
|
color: (Hexcolor("#B8382B")),
|
|
|
|
color: Color(PRIMARY_COLOR),
|
|
|
|
onPressed: () => {referToDoctor(context)},
|
|
|
|
onPressed: () => {referToDoctor(context, model)},
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
))
|
|
|
|
))
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),);
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget priorityBar(BuildContext _context) {
|
|
|
|
Widget priorityBar(BuildContext _context) {
|
|
|
|
@ -460,7 +430,6 @@ class _ReferPatientState extends State<ReferPatientScreen> {
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
}).toList(),
|
|
|
|
}).toList(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -488,10 +457,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
final routeArgs = ModalRoute
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.settings
|
|
|
|
|
|
|
|
.arguments as Map;
|
|
|
|
|
|
|
|
PatiantInformtion patient = routeArgs['patient'];
|
|
|
|
PatiantInformtion patient = routeArgs['patient'];
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
@ -508,8 +474,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
|
|
|
|
selectedDoctorID: doctorId.toString(),
|
|
|
|
selectedDoctorID: doctorId.toString(),
|
|
|
|
projectID: patient.projectId);
|
|
|
|
projectID: patient.projectId);
|
|
|
|
// TODO: Add Translation
|
|
|
|
// TODO: Add Translation
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
DrAppToastMsg.showSuccesToast('Reply Successfully');
|
|
|
|
'Reply Successfully');
|
|
|
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
DrAppToastMsg.showErrorToast(e);
|
|
|
|
DrAppToastMsg.showErrorToast(e);
|
|
|
|
|