merge-requests/277/head
Sultan Khan 5 years ago
commit ed3b42d721

@ -29,7 +29,7 @@ const Map<String, Map<String, String>> localizedValues = {
'en': 'Answer/Suggestions', 'en': 'Answer/Suggestions',
'ar': 'ملاحضات وتفاصيل العيادة' 'ar': 'ملاحضات وتفاصيل العيادة'
}, },
'outPatients': {'en': 'Out-Patients', 'ar': 'ةالمريض الخارجي'}, 'outPatients': {'en': 'Out-Patients', 'ar': 'المريض الخارجي'},
'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'}, 'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'},
'searchAbout': {'en': 'Search', 'ar': 'البحث عن'}, 'searchAbout': {'en': 'Search', 'ar': 'البحث عن'},
'patient': {'en': 'Patient', 'ar': ' مريض'}, 'patient': {'en': 'Patient', 'ar': ' مريض'},
@ -37,19 +37,19 @@ const Map<String, Map<String, String>> localizedValues = {
'lab': {'en': 'Lab', 'ar': 'المختبر'}, 'lab': {'en': 'Lab', 'ar': 'المختبر'},
'result': {'en': 'Result', 'ar': 'نتيجة'}, 'result': {'en': 'Result', 'ar': 'نتيجة'},
'todayStatistics': {'en': 'Today Statistics', 'ar': 'إحصائيات اليوم'}, 'todayStatistics': {'en': 'Today Statistics', 'ar': 'إحصائيات اليوم'},
'arrived': {'en': 'Arrived', 'ar': 'وصل'}, 'arrived': {'en': 'Arrival Patients', 'ar': ' المرضى الواصلين'},
'er': {'en': 'ER', 'ar': 'حالة طوارئ'}, 'er': {'en': 'ER', 'ar': 'حالة طوارئ'},
'walkIn': {'en': 'Walk-in', 'ar': 'ادخل'}, 'walkIn': {'en': 'Walk-in', 'ar': 'ادخل'},
'notArrived': {'en': 'Not Arrived', 'ar': 'لم يصل'}, 'notArrived': {'en': 'Not Arrived', 'ar': 'لم يصل'},
'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'},
'service': {'en': 'Service', 'ar': 'خدمة'}, 'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'االإحالة'}, 'referral': {'en': 'Referral', 'ar': 'االإحالة'},
'inPatient': {'en': 'In-Patient', 'ar': 'االمريض الداخلي'}, 'inPatient': {'en': 'In-Patient', 'ar': 'المريض الداخلي'},
'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'},
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, 'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'},
'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'},
'referPatient': {'en': 'Refer Patient', 'ar': 'إحالة مريض'}, 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'},
'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'},
'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'}, 'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'},
'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'}, 'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'},
@ -215,7 +215,7 @@ const Map<String, Map<String, String>> localizedValues = {
'en': 'Please fill all fields..!', 'en': 'Please fill all fields..!',
'ar': 'الرجاء ملأ جميع الحقول..!' 'ar': 'الرجاء ملأ جميع الحقول..!'
}, },
'replay2': {'en': 'Replay', 'ar': 'رد الطبيب'}, 'replay2': {'en': 'Reply', 'ar': 'رد الطبيب'},
'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'},
'pharmaciesList': {'en': 'Pharmacies List', 'ar': 'قائمة الصيدليات'}, 'pharmaciesList': {'en': 'Pharmacies List', 'ar': 'قائمة الصيدليات'},
'price': {'en': 'Price', 'ar': 'السعر'}, 'price': {'en': 'Price', 'ar': 'السعر'},
@ -666,4 +666,16 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "You have to add chief complaint fields correctly .", 'en': "You have to add chief complaint fields correctly .",
'ar': "يجب عليك إضافة حقول شكوى الرئيس بشكل صحيح" 'ar': "يجب عليك إضافة حقول شكوى الرئيس بشكل صحيح"
}, },
'referralStatus': {
'en': "Referral Status : ",
'ar': "حالة الإحالة :"
},
'referralRemark': {
'en': "Referral Remark : ",
'ar': "ملاحظة الإحالة :"
},
'ICDName': {
'en': "ICDName",
'ar': "اسم ال ICD"
},
}; };

@ -0,0 +1,18 @@
class Controls {
String code;
String controlValue;
Controls({this.code, this.controlValue});
Controls.fromJson(Map<String, dynamic> json) {
code = json['Code'];
controlValue = json['ControlValue'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Code'] = this.code;
data['ControlValue'] = this.controlValue;
return data;
}
}

@ -1,3 +1,5 @@
import 'ControlsModel.dart';
class PostProcedureReqModel { class PostProcedureReqModel {
int patientMRN; int patientMRN;
int appointmentNo; int appointmentNo;
@ -66,22 +68,3 @@ class Procedures {
return data; return data;
} }
} }
class Controls {
String code;
String controlValue;
Controls({this.code, this.controlValue});
Controls.fromJson(Map<String, dynamic> json) {
code = json['Code'];
controlValue = json['ControlValue'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Code'] = this.code;
data['ControlValue'] = this.controlValue;
return data;
}
}

@ -0,0 +1,75 @@
import 'ControlsModel.dart';
class UpdateProcedureRequestModel {
int orderNo;
int patientMRN;
int appointmentNo;
int episodeID;
int lineItemNo;
ProcedureDetail procedureDetail;
String vidaAuthTokenID;
UpdateProcedureRequestModel(
{this.orderNo,
this.patientMRN,
this.appointmentNo,
this.episodeID,
this.lineItemNo,
this.procedureDetail,
this.vidaAuthTokenID});
UpdateProcedureRequestModel.fromJson(Map<String, dynamic> json) {
orderNo = json['OrderNo'];
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeID = json['EpisodeID'];
lineItemNo = json['LineItemNo'];
procedureDetail = json['procedureDetail'] != null
? new ProcedureDetail.fromJson(json['procedureDetail'])
: null;
vidaAuthTokenID = json['VidaAuthTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['OrderNo'] = this.orderNo;
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeID;
data['LineItemNo'] = this.lineItemNo;
if (this.procedureDetail != null) {
data['procedureDetail'] = this.procedureDetail.toJson();
}
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
return data;
}
}
class ProcedureDetail {
String procedure;
String category;
List<Controls> controls;
ProcedureDetail({this.procedure, this.category, this.controls});
ProcedureDetail.fromJson(Map<String, dynamic> json) {
procedure = json['Procedure'];
category = json['Category'];
if (json['Controls'] != null) {
controls = new List<Controls>();
json['Controls'].forEach((v) {
controls.add(new Controls.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Procedure'] = this.procedure;
data['Category'] = this.category;
if (this.controls != null) {
data['Controls'] = this.controls.map((v) => v.toJson()).toList();
}
return data;
}
}

@ -24,11 +24,7 @@ class PrescriptionService extends BaseService {
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel();
SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel(
//search: ["Acetaminophen"], //search: ["Acetaminophen"],
// vidaAuthTokenID:
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio",
search: ["Amoxicillin"], search: ["Amoxicillin"],
//vidaAuthTokenID:
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio",
); );
PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel _postPrescriptionReqModel =

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_re
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
@ -104,7 +105,8 @@ class ProcedureService extends BaseService {
}, body: postProcedureReqModel.toJson()); }, body: postProcedureReqModel.toJson());
} }
Future updateProcedure(PostProcedureReqModel postProcedureReqModel) async { Future updateProcedure(
UpdateProcedureRequestModel updateProcedureRequestModel) async {
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post(UPDATE_PROCEDURE, await baseAppClient.post(UPDATE_PROCEDURE,
@ -113,6 +115,6 @@ class ProcedureService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: postProcedureReqModel.toJson()); }, body: updateProcedureRequestModel.toJson());
} }
} }

@ -131,7 +131,7 @@ class PatientReferralViewModel extends BaseViewModel {
await _referralPatientService.responseReferral(pendingReferral, isAccepted); await _referralPatientService.responseReferral(pendingReferral, isAccepted);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import '../../locator.dart'; import '../../locator.dart';
@ -13,7 +14,9 @@ class VitalSignsViewModel extends BaseViewModel {
VitalSignsService _vitalSignService = locator<VitalSignsService>(); VitalSignsService _vitalSignService = locator<VitalSignsService>();
VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns;
List<VitalSignHistory> get patientVitalSignsHistory => _vitalSignService.patientVitalSignsHistory;
List<VitalSignHistory> get patientVitalSignsHistory =>
_vitalSignService.patientVitalSignsHistory;
String heightCm = "0"; String heightCm = "0";
String weightKg = "0"; String weightKg = "0";
@ -34,8 +37,16 @@ class VitalSignsViewModel extends BaseViewModel {
} }
} }
Future getPatientVitalSignHistory(PatiantInformtion patient, String from, String to) async { Future getPatientVitalSignHistory(
PatiantInformtion patient, String from, String to) async {
setState(ViewState.Busy); setState(ViewState.Busy);
if (from == null || from == "0") {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
if (to == null || to == "0") {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); await _vitalSignService.getPatientVitalSignsHistory(patient, from, to);
if (_vitalSignService.hasError) { if (_vitalSignService.hasError) {
error = _vitalSignService.error; error = _vitalSignService.error;
@ -48,9 +59,7 @@ class VitalSignsViewModel extends BaseViewModel {
if (weightKg == "0" || weightKg == null || weightKg == 'null') { if (weightKg == "0" || weightKg == null || weightKg == 'null') {
weightKg = element.weightKg.toString(); weightKg = element.weightKg.toString();
} }
if (bodyMax == "0" || if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') {
bodyMax == null ||
bodyMax == 'null') {
bodyMax = element.bodyMassIndex.toString(); bodyMax = element.bodyMassIndex.toString();
} }
if (temperatureCelcius == "0" || if (temperatureCelcius == "0" ||
@ -84,24 +93,24 @@ class VitalSignsViewModel extends BaseViewModel {
return "Normal"; return "Normal";
} else if (bodyMassIndex <= 30) { } else if (bodyMassIndex <= 30) {
return "Overweight"; return "Overweight";
} else { // > 30.0 } else {
// > 30.0
return "Obese"; return "Obese";
} }
} }
String getTempratureMethod(int temperatureCelciusMethod){ String getTempratureMethod(int temperatureCelciusMethod) {
// temperatureCelciusMethod ( vital sign response field )- master 2005 // temperatureCelciusMethod ( vital sign response field )- master 2005
if(temperatureCelciusMethod == 1){ if (temperatureCelciusMethod == 1) {
return "Oral"; return "Oral";
} else if(temperatureCelciusMethod == 2){ } else if (temperatureCelciusMethod == 2) {
return "Axilla"; return "Axilla";
} else if(temperatureCelciusMethod == 3){ } else if (temperatureCelciusMethod == 3) {
return "Rectal"; return "Rectal";
} else if(temperatureCelciusMethod == 4){ } else if (temperatureCelciusMethod == 4) {
return "Tympanic"; return "Tympanic";
} else if(temperatureCelciusMethod == 5){ } else if (temperatureCelciusMethod == 5) {
return "Temporal"; return "Temporal";
} }
} }
} }

@ -49,18 +49,22 @@ class PatientViewModel extends BaseViewModel {
_patientService.referalFrequancyList; _patientService.referalFrequancyList;
Future getPatientList(patient, patientType, Future getPatientList(patient, patientType,
{bool isBusyLocal = false}) async { {bool isBusyLocal = false}) async {
var localRes ;
if (isBusyLocal) { if (isBusyLocal) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
localRes = await _patientService.getPatientList(patient, patientType);
if (_patientService.hasError) { if (_patientService.hasError) {
error = _patientService.error; error = _patientService.error;
setState(ViewState.Error); setState(ViewState.Error);
} }
return _patientService.getPatientList(patient, patientType); return localRes;
} }

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dar
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart';
import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
@ -61,7 +62,6 @@ class ProcedureViewModel extends BaseViewModel {
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
await getProcedure(mrn: mrn);
} else { } else {
await getProcedure(mrn: mrn); await getProcedure(mrn: mrn);
setState(ViewState.Idle); setState(ViewState.Idle);
@ -69,16 +69,17 @@ class ProcedureViewModel extends BaseViewModel {
} }
Future updateProcedure( Future updateProcedure(
{PostProcedureReqModel postProcedureReqModel, int mrn}) async { {UpdateProcedureRequestModel updateProcedureRequestModel,
int mrn}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.updateProcedure(postProcedureReqModel); await _procedureService.updateProcedure(updateProcedureRequestModel);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
await getProcedure(mrn: mrn); // await getProcedure(mrn: mrn);
} }
} }

@ -33,8 +33,8 @@ class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ChangeNotifierProvider<T>( return ChangeNotifierProvider<T>.value(
create: (BuildContext context) => model, value: model,
child: Consumer<T>(builder: widget.builder), child: Consumer<T>(builder: widget.builder),
); );
} }

@ -141,16 +141,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row(
children: <Widget>[
AppText(
TranslationBase.of(context).welcome,
fontSize:
SizeConfig.textMultiplier * 1.7,
color: Colors.white,
)
],
),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
@ -1201,8 +1191,8 @@ class DashboardItem extends StatelessWidget {
height: height != null height: height != null
? height ? height
: MediaQuery.of(context).orientation == Orientation.portrait : MediaQuery.of(context).orientation == Orientation.portrait
? MediaQuery.of(context).size.height * 0.19 ? MediaQuery.of(context).size.height * 0.20
: MediaQuery.of(context).size.height * 0.35, : MediaQuery.of(context).size.height * 0.36,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !hasBorder color: !hasBorder
? color != null ? color != null

@ -41,97 +41,109 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
thickness: 1.0, thickness: 1.0,
color: Colors.grey, color: Colors.grey,
), ),
if (model.medicalFileList.length != 0) (model.medicalFileList.length != 0 &&
ListView.builder( model.medicalFileList != null)
//physics: , ? ListView.builder(
physics: NeverScrollableScrollPhysics(), //physics: ,
scrollDirection: Axis.vertical, physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, scrollDirection: Axis.vertical,
itemCount: model shrinkWrap: true,
.medicalFileList[0].entityList[0].timelines.length, itemCount: model.medicalFileList[0].entityList[0]
itemBuilder: (BuildContext ctxt, int index) { .timelines.length,
return Padding( itemBuilder: (BuildContext ctxt, int index) {
padding: EdgeInsets.symmetric( return Padding(
horizontal: 12.0, vertical: 8.0), padding: EdgeInsets.symmetric(
child: InkWell( horizontal: 12.0, vertical: 8.0),
child: Container( child: InkWell(
child: Column( child: Container(
children: [ child: Column(
Row( children: [
children: [ Row(
AppText( children: [
TranslationBase.of(context).branch + AppText(
": ", TranslationBase.of(context).branch +
fontWeight: FontWeight.w700, ": ",
), fontWeight: FontWeight.w700,
AppText(model ),
.medicalFileList[0] AppText(model
.entityList[0] .medicalFileList[0]
.timelines[index] .entityList[0]
.projectName), .timelines[index]
], .projectName),
), ],
Row( ),
children: [ Row(
AppText( children: [
TranslationBase.of(context) AppText(
.doctorName TranslationBase.of(context)
.toUpperCase() + .doctorName
": ", .toUpperCase() +
fontWeight: FontWeight.w700, ": ",
), fontWeight: FontWeight.w700,
Expanded( ),
child: AppText( Expanded(
child: AppText(
model
.medicalFileList[0]
.entityList[0]
.timelines[index]
.doctorName,
fontWeight: FontWeight.w700,
),
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context)
.clinicName +
": ",
fontWeight: FontWeight.w700,
),
AppText(
model model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[index] .timelines[index]
.doctorName, .clinicName,
fontWeight: FontWeight.w700,
), ),
), ],
], ),
), SizedBox(height: 10.0),
Row( Divider(
children: [ height: 1.0,
AppText( thickness: 1.0,
TranslationBase.of(context) color: Colors.grey.shade400,
.clinicName + )
": ", ],
fontWeight: FontWeight.w700, ),
),
AppText(
model.medicalFileList[0].entityList[0]
.timelines[index].clinicName,
),
],
),
SizedBox(height: 10.0),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey.shade400,
)
],
), ),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
MedicalFileDetails(
age: patient.age,
firstName: patient.firstName,
lastName: patient.lastName,
gender: patient.genderDescription,
encounterNumber: index,
pp: patient.patientMRN,
)),
);
},
), ),
onTap: () { );
Navigator.push( })
context, : Center(
MaterialPageRoute( child: Container(
builder: (context) => MedicalFileDetails( child: AppText(
age: patient.age, 'THERES NO MEDICAL FILE FOR THIS Patient',
firstName: patient.firstName,
lastName: patient.lastName,
gender: patient.genderDescription,
encounterNumber: index,
pp: patient.patientMRN,
)),
);
},
), ),
); ),
}) )
], ],
), ),
), ),

@ -44,6 +44,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
bool _autoValidate = false; bool _autoValidate = false;
bool onlyArrived = true; bool onlyArrived = true;
bool isFormSubmitted = false;
var _patientSearchFormValues = PatientModel( var _patientSearchFormValues = PatientModel(
FirstName: "0", FirstName: "0",
MiddleName: "0", MiddleName: "0",
@ -64,7 +66,9 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
PatientOutSA: false); PatientOutSA: false);
void _validateInputs() async { void _validateInputs() async {
setState(() {
isFormSubmitted = true;
});
try { try {
if (_formKey.currentState.validate()) { if (_formKey.currentState.validate()) {
@ -72,9 +76,14 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
if ((_patientSearchFormValues.From == "0" || if ((_patientSearchFormValues.From == "0" ||
_patientSearchFormValues.To == "0") && _patientSearchFormValues.To == "0") &&
_selectedType == "7") { _selectedType == "7" || ((_patientSearchFormValues.From == "0" ||
helpers.showErrorToast("Please Choose The Dates"); _patientSearchFormValues.To == "0") &&
_selectedType == "6") ) {
// helpers.showErrorToast("Please Choose The Dates");
} else { } else {
setState(() {
isFormSubmitted = false;
});
Navigator.of(context).pushNamed(PATIENTS, arguments: { Navigator.of(context).pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues, "patientSearchForm": _patientSearchFormValues,
"selectedType": _selectedType "selectedType": _selectedType
@ -112,7 +121,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
children: <Widget>[ children: <Widget>[
Container( Container(
child: Icon( child: Icon(
DoctorApp.search_patient, DoctorApp.search_patient_1,
size: 100, size: 100,
color: Colors.black, color: Colors.black,
), ),
@ -403,7 +412,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
), ),
), ),
(!(_selectedType == '2' || _selectedType == '4')) (!(_selectedType == '2' || _selectedType == '4'))
? DynamicElements(_patientSearchFormValues) ? DynamicElements(_patientSearchFormValues, isFormSubmitted)
: SizedBox( : SizedBox(
height: 0, height: 0,
), ),

@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; 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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
@ -273,7 +274,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
patientType) patientType)
.then((res) { .then((res) {
setState(() { setState(() {
_isLoading = false;
if (res != null && res['MessageStatus'] == 1) { if (res != null && res['MessageStatus'] == 1) {
if (val2 == 7) { if (val2 == 7) {
@ -302,10 +303,13 @@ class _PatientsScreenState extends State<PatientsScreen> {
responseModelList = new ModelResponse.fromJson(parsed).list; responseModelList = new ModelResponse.fromJson(parsed).list;
responseModelList2 = responseModelList; responseModelList2 = responseModelList;
_isError = false; _isError = false;
} else { } else {
_isError = true; _isError = true;
error = model.error; //res['ErrorEndUserMessage'] ?? res['ErrorMessage']; error = model.error??res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
} }
_isLoading = false;
}); });
}).catchError((error) { }).catchError((error) {
setState(() { setState(() {
@ -612,9 +616,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
.white, .white,
), ),
AppText( AppText(
item " ${DateUtils.getAgeByBirthday(item.dateofBirth)}",
.age
.toString(),
fontSize: 1.8 * fontSize: 1.8 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,

@ -117,6 +117,12 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
marginBottom: 5, marginBottom: 5,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
AppText(
notesList[index]
["AdmissionNo"],
marginLeft: 10,
color: Colors.grey[600],
),
AppText( AppText(
convertDateFormat( convertDateFormat(
notesList[index] notesList[index]
@ -128,18 +134,24 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
), ),
), ),
children: <Widget>[ children: <Widget>[
Divider( Divider(
color: Colors.black, color: Colors.black,
height: 20, height: 20,
thickness: 1, thickness: 1,
indent: 0, indent: 0,
endIndent: 0, endIndent: 0,
), ),
AppText( Row(
notesList[index]["Notes"], mainAxisAlignment:
margin: 5, MainAxisAlignment.start,
) children: [
], AppText(
notesList[index]["Notes"],
margin: 5,
),
],
)
],
), ),
], ],
)); ));

@ -1,9 +1,11 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; 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/dr_app_toast_msg.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/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
@ -144,8 +146,11 @@ class MyReferralDetailScreen extends StatelessWidget {
fontSize: 16, fontSize: 16,
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
handler: () { handler: () async {
model.responseReferral(pendingReferral, true); await model.responseReferral(pendingReferral, true);
if(model.state == ViewState.ErrorLocal){
DrAppToastMsg.showErrorToast(model.error);
}
}, },
), ),
), ),
@ -160,8 +165,11 @@ class MyReferralDetailScreen extends StatelessWidget {
fontSize: 16, fontSize: 16,
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
handler: () { handler: () async {
model.responseReferral(pendingReferral, false); await model.responseReferral(pendingReferral, true);
if(model.state == ViewState.ErrorLocal){
DrAppToastMsg.showErrorToast(model.error);
}
}, },
), ),
), ),

@ -1,6 +1,5 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart';
@ -8,29 +7,22 @@ import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/drugtodrug.dart'; import 'package:doctor_app_flutter/screens/prescription/drugtodrug.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.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/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/dynamic_elements.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/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.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_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart'; import 'package:flutter/services.dart';
addPrescriptionForm(context, PrescriptionViewModel model, addPrescriptionForm(context, PrescriptionViewModel model,
PatiantInformtion patient, prescription) { PatiantInformtion patient, prescription) {
@ -110,6 +102,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TextEditingController instructionController = TextEditingController(); TextEditingController instructionController = TextEditingController();
DateTime selectedDate; DateTime selectedDate;
dynamic selectedDrug; dynamic selectedDrug;
int strengthChar;
GetMedicationResponseModel _selectedMedication; GetMedicationResponseModel _selectedMedication;
GlobalKey key = GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>(); new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
@ -198,14 +191,25 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
dynamic route25 = {"id": 37, "name": "Inserted into Vagina"}; dynamic route25 = {"id": 37, "name": "Inserted into Vagina"};
dynamic route26 = {"id": 36, "name": "Inserted into Rectum"}; dynamic route26 = {"id": 36, "name": "Inserted into Rectum"};
dynamic route27 = {"id": 31, "name": "In Each Nostril"}; dynamic route27 = {"id": 31, "name": "In Each Nostril"};
dynamic frequency1 = {"id": 1, "name": "2 Times a day"}; dynamic frequency1 = {"id": 2, "name": "2 Times a day"};
dynamic frequency2 = {"id": 2, "name": "3 Times a day"}; dynamic frequency2 = {"id": 3, "name": "3 Times a day"};
dynamic frequency3 = {"id": 3, "name": "4 Times a day"}; dynamic frequency3 = {"id": 4, "name": "4 Times a day"};
dynamic frequency4 = {"id": 8, "name": "As Needed"}; dynamic frequency4 = {"id": 8, "name": "As Needed"};
dynamic frequency5 = {"id": 9, "name": "Bed Time"}; dynamic frequency5 = {"id": 9, "name": "Bed Time"};
dynamic frequency6 = {"id": 11, "name": "Every Other Day"}; dynamic frequency6 = {"id": 11, "name": "Every Other Day"};
dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"}; dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"};
dynamic frequency8 = {"id": 34, "name": "As Directed"}; dynamic frequency8 = {"id": 34, "name": "As Directed"};
dynamic frequency9 = {"id": 22, "name": "Once Per Month"};
dynamic frequency10 = {"id": 2, "name": "3 Times a day"};
dynamic frequency11 = {"id": 21, "name": "Every 3 hours"};
dynamic frequency12 = {"id": 20, "name": "Once a Week"};
dynamic frequency13 = {"id": 12, "name": "Every Half Hour"};
dynamic frequency14 = {"id": 10, "name": "4 Times a Day"};
dynamic frequency15 = {"id": 24, "name": "Once Every 2 Months"};
dynamic frequency16 = {"id": 25, "name": "Every One Hour"};
dynamic frequency17 = {"id": 26, "name": "Every Two Hours"};
dynamic frequency18 = {"id": 28, "name": "Every Six Hours"};
dynamic duration1 = {"id": 1, "name": "For 1 Day"}; dynamic duration1 = {"id": 1, "name": "For 1 Day"};
dynamic duration2 = {"id": 2, "name": "For 2 Days"}; dynamic duration2 = {"id": 2, "name": "For 2 Days"};
dynamic duration3 = {"id": 3, "name": "For 3 Days"}; dynamic duration3 = {"id": 3, "name": "For 3 Days"};
@ -234,6 +238,15 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
dynamic doseTime10 = {"id": 10, "name": "While wake"}; dynamic doseTime10 = {"id": 10, "name": "While wake"};
dynamic doseTime11 = {"id": 12, "name": "Any Time"}; dynamic doseTime11 = {"id": 12, "name": "Any Time"};
dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; dynamic doseTime12 = {"id": 21, "name": "Bed Time"};
dynamic doseTime13 = {"id": 13, "name": "30 Minutes Before Meals"};
dynamic doseTime14 = {"id": 14, "name": "1 Hour Before Meals"};
dynamic doseTime15 = {"id": 15, "name": "2 Hours After Meal"};
dynamic doseTime16 = {"id": 16, "name": "After Breakfast"};
dynamic doseTime17 = {"id": 17, "name": "Before Lunch"};
dynamic doseTime18 = {"id": 18, "name": "After Lunch"};
dynamic doseTime19 = {"id": 20, "name": "After Dinner"};
dynamic doseTime20 = {"id": 21, "name": "Bed Time"};
dynamic doseTime21 = {"id": 11, "name": "Now"};
dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"};
dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"};
dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; dynamic indication3 = {"id": 547, "name": "Hypertrichosis"};
@ -273,6 +286,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
doseTimeList.add(doseTime9); doseTimeList.add(doseTime9);
doseTimeList.add(doseTime10); doseTimeList.add(doseTime10);
doseTimeList.add(doseTime11); doseTimeList.add(doseTime11);
doseTimeList.add(doseTime12);
doseTimeList.add(doseTime13);
doseTimeList.add(doseTime14);
doseTimeList.add(doseTime15);
doseTimeList.add(doseTime16);
doseTimeList.add(doseTime17);
doseTimeList.add(doseTime18);
doseTimeList.add(doseTime19);
doseTimeList.add(doseTime20);
doseTimeList.add(doseTime21);
doseTimeList.add(doseTime12); doseTimeList.add(doseTime12);
frequencyList.add(frequency1); frequencyList.add(frequency1);
frequencyList.add(frequency2); frequencyList.add(frequency2);
@ -282,6 +306,16 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
frequencyList.add(frequency6); frequencyList.add(frequency6);
frequencyList.add(frequency7); frequencyList.add(frequency7);
frequencyList.add(frequency8); frequencyList.add(frequency8);
frequencyList.add(frequency9);
frequencyList.add(frequency10);
frequencyList.add(frequency11);
frequencyList.add(frequency12);
frequencyList.add(frequency13);
frequencyList.add(frequency14);
frequencyList.add(frequency15);
frequencyList.add(frequency16);
frequencyList.add(frequency17);
frequencyList.add(frequency18);
routeList.add(route1); routeList.add(route1);
routeList.add(route2); routeList.add(route2);
routeList.add(route3); routeList.add(route3);
@ -484,46 +518,6 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
], ],
), ),
), ),
// Container(
// height: screenSize.height * 0.070,
// child: InkWell(
// onTap: referToList != null
// ? () {
// ListSelectDialog dialog =
// ListSelectDialog(
// list: referToList,
// attributeName: 'name',
// attributeValueId: 'id',
// okText:
// TranslationBase.of(context)
// .ok,
// okFunction: (selectedValue) {
// setState(() {
// type = selectedValue;
// _selectedBranch = null;
// });
// },
// );
// showDialog(
// barrierDismissible: false,
// context: context,
// builder:
// (BuildContext context) {
// return dialog;
// },
// );
// }
// : null,
// child: TextField(
// decoration: textFieldSelectorDecoration(
// TranslationBase.of(context)
// .orderType,
// type != null ? type['name'] : null,
// true),
// enabled: false,
// ),
// ),
// ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
@ -533,21 +527,33 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
width: width:
MediaQuery.of(context).size.width * MediaQuery.of(context).size.width *
0.650, 0.550,
child: TextFields( child: TextFields(
inputFormatters: [
LengthLimitingTextInputFormatter(4)
],
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context)
.strength, .strength,
controller: strengthController, controller: strengthController,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
validator: (value) { onChanged: (String value) {
if (value.isEmpty && setState(() {
strengthController.text.length > strengthChar = value.length;
4) });
return TranslationBase.of(context) if (strengthChar >= 4) {
.emptyMessage; DrAppToastMsg.showErrorToast(
else "Only 4 Digits allowed for strength");
return null; }
}, },
// validator: (value) {
// if (value.isEmpty &&
// strengthController.text.length >
// 4)
// return TranslationBase.of(context)
// .emptyMessage;
// else
// return null;
// },
), ),
), ),
SizedBox( SizedBox(
@ -556,7 +562,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
width: width:
MediaQuery.of(context).size.width * MediaQuery.of(context).size.width *
0.250, 0.350,
child: InkWell( child: InkWell(
onTap: unitsList != null onTap: unitsList != null
? () { ? () {
@ -863,15 +869,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// formKey.currentState.save(); // formKey.currentState.save();
// Navigator.pop(context); // Navigator.pop(context);
// openDrugToDrug(); // openDrugToDrug();
if (strength == null || if (route == null ||
route == null ||
frequency == null || frequency == null ||
indication == null || indication == null ||
doseTime == null || doseTime == null ||
duration == null || duration == null ||
selectedDate == null || selectedDate == null ||
units == null || units == null) {
_selectedMedication == null) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
"Please Fill All Fields"); "Please Fill All Fields");
return; return;
@ -1023,41 +1027,4 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
); );
}); });
} }
// searchData(String str, PrescriptionViewModel model) {
// var strExist = str.length > 0 ? true : false;
//
// if (strExist) {
// filteredNotesList = null;
// filteredNotesList = model.drugsList
// .where((note) =>
// note["GenericName"].toString().contains(str.toUpperCase()))
// .toList();
// setState(() {
// notesList = filteredNotesList;
// });
// } else {
// setState(() {
// notesList = model.drugsList;
// });
// }
// }
searchMedicine(context, PrescriptionViewModel model, String str) async {
FocusScope.of(context).unfocus();
// if (searchController.text.isEmpty()) {
// helpers.showErrorToast(TranslationBase.of(context).typeMedicineName);
// //"Type Medicine Name")
// return;
// }
if (searchController.text.length < 0) {
helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter);
return;
}
GifLoaderDialogUtils.showMyDialog(context);
await model.getDrugs(drugName: searchController.text);
GifLoaderDialogUtils.hideDialog(context);
}
} }

@ -22,6 +22,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class NewPrescriptionScreen extends StatefulWidget { class NewPrescriptionScreen extends StatefulWidget {
@ -32,15 +33,21 @@ class NewPrescriptionScreen extends StatefulWidget {
class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> { class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
PersistentBottomSheetController _controller; PersistentBottomSheetController _controller;
final _scaffoldKey = GlobalKey<ScaffoldState>(); final _scaffoldKey = GlobalKey<ScaffoldState>();
TextEditingController strengthController = TextEditingController();
int testNum = 0; int testNum = 0;
int strengthChar;
PatiantInformtion patient; PatiantInformtion patient;
dynamic route; dynamic route;
dynamic doseTime; dynamic doseTime;
dynamic frequencyUpdate; dynamic frequencyUpdate;
dynamic updatedDuration;
dynamic units;
List<dynamic> doseTimeList; List<dynamic> doseTimeList;
List<dynamic> routeList; List<dynamic> routeList;
List<dynamic> frequencyList; List<dynamic> frequencyList;
List<dynamic> durationList;
List<dynamic> unitsList;
@override @override
void initState() { void initState() {
@ -48,15 +55,30 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
routeList = List(); routeList = List();
doseTimeList = List(); doseTimeList = List();
frequencyList = List(); frequencyList = List();
durationList = List();
unitsList = List();
dynamic frequency1 = {"id": 1, "name": "2 Times a day"}; dynamic unit1 = {"id": 1, "name": "MG"};
dynamic frequency2 = {"id": 2, "name": "3 Times a day"}; dynamic unit2 = {"id": 2, "name": "MCG"};
dynamic frequency3 = {"id": 3, "name": "4 Times a day"}; dynamic unit3 = {"id": 3, "name": "GM"};
dynamic frequency1 = {"id": 2, "name": "2 Times a day"};
dynamic frequency2 = {"id": 3, "name": "3 Times a day"};
dynamic frequency3 = {"id": 4, "name": "4 Times a day"};
dynamic frequency4 = {"id": 8, "name": "As Needed"}; dynamic frequency4 = {"id": 8, "name": "As Needed"};
dynamic frequency5 = {"id": 9, "name": "Bed Time"}; dynamic frequency5 = {"id": 9, "name": "Bed Time"};
dynamic frequency6 = {"id": 11, "name": "Every Other Day"}; dynamic frequency6 = {"id": 11, "name": "Every Other Day"};
dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"}; dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"};
dynamic frequency8 = {"id": 34, "name": "As Directed"}; dynamic frequency8 = {"id": 34, "name": "As Directed"};
dynamic frequency9 = {"id": 22, "name": "Once Per Month"};
dynamic frequency10 = {"id": 2, "name": "3 Times a day"};
dynamic frequency11 = {"id": 21, "name": "Every 3 hours"};
dynamic frequency12 = {"id": 20, "name": "Once a Week"};
dynamic frequency13 = {"id": 12, "name": "Every Half Hour"};
dynamic frequency14 = {"id": 10, "name": "4 Times a Day"};
dynamic frequency15 = {"id": 24, "name": "Once Every 2 Months"};
dynamic frequency16 = {"id": 25, "name": "Every One Hour"};
dynamic frequency17 = {"id": 26, "name": "Every Two Hours"};
dynamic frequency18 = {"id": 28, "name": "Every Six Hours"};
dynamic doseTime1 = {"id": 1, "name": "Before Meals"}; dynamic doseTime1 = {"id": 1, "name": "Before Meals"};
dynamic doseTime2 = {"id": 2, "name": "After Meals"}; dynamic doseTime2 = {"id": 2, "name": "After Meals"};
dynamic doseTime3 = {"id": 3, "name": "With Meals"}; dynamic doseTime3 = {"id": 3, "name": "With Meals"};
@ -69,6 +91,15 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
dynamic doseTime10 = {"id": 10, "name": "While wake"}; dynamic doseTime10 = {"id": 10, "name": "While wake"};
dynamic doseTime11 = {"id": 12, "name": "Any Time"}; dynamic doseTime11 = {"id": 12, "name": "Any Time"};
dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; dynamic doseTime12 = {"id": 21, "name": "Bed Time"};
dynamic doseTime13 = {"id": 13, "name": "30 Minutes Before Meals"};
dynamic doseTime14 = {"id": 14, "name": "1 Hour Before Meals"};
dynamic doseTime15 = {"id": 15, "name": "2 Hours After Meal"};
dynamic doseTime16 = {"id": 16, "name": "After Breakfast"};
dynamic doseTime17 = {"id": 17, "name": "Before Lunch"};
dynamic doseTime18 = {"id": 18, "name": "After Lunch"};
dynamic doseTime19 = {"id": 20, "name": "After Dinner"};
dynamic doseTime20 = {"id": 21, "name": "Bed Time"};
dynamic doseTime21 = {"id": 11, "name": "Now"};
dynamic route1 = {"id": 7, "name": "By Mouth"}; dynamic route1 = {"id": 7, "name": "By Mouth"};
dynamic route2 = {"id": 10, "name": "Inhale by Mouth"}; dynamic route2 = {"id": 10, "name": "Inhale by Mouth"};
dynamic route3 = {"id": 15, "name": "for INJECTION"}; dynamic route3 = {"id": 15, "name": "for INJECTION"};
@ -78,7 +109,57 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
dynamic route7 = {"id": 27, "name": "In Both EYES"}; dynamic route7 = {"id": 27, "name": "In Both EYES"};
dynamic route8 = {"id": 28, "name": "In Both Ears"}; dynamic route8 = {"id": 28, "name": "In Both Ears"};
dynamic route9 = {"id": 32, "name": "Intramuscular"}; dynamic route9 = {"id": 32, "name": "Intramuscular"};
dynamic route10 = {"id": 60, "name": "TRANSDERMAL"};
dynamic route11 = {"id": 59, "name": "OROPHARYNGEAL"};
dynamic route12 = {"id": 15, "name": "for INJECTION"};
dynamic route13 = {"id": 58, "name": "SUBCUTANEOUS"};
dynamic route14 = {"id": 57, "name": "NASOGASTRIC"};
dynamic route15 = {"id": 56, "name": "IRRIGATION"};
dynamic route16 = {"id": 55, "name": "INTRAVITREAL"};
dynamic route17 = {"id": 54, "name": "INTRAVENOUS BOLUS"};
dynamic route18 = {"id": 51, "name": "EPIDURAL"};
dynamic route19 = {"id": 47, "name": "Parenteral"};
dynamic route20 = {"id": 43, "name": "IM"};
dynamic route21 = {"id": 42, "name": "IV"};
dynamic route22 = {"id": 41, "name": "Sublingual"};
dynamic route23 = {"id": 40, "name": "For Nebulization"};
dynamic route24 = {"id": 39, "name": "Nasal"};
dynamic route25 = {"id": 37, "name": "Inserted into Vagina"};
dynamic route26 = {"id": 36, "name": "Inserted into Rectum"};
dynamic route27 = {"id": 31, "name": "In Each Nostril"};
dynamic duration1 = {"id": 1, "name": "For 1 Day"};
dynamic duration2 = {"id": 2, "name": "For 2 Days"};
dynamic duration3 = {"id": 3, "name": "For 3 Days"};
dynamic duration4 = {"id": 4, "name": "For 4 Days"};
dynamic duration5 = {"id": 5, "name": "For 5 Days"};
dynamic duration6 = {"id": 6, "name": "For 6 Days"};
dynamic duration7 = {"id": 7, "name": "For 7 Days"};
dynamic duration8 = {"id": 8, "name": "For 8 Days"};
dynamic duration9 = {"id": 9, "name": "For 9 Days"};
dynamic duration10 = {"id": 10, "name": "For 10 Days"};
dynamic duration11 = {"id": 14, "name": "For 14 Days"};
dynamic duration12 = {"id": 21, "name": "For 21 Days"};
dynamic duration13 = {"id": 30, "name": "For 30 Days"};
dynamic duration14 = {"id": 45, "name": "For 45 Days"};
dynamic duration15 = {"id": 60, "name": "For 60 Days"};
dynamic duration16 = {"id": 90, "name": "For 90 Days"};
durationList.add(duration1);
durationList.add(duration2);
durationList.add(duration3);
durationList.add(duration4);
durationList.add(duration5);
durationList.add(duration6);
durationList.add(duration7);
durationList.add(duration8);
durationList.add(duration9);
durationList.add(duration10);
durationList.add(duration11);
durationList.add(duration12);
durationList.add(duration13);
durationList.add(duration14);
durationList.add(duration15);
durationList.add(duration16);
frequencyList.add(frequency1); frequencyList.add(frequency1);
frequencyList.add(frequency2); frequencyList.add(frequency2);
frequencyList.add(frequency3); frequencyList.add(frequency3);
@ -87,6 +168,16 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
frequencyList.add(frequency6); frequencyList.add(frequency6);
frequencyList.add(frequency7); frequencyList.add(frequency7);
frequencyList.add(frequency8); frequencyList.add(frequency8);
frequencyList.add(frequency9);
frequencyList.add(frequency10);
frequencyList.add(frequency11);
frequencyList.add(frequency12);
frequencyList.add(frequency13);
frequencyList.add(frequency14);
frequencyList.add(frequency15);
frequencyList.add(frequency16);
frequencyList.add(frequency17);
frequencyList.add(frequency18);
doseTimeList.add(doseTime1); doseTimeList.add(doseTime1);
doseTimeList.add(doseTime2); doseTimeList.add(doseTime2);
doseTimeList.add(doseTime3); doseTimeList.add(doseTime3);
@ -99,6 +190,15 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
doseTimeList.add(doseTime10); doseTimeList.add(doseTime10);
doseTimeList.add(doseTime11); doseTimeList.add(doseTime11);
doseTimeList.add(doseTime12); doseTimeList.add(doseTime12);
doseTimeList.add(doseTime13);
doseTimeList.add(doseTime14);
doseTimeList.add(doseTime15);
doseTimeList.add(doseTime16);
doseTimeList.add(doseTime17);
doseTimeList.add(doseTime18);
doseTimeList.add(doseTime19);
doseTimeList.add(doseTime20);
doseTimeList.add(doseTime21);
routeList.add(route1); routeList.add(route1);
routeList.add(route2); routeList.add(route2);
routeList.add(route3); routeList.add(route3);
@ -108,6 +208,27 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
routeList.add(route7); routeList.add(route7);
routeList.add(route8); routeList.add(route8);
routeList.add(route9); routeList.add(route9);
routeList.add(route10);
routeList.add(route11);
routeList.add(route12);
routeList.add(route13);
routeList.add(route14);
routeList.add(route15);
routeList.add(route16);
routeList.add(route17);
routeList.add(route18);
routeList.add(route19);
routeList.add(route20);
routeList.add(route21);
routeList.add(route22);
routeList.add(route23);
routeList.add(route24);
routeList.add(route25);
routeList.add(route26);
routeList.add(route27);
unitsList.add(unit1);
unitsList.add(unit2);
unitsList.add(unit3);
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -368,7 +489,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.282, 0.295,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -508,13 +629,18 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
children: [ children: [
Expanded( Expanded(
child: child:
AppText( Container(
model height:
.prescriptionList[0] 30,
.entityList[index] child:
.remarks, AppText(
fontSize: model
14.0, .prescriptionList[0]
.entityList[index]
.remarks,
fontSize:
11.5,
),
), ),
), ),
], ],
@ -718,213 +844,389 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
builder: (BuildContext context) { builder: (BuildContext context) {
return StatefulBuilder(builder: (BuildContext context, return StatefulBuilder(builder: (BuildContext context,
StateSetter setState /*You can rename this!*/) { StateSetter setState /*You can rename this!*/) {
return Container( return DraggableScrollableSheet(
height: MediaQuery.of(context).size.height * 0.73, initialChildSize: 0.90,
child: Form( maxChildSize: 0.90,
child: Padding( minChildSize: 0.6,
padding: builder:
EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0), (BuildContext context, ScrollController scrollController) {
child: Column( return Container(
crossAxisAlignment: CrossAxisAlignment.start, height: MediaQuery.of(context).size.height * 1.0,
children: [ child: Form(
AppText( child: Padding(
drugName.toUpperCase(), padding: EdgeInsets.symmetric(
fontWeight: FontWeight.w900, horizontal: 20.0, vertical: 12.0),
), child: Column(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
height: 30.0, children: [
), AppText(
Column( drugName.toUpperCase(),
children: [ fontWeight: FontWeight.w900,
Container(
height:
MediaQuery.of(context).size.height * 0.070,
child: InkWell(
onTap: routeList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: routeList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
route = selectedValue;
});
if (route == null) {
route = route['id'];
}
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).route,
route != null ? route['name'] : null,
true),
enabled: false,
),
), ),
), SizedBox(
SizedBox( height: 10.0,
height: 12.0,
),
Container(
height:
MediaQuery.of(context).size.height * 0.070,
child: InkWell(
onTap: doseTimeList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: doseTimeList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
doseTime = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doseTime,
doseTime != null
? doseTime['name']
: null,
true),
enabled: false,
),
), ),
), Column(
SizedBox( children: [
height: 12.0, Container(
), height: MediaQuery.of(context).size.height *
Container( 0.070,
height: width: double.infinity,
MediaQuery.of(context).size.height * 0.070, child: Row(
child: InkWell( children: [
onTap: frequencyList != null Container(
? () { width: MediaQuery.of(context)
ListSelectDialog dialog = .size
ListSelectDialog( .width *
list: frequencyList, 0.550,
attributeName: 'name', child: TextFields(
attributeValueId: 'id', inputFormatters: [
okText: LengthLimitingTextInputFormatter(
TranslationBase.of(context).ok, 4)
okFunction: (selectedValue) { ],
setState(() { hintText:
frequencyUpdate = selectedValue; TranslationBase.of(context)
}); .strength,
}, controller: strengthController,
); keyboardType: TextInputType.number,
showDialog( onChanged: (String value) {
barrierDismissible: false, setState(() {
context: context, strengthChar = value.length;
builder: (BuildContext context) { });
return dialog; if (strengthChar >= 4) {
}, DrAppToastMsg.showErrorToast(
); "Only 4 Digits allowed for strength");
} }
: null, },
child: TextField( // validator: (value) {
decoration: textFieldSelectorDecoration( // if (value.isEmpty &&
TranslationBase.of(context).frequency, // strengthController.text.length >
frequencyUpdate != null // 4)
? frequencyUpdate['name'] // return TranslationBase.of(context)
// .emptyMessage;
// else
// return null;
// },
),
),
SizedBox(
width: 10.0,
),
Container(
width: MediaQuery.of(context)
.size
.width *
0.3200,
child: InkWell(
onTap: unitsList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: unitsList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(
context)
.ok,
okFunction:
(selectedValue) {
setState(() {
units = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext
context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration:
textFieldSelectorDecoration(
'UNIT Type',
units != null
? units['name']
: null,
true),
enabled: false,
),
),
),
],
),
),
Container(
height: MediaQuery.of(context).size.height *
0.070,
child: InkWell(
onTap: routeList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: routeList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
route = selectedValue;
});
if (route == null) {
route = route['id'];
}
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
return dialog;
},
);
}
: null, : null,
true), child: TextField(
enabled: false, decoration: textFieldSelectorDecoration(
), TranslationBase.of(context).route,
), route != null
), ? route['name']
SizedBox( : null,
height: 12.0, true),
), enabled: false,
Container( ),
decoration: BoxDecoration( ),
borderRadius: ),
BorderRadius.all(Radius.circular(6.0)), SizedBox(
border: Border.all( height: 12.0,
width: 1.0, color: HexColor("#CCCCCC"))), ),
child: TextFields( Container(
hintText: remarks, height: MediaQuery.of(context).size.height *
controller: remarksController, 0.070,
maxLines: 7, child: InkWell(
minLines: 4, onTap: doseTimeList != null
), ? () {
), ListSelectDialog dialog =
SizedBox( ListSelectDialog(
height: 12.0, list: doseTimeList,
), attributeName: 'name',
SizedBox( attributeValueId: 'id',
height: MediaQuery.of(context).size.height * 0.12, okText:
), TranslationBase.of(context)
Container( .ok,
margin: EdgeInsets.all( okFunction: (selectedValue) {
SizeConfig.widthMultiplier * 2), setState(() {
child: Wrap( doseTime = selectedValue;
alignment: WrapAlignment.center, });
children: <Widget>[ },
AppButton( );
title: 'update prescription'.toUpperCase(), showDialog(
onPressed: () { barrierDismissible: false,
updatePrescription( context: context,
doseUnit: doseUnit, builder:
doseStreangth: doseStreangth, (BuildContext context) {
duration: duration, return dialog;
startDate: startDate, },
doseId: dose, );
frequencyId: frequency, }
routeId: rouat, : null,
patient: patient, child: TextField(
model: model, decoration: textFieldSelectorDecoration(
drugId: drugId, TranslationBase.of(context)
remarks: remarksController.text, .doseTime,
route: route != null doseTime != null
? route['id'].toString() ? doseTime['name']
: rouat, : null,
frequency: frequencyUpdate != null true),
? frequencyUpdate['id'].toString() enabled: false,
: frequency, ),
dose: doseTime != null ),
? doseTime['id'].toString() ),
: dose, SizedBox(
enteredRemarks: enteredRemarks); height: 12.0,
Navigator.pop(context); ),
}, Container(
height: MediaQuery.of(context).size.height *
0.070,
child: InkWell(
onTap: frequencyList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: frequencyList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
frequencyUpdate =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.frequency,
frequencyUpdate != null
? frequencyUpdate['name']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 12.0,
),
Container(
height: MediaQuery.of(context).size.height *
0.070,
child: InkWell(
onTap: durationList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: durationList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
updatedDuration =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.duration,
updatedDuration != null
? updatedDuration['name']
.toString()
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: remarks,
controller: remarksController,
maxLines: 7,
minLines: 4,
),
),
SizedBox(
height: 12.0,
),
SizedBox(
height: MediaQuery.of(context).size.height *
0.12,
),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'update prescription'
.toUpperCase(),
onPressed: () {
updatePrescription(
newDoseStreangth:
strengthController
.text.isNotEmpty
? strengthController
.text
: doseStreangth,
newUnit: units != null
? units['id'].toString()
: doseUnit,
doseUnit: doseUnit,
doseStreangth: doseStreangth,
duration: duration,
startDate: startDate,
doseId: dose,
frequencyId: frequency,
routeId: rouat,
patient: patient,
model: model,
newDuration: updatedDuration !=
null
? updatedDuration['id']
.toString()
: duration,
drugId: drugId,
remarks: remarksController.text,
route: route != null
? route['id'].toString()
: rouat,
frequency: frequencyUpdate != null
? frequencyUpdate['id']
.toString()
: frequency,
dose: doseTime != null
? doseTime['id'].toString()
: dose,
enteredRemarks: enteredRemarks);
Navigator.pop(context);
},
),
],
),
), ),
], ],
), ),
), ],
], ),
), ),
], ));
), });
),
));
}); });
}); });
} }
@ -942,7 +1244,10 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
String startDate, String startDate,
String doseUnit, String doseUnit,
String doseStreangth, String doseStreangth,
String newDoseStreangth,
String duration, String duration,
String newDuration,
String newUnit,
String enteredRemarks, String enteredRemarks,
PatiantInformtion patient}) async { PatiantInformtion patient}) async {
//PrescriptionViewModel model = PrescriptionViewModel(); //PrescriptionViewModel model = PrescriptionViewModel();
@ -957,10 +1262,13 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
sss.add(PrescriptionRequestModel( sss.add(PrescriptionRequestModel(
covered: true, covered: true,
dose: int.parse( dose: newDoseStreangth.isNotEmpty
doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1, ? int.parse(newDoseStreangth)
: int.parse(
doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1,
itemId: drugId, itemId: drugId,
doseUnitId: int.parse(doseUnit), doseUnitId:
newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit),
route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), route: route.isNotEmpty ? int.parse(route) : int.parse(routeId),
frequency: frequency.isNotEmpty frequency: frequency.isNotEmpty
? int.parse(frequency) ? int.parse(frequency)
@ -969,7 +1277,9 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
approvalRequired: true, approvalRequired: true,
icdcode10Id: "test2", icdcode10Id: "test2",
doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId), doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId),
duration: int.parse(duration), duration: newDuration.isNotEmpty
? int.parse(newDuration)
: int.parse(duration),
doseStartDate: startDate)); doseStartDate: startDate));
updatePrescriptionReqModel.prescriptionRequestModel = sss; updatePrescriptionReqModel.prescriptionRequestModel = sss;
//postProcedureReqModel.procedures = controlsProcedure; //postProcedureReqModel.procedures = controlsProcedure;

@ -1,12 +1,14 @@
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart';
@ -14,17 +16,12 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.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_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -44,6 +41,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
} }
TextEditingController procedureController = TextEditingController(); TextEditingController procedureController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
@ -267,8 +265,16 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
.spaceBetween, .spaceBetween,
children: [ children: [
Container( Container(
height: 120.0, height: MediaQuery.of(
width: 45.0, context)
.size
.height *
0.18,
width: MediaQuery.of(
context)
.size
.width *
0.135,
child: Column( child: Column(
children: [ children: [
AppText( AppText(
@ -310,8 +316,16 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
), ),
Expanded( Expanded(
child: Container( child: Container(
height: 120, height: MediaQuery.of(
width: 325.0, context)
.size
.height *
0.2,
width: MediaQuery.of(
context)
.size
.width *
0.05,
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -413,26 +427,35 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
children: [ children: [
Expanded( Expanded(
child: child:
AppText( Container(
model height: MediaQuery.of(context)
.procedureList[ .size
0] .height *
.entityList[ 0.052,
index] width: MediaQuery.of(context)
.remarks .size
.toString(), .width *
fontSize: 0.10,
13.5, child:
AppText(
model
.procedureList[0]
.entityList[index]
.remarks
.toString(),
fontSize:
11.5,
),
), ),
), ),
], ],
), ),
SizedBox( SizedBox(
height: 10.0, height: 20.0,
), ),
Divider( Divider(
height: 5.0, height: 1.0,
thickness: 1.0, thickness: 1.0,
color: color:
Colors.grey, Colors.grey,
@ -676,10 +699,11 @@ postProcedure(
postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN; postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) {
controls.add( controls.add(
Controls(code: remarks.isEmpty ? '' : remarks, controlValue: 'test'), Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks),
); );
});
entityList.forEach((element) { entityList.forEach((element) {
controlsProcedure.add(Procedures( controlsProcedure.add(Procedures(
@ -693,6 +717,7 @@ postProcedure(
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added'); DrAppToastMsg.showSuccesToast('procedure has been added');
} }
@ -704,30 +729,37 @@ updateProcedure(
String procedureId, String procedureId,
PatiantInformtion patient, PatiantInformtion patient,
String categorieId}) async { String categorieId}) async {
PostProcedureReqModel updateProcedureReqModel = new PostProcedureReqModel(); UpdateProcedureRequestModel updateProcedureReqModel =
new UpdateProcedureRequestModel();
List<Controls> controls = List(); List<Controls> controls = List();
List<Procedures> controlsProcedure = List(); ProcedureDetail controlsProcedure = new ProcedureDetail();
updateProcedureReqModel.appointmentNo = patient.appointmentNo; updateProcedureReqModel.appointmentNo = patient.appointmentNo;
updateProcedureReqModel.episodeID = patient.episodeNo; updateProcedureReqModel.episodeID = patient.episodeNo;
updateProcedureReqModel.patientMRN = patient.patientMRN; updateProcedureReqModel.patientMRN = patient.patientMRN;
updateProcedureReqModel.lineItemNo = 1;
updateProcedureReqModel.orderNo = 0;
controls.add( controls.add(
Controls( Controls(code: "02", controlValue: remarks.isEmpty ? '' : remarks),
code: remarks.isEmpty ? '' : remarks,
controlValue: 'Testing',
),
); );
controlsProcedure.add(Procedures(
category: categorieId, procedure: procedureId, controls: controls)); controlsProcedure.procedure = procedureId;
updateProcedureReqModel.procedures = controlsProcedure; controlsProcedure.category = categorieId;
controlsProcedure.controls = controls;
// controlsProcedure.add(ProcedureDetail(
// category: categorieId, procedure: procedureId, controls: controls));
updateProcedureReqModel.procedureDetail = controlsProcedure;
await model.updateProcedure( await model.updateProcedure(
postProcedureReqModel: updateProcedureReqModel, mrn: patient.patientMRN); updateProcedureRequestModel: updateProcedureReqModel,
mrn: patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been updated'); DrAppToastMsg.showSuccesToast('procedure has been updated');
} }

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -34,7 +35,7 @@ class SettingsScreen extends StatelessWidget {
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 350), duration: Duration(milliseconds: 350),
decoration: BoxDecoration( decoration: BoxDecoration(
color: !projectsProvider.isArabic ? HexColor('#58434F') : Colors.transparent, color: !projectsProvider.isArabic ? AppGlobal.appPrimaryColor : Colors.transparent,
border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0)) border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
), ),
child: Center(child: AppText(TranslationBase.of(context).lanEnglish, color: !projectsProvider.isArabic ? Colors.white : Colors.grey[500])) child: Center(child: AppText(TranslationBase.of(context).lanEnglish, color: !projectsProvider.isArabic ? Colors.white : Colors.grey[500]))
@ -47,7 +48,7 @@ class SettingsScreen extends StatelessWidget {
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 350), duration: Duration(milliseconds: 350),
decoration: BoxDecoration( decoration: BoxDecoration(
color: projectsProvider.isArabic ? HexColor('#58434F') : Colors.transparent, color: projectsProvider.isArabic ? AppGlobal.appPrimaryColor : Colors.transparent,
border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0)) border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
), ),
child: Center(child: AppText(TranslationBase.of(context).lanArabic, color: projectsProvider.isArabic ? Colors.white : Colors.grey[500],)) child: Center(child: AppText(TranslationBase.of(context).lanArabic, color: projectsProvider.isArabic ? Colors.white : Colors.grey[500],))

@ -216,5 +216,23 @@ class DateUtils {
return 12; return 12;
} }
} }
static String getAgeByBirthday(dynamic birthday){
// https://leechy.dev/calculate-dates-diff-in-dart
DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday);
final now = DateTime.now();
int years = now.year - birthDate .year;
int months = now.month - birthDate.month;
int days = now.day - birthDate.day;
if (months < 0 || (months == 0 && days < 0)) {
years--;
months += (days < 0 ? 11 : 12);
}
if (days < 0) {
final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day);
days = now.difference(monthAgo).inDays + 1;
}
return "$years Yr $months Mnth $days Day";
}
} }

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
class DrAppToastMsg {
class DrAppToastMsg {
void showLongToast(msg) { void showLongToast(msg) {
FlutterFlexibleToast.showToast( FlutterFlexibleToast.showToast(
message: msg, message: msg,
@ -8,7 +9,7 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
); );
} }
static void showSuccesToast(msg) { static void showSuccesToast(msg) {
FlutterFlexibleToast.showToast( FlutterFlexibleToast.showToast(
message: msg, message: msg,
toastLength: Toast.LENGTH_SHORT, toastLength: Toast.LENGTH_SHORT,
@ -19,7 +20,6 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
textColor: Colors.white); textColor: Colors.white);
} }
static void showErrorToast(msg) { static void showErrorToast(msg) {
FlutterFlexibleToast.showToast( FlutterFlexibleToast.showToast(
message: msg, message: msg,
@ -29,7 +29,7 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
icon: ICON.CLOSE, icon: ICON.CLOSE,
fontSize: 16, fontSize: 16,
imageSize: 35, imageSize: 35,
timeInSeconds: 110, timeInSeconds: 9000,
textColor: Colors.white); textColor: Colors.white);
} }
@ -75,4 +75,4 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
void cancelToast(msg) { void cancelToast(msg) {
FlutterFlexibleToast.cancel(); FlutterFlexibleToast.cancel();
} }
} }

@ -1036,6 +1036,12 @@ class TranslationBase {
String get chiefComplaintErrorMsg => String get chiefComplaintErrorMsg =>
localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; localizedValues['chiefComplaintErrorMsg'][locale.languageCode];
String get ICDName =>
localizedValues['ICDName'][locale.languageCode];
String get referralStatus =>
localizedValues['referralStatus'][locale.languageCode];
String get referralRemark =>
localizedValues['referralRemark'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,13 +1,15 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.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/custom_validation_error.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
class DynamicElements extends StatefulWidget { class DynamicElements extends StatefulWidget {
final PatientModel _patientSearchFormValues; final PatientModel _patientSearchFormValues;
DynamicElements(this._patientSearchFormValues); final bool isFormSubmitted;
DynamicElements(this._patientSearchFormValues, this.isFormSubmitted);
@override @override
_DynamicElementsState createState() => _DynamicElementsState(); _DynamicElementsState createState() => _DynamicElementsState();
} }
@ -113,6 +115,10 @@ class _DynamicElementsState extends State<DynamicElements> {
), ),
SizedBox( SizedBox(
height: 5,
),
if(widget._patientSearchFormValues.From == "0" && widget.isFormSubmitted)
CustomValidationError(),SizedBox(
height: 10, height: 10,
), ),
AppTextFormField( AppTextFormField(
@ -137,6 +143,10 @@ class _DynamicElementsState extends State<DynamicElements> {
} }
}, },
), ),
if(widget._patientSearchFormValues.To == "0" && widget.isFormSubmitted)
CustomValidationError(),SizedBox(
height: 10,
),
], ],
); );
}, },

@ -37,25 +37,36 @@ class PatientReferralItemWidget extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Center( Center(
child: AppText( child: AppText(
"${patientName}", patientName != null ? "${patientName}" : "",
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
), ),
), ),
if (referralStatus != null) if (referralStatus != null)
Container( Row(
color: Color(0xFF4BA821), children: [
padding: EdgeInsets.all(4), AppText(
child: AppText( TranslationBase.of(context).referralStatus,
referralStatus color: Colors.grey,
/*referralStatus == "46" fontWeight: FontWeight.bold,
? TranslationBase.of(context).approved fontSize: 12,
: TranslationBase.of(context).rejected*/, ),
color: Colors.white, Container(
fontWeight: FontWeight.bold, color: Color(0xFF4BA821),
fontSize: 12, padding: EdgeInsets.all(4),
), child: AppText(
referralStatus
/*referralStatus == "46"
? TranslationBase.of(context).approved
: TranslationBase.of(context).rejected*/
,
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12,
),
),
],
), ),
SizedBox( SizedBox(
height: 8, height: 8,
@ -83,11 +94,26 @@ class PatientReferralItemWidget extends StatelessWidget {
SizedBox( SizedBox(
height: 8, height: 8,
), ),
AppText( Row(
"${TranslationBase.of(context).dr} $referralDoctorName", crossAxisAlignment: CrossAxisAlignment.start,
color: Colors.black, children: [
fontWeight: FontWeight.bold, AppText(
fontSize: 12, "${TranslationBase.of(context).referralDoctor} : ",
color: Colors.grey,
fontWeight: FontWeight.bold,
fontSize: 12,
),
Expanded(
child: AppText(
referralDoctorName != null
? "${TranslationBase.of(context).dr} $referralDoctorName"
: "",
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
),
],
), ),
SizedBox( SizedBox(
height: 8, height: 8,
@ -112,11 +138,21 @@ class PatientReferralItemWidget extends StatelessWidget {
SizedBox( SizedBox(
height: 8, height: 8,
), ),
AppText( Row(
remark, children: [
color: Colors.grey, AppText(
fontWeight: FontWeight.normal, TranslationBase.of(context).referralRemark,
fontSize: 12, color: Colors.grey,
fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText(
remark,
color: Colors.grey,
fontWeight: FontWeight.normal,
fontSize: 12,
),
],
), ),
SizedBox( SizedBox(
height: 16, height: 16,

@ -18,23 +18,7 @@ import './profile_medical_info_widget.dart';
class PatientProfileWidget extends StatelessWidget { class PatientProfileWidget extends StatelessWidget {
PatiantInformtion patient; PatiantInformtion patient;
String getPatientAge(dynamic birthday){
// https://leechy.dev/calculate-dates-diff-in-dart
DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday);
final now = DateTime.now();
int years = now.year - birthDate .year;
int months = now.month - birthDate.month;
int days = now.day - birthDate.day;
if (months < 0 || (months == 0 && days < 0)) {
years--;
months += (days < 0 ? 11 : 12);
}
if (days < 0) {
final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day);
days = now.difference(monthAgo).inDays + 1;
}
return "$years Yr $months Mnth $days Day";
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -133,7 +117,7 @@ class PatientProfileWidget extends StatelessWidget {
height: 4, height: 4,
), ),
AppText( AppText(
"${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${getPatientAge(patient.dateofBirth)/*patient.age*/}", "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth)/*patient.age*/}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize: 1.6 * SizeConfig.textMultiplier,
), ),

@ -43,7 +43,8 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'Dr. ${authProvider.doctorProfile.doctorName}', TranslationBase.of(context).dr +
' ${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.white, color: Colors.white,

@ -83,19 +83,17 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
child: Expanded( child: Texts(
child: Texts( projectViewModel.isArabic
projectViewModel.isArabic ? selectedAllergy.selectedAllergy.nameAr
? selectedAllergy.selectedAllergy.nameAr : selectedAllergy.selectedAllergy.nameEn
: selectedAllergy.selectedAllergy.nameEn .toUpperCase(),
.toUpperCase(), variant: "bodyText",
variant: "bodyText", textDecoration: selectedAllergy.isChecked
textDecoration: selectedAllergy.isChecked ? null
? null : TextDecoration.lineThrough,
: TextDecoration.lineThrough, bold: true,
bold: true, color: Colors.black),
color: Colors.black),
),
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
), ),
Texts( Texts(

@ -83,18 +83,16 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Container( Container(
child: Expanded( child: Texts(
child: Texts( projectViewModel.isArabic
projectViewModel.isArabic ? myHistory.selectedHistory.nameAr
? myHistory.selectedHistory.nameAr : myHistory.selectedHistory.nameEn,
: myHistory.selectedHistory.nameEn, variant: "bodyText",
variant: "bodyText", textDecoration: myHistory.isChecked
textDecoration: myHistory.isChecked ? null
? null : TextDecoration.lineThrough,
: TextDecoration.lineThrough, bold: true,
bold: true, color: Colors.black),
color: Colors.black),
),
width: MediaQuery.of(context).size.width * 0.7, width: MediaQuery.of(context).size.width * 0.7,
), ),
if (myHistory.isChecked) if (myHistory.isChecked)
@ -212,7 +210,9 @@ class _PriorityBarState extends State<PriorityBar> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((item,) { children: _priorities.map((item,) {
bool _isActive = _priorities[_activePriority] == item ? true : false; bool _isActive = _priorities[_activePriority] == item ? true : false;
index++; if(index <2){
index++;
}
return Expanded( return Expanded(
child: InkWell( child: InkWell(
child: Center( child: Center(

@ -210,7 +210,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
assessment.createdOn !=null?DateTime.parse(assessment.createdOn).day.toString():DateTime.now().day.toString(), assessment.createdOn !=null?DateTime.parse(assessment.createdOn).day.toString():DateTime.now().day.toString(),
fontWeight: FontWeight fontWeight: FontWeight
.bold, .bold,
fontSize: 16, fontSize: 13,
), ),
AppText( AppText(
Helpers.getMonth(assessment.createdOn !=null?DateTime.parse(assessment.createdOn).month:DateTime.now().month).toUpperCase(), Helpers.getMonth(assessment.createdOn !=null?DateTime.parse(assessment.createdOn).month:DateTime.now().month).toUpperCase(),
@ -225,6 +225,32 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
crossAxisAlignment: CrossAxisAlignment crossAxisAlignment: CrossAxisAlignment
.start, .start,
children: [ children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).ICDName +" : ",
fontWeight: FontWeight
.bold,
fontSize: 13,
),
Container(
width: MediaQuery
.of(context)
.size
.width * 0.29,
child: AppText(
assessment
.selectedICD.description
.toString(),
fontSize: 10,
color: Colors.grey,
),
),
],
),
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
@ -233,7 +259,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
TranslationBase.of(context).appointmentNo, TranslationBase.of(context).appointmentNo,
fontWeight: FontWeight fontWeight: FontWeight
.bold, .bold,
fontSize: 16, fontSize: 13,
), ),
AppText( AppText(
assessment assessment
@ -248,15 +274,21 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
AppText(
TranslationBase.of(context).condition + " : ",
fontWeight: FontWeight
.bold,
fontSize: 13,
),
AppText( AppText(
projectViewModel.isArabic?assessment projectViewModel.isArabic?assessment
.selectedDiagnosisCondition .selectedDiagnosisCondition
.nameAr : assessment .nameAr : assessment
.selectedDiagnosisCondition .selectedDiagnosisCondition
.nameEn, .nameEn,
fontWeight: FontWeight fontSize: 10,
.bold, color: Colors.grey,
fontSize: 16,
), ),
], ],
), ),
@ -268,7 +300,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
TranslationBase.of(context).dType+' : ', TranslationBase.of(context).dType+' : ',
fontWeight: FontWeight fontWeight: FontWeight
.bold, .bold,
fontSize: 16, fontSize: 13,
), ),
AppText( AppText(
projectViewModel.isArabic?assessment projectViewModel.isArabic?assessment
@ -290,7 +322,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
TranslationBase.of(context).doc, TranslationBase.of(context).doc,
fontWeight: FontWeight fontWeight: FontWeight
.bold, .bold,
fontSize: 16, fontSize: 13,
), ),
AppText( AppText(
assessment.doctorName??'', assessment.doctorName??'',
@ -309,11 +341,17 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
SizedBox( SizedBox(
height: 6, height: 6,
), ),
AppText(
TranslationBase.of(context).remarks + " : ",
fontWeight: FontWeight
.bold,
fontSize: 13,
),
Container( Container(
width: MediaQuery width: MediaQuery
.of(context) .of(context)
.size .size
.width * 0.5, .width * 0.38,
child: AppText( child: AppText(
assessment.remark ?? "", assessment.remark ?? "",
fontSize: 10, fontSize: 10,
@ -335,7 +373,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
"ICD : ".toUpperCase(), "ICD : ".toUpperCase(),
fontWeight: FontWeight fontWeight: FontWeight
.bold, .bold,
fontSize: 16, fontSize: 13,
), ),
Container( Container(
child: AppText( child: AppText(
@ -520,7 +558,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
AppText( AppText(
TranslationBase.of(context).addAssessmentDetails.toUpperCase(), TranslationBase.of(context).addAssessmentDetails.toUpperCase(),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 13,
), ),
SizedBox( SizedBox(
height: 16, height: 16,

@ -1,9 +1,10 @@
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
@ -28,6 +29,7 @@ class _AppDrawerState extends State<AppDrawer> {
bool _isInit = true; bool _isInit = true;
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
ProjectViewModel projectsProvider; ProjectViewModel projectsProvider;
// @override // @override
// void didChangeDependencies() { // void didChangeDependencies() {
// super.didChangeDependencies(); // super.didChangeDependencies();
@ -47,119 +49,126 @@ class _AppDrawerState extends State<AppDrawer> {
// margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2), // margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2),
child: Drawer( child: Drawer(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
flex: 4, flex: 4,
child: ListView(padding: EdgeInsets.zero, children: <Widget>[ child: ListView(padding: EdgeInsets.zero, children: <Widget>[
Container( Container(
height: SizeConfig.heightMultiplier * 50, height: SizeConfig.heightMultiplier * 50,
child: InkWell( child: InkWell(
child: DrawerHeader( child: DrawerHeader(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Container(
child: Image.asset('assets/images/logo.png'), child: Image.asset(
margin: EdgeInsets.only(top: 10, bottom: 15), 'assets/images/logo.png',
),
SizedBox(
height: 1,
child: Container(
color: Colors.black26,
), ),
margin: EdgeInsets.only(top: 10, bottom: 15),
), ),
SizedBox(height: 15), SizedBox(
authProvider.doctorProfile != null height: 1,
? CircleAvatar( child: Container(
radius: SizeConfig.imageSizeMultiplier * 12, color: Colors.black26,
backgroundImage: NetworkImage( ),
authProvider.doctorProfile.doctorImageURL), ),
backgroundColor: Colors.white, SizedBox(height: 15),
) InkWell(
: SizedBox(), onTap: (){
authProvider.doctorProfile != null Navigator.of(context).pushNamed(PROFILE, arguments: {
? Padding( 'title': authProvider.doctorProfile.doctorName,
padding: EdgeInsets.only(top: 10), "doctorProfileall": authProvider.doctorProfile
child: AppText( });
authProvider.doctorProfile?.doctorName, },
fontWeight: FontWeight.bold, child: Column(
color: Colors.black, children: [
fontSize: SizeConfig.textMultiplier * 2, authProvider.doctorProfile != null
)) ? CircleAvatar(
: SizedBox(), radius: SizeConfig.imageSizeMultiplier * 12,
AppText( backgroundImage: NetworkImage(
projectsProvider.isArabic authProvider.doctorProfile.doctorImageURL),
? authProvider backgroundColor: Colors.white,
.doctorProfile.titleDescriptionN ?? )
"" : SizedBox(),
: authProvider authProvider.doctorProfile != null
.doctorProfile?.titleDescription ?? ? Padding(
"", padding: EdgeInsets.only(top: 10),
fontWeight: FontWeight.normal, child: AppText(
color: Colors.black87), authProvider.doctorProfile?.doctorName,
RaisedButton( fontWeight: FontWeight.bold,
shape: RoundedRectangleBorder( color: Colors.black,
borderRadius: BorderRadius.circular(18.0), fontSize: SizeConfig.textMultiplier * 2,
side: BorderSide(color: Colors.red)), ))
child: AppText( : SizedBox(),
TranslationBase.of(context).logout, AppText(
color: Colors.white, projectsProvider.isArabic
), ? authProvider
onPressed: () async { .doctorProfile.titleDescriptionN ??
Navigator.pop(context); ""
await helpers.logout(); : authProvider
}, .doctorProfile?.titleDescription ??
"",
fontWeight: FontWeight.normal,
color: Colors.black87),
],
),
),
RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
side: BorderSide(color: Colors.red)),
child: AppText(
TranslationBase.of(context).logout,
color: Colors.white,
),
onPressed: () async {
Navigator.pop(context);
await helpers.logout();
},
),
],
), ),
], ),
), ),
), ),
onTap: () { InkWell(
//Navigator.of(context).pushNamed(PROFILE); child: DrawerItem(
Navigator.of(context).pushNamed(PROFILE, arguments: { TranslationBase.of(context).settings, Icons.settings),
'title': authProvider.doctorProfile.doctorName, onTap: () {
"doctorProfileall": authProvider.doctorProfile Navigator.pop(context);
}); Navigator.of(context).pushNamed(SETTINGS);
}, },
), ),
), InkWell(
InkWell( child: DrawerItem(
child: DrawerItem( TranslationBase.of(context).qr +
TranslationBase.of(context).settings, Icons.settings), TranslationBase.of(context).reader,
onTap: () { DoctorApp.qr_code),
Navigator.pop(context); onTap: () {
Navigator.of(context).pushNamed(SETTINGS); Navigator.pop(context);
}, Navigator.of(context).pushNamed(QR_READER);
), },
InkWell( ),
child: DrawerItem( ]),
TranslationBase.of(context).qr +
TranslationBase.of(context).reader,
DoctorApp.qr_code),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(QR_READER);
},
), ),
]), Expanded(
), flex: 1,
Expanded( child: Column(children: <Widget>[
flex: 1, Container(
child: Column(children: <Widget>[ // This align moves the children to the bottom
Container( child: Align(
// This align moves the children to the bottom alignment: FractionalOffset.bottomCenter,
child: Align( child: Container(
alignment: FractionalOffset.bottomCenter, child: Column(
child: Container( children: <Widget>[
child: Column( Text("Powered by"),
children: <Widget>[ Image.asset(
Text("Powered by"), 'assets/images/cs_logo_container.png',
Image.asset( width: SizeConfig.imageSizeMultiplier * 30,
'assets/images/cs_logo_container.png', )
width: SizeConfig.imageSizeMultiplier * 30, ],
) ))))
], ]))
)))) ])),
]))
])),
), ),
width: SizeConfig.realScreenWidth * 0.60, width: SizeConfig.realScreenWidth * 0.60,
margin: 0, margin: 0,

@ -28,7 +28,7 @@ class _DrawerItemState extends State<DrawerItem> {
return Container( return Container(
margin: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10), margin: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Icon( Icon(
widget.icon, widget.icon,
@ -37,12 +37,15 @@ class _DrawerItemState extends State<DrawerItem> {
), ),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
widget.title, widget.title,
color: widget.color ?? Colors.black, color: widget.color ?? Colors.black,
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
margin: 5, // margin: 5,
marginLeft: 5,
marginRight: 5,
fontSize: SizeConfig.textMultiplier * 2.3, fontSize: SizeConfig.textMultiplier * 2.3,
), ),
AppText( AppText(

Loading…
Cancel
Save