|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/PatientType.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/referral/referred_patient_detail_in-paint.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/referral/referred_patient_detail_in-paint.dart';
|
|
|
|
@ -6,12 +7,15 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class ReferredPatientScreen extends StatelessWidget {
|
|
|
|
class ReferredPatientScreen extends StatelessWidget {
|
|
|
|
// previous design page is: MyReferredPatient
|
|
|
|
|
|
|
|
|
|
|
|
PatientType patientType = PatientType.IN_PATIENT;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return BaseView<PatientReferralViewModel>(
|
|
|
|
return BaseView<PatientReferralViewModel>(
|
|
|
|
@ -20,7 +24,24 @@ class ReferredPatientScreen extends StatelessWidget {
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
isShowAppBar: false,
|
|
|
|
isShowAppBar: false,
|
|
|
|
appBarTitle: TranslationBase.of(context).referredPatient,
|
|
|
|
appBarTitle: TranslationBase.of(context).referredPatient,
|
|
|
|
body: model.listMyReferredPatientModel == null ||
|
|
|
|
body: Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.only(top: 70),
|
|
|
|
|
|
|
|
child: PatientTypeRadioWidget(
|
|
|
|
|
|
|
|
(patientType) async {
|
|
|
|
|
|
|
|
this.patientType = patientType;
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
if (patientType == PatientType.IN_PATIENT) {
|
|
|
|
|
|
|
|
await model.getMyReferredPatient(isFirstTime: false);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
await model.getMyReferredOutPatient(isFirstTime: false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
model.listMyReferredPatientModel == null ||
|
|
|
|
model.listMyReferredPatientModel.length == 0
|
|
|
|
model.listMyReferredPatientModel.length == 0
|
|
|
|
? Center(
|
|
|
|
? Center(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
@ -40,19 +61,12 @@ class ReferredPatientScreen extends StatelessWidget {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: SingleChildScrollView(
|
|
|
|
: Expanded(
|
|
|
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
// DoctorApplication.svc/REST/GtMyReferredPatient
|
|
|
|
// DoctorApplication.svc/REST/GtMyReferredPatient
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(top: 70),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
// const Divider(
|
|
|
|
|
|
|
|
// color: Color(0xffCCCCCC),
|
|
|
|
|
|
|
|
// height: 1,
|
|
|
|
|
|
|
|
// thickness: 2,
|
|
|
|
|
|
|
|
// indent: 0,
|
|
|
|
|
|
|
|
// endIndent: 0,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
...List.generate(
|
|
|
|
...List.generate(
|
|
|
|
model.listMyReferredPatientModel.length,
|
|
|
|
model.listMyReferredPatientModel.length,
|
|
|
|
(index) => InkWell(
|
|
|
|
(index) => InkWell(
|
|
|
|
@ -66,7 +80,9 @@ class ReferredPatientScreen extends StatelessWidget {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: PatientReferralItemWidget(
|
|
|
|
child: PatientReferralItemWidget(
|
|
|
|
referralStatus:model.getReferredPatientItem(index).referralStatusDesc,
|
|
|
|
referralStatus: model
|
|
|
|
|
|
|
|
.getReferredPatientItem(index)
|
|
|
|
|
|
|
|
.referralStatusDesc,
|
|
|
|
referralStatusCode: model
|
|
|
|
referralStatusCode: model
|
|
|
|
.getReferredPatientItem(index)
|
|
|
|
.getReferredPatientItem(index)
|
|
|
|
.referralStatus,
|
|
|
|
.referralStatus,
|
|
|
|
@ -74,12 +90,14 @@ class ReferredPatientScreen extends StatelessWidget {
|
|
|
|
"${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
|
|
|
|
"${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
|
|
|
|
patientGender:
|
|
|
|
patientGender:
|
|
|
|
model.getReferredPatientItem(index).gender,
|
|
|
|
model.getReferredPatientItem(index).gender,
|
|
|
|
referredDate: AppDateUtils.convertDateFromServerFormat(
|
|
|
|
referredDate:
|
|
|
|
|
|
|
|
AppDateUtils.convertDateFromServerFormat(
|
|
|
|
model
|
|
|
|
model
|
|
|
|
.getReferredPatientItem(index)
|
|
|
|
.getReferredPatientItem(index)
|
|
|
|
.referralDate,
|
|
|
|
.referralDate,
|
|
|
|
"dd/MM/yyyy"),
|
|
|
|
"dd/MM/yyyy"),
|
|
|
|
referredTime: AppDateUtils.convertDateFromServerFormat(
|
|
|
|
referredTime:
|
|
|
|
|
|
|
|
AppDateUtils.convertDateFromServerFormat(
|
|
|
|
model
|
|
|
|
model
|
|
|
|
.getReferredPatientItem(index)
|
|
|
|
.getReferredPatientItem(index)
|
|
|
|
.referralDate,
|
|
|
|
.referralDate,
|
|
|
|
@ -117,6 +135,61 @@ class ReferredPatientScreen extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PatientTypeRadioWidget extends StatefulWidget {
|
|
|
|
|
|
|
|
final Function(PatientType) radioOnChange;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PatientTypeRadioWidget(this.radioOnChange);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
_PatientTypeRadioWidgetState createState() =>
|
|
|
|
|
|
|
|
_PatientTypeRadioWidgetState(this.radioOnChange);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _PatientTypeRadioWidgetState extends State<PatientTypeRadioWidget> {
|
|
|
|
|
|
|
|
final Function(PatientType) radioOnChange;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_PatientTypeRadioWidgetState(this.radioOnChange);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PatientType patientType = PatientType.IN_PATIENT;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
return Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: RadioListTile<PatientType>(
|
|
|
|
|
|
|
|
title: AppText(TranslationBase.of(context).inPatient),
|
|
|
|
|
|
|
|
value: PatientType.IN_PATIENT,
|
|
|
|
|
|
|
|
groupValue: patientType,
|
|
|
|
|
|
|
|
onChanged: (PatientType value) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
patientType = value;
|
|
|
|
|
|
|
|
radioOnChange(value);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: RadioListTile<PatientType>(
|
|
|
|
|
|
|
|
title: AppText(TranslationBase.of(context).outpatient),
|
|
|
|
|
|
|
|
value: PatientType.OUT_PATIENT,
|
|
|
|
|
|
|
|
groupValue: patientType,
|
|
|
|
|
|
|
|
onChanged: (PatientType value) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
patientType = value;
|
|
|
|
|
|
|
|
radioOnChange(value);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|