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") {
return "This server not work probably in this time";
return helpers.generateContactAdminMsg();
}
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_physical_exam_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';

@ -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_physical_exam_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 '../../locator.dart';

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

@ -326,7 +326,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
}
} else {
if (isView == false && val2 == 1) {
lItems = res['GetPatientFileInformation_PRMList'];
lItems = res['GetPatientFileInformation_PRMList']
.where((i) =>
i['PatientTypeDescription'] == 'Permanent File')
.toList();
} else {
lItems = res[SERVICES_PATIANT2[val2]];
}
@ -391,23 +394,70 @@ class _PatientsScreenState extends State<PatientsScreen> {
: lItems == null || lItems.length == 0
? Column(
children: [
if (int.parse(patientType) == 7)
Column(children: <Widget>[
SizedBox(height: 18.5),
Container(
margin: EdgeInsets.only(top: 10),
child: ClinicList(
clinicId: clinicId,
onClinicChange: (newValue) {
clinicId = newValue;
changeClinic(newValue, context, model);
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)
Container(
padding: EdgeInsets.all(5),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(10)),
child: ClinicList(
clinicId: clinicId,
onClinicChange: (newValue) {
clinicId = newValue;
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(
margin: EdgeInsets.only(
top: MediaQuery.of(context).size.height * 0.35),
child: DrAppEmbeddedError(
error: TranslationBase.of(context)
.youDontHaveAnyPatient),
top: MediaQuery.of(context).size.height * 0.10),
child: 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: Texts(TranslationBase.of(context)
.youDontHaveAnyPatient),
)
],
),
),
),
],
)
@ -482,7 +532,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
child: SERVICES_PATIANT2[
int.parse(patientType)] ==
"patientArrivalList"
? _locationBar(context)
? _locationBar(context, model)
: Container(),
),
// Row(
@ -755,7 +805,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
));
}
Widget _locationBar(BuildContext _context) {
Widget _locationBar(BuildContext _context, model) {
return Container(
height: MediaQuery.of(context).size.height * 0.0619,
width: SizeConfig.screenWidth * 0.94,
@ -806,7 +856,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
setState(() {
_activeLocation = _locations.indexOf(item);
});
filterPatient(item.toString());
filterPatient(item.toString(), model);
}),
_isActive
? Container(
@ -826,7 +876,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
);
}
filterPatient(item) {
filterPatient(item, model) {
if (item == 'Tomorrow') {
_patientSearchFormValues.To = DateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month,
@ -837,17 +887,132 @@ class _PatientsScreenState extends State<PatientsScreen> {
DateTime.now().day + 1),
'yyyy-MM-dd');
} 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(
DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 6),
'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);
}
Navigator.of(context).pop();
Navigator.of(context).pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues,
"selectedType": "7",
"arrivalType": "1",
"activeFilter": _activeLocation
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);
}
});
}
responseModelList2 = responseModelList;
_isError = false;
} else {
_isError = true;
error =
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,
),
Container(
height: 55.0,
// height: 60.0,
child: InkWell(
onTap: model.listOfICD10 != null
? () {
@ -196,7 +196,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
itemSubmitted: (item) => setState(() {
widget.mySelectedAssessment
.selectedICD = item;
icdNameController.text = item.code;
icdNameController.text = '${item.code.trim()}/${item.description}';
}),
key: key,
suggestions: model.listOfICD10,
@ -232,48 +232,14 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
});
}
: null,
//hasLabelText:
// icdNameController.text != ''
// ? true
// : false,
//showLabelText: true,
hintText: TranslationBase.of(context)
.nameOrICD,
//fontSize: 13.5,
//readOnly: true,
//fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: icdNameController,
//suffixIcon: EvaIcons.search,
// validator: (value) {
// if (value == null)
// return TranslationBase.of(context)
// .emptyMessage;
// else
// return null;
// },
isDropDown: true,
enabled: false,
height: 55.0,
enabled: true,
)
// 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 &&

@ -18,10 +18,10 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'SOAP_open_items.dart';
import 'SOAP_step_header.dart';
import 'assessment/add_assessment_details.dart';
import 'expandable_SOAP_widget.dart';
import '../SOAP_open_items.dart';
import '../SOAP_step_header.dart';
import 'add_assessment_details.dart';
import '../expandable_SOAP_widget.dart';
class UpdateAssessmentPage extends StatefulWidget {
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/helpers.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/app-textfield-custom.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_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'SOAP_step_header.dart';
@ -268,7 +264,6 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
color: Colors.grey[300],
fontColor: Colors.black,
fontWeight: FontWeight.w600,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
setState(() {
widget.changePageViewIndex(2);
@ -285,23 +280,34 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
loading: model.state == ViewState.BusyLocal,
disabled: progressNoteController.text.isEmpty,
onPressed: () async {
if(isAddProgress) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
setState(() {
widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName ?? doctorProfile.doctorName;
widget.patientProgressNote.editedByName = doctorProfile.doctorName;
widget.patientProgressNote.createdOn = DateTime.now().toString();
widget.patientProgressNote.planNote = progressNoteController.text;
isAddProgress = !isAddProgress;
});
submitPlan(model);
} else{
Navigator.of(context).pop();
}
},
if (progressNoteController.text.isNotEmpty) {
if (isAddProgress) {
Map profile =
await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile =
DoctorProfileModel.fromJson(profile);
setState(() {
widget.patientProgressNote.createdByName =
widget.patientProgressNote
.createdByName ??
doctorProfile.doctorName;
widget.patientProgressNote.editedByName =
doctorProfile.doctorName;
widget.patientProgressNote.createdOn =
DateTime.now().toString();
widget.patientProgressNote.planNote =
progressNoteController.text;
isAddProgress = !isAddProgress;
});
submitPlan(model);
} else {
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/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/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/shared/app_scaffold_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)
InkWell(
onTap: () {
Navigator.of(context).pushNamed(PROFILE, arguments: {
'title': authProvider.doctorProfile.doctorName,
"doctorProfileall": authProvider.doctorProfile
});
// TODO: return it back when its needed
// Navigator.of(context).pushNamed(PROFILE, arguments: {
// 'title': authProvider.doctorProfile.doctorName,
// "doctorProfileall": authProvider.doctorProfile
// });
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

@ -38,9 +38,13 @@ class NetworkBaseView extends StatelessWidget {
children: [
SizedBox(height: 100,),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(baseViewModel.error??''),
Center(
child: Center(
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