Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into replay_status

replay_status
Elham Rababh 5 years ago
commit a014e0140d

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";

@ -1,75 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/referral_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/doctor/my_referral_patient_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
class MyReferralPatient extends StatefulWidget {
int expandedItemIndex = -1;
@override
_MyReferralPatientState createState() => _MyReferralPatientState();
}
class _MyReferralPatientState extends State<MyReferralPatient> {
@override
Widget build(BuildContext context) {
return BaseView<ReferralPatientViewModel>(
onModelReady: (model) => model.getMyReferralPatient(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).myReferralPatient,
body: model.listMyReferralPatientModel.length == 0
? Center(
child: AppText(
TranslationBase.of(context).errorNoSchedule,
color: Theme.of(context).errorColor,
),
)
: Container(
padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0),
child: ListView(
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 10,
),
Container(
child: Column(
children: [
...List.generate(
model.listMyReferralPatientModel.length,
(index) => MyReferralPatientWidget(
myReferralPatientModel: model
.listMyReferralPatientModel[index],
model: model,
expandClick: () {
setState(() {
if (widget.expandedItemIndex ==
index) {
widget.expandedItemIndex = -1;
} else {
widget.expandedItemIndex = index;
}
});
},
isExpand:
widget.expandedItemIndex == index,
),
)
],
),
),
],
),
],
),
),
));
}
}

@ -25,7 +25,6 @@ class InPatientPage extends StatefulWidget {
} }
class _InPatientPageState extends State<InPatientPage> { class _InPatientPageState extends State<InPatientPage> {
TextEditingController _searchController = TextEditingController(); TextEditingController _searchController = TextEditingController();
bool isSortDes = false; bool isSortDes = false;
@ -65,10 +64,9 @@ class _InPatientPageState extends State<InPatientPage> {
onChanged: (value) { onChanged: (value) {
widget.patientSearchViewModel.filterSearchResults(value); widget.patientSearchViewModel.filterSearchResults(value);
}), }),
Positioned( Positioned(
right: 35, right: 35,
top:5, top: 5,
child: IconButton( child: IconButton(
icon: Icon( icon: Icon(
isSortDes isSortDes
@ -80,7 +78,8 @@ class _InPatientPageState extends State<InPatientPage> {
// padding: EdgeInsets.only(bottom: 30), // padding: EdgeInsets.only(bottom: 30),
onPressed: () { onPressed: () {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.patientSearchViewModel.sortInPatient(isDes: isSortDes); widget.patientSearchViewModel
.sortInPatient(isDes: isSortDes);
isSortDes = !isSortDes; isSortDes = !isSortDes;
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}, },
@ -89,84 +88,125 @@ class _InPatientPageState extends State<InPatientPage> {
], ],
), ),
), ),
widget.patientSearchViewModel.state == ViewState.Idle?widget.patientSearchViewModel.filteredInPatientItems.length > 0 widget.patientSearchViewModel.state == ViewState.Idle
? (widget.isMyInPatient && widget.patientSearchViewModel.myIinPatientList.length ==0 )?NoData():Expanded( ? widget.patientSearchViewModel.filteredInPatientItems.length > 0
? (widget.isMyInPatient &&
widget.patientSearchViewModel.myIinPatientList
.length ==
0)
? NoData()
: Expanded(
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0), margin: EdgeInsets.symmetric(horizontal: 16.0),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
...List.generate( ListView.builder(
widget.patientSearchViewModel.filteredInPatientItems.length, (index) { itemCount: widget.patientSearchViewModel
.filteredInPatientItems.length,
scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
if (!widget.isMyInPatient) if (!widget.isMyInPatient)
return PatientCard( return PatientCard(
patientInfo: patientInfo: widget
widget.patientSearchViewModel.filteredInPatientItems[index], .patientSearchViewModel
.filteredInPatientItems[index],
patientType: "1", patientType: "1",
arrivalType: "1", arrivalType: "1",
isInpatient: true, isInpatient: true,
isMyPatient: widget.patientSearchViewModel.filteredInPatientItems[index] isMyPatient: widget
.patientSearchViewModel
.filteredInPatientItems[
index]
.doctorId == .doctorId ==
widget.patientSearchViewModel.doctorProfile.doctorID, widget.patientSearchViewModel
.doctorProfile.doctorID,
onTap: () { onTap: () {
FocusScopeNode currentFocus = FocusScopeNode currentFocus =
FocusScope.of(context); FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) { if (!currentFocus
.hasPrimaryFocus) {
currentFocus.unfocus(); currentFocus.unfocus();
} }
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
PATIENTS_PROFILE, PATIENTS_PROFILE,
arguments: { arguments: {
"patient": widget.patientSearchViewModel. "patient": widget
filteredInPatientItems[index], .patientSearchViewModel
.filteredInPatientItems[index],
"patientType": "1", "patientType": "1",
"from": "0", "from": "0",
"to": "0", "to": "0",
"isSearch": false, "isSearch": false,
"isInpatient": true, "isInpatient": true,
"arrivalType": "1", "arrivalType": "1",
"isMyPatient":widget.patientSearchViewModel.filteredInPatientItems[index] "isMyPatient": widget
.patientSearchViewModel
.filteredInPatientItems[
index]
.doctorId == .doctorId ==
widget.patientSearchViewModel.doctorProfile.doctorID, widget
.patientSearchViewModel
.doctorProfile
.doctorID,
}); });
}, },
); );
else if (widget.patientSearchViewModel.filteredInPatientItems[index] else if (widget
.patientSearchViewModel
.filteredInPatientItems[
index]
.doctorId == .doctorId ==
widget.patientSearchViewModel.doctorProfile.doctorID && widget.patientSearchViewModel
.doctorProfile.doctorID &&
widget.isMyInPatient) widget.isMyInPatient)
return PatientCard( return PatientCard(
patientInfo: patientInfo: widget
widget.patientSearchViewModel.filteredInPatientItems[index], .patientSearchViewModel
.filteredInPatientItems[index],
patientType: "1", patientType: "1",
arrivalType: "1", arrivalType: "1",
isInpatient: true, isInpatient: true,
isMyPatient: widget.patientSearchViewModel isMyPatient: widget
.filteredInPatientItems[index] .patientSearchViewModel
.filteredInPatientItems[
index]
.doctorId == .doctorId ==
widget.patientSearchViewModel.doctorProfile.doctorID, widget.patientSearchViewModel
.doctorProfile.doctorID,
onTap: () { onTap: () {
FocusScopeNode currentFocus = FocusScopeNode currentFocus =
FocusScope.of(context); FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) { if (!currentFocus
.hasPrimaryFocus) {
currentFocus.unfocus(); currentFocus.unfocus();
} }
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
PATIENTS_PROFILE, PATIENTS_PROFILE,
arguments: { arguments: {
"patient": widget.patientSearchViewModel.filteredInPatientItems[index], "patient": widget
.patientSearchViewModel
.filteredInPatientItems[index],
"patientType": "1", "patientType": "1",
"from": "0", "from": "0",
"to": "0", "to": "0",
"isSearch": false, "isSearch": false,
"isInpatient": true, "isInpatient": true,
"arrivalType": "1", "arrivalType": "1",
"isMyPatient":widget.patientSearchViewModel.filteredInPatientItems[index] "isMyPatient": widget
.patientSearchViewModel
.filteredInPatientItems[
index]
.doctorId == .doctorId ==
widget.patientSearchViewModel.doctorProfile.doctorID, widget
.patientSearchViewModel
.doctorProfile
.doctorID,
}); });
}, },
); );
@ -181,11 +221,11 @@ class _InPatientPageState extends State<InPatientPage> {
), ),
), ),
) )
: NoData(): Center( : NoData()
: Center(
child: Container( child: Container(
height: 300, height: 300,
width: 300, width: 300,
), ),
), ),
], ],
@ -205,8 +245,7 @@ class NoData extends StatelessWidget {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
child: ErrorMessage( child: ErrorMessage(
error: error: TranslationBase.of(context).noDataAvailable)),
TranslationBase.of(context).noDataAvailable)),
), ),
); );
} }

@ -47,8 +47,7 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(patient),
patient),
appBarTitle: TranslationBase.of(context).ucaf, appBarTitle: TranslationBase.of(context).ucaf,
body: Column( body: Column(
children: [ children: [
@ -234,10 +233,15 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
case 0: case 0:
if (model.patientAssessmentList != null) { if (model.patientAssessmentList != null) {
return [ return [
...List.generate( ListView.builder(
model.patientAssessmentList.length, itemCount: model.patientAssessmentList.length,
(index) => DiagnosisWidget( scrollDirection: Axis.vertical,
model, model.patientAssessmentList[index])).toList() physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return DiagnosisWidget(
model, model.patientAssessmentList[index]);
})
]; ];
} else { } else {
return [ return [
@ -247,22 +251,30 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
break; break;
case 1: case 1:
return [ return [
...List.generate( ListView.builder(
model.prescriptionList != null itemCount: model.prescriptionList != null
? model.prescriptionList.entityList.length ? model.prescriptionList.entityList.length
: 0, : 0,
(index) => MedicationWidget( scrollDirection: Axis.vertical,
model, model.prescriptionList.entityList[index])).toList() physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return MedicationWidget(
model, model.prescriptionList.entityList[index]);
})
]; ];
break; break;
case 2: case 2:
if (model.orderProcedures != null) { if (model.orderProcedures != null) {
return [ return [
...List.generate( ListView.builder(
model.orderProcedures.length, itemCount: model.orderProcedures.length,
(index) => scrollDirection: Axis.vertical,
ProceduresWidget(model, model.orderProcedures[index])) physics: ScrollPhysics(),
.toList() shrinkWrap: true,
itemBuilder: (context, index) {
return ProceduresWidget(model, model.orderProcedures[index]);
})
]; ];
} else { } else {
return [ return [

@ -18,7 +18,8 @@ import 'my-referral-patient-screen.dart';
class MyReferralInPatientScreen extends StatefulWidget { class MyReferralInPatientScreen extends StatefulWidget {
@override @override
_MyReferralInPatientScreenState createState() => _MyReferralInPatientScreenState(); _MyReferralInPatientScreenState createState() =>
_MyReferralInPatientScreenState();
} }
class _MyReferralInPatientScreenState extends State<MyReferralInPatientScreen> { class _MyReferralInPatientScreenState extends State<MyReferralInPatientScreen> {
@ -76,51 +77,87 @@ class _MyReferralInPatientScreenState extends State<MyReferralInPatientScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
...List.generate( ListView.builder(
model.myReferralPatients.length, itemCount: model.myReferralPatients.length,
(index) => InkWell( scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return InkWell(
onTap: () { onTap: () {
if(patientType == PatientType.OUT_PATIENT) { if (patientType ==
PatientType.OUT_PATIENT) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: MyReferralDetailScreen(referralPatient: model.myReferralPatients[index]), page: MyReferralDetailScreen(
referralPatient: model
.myReferralPatients[index]),
), ),
); );
} else{ } else {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ReferralPatientDetailScreen(model.myReferralPatients[index], model), page: ReferralPatientDetailScreen(
model.myReferralPatients[index],
model),
), ),
); );
} }
}, },
child: PatientReferralItemWidget( child: PatientReferralItemWidget(
referralStatus: model.getReferralStatusNameByCode( referralStatus:
model.myReferralPatients[index].referralStatus, context), model.getReferralStatusNameByCode(
referralStatusCode: model.myReferralPatients[index].referralStatus, model.myReferralPatients[index]
patientName: model.myReferralPatients[index].patientName, .referralStatus,
patientGender: model.myReferralPatients[index].gender, context),
referredDate: AppDateUtils.getDayMonthYearDateFormatted( referralStatusCode: model
model.myReferralPatients[index].referralDate), .myReferralPatients[index]
referredTime: AppDateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate), .referralStatus,
patientID: "${model.myReferralPatients[index].patientID}", patientName: model
.myReferralPatients[index]
.patientName,
patientGender: model
.myReferralPatients[index].gender,
referredDate: AppDateUtils
.getDayMonthYearDateFormatted(model
.myReferralPatients[index]
.referralDate),
referredTime: AppDateUtils.getTimeHHMMA(
model.myReferralPatients[index]
.referralDate),
patientID:
"${model.myReferralPatients[index].patientID}",
isSameBranch: false, isSameBranch: false,
isReferral: true, isReferral: true,
isReferralClinic: true, isReferralClinic: true,
referralClinic: "${model.myReferralPatients[index].referringClinicDescription}", referralClinic:
remark: model.myReferralPatients[index].referringDoctorRemarks, "${model.myReferralPatients[index].referringClinicDescription}",
nationality: model.myReferralPatients[index].nationalityName, remark: model.myReferralPatients[index]
nationalityFlag: model.myReferralPatients[index].nationalityFlagURL, .referringDoctorRemarks,
doctorAvatar: model.myReferralPatients[index].doctorImageURL, nationality: model
referralDoctorName: model.myReferralPatients[index].referringDoctorName, .myReferralPatients[index]
clinicDescription: model.myReferralPatients[index].referringClinicDescription, .nationalityName,
infoIcon: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black), nationalityFlag: model
), .myReferralPatients[index]
), .nationalityFlagURL,
doctorAvatar: model
.myReferralPatients[index]
.doctorImageURL,
referralDoctorName: model
.myReferralPatients[index]
.referringDoctorName,
clinicDescription: model
.myReferralPatients[index]
.referringClinicDescription,
infoIcon: Icon(
FontAwesomeIcons.arrowRight,
size: 25,
color: Colors.black),
), ),
);
})
], ],
), ),
), ),

@ -13,7 +13,6 @@ 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 StatefulWidget { class ReferredPatientScreen extends StatefulWidget {
@override @override
_ReferredPatientScreenState createState() => _ReferredPatientScreenState(); _ReferredPatientScreenState createState() => _ReferredPatientScreenState();
} }
@ -74,15 +73,21 @@ class _ReferredPatientScreenState extends State<ReferredPatientScreen> {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
...List.generate( ListView.builder(
itemCount:
model.listMyReferredPatientModel.length, model.listMyReferredPatientModel.length,
(index) => InkWell( scrollDirection: Axis.vertical,
physics: ScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ReferredPatientDetailScreen( page: ReferredPatientDetailScreen(
model.getReferredPatientItem(index), this.patientType), model.getReferredPatientItem(index),
this.patientType),
), ),
); );
}, },
@ -95,16 +100,17 @@ class _ReferredPatientScreenState extends State<ReferredPatientScreen> {
.referralStatus, .referralStatus,
patientName: patientName:
"${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
model.getReferredPatientItem(index).gender, .getReferredPatientItem(index)
referredDate: .gender,
AppDateUtils.convertDateFromServerFormat( referredDate: AppDateUtils
.convertDateFromServerFormat(
model model
.getReferredPatientItem(index) .getReferredPatientItem(index)
.referralDate, .referralDate,
"dd/MM/yyyy"), "dd/MM/yyyy"),
referredTime: referredTime: AppDateUtils
AppDateUtils.convertDateFromServerFormat( .convertDateFromServerFormat(
model model
.getReferredPatientItem(index) .getReferredPatientItem(index)
.referralDate, .referralDate,
@ -135,7 +141,8 @@ class _ReferredPatientScreenState extends State<ReferredPatientScreen> {
infoIcon: Icon(FontAwesomeIcons.arrowRight, infoIcon: Icon(FontAwesomeIcons.arrowRight,
size: 25, color: Colors.black), size: 25, color: Colors.black),
), ),
), );
},
), ),
], ],
), ),

@ -347,6 +347,9 @@ class PatientCard extends StatelessWidget {
SizedBox( SizedBox(
width: 10, width: 10,
), ),
Expanded(
child: Row(
children: [
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -355,9 +358,6 @@ class PatientCard extends StatelessWidget {
label: TranslationBase.of(context).fileNumber, label: TranslationBase.of(context).fileNumber,
value: patientInfo.patientId.toString(), value: patientInfo.patientId.toString(),
), ),
//if (isInpatient)
CustomRow( CustomRow(
label: TranslationBase.of(context).age + " : ", label: TranslationBase.of(context).age + " : ",
value: value:
@ -399,7 +399,11 @@ class PatientCard extends StatelessWidget {
), ),
], ],
), ),
])) ]),
),
Icon(Icons.arrow_forward, size: 24,),
],
))
]), ]),
isFromLiveCare isFromLiveCare
? Row( ? Row(

Loading…
Cancel
Save