Done Referral Discharged Patient

merge-requests/576/head
Mohammad Aljammal 5 years ago
parent ae4e03317b
commit b2bcb3dd6d

@ -240,7 +240,7 @@ const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults";
const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient";
const GET_MY_DISCHARGE_PATIENT = "/Services/DoctorApplication.svc/REST/GtMyDischargePatient";
const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
const GET_PAtIENTS_INSURANCE_APPROVALS =
"Services/Patients.svc/REST/GetApprovalStatus";

@ -1,3 +1,5 @@
import 'package:doctor_app_flutter/util/date-utils.dart';
class DischargeReferralPatient {
dynamic rowID;
int projectID;
@ -31,7 +33,7 @@ class DischargeReferralPatient {
int referralClinic;
int referringClinic;
int referralStatus;
String referralDate;
DateTime referralDate;
String referringDoctorRemarks;
String referredDoctorRemarks;
String referralResponseOn;
@ -137,7 +139,7 @@ class DischargeReferralPatient {
referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic'];
referralStatus = json['ReferralStatus'];
referralDate = json['ReferralDate'];
referralDate = DateUtils.convertStringToDate(json['ReferralDate']);
referringDoctorRemarks = json['ReferringDoctorRemarks'];
referredDoctorRemarks = json['ReferredDoctorRemarks'];
referralResponseOn = json['ReferralResponseOn'];

@ -13,37 +13,34 @@ class DischargedPatientViewModel extends BaseViewModel {
List<PatiantInformtion> get myDischargedPatient =>
_dischargedPatientService.myDischargedPatients;
List<DischargeReferralPatient> get myDischargeReferralPatient =>
_dischargedPatientService.myDischargeReferralPatients;
List<PatiantInformtion> filterData = [];
List<PatiantInformtion> get filterData => filterData2.isNotEmpty? filterData2:myDischargedPatient;
List<PatiantInformtion> filterData2 = [];
searchData(String str) {
// this.responseModelList = this.responseModelList2;
// var strExist = str.length > 0 ? true : false;
// if (strExist) {
// List<PatiantInformtion> filterData = [];
//
// for (var i = 0; i < responseModelList2.length; i++) {
// String firstName = responseModelList[i].firstName.toUpperCase();
// String lastName = responseModelList[i].lastName.toUpperCase();
// String mobile = responseModelList[i].mobileNumber.toUpperCase();
// String patientID = responseModelList[i].patientId.toString();
//
// if (firstName.contains(str.toUpperCase()) ||
// lastName.contains(str.toUpperCase()) ||
// mobile.contains(str) ||
// patientID.contains(str)) {
// filterData.add(responseModelList[i]);
// }
// }
//
// // setState(() {
// // this.responseModelList = filterData;
// // });
// } else {
// filterData = myDischargedPatient;
// notifyListeners();
// }
var strExist = str.length > 0 ? true : false;
if (strExist) {
filterData2 = [];
for (var i = 0; i < myDischargedPatient.length; i++) {
String firstName = myDischargedPatient[i].firstName.toUpperCase();
String lastName = myDischargedPatient[i].lastName.toUpperCase();
String mobile = myDischargedPatient[i].mobileNumber.toUpperCase();
String patientID = myDischargedPatient[i].patientId.toString();
if (firstName.contains(str.toUpperCase()) ||
lastName.contains(str.toUpperCase()) ||
mobile.contains(str) ||
patientID.contains(str)) {
filterData2.add(myDischargedPatient[i]);
}
}
notifyListeners();
} else {
filterData2 = myDischargedPatient;
notifyListeners();
}
}

@ -1,6 +1,8 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/DischargeReferralPatient.dart';
import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/service/DischargedPatientService.dart';
import 'package:doctor_app_flutter/core/service/MyReferralPatientService.dart';
import 'package:doctor_app_flutter/core/service/ReferralService.dart';
import 'package:doctor_app_flutter/core/service/patient-doctor-referral-service.dart';
@ -24,6 +26,10 @@ class PatientReferralViewModel extends BaseViewModel {
MyReferralInPatientService _myReferralService =
locator<MyReferralInPatientService>();
DischargedPatientService _dischargedPatientService = locator<DischargedPatientService>();
List<DischargeReferralPatient> get myDischargeReferralPatient =>
_dischargedPatientService.myDischargeReferralPatients;
List<dynamic> get branchesList => _referralPatientService.projectsList;
List<dynamic> get clinicsList => _referralPatientService.clinicsList;
@ -261,6 +267,16 @@ class PatientReferralViewModel extends BaseViewModel {
}
}
Future gtMyDischargeReferralPatient() async {
setState(ViewState.Busy);
await _dischargedPatientService.gtMyDischargeReferralPatient();
if (_dischargedPatientService.hasError) {
error = _dischargedPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
String getReferralStatusNameByCode(int statusCode, BuildContext context) {
switch (statusCode) {
case 1:
@ -329,4 +345,30 @@ class PatientReferralViewModel extends BaseViewModel {
patient.clinicDescription = referredPatient.clinicDescription;
return patient;
}
PatiantInformtion getPatientFromDischargeReferralPatient(
DischargeReferralPatient referredPatient) {
PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName;
patient.patientId = referredPatient.patientID;
patient.firstName = referredPatient.firstName;
patient.middleName = referredPatient.middleName;
patient.lastName = referredPatient.lastName;
patient.gender = referredPatient.gender;
patient.dateofBirth = referredPatient.dateofBirth;
patient.mobileNumber = referredPatient.mobileNumber;
patient.emailAddress = referredPatient.emailAddress;
patient.patientIdentificationNo = referredPatient.patientIdentificationNo;
patient.patientType = referredPatient.patientType;
patient.admissionNo = referredPatient.admissionNo;
patient.admissionDate = referredPatient.admissionDate;
patient.roomId = referredPatient.roomID;
patient.bedId = referredPatient.bedID;
patient.nationalityName = referredPatient.nationalityName;
patient.nationalityFlagURL = '';// TODO from backend referredPatient.nationalityFlagURL;
patient.age = referredPatient.age;
patient.clinicDescription = referredPatient.clinicDescription;
return patient;
}
}

@ -14,6 +14,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart';
import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart';
import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
@ -547,51 +548,53 @@ class _HomeScreenState extends State<HomeScreen> {
},
),
HomePageCard(
color: Colors.black,
color: Colors.red[800],
margin: EdgeInsets.all(5),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: 10, left: 10, right: 0),
child: Icon(
DoctorApp.search,
size: 32,
DoctorApp.referral_1,
size: 35,
color: Colors.white,
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.searchmedicinepatient,
.patientsreferral,
color: Colors.white,
textAlign: TextAlign.start,
fontSize: 13,
fontSize: 15,
))
],
),
hasBorder: false,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
SearchMedicinePatientScreen(),
));
context,
MaterialPageRoute(
builder: (context) =>
PatientReferralScreen(),
// MyReferredPatient(),
),
);
},
),
HomePageCard(
color: Colors.red[800],
color: Colors.grey[300],
margin: EdgeInsets.all(5),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
@ -599,14 +602,13 @@ class _HomeScreenState extends State<HomeScreen> {
child: Icon(
DoctorApp.referral_1,
size: 35,
color: Colors.white,
color: Colors.black,
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.patientsreferral,
color: Colors.white,
'Discharged Patients',
color: Colors.black,
textAlign: TextAlign.start,
fontSize: 15,
))
@ -618,7 +620,7 @@ class _HomeScreenState extends State<HomeScreen> {
context,
MaterialPageRoute(
builder: (context) =>
PatientReferralScreen(),
DischargedPatient(),
// MyReferredPatient(),
),
);
@ -629,9 +631,9 @@ class _HomeScreenState extends State<HomeScreen> {
margin: EdgeInsets.all(5),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
@ -644,7 +646,7 @@ class _HomeScreenState extends State<HomeScreen> {
Container(
padding: EdgeInsets.all(10),
child: AppText(
'DischargedPatient',
'Referral Discharged',
color: Colors.white,
textAlign: TextAlign.start,
fontSize: 15,
@ -657,31 +659,53 @@ class _HomeScreenState extends State<HomeScreen> {
context,
MaterialPageRoute(
builder: (context) =>
DischargedPatient(),
ReferralDischargedPatientPage(),
// MyReferredPatient(),
),
);
},
),
])),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
HomePageCard(
color: Colors.black,
margin: EdgeInsets.all(5),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: 10, left: 10, right: 0),
child: Icon(
DoctorApp.search,
size: 32,
color: Colors.white,
)),
Container(
padding: EdgeInsets.all(10),
child: AppText(
TranslationBase.of(context)
.searchmedicinepatient,
color: Colors.white,
textAlign: TextAlign.start,
fontSize: 13,
))
],
),
hasBorder: false,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
SearchMedicinePatientScreen(),
));
},
),
// ],
// ),
// SizedBox(
// height: 10,
// ),
// Row(
// children: [
])),
// ],
// ),
// SizedBox(
// height: 20,
// ),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,

@ -30,284 +30,302 @@ class _DischargedPatientState extends State<DischargedPatient> {
backgroundColor: Colors.grey[200],
isShowAppBar: true,
baseViewModel: model,
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 12,),
Container(
width: double.maxFinite,
height: 75,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: Color(0xffCCCCCC),
),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
left: 10, top: 10),
child: AppText(
TranslationBase.of(
context)
.searchPatientName,
fontSize: 13,
)),
AppTextFormField(
// focusNode: focusProject,
controller: _controller,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(
DoctorApp.filter_1,
color: Colors.black,
),
iconSize: 20,
padding:
EdgeInsets.only(
bottom: 30),
body: model.filterData.isEmpty?Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
'No Discharged Patient',
color: Theme.of(context).errorColor,
),
)
],
),
):Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 12,),
Container(
width: double.maxFinite,
height: 75,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: Color(0xffCCCCCC),
),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
left: 10, top: 10),
child: AppText(
TranslationBase.of(
context)
.searchPatientName,
fontSize: 13,
)),
AppTextFormField(
// focusNode: focusProject,
controller: _controller,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(
DoctorApp.filter_1,
color: Colors.black,
),
onChanged: (String str) {
//this.searchData(str);
}),
])),
...List.generate(
model.myDischargedPatient.length,
(index) => InkWell(
onTap: () {
Navigator.of(context)
.pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model.myDischargedPatient[index],
"patientType": "1",
"isSearch": false,
"isInpatient":true,
"isDischargedPatient":true
});
iconSize: 20,
padding:
EdgeInsets.only(
bottom: 30),
),
onChanged: (String str) {
model.searchData(str);
}),
])),
SizedBox(height: 5,),
Expanded(
child: ListView.builder(
itemCount: model.filterData.length,
itemBuilder: (context,index)=>InkWell(
onTap: () {
Navigator.of(context)
.pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model.filterData[index],
"patientType": "1",
"isSearch": false,
"isInpatient":true,
"isDischargedPatient":true
});
},
child: Container(
width: double.maxFinite,
margin: EdgeInsets.all(8),
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(children: [
Container(
width: 170,
child: AppText(
(Helpers.capitalize(model
.myDischargedPatient[index]
.firstName) +
" " +
Helpers.capitalize(model
.myDischargedPatient[index]
.lastName)),
fontSize: 16,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
textOverflow: TextOverflow.ellipsis,
),
),
model.myDischargedPatient[index].gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
]),
Row(
children: [
AppText(
model.myDischargedPatient[index].nationalityName != null
? model.myDischargedPatient[index].nationalityName.trim()
: model.myDischargedPatient[index].nationality != null
? model.myDischargedPatient[index].nationality.trim()
: model.myDischargedPatient[index].nationalityId != null
? model.myDischargedPatient[index].nationalityId
: "",
fontWeight: FontWeight.bold,
fontSize: 14,
textOverflow: TextOverflow.ellipsis,
},
child: Container(
width: double.maxFinite,
margin: EdgeInsets.all(8),
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
),
child: Column(
children: [
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(children: [
Container(
width: 170,
child: AppText(
(Helpers.capitalize(model
.filterData[index]
.firstName) +
" " +
Helpers.capitalize(model
.filterData[index]
.lastName)),
fontSize: 16,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
textOverflow: TextOverflow.ellipsis,
),
),
model.myDischargedPatient[index]
.nationality !=
null ||
model.myDischargedPatient[index]
.nationalityId !=
null
? ClipRRect(
borderRadius:
BorderRadius.circular(20.0),
child: Image.network(
model.myDischargedPatient[index].nationalityFlagURL != null ?
model.myDischargedPatient[index].nationalityFlagURL
: '',
height: 25,
width: 30,
errorBuilder:
(BuildContext context,
Object exception,
StackTrace stackTrace) {
return AppText(
'',
fontSize: 10,
);
},
))
: SizedBox()
],
)
],
)),
Row(
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
model.myDischargedPatient[index].gender ==
1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
model.filterData[index].gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
),
),
],
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context)
.fileNumber,
style: TextStyle(
fontSize: 14,
fontFamily: 'Poppins')),
new TextSpan(
text: model
.myDischargedPatient[index]
.patientId
.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 15)),
],
]),
Row(
children: [
AppText(
model.filterData[index].nationalityName != null
? model.filterData[index].nationalityName.trim()
: model.filterData[index].nationality != null
? model.filterData[index].nationality.trim()
: model.filterData[index].nationalityId != null
? model.filterData[index].nationalityId
: "",
fontWeight: FontWeight.bold,
fontSize: 14,
textOverflow: TextOverflow.ellipsis,
),
model.filterData[index]
.nationality !=
null ||
model.filterData[index]
.nationalityId !=
null
? ClipRRect(
borderRadius:
BorderRadius.circular(20.0),
child: Image.network(
model.filterData[index].nationalityFlagURL != null ?
model.filterData[index].nationalityFlagURL
: '',
height: 25,
width: 30,
errorBuilder:
(BuildContext context,
Object exception,
StackTrace stackTrace) {
return AppText(
'',
fontSize: 10,
);
},
))
: SizedBox()
],
)
],
)),
Row(
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 12.0),
child: Container(
width: 60,
height: 60,
child: Image.asset(
model.filterData[index].gender ==
1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize:
],
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context)
.fileNumber,
style: TextStyle(
fontSize: 14,
fontFamily: 'Poppins')),
new TextSpan(
text: model
.filterData[index]
.patientId
.toString(),
style: TextStyle(
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: 15)),
],
),
children: <TextSpan>[
new TextSpan(
text: model.myDischargedPatient[index].admissionDate == null ? "" :
TranslationBase.of(context).admissionDate + " : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
text: model.myDischargedPatient[index].admissionDate == null ? ""
: "${DateUtils.convertDateFromServerFormat(model.myDischargedPatient[index].admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 15)),
],
),
),
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: model.filterData[index].admissionDate == null ? "" :
TranslationBase.of(context).admissionDate + " : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
text: model.filterData[index].admissionDate == null ? ""
: "${DateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 15)),
],
),
children: <TextSpan>[
new TextSpan(
text: model.myDischargedPatient[index].dischargeDate == null ? ""
: "Discharge Date : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
text: model.myDischargedPatient[index].dischargeDate == null ? ""
: "${DateUtils.convertDateFromServerFormat(model.myDischargedPatient[index].dischargeDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 15)),
],
),
),
),
Row(
children: [
AppText(
"${TranslationBase.of(context).numOfDays}: ",
fontSize: 14,fontWeight: FontWeight.w300,
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: model.filterData[index].dischargeDate == null ? ""
: "Discharge Date : ",
style: TextStyle(fontSize: 14)),
new TextSpan(
text: model.filterData[index].dischargeDate == null ? ""
: "${DateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 15)),
],
),
),
AppText(
"${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(model.myDischargedPatient[index].admissionDate)).inDays + 1}",
fontSize: 15,
fontWeight: FontWeight.w700),
],
),
],
),
)
],
)
],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).numOfDays}: ",
fontSize: 14,fontWeight: FontWeight.w300,
),
AppText(
"${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}",
fontSize: 15,
fontWeight: FontWeight.w700),
],
),
],
),
)
],
)
],
),
),
),
),
)
],
),
)),
),
],
),
),
),

@ -0,0 +1,591 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/DischargeReferralPatient.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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:flutter/material.dart';
import '../../routes.dart';
class ReferralDischargedPatientDetails extends StatelessWidget {
final DischargeReferralPatient referredPatient;
ReferralDischargedPatientDetails(this.referredPatient,);
@override
Widget build(BuildContext context) {
return BaseView<PatientReferralViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Container(
child: Column(
children: [
Container(
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Column(
children: [
Container(
padding: EdgeInsets.only(left: 12.0),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
(Helpers.capitalize(
"${referredPatient.firstName} ${referredPatient.lastName}")),
fontSize: SizeConfig.textMultiplier * 2.5,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
),
),
referredPatient.gender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(
DoctorApp.female_1,
color: Colors.pink,
),
InkWell(
onTap: () {
PatiantInformtion patient =
model.getPatientFromDischargeReferralPatient(referredPatient);
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient,
"patientType": "1",
"isInpatient": true,
"arrivalType": "1",
"from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
"to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'),
});
},
child: Icon(
Icons.account_circle,
size: 25,
),
)
]),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
//TODO from backend
// Padding(
// padding: EdgeInsets.only(left: 12.0),
// child: Container(
// width: 60,
// height: 60,
// child: Image.network(
// referredPatient.doctorImageURL
// ),
// ),
// ),
SizedBox(
width: 10,
),
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
AppText(
"${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}",
fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700,
color: referredPatient.referralStatus == 1
? Color(0xffc4aa54)
: referredPatient.referralStatus == 46
? Colors.green[700]
: Colors.red[700],
),
AppText(
DateUtils.getDayMonthYearDateFormatted(referredPatient.referralDate,),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier,
color: Color(0XFF28353E),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"Admission Date: ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
DateUtils.convertDateFromServerFormat(
referredPatient.admissionDate,
"dd MMM,yyyy"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"Discharge Date: ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
DateUtils.convertDateFromServerFormat(
referredPatient.dischargeDate,
"dd MMM,yyyy"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"Number of Days: ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
DateUtils.convertDateFromServerFormat(
referredPatient.dischargeDate,
"dd MMM,yyyy"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"Referring Doctor ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.referringDoctorName,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.fileNumber,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
"${referredPatient.patientID}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"${TranslationBase.of(context).refClinic}: ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 *
SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
referredPatient
.referringClinicDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 *
SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.frequency +
": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 *
SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient
.frequencyDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.8 *
SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
],
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).priority +
": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.priorityDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"Referring Clinic ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.referringClinicDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"Frequency ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.frequency.toString(),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"Priority ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.frequency.toString(),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.maxResponseTime +
": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
DateUtils.convertDateFromServerFormat(
referredPatient.mAXResponseTime,
"dd MMM,yyyy"),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 0),
child: Image.asset(
'assets/images/patient/ic_ref_arrow_left.png',
height: 50,
width: 30,
),
),
//TODO from backend
// Container(
// margin: EdgeInsets.only(
// left: 0,
// top: 25,
// right: 0,
// bottom: 0),
// padding: EdgeInsets.only(
// left: 4.0, right: 4.0),
// child: referredPatient.doctorImageURL !=
// null
// ? ClipRRect(
// borderRadius:
// BorderRadius.circular(20.0),
// child: Image.network(
// referredPatient.doctorImageURL,
// height: 25,
// width: 30,
// errorBuilder:
// (BuildContext context,
// Object exception,
// StackTrace stackTrace) {
// return Text('No Image');
// },
// ))
// : Container(
// child: Image.asset(
// referredPatient.gender == 1
// ? 'assets/images/male_avatar.png'
// : 'assets/images/female_avatar.png',
// fit: BoxFit.cover,
// ),
// ),
// ),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.only(
left: 10,
top: 30,
right: 10,
bottom: 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
"Dr ${referredPatient.referringDoctorName}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w800,
fontSize: 1.5 *
SizeConfig.textMultiplier,
color: Colors.black,
),
AppText(
referredPatient
.referringClinicDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.3 *
SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
),
),
),
],
),
],
),
),
],
),
],
),
),
),
Expanded(
child: SingleChildScrollView(
child: Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
border: Border.fromBorderSide(BorderSide(
color: Colors.white,
width: 1.0,
)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).remarks,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 2.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
AppText(
referredPatient.referringDoctorRemarks,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
SizedBox(
height: 8,
),
],
),
),
),
),
],
),
),
),
);
}
}

@ -0,0 +1,105 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/DischargedPatientViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_patient_detail_in-paint.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
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/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../../routes.dart';
import 'ReferralDischargedPatientDetails.dart';
class ReferralDischargedPatientPage extends StatefulWidget {
@override
_ReferralDischargedPatientPageState createState() => _ReferralDischargedPatientPageState();
}
class _ReferralDischargedPatientPageState extends State<ReferralDischargedPatientPage> {
@override
Widget build(BuildContext context) {
return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.gtMyDischargeReferralPatient(),
builder: (_, model, w) => AppScaffold(
appBarTitle: 'Referral Discharged ',
backgroundColor: Colors.grey[200],
isShowAppBar: true,
baseViewModel: model,
body: model.myDischargeReferralPatient.isEmpty?Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
'No Discharged Patient',
color: Theme.of(context).errorColor,
),
)
],
),
):Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 5,),
Expanded(
child: ListView.builder(
itemCount: model.myDischargeReferralPatient.length,
itemBuilder: (context,index)=>InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: ReferralDischargedPatientDetails(model.myDischargeReferralPatient[index]),
),
);
},
child: PatientReferralItemWidget(
referralStatus: model.getReferralStatusNameByCode(model.myDischargeReferralPatient[index].referralStatus,context),
referralStatusCode: model.myDischargeReferralPatient[index].referralStatus,
patientName: model.myDischargeReferralPatient[index].firstName+" "+model.myDischargeReferralPatient[index].lastName,
patientGender: model.myDischargeReferralPatient[index].gender,
referredDate: DateUtils.getDayMonthYearDateFormatted(model.myDischargeReferralPatient[index].referralDate),
referredTime: DateUtils.getTimeHHMMA(model.myDischargeReferralPatient[index].referralDate),
patientID: "${model.myDischargeReferralPatient[index].patientID}",
isSameBranch: false,
isReferral: true,
isReferralClinic: true,
referralClinic:"${model.myDischargeReferralPatient[index].referringClinicDescription}",
remark: model.myDischargeReferralPatient[index].referringDoctorRemarks,
nationality: model.myDischargeReferralPatient[index].nationalityName,
nationalityFlag: '',//model.myDischargeReferralPatient[index].nationalityFlagURL, //TODO From backend
doctorAvatar: '',//model.myDischargeReferralPatient[index].doctorImageURL, //TODO From backend
referralDoctorName: model.myDischargeReferralPatient[index].referringDoctorName,
clinicDescription: model.myDischargeReferralPatient[index].referringClinicDescription,
infoIcon: Icon(FontAwesomeIcons.arrowRight,
size: 25, color: Colors.black),
),
)),
),
],
),
),
),
);
}
}

@ -132,7 +132,7 @@ class PatientProfileButton extends StatelessWidget {
'patientType': patientType,
'arrivalType': arrivalType,
'isInpatient': isInPatient,
'isDischargedPatient;': isDischargedPatient,
'isDischargedPatient': isDischargedPatient,
});
}
}

@ -105,6 +105,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_NOTE,
isDischargedPatient: isDischargedPatient,
nameLine1: "Order", //"Text",
nameLine2: "Sheet", //TranslationBase.of(context).orders,
icon: 'patient/Progress_notes.png'),

Loading…
Cancel
Save