Merge branch 'development' into textfield-validation

merge-requests/498/head
mosazaid 5 years ago
commit 82cbf392af

@ -295,7 +295,7 @@ class BaseAppClient {
} }
} }
if (error == null || error == "null" || error == "null\n") { if (error == null || error == "null" || error == "null\n") {
return "This server not work probably in this time"; return helpers.generateContactAdminMsg();
} }
return error; return error;
} }

@ -21,7 +21,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_mode
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/assessment/update_assessment_page.dart';
import 'base/lookup-service.dart'; import 'base/lookup-service.dart';

@ -25,7 +25,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_mode
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/assessment/update_assessment_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../locator.dart'; import '../../locator.dart';

@ -89,13 +89,14 @@ class SickLeaveViewModel extends BaseViewModel {
} }
Future getCoveringDoctors() async { Future getCoveringDoctors() async {
setState(ViewState.Busy); //setState(ViewState.Busy);
await _sickLeaveService.getCoveringDoctors(); await _sickLeaveService.getCoveringDoctors();
if (_sickLeaveService.hasError) { if (_sickLeaveService.hasError) {
error = _sickLeaveService.error; error = _sickLeaveService.error;
setState(ViewState.Error); // setState(ViewState.Error);
} else }
setState(ViewState.Idle); //else
// setState(ViewState.Idle);
} }
Future addReschedule(request) async { Future addReschedule(request) async {

@ -326,7 +326,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
} }
} else { } else {
if (isView == false && val2 == 1) { if (isView == false && val2 == 1) {
lItems = res['GetPatientFileInformation_PRMList']; lItems = res['GetPatientFileInformation_PRMList']
.where((i) =>
i['PatientTypeDescription'] == 'Permanent File')
.toList();
} else { } else {
lItems = res[SERVICES_PATIANT2[val2]]; lItems = res[SERVICES_PATIANT2[val2]];
} }
@ -391,23 +394,70 @@ class _PatientsScreenState extends State<PatientsScreen> {
: lItems == null || lItems.length == 0 : lItems == null || lItems.length == 0
? Column( ? Column(
children: [ children: [
Column(children: <Widget>[
SizedBox(height: 18.5),
Container(
width: SizeConfig.screenWidth * 0.9,
height: SizeConfig.screenHeight * 0.08,
child: TextField(
controller: _controller,
onChanged: (String str) {
this.searchData(str);
},
decoration: buildInputDecoration(
context,
TranslationBase.of(context)
.searchPatientName),
),
),
SizedBox(
height: 10.0,
),
if (int.parse(patientType) == 7) if (int.parse(patientType) == 7)
Container( Container(
margin: EdgeInsets.only(top: 10), padding: EdgeInsets.all(5),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(10)),
child: ClinicList( child: ClinicList(
clinicId: clinicId, clinicId: clinicId,
onClinicChange: (newValue) { onClinicChange: (newValue) {
clinicId = newValue; clinicId = newValue;
changeClinic(newValue, context, model); changeClinic(newValue, context, model);
}, },
), )),
), Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height *
0.03),
// child: _locationBar(context)
child:
SERVICES_PATIANT2[int.parse(patientType)] ==
"patientArrivalList"
? _locationBar(context, model)
: Container(),
)
]),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: MediaQuery.of(context).size.height * 0.35), top: MediaQuery.of(context).size.height * 0.10),
child: DrAppEmbeddedError( child: Center(
error: TranslationBase.of(context) child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context)
.youDontHaveAnyPatient), .youDontHaveAnyPatient),
)
],
),
),
), ),
], ],
) )
@ -482,7 +532,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
child: SERVICES_PATIANT2[ child: SERVICES_PATIANT2[
int.parse(patientType)] == int.parse(patientType)] ==
"patientArrivalList" "patientArrivalList"
? _locationBar(context) ? _locationBar(context, model)
: Container(), : Container(),
), ),
// Row( // Row(
@ -755,7 +805,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
)); ));
} }
Widget _locationBar(BuildContext _context) { Widget _locationBar(BuildContext _context, model) {
return Container( return Container(
height: MediaQuery.of(context).size.height * 0.0619, height: MediaQuery.of(context).size.height * 0.0619,
width: SizeConfig.screenWidth * 0.94, width: SizeConfig.screenWidth * 0.94,
@ -806,7 +856,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
setState(() { setState(() {
_activeLocation = _locations.indexOf(item); _activeLocation = _locations.indexOf(item);
}); });
filterPatient(item.toString()); filterPatient(item.toString(), model);
}), }),
_isActive _isActive
? Container( ? Container(
@ -826,7 +876,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
); );
} }
filterPatient(item) { filterPatient(item, model) {
if (item == 'Tomorrow') { if (item == 'Tomorrow') {
_patientSearchFormValues.To = DateUtils.convertDateToFormat( _patientSearchFormValues.To = DateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month, DateTime(DateTime.now().year, DateTime.now().month,
@ -837,17 +887,132 @@ class _PatientsScreenState extends State<PatientsScreen> {
DateTime.now().day + 1), DateTime.now().day + 1),
'yyyy-MM-dd'); 'yyyy-MM-dd');
} else if (item == 'Next Week') { } else if (item == 'Next Week') {
_patientSearchFormValues.From = DateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 1),
'yyyy-MM-dd');
_patientSearchFormValues.To = DateUtils.convertDateToFormat( _patientSearchFormValues.To = DateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month, DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 6), DateTime.now().day + 6),
'yyyy-MM-dd'); 'yyyy-MM-dd');
} else {
_patientSearchFormValues.From = DateUtils.convertDateToFormat(
DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day),
'yyyy-MM-dd');
_patientSearchFormValues.To = DateUtils.convertDateToFormat(
DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day),
'yyyy-MM-dd');
}
searchPatient(model);
// Navigator.of(context).pop();
// Navigator.of(context).pushNamed(PATIENTS, arguments: {
// "patientSearchForm": _patientSearchFormValues,
// "selectedType": "7",
// "arrivalType": "1",
// "activeFilter": _activeLocation
// });
}
searchPatient(model) {
GifLoaderDialogUtils.showMyDialog(context);
int val2 = int.parse(patientType);
GetPatientArrivalListRequestModel getPatientArrivalListRequestModel;
if (val2 == 7) {
getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel(
from: _patientSearchFormValues.From,
to: _patientSearchFormValues.To,
pageIndex: 0,
pageSize: 0,
patientMRN: patient.getPatientID);
}
model
.getPatientList(
val2 == 7 ? getPatientArrivalListRequestModel.toJson() : patient,
patientType,
isView: isView)
.then((res) {
setState(() {
GifLoaderDialogUtils.hideDialog(context);
if (res != null && res['MessageStatus'] == 1) {
if (val2 == 7) {
if (res[SERVICES_PATIANT2[val2]] == null) {
_isError = true;
_isLoading = false;
this.error = error.toString();
} else {
var localList = [];
if (res["patientArrivalList"]["entityList"] == null) {
res["patientArrivalList"]["entityList"] = [];
}
res["patientArrivalList"]["entityList"].forEach((v) {
Map<String, dynamic> mergedPatient = {
...v,
...v["patientDetails"]
};
localList.add(mergedPatient);
});
lItems = localList;
}
} else {
if (isView == false && val2 == 1) {
lItems = res['GetPatientFileInformation_PRMList']
.where((i) => i['PatientTypeDescription'] == 'Permanent File')
.toList();
} else {
lItems = res[SERVICES_PATIANT2[val2]];
}
}
parsed = lItems;
responseModelList = new ModelResponse.fromJson(parsed).list;
if (val2 == 7) {
responseModelList.sort((a, b) {
if (b.startTime != null && b.startTime != null) {
try {
DateTime now = DateTime.now();
DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm");
String formattedDate =
DateFormat('yyyy-MM-dd ' + a.startTime).format(now);
DateTime dateTimeA = dateFormat.parse(formattedDate);
String formattedDateB =
DateFormat('yyyy-MM-dd ' + b.startTime).format(now);
DateTime dateTimeB = dateFormat.parse(formattedDateB);
var adate = dateTimeA; //a.startTime;
var bdate = dateTimeB;
return adate.compareTo(bdate);
} on Exception catch (_) {
print('never reached');
var adate = a.startTime; //a.startTime;
var bdate = b.startTime;
return adate.compareTo(bdate);
}
} else {
var adate = convertDateFormat(a.appointmentDate);
var bdate = convertDateFormat(b.appointmentDate);
return bdate.compareTo(adate);
}
});
} }
Navigator.of(context).pop(); responseModelList2 = responseModelList;
Navigator.of(context).pushNamed(PATIENTS, arguments: { _isError = false;
"patientSearchForm": _patientSearchFormValues, } else {
"selectedType": "7", _isError = true;
"arrivalType": "1", error =
"activeFilter": _activeLocation model.error ?? res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
}
_isLoading = false;
});
}).catchError((error) {
GifLoaderDialogUtils.hideDialog(context);
setState(() {
_isError = true;
_isLoading = false;
this.error = error.toString();
});
}); });
} }
} }

@ -167,7 +167,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: 10, height: 10,
), ),
Container( Container(
height: 55.0, // height: 60.0,
child: InkWell( child: InkWell(
onTap: model.listOfICD10 != null onTap: model.listOfICD10 != null
? () { ? () {
@ -196,7 +196,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
itemSubmitted: (item) => setState(() { itemSubmitted: (item) => setState(() {
widget.mySelectedAssessment widget.mySelectedAssessment
.selectedICD = item; .selectedICD = item;
icdNameController.text = item.code; icdNameController.text = '${item.code.trim()}/${item.description}';
}), }),
key: key, key: key,
suggestions: model.listOfICD10, suggestions: model.listOfICD10,
@ -232,48 +232,14 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
}); });
} }
: null, : null,
//hasLabelText:
// icdNameController.text != ''
// ? true
// : false,
//showLabelText: true,
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context)
.nameOrICD, .nameOrICD,
//fontSize: 13.5,
//readOnly: true,
//fontWeight: FontWeight.w600,
maxLines: 2, maxLines: 2,
minLines: 1, minLines: 1,
controller: icdNameController, controller: icdNameController,
//suffixIcon: EvaIcons.search,
// validator: (value) {
// if (value == null)
// return TranslationBase.of(context)
// .emptyMessage;
// else
// return null;
// },
isDropDown: true, enabled: true,
enabled: false,
height: 55.0,
) )
// TextField(
// decoration: textFieldSelectorDecoration(
// widget.mySelectedAssessment.selectedICD !=
// null ? widget.mySelectedAssessment
// .selectedICD.code : "Name or ICD",
// widget.mySelectedAssessment.selectedICD !=
// null ? projectViewModel.isArabic
// ? widget.mySelectedAssessment
// .selectedICD.nameAr
// : widget.mySelectedAssessment
// .selectedICD.nameEn : null, true,
// icon: EvaIcons.search),
// enabled: false,
// ),
), ),
), ),
if (isFormSubmitted && if (isFormSubmitted &&

@ -18,10 +18,10 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'SOAP_open_items.dart'; import '../SOAP_open_items.dart';
import 'SOAP_step_header.dart'; import '../SOAP_step_header.dart';
import 'assessment/add_assessment_details.dart'; import 'add_assessment_details.dart';
import 'expandable_SOAP_widget.dart'; import '../expandable_SOAP_widget.dart';
class UpdateAssessmentPage extends StatefulWidget { class UpdateAssessmentPage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;

@ -12,15 +12,11 @@ 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/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/expandable-widget-header-body.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'SOAP_step_header.dart'; import 'SOAP_step_header.dart';
@ -268,7 +264,6 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
color: Colors.grey[300], color: Colors.grey[300],
fontColor: Colors.black, fontColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
loading: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
setState(() { setState(() {
widget.changePageViewIndex(2); widget.changePageViewIndex(2);
@ -285,22 +280,33 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
disabled: progressNoteController.text.isEmpty, disabled: progressNoteController.text.isEmpty,
onPressed: () async { onPressed: () async {
if (progressNoteController.text.isNotEmpty) {
if(isAddProgress) { if (isAddProgress) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile =
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile =
DoctorProfileModel.fromJson(profile);
setState(() { setState(() {
widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName ?? doctorProfile.doctorName; widget.patientProgressNote.createdByName =
widget.patientProgressNote.editedByName = doctorProfile.doctorName; widget.patientProgressNote
widget.patientProgressNote.createdOn = DateTime.now().toString(); .createdByName ??
widget.patientProgressNote.planNote = progressNoteController.text; doctorProfile.doctorName;
widget.patientProgressNote.editedByName =
doctorProfile.doctorName;
widget.patientProgressNote.createdOn =
DateTime.now().toString();
widget.patientProgressNote.planNote =
progressNoteController.text;
isAddProgress = !isAddProgress; isAddProgress = !isAddProgress;
}); });
submitPlan(model); submitPlan(model);
} else {
} else{
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} else {
helpers.showErrorToast(TranslationBase.of(context)
.progressNoteErrorMsg);
}
}, },
), ),
), ),

@ -10,7 +10,7 @@ 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/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/assessment/update_assessment_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_plan_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_plan_page.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';

@ -78,10 +78,11 @@ class _AppDrawerState extends State<AppDrawer> {
if (authProvider.doctorProfile != null) if (authProvider.doctorProfile != null)
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.of(context).pushNamed(PROFILE, arguments: { // TODO: return it back when its needed
'title': authProvider.doctorProfile.doctorName, // Navigator.of(context).pushNamed(PROFILE, arguments: {
"doctorProfileall": authProvider.doctorProfile // 'title': authProvider.doctorProfile.doctorName,
}); // "doctorProfileall": authProvider.doctorProfile
// });
}, },
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

@ -38,9 +38,13 @@ class NetworkBaseView extends StatelessWidget {
children: [ children: [
SizedBox(height: 100,), SizedBox(height: 100,),
Image.asset('assets/images/no-data.png'), Image.asset('assets/images/no-data.png'),
Padding( Center(
padding: const EdgeInsets.all(8.0), child: Center(
child: Texts(baseViewModel.error??''), child: Padding(
padding: const EdgeInsets.only(top: 12, bottom: 12,right: 20, left: 30),
child: Center(child: Texts(baseViewModel.error??'' , textAlign: TextAlign.center,)),
),
),
) )
], ],

Loading…
Cancel
Save