Merge branch 'special_clinical' into 'development'

Special clinical

See merge request Cloud_Solution/doctor_app_flutter!782
merge-requests/783/merge
Elham Ali 5 years ago
commit 09ca6d2454

@ -64,7 +64,7 @@ class PatientSearchRequestModel {
data['SearchType'] = this.searchType; data['SearchType'] = this.searchType;
data['MobileNo'] = this.mobileNo; data['MobileNo'] = this.mobileNo;
data['IdentificationNo'] = this.identificationNo; data['IdentificationNo'] = this.identificationNo;
//data['NursingStationID'] = this.nursingStationID; data['NursingStationID'] = this.nursingStationID;
data['ClinicID'] = this.clinicID; data['ClinicID'] = this.clinicID;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
return data; return data;

@ -155,7 +155,7 @@ class PatientSearchViewModel extends BaseViewModel {
setState(ViewState.Error); setState(ViewState.Error);
} }
} else { } else {
// setDefaultInPatientList(); setDefaultInPatientList();
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

@ -106,7 +106,7 @@ class DashboardViewModel extends BaseViewModel {
GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId){ GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId){
GetSpecialClinicalCareListResponseModel special ; GetSpecialClinicalCareListResponseModel special ;
specialClinicalCareList.forEach((element) { specialClinicalCareList.forEach((element) {
if(element.clinicID == 1){ if(element.clinicID == clinicId){
special = element; special = element;
} }
}); });

@ -71,7 +71,7 @@ class _HomeScreenState extends State<HomeScreen> {
await model.getDashboard(); await model.getDashboard();
await model.getDoctorProfile(isGetProfile: true); await model.getDoctorProfile(isGetProfile: true);
await model.checkDoctorHasLiveCare(); await model.checkDoctorHasLiveCare();
// await model.getSpecialClinicalCareList(); await model.getSpecialClinicalCareList();
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,

@ -16,14 +16,16 @@ import '../../routes.dart';
class InPatientPage extends StatefulWidget { class InPatientPage extends StatefulWidget {
final bool isMyInPatient; final bool isMyInPatient;
final PatientSearchViewModel patientSearchViewModel;
InPatientPage(this.isMyInPatient); InPatientPage(this.isMyInPatient, this.patientSearchViewModel);
@override @override
_InPatientPageState createState() => _InPatientPageState(); _InPatientPageState createState() => _InPatientPageState();
} }
class _InPatientPageState extends State<InPatientPage> { class _InPatientPageState extends State<InPatientPage> {
TextEditingController _searchController = TextEditingController(); TextEditingController _searchController = TextEditingController();
bool isSortDes = false; bool isSortDes = false;
@ -36,166 +38,159 @@ class _InPatientPageState extends State<InPatientPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PatientSearchViewModel>( return AppScaffold(
onModelReady: (model) async { baseViewModel: widget.patientSearchViewModel,
await model.setDefaultInPatientList(); isShowAppBar: false,
}, body: Column(
builder: (_, model, w) => AppScaffold( crossAxisAlignment: CrossAxisAlignment.start,
baseViewModel: model, children: [
isShowAppBar: false, Container(
body: Column( height: MediaQuery.of(context).size.height * 0.070,
crossAxisAlignment: CrossAxisAlignment.start, ),
children: [ Container(
Container( margin: EdgeInsets.all(16.0),
height: MediaQuery.of(context).size.height * 0.070, child: Stack(
), children: [
Container( AppTextFieldCustom(
margin: EdgeInsets.all(16.0), hintText: TranslationBase.of(context).searchPatientName,
child: Stack( isTextFieldHasSuffix: true,
children: [ suffixIcon: IconButton(
AppTextFieldCustom(
hintText: TranslationBase.of(context).searchPatientName,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
),
onPressed: () {},
),
controller: _searchController,
onChanged: (value) {
model.filterSearchResults(value);
}),
Positioned(
right: 35,
top:5,
child: IconButton(
icon: Icon( icon: Icon(
isSortDes Icons.search,
? FontAwesomeIcons.sortAmountDown
: FontAwesomeIcons.sortAmountUp,
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, onPressed: () {},
// padding: EdgeInsets.only(bottom: 30),
onPressed: () {
GifLoaderDialogUtils.showMyDialog(context);
model.sortInPatient(isDes: isSortDes);
isSortDes = !isSortDes;
GifLoaderDialogUtils.hideDialog(context);
},
), ),
) controller: _searchController,
], onChanged: (value) {
), widget.patientSearchViewModel.filterSearchResults(value);
), }),
model.state == ViewState.Idle?model.filteredInPatientItems.length > 0
? Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...List.generate(
model.filteredInPatientItems.length, (index) {
if (!widget.isMyInPatient)
return PatientCard(
patientInfo:
model.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model
.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model
.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else if (model.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID &&
widget.isMyInPatient)
return PatientCard(
patientInfo:
model.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model
.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context).pushNamed( Positioned(
PATIENTS_PROFILE, right: 35,
arguments: { top:5,
"patient": model child: IconButton(
.filteredInPatientItems[index], icon: Icon(
"patientType": "1", isSortDes
"from": "0", ? FontAwesomeIcons.sortAmountDown
"to": "0", : FontAwesomeIcons.sortAmountUp,
"isSearch": false, color: Colors.black,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else
return SizedBox();
}),
SizedBox(
height: 15,
)
],
),
),
),
)
: Expanded(
child: SingleChildScrollView(
child: Container(
child: ErrorMessage(
error:
TranslationBase.of(context).noDataAvailable)),
),
): Center(
child: Container(
height: 300,
width: 300,
child: Image.asset(
"assets/images/progress-loading-red.gif"),
), ),
iconSize: 20,
// padding: EdgeInsets.only(bottom: 30),
onPressed: () {
GifLoaderDialogUtils.showMyDialog(context);
widget.patientSearchViewModel.sortInPatient(isDes: isSortDes);
isSortDes = !isSortDes;
GifLoaderDialogUtils.hideDialog(context);
},
), ),
], )
), ],
),
),
widget.patientSearchViewModel.state == ViewState.Idle?widget.patientSearchViewModel.filteredInPatientItems.length > 0
? Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...List.generate(
widget.patientSearchViewModel.filteredInPatientItems.length, (index) {
if (!widget.isMyInPatient)
return PatientCard(
patientInfo:
widget.patientSearchViewModel.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: widget.patientSearchViewModel.filteredInPatientItems[index]
.doctorId ==
widget.patientSearchViewModel.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": widget.patientSearchViewModel.
filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else if (widget.patientSearchViewModel.filteredInPatientItems[index]
.doctorId ==
widget.patientSearchViewModel.doctorProfile.doctorID &&
widget.isMyInPatient)
return PatientCard(
patientInfo:
widget.patientSearchViewModel.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: widget.patientSearchViewModel
.filteredInPatientItems[index]
.doctorId ==
widget.patientSearchViewModel.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": widget.patientSearchViewModel.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else
return SizedBox();
}),
SizedBox(
height: 15,
)
],
),
),
),
)
: Expanded(
child: SingleChildScrollView(
child: Container(
child: ErrorMessage(
error:
TranslationBase.of(context).noDataAvailable)),
),
): Center(
child: Container(
height: 300,
width: 300,
child: Image.asset(
"assets/images/progress-loading-red.gif"),
),
),
],
), ),
); );
} }

@ -65,12 +65,12 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen>
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.clearPatientList(); model.clearPatientList();
// if (widget.specialClinic != null) { if (widget.specialClinic != null) {
// await model.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID); await model.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID);
// requestModel.nursingStationID = requestModel.nursingStationID =
// model.specialClinicalCareMappingList[0].nursingStationID; model.specialClinicalCareMappingList[0].nursingStationID;
// requestModel.clinicID = 0; requestModel.clinicID = 0;
// } }
model.getInPatientList(requestModel); model.getInPatientList(requestModel);
}, },
builder: (_, model, w) => builder: (_, model, w) =>
@ -265,8 +265,8 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen>
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: [ children: [
InPatientPage(false), InPatientPage(false, model),
InPatientPage(true), InPatientPage(true,model),
DischargedPatient(), DischargedPatient(),
], ],
), ),

Loading…
Cancel
Save