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['MobileNo'] = this.mobileNo;
data['IdentificationNo'] = this.identificationNo;
//data['NursingStationID'] = this.nursingStationID;
data['NursingStationID'] = this.nursingStationID;
data['ClinicID'] = this.clinicID;
data['ProjectID'] = this.projectID;
return data;

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

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

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

@ -16,14 +16,16 @@ import '../../routes.dart';
class InPatientPage extends StatefulWidget {
final bool isMyInPatient;
final PatientSearchViewModel patientSearchViewModel;
InPatientPage(this.isMyInPatient);
InPatientPage(this.isMyInPatient, this.patientSearchViewModel);
@override
_InPatientPageState createState() => _InPatientPageState();
}
class _InPatientPageState extends State<InPatientPage> {
TextEditingController _searchController = TextEditingController();
bool isSortDes = false;
@ -36,12 +38,8 @@ class _InPatientPageState extends State<InPatientPage> {
@override
Widget build(BuildContext context) {
return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {
await model.setDefaultInPatientList();
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
return AppScaffold(
baseViewModel: widget.patientSearchViewModel,
isShowAppBar: false,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -65,7 +63,7 @@ class _InPatientPageState extends State<InPatientPage> {
),
controller: _searchController,
onChanged: (value) {
model.filterSearchResults(value);
widget.patientSearchViewModel.filterSearchResults(value);
}),
Positioned(
@ -82,7 +80,7 @@ class _InPatientPageState extends State<InPatientPage> {
// padding: EdgeInsets.only(bottom: 30),
onPressed: () {
GifLoaderDialogUtils.showMyDialog(context);
model.sortInPatient(isDes: isSortDes);
widget.patientSearchViewModel.sortInPatient(isDes: isSortDes);
isSortDes = !isSortDes;
GifLoaderDialogUtils.hideDialog(context);
},
@ -91,7 +89,7 @@ class _InPatientPageState extends State<InPatientPage> {
],
),
),
model.state == ViewState.Idle?model.filteredInPatientItems.length > 0
widget.patientSearchViewModel.state == ViewState.Idle?widget.patientSearchViewModel.filteredInPatientItems.length > 0
? Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
@ -100,18 +98,17 @@ class _InPatientPageState extends State<InPatientPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...List.generate(
model.filteredInPatientItems.length, (index) {
widget.patientSearchViewModel.filteredInPatientItems.length, (index) {
if (!widget.isMyInPatient)
return PatientCard(
patientInfo:
model.filteredInPatientItems[index],
widget.patientSearchViewModel.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model
.filteredInPatientItems[index]
isMyPatient: widget.patientSearchViewModel.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID,
widget.patientSearchViewModel.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
@ -122,8 +119,8 @@ class _InPatientPageState extends State<InPatientPage> {
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model
.filteredInPatientItems[index],
"patient": widget.patientSearchViewModel.
filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
@ -133,20 +130,20 @@ class _InPatientPageState extends State<InPatientPage> {
});
},
);
else if (model.filteredInPatientItems[index]
else if (widget.patientSearchViewModel.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID &&
widget.patientSearchViewModel.doctorProfile.doctorID &&
widget.isMyInPatient)
return PatientCard(
patientInfo:
model.filteredInPatientItems[index],
widget.patientSearchViewModel.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model
isMyPatient: widget.patientSearchViewModel
.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID,
widget.patientSearchViewModel.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
@ -157,8 +154,7 @@ class _InPatientPageState extends State<InPatientPage> {
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model
.filteredInPatientItems[index],
"patient": widget.patientSearchViewModel.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
@ -196,7 +192,6 @@ class _InPatientPageState extends State<InPatientPage> {
),
],
),
),
);
}
}

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

Loading…
Cancel
Save