Merge branch 'development' into 'master'

Development

See merge request Cloud_Solution/doctor_app_flutter!183
merge-requests/390/merge
Mohammad Aljammal 5 years ago
commit 8e5316a0b0

1
.gitignore vendored

@ -29,6 +29,7 @@
.pub-cache/
.pub/
/build/
pubspec.lock # Except for application packages
# Web related
lib/generated_plugin_registrant.dart

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:http/http.dart' as http;

@ -100,8 +100,8 @@ var SERVICES_PATIANT2 = [
"List_MyReferralPatient"
];
var SERVICES_PATIANT_HEADER = [
"OutPatient",
"InPatient",
"Search Out-Patient",
"Search In-Patient",
"Discharge",
"Referred",
"Referral Discharge",

@ -6,7 +6,6 @@ const Map<String, Map<String, String>> localizedValues = {
'lanArabic': {'en': 'العربية', 'ar': 'العربية'},
'theDoctor': {'en': 'Doctor', 'ar': 'الطبيب'},
'reply': {'en': 'Reply', 'ar': 'رد'},
'time': {'en': 'Time', 'ar': 'الوقت'},
'fileNo': {'en': 'File No:', 'ar': 'رقم الملف:'},
'mobileNo': {'en': 'Mobile No', 'ar': 'رقم الموبايل'},
@ -35,18 +34,22 @@ const Map<String, Map<String, String>> localizedValues = {
'searchAbout': {'en': 'Search', 'ar': 'البحث عن'},
'patient': {'en': 'Patient', 'ar': ' مريض'},
'labResult': {'en': 'Lab Result', 'ar': 'نتيجة المختبر'},
'lab': {'en': 'Lab', 'ar': 'المختبر'},
'result': {'en': 'Result', 'ar': 'نتيجة'},
'todayStatistics': {'en': 'Today Statistics', 'ar': 'إحصائيات اليوم'},
'arrived': {'en': 'Arrived', 'ar': 'وصل'},
'er': {'en': 'ER', 'ar': 'حالة طوارئ'},
'walkIn': {'en': 'Walk-in', 'ar': 'ادخل'},
'notArrived': {'en': 'Not Arrived', 'ar': 'لم يصل'},
'radiology': {'en': 'Radiology', 'ar': 'الأشعة'},
'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'االإحالة'},
'inPatient': {'en': 'In-Patient', 'ar': 'االمريض الداخلي'},
'operations': {'en': 'Operations', 'ar': 'عمليات'},
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'},
'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'},
'myReferral': {'en': 'My Referral', 'ar': 'إحالة'},
'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'},
'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'},
'middleName': {'en': 'Middle Name', 'ar': 'اسم الاب'},
@ -79,9 +82,14 @@ const Map<String, Map<String, String>> localizedValues = {
'errorMessage': {'en': 'Something went wrong', 'ar': 'حدث خطأ ما'},
'patientProfile': {'en': 'Patient Profile', 'ar': 'ملف المريض'},
'vitalSign': {'en': 'Vital Sign', 'ar': 'المؤشرات الحيوية'},
'vital': {'en': 'Vital', 'ar': 'الحيوية'},
'signs': {'en': 'Signs', 'ar': 'المؤشرات'},
'labOrder': {'en': 'Lab Order', 'ar': 'نتائج التحاليل'},
'prescription': {'en': 'Prescription', 'ar': 'الوصفات'},
'medicines': {'en': 'Medicines', 'ar': 'الأدوية'},
'prescription': {'en': 'Prescription', 'ar': 'وصفات'},
'insuranceApprovals': {'en': 'Insurance Approvals', 'ar': 'موافقات التأمين'},
'insurance': {'en': 'Insurance', 'ar': 'التأمين'},
'approvals': {'en': 'Approvals', 'ar': 'موافقات'},
'bodyMeasurements': {'en': 'Body Measurements', 'ar': 'قياسات الجسم'},
'temperature': {'en': 'Temperature', 'ar': 'درجة الحرارة'},
'pulse': {'en': 'Pulse', 'ar': 'النبض'},
@ -105,6 +113,8 @@ const Map<String, Map<String, String>> localizedValues = {
},
'replay': {'en': 'Replay', 'ar': 'تاكيد'},
'progressNote': {'en': 'Progress Note', 'ar': 'ملاحظة التقدم'},
'progress': {'en': 'Progress', 'ar': 'التقدم'},
'note': {'en': 'Note', 'ar': 'ملاحظة'},
'searchNote': {'en': 'Search Note', 'ar': 'بحث عن ملاحظة'},
'errorNoProgressNote': {
'en': 'You don\'t have any Progress Note',
@ -165,6 +175,7 @@ const Map<String, Map<String, String>> localizedValues = {
'ar': 'ليس لديك اي مرضى'
},
'age': {'en': 'Age', 'ar': 'العمر'},
'nationality': {'en': 'Nationality', 'ar': 'الجنسية'},
'today': {'en': 'Today', 'ar': 'اليوم'},
'yesterday': {'en': 'Yesterday', 'ar': 'الأمس'},
'tomorrow': {'en': 'Tomorrow', 'ar': 'الغد'},
@ -205,7 +216,8 @@ const Map<String, Map<String, String>> localizedValues = {
'price': {'en': 'Price', 'ar': 'السعر'},
'youCanFindItIn': {'en': 'You can Find it in', 'ar': 'تستطيع ان تجده هنا '},
'radiologyReport': {'en': 'Radiology Report', 'ar': 'تقرير الاشعة'},
'orders': {'en': 'Orders', 'ar': ' الطلبات'},
'orders': {'en': 'Orders', 'ar': 'الطلبات'},
'list': {'en': 'List', 'ar': 'قائمة'},
'searchOrders': {'en': 'Search Orders', 'ar': ' بحث عن الطلبات'},
'prescriptionDetails': {'en': 'Prescription Details', 'ar': 'تفاصبل الوصفة'},
'prescriptionInfo': {'en': 'Prescription Info', 'ar': 'معلومات الوصفة'},
@ -223,10 +235,10 @@ const Map<String, Map<String, String>> localizedValues = {
'endcall': {'en': 'End Call', 'ar': 'إنهاء المكالمة'},
'transfertoadmin': {'en': 'Transfer to admin', 'ar': 'نقل إلى المسؤول'},
"searchMedicineImageCaption": {
'en': 'Type or speak the medicine name to search',
'ar': ' اكتب أو انطق اسم الدواء للبحث'
'en': 'Type the medicine name to search',
'ar': ' اكتب اسم الدواء للبحث'
},
"type": {'en': 'Type or Speak', 'ar': 'اكتب أو تحدث '},
"type": {'en': 'Type ', 'ar': 'اكتب'},
"fromDate": {'en': 'From Date', 'ar': 'من تاريخ'},
"toDate": {'en': 'To Date', 'ar': 'الى تاريخ'},
"searchPatientImageCaptionTitle": {
@ -242,11 +254,23 @@ const Map<String, Map<String, String>> localizedValues = {
'en': 'You don\'t have any Items',
'ar': 'لا يوجد اي نتائج'
},
'typeMedicineName': {
'en': 'Type Medicine Name',
'ar': 'اكتب اسم الدواء'
},'moreThan3Letter': {
'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'},
'moreThan3Letter': {
'en': 'Medicine Name Should Be More Than 3 letter',
'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف'
},
'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '},
'age2': {'en': 'Age: ', 'ar': 'العمر: '},
'replySuccessfully': {
'en': 'Reply Successfully',
'ar': 'تم الرد بنجاح'
},
'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '},
'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'},
'admissionNo': {'en': 'ADMISSION #: ', 'ar': 'قبول #:'},
'losNo': {'en': 'LOS #:', 'ar': 'LOS #:'},
'area': {'en': 'AREA:', 'ar': 'المنطقة'},
'room': {'en': 'ROOM:', 'ar': 'الغرفة'},
'bed': {'en': 'BED:', 'ar': 'السرير'},
};

@ -1,23 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/hospitals_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
///This service just an example
class HospitalService extends BaseService {
List<HospitalsModel> _hospitals = List();
List<HospitalsModel> get hospitals => _hospitals;
Future getHospitals() async {
await baseAppClient.post(GET_PROJECTS,
onSuccess: (dynamic response, int statusCode) {
_hospitals.clear();
response['ListProject'].forEach((hospital) {
_hospitals.add(HospitalsModel.fromJson(hospital));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: Map());
}
}

@ -0,0 +1,49 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/request_schedule.dart';
import 'package:doctor_app_flutter/models/pharmacies/pharmacies_List_request_model.dart';
import 'package:doctor_app_flutter/models/pharmacies/pharmacies_items_request_model.dart';
class MedicineService extends BaseService {
var _pharmacyItemsList = [];
var _pharmaciesList = [];
get pharmacyItemsList => _pharmacyItemsList;
get pharmaciesList => _pharmaciesList;
PharmaciesItemsRequestModel _itemsRequestModel =
PharmaciesItemsRequestModel();
PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel();
Future getMedicineItem(String itemName) async {
_itemsRequestModel.pHRItemName = itemName;
await baseAppClient.post(
PHARMACY_ITEMS_URL,
onSuccess: (dynamic response, int statusCode) {
_pharmacyItemsList.clear();
_pharmacyItemsList = response['ListPharmcy_Region_enh'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _itemsRequestModel.toJson(),
);
}
Future getPharmaciesList(int itemId) async {
_listRequestModel.itemID = itemId;
await baseAppClient.post(
PHARMACY_LIST_URL,
onSuccess: (dynamic response, int statusCode) {
_pharmaciesList.clear();
_pharmaciesList = response['PharmList'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _listRequestModel.toJson(),
);
}
}

@ -0,0 +1,412 @@
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/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/request_schedule.dart';
import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_list_stp_referral_frequency_request.dart';
import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart';
import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart';
import 'package:doctor_app_flutter/models/patient/lab_result/lab_result_req_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart';
import 'package:doctor_app_flutter/models/patient/radiology/radiology_res_model.dart';
import 'package:doctor_app_flutter/models/patient/refer_to_doctor_request.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart';
class PatientService extends BaseService {
List<VitalSignResModel> _patientVitalSignList = [];
List<VitalSignResModel> patientVitalSignOrderdSubList = [];
List<VitalSignResModel> get patientVitalSignList => _patientVitalSignList;
List<LabOrdersResModel> _patientLabResultOrdersList = [];
List<LabOrdersResModel> get patientLabResultOrdersList =>
_patientLabResultOrdersList;
List<PrescriptionResModel> get patientPrescriptionsList =>
_patientPrescriptionsList;
List<PrescriptionResModel> _patientPrescriptionsList = [];
List<PrescriptionReportForInPatient> get prescriptionReportForInPatientList =>
_prescriptionReportForInPatientList;
List<PrescriptionReportForInPatient> _prescriptionReportForInPatientList = [];
List<RadiologyResModel> _patientRadiologyList = [];
List<RadiologyResModel> get patientRadiologyList => _patientRadiologyList;
List<PrescriptionReport> _prescriptionReport = [];
List<PrescriptionReport> get prescriptionReport => _prescriptionReport;
List<LabResult> _labResultList = [];
List<LabResult> get labResultList => _labResultList;
// TODO: replace var with model
var _patientProgressNoteList = [];
get patientProgressNoteList => _patientProgressNoteList;
// TODO: replace var with model
var _insuranceApporvalsList = [];
get insuranceApporvalsList => _insuranceApporvalsList;
// TODO: replace var with model
var _doctorsList = [];
get doctorsList => _doctorsList;
// TODO: replace var with model
var _clinicsList = [];
get clinicsList => _clinicsList;
// TODO: replace var with model
var _referalFrequancyList = [];
get referalFrequancyList => _referalFrequancyList;
DoctorsByClinicIdRequest _doctorsByClinicIdRequest =
DoctorsByClinicIdRequest();
STPReferralFrequencyRequest _referralFrequencyRequest =
STPReferralFrequencyRequest();
ClinicByProjectIdRequest _clinicByProjectIdRequest =
ClinicByProjectIdRequest();
ReferToDoctorRequest _referToDoctorRequest;
RequestSchedule _requestSchedule = RequestSchedule();
Future<dynamic> getPatientList(PatientModel patient, patientType) async {
hasError = false;
int val = int.parse(patientType);
dynamic localRes;
await baseAppClient.post(
GET_PATIENT + SERVICES_PATIANT[val],
onSuccess: (dynamic response, int statusCode) {
localRes = response;
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
"ProjectID": patient.ProjectID,
"ClinicID": patient.ClinicID,
"DoctorID": patient.DoctorID,
"FirstName": patient.FirstName,
"MiddleName": patient.MiddleName,
"LastName": patient.LastName,
"PatientMobileNumber": patient.PatientMobileNumber,
"PatientIdentificationID": patient.PatientIdentificationID,
"PatientID": patient.PatientID,
"From": patient.From,
"To": patient.To,
"LanguageID": patient.LanguageID,
"stamp": patient.stamp,
"IPAdress": patient.IPAdress,
"VersionID": patient.VersionID,
"Channel": patient.Channel,
"TokenID": patient.TokenID,
"SessionID": patient.SessionID,
"IsLoginForDoctorApp": patient.IsLoginForDoctorApp,
"PatientOutSA": patient.PatientOutSA
},
);
return Future.value(localRes);
}
Future getPatientVitalSign(patient) async {
hasError = false;
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) {
_patientVitalSignList = [];
response['List_DoctorPatientVitalSign'].forEach((v) {
_patientVitalSignList.add(new VitalSignResModel.fromJson(v));
});
if (_patientVitalSignList.length > 0) {
List<VitalSignResModel> patientVitalSignOrderdSubListTemp = [];
patientVitalSignOrderdSubListTemp = _patientVitalSignList;
patientVitalSignOrderdSubListTemp
.sort((VitalSignResModel a, VitalSignResModel b) {
return b.vitalSignDate.microsecondsSinceEpoch -
a.vitalSignDate.microsecondsSinceEpoch;
});
patientVitalSignOrderdSubList.clear();
int length = patientVitalSignOrderdSubListTemp.length >= 20
? 20
: patientVitalSignOrderdSubListTemp.length;
for (int x = 0; x < length; x++) {
patientVitalSignOrderdSubList
.add(patientVitalSignOrderdSubListTemp[x]);
}
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getLabResultOrders(patient) async {
hasError = false;
await baseAppClient.post(
GET_PATIENT_LAB_OREDERS,
onSuccess: (dynamic response, int statusCode) {
_patientLabResultOrdersList = [];
response['List_GetLabOreders'].forEach((v) {
_patientLabResultOrdersList.add(new LabOrdersResModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getOutPatientPrescriptions(patient) async {
hasError = false;
await baseAppClient.post(
GET_PRESCRIPTION,
onSuccess: (dynamic response, int statusCode) {
_patientPrescriptionsList = [];
response['PatientPrescriptionList'].forEach((v) {
_patientPrescriptionsList.add(new PrescriptionResModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getInPatientPrescriptions(patient) async {
hasError = false;
await baseAppClient.post(
GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT,
onSuccess: (dynamic response, int statusCode) {
_prescriptionReportForInPatientList = [];
response['List_PrescriptionReportForInPatient'].forEach((v) {
prescriptionReportForInPatientList
.add(PrescriptionReportForInPatient.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getPrescriptionReport(prescriptionReqModel) async {
hasError = false;
await baseAppClient.post(
GET_PRESCRIPTION_REPORT,
onSuccess: (dynamic response, int statusCode) {
_prescriptionReport = [];
response['ListPRM'].forEach((v) {
_prescriptionReport.add(PrescriptionReport.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: prescriptionReqModel,
);
}
Future getPatientRadiology(patient) async {
hasError = false;
await baseAppClient.post(
GET_RADIOLOGY,
onSuccess: (dynamic response, int statusCode) {
_patientRadiologyList = [];
response['List_GetRadOreders'].forEach((v) {
_patientRadiologyList.add(new RadiologyResModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getLabResult(LabOrdersResModel labOrdersResModel) async {
hasError = false;
RequestLabResult requestLabResult = RequestLabResult();
requestLabResult.sessionID = labOrdersResModel.setupID;
requestLabResult.orderNo = labOrdersResModel.orderNo;
requestLabResult.invoiceNo = labOrdersResModel.invoiceNo;
requestLabResult.patientTypeID = labOrdersResModel.patientType;
await baseAppClient.post(
GET_PATIENT_LAB_RESULTS,
onSuccess: (dynamic response, int statusCode) {
_labResultList = [];
response['List_GetLabNormal'].forEach((v) {
_labResultList.add(new LabResult.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: requestLabResult.toJson(),
);
}
Future getPatientInsuranceApprovals(patient) async {
hasError = false;
await baseAppClient.post(
PATIENT_INSURANCE_APPROVALS_URL,
onSuccess: (dynamic response, int statusCode) {
_insuranceApporvalsList = [];
_insuranceApporvalsList = response['List_ApprovalMain_InPatient'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getPatientProgressNote(patient) async {
hasError = false;
await baseAppClient.post(
PATIENT_PROGRESS_NOTE_URL,
onSuccess: (dynamic response, int statusCode) {
_patientProgressNoteList = [];
_patientProgressNoteList = response['List_GetPregressNoteForInPatient'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getClinicsList() async {
hasError = false;
await baseAppClient.post(
PATIENT_GET_CLINIC_BY_PROJECT_URL,
onSuccess: (dynamic response, int statusCode) {
_clinicsList = [];
_clinicsList = response['List_Clinic_All'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _clinicByProjectIdRequest.toJson(),
);
}
Future getReferralFrequancyList() async {
hasError = false;
await baseAppClient.post(
PATIENT_GET_LIST_REFERAL_URL,
onSuccess: (dynamic response, int statusCode) {
_referalFrequancyList = [];
_referalFrequancyList = response['list_STPReferralFrequency'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _referralFrequencyRequest.toJson(),
);
}
Future getDoctorsList(String clinicId) async {
hasError = false;
_doctorsByClinicIdRequest.clinicID = clinicId;
await baseAppClient.post(
PATIENT_GET_DOCTOR_BY_CLINIC_URL,
onSuccess: (dynamic response, int statusCode) {
_doctorsList = [];
_doctorsList = response['List_Doctors_All'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _doctorsByClinicIdRequest.toJson(),
);
}
// TODO send the total model insted of each parameter
Future referToDoctor({String selectedDoctorID,
String selectedClinicID,
int admissionNo,
String extension,
String priority,
String frequency,
String referringDoctorRemarks,
int patientID,
int patientTypeID,
String roomID,
int projectID}) async {
hasError = false;
// TODO Change it to use it when we implement authentication user
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
int doctorID = doctorProfile.doctorID;
int clinicId = doctorProfile.clinicID;
_referToDoctorRequest = ReferToDoctorRequest(
projectID: projectID,
admissionNo: admissionNo,
roomID: roomID,
referralClinic: selectedClinicID.toString(),
referralDoctor: selectedDoctorID.toString(),
createdBy: doctorID,
editedBy: doctorID,
patientID: patientID,
patientTypeID: patientTypeID,
referringClinic: clinicId,
referringDoctor: doctorID,
referringDoctorRemarks: referringDoctorRemarks,
priority: priority,
frequency: frequency,
extension: extension,
);
await baseAppClient.post(
PATIENT_PROGRESS_NOTE_URL,
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _referToDoctorRequest.toJson(),
);
}
}

@ -0,0 +1,51 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart';
import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
class ReferralPatientService extends BaseService {
List<MyReferralPatientModel> _listMyReferralPatientModel = [];
List<MyReferralPatientModel> get listMyReferralPatientModel => _listMyReferralPatientModel;
Helpers helpers = Helpers();
RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks();
Future getMyReferralPatient() async {
await baseAppClient.post(GET_MY_REFERRAL_PATIENT,
onSuccess: (dynamic response, int statusCode) {
_listMyReferralPatientModel.clear();
response['List_MyReferralPatient'].forEach((v) {
listMyReferralPatientModel.add(MyReferralPatientModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestMyReferralPatient .toJson(),);
}
Future replay(
String referredDoctorRemarks, MyReferralPatientModel model) async {
_requestAddReferredDoctorRemarks.admissionNo = model.admissionNo;
_requestAddReferredDoctorRemarks.patientID = model.patientID;
_requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks;
_requestAddReferredDoctorRemarks.lineItemNo = model.lineItemNo;
_requestAddReferredDoctorRemarks.referringDoctor = model.referringDoctor;
await baseAppClient.post(GET_MY_REFERRAL_PATIENT,
onSuccess: (dynamic response, int statusCode) {
model.referredDoctorRemarks = referredDoctorRemarks;
listMyReferralPatientModel[
listMyReferralPatientModel.indexOf(model)] = model;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestMyReferralPatient .toJson(),);
}
}

@ -0,0 +1,65 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/verify_referral_doctor_remarks.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
class ReferredPatientService extends BaseService {
List<MyReferredPatientModel> _listMyReferredPatientModel = [];
List<MyReferredPatientModel> get listMyReferredPatientModel =>
_listMyReferredPatientModel;
Helpers helpers = Helpers();
RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel();
VerifyReferralDoctorRemarks _verifyreferraldoctorremarks =
VerifyReferralDoctorRemarks();
Future getMyReferredPatient() async {
await baseAppClient.post(
GET_MY_REFERRED_PATIENT,
onSuccess: (dynamic response, int statusCode) {
_listMyReferredPatientModel.clear();
response['List_MyReferredPatient'].forEach((v) {
listMyReferredPatientModel.add(MyReferredPatientModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _requestMyReferralPatient.toJson(),
);
}
Future verify(MyReferredPatientModel model) async {
_verifyreferraldoctorremarks.patientID = model.projectId;
_verifyreferraldoctorremarks.admissionNo = model.admissionNo;
_verifyreferraldoctorremarks.lineItemNo = model.lineItemNo;
_verifyreferraldoctorremarks.referredDoctorRemarks =
model.referredDoctorRemarks;
_verifyreferraldoctorremarks.referringDoctor = model.referringDoctor;
_verifyreferraldoctorremarks.firstName = model.firstName;
_verifyreferraldoctorremarks.middleName = model.middleName;
_verifyreferraldoctorremarks.lastName = model.lastName;
_verifyreferraldoctorremarks.patientMobileNumber = model.mobileNumber;
_verifyreferraldoctorremarks.patientIdentificationID =
model.patientIdentificationNo;
await baseAppClient.post(
GET_MY_REFERRED_PATIENT,
onSuccess: (dynamic response, int statusCode) {
listMyReferredPatientModel[listMyReferredPatientModel.indexOf(model)] =
model;
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _verifyreferraldoctorremarks.toJson(),
);
}
}

@ -5,12 +5,12 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/config/config.dart';
import '../models/doctor/user_model.dart';
import '../../models/doctor/user_model.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
class AuthProvider with ChangeNotifier {
class AuthViewModel with ChangeNotifier {
List<ClinicModel> doctorsClinicList = [];
String selectedClinicName;
bool isLogin = false;
@ -23,7 +23,7 @@ class AuthProvider with ChangeNotifier {
}
AuthProvider() {
AuthViewModel() {
getUserAuthentication();
}

@ -1,7 +1,5 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/hospitals_model.dart';
import 'package:doctor_app_flutter/core/service/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/hospital/hospitals_service.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import '../../locator.dart';

@ -1,23 +1,31 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/hospitals_model.dart';
import 'package:doctor_app_flutter/core/service/hospital/hospitals_service.dart';
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:flutter/cupertino.dart';
import '../../locator.dart';
import 'base_view_model.dart';
// TODO change it when change login
class HospitalViewModel with ChangeNotifier {
BaseAppClient baseAppClient = BaseAppClient();
///This View Model just an example
class HospitalViewModel extends BaseViewModel {
HospitalService _hospitalService = locator<HospitalService>();
Future<Map> getProjectsList() async {
const url = GET_PROJECTS;
// TODO create model or remove it if no info need
var info = {
"LanguageID": 1,
"stamp": "2020-02-26T13:51:44.111Z",
"IPAdress": "11.11.11.11",
"VersionID": 1.2,
"Channel": 9,
"TokenID": "",
"SessionID": "i1UJwCTSqt",
"IsLoginForDoctorApp": true
};
dynamic localRes;
List<HospitalsModel> get hospitals => _hospitalService.hospitals;
Future getHospitals() async {
setState(ViewState.Busy);
await _hospitalService.getHospitals();
if (_hospitalService.hasError) {
error = _hospitalService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
await baseAppClient.post(url, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: info);
return Future.value(localRes);
}
}

@ -1,7 +1,7 @@
import 'dart:convert';
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/models/livecare/end_call_req.dart';
import 'package:doctor_app_flutter/models/livecare/get_panding_req_list.dart';
import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart';
@ -9,11 +9,10 @@ import 'package:doctor_app_flutter/models/livecare/start_call_req.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
class LiveCareProvider with ChangeNotifier {
//TODO: change it when Live care return back.
class LiveCareViewModel with ChangeNotifier {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
List<LiveCarePendingListResponse> liveCarePendingList = [];

@ -0,0 +1,32 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/medicine_service.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class MedicineViewModel extends BaseViewModel {
MedicineService _medicineService = locator<MedicineService>();
get pharmacyItemsList => _medicineService.pharmacyItemsList;
get pharmaciesList => _medicineService.pharmaciesList;
Future getMedicineItem(String itemName) async {
setState(ViewState.Busy);
await _medicineService.getMedicineItem(itemName);
if (_medicineService.hasError) {
error = _medicineService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPharmaciesList(int itemId) async {
setState(ViewState.Busy);
await _medicineService.getPharmaciesList(itemId);
if (_medicineService.hasError) {
error = _medicineService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -0,0 +1,244 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/patient_service.dart';
import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart';
import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart';
import 'package:doctor_app_flutter/models/patient/radiology/radiology_res_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class PatientViewModel extends BaseViewModel {
PatientService _patientService = locator<PatientService>();
List<VitalSignResModel> get patientVitalSignList =>
_patientService.patientVitalSignList;
List<VitalSignResModel> get patientVitalSignOrderdSubList =>
_patientService.patientVitalSignOrderdSubList;
List<LabOrdersResModel> get patientLabResultOrdersList =>
_patientService.patientLabResultOrdersList;
List<PrescriptionResModel> get patientPrescriptionsList =>
_patientService.patientPrescriptionsList;
List<PrescriptionReportForInPatient> get prescriptionReportForInPatientList =>
_patientService.prescriptionReportForInPatientList;
List<PrescriptionReport> get prescriptionReport =>
_patientService.prescriptionReport;
List<RadiologyResModel> get patientRadiologyList =>
_patientService.patientRadiologyList;
List<LabResult> get labResultList => _patientService.labResultList;
get insuranceApporvalsList => _patientService.insuranceApporvalsList;
get patientProgressNoteList => _patientService.patientProgressNoteList;
get clinicsList => _patientService.clinicsList;
get doctorsList => _patientService.doctorsList;
get referalFrequancyList => _patientService.referalFrequancyList;
Future getPatientList(PatientModel patient, patientType,
{bool isBusyLocal = false}) async {
if(isBusyLocal) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
}
return _patientService.getPatientList(patient, patientType);
if (_patientService.hasError) {
error = _patientService.error;
if(isBusyLocal) {
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Error);
} } else
setState(ViewState.Idle);
}
Future getPatientVitalSign(patient) async {
setState(ViewState.Busy);
await _patientService.getPatientVitalSign(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getLabResultOrders(patient) async {
setState(ViewState.Busy);
await _patientService.getLabResultOrders(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getOutPatientPrescriptions(patient) async {
setState(ViewState.Busy);
await _patientService.getOutPatientPrescriptions(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getInPatientPrescriptions(patient) async {
setState(ViewState.Busy);
await _patientService.getInPatientPrescriptions(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPrescriptionReport(patient) async {
setState(ViewState.Busy);
await _patientService.getPrescriptionReport(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPatientRadiology(patient) async {
setState(ViewState.Busy);
await _patientService.getPatientRadiology(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getLabResult(LabOrdersResModel labOrdersResModel) async {
setState(ViewState.Busy);
await _patientService.getLabResult(labOrdersResModel);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPatientInsuranceApprovals(patient) async {
setState(ViewState.Busy);
await _patientService.getPatientInsuranceApprovals(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPatientProgressNote(patient) async {
setState(ViewState.Busy);
await _patientService.getPatientProgressNote(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getClinicsList() async {
setState(ViewState.Busy);
await _patientService.getClinicsList();
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else {
{
await getReferralFrequancyList();
setState(ViewState.Idle);
}
}
}
Future getDoctorsList(String clinicId) async {
setState(ViewState.BusyLocal);
await _patientService.getDoctorsList(clinicId);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.ErrorLocal);
} else {
{
await getReferralFrequancyList();
setState(ViewState.Idle);
}
}
}
List getDoctorNameList() {
var doctorNamelist =
_patientService.doctorsList.map((value) => value['DoctorName'].toString()).toList();
return doctorNamelist;
}
List getClinicNameList() {
var clinicsNameslist = _patientService.clinicsList
.map((value) => value['ClinicDescription'].toString())
.toList();
return clinicsNameslist;
}
Future getReferralFrequancyList() async {
setState(ViewState.Busy);
await _patientService.getReferralFrequancyList();
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
List getReferralNamesList() {
var referralNamesList = _patientService.referalFrequancyList
.map((value) => value['Description'].toString())
.toList();
return referralNamesList;
}
Future referToDoctor(
{String selectedDoctorID,
String selectedClinicID,
int admissionNo,
String extension,
String priority,
String frequency,
String referringDoctorRemarks,
int patientID,
int patientTypeID,
String roomID,
int projectID}) async {
setState(ViewState.BusyLocal);
await _patientService.referToDoctor(
selectedClinicID: selectedClinicID,
selectedDoctorID: selectedDoctorID,
admissionNo: admissionNo,
extension: extension,
priority: priority,
frequency: frequency,
referringDoctorRemarks: referringDoctorRemarks,
patientID: patientID,
patientTypeID: patientTypeID,
roomID: roomID,
projectID: projectID);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/providers/auth_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart';
@ -121,7 +121,7 @@ class ProjectProvider with ChangeNotifier {
tokenID: '',
languageID: 2);
Provider.of<AuthProvider>(AppGlobal.CONTEX, listen: false)
Provider.of<AuthViewModel>(AppGlobal.CONTEX, listen: false)
.getDocProfiles(docInfo.toJson())
.then((res) async {
sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]);

@ -0,0 +1,32 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/referral_patient_service.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class ReferralPatientViewModel extends BaseViewModel {
ReferralPatientService _referralPatientService = locator<ReferralPatientService>();
List<MyReferralPatientModel> get listMyReferralPatientModel => _referralPatientService.listMyReferralPatientModel;
Future getMyReferralPatient() async {
setState(ViewState.Busy);
await _referralPatientService.getMyReferralPatient();
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future replay(String referredDoctorRemarks, MyReferralPatientModel model) async {
setState(ViewState.BusyLocal);
await _referralPatientService.replay(referredDoctorRemarks, model);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -0,0 +1,32 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/referred_patient_service.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class ReferredPatientViewModel extends BaseViewModel {
ReferredPatientService _referralPatientService = locator<ReferredPatientService>();
List<MyReferredPatientModel> get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel;
Future getMyReferredPatient() async {
setState(ViewState.Busy);
await _referralPatientService.getMyReferredPatient();
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future verify(MyReferredPatientModel model) async {
setState(ViewState.BusyLocal);
await _referralPatientService.verify(model);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -1,10 +1,6 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/hospitals_model.dart';
import 'package:doctor_app_flutter/core/service/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/hospital/hospitals_service.dart';
import 'package:doctor_app_flutter/core/service/schedule_service.dart';
import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';

@ -39,7 +39,7 @@ class _LandingPageState extends State<LandingPage> {
return Scaffold(
appBar: AppBar(
elevation: 0,
backgroundColor: Hexcolor('#515B5D'),
backgroundColor: HexColor('#515B5D'),
textTheme: TextTheme(
headline6:
TextStyle(color: Colors.white)),

@ -1,10 +1,16 @@
import 'package:doctor_app_flutter/core/service/patient_service.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:get_it/get_it.dart';
import 'core/service/doctor_reply_service.dart';
import 'core/service/hospital/hospitals_service.dart';
import 'core/service/medicine_service.dart';
import 'core/service/referral_patient_service.dart';
import 'core/service/referred_patient_service.dart';
import 'core/service/schedule_service.dart';
import 'core/viewModel/doctor_replay_view_model.dart';
import 'core/viewModel/hospital_view_model.dart';
import 'core/viewModel/medicine_view_model.dart';
import 'core/viewModel/referral_view_model.dart';
import 'core/viewModel/referred_view_model.dart';
import 'core/viewModel/schedule_view_model.dart';
GetIt locator = GetIt.instance;
@ -12,12 +18,18 @@ GetIt locator = GetIt.instance;
///di
void setupLocator() {
/// Services
locator.registerLazySingleton(() => HospitalService());
locator.registerLazySingleton(() => DoctorReplyService());
locator.registerLazySingleton(() => ScheduleService());
locator.registerLazySingleton(() => ReferralPatientService());
locator.registerLazySingleton(() => ReferredPatientService());
locator.registerLazySingleton(() => MedicineService());
locator.registerLazySingleton(() => PatientService());
/// View Model
locator.registerFactory(() => HospitalViewModel());
locator.registerFactory(() => DoctorReplayViewModel());
locator.registerFactory(() => ScheduleViewModel());
locator.registerFactory(() => ReferralPatientViewModel());
locator.registerFactory(() => ReferredPatientViewModel());
locator.registerFactory(() => MedicineViewModel());
locator.registerFactory(() => PatientViewModel());
}

@ -1,6 +1,5 @@
import 'package:doctor_app_flutter/providers/livecare_provider.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
@ -8,9 +7,8 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import './config/size_config.dart';
import './providers/auth_provider.dart';
import './providers/patients_provider.dart';
import './providers/hospital_provider.dart';
import 'core/viewModel/auth_view_model.dart';
import 'core/viewModel/hospital_view_model.dart';
import './routes.dart';
import 'config/config.dart';
import 'locator.dart';
@ -31,19 +29,16 @@ class MyApp extends StatelessWidget {
SizeConfig().init(constraints, orientation);
return MultiProvider(
providers: [
ChangeNotifierProvider<PatientsProvider>(
create: (context) => PatientsProvider()),
ChangeNotifierProvider<AuthProvider>(
create: (context) => AuthProvider()),
ChangeNotifierProvider<HospitalProvider>(
create: (context) => HospitalProvider()),
ChangeNotifierProvider<AuthViewModel>(
create: (context) => AuthViewModel()),
ChangeNotifierProvider<HospitalViewModel>(
create: (context) => HospitalViewModel()),
ChangeNotifierProvider<ProjectProvider>(
create: (context) => ProjectProvider(),
),
ChangeNotifierProvider<LiveCareProvider>(
create: (context) => LiveCareProvider(),
ChangeNotifierProvider<LiveCareViewModel>(
create: (context) => LiveCareViewModel(),
),
ChangeNotifierProvider<MedicineProvider>(create: (context) => MedicineProvider(),),
],
child: Consumer<ProjectProvider>(
builder: (context,projectProvider,child) => MaterialApp(
@ -62,7 +57,7 @@ class MyApp extends StatelessWidget {
theme: ThemeData(
primarySwatch: Colors.grey,
primaryColor: Colors.grey,
buttonColor: Hexcolor('#B8382C'),
buttonColor: HexColor('#B8382C'),
fontFamily: 'WorkSans',
dividerColor: Colors.grey[350],
backgroundColor: Color.fromRGBO(255,255,255, 1)

@ -1,29 +0,0 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:flutter/cupertino.dart';
class HospitalProvider with ChangeNotifier {
BaseAppClient baseAppClient = BaseAppClient();
Future<Map> getProjectsList() async {
const url = GET_PROJECTS;
var info = {
"LanguageID": 1,
"stamp": "2020-02-26T13:51:44.111Z",
"IPAdress": "11.11.11.11",
"VersionID": 1.2,
"Channel": 9,
"TokenID": "",
"SessionID": "i1UJwCTSqt",
"IsLoginForDoctorApp": true
};
dynamic localRes;
await baseAppClient.post(url, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: info);
return Future.value(localRes);
}
}

@ -1,78 +0,0 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/pharmacies/pharmacies_List_request_model.dart';
import 'package:doctor_app_flutter/models/pharmacies/pharmacies_items_request_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/cupertino.dart';
class MedicineProvider with ChangeNotifier {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
var pharmacyItemsList = [];
var pharmaciesList = [];
bool isFinished = true;
bool hasError = false;
String errorMsg = '';
BaseAppClient baseAppClient = BaseAppClient();
PharmaciesItemsRequestModel _itemsRequestModel =
PharmaciesItemsRequestModel();
PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel();
clearPharmacyItemsList() {
pharmacyItemsList.clear();
notifyListeners();
}
getMedicineItem(String itemName) async {
_itemsRequestModel.pHRItemName = itemName;
resetDefaultValues();
pharmacyItemsList.clear();
notifyListeners();
try {
await baseAppClient.post(PHARMACY_ITEMS_URL,
onSuccess: (dynamic response, int statusCode) {
pharmacyItemsList = response['ListPharmcy_Region_enh'];
hasError = false;
isFinished = true;
errorMsg = "Done";
}, onFailure: (String error, int statusCode) {
isFinished = true;
hasError = true;
errorMsg = error;
}, body: _itemsRequestModel.toJson());
notifyListeners();
} catch (error) {
throw error;
}
}
getPharmaciesList(int itemId) async {
resetDefaultValues();
try {
_listRequestModel.itemID = itemId;
isFinished = false;
await baseAppClient.post(PHARMACY_LIST_URL,
onSuccess: (dynamic response, int statusCode) {
pharmaciesList = response['PharmList'];
hasError = false;
isFinished = true;
errorMsg = "Done";
}, onFailure: (String error, int statusCode) {
isFinished = true;
hasError = true;
errorMsg = error;
}, body: _listRequestModel.toJson());
notifyListeners();
} catch (error) {
throw error;
}
}
resetDefaultValues() {
isFinished = false;
hasError = false;
errorMsg = '';
notifyListeners();
}
}

@ -1,542 +0,0 @@
import 'dart:convert';
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_list_stp_referral_frequency_request.dart';
import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart';
import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart';
import 'package:doctor_app_flutter/models/patient/lab_result/lab_result_req_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart';
import 'package:doctor_app_flutter/models/patient/radiology/radiology_res_model.dart';
import 'package:doctor_app_flutter/models/patient/refer_to_doctor_request.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/cupertino.dart';
import '../config/config.dart';
import '../models/patient/lab_orders/lab_orders_res_model.dart';
import '../models/patient/patiant_info_model.dart';
import '../models/patient/patient_model.dart';
import '../models/patient/prescription/prescription_res_model.dart';
import '../models/patient/radiology/radiology_res_model.dart';
import '../models/patient/vital_sign/vital_sign_res_model.dart';
import '../util/helpers.dart';
Helpers helpers = Helpers();
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class PatientsProvider with ChangeNotifier {
bool isLoading = false;
bool isError = false;
String error = '';
List<VitalSignResModel> patientVitalSignList = [];
List<VitalSignResModel> patientVitalSignOrderdSubList = [];
List<LabOrdersResModel> patientLabResultOrdersList = [];
List<PrescriptionResModel> patientPrescriptionsList = [];
List<RadiologyResModel> patientRadiologyList = [];
List<PrescriptionReportForInPatient> prescriptionReportForInPatientList = [];
List<PrescriptionReport> prescriptionReport = [];
BaseAppClient baseAppClient = BaseAppClient();
/*@author: ibrahe albitar
*@Date:2/6/2020
*@desc: getPatientPrescriptions
*/
List<LabResult> labResultList = [];
var patientProgressNoteList = [];
var insuranceApporvalsList = [];
var doctorsList = [];
var clinicsList = [];
var referalFrequancyList = [];
DoctorsByClinicIdRequest _doctorsByClinicIdRequest =
DoctorsByClinicIdRequest();
STPReferralFrequencyRequest _referralFrequencyRequest =
STPReferralFrequencyRequest();
ClinicByProjectIdRequest _clinicByProjectIdRequest =
ClinicByProjectIdRequest();
ReferToDoctorRequest _referToDoctorRequest;
PatiantInformtion _selectedPatient;
Future<dynamic> getPatientList(PatientModel patient, patientType) async {
int val = int.parse(patientType);
try {
dynamic localRes;
await baseAppClient.post(GET_PATIENT + SERVICES_PATIANT[val],
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: {
"ProjectID": patient.ProjectID,
"ClinicID": patient.ClinicID,
"DoctorID": patient.DoctorID,
"FirstName": patient.FirstName,
"MiddleName": patient.MiddleName,
"LastName": patient.LastName,
"PatientMobileNumber": patient.PatientMobileNumber,
"PatientIdentificationID": patient.PatientIdentificationID,
"PatientID": patient.PatientID,
"From": patient.From,
"To": patient.To,
"LanguageID": patient.LanguageID,
"stamp": patient.stamp,
"IPAdress": patient.IPAdress,
"VersionID": patient.VersionID,
"Channel": patient.Channel,
"TokenID": patient.TokenID,
"SessionID": patient.SessionID,
"IsLoginForDoctorApp": patient.IsLoginForDoctorApp,
"PatientOutSA": patient.PatientOutSA
});
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
setBasicData() {
isLoading = true;
isError = false;
error = '';
notifyListeners();
}
/*
*@author: Elham Rababah
*@Date:27/4/2020
*@param: patient
*@return:
*@desc: getPatientVitalSign
*/
getPatientVitalSign(patient) async {
setBasicData();
try {
await baseAppClient.post(GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) {
patientVitalSignList = [];
response['List_DoctorPatientVitalSign'].forEach((v) {
patientVitalSignList.add(new VitalSignResModel.fromJson(v));
});
if (patientVitalSignList.length > 0) {
List<VitalSignResModel> patientVitalSignOrderdSubListTemp = [];
patientVitalSignOrderdSubListTemp = patientVitalSignList;
patientVitalSignOrderdSubListTemp
.sort((VitalSignResModel a, VitalSignResModel b) {
return b.vitalSignDate.microsecondsSinceEpoch -
a.vitalSignDate.microsecondsSinceEpoch;
});
patientVitalSignOrderdSubList.clear();
int length = patientVitalSignOrderdSubListTemp.length >= 20
? 20
: patientVitalSignOrderdSubListTemp.length;
for (int x = 0; x < length; x++) {
patientVitalSignOrderdSubList
.add(patientVitalSignOrderdSubListTemp[x]);
}
}
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
/*@author: Elham Rababah
*@Date:27/4/2020
*@param: patient
*@return:
*@desc: getLabResult Orders
*/
getLabResultOrders(patient) async {
// isLoading = true;
// notifyListeners();
setBasicData();
try {
await baseAppClient.post(GET_PATIENT_LAB_OREDERS,
onSuccess: (dynamic response, int statusCode) {
patientLabResultOrdersList = [];
response['List_GetLabOreders'].forEach((v) {
patientLabResultOrdersList.add(new LabOrdersResModel.fromJson(v));
});
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
/*@author: Elham Rababah
*@Date:3/5/2020
*@param: patient
*@return:
*@desc: geOutPatientPrescriptions
*/
getOutPatientPrescriptions(patient) async {
setBasicData();
try {
await baseAppClient.post(GET_PRESCRIPTION,
onSuccess: (dynamic response, int statusCode) {
patientPrescriptionsList = [];
response['PatientPrescriptionList'].forEach((v) {
patientPrescriptionsList.add(new PrescriptionResModel.fromJson(v));
});
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
/*@author: Mohammad Aljammal
*@Date:4/6/2020
*@param: patient
*@return:
*@desc: getInPatientPrescriptions
*/
getInPatientPrescriptions(patient) async {
setBasicData();
try {
prescriptionReportForInPatientList = [];
notifyListeners();
await baseAppClient.post(GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT,
onSuccess: (dynamic response, int statusCode) {
response['List_PrescriptionReportForInPatient'].forEach((v) {
prescriptionReportForInPatientList
.add(PrescriptionReportForInPatient.fromJson(v));
});
isError = false;
isLoading = false;
}, onFailure: (String error, int statusCode) {
isError = true;
isLoading = false;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
getPrescriptionReport(prescriptionReqModel) async {
prescriptionReport = [];
isLoading = true;
isError = false;
error = "";
notifyListeners();
await baseAppClient.post(GET_PRESCRIPTION_REPORT,
onSuccess: (dynamic response, int statusCode) {
response['ListPRM'].forEach((v) {
prescriptionReport.add(PrescriptionReport.fromJson(v));
});
isError = false;
isLoading = false;
}, onFailure: (String error, int statusCode) {
isError = true;
isLoading = false;
this.error = error;
}, body: prescriptionReqModel);
notifyListeners();
}
/*@author: Elham Rababah
*@Date:12/5/2020
*@param: patient
*@return:
*@desc: getPatientRadiology
*/
handelCatchErrorCase(err) {
isLoading = false;
isError = true;
error = helpers.generateContactAdminMsg(err);
notifyListeners();
throw err;
}
/*@author: Elham Rababah
*@Date:3/5/2020
*@param: patient
*@return:
*@desc: getPatientRadiology
*/
getPatientRadiology(patient) async {
// isLoading = true;
// notifyListeners();
setBasicData();
try {
await baseAppClient.post(GET_RADIOLOGY,
onSuccess: (dynamic response, int statusCode) {
patientRadiologyList = [];
response['List_GetRadOreders'].forEach((v) {
patientRadiologyList.add(new RadiologyResModel.fromJson(v));
});
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
getLabResult(LabOrdersResModel labOrdersResModel) async {
labResultList.clear();
isLoading = true;
notifyListeners();
RequestLabResult requestLabResult = RequestLabResult();
requestLabResult.sessionID = labOrdersResModel.setupID;
requestLabResult.orderNo = labOrdersResModel.orderNo;
requestLabResult.invoiceNo = labOrdersResModel.invoiceNo;
requestLabResult.patientTypeID = labOrdersResModel.patientType;
await baseAppClient.post(GET_PATIENT_LAB_RESULTS,
onSuccess: (dynamic response, int statusCode) {
isError = false;
isLoading = false;
response['List_GetLabNormal'].forEach((v) {
labResultList.add(new LabResult.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
isError = true;
isLoading = false;
this.error = error;
}, body: requestLabResult.toJson());
notifyListeners();
}
getPatientInsuranceApprovals(patient) async {
setBasicData();
try {
await baseAppClient.post(PATIENT_INSURANCE_APPROVALS_URL,
onSuccess: (dynamic response, int statusCode) {
insuranceApporvalsList = response['List_ApprovalMain_InPatient'];
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
/*@author: ibrahe albitar
*@Date:2/6/2020
*@desc: getPatientProgressNote
*/
getPatientProgressNote(patient) async {
setBasicData();
try {
await baseAppClient.post(PATIENT_PROGRESS_NOTE_URL,
onSuccess: (dynamic response, int statusCode) {
patientProgressNoteList = response['List_GetPregressNoteForInPatient'];
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
/*@author: ibrahem albitar
*@Date:3/6/2020
*@desc: getDoctorsList
*/
getDoctorsList(String clinicId) async {
setBasicData();
try {
_doctorsByClinicIdRequest.clinicID = clinicId;
await baseAppClient.post(PATIENT_GET_DOCTOR_BY_CLINIC_URL,
onSuccess: (dynamic response, int statusCode) {
doctorsList = response['List_Doctors_All'];
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: _doctorsByClinicIdRequest.toJson());
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
List getDoctorNameList() {
var doctorNamelist =
doctorsList.map((value) => value['DoctorName'].toString()).toList();
return doctorNamelist;
}
/*@author: ibrahem albitar
*@Date:3/6/2020
*@desc: getClinicsList
*/
getClinicsList() async {
setBasicData();
try {
await baseAppClient.post(PATIENT_GET_CLINIC_BY_PROJECT_URL,
onSuccess: (dynamic response, int statusCode) {
clinicsList = response['List_Clinic_All'];
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: _clinicByProjectIdRequest.toJson());
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
List getClinicNameList() {
var clinicsNameslist = clinicsList
.map((value) => value['ClinicDescription'].toString())
.toList();
return clinicsNameslist;
}
/*@author: ibrahem albitar
*@Date:3/6/2020
*@desc: getReferralFrequancyList
*/
getReferralFrequancyList() async {
setBasicData();
try {
await baseAppClient.post(PATIENT_GET_LIST_REFERAL_URL,
onSuccess: (dynamic response, int statusCode) {
referalFrequancyList = response['list_STPReferralFrequency'];
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: _referralFrequencyRequest.toJson());
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
List getReferralNamesList() {
var referralNamesList = referalFrequancyList
.map((value) => value['Description'].toString())
.toList();
return referralNamesList;
}
/*@author: ibrahem albitar
*@Date:3/6/2020
*@desc: referToDoctor
*/
referToDoctor(context,
{String selectedDoctorID,
String selectedClinicID,
int admissionNo,
String extension,
String priority,
String frequency,
String referringDoctorRemarks,
int patientID,
int patientTypeID,
String roomID,
int projectID}) async {
setBasicData();
try {
String token = await sharedPref.getString(TOKEN);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile =
new DoctorProfileModel.fromJson(profile);
int doctorID = doctorProfile.doctorID;
int clinicId = doctorProfile.clinicID;
_referToDoctorRequest = ReferToDoctorRequest(
projectID: projectID,
admissionNo: admissionNo,
roomID: roomID,
referralClinic: selectedClinicID.toString(),
referralDoctor: selectedDoctorID.toString(),
createdBy: doctorID,
editedBy: doctorID,
patientID: patientID,
patientTypeID: patientTypeID,
referringClinic: clinicId,
referringDoctor: doctorID,
referringDoctorRemarks: referringDoctorRemarks,
priority: priority,
frequency: frequency,
extension: extension,
tokenID: token);
await baseAppClient.post(PATIENT_REFER_TO_DOCTOR_URL,
onSuccess: (dynamic response, int statusCode) {
// print('Done : \n $res');
Navigator.pop(context);
},
onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
},
body: _referToDoctorRequest.toJson());
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
}

@ -1,77 +0,0 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart';
import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart';
import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart';
class MyReferralPatientProvider with ChangeNotifier {
List<MyReferralPatientModel> listMyReferralPatientModel = [];
bool isLoading = true;
bool isError = false;
String error = '';
Helpers helpers = Helpers();
BaseAppClient baseAppClient = BaseAppClient();
RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks();
MyReferralPatientProvider() {
getMyReferralPatient();
}
getMyReferralPatient() async {
try {
await baseAppClient.post(GET_MY_REFERRAL_PATIENT,
body: _requestMyReferralPatient.toJson(),
onSuccess: (dynamic response, int statusCode) {
response['List_MyReferralPatient'].forEach((v) {
listMyReferralPatientModel.add(MyReferralPatientModel.fromJson(v));
});
isError = false;
isLoading = false;
},
onFailure: (String error, int statusCode) {
isError = true;
isLoading = false;
this.error = error;
},
);
notifyListeners();
} catch (error) {
isLoading = false;
isError = true;
this.error = 'Something wrong happened, please contact the admin';
notifyListeners();
}
}
Future replay(
String referredDoctorRemarks, MyReferralPatientModel model) async {
try {
_requestAddReferredDoctorRemarks.admissionNo = model.admissionNo;
_requestAddReferredDoctorRemarks.patientID = model.patientID;
_requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks;
_requestAddReferredDoctorRemarks.lineItemNo = model.lineItemNo;
_requestAddReferredDoctorRemarks.referringDoctor = model.referringDoctor;
await baseAppClient.post(ADD_REFERRED_DOCTOR_REMARKS,
body: _requestAddReferredDoctorRemarks.toJson(),
onSuccess: (dynamic body, int statusCode) {
model.referredDoctorRemarks = referredDoctorRemarks;
listMyReferralPatientModel[
listMyReferralPatientModel.indexOf(model)] = model;
notifyListeners();
},
onFailure: (String error, int statusCode) {
throw (error);
},
);
} catch (error) {
throw error;
}
}
}

@ -1,83 +0,0 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart';
import 'package:doctor_app_flutter/models/doctor/verify_referral_doctor_remarks.dart';
import 'package:flutter/cupertino.dart';
import '../util/helpers.dart';
class MyReferredPatientProvider with ChangeNotifier {
List<MyReferredPatientModel> listMyReferredPatientModel = [];
bool isLoading = true;
bool isError = false;
String error = '';
Helpers helpers = Helpers();
RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel();
VerifyReferralDoctorRemarks _verifyreferraldoctorremarks = VerifyReferralDoctorRemarks();
MyReferredPatientProvider() {
getMyReferralPatient();
}
BaseAppClient baseAppClient = BaseAppClient();
getMyReferralPatient() async {
try {
await baseAppClient.post(GET_MY_REFERRED_PATIENT,
body: _requestMyReferralPatient.toJson(),
onSuccess: (dynamic response, int statusCode) {
response['List_MyReferredPatient'].forEach((v) {
listMyReferredPatientModel.add(MyReferredPatientModel.fromJson(v));
});
isError = false;
isLoading = false;
},
onFailure: (String error, int statusCode) {
isError = true;
isLoading = false;
this.error = error;
},
);
notifyListeners();
} catch (error) {
isLoading = false;
isError = true;
this.error = 'Something wrong happened, please contact the admin';
notifyListeners();
}
}
Future verify(
MyReferredPatientModel model) async {
try {
_verifyreferraldoctorremarks.patientID=model.projectId;
_verifyreferraldoctorremarks.admissionNo =model.admissionNo;
_verifyreferraldoctorremarks.lineItemNo = model.lineItemNo;
_verifyreferraldoctorremarks.referredDoctorRemarks=model.referredDoctorRemarks;
_verifyreferraldoctorremarks.referringDoctor=model.referringDoctor;
_verifyreferraldoctorremarks.firstName=model.firstName;
_verifyreferraldoctorremarks.middleName=model.middleName;
_verifyreferraldoctorremarks.lastName=model.lastName;
_verifyreferraldoctorremarks.patientMobileNumber=model.mobileNumber;
_verifyreferraldoctorremarks.patientIdentificationID=model.patientIdentificationNo;
await baseAppClient.post(GET_MY_REFERRED_PATIENT,
body: _verifyreferraldoctorremarks.toJson(),
onSuccess: (dynamic body, int statusCode) {
listMyReferredPatientModel[
listMyReferredPatientModel.indexOf(model)] = model;
notifyListeners();
},
onFailure: (String error, int statusCode) {
throw(error);
},
);
} catch (error) {
throw(error);
}
}
}

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/providers/auth_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/screens/auth/login_screen.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:flutter/cupertino.dart';
@ -11,7 +11,7 @@ import 'landing_page.dart';
class RootPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
AuthProvider authProvider = Provider.of(context);
AuthViewModel authProvider = Provider.of(context);
Widget buildRoot() {
switch (authProvider.stutas) {
case APP_STATUS.LOADING:

@ -32,7 +32,6 @@ import './screens/patients/profile/progress_note_screen.dart';
import './screens/patients/profile/radiology/radiology_screen.dart';
import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart';
import './screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart';
import './screens/patients/profile/vital_sign/vital_sign_screen.dart';
import './screens/profile_screen.dart';
import './screens/settings/settings_screen.dart';
import 'landing_page.dart';
@ -96,7 +95,6 @@ var routes = {
PHARMACIES_LIST: (_) => PharmaciesListScreen(
itemID: null,
),
VITAL_SIGN: (_) => VitalSignScreen(),
MESSAGES: (_) => MessagesScreen(),
SERVICES: (_) => ServicesScreen(),
LAB_ORDERS: (_) => LabOrdersScreen(),

@ -1,23 +1,23 @@
import 'package:barcode_scan/platform_wrapper.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/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
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/providers/patients_provider.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.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/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import '../routes.dart';
import 'base/base_view.dart';
Helpers helpers = Helpers();
class QrReaderScreen extends StatefulWidget {
@override
@ -55,18 +55,22 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).qr+ TranslationBase.of(context).reader,
body: Center(
child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
child: FractionallySizedBox(
widthFactor: 0.9,
child: ListView(
children: [
AppText(
TranslationBase.of(context).startScanning,
fontSize: 18,
return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle:
TranslationBase.of(context).qr + TranslationBase.of(context).reader,
body: Center(
child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
child: FractionallySizedBox(
widthFactor: 0.9,
child: ListView(
children: [
AppText(
TranslationBase.of(context).startScanning,
fontSize: 18,
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
),
@ -89,7 +93,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
),
Button(
onTap: () {
_scanQrAndGetPatient(context);
_scanQrAndGetPatient(context, model);
},
title: TranslationBase.of(context).scanQr,
loading: isLoading,
@ -111,20 +115,22 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
error ??
TranslationBase.of(context)
.errorMessage,
color: Theme.of(context).errorColor)),
color: Theme
.of(context)
.errorColor)),
],
),
)
)
: Container(),
],
],
),
),
),
),
),
),
),
);
),);
}
_scanQrAndGetPatient(BuildContext context) async {
_scanQrAndGetPatient(BuildContext context, PatientViewModel model) async {
/// When give qr we will change this method to get data
/// var result = await BarcodeScanner.scan();
/// int patientID = get from qr result
@ -148,8 +154,8 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
// Provider.of<PatientsProvider>(context, listen: false);
patient.PatientID = 8808;
patient.TokenID = token;
Provider.of<PatientsProvider>(context, listen: false)
.getPatientList(patient, "1")
model
.getPatientList(patient, "1", isBusyLocal: true)
.then((response) {
if (response['MessageStatus'] == 1) {
switch (patientType) {

@ -4,12 +4,9 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/providers/auth_provider.dart';
import 'package:doctor_app_flutter/providers/hospital_provider.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/providers/referral_patient_provider.dart';
import 'package:doctor_app_flutter/providers/referred_patient_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -41,8 +38,8 @@ class DashboardScreen extends StatefulWidget {
}
class _DashboardScreenState extends State<DashboardScreen> {
HospitalProvider hospitalProvider;
AuthProvider authProvider;
HospitalViewModel hospitalProvider;
AuthViewModel authProvider;
bool isLoading = false;
ProjectProvider projectsProvider;
var _isInit = true;
@ -85,7 +82,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: <Widget>[
Container(
height: 140,
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
width: double.infinity,
child: FractionallySizedBox(
widthFactor: 0.9,
@ -224,7 +221,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
bottom: 19,
child: Container(
decoration: BoxDecoration(
color: Hexcolor("#DED8CF"),
color: HexColor("#DED8CF"),
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
@ -252,20 +249,20 @@ class _DashboardScreenState extends State<DashboardScreen> {
AppText("38",
fontSize:
SizeConfig.textMultiplier * 3.7,
color: Hexcolor('#5D4C35'),
color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold,),
AppText(TranslationBase
.of(context)
.outPatients,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.4,
color: Hexcolor('#5D4C35'),
color: HexColor('#5D4C35'),
),
],
),
circularStrokeCap: CircularStrokeCap.butt,
backgroundColor: Colors.blueGrey[100],
progressColor: Hexcolor('#B8382C'),
progressColor: HexColor('#B8382C'),
),
),
Container(
@ -279,7 +276,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
border: TableBorder.symmetric(
inside: BorderSide(
width: 0.5,
color: Hexcolor('#5D4C35'),
color: HexColor('#5D4C35'),
),
),
children: [
@ -293,13 +290,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
TranslationBase.of(context).arrived,
fontSize:
SizeConfig.textMultiplier * 1.5,
color: Hexcolor('#5D4C35'),
color: HexColor('#5D4C35'),
),
AppText(
"23",
fontSize:
SizeConfig.textMultiplier * 2.7,
color: Hexcolor('#5D4C35'),
color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold,
),
SizedBox(
@ -315,13 +312,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
TranslationBase.of(context).er,
fontSize:
SizeConfig.textMultiplier * 1.5,
color: Hexcolor('#5D4C35'),
color: HexColor('#5D4C35'),
),
AppText(
"03",
fontSize:
SizeConfig.textMultiplier * 2.7,
color: Hexcolor('#5D4C35'),
color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold,
),
SizedBox(
@ -344,13 +341,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
TranslationBase.of(context).notArrived,
fontSize:
SizeConfig.textMultiplier * 1.5,
color: Hexcolor('#5D4C35'),
color: HexColor('#5D4C35'),
),
AppText(
"15",
fontSize:
SizeConfig.textMultiplier * 2.7,
color: Hexcolor('#5D4C35'),
color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold,
),
],
@ -366,13 +363,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
TranslationBase.of(context).walkIn,
fontSize:
SizeConfig.textMultiplier * 1.5,
color: Hexcolor('#5D4C35'),
color: HexColor('#5D4C35'),
),
AppText(
"04",
fontSize:
SizeConfig.textMultiplier * 2.7,
color: Hexcolor('#5D4C35'),
color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold,
),
],
@ -556,7 +553,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
),
imageName: '4.png',
color: Hexcolor('#B8382C'),
color: HexColor('#B8382C'),
hasBorder: false,
width: MediaQuery
.of(context)
@ -610,7 +607,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
),
imageName: '5.png',
color: Hexcolor('#B8382C'),
color: HexColor('#B8382C'),
hasBorder: false,
width: MediaQuery
.of(context)
@ -746,10 +743,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
context,
MaterialPageRoute(
builder: (context) =>
ChangeNotifierProvider(
create: (_) => MedicineProvider(),
child: MedicineSearchScreen(),
),
MedicineSearchScreen(),
),
);
},
@ -826,11 +820,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
context,
MaterialPageRoute(
builder: (context) =>
ChangeNotifierProvider(
create: (_) =>
MyReferralPatientProvider(),
child: MyReferralPatient(),
),
MyReferralPatient(),
),
);
},
@ -859,11 +849,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
context,
MaterialPageRoute(
builder: (context) =>
ChangeNotifierProvider(
create: (_) =>
MyReferredPatientProvider(),
child: MyReferredPatient(),
),
MyReferredPatient(),
),
);
},
@ -1025,7 +1011,7 @@ class DashboardItem extends StatelessWidget {
.height * 0.35,
decoration: BoxDecoration(
color: !hasBorder ? color != null ? color : Hexcolor('#050705')
color: !hasBorder ? color != null ? color : HexColor('#050705')
.withOpacity(opacity) : Colors
.white,
borderRadius: BorderRadius.circular(6.0),

@ -1,31 +1,28 @@
import 'package:doctor_app_flutter/providers/referral_patient_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/referral_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/doctor/my_referral_patient_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:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
class MyReferralPatient extends StatelessWidget {
MyReferralPatientProvider referralPatientProvider;
class MyReferralPatient extends StatefulWidget {
int expandedItemIndex = -1;
@override
_MyReferralPatientState createState() => _MyReferralPatientState();
}
class _MyReferralPatientState extends State<MyReferralPatient> {
@override
Widget build(BuildContext context) {
referralPatientProvider = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).myReferralPatient,
body: referralPatientProvider.isLoading
? DrAppCircularProgressIndeicator()
: referralPatientProvider.isError
? Center(
child: AppText(
referralPatientProvider.error,
color: Theme.of(context).errorColor,
),
)
: referralPatientProvider.listMyReferralPatientModel.length == 0
return BaseView<ReferralPatientViewModel>(
onModelReady: (model) => model.getMyReferralPatient(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).myReferralPatient,
body: model.listMyReferralPatientModel.length == 0
? Center(
child: AppText(
TranslationBase.of(context).errorNoSchedule,
@ -44,13 +41,28 @@ class MyReferralPatient extends StatelessWidget {
),
Container(
child: Column(
children: referralPatientProvider
.listMyReferralPatientModel
.map((item) {
return MyReferralPatientWidget(
myReferralPatientModel: item,
);
}).toList(),
children: [
...List.generate(
model.listMyReferralPatientModel.length,
(index) => MyReferralPatientWidget(
myReferralPatientModel: model
.listMyReferralPatientModel[index],
model: model,
expandClick: () {
setState(() {
if (widget.expandedItemIndex ==
index) {
widget.expandedItemIndex = -1;
} else {
widget.expandedItemIndex = index;
}
});
},
isExpand:
widget.expandedItemIndex == index,
),
)
],
),
),
],
@ -58,6 +70,6 @@ class MyReferralPatient extends StatelessWidget {
],
),
),
);
));
}
}

@ -1,42 +1,33 @@
import 'package:doctor_app_flutter/providers/referred_patient_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/referred_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/doctor/my_referred_patient_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:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
class MyReferredPatient extends StatelessWidget {
MyReferredPatientProvider referredPatientProvider;
@override
Widget build(BuildContext context) {
referredPatientProvider = Provider.of(context);
return AppScaffold(
return BaseView<ReferredPatientViewModel>(
onModelReady: (model) => model.getMyReferredPatient(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).myReferredPatient,
body: referredPatientProvider.isLoading
? DrAppCircularProgressIndeicator()
: referredPatientProvider.isError
? Center(
child: AppText(
referredPatientProvider.error,
color: Theme.of(context).errorColor,
),
)
: referredPatientProvider.listMyReferredPatientModel.length == 0
? Center(
child: AppText(
TranslationBase.of(context).errorNoSchedule,
color: Theme.of(context).errorColor,
),
)
: Container(
padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0),
child: ListView(
children: <Widget>[
Column(
body: model.listMyReferredPatientModel.length == 0
? Center(
child: AppText(
TranslationBase.of(context).errorNoSchedule,
color: Theme.of(context).errorColor,
),
)
: Container(
padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0),
child: ListView(
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
@ -45,11 +36,12 @@ class MyReferredPatient extends StatelessWidget {
Container(
child: Column(
//children: referredPatientProvider.listMyReferralPatientModel.map((item) {
children: referredPatientProvider
children: model
.listMyReferredPatientModel
.map((item) {
return MyReferredPatientWidget(
myReferredPatientModel: item,
model:model
);
}).toList(),
),
@ -59,6 +51,6 @@ class MyReferredPatient extends StatelessWidget {
],
),
),
);
));
}
}

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/livecare_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart';
import 'package:doctor_app_flutter/screens/live_care/video_call.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
@ -33,12 +33,12 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
List<LiveCarePendingListResponse> _data = [];
Helpers helpers = new Helpers();
bool _isInit = true;
LiveCareProvider _liveCareProvider;
LiveCareViewModel _liveCareProvider;
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
_liveCareProvider = Provider.of<LiveCareProvider>(context);
_liveCareProvider = Provider.of<LiveCareViewModel>(context);
pendingList();
}
_isInit = false;

@ -3,7 +3,7 @@ import 'dart:async';
import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart';
import 'package:doctor_app_flutter/models/livecare/session_status_model.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/providers/livecare_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart';
import 'package:doctor_app_flutter/screens/live_care/panding_list.dart';
import 'package:doctor_app_flutter/util/VideoChannel.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
@ -30,7 +30,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
Timer _timmerInstance;
int _start = 0;
String _timmer = '';
LiveCareProvider _liveCareProvider;
LiveCareViewModel _liveCareProvider;
bool _isInit = true;
var _tokenData;
bool isTransfer = false;
@ -43,7 +43,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
_liveCareProvider = Provider.of<LiveCareProvider>(context);
_liveCareProvider = Provider.of<LiveCareViewModel>(context);
startCall(false);
}
_isInit = false;

@ -2,8 +2,9 @@ import 'dart:math';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
@ -14,10 +15,9 @@ 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_text_form_field.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/network_base_view.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_recognition_result.dart';
import 'package:speech_to_text/speech_to_text.dart';
@ -40,7 +40,6 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
final myController = TextEditingController();
Helpers helpers = new Helpers();
bool _hasSpeech = false;
MedicineProvider _medicineProvider;
String _currentLocaleId = "";
bool _isInit = true;
final SpeechToText speech = SpeechToText();
@ -57,12 +56,6 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
_medicineProvider = Provider.of<MedicineProvider>(context);
// requestPermissions();
// initSpeechState();
}
_isInit = false;
}
void requestPermissions() async {
@ -92,7 +85,8 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
@override
Widget build(BuildContext context) {
return AppScaffold(
return BaseView<MedicineViewModel>(
builder: (_, model, w) => AppScaffold(
appBarTitle: TranslationBase.of(context).searchMedicine,
body: FractionallySizedBox(
widthFactor: 0.97,
@ -140,7 +134,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
controller: myController,
onSaved: (value) {},
onFieldSubmitted: (value) {
searchMedicine(context);
searchMedicine(context, model);
},
textInputAction: TextInputAction.search,
// TODO return it back when it needed
@ -165,109 +159,115 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
// TODO change it secondary button and add loading
AppButton(
title: TranslationBase.of(context).search,
onPressed: () {
searchMedicine(context);
searchMedicine(context, model);
},
),
],
),
),
Container(
margin: EdgeInsets.only(
left: SizeConfig.heightMultiplier * 2),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).youCanFind +
_medicineProvider.pharmacyItemsList.length
.toString() +
" " +
TranslationBase.of(context).itemsInSearch,
fontWeight: FontWeight.bold,
),
],
),
),
Container(
height: MediaQuery.of(context).size.height * 0.35,
child: Container(
child: !_medicineProvider.isFinished
? DrAppCircularProgressIndeicator()
: _medicineProvider.hasError
? Center(
child: Text(
_medicineProvider.errorMsg,
style: TextStyle(
color:
Theme.of(context).errorColor),
),
)
: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount:
_medicineProvider.pharmacyItemsList ==
null
? 0
: _medicineProvider
.pharmacyItemsList.length,
itemBuilder:
(BuildContext context, int index) {
return InkWell(
child: MedicineItemWidget(
label: _medicineProvider
.pharmacyItemsList[index]
["ItemDescription"],
url: _medicineProvider
.pharmacyItemsList[index]
["ImageSRCUrl"],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
PharmaciesListScreen(
itemID: _medicineProvider
NetworkBaseView(
baseViewModel: model,
child: Column(
children: [
Container(
margin: EdgeInsets.only(
left: SizeConfig.heightMultiplier * 2),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase
.of(context)
.youCanFind +
model.pharmacyItemsList.length
.toString() +
" " +
TranslationBase
.of(context)
.itemsInSearch,
fontWeight: FontWeight.bold,
),
],
),
),
Container(
height: MediaQuery
.of(context)
.size
.height * 0.35,
child: Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount:
model.pharmacyItemsList ==
null
? 0
: model
.pharmacyItemsList.length,
itemBuilder:
(BuildContext context, int index) {
return InkWell(
child: MedicineItemWidget(
label: model
.pharmacyItemsList[index]
["ItemDescription"],
url: model
.pharmacyItemsList[index]
["ImageSRCUrl"],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
PharmaciesListScreen(
itemID: model
.pharmacyItemsList[
index]["ItemID"],
url: _medicineProvider
url: model
.pharmacyItemsList[
index]["ImageSRCUrl"]),
),
),
);
},
);
},
);
},
),
),
),
},
),
),
),
],
)),
],
),
),
],
),
),
));
],
),
),
),),);
}
searchMedicine(context) {
searchMedicine(context, MedicineViewModel model) {
FocusScope.of(context).unfocus();
if (myController.text.isNullOrEmpty()) {
_medicineProvider.clearPharmacyItemsList();
helpers.showErrorToast(TranslationBase.of(context).typeMedicineName) ;
helpers.showErrorToast(TranslationBase
.of(context)
.typeMedicineName);
//"Type Medicine Name")
return;
}
if (myController.text.length < 3) {
_medicineProvider.clearPharmacyItemsList();
helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter);
helpers.showErrorToast(TranslationBase
.of(context)
.moreThan3Letter);
return;
}
_medicineProvider.getMedicineItem(myController.text);
model.getMedicineItem(myController.text);
}
startVoiceSearch() {
@ -292,7 +292,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
lastStatus = '';
myController.text = reconizedWord;
Future.delayed(const Duration(seconds: 2), () {
searchMedicine(context);
// searchMedicine(context);
});
});
}

@ -2,14 +2,14 @@ import 'dart:convert';
import 'dart:typed_data';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart';
@ -34,7 +34,6 @@ class PharmaciesListScreen extends StatefulWidget {
class _PharmaciesListState extends State<PharmaciesListScreen> {
var _data;
Helpers helpers = new Helpers();
MedicineProvider _medicineProvider;
ProjectProvider projectsProvider;
bool _isInit = true;
@ -43,47 +42,38 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
_medicineProvider = Provider.of<MedicineProvider>(context);
pharmaciesList();
}
_isInit = false;
}
@override
Widget build(BuildContext context) {
projectsProvider = Provider.of(context);
return AppScaffold(
return BaseView<MedicineViewModel>(
onModelReady: (model) => model.getPharmaciesList(widget.itemID),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).pharmaciesList,
body: !_medicineProvider.isFinished
? DrAppCircularProgressIndeicator()
: _medicineProvider.hasError
? Center(
child: Text(
_medicineProvider.errorMsg,
style: TextStyle(
color: Theme.of(context).errorColor),
),
)
:Container(
body: Container(
height: SizeConfig.screenHeight,
child: ListView(
shrinkWrap: true,
scrollDirection: Axis.vertical,
physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[
_medicineProvider.pharmaciesList.length >0 ?RoundedContainer(
child: Row(
children: <Widget>[
Expanded(
flex: 1,
child: ClipRRect(
borderRadius: BorderRadius.all(
Radius.circular(7)),
child: widget.url != null ?Image.network(
widget.url,
height:
SizeConfig.imageSizeMultiplier *
model.pharmaciesList.length > 0
? RoundedContainer(
child: Row(
children: <Widget>[
Expanded(
flex: 1,
child: ClipRRect(
borderRadius:
BorderRadius.all(Radius.circular(7)),
child: widget.url != null
? Image.network(
widget.url,
height:
SizeConfig.imageSizeMultiplier *
21,
width:
SizeConfig.imageSizeMultiplier *
@ -110,7 +100,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
fontWeight: FontWeight.bold,
),
AppText(
_medicineProvider.pharmaciesList[0]["ItemDescription"],
model.pharmaciesList[0]["ItemDescription"],
marginLeft: 10,
marginTop: 0,
marginRight: 10,
@ -125,7 +115,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
fontWeight: FontWeight.bold,
),
AppText(
_medicineProvider.pharmaciesList[0]["SellingPrice"]
model.pharmaciesList[0]["SellingPrice"]
.toString(),
marginLeft: 10,
marginTop: 0,
@ -161,7 +151,8 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
child: ListView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: _medicineProvider.pharmaciesList == null ? 0 : _medicineProvider.pharmaciesList.length,
itemCount: model.pharmaciesList == null ? 0 : model
.pharmaciesList.length,
itemBuilder: (BuildContext context, int index) {
return RoundedContainer(
child: Row(
@ -170,13 +161,14 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
flex: 1,
child: ClipRRect(
borderRadius:
BorderRadius.all(Radius.circular(7)),
BorderRadius.all(Radius.circular(7)),
child: Image.network(
_medicineProvider.pharmaciesList[index]["ProjectImageURL"],
model
.pharmaciesList[index]["ProjectImageURL"],
height:
SizeConfig.imageSizeMultiplier * 15,
SizeConfig.imageSizeMultiplier * 15,
width:
SizeConfig.imageSizeMultiplier * 15,
SizeConfig.imageSizeMultiplier * 15,
fit: BoxFit.cover,
),
),
@ -184,7 +176,8 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
Expanded(
flex: 4,
child: AppText(
_medicineProvider.pharmaciesList[index]["LocationDescription"],
model
.pharmaciesList[index]["LocationDescription"],
margin: 10,
),
),
@ -202,8 +195,10 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
Icons.call,
color: Colors.red,
),
onTap: () => launch("tel://" +
_medicineProvider.pharmaciesList[index]["PhoneNumber"]),
onTap: () =>
launch("tel://" +
model
.pharmaciesList[index]["PhoneNumber"]),
),
),
Padding(
@ -216,11 +211,13 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
onTap: () {
MapsLauncher.launchCoordinates(
double.parse(
_medicineProvider.pharmaciesList[index]["Latitude"]),
model
.pharmaciesList[index]["Latitude"]),
double.parse(
_medicineProvider.pharmaciesList[index]["Longitude"]),
_medicineProvider.pharmaciesList[index]
["LocationDescription"]);
model
.pharmaciesList[index]["Longitude"]),
model.pharmaciesList[index]
["LocationDescription"]);
},
),
),
@ -233,13 +230,10 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
}),
),
)
]),
));
]),
),),);
}
pharmaciesList() async {
_medicineProvider.getPharmaciesList(widget.itemID);
}
Image imageFromBase64String(String base64String) {
return Image.memory(base64Decode(base64String));

@ -1,15 +1,13 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription/request_prescription_report.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
class OutPatientPrescriptionDetailsScreen extends StatefulWidget {
final PrescriptionResModel prescriptionResModel;
@ -23,44 +21,33 @@ class OutPatientPrescriptionDetailsScreen extends StatefulWidget {
class _OutPatientPrescriptionDetailsScreenState
extends State<OutPatientPrescriptionDetailsScreen> {
bool _isInit = true;
PatientsProvider patientsProvider;
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProvider = Provider.of<PatientsProvider>(context);
RequestPrescriptionReport prescriptionReqModel =
RequestPrescriptionReport(
appointmentNo: widget.prescriptionResModel.appointmentNo,
episodeID: widget.prescriptionResModel.episodeID,
setupID: widget.prescriptionResModel.setupID,
patientTypeID: widget.prescriptionResModel.patientID);
patientsProvider.getPrescriptionReport(prescriptionReqModel.toJson());
}
_isInit = false;
getPrescriptionReport(BuildContext context,PatientViewModel model ){
RequestPrescriptionReport prescriptionReqModel =
RequestPrescriptionReport(
appointmentNo: widget.prescriptionResModel.appointmentNo,
episodeID: widget.prescriptionResModel.episodeID,
setupID: widget.prescriptionResModel.setupID,
patientTypeID: widget.prescriptionResModel.patientID);
model.getPrescriptionReport(prescriptionReqModel.toJson());
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).prescriptionDetails,
body: patientsProvider.isLoading
? DrAppCircularProgressIndeicator()
: patientsProvider.isError
? DrAppEmbeddedError(error: patientsProvider.error)
: CardWithBgWidgetNew(
return BaseView<PatientViewModel>(
onModelReady: (model) => getPrescriptionReport(context, model),
builder: (_, model, w) => AppScaffold(
appBarTitle: TranslationBase.of(context).prescriptionDetails,
body: CardWithBgWidgetNew(
widget: ListView.builder(
itemCount: patientsProvider.prescriptionReport.length,
itemCount: model.prescriptionReport.length,
itemBuilder: (BuildContext context, int index) {
return OutPatientPrescriptionDetailsItem(
prescriptionReport:
patientsProvider.prescriptionReport[index],
model.prescriptionReport[index],
);
}),
),
);
),);
}
}

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
@ -140,7 +140,9 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: AppText(
TranslationBase.of(context).searchPatientImageCaptionTitle.toUpperCase(),
TranslationBase.of(context)
.searchPatientImageCaptionTitle
.toUpperCase(),
fontWeight: FontWeight.bold,
fontSize: SizeConfig.heightMultiplier * 2.5,
),
@ -155,7 +157,6 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
)
],
),
Container(
padding: EdgeInsets.all(15),
width: SizeConfig.screenWidth * 1,
@ -175,12 +176,11 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
side: BorderSide(
width: 1.0,
style: BorderStyle.solid,
color: Hexcolor("#CCCCCC")),
color: HexColor("#CCCCCC")),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)),
),
),
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
@ -195,54 +195,53 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
// add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline(
child: DropdownButton(
isExpanded: true,
value: _selectedType,
iconSize: 25,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return PATIENT_TYPE.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
!projectsProvider.isArabic
? AppText(
item['text'],
fontSize: SizeConfig
.textMultiplier *
2.1,
)
: AppText(
item['text_ar'],
fontSize: SizeConfig
.textMultiplier *
2.1,
),
],
);
}).toList();
},
onChanged: (String newValue) =>
{
setState(() {
_selectedType = newValue;
selectedPatientType =
int.parse(_selectedType);
})
},
items: PATIENT_TYPE.map((item) {
!projectsProvider.isArabic
? itemText = item['text']
: itemText = item['text_ar'];
return DropdownMenuItem(
child: Text(
itemText,
textAlign: TextAlign.end,
),
value: item['val'],
);
}).toList(),
)),
isExpanded: true,
value: _selectedType,
iconSize: 25,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return PATIENT_TYPE.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
!projectsProvider.isArabic
? AppText(
item['text'],
fontSize: SizeConfig
.textMultiplier *
2.1,
)
: AppText(
item['text_ar'],
fontSize: SizeConfig
.textMultiplier *
2.1,
),
],
);
}).toList();
},
onChanged: (String newValue) => {
setState(() {
_selectedType = newValue;
selectedPatientType =
int.parse(_selectedType);
})
},
items: PATIENT_TYPE.map((item) {
!projectsProvider.isArabic
? itemText = item['text']
: itemText = item['text_ar'];
return DropdownMenuItem(
child: Text(
itemText,
textAlign: TextAlign.end,
),
value: item['val'],
);
}).toList(),
)),
),
],
),
@ -253,30 +252,23 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))
),
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase
.of(context)
.firstName,
labelText:
TranslationBase.of(context).firstName,
borderColor: Colors.white,
onSaved: (value) {
value == null
? _patientSearchFormValues.setFirstName =
"0"
"0"
: _patientSearchFormValues.setFirstName =
value;
value;
if (value
.toString()
.trim()
.isEmpty) {
if (value.toString().trim().isEmpty) {
_patientSearchFormValues.setFirstName = "0";
}
},
@ -290,29 +282,24 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))
),
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase
.of(context)
.middleName,
labelText:
TranslationBase.of(context).middleName,
borderColor: Colors.white,
onSaved: (value) {
value == null
? _patientSearchFormValues.setMiddleName =
"0"
"0"
: _patientSearchFormValues.setMiddleName =
value;
if (value
.toString()
.trim()
.isEmpty) {
value;
if (value.toString().trim().isEmpty) {
_patientSearchFormValues.setMiddleName =
"0";
"0";
}
},
// validator: (value) {
@ -325,27 +312,21 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))
),
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase
.of(context)
.lastName,
labelText: TranslationBase.of(context).lastName,
borderColor: Colors.white,
onSaved: (value) {
value == null
?
_patientSearchFormValues.setLastName = "0"
? _patientSearchFormValues.setLastName =
"0"
: _patientSearchFormValues.setLastName =
value;
if (value
.toString()
.trim()
.isEmpty) {
value;
if (value.toString().trim().isEmpty) {
_patientSearchFormValues.setLastName = "0";
}
},
@ -356,30 +337,25 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))
),
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase
.of(context)
.phoneNumber,
labelText:
TranslationBase.of(context).phoneNumber,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
onSaved: (value) {
value == null
? _patientSearchFormValues
.setPatientMobileNumber = "0"
.setPatientMobileNumber = "0"
: _patientSearchFormValues
.setPatientMobileNumber = value;
.setPatientMobileNumber = value;
if (value
.toString()
.trim()
.isEmpty) {
if (value.toString().trim().isEmpty) {
_patientSearchFormValues
.setPatientMobileNumber = "0";
}
@ -391,29 +367,24 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))
),
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase
.of(context)
.patientID,
labelText:
TranslationBase.of(context).patientID,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
onSaved: (value) {
value == null
?
_patientSearchFormValues.setPatientID = 0
? _patientSearchFormValues.setPatientID =
0
: _patientSearchFormValues.setPatientID =
int.parse(value);
if (value
.toString()
.trim()
.isEmpty) {
int.parse(value);
if (value.toString().trim().isEmpty) {
_patientSearchFormValues.setPatientID = 0;
}
}),
@ -423,16 +394,14 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))
),
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase
.of(context)
.patientFile,
labelText:
TranslationBase.of(context).patientFile,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
@ -442,8 +411,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
(!(_selectedType == '2' || _selectedType == '4'))
? DynamicElements(_patientSearchFormValues)
: SizedBox(
height: 0,
),
height: 0,
),
SizedBox(
height: 10,
),
@ -454,9 +423,9 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
side: BorderSide(
width: 1.0,
style: BorderStyle.solid,
color: Hexcolor("#CCCCCC")),
color: HexColor("#CCCCCC")),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
BorderRadius.all(Radius.circular(6.0)),
),
),
width: double.infinity,
@ -473,29 +442,29 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
// add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline(
child: DropdownButton(
isExpanded: true,
value: _selectedLocation,
iconSize: 25,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return LOCATIONS.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
!projectsProvider.isArabic
? AppText(
item['text'],
fontSize: SizeConfig
.textMultiplier *
2.1,
)
: AppText(
item['text-ar'],
fontSize: SizeConfig
.textMultiplier *
2.1,
)
isExpanded: true,
value: _selectedLocation,
iconSize: 25,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return LOCATIONS.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
!projectsProvider.isArabic
? AppText(
item['text'],
fontSize: SizeConfig
.textMultiplier *
2.1,
)
: AppText(
item['text-ar'],
fontSize: SizeConfig
.textMultiplier *
2.1,
)
],
);
}).toList();
@ -517,7 +486,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
value: item['val'],
);
}).toList(),
)),
)),
),
],
),
@ -530,30 +499,29 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: Hexcolor("#CCCCCC"))
),
height: 25,
width: 25,
child: Checkbox(
value: true,
checkColor: Hexcolor("#2A930A"),
activeColor: Colors.white,
onChanged: (bool newValue) {}),
),
SizedBox(width: 12,),
AppText(
TranslationBase
.of(context)
.onlyArrivedPatient,
fontSize: SizeConfig.textMultiplier *
2),
])),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
height: 25,
width: 25,
child: Checkbox(
value: true,
checkColor: HexColor("#2A930A"),
activeColor: Colors.white,
onChanged: (bool newValue) {}),
),
SizedBox(
width: 12,
),
AppText(
TranslationBase.of(context)
.onlyArrivedPatient,
fontSize: SizeConfig.textMultiplier * 2),
])),
SizedBox(
height: 10,
),

@ -1,67 +0,0 @@
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../providers/patients_provider.dart';
class PatientsListScreen extends StatefulWidget {
@override
_PatientsListScreenState createState() => _PatientsListScreenState();
}
class _PatientsListScreenState extends State<PatientsListScreen> {
var _isInit = true;
var _isLoading = true;
var _hasError;
@override
void didChangeDependencies() {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatientModel patient = routeArgs['patientSearchForm'];
print(patient.TokenID+"EEEEEE");
String patientType = routeArgs['selectedType'];
print(patientType);
if (_isInit) {
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
patientsProv.getPatientList(patient, patientType).then((res) {
// print('MessageStatus${res['MessageStatus']}');
print('List_MyInPatient${(res['List_MyInPatient'][0])}');
setState(() {
_isLoading = false;
_hasError = res['ErrorEndUserMessage'];
});
print(res);
}).catchError((error) {
print(error);
});
}
_isInit = false;
super.didChangeDependencies();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('PatientsListScreen'),
),
body: _isLoading
? Center(
child: CircularProgressIndicator(),
)
: Container(
child: _hasError != null
? Center(
child: Text(
_hasError,
style: TextStyle(color: Theme.of(context).errorColor),
),
)
: Text('EEEEEEEEEEEEEE'),
),
);
}
}
/*
{ProjectID: 15, ClinicID: null, DoctorID: 4709, PatientID: 1288076, DoctorName: SHAZIA MAQSOOD, DoctorNameN: null, FirstName: LAMA, MiddleName: ABDULLAH, LastName: AL-SALOOM, FirstNameN: null, MiddleNameN: null, LastNameN: null, Gender: 2, DateofBirth: /Date(522363600000+0300)/, NationalityID: null, MobileNumber: 0543133371, EmailAddress: Lala_as@hotmail.com, PatientIdentificationNo: 1040451369, PatientType: 1, AdmissionNo: 2020008493, AdmissionDate: /Date(1587589200000+0300)/, RoomID: 119, BedID: 119, NursingStationID: null, Description: null, ClinicDescription: OB-GYNE, ClinicDescriptionN: null, NationalityName: Saudi, NationalityNameN: null, Age: 34 Yr, GenderDescription: Female, NursingStationName: Post Natal Ward A2}
*/

@ -8,13 +8,14 @@
*/
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
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/providers/patients_provider.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
@ -55,70 +56,15 @@ class _PatientsScreenState extends State<PatientsScreen> {
bool _isInit = true;
String patientType;
String patientTypeTitle;
var _isLoading = false;
var _isLoading = true;
bool _isError = true;
bool _isError = false;
String error = "";
ProjectProvider projectsProvider;
final _controller = TextEditingController();
PatientModel patient;
PatientsProvider patientsProv;
@override
void didChangeDependencies() {
projectsProvider = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patientSearchForm'];
patientType = routeArgs['selectedType'];
if (!projectsProvider.isArabic)
patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
else
patientTypeTitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)];
print(patientType);
if (_isInit) {
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
setState(() {
_isLoading = true;
_isError = false;
error = "";
});
patientsProv.getPatientList(patient, patientType).then((res) {
setState(() {
_isLoading = false;
if (res['MessageStatus'] == 1) {
int val2 = int.parse(patientType);
lItems = res[SERVICES_PATIANT2[val2]];
parsed = lItems;
responseModelList = new ModelResponse.fromJson(parsed).list;
responseModelList2 = responseModelList;
_isError = false;
} else {
_isError = true;
error = res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
}
});
}).catchError((error) {
print(error);
setState(() {
_isError = true;
_isLoading = false;
this.error = error;
});
});
}
_isInit = false;
super.didChangeDependencies();
}
/*
*@author: Amjad Amireh
@ -300,29 +246,81 @@ class _PatientsScreenState extends State<PatientsScreen> {
@override
Widget build(BuildContext context) {
_locations = [
TranslationBase.of(context).all,
TranslationBase.of(context).today,
TranslationBase.of(context).tomorrow,
TranslationBase.of(context).nextWeek,
TranslationBase
.of(context)
.all,
TranslationBase
.of(context)
.today,
TranslationBase
.of(context)
.tomorrow,
TranslationBase
.of(context)
.nextWeek,
];
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
return AppScaffold(
appBarTitle: patientTypeTitle,
body: _isLoading
? DrAppCircularProgressIndeicator()
: _isError
? DrAppEmbeddedError(error: error)
: lItems == null || lItems.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).youDontHaveAnyPatient)
: Container(
child: ListView(
projectsProvider = Provider.of(context);
final routeArgs = ModalRoute
.of(context)
.settings
.arguments as Map;
patient = routeArgs['patientSearchForm'];
patientType = routeArgs['selectedType'];
if (!projectsProvider.isArabic)
patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
else
patientTypeTitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)];
return BaseView<PatientViewModel>(
onModelReady: (model) {
// TODO : change all the logic here to make it work with the model and remove future
model.getPatientList(patient, patientType).then((res) {
setState(() {
_isLoading = false;
if (res['MessageStatus'] == 1) {
int val2 = int.parse(patientType);
lItems = res[SERVICES_PATIANT2[val2]];
parsed = lItems;
responseModelList = new ModelResponse.fromJson(parsed).list;
responseModelList2 = responseModelList;
_isError = false;
} else {
_isError = true;
error = res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
}
});
}).catchError((error) {
setState(() {
_isError = true;
_isLoading = false;
this.error = error;
});
});
},
builder: (_, model, w) =>
AppScaffold(
appBarTitle: patientTypeTitle,
body: _isLoading
? DrAppCircularProgressIndeicator()
: _isError
? DrAppEmbeddedError(error: error)
: lItems == null || lItems.length == 0
? DrAppEmbeddedError(
error: TranslationBase
.of(context)
.youDontHaveAnyPatient)
: Container(
child: ListView(
scrollDirection: Axis.vertical,
children: <Widget>[
Container(
child: lItems == null
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Center(
@ -349,9 +347,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
? _locationBar(context)
: Container(),
),
SizedBox(height: 10.0),
SizedBox(height: 18.5),
Container(
width: SizeConfig.screenWidth * 0.9,
height: SizeConfig.screenHeight * 0.05,
child: TextField(
controller: _controller,
onChanged: (String str) {
@ -360,266 +359,353 @@ class _PatientsScreenState extends State<PatientsScreen> {
decoration: buildInputDecoration(
context,
TranslationBase.of(context)
.search),
.searchPatient),
),
),
SizedBox(
height: 10.0,
),
Divider(
thickness: 0.8,
color: Color(0xffCCCCCC),
),
Container(
decoration: BoxDecoration(
color: Color(0Xffffffff),
borderRadius:
BorderRadius.circular(20)),
margin:
EdgeInsets.fromLTRB(15, 0, 15, 0),
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: (responseModelList.length > 0)
? Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: responseModelList
.map((PatiantInformtion item) {
return Container(
decoration: myBoxDecoration(),
child: InkWell(
child: Row(
children: <Widget>[
Column(
mainAxisAlignment:
MainAxisAlignment
.start,
children: <Widget>[
Container(
decoration:
BoxDecoration(
gradient: LinearGradient(
begin:
Alignment(
-1,
-1),
end:
Alignment(
1, 1),
colors: [
Colors.grey[
100],
Colors.grey[
200],
]),
boxShadow: [
BoxShadow(
color: Color
.fromRGBO(
0,
0,
0,
0.08),
offset:
Offset(
0.0,
5.0),
blurRadius:
16.0)
],
borderRadius: BorderRadius
.all(Radius
.circular(
50.0)),
),
width: 80,
height: 80,
child: Icon(
item
.genderDescription ==
"Male"
? DoctorApp
.male
: DoctorApp
.female_icon,
size: 80,
)),
],
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
// mainAxisAlignment: MainAxisAlignment.center,
children: responseModelList.map(
(PatiantInformtion item) {
return Container(
decoration:
myBoxDecoration(),
child: InkWell(
child: Row(
children: <Widget>[
SizedBox(
height: 15,
),
AppText(
item.firstName +
" " +
item.lastName,
fontSize: 2.0 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold,
backGroundcolor:
Colors.white,
),
SizedBox(
height: 8,
),
AppText(
TranslationBase
.of(
context)
.fileNo +
item.patientId
.toString(),
fontSize: 2.0 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold,
backGroundcolor:
Colors.white,
),
AppText(
TranslationBase
.of(
context)
.age +
item.age
.toString(),
fontSize: 2.0 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold,
backGroundcolor:
Colors.white,
),
SizedBox(
height: 8,
),
SERVICES_PATIANT2[
int.parse(
patientType)] ==
"List_MyOutPatient"
? Row(
Column(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: <
Widget>[
Container(
height:
20,
width: 80,
decoration:
BoxDecoration(
borderRadius:
BorderRadius
.circular(
50),
color: Hexcolor(
"#20A169"),
),
MainAxisAlignment
.start,
children: <Widget>[
Padding(
padding: EdgeInsets
.only(
left:
12.0),
child:
AppText(
item
.startTime,
color: Colors
.white,
fontSize:
2 * SizeConfig
.textMultiplier,
textAlign:
TextAlign
.center,
fontWeight:
FontWeight
.bold,
Container(
decoration:
BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(
0,
0,
0,
0.08),
offset: Offset(
0.0,
5.0),
blurRadius:
16.0)
],
borderRadius:
BorderRadius.all(
Radius.circular(35.0)),
color: Color(
0xffCCCCCC),
),
width: 70,
height: 70,
child: Icon(
item.genderDescription ==
"Male"
? DoctorApp
.male
: DoctorApp
.female_icon,
size: 70,
color: Colors
.white,
),
),
),
SizedBox(
width: 60,
),
Container(
child:
AppText(
convertDateFormat2(
item
.appointmentDate
.toString()),
fontSize:
2.0 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight
.bold,
),
)
],
)
: AppText(
item
.nationalityName ??
item
.nationalityNameN,
fontSize: 2.5 *
SizeConfig
.textMultiplier,
),
SizedBox(
height: 15,
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Column(
children: [
SizedBox(
height:
10.0,
),
Padding(
padding: EdgeInsets.symmetric(
vertical:
5.5,
horizontal:
22.5),
child:
AppText(
item.firstName +
" " +
item.lastName,
fontSize:
2.0 *
SizeConfig.textMultiplier,
fontWeight:
FontWeight.bold,
backGroundcolor:
Colors.white,
),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <
Widget>[
Wrap(
children: [
AppText(
TranslationBase.of(context).fileNo,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
),
AppText(
item.patientId.toString(),
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
],
),
SizedBox(
height:
2.5,
),
AppText(
'NATIONALITY: ' +
item.nationalityName.toString(),
fontSize:
1.8 * SizeConfig.textMultiplier,
fontWeight:
FontWeight.bold,
backGroundcolor:
Colors.white,
),
SizedBox(
height:
15.5,
),
SERVICES_PATIANT2[int.parse(patientType)] ==
"List_MyOutPatient"
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
item.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 0.5,
)
],
)
: SizedBox(
height: 5,
),
],
),
Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
// mainAxisAlignment:
// MainAxisAlignment
// .spaceBetween,
children: <
Widget>[
SizedBox(
height:
0.5,
),
SizedBox(
height:
0,
),
Wrap(
children: [
AppText(
TranslationBase.of(context).age2,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
),
AppText(
item.age.toString(),
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
],
),
SizedBox(
height:
2.5,
),
Wrap(
children: [
AppText(
TranslationBase.of(context).gender2,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
),
AppText(
item.gender.toString() == '1' ? 'Male' : 'Female',
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
],
),
SizedBox(
height:
8,
),
SERVICES_PATIANT2[int.parse(patientType)] ==
"List_MyOutPatient"
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
item.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 25.5,
),
],
)
: SizedBox(
height: 15,
),
],
),
],
),
],
),
),
// Divider(color: Colors.grey)
],
),
onTap: () {
Navigator.of(context)
.pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": item
});
},
),
// Divider(color: Colors.grey)
],
),
onTap: () {
Navigator.of(context)
.pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": item
});
},
),
);
}).toList(),
)
);
}).toList(),
)
: Center(
child: DrAppEmbeddedError(
error: TranslationBase
.of(context)
.youDontHaveAnyPatient),
child: DrAppEmbeddedError(
error: TranslationBase.of(
context)
.youDontHaveAnyPatient),
),
),
],
),
),
)
],
),
),
);
),
),
),);
}
InputDecoration buildInputDecoration(BuildContext context, hint) {
return InputDecoration(
prefixIcon: Icon(Icons.search, color: Colors.red),
prefixIcon: Icon(Icons.search, color: Colors.grey),
filled: true,
fillColor: Colors.white,
hintText: hint,
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
hintStyle: TextStyle(fontSize: 1.66 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: HexColor('#CCCCCC')),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(50.0)),
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Colors.grey), //),
));
}
@ -627,13 +713,15 @@ class _PatientsScreenState extends State<PatientsScreen> {
Widget _locationBar(BuildContext _context) {
return Expanded(
child: Container(
height: MediaQuery
.of(context)
.size
.height * 0.065,
width: SizeConfig.screenWidth * 0.95,
height: MediaQuery.of(context).size.height * 0.0619,
width: SizeConfig.screenWidth * 0.94,
decoration: BoxDecoration(
color: Color(0Xffffffff), borderRadius: BorderRadius.circular(20)),
color: Color(0Xffffffff),
borderRadius: BorderRadius.circular(12.5),
border: Border.all(
width: 0.5,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max,
@ -643,29 +731,35 @@ class _PatientsScreenState extends State<PatientsScreen> {
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
InkWell(
child: Center(
child: Container(
height: 40,
width: 90,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: _isActive ? Hexcolor("#B8382B") : Colors.white,
),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
child: Expanded(
child: Container(
height: MediaQuery.of(context).size.height * 0.058,
width: SizeConfig.screenWidth * 0.2334,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(12.5),
topRight: Radius.circular(12.5),
topLeft: Radius.circular(9.5),
bottomLeft: Radius.circular(9.5)),
color:
_isActive ? HexColor("#B8382B") : Colors.white,
),
)),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.normal,
),
),
)),
),
),
onTap: () {
print(_locations.indexOf(item));
filterBooking(item.toString());
@ -676,11 +770,13 @@ class _PatientsScreenState extends State<PatientsScreen> {
_isActive
? Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10),
topRight: Radius.circular(10)),
color: Colors.white),
alignment: Alignment.center,
height: 3,
width: 90,
height: 1,
width: SizeConfig.screenWidth * 0.23,
)
: Container()
]);
@ -694,8 +790,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
return BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
color: Color(0xffCCCCCC),
width: 0.5,
),
),
);

@ -1,21 +1,20 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/insurance_aprovals_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../config/shared_pref_kay.dart';
import '../../../config/size_config.dart';
import '../../../models/patient/patiant_info_model.dart';
import '../../../providers/patients_provider.dart';
import '../../../util/dr_app_shared_pref.dart';
import '../../../widgets/shared/app_scaffold_widget.dart';
import '../../../widgets/shared/app_texts_widget.dart';
import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -33,11 +32,9 @@ class InsuranceApprovalsScreen extends StatefulWidget {
}
class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
PatientsProvider patientsProv;
var approvalsList;
var filteredApprovalsList;
final _controller = TextEditingController();
var _isInit = true;
/*
*@author: ibrahim al bitar
@ -46,7 +43,8 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
*@return:
*@desc:
*/
getInsuranceApprovalsList(context) async {
getInsuranceApprovalsList(
BuildContext context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
@ -60,62 +58,58 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
tokenID: token,
patientTypeID: patient.patientType,
languageID: 2);
patientsProv
model
.getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson()).then((c){
approvalsList = patientsProv.insuranceApporvalsList;
approvalsList = model.insuranceApporvalsList;
});
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getInsuranceApprovalsList(context);
approvalsList = patientsProv.insuranceApporvalsList;
_isInit = false;
}
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).insuranceApprovals,
body: patientsProv.isLoading
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error)
: patientsProv.insuranceApporvalsList == null || patientsProv.insuranceApporvalsList.length == 0
? DrAppEmbeddedError(
error:
TranslationBase.of(context).errorNoInsuranceApprovals)
: Column(
children: <Widget>[
Container(
margin: EdgeInsets.all(10),
width: SizeConfig.screenWidth * 0.80,
child: TextField(
controller: _controller,
onChanged: (String str) {
this.searchData(str);
},
textInputAction: TextInputAction.done,
decoration: buildInputDecoration(
context,
TranslationBase.of(context)
.searchInsuranceApprovals),
),
),
Expanded(
child: Container(
margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05,
0,
SizeConfig.realScreenWidth * 0.05,
0),
child: ListView.builder(
itemCount: approvalsList.length,
itemBuilder: (BuildContext ctxt, int index) {
return BaseView<PatientViewModel>(
onModelReady: (model) => getInsuranceApprovalsList(context, model),
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase
.of(context)
.insuranceApprovals,
body: model.insuranceApporvalsList == null ||
model.insuranceApporvalsList.length == 0
? DrAppEmbeddedError(
error:
TranslationBase
.of(context)
.errorNoInsuranceApprovals)
: Column(
children: <Widget>[
Container(
margin: EdgeInsets.all(10),
width: SizeConfig.screenWidth * 0.80,
child: TextField(
controller: _controller,
onChanged: (String str) {
this.searchData(str, model);
},
textInputAction: TextInputAction.done,
decoration: buildInputDecoration(
context,
TranslationBase
.of(context)
.searchInsuranceApprovals),
),
),
Expanded(
child: Container(
margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05,
0,
SizeConfig.realScreenWidth * 0.05,
0),
child: ListView.builder(
itemCount: approvalsList.length,
itemBuilder: (BuildContext ctxt, int index) {
return RoundedContainer(
child: Column(
crossAxisAlignment:
@ -429,13 +423,13 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
],
),
],
));
}),
),
),
],
),
);
));
}),
),
),
],
),
),);
}
InputDecoration buildInputDecoration(BuildContext context, hint) {
@ -447,7 +441,7 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
borderSide: BorderSide(color: HexColor('#CCCCCC')),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -455,21 +449,21 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
));
}
searchData(String str) {
searchData(String str, PatientViewModel model) {
var strExist = str.length > 0 ? true : false;
if (strExist) {
filteredApprovalsList = null;
filteredApprovalsList = approvalsList
.where((note) =>
note["ClinicName"].toString().contains(str.toUpperCase()))
note["ClinicName"].toString().contains(str.toUpperCase()))
.toList();
setState(() {
approvalsList = filteredApprovalsList;
});
} else {
setState(() {
approvalsList = patientsProv.insuranceApporvalsList;
approvalsList = model.insuranceApporvalsList;
});
}
}

@ -1,24 +1,20 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart';
import '../../../../models/patient/lab_orders/lab_orders_req_model.dart';
import '../../../../models/patient/patiant_info_model.dart';
import '../../../../providers/patients_provider.dart';
import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart';
import '../../../../widgets/shared/app_texts_widget.dart';
import '../../../../widgets/shared/card_with_bg_widget.dart';
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import '../../../../widgets/shared/profile_image_widget.dart';
import 'lab_result_secreen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -36,17 +32,16 @@ class LabOrdersScreen extends StatefulWidget {
}
class _LabOrdersScreenState extends State<LabOrdersScreen> {
PatientsProvider patientsProv;
var _isInit = true;
/*
*@author: Elham Rababah
*@Date:28/4/2020
*@param: context
*@return:
*@desc: getVitalSignList Function
*@desc: getLabResultOrders Function
*/
getLabResultOrders(context) async {
getLabResultOrders(BuildContext context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
@ -57,181 +52,184 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
patientTypeID: patient.patientType,
languageID: 2);
patientsProv.getLabResultOrders(labOrdersReqModel.toJson());
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getLabResultOrders(context);
}
_isInit = false;
model.getLabResultOrders(labOrdersReqModel.toJson());
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).labOrders,
body: patientsProv.isLoading
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error)
: patientsProv.patientLabResultOrdersList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoLabOrders)
: Container(
margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05,
0,
SizeConfig.realScreenWidth * 0.05,
0),
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(20.0),
return BaseView<PatientViewModel>(
onModelReady: (model) => getLabResultOrders(context, model),
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase
.of(context)
.labOrders,
body: model.patientLabResultOrdersList.length == 0
? DrAppEmbeddedError(
error: TranslationBase
.of(context)
.errorNoLabOrders)
: Container(
margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05,
0,
SizeConfig.realScreenWidth * 0.05,
0),
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(20.0),
),
),
child: ListView.builder(
itemCount:
model.patientLabResultOrdersList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
LabResult(
labOrders: model
.patientLabResultOrdersList[index],
),
),
);
},
child: Container(
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10)),
border: Border(
bottom: BorderSide(
color: Colors.grey, width: 0.5),
top: BorderSide(
color: Colors.grey, width: 0.5),
left: BorderSide(
color: Colors.grey, width: 0.5),
right: BorderSide(
color: Colors.grey, width: 0.5),
),
),
),
child: ListView.builder(
itemCount:
patientsProv.patientLabResultOrdersList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => LabResult(
labOrders: patientsProv
.patientLabResultOrdersList[index],
),
),
);
},
child: Container(
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10)),
border: Border(
bottom: BorderSide(
color: Colors.grey, width: 0.5),
top: BorderSide(
color: Colors.grey, width: 0.5),
left: BorderSide(
color: Colors.grey, width: 0.5),
right: BorderSide(
color: Colors.grey, width: 0.5),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
LargeAvatar(
url: model
.patientLabResultOrdersList[
index]
.doctorImageURL,
name: model
.patientLabResultOrdersList[
index]
.doctorName,
),
child: Column(
crossAxisAlignment:
Expanded(
child: Padding(
padding:
const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
LargeAvatar(
url: patientsProv
.patientLabResultOrdersList[
index]
.doctorImageURL,
name: patientsProv
.patientLabResultOrdersList[
index]
.doctorName,
AppText(
'${model
.patientLabResultOrdersList[index]
.doctorName}',
fontSize: 1.7 *
SizeConfig
.textMultiplier,
fontWeight: FontWeight.w600,
),
Expanded(
child: Padding(
padding:
const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${patientsProv.patientLabResultOrdersList[index].doctorName}',
fontSize: 1.7 *
SizeConfig
.textMultiplier,
fontWeight: FontWeight.w600,
),
SizedBox(
height: 8,
),
AppText(
' ${patientsProv.patientLabResultOrdersList[index].projectName}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800]),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
' Invoice No :',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${patientsProv.patientLabResultOrdersList[index].invoiceNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
],
)
],
),
),
)
],
),
SizedBox(
height: 3,
),
Divider(
color: Colors.grey,
),
SizedBox(
height: 3,
),
Row(
children: <Widget>[
Icon(
EvaIcons.calendar,
color: Colors.grey[700],
SizedBox(
height: 8,
),
AppText(
' ${model
.patientLabResultOrdersList[index]
.projectName}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800]),
SizedBox(
width: 10,
height: 8,
),
Expanded(
child: AppText(
'${Helpers.getDate(patientsProv.patientLabResultOrdersList[index].createdOn)}',
fontSize: 2.0 *
SizeConfig.textMultiplier,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
' Invoice No :',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${model
.patientLabResultOrdersList[index]
.invoiceNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
],
)
],
)
],
),
),
)
],
),
SizedBox(
height: 3,
),
Divider(
color: Colors.grey,
),
SizedBox(
height: 3,
),
Row(
children: <Widget>[
Icon(
EvaIcons.calendar,
color: Colors.grey[700],
),
SizedBox(
width: 10,
),
),
);
}),
),
),
);
Expanded(
child: AppText(
'${Helpers.getDate(model
.patientLabResultOrdersList[index]
.createdOn)}',
fontSize: 2.0 *
SizeConfig.textMultiplier,
),
)
],
)
],
),
),
);
}),
),
),
),);
}
}

@ -1,18 +1,15 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/doctor/lab_result_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
class LabResult extends StatefulWidget {
final LabOrdersResModel labOrders;
@ -24,63 +21,46 @@ class LabResult extends StatefulWidget {
}
class _LabResultState extends State<LabResult> {
PatientsProvider patientsProv;
bool _isInit = true;
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
patientsProv.getLabResult(widget.labOrders);
// getLabResultOrders(context);
}
_isInit = false;
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).labOrders,
body: patientsProv.isLoading
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error)
: patientsProv.labResultList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoLabOrders)
: Container(
margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05,
0,
SizeConfig.realScreenWidth * 0.05,
0),
child: ListView(
return BaseView<PatientViewModel>(
onModelReady: (model) => model.getLabResult(widget.labOrders),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).labOrders,
body: model.labResultList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoLabOrders)
: Container(
margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05,
0, SizeConfig.realScreenWidth * 0.05, 0),
child: ListView(
children: <Widget>[
CardWithBgWidgetNew(
widget: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
CardWithBgWidgetNew(
widget: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).invoiceNo,
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${widget.labOrders.invoiceNo}',
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
],
),
AppText(
TranslationBase.of(context).invoiceNo,
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${widget.labOrders.invoiceNo}',
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
CardWithBgWidgetNew(
widget: LabResultWidget(
labResult: patientsProv.labResultList,
))
],
),
),
CardWithBgWidgetNew(
widget: LabResultWidget(
labResult: model.labResultList,
))
],
),
),
),
);
}
}

@ -1,20 +1,18 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/progress_note_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../config/shared_pref_kay.dart';
import '../../../config/size_config.dart';
import '../../../models/patient/patiant_info_model.dart';
import '../../../providers/patients_provider.dart';
import '../../../util/dr_app_shared_pref.dart';
import '../../../widgets/shared/app_scaffold_widget.dart';
import '../../../widgets/shared/app_texts_widget.dart';
import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -32,7 +30,6 @@ class PatientsOrdersScreen extends StatefulWidget {
}
class _PatientsOrdersState extends State<PatientsOrdersScreen> {
PatientsProvider patientsProv;
var notesList;
var filteredNotesList;
final _controller = TextEditingController();
@ -45,7 +42,7 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
*@return:
*@desc:
*/
getProgressNoteList(context) async {
getProgressNoteList(BuildContext context, PatientViewModel model ) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
@ -59,31 +56,20 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
tokenID: token,
patientTypeID: patient.patientType,
languageID: 2);
patientsProv.getPatientProgressNote(progressNoteRequest.toJson()).then((c){
notesList = patientsProv.patientProgressNoteList;
model.getPatientProgressNote(progressNoteRequest.toJson()).then((c){
notesList = model.patientProgressNoteList;
});
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getProgressNoteList(context);
notesList = patientsProv.patientProgressNoteList;
}
_isInit = false;
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).orders,
body: patientsProv.isLoading
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error)
: notesList == null || notesList.length == 0
return BaseView<PatientViewModel>(
onModelReady: (model) => getProgressNoteList(context, model),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).orders,
body: notesList == null || notesList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoOrders)
: Column(
@ -94,7 +80,7 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
child: TextField(
controller: _controller,
onChanged: (String str) {
this.searchData(str);
this.searchData(str, model);
},
textInputAction: TextInputAction.done,
decoration: buildInputDecoration(context,
@ -162,7 +148,7 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
),
],
),
);
),);
}
InputDecoration buildInputDecoration(BuildContext context, hint) {
@ -174,7 +160,7 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
borderSide: BorderSide(color: HexColor('#CCCCCC')),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(50.0)),
@ -182,7 +168,7 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
));
}
searchData(String str) {
searchData(String str, PatientViewModel model) {
var strExist = str.length > 0 ? true : false;
if (strExist) {
@ -196,7 +182,7 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
});
} else {
setState(() {
notesList = patientsProv.patientProgressNoteList;
notesList = model.patientProgressNoteList;
});
}
}

@ -1,23 +1,17 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/reauest_prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/prescription_in_patinets_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/prescription_out_patinets_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart';
import '../../../../models/patient/patiant_info_model.dart';
import '../../../../models/patient/prescription/prescription_req_model.dart';
import '../../../../providers/patients_provider.dart';
import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart';
import '../../../../widgets/shared/app_texts_widget.dart';
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import '../../../../widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -35,8 +29,6 @@ class PrescriptionScreen extends StatefulWidget {
}
class _PrescriptionScreenState extends State<PrescriptionScreen> {
PatientsProvider patientsProv;
bool _isInit = true;
String type = '2';
/*
@ -46,7 +38,7 @@ class _PrescriptionScreenState extends State<PrescriptionScreen> {
*@return:
*@desc: getPrescriptionsList Function
*/
getPrescriptionsList(context) async {
getPrescriptionsList(BuildContext context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
@ -58,7 +50,7 @@ class _PrescriptionScreenState extends State<PrescriptionScreen> {
patientID: patient.patientId,
patientTypeID: patient.patientType,
admissionNo: int.parse(patient.admissionNo));
patientsProv.getInPatientPrescriptions(prescriptionReqModel.toJson());
model.getInPatientPrescriptions(prescriptionReqModel.toJson());
} else {
PrescriptionReqModel prescriptionReqModel = PrescriptionReqModel(
patientID: patient.patientId,
@ -67,37 +59,30 @@ class _PrescriptionScreenState extends State<PrescriptionScreen> {
patientTypeID: patient.patientType,
languageID: 2,
setupID: 0);
patientsProv.getOutPatientPrescriptions(prescriptionReqModel.toJson());
model.getOutPatientPrescriptions(prescriptionReqModel.toJson());
}
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getPrescriptionsList(context);
}
_isInit = false;
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).prescription,
body: patientsProv.isLoading
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error)
: type == '1'
? PrescriptionInPatientWidget(
prescriptionReportForInPatientList:
patientsProv.prescriptionReportForInPatientList,
)
: PrescriptionOutPatientWidget(
patientPrescriptionsList:
patientsProv.patientPrescriptionsList,
),
);
return BaseView<PatientViewModel>(
onModelReady: (model) => getPrescriptionsList(context, model),
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase
.of(context)
.prescription,
body: type == '1'
? PrescriptionInPatientWidget(
prescriptionReportForInPatientList:
model.prescriptionReportForInPatientList,
)
: PrescriptionOutPatientWidget(
patientPrescriptionsList:
model.patientPrescriptionsList,
),
),);
}
}

@ -1,20 +1,18 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/progress_note_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../config/shared_pref_kay.dart';
import '../../../config/size_config.dart';
import '../../../models/patient/patiant_info_model.dart';
import '../../../providers/patients_provider.dart';
import '../../../util/dr_app_shared_pref.dart';
import '../../../widgets/shared/app_scaffold_widget.dart';
import '../../../widgets/shared/app_texts_widget.dart';
import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -32,7 +30,6 @@ class ProgressNoteScreen extends StatefulWidget {
}
class _ProgressNoteState extends State<ProgressNoteScreen> {
PatientsProvider patientsProv;
var notesList;
var filteredNotesList;
final _controller = TextEditingController();
@ -45,7 +42,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
*@return:
*@desc:
*/
getProgressNoteList(context) async {
getProgressNoteList(BuildContext context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
@ -53,51 +50,46 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
print(type);
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
visitType: 5, // if equal 5 then this will return progress note
visitType: 5,
// if equal 5 then this will return progress note
admissionNo: int.parse(patient.admissionNo),
projectID: patient.projectId,
tokenID: token,
patientTypeID: patient.patientType,
languageID: 2);
patientsProv.getPatientProgressNote(progressNoteRequest.toJson()).then((c){
notesList = patientsProv.patientProgressNoteList;
model.getPatientProgressNote(progressNoteRequest.toJson()).then((c) {
notesList = model.patientProgressNoteList;
});
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getProgressNoteList(context);
notesList = patientsProv.patientProgressNoteList;
}
_isInit = false;
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).progressNote,
body: patientsProv.isLoading
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error)
: notesList == null || notesList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoProgressNote)
: Column(
children: <Widget>[
Container(
margin: EdgeInsets.all(10),
width: SizeConfig.screenWidth * 0.80,
child: TextField(
controller: _controller,
onChanged: (String str) {
this.searchData(str);
},
textInputAction: TextInputAction.done,
decoration: buildInputDecoration(context,
return BaseView<PatientViewModel>(
onModelReady: (model) => getProgressNoteList(context, model),
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase
.of(context)
.progressNote,
body: notesList == null || notesList.length == 0
? DrAppEmbeddedError(
error: TranslationBase
.of(context)
.errorNoProgressNote)
: Column(
children: <Widget>[
Container(
margin: EdgeInsets.all(10),
width: SizeConfig.screenWidth * 0.80,
child: TextField(
controller: _controller,
onChanged: (String str) {
this.searchData(str, model);
},
textInputAction: TextInputAction.done,
decoration: buildInputDecoration(context,
TranslationBase.of(context).searchNote),
),
),
@ -160,9 +152,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
}),
),
),
],
),
);
],
),
),);
}
InputDecoration buildInputDecoration(BuildContext context, hint) {
@ -174,7 +166,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
borderSide: BorderSide(color: HexColor('#CCCCCC')),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -182,21 +174,21 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
));
}
searchData(String str) {
searchData(String str, PatientViewModel model) {
var strExist = str.length > 0 ? true : false;
if (strExist) {
filteredNotesList = null;
filteredNotesList = patientsProv.patientProgressNoteList
filteredNotesList = model.patientProgressNoteList
.where((note) =>
note["DoctorName"].toString().contains(str.toUpperCase()))
note["DoctorName"].toString().contains(str.toUpperCase()))
.toList();
setState(() {
notesList = filteredNotesList;
});
} else {
setState(() {
notesList = patientsProv.patientProgressNoteList;
notesList = model.patientProgressNoteList;
});
}
}

@ -1,19 +1,18 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/radiology/radiology_req_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_report_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart';
import '../../../../models/patient/patiant_info_model.dart';
import '../../../../providers/patients_provider.dart';
import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart';
import '../../../../widgets/shared/app_texts_widget.dart';
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -31,8 +30,6 @@ class RadiologyScreen extends StatefulWidget {
}
class _RadiologyScreenState extends State<RadiologyScreen> {
PatientsProvider patientsProv;
var _isInit = true;
/*
*@author: Elham Rababah
@ -41,7 +38,7 @@ class _RadiologyScreenState extends State<RadiologyScreen> {
*@return:
*@desc: getRadiologyList Function
*/
getRadiologyList(context) async {
getRadiologyList(context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
@ -58,140 +55,136 @@ class _RadiologyScreenState extends State<RadiologyScreen> {
patientTypeID: patient.patientType,
languageID: 2,
);
patientsProv.getPatientRadiology(radiologyReqModel.toJson());
model.getPatientRadiology(radiologyReqModel.toJson());
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getRadiologyList(context);
}
_isInit = false;
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).radiology,
body: patientsProv.isLoading
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error)
: patientsProv.patientRadiologyList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).youDoNotHaveAnyItem)
: Container(
margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05,
0,
SizeConfig.realScreenWidth * 0.05,
0),
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(20.0),
return BaseView<PatientViewModel>(
onModelReady: (model) => getRadiologyList(context, model),
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase
.of(context)
.radiology,
body:
model.patientRadiologyList.length == 0
? DrAppEmbeddedError(
error: TranslationBase
.of(context)
.youDoNotHaveAnyItem)
: Container(
margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05,
0,
SizeConfig.realScreenWidth * 0.05,
0),
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(20.0),
),
),
child: ListView.builder(
itemCount: model.patientRadiologyList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
RadiologyReportScreen(
reportData: model
.patientRadiologyList[index]
.reportData,
)),
);
},
child: Container(
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10)),
border: Border(
bottom: BorderSide(
color: Colors.grey, width: 0.5),
top: BorderSide(
color: Colors.grey, width: 0.5),
left: BorderSide(
color: Colors.grey, width: 0.5),
right: BorderSide(
color: Colors.grey, width: 0.5),
),
),
),
child: ListView.builder(
itemCount: patientsProv.patientRadiologyList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
RadiologyReportScreen(
reportData: patientsProv
.patientRadiologyList[index]
.reportData,
)),
);
},
child: Container(
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10)),
border: Border(
bottom: BorderSide(
color: Colors.grey, width: 0.5),
top: BorderSide(
color: Colors.grey, width: 0.5),
left: BorderSide(
color: Colors.grey, width: 0.5),
right: BorderSide(
color: Colors.grey, width: 0.5),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
LargeAvatar(
url: model
.patientRadiologyList[index]
.doctorImageURL,
),
child: Column(
crossAxisAlignment:
Expanded(
child: Padding(
padding:
const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
LargeAvatar(
url: patientsProv
.patientRadiologyList[index]
.doctorImageURL,
AppText(
'${model.patientRadiologyList[index].doctorName}',
fontSize: 2.5 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold),
SizedBox(
height: 8,
),
AppText(
'Invoice No:${model.patientRadiologyList[index].invoiceNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
),
SizedBox(
height: 8,
),
AppText(
' ${model.patientRadiologyList[index].clinicName}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Theme.of(context)
.primaryColor,
),
SizedBox(
height: 8,
),
Expanded(
child: Padding(
padding:
const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${patientsProv.patientRadiologyList[index].doctorName}',
fontSize: 2.5 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold),
SizedBox(
height: 8,
),
AppText(
'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
),
SizedBox(
height: 8,
),
AppText(
' ${patientsProv.patientRadiologyList[index].clinicName}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Theme.of(context)
.primaryColor,
),
SizedBox(
height: 8,
),
],
),
),
)
],
),
],
),
),
);
}),
),
),
);
),
)
],
),
],
),
),
);
}),
),
),
),);
}
}

@ -1,22 +1,22 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_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/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import '../../../config/size_config.dart';
import '../../../providers/patients_provider.dart';
import '../../../util/dr_app_shared_pref.dart';
import '../../../util/extenstions.dart';
import '../../../widgets/shared/app_scaffold_widget.dart';
import '../../../widgets/shared/app_texts_widget.dart';
import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import '../../../util/extenstions.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -34,7 +34,6 @@ class ReferPatientScreen extends StatefulWidget {
}
class _ReferPatientState extends State<ReferPatientScreen> {
PatientsProvider patientsProv;
var doctorsList;
final _remarksController = TextEditingController();
final _extController = TextEditingController();
@ -51,46 +50,32 @@ class _ReferPatientState extends State<ReferPatientScreen> {
int _activePriority = 1;
FocusNode myFocusNode;
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
myFocusNode = FocusNode();
doctorsList = null;
patientsProv = Provider.of<PatientsProvider>(context);
patientsProv.getClinicsList();
patientsProv.getReferralFrequancyList();
}
_isInit = false;
}
FocusNode myFocusNode = FocusNode();
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).myReferralPatient,
body: patientsProv.isLoading
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error)
: patientsProv.clinicsList == null
? DrAppEmbeddedError(error: 'Something Wrong!')
: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).clinic,
fontSize: 18,
fontWeight: FontWeight.bold,
marginLeft: 15,
marginTop: 15,
),
RoundedContainer(
margin: 10,
showBorder: true,
return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).myReferralPatient,
body: model.clinicsList == null
? DrAppEmbeddedError(error: 'Something Wrong!')
: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).clinic,
fontSize: 18,
fontWeight: FontWeight.bold,
marginLeft: 15,
marginTop: 15,
),
RoundedContainer(
margin: 10,
showBorder: true,
raduis: 30,
borderColor: Color(0xff707070),
width: double.infinity,
@ -112,7 +97,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return patientsProv
return model
.getClinicNameList()
.map((item) {
return Row(
@ -132,7 +117,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
setState(() {
_selectedDoctor = null;
_selectedClinic = newValue;
var clinicInfo = patientsProv
var clinicInfo = model
.clinicsList
.where((i) =>
i['ClinicDescription']
@ -144,10 +129,10 @@ class _ReferPatientState extends State<ReferPatientScreen> {
clinicId = clinicInfo[0]['ClinicID']
.toString();
patientsProv.getDoctorsList(clinicId);
model.getDoctorsList(clinicId);
})
},
items: patientsProv
items: model
.getClinicNameList()
.map((item) {
return DropdownMenuItem(
@ -197,7 +182,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return patientsProv
return model
.getDoctorNameList()
.map((item) {
return Row(
@ -217,7 +202,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
setState(() {
_selectedDoctor = newValue;
doctorsList =
patientsProv.doctorsList;
model.doctorsList;
var doctorInfo = doctorsList
.where((i) => i['DoctorName']
@ -228,7 +213,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
.toString();
})
},
items: patientsProv
items: model
.getDoctorNameList()
.map((item) {
return DropdownMenuItem(
@ -311,7 +296,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return patientsProv
return model
.getReferralNamesList()
.map((item) {
return Row(
@ -330,7 +315,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
onChanged: (newValue) => {
setState(() {
_selectedReferralFrequancy = newValue;
var freqInfo = patientsProv
var freqInfo = model
.referalFrequancyList
.singleWhere((i) => i[
'Description']
@ -342,7 +327,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
myFocusNode.requestFocus();
})
},
items: patientsProv
items: model
.getReferralNamesList()
.map((item) {
return DropdownMenuItem(
@ -389,17 +374,23 @@ class _ReferPatientState extends State<ReferPatientScreen> {
visibility:
isValid == null ? false : !isValid,
),
// TODO replace AppButton with secondary button and add loading
AppButton(
title: TranslationBase.of(context).send,
title: TranslationBase
.of(context)
.send,
color: Color(PRIMARY_COLOR),
onPressed: () => {referToDoctor(context)},
onPressed: () =>
{
referToDoctor(context, model)
},
)
],
))
],
),
),
);
],
),
),
),);
}
Widget priorityBar(BuildContext _context) {
@ -428,7 +419,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
width: 90,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: _isActive ? Hexcolor("#B8382B") : Colors.white,
color: _isActive ? HexColor("#B8382B") : Colors.white,
),
child: Center(
child: Text(
@ -488,25 +479,37 @@ class _ReferPatientState extends State<ReferPatientScreen> {
return time;
}
void referToDoctor(context) {
referToDoctor(BuildContext context, PatientViewModel model) async {
if (!validation()) {
return;
}
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
final routeArgs = ModalRoute
.of(context)
.settings
.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
patientsProv.referToDoctor(context,
extension: _extController.value.text,
admissionNo: int.parse(patient.admissionNo),
referringDoctorRemarks: _remarksController.value.text,
frequency: freqId,
patientID: patient.patientId,
patientTypeID: patient.patientType,
priority: (_activePriority + 1).toString(),
roomID: patient.roomId,
selectedClinicID: clinicId.toString(),
selectedDoctorID: doctorId.toString(),
projectID: patient.projectId);
try {
await model.referToDoctor(
extension: _extController.value.text,
admissionNo: int.parse(patient.admissionNo),
referringDoctorRemarks: _remarksController.value.text,
frequency: freqId,
patientID: patient.patientId,
patientTypeID: patient.patientType,
priority: (_activePriority + 1).toString(),
roomID: patient.roomId,
selectedClinicID: clinicId.toString(),
selectedDoctorID: doctorId.toString(),
projectID: patient.projectId);
// TODO: Add Translation
DrAppToastMsg.showSuccesToast(
'Reply Successfully');
Navigator.pop(context);
} catch (e) {
DrAppToastMsg.showErrorToast(e);
}
}
bool validation() {

@ -1,20 +1,19 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_req_model.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart';
import '../../../../lookups/patient_lookup.dart';
import '../../../../models/patient/patiant_info_model.dart';
import '../../../../models/patient/vital_sign/vital_sign_res_model.dart';
import '../../../../providers/patients_provider.dart';
import '../../../../routes.dart';
import '../../../../screens/patients/profile/vital_sign/vital_sign_item.dart';
import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -28,8 +27,6 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
VitalSignResModel vitalSing;
String url = "assets/images/";
PatientsProvider patientsProv;
var _isInit = true;
/*
*@author: Elham Rababah
@ -38,7 +35,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
*@return:
*@desc: getVitalSignList Function
*/
getVitalSignList(context) async {
getVitalSignList(BuildContext context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
@ -57,18 +54,10 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
languageID: 2,
transNo:
patient.admissionNo != null ? int.parse(patient.admissionNo) : 0);
patientsProv.getPatientVitalSign(vitalSignReqModel.toJson());
model.getPatientVitalSign(vitalSignReqModel.toJson());
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getVitalSignList(context);
}
_isInit = false;
}
final double contWidth = SizeConfig.realScreenWidth * 0.70;
@ -76,13 +65,12 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
vitalSing = routeArgs['vitalSing'];
return AppScaffold(
return BaseView<PatientViewModel>(
onModelReady: (model) => getVitalSignList(context, model),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).vitalSign,
body: patientsProv.isLoading
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error)
: patientsProv.patientVitalSignOrderdSubList.length == 0
body: model.patientVitalSignOrderdSubList.length == 0
? DrAppEmbeddedError(
error: 'You don\'t have any vital Sings')
: Container(
@ -106,7 +94,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
des: TranslationBase.of(context)
.bodyMeasurements,
url: url + 'heartbeat.png',
lastVal: patientsProv
lastVal: model
.patientVitalSignOrderdSubList[0]
.heightCm
.toString(),
@ -129,7 +117,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
des: TranslationBase.of(context)
.temperature,
url: url + 'heartbeat.png',
lastVal: patientsProv
lastVal: model
.patientVitalSignOrderdSubList[0]
.temperatureCelcius
.toString(),
@ -154,7 +142,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
child: VitalSignItem(
des: TranslationBase.of(context).pulse,
url: url + 'heartbeat.png',
lastVal: patientsProv
lastVal: model
.patientVitalSignOrderdSubList[0]
.pulseBeatPerMinute
.toString(),
@ -175,7 +163,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
des:
TranslationBase.of(context).respiration,
url: url + 'heartbeat.png',
lastVal: patientsProv
lastVal: model
.patientVitalSignOrderdSubList[0]
.respirationBeatPerMinute
.toString(),
@ -200,7 +188,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
des: TranslationBase.of(context)
.bloodPressure,
url: url + 'heartbeat.png',
lastVal: patientsProv
lastVal: model
.patientVitalSignOrderdSubList[0]
.bloodPressure
.toString(),
@ -221,7 +209,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
des:
TranslationBase.of(context).oxygenation,
url: url + 'heartbeat.png',
lastVal: patientsProv
lastVal: model
.patientVitalSignOrderdSubList[0].fIO2
.toString(),
unit: '',
@ -243,14 +231,16 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
});
},
child: VitalSignItem(
des: TranslationBase.of(context).painScale,
des: TranslationBase
.of(context)
.painScale,
url: url + 'heartbeat.png',
),
),
],
),
],
),
));
),
),),);
}
}

@ -48,7 +48,7 @@ class VitalSignItem extends StatelessWidget {
des,
style: TextStyle(
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Hexcolor('#B8382C'),
color: HexColor('#B8382C'),
fontWeight: FontWeight.bold),
),
),
@ -71,7 +71,7 @@ class VitalSignItem extends StatelessWidget {
new TextSpan(
text: ' ${unit}',
style: TextStyle(
color: Hexcolor('#B8382C'),
color: HexColor('#B8382C'),
),
),
],

File diff suppressed because one or more lines are too long

@ -1,154 +0,0 @@
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_req_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart';
import '../../../../models/patient/patiant_info_model.dart';
import '../../../../providers/patients_provider.dart';
import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart';
import '../../../../widgets/shared/app_texts_widget.dart';
import '../../../../widgets/shared/card_with_bg_widget.dart';
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import '../../../../widgets/shared/profile_image_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
/*
*@author: Elham Rababah
*@Date:26/4/2020
*@param:
*@return:VitalSignScreen
*@desc: VitalSignScreen class
*/
class VitalSignScreen extends StatefulWidget {
@override
_VitalSignScreenState createState() => _VitalSignScreenState();
}
class _VitalSignScreenState extends State<VitalSignScreen> {
PatientsProvider patientsProv;
var _isInit = true;
/*
*@author: Elham Rababah
*@Date:28/4/2020
*@param: context
*@return:
*@desc: getVitalSignList Function
*/
getVitalSignList(context) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
int inOutpatientType = 1;
if (type == '0') {
inOutpatientType = 2;
}
print(type);
VitalSignReqModel vitalSignReqModel = VitalSignReqModel(
patientID: patient.patientId,
projectID: patient.projectId,
tokenID: token,
patientTypeID: patient.patientType,
inOutpatientType: inOutpatientType,
languageID: 2,
transNo:
patient.admissionNo != null ? int.parse(patient.admissionNo) : 0);
patientsProv.getPatientVitalSign(vitalSignReqModel.toJson());
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getVitalSignList(context);
}
_isInit = false;
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "VITAL SIGN",
body: patientsProv.isLoading
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error)
: patientsProv.patientVitalSignList.length == 0
? DrAppEmbeddedError(error: 'You don\'t have any Vital Sign')
: Container(
margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05,
0,
SizeConfig.realScreenWidth * 0.05,
0),
child: ListView.builder(
itemCount: patientsProv.patientVitalSignList.length,
itemBuilder: (BuildContext ctxt, int index) {
return InkWell(
child: CardWithBgWidget(
widget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
ProfileImageWidget(
url: patientsProv
.patientVitalSignList[index]
.doctorImageURL),
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${patientsProv.patientVitalSignList[index].doctorName}',
fontSize: 2.5 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 8,
),
AppText(
' ${patientsProv.patientVitalSignList[index].clinicName}',
fontSize: 2 *
SizeConfig.textMultiplier,
color: Theme.of(context)
.primaryColor,
),
SizedBox(
height: 8,
),
],
),
),
)
],
),
],
),
),
onTap: () {
Navigator.of(context)
.pushNamed(VITAL_SIGN_DETAILS, arguments: {
'vitalSing':
patientsProv.patientVitalSignList[index]
});
},
);
}),
),
);
}
}

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/providers/hospital_provider.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/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -34,7 +34,7 @@ class SettingsScreen extends StatelessWidget {
child: AnimatedContainer(
duration: Duration(milliseconds: 350),
decoration: BoxDecoration(
color: !projectsProvider.isArabic ? Hexcolor('#58434F') : Colors.transparent,
color: !projectsProvider.isArabic ? HexColor('#58434F') : Colors.transparent,
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]))
@ -47,7 +47,7 @@ class SettingsScreen extends StatelessWidget {
child: AnimatedContainer(
duration: Duration(milliseconds: 350),
decoration: BoxDecoration(
color: projectsProvider.isArabic ? Hexcolor('#58434F') : Colors.transparent,
color: projectsProvider.isArabic ? HexColor('#58434F') : Colors.transparent,
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],))

@ -0,0 +1,77 @@
import 'package:intl/intl.dart';
class DateUtils {
static String convertStringToDateFormat(String date, String dateFormat) {
DateTime dateTime = DateTime.parse(date);
return DateFormat(dateFormat).format(dateTime);
}
static convertDateFromServerFormat(String str, dateFormat) {
const start = "/Date(";
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
return DateFormat(dateFormat).format(date);
}
static String differenceBetweenDateAndCurrentInYearMonthDay(DateTime firstDate) {
DateTime now = DateTime.now();
// now = now.add(Duration(days: 400, minutes: 0));
var difference = firstDate.difference(now);
int years = now.year - firstDate.year;
int months = now.month - firstDate.month;
int days = now.day - firstDate.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, firstDate.day);
days = now.difference(monthAgo).inDays + 1;
}
return "$days Days, $months Months, $years Years";
}
static String differenceBetweenDateAndCurrent(DateTime firstDate) {
DateTime now = DateTime.now();
// DateTime now = nows.add(Duration(days: 400, minutes: 25, hours: 0));
var difference = now.difference(firstDate);
int minutesInDays = difference.inMinutes;
int hoursInDays = minutesInDays ~/ 60;
int minutes = minutesInDays % 60;
int days = hoursInDays ~/ 24;
int hours = hoursInDays % 24;
double hoursInOneDay = difference.inHours / difference.inDays;
return "$days Days, $hours HR, $minutes Min";
}
static String differenceBetweenServerDateAndCurrent(String str) {
const start = "/Date(";
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
return differenceBetweenDateAndCurrent(date);
}
}

@ -33,6 +33,8 @@ class TranslationBase {
String get mobileNo => localizedValues['mobileNo'][locale.languageCode];
String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode];
String get messagesScreenToolbarTitle =>
localizedValues['messagesScreenToolbarTitle'][locale.languageCode];
@ -57,10 +59,8 @@ class TranslationBase {
String get outPatients => localizedValues['outPatients'][locale.languageCode];
String get searchPatient =>
localizedValues['searchPatient'][locale.languageCode];
String get searchAbout =>
localizedValues['searchAbout'][locale.languageCode];
String get patient =>
localizedValues['patient'][locale.languageCode];
String get searchAbout => localizedValues['searchAbout'][locale.languageCode];
String get patient => localizedValues['patient'][locale.languageCode];
String get labResult => localizedValues['labResult'][locale.languageCode];
String get todayStatistics =>
localizedValues['todayStatistics'][locale.languageCode];
@ -71,6 +71,7 @@ class TranslationBase {
String get walkIn => localizedValues['walkIn'][locale.languageCode];
String get notArrived => localizedValues['notArrived'][locale.languageCode];
String get radiology => localizedValues['radiology'][locale.languageCode];
String get service => localizedValues['service'][locale.languageCode];
String get referral => localizedValues['referral'][locale.languageCode];
String get inPatient => localizedValues['inPatient'][locale.languageCode];
String get operations => localizedValues['operations'][locale.languageCode];
@ -78,8 +79,8 @@ class TranslationBase {
localizedValues['patientServices'][locale.languageCode];
String get searchMedicine =>
localizedValues['searchMedicine'][locale.languageCode];
String get myReferralPatient =>
localizedValues['myReferralPatient'][locale.languageCode];
String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode];
String get myReferral => localizedValues['myReferral'][locale.languageCode];
String get myReferredPatient =>
localizedValues['myReferredPatient'][locale.languageCode];
String get firstName => localizedValues['firstName'][locale.languageCode];
@ -112,11 +113,16 @@ class TranslationBase {
String get patientProfile =>
localizedValues['patientProfile'][locale.languageCode];
String get vitalSign => localizedValues['vitalSign'][locale.languageCode];
String get vital => localizedValues['vital'][locale.languageCode];
String get signs => localizedValues['signs'][locale.languageCode];
String get labOrder => localizedValues['labOrder'][locale.languageCode];
String get prescription =>
localizedValues['prescription'][locale.languageCode];
String get insuranceApprovals =>
localizedValues['insuranceApprovals'][locale.languageCode];
String get lab => localizedValues['lab'][locale.languageCode];
String get result => localizedValues['result'][locale.languageCode];
String get medicines => localizedValues['medicines'][locale.languageCode];
String get prescription => localizedValues['prescription'][locale.languageCode];
String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode];
String get insurance => localizedValues['insurance'][locale.languageCode];
String get approvals => localizedValues['approvals'][locale.languageCode];
String get bodyMeasurements =>
localizedValues['bodyMeasurements'][locale.languageCode];
String get temperature => localizedValues['temperature'][locale.languageCode];
@ -136,8 +142,9 @@ class TranslationBase {
String get pleaseEnterAnswer =>
localizedValues['pleaseEnterAnswer'][locale.languageCode];
String get replay => localizedValues['replay'][locale.languageCode];
String get progressNote =>
localizedValues['progressNote'][locale.languageCode];
String get progressNote => localizedValues['progressNote'][locale.languageCode];
String get progress => localizedValues['progress'][locale.languageCode];
String get note => localizedValues['note'][locale.languageCode];
String get searchNote => localizedValues['searchNote'][locale.languageCode];
String get errorNoProgressNote =>
localizedValues['errorNoProgressNote'][locale.languageCode];
@ -191,6 +198,7 @@ class TranslationBase {
String get youDoNotHaveAnyItem =>
localizedValues['youDoNotHaveAnyItem'][locale.languageCode];
String get age => localizedValues['age'][locale.languageCode];
String get nationality => localizedValues['nationality'][locale.languageCode];
String get today => localizedValues['today'][locale.languageCode];
String get tomorrow => localizedValues['tomorrow'][locale.languageCode];
String get all => localizedValues['all'][locale.languageCode];
@ -229,6 +237,7 @@ class TranslationBase {
String get radiologyReport =>
localizedValues['radiologyReport'][locale.languageCode];
String get orders => localizedValues['orders'][locale.languageCode];
String get list => localizedValues['list'][locale.languageCode];
String get searchOrders =>
localizedValues['searchOrders'][locale.languageCode];
String get prescriptionDetails =>
@ -271,8 +280,19 @@ class TranslationBase {
localizedValues['searchPatientImageCaptionBody'][locale.languageCode];
String get welcome => localizedValues['welcome'][locale.languageCode];
String get typeMedicineName => localizedValues['typeMedicineName'][locale.languageCode];
String get moreThan3Letter => localizedValues['moreThan3Letter'][locale.languageCode];
String get typeMedicineName =>
localizedValues['typeMedicineName'][locale.languageCode];
String get moreThan3Letter =>
localizedValues['moreThan3Letter'][locale.languageCode];
String get gender2 => localizedValues['gender2'][locale.languageCode];
String get age2 => localizedValues['age2'][locale.languageCode];
String get admissionDetail => localizedValues['admissionDetail'][locale.languageCode];
String get dateTime => localizedValues['dateTime'][locale.languageCode];
String get admissionNo => localizedValues['admissionNo'][locale.languageCode];
String get losNo => localizedValues['losNo'][locale.languageCode];
String get area => localizedValues['area'][locale.languageCode];
String get room => localizedValues['room'][locale.languageCode];
String get bed => localizedValues['bed'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -108,7 +108,7 @@ class AuthHeader extends StatelessWidget {
Text(
text2,
style: TextStyle(
color: Hexcolor('#B8382C'),
color: HexColor('#B8382C'),
fontSize: textFontSize,
fontWeight: FontWeight.w800),
)
@ -156,7 +156,7 @@ class AuthHeader extends StatelessWidget {
fontSize:
SizeConfig.isMobile ? 26 : SizeConfig.realScreenWidth * 0.030,
fontWeight: FontWeight.w800,
color: Hexcolor('#B8382C')),
color: HexColor('#B8382C')),
),
);
}
@ -172,7 +172,7 @@ class AuthHeader extends StatelessWidget {
style: TextStyle(
fontWeight: FontWeight.w800,
fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029,
color: Hexcolor('#B8382C'),
color: HexColor('#B8382C'),
),
);
}

@ -30,7 +30,7 @@ class ChangePassword extends StatelessWidget {
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
borderSide: BorderSide(color: HexColor('#CCCCCC')),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -69,7 +69,7 @@ class ChangePassword extends StatelessWidget {
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
borderSide: BorderSide(color: HexColor('#CCCCCC')),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -98,7 +98,7 @@ class ChangePassword extends StatelessWidget {
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
borderSide: BorderSide(color: HexColor('#CCCCCC')),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -137,7 +137,7 @@ class ChangePassword extends StatelessWidget {
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(width: 0.5, color: Hexcolor('#CCCCCC'))),
side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))),
),
SizedBox(
height: 10,

@ -8,7 +8,7 @@ import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../config/size_config.dart';
import '../../providers/auth_provider.dart';
import '../../core/viewModel/auth_view_model.dart';
import '../../routes.dart';
import '../../util/dr_app_shared_pref.dart';
import '../../util/dr_app_toast_msg.dart';
@ -69,7 +69,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
@override
Widget build(BuildContext context) {
AuthProvider authProv = Provider.of<AuthProvider>(context);
AuthViewModel authProv = Provider.of<AuthViewModel>(context);
var imeiModel = {'IMEI': _platformImei};
_loginTypeFuture = authProv.selectDeviceImei(imeiModel);
return FutureBuilder(
@ -97,7 +97,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
Container(
decoration: BoxDecoration(
border: Border.all(
color: Hexcolor('#CCCCCC'),
color: HexColor('#CCCCCC'),
),
borderRadius: BorderRadius.circular(50)),
margin: const EdgeInsets.fromLTRB(0, 20.0, 30, 0),
@ -111,7 +111,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
// color: Colors.green, // border color
shape: BoxShape.circle,
border:
Border.all(color: Hexcolor('#CCCCCC'))),
Border.all(color: HexColor('#CCCCCC'))),
child: CircleAvatar(
child: Image.asset(
'assets/images/dr_avatar.png',
@ -129,7 +129,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
_loggedUser['List_MemberInformation'][0]
['MemberName'],
style: TextStyle(
color: Hexcolor('515A5D'),
color: HexColor('515A5D'),
fontSize:
2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w800),
@ -137,7 +137,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
Text(
'ENT Spec',
style: TextStyle(
color: Hexcolor('515A5D'),
color: HexColor('515A5D'),
fontSize:
1.5 * SizeConfig.textMultiplier),
)
@ -203,7 +203,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(width: 0.5, color: Hexcolor('#CCCCCC'))),
side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))),
),
SizedBox(
height: 10,

@ -10,8 +10,8 @@ import 'package:provider/provider.dart';
import '../../config/shared_pref_kay.dart';
import '../../config/size_config.dart';
import '../../models/doctor/user_model.dart';
import '../../providers/auth_provider.dart';
import '../../providers/hospital_provider.dart';
import '../../core/viewModel/auth_view_model.dart';
import '../../core/viewModel/hospital_view_model.dart';
import '../../routes.dart';
import '../../util/dr_app_shared_pref.dart';
import '../../util/dr_app_toast_msg.dart';
@ -51,7 +51,7 @@ class _LoginFormState extends State<LoginForm> {
channel: 9,
sessionID: "i1UJwCTSqt");
AuthProvider authProv;
AuthViewModel authProv;
@override
void initState() {
super.initState();
@ -61,7 +61,7 @@ class _LoginFormState extends State<LoginForm> {
@override
void didChangeDependencies() {
super.didChangeDependencies();
authProv = Provider.of<AuthProvider>(context);
authProv = Provider.of<AuthViewModel>(context);
if (_isInit) {
if (projectsList.length == 0) {
@ -159,7 +159,7 @@ class _LoginFormState extends State<LoginForm> {
padding: const EdgeInsets.all(0.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(width: 0.5, color: Hexcolor('#CCCCCC'))),
side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))),
child: Container(
padding: const EdgeInsets.all(10.0),
height: 50,
@ -199,7 +199,7 @@ class _LoginFormState extends State<LoginForm> {
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
borderSide: BorderSide(color: HexColor('#CCCCCC')),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -222,7 +222,7 @@ class _LoginFormState extends State<LoginForm> {
);
}
login(context, AuthProvider authProv, Function changeLoadingStata) {
login(context, AuthViewModel authProv, Function changeLoadingStata) {
FocusScopeNode currentFocus = FocusScope.of(context);
// if (!currentFocus.hasPrimaryFocus) {
@ -258,7 +258,7 @@ class _LoginFormState extends State<LoginForm> {
}
}
insertDeviceImei(preRes, AuthProvider authProv) {
insertDeviceImei(preRes, AuthViewModel authProv) {
if (_platformImei != 'Unknown') {
var imeiInfo = {
"IMEI": _platformImei,
@ -323,7 +323,7 @@ class _LoginFormState extends State<LoginForm> {
}
getProjectsList() {
HospitalProvider projectsProv = Provider.of<HospitalProvider>(context);
HospitalViewModel projectsProv = Provider.of<HospitalViewModel>(context);
projectsProv.getProjectsList().then((res) {
if (res['MessageStatus'] == 1) {
setState(() {

@ -2,12 +2,13 @@ import 'dart:async';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/auth_provider.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
Helpers helpers = Helpers();
class ShowTimerText extends StatefulWidget {
ShowTimerText({Key key, this.model});
@ -23,7 +24,7 @@ class _ShowTimerTextState extends State<ShowTimerText> {
int sec = 59;
Timer _timer;
AuthProvider authProv;
AuthViewModel authProv;
resendCode() {
min = TIMER_MIN - 1;
@ -63,7 +64,7 @@ class _ShowTimerTextState extends State<ShowTimerText> {
@override
Widget build(BuildContext context) {
authProv = Provider.of<AuthProvider>(context);
authProv = Provider.of<AuthViewModel>(context);
return Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
@ -78,7 +79,7 @@ class _ShowTimerTextState extends State<ShowTimerText> {
timerText,
style: TextStyle(
fontSize: 3.0 * SizeConfig.textMultiplier,
color: Hexcolor('#B8382C'),
color: HexColor('#B8382C'),
fontWeight: FontWeight.bold),
),
),

@ -10,7 +10,7 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../config/size_config.dart';
import '../../providers/auth_provider.dart';
import '../../core/viewModel/auth_view_model.dart';
import '../../routes.dart';
import '../../util/dr_app_shared_pref.dart';
import '../../util/dr_app_toast_msg.dart';
@ -40,7 +40,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
};
Future _loggedUserFuture;
var _loggedUser;
AuthProvider authProv;
AuthViewModel authProv;
bool _isInit = true;
var model;
TextEditingController digit1 = TextEditingController(text: "");
@ -64,7 +64,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
authProv = Provider.of<AuthProvider>(context);
authProv = Provider.of<AuthViewModel>(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
model = routeArgs['model'];
}
@ -73,7 +73,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
@override
Widget build(BuildContext context) {
authProv = Provider.of<AuthProvider>(context);
authProv = Provider.of<AuthViewModel>(context);
final focusD1 = FocusNode();
final focusD2 = FocusNode();
final focusD3 = FocusNode();
@ -227,7 +227,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
borderRadius: BorderRadius.circular(10),
side: BorderSide(
width: 0.5,
color: Hexcolor('#CCCCCC'))),
color: HexColor('#CCCCCC'))),
),
buildSizedBox(20),
ShowTimerText(model: model),
@ -335,7 +335,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
*@return:
*@desc: verify Account func call sendActivationCodeByOtpNotificationType service
*/
verifyAccount(AuthProvider authProv, Function changeLoadingStata) async {
verifyAccount(AuthViewModel authProv, Function changeLoadingStata) async {
if (verifyAccountForm.currentState.validate()) {
changeLoadingStata(true);

@ -6,7 +6,7 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../config/size_config.dart';
import '../../providers/auth_provider.dart';
import '../../core/viewModel/auth_view_model.dart';
import '../../routes.dart';
import '../../util/dr_app_shared_pref.dart';
import '../../util/helpers.dart';
@ -57,7 +57,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
@override
Widget build(BuildContext context) {
AuthProvider authProv = Provider.of<AuthProvider>(context);
AuthViewModel authProv = Provider.of<AuthViewModel>(context);
return FutureBuilder(
future: Future.wait([_loggedUserFuture]),
builder: (BuildContext context, AsyncSnapshot snapshot) {
@ -145,7 +145,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
*@return: Center widget
*@desc: buildSMSMethod Methods widget
*/
Center buildSMSMethod(BuildContext context, AuthProvider authProv) {
Center buildSMSMethod(BuildContext context, AuthViewModel authProv) {
return buildVerificationMethod(
context,
'assets/images/verification_sms_icon.png',
@ -161,7 +161,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
*@return: Center widget
*@desc: build WhatsApp Methods widget
*/
Center buildWhatsAppMethod(BuildContext context, AuthProvider authProv) {
Center buildWhatsAppMethod(BuildContext context, AuthViewModel authProv) {
return buildVerificationMethod(
context,
'assets/images/verification_whatsapp_icon.png',
@ -177,7 +177,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
*@return: Center widget
*@desc: build FaceID Methods widget
*/
Center buildFaceIDMethod(BuildContext context, AuthProvider authProv) {
Center buildFaceIDMethod(BuildContext context, AuthViewModel authProv) {
return buildVerificationMethod(
context,
'assets/images/verification_faceid_icon.png',
@ -193,7 +193,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
*@return: Center widget
*@desc: build Fingerprint Methods widget
*/
Center buildFingerprintMethod(BuildContext context, AuthProvider authProv) {
Center buildFingerprintMethod(BuildContext context, AuthViewModel authProv) {
return buildVerificationMethod(
context,
'assets/images/verification_fingerprint_icon.png',
@ -222,7 +222,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
decoration: BoxDecoration(
border: Border.all(
width: 1,
color: Hexcolor(
color: HexColor(
'#CCCCCC') // <--- border width here
),
borderRadius: BorderRadius.all(Radius.circular(10))),
@ -262,7 +262,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
*@return:
*@desc: send Activation Code By Otp Notification Type
*/
sendActivationCodeByOtpNotificationType(oTPSendType, AuthProvider authProv) {
sendActivationCodeByOtpNotificationType(oTPSendType, AuthViewModel authProv) {
// TODO : build enum for verfication method
if (oTPSendType == 1 || oTPSendType == 2) {
widget.changeLoadingStata(true);

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:provider/provider.dart';
import '../shared/rounded_container_widget.dart';

@ -28,7 +28,7 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
margin: EdgeInsets.symmetric(vertical: 10.0),
width: double.infinity,
decoration: BoxDecoration(
color: Hexcolor('#FFFFFF'),
color: HexColor('#FFFFFF'),
borderRadius: BorderRadius.all(
Radius.circular(20.0),
),

@ -81,7 +81,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
Expanded(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
@ -98,7 +98,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
),
Expanded(
child: Container(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
child: Center(
child: Texts(
TranslationBase.of(context).value,
@ -109,7 +109,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
Expanded(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),

@ -1,22 +1,27 @@
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/referral_view_model.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart';
import 'package:doctor_app_flutter/providers/referral_patient_provider.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/translations_delegate_base.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/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:intl/intl.dart';
class MyReferralPatientWidget extends StatefulWidget {
final MyReferralPatientModel myReferralPatientModel;
final ReferralPatientViewModel model;
final bool isExpand;
final Function expandClick;
MyReferralPatientWidget({Key key, this.myReferralPatientModel});
MyReferralPatientWidget({Key key, this.myReferralPatientModel, this.model, this.isExpand, this.expandClick});
@override
_MyReferralPatientWidgetState createState() =>
@ -24,7 +29,6 @@ class MyReferralPatientWidget extends StatefulWidget {
}
class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
bool _showDetails = false;
bool _isLoading = false;
final _formKey = GlobalKey<FormState>();
String error;
@ -39,308 +43,416 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
@override
Widget build(BuildContext context) {
return CardWithBgWidgetNew(
widget: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
InkWell(
onTap: () {
setState(() {
_showDetails = !_showDetails;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
AppText(
'${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.lastName}',
fontSize: 2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
Icon(_showDetails
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down),
],
),
),
!_showDetails
? Container()
: AnimatedContainer(
duration: Duration(milliseconds: 200),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 5,
),
Divider(
color: Color(0xFF000000),
height: 0.5,
return Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 8),
padding: EdgeInsets.only(left: 0, top: 8, right: 0, bottom: 0),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.fromBorderSide(BorderSide(
color: Color(0xffCCCCCC),
width: 2,
)),
color: Color(0xffffffff),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
HeaderBodyExpandableNotifier(
headerWidget: Column(
children: [
Container(
padding:
EdgeInsets.only(left: 16, top: 8, right: 8, bottom: 0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
color: Color(0xFFB8382C),
padding: EdgeInsets.symmetric(
vertical: 4, horizontal: 4),
child: AppText(
'${widget.myReferralPatientModel.priorityDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.white,
),
),
SizedBox(
height: 10,
),
AppText(
'${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.middleName} ${widget.myReferralPatientModel.lastName}',
fontSize: 2 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
),
SizedBox(
height: 10,
),
Row(
children: [
AppText(
TranslationBase.of(context).fileNo,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
),
SizedBox(
width: 20,
),
AppText(
'${widget.myReferralPatientModel.referralDoctor}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
),
],
),
],
),
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 0.5),
),
Container(
margin:
EdgeInsets.symmetric(horizontal: 8, vertical: 8),
child: InkWell(
onTap: widget.expandClick,
child: Image.asset(
"assets/images/ic_circle_arrow.png",
width: 25,
height: 25,
color: Colors.black,
),
children: [
TableRow(children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).fileNo,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
AppText(
'${widget.myReferralPatientModel.referringDoctor}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
)
],
),
),
SizedBox(
height: 10,
),
],
),
bodyWidget: Container(
child: Column(
children: [
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
Container(
height: 1.8 * SizeConfig.textMultiplier * 6,
padding:
EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0),
child: Expanded(
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 8,
),
),
Container(
margin: EdgeInsets.only(
left: 4, top: 2.5, right: 2.5, bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context)
.referralDoctor,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
AppText(
widget.myReferralPatientModel
.referringClinicDescription,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
SizedBox(
child: AppText(
TranslationBase.of(context).referralDoctor,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
),
),
),
]),
TableRow(children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context)
.referringClinic,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
AppText(
'${widget.myReferralPatientModel.referringClinicDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
SizedBox(
height: 4,
),
SizedBox(
child: AppText(
'${widget.myReferralPatientModel.referringDoctorName}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
),
),
SizedBox(
height: 8,
),
],
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: SizedBox(
child: Container(
color: Color(0xffCCCCCC),
),
Container(
margin: EdgeInsets.only(
left: 4, top: 2.5, right: 2.5, bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).frequency,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
AppText(
widget.myReferralPatientModel
.frequencyDescription,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
width: 1,
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 8,
),
SizedBox(
child: AppText(
TranslationBase.of(context).referringClinic,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
),
),
SizedBox(
height: 4,
),
SizedBox(
child: AppText(
'${widget.myReferralPatientModel.referringClinicDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
),
),
SizedBox(
height: 8,
),
)
]),
TableRow(
],
),
),
],
),
),
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 10,
),
Container(
height: 1.8 * SizeConfig.textMultiplier * 6,
padding:
EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0),
child: Expanded(
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).priority,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
AppText(
'${widget.myReferralPatientModel.priorityDescription}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
SizedBox(
height: 8,
),
SizedBox(
child: AppText(
TranslationBase.of(context).frequency,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
),
),
Container(
margin: EdgeInsets.only(
left: 4,
top: 2.5,
right: 2.5,
bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context)
.maxResponseTime,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
AppText(
Helpers.getDateFormatted(widget
.myReferralPatientModel
.mAXResponseTime),
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
SizedBox(
height: 4,
),
SizedBox(
child: AppText(
'${widget.myReferralPatientModel.frequencyDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
),
)
),
SizedBox(
height: 8,
),
],
),
],
),
Divider(
color: Color(0xFF000000),
height: 0.5,
),
SizedBox(
height: 5,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context)
.clinicDetailsandRemarks,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: SizedBox(
child: Container(
color: Color(0xffCCCCCC),
),
width: 1,
),
Texts(
'${widget.myReferralPatientModel.referringDoctorRemarks}',
style: "bodyText1",
readMore: true,
textAlign: TextAlign.start,
maxLength: 100)
],
),
SizedBox(
height: 5,
),
AppText(
TranslationBase.of(context).answerSuggestions,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
),
Form(
key: _formKey,
child: TextFields(
controller:answerController,
maxLines: 2,
minLines: 2,
hintText:
TranslationBase.of(context).answerThePatient,
fontWeight: FontWeight.normal,
readOnly: _isLoading,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.pleaseEnterAnswer;
else
return null;
},
),
),
SizedBox(height: 10.0),
SizedBox(height: 10.0),
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 10, right: 10),
child: Button(
onTap: () async {
final form = _formKey.currentState;
if (form.validate()) {
setState(() {
_isLoading = true;
});
try {
await Provider.of<MyReferralPatientProvider>(
context,
listen: false)
.replay(answerController.text.toString(),
widget.myReferralPatientModel);
setState(() {
_isLoading = false;
});
DrAppToastMsg.showSuccesToast(
'Reply Successfully');
} catch (e) {
setState(() {
_isLoading = false;
});
DrAppToastMsg.showErrorToast(e);
}
}
},
title: TranslationBase.of(context).replay,
loading: _isLoading,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 8,
),
SizedBox(
child: AppText(
TranslationBase.of(context).maxResponseTime,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
),
),
SizedBox(
height: 4,
),
SizedBox(
child: AppText(
'${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime)}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
),
),
SizedBox(
height: 8,
),
],
),
),
],
),
),
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 10,
),
Container(
padding:
EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0),
child: Expanded(
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 8,
),
SizedBox(
child: AppText(
TranslationBase.of(context)
.clinicDetailsandRemarks,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
),
),
SizedBox(
height: 4,
),
SizedBox(
child: AppText(
'${widget.myReferralPatientModel.referringDoctorRemarks}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
),
),
SizedBox(
height: 8,
),
],
),
),
)
],
],
),
),
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 10,
),
Container(
color: Colors.white,
padding: EdgeInsets.all(8),
child: Form(
key: _formKey,
child: TextFields(
controller: answerController,
maxLines: 3,
minLines: 2,
hintText: TranslationBase.of(context).answerThePatient,
fontWeight: FontWeight.normal,
readOnly: _isLoading,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.pleaseEnterAnswer;
else
return null;
},
),
),
),
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 10, right: 10),
child: Button(
onTap: () async {
final form = _formKey.currentState;
if (form.validate()) {
try {
await widget.model.replay(
answerController.text.toString(),
widget.myReferralPatientModel);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).replySuccessfully);
} catch (e) {
DrAppToastMsg.showErrorToast(e);
}
}
},
title: TranslationBase.of(context).replay,
loading: widget.model.state == ViewState.BusyLocal,
),
)
],
),
],
),
),
isExpand: widget.isExpand,
),
],
),
);
}

@ -1,27 +1,22 @@
import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.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/referred_view_model.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/referred_patient_provider.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart';
import 'package:flutter/material.dart';
class MyReferredPatientWidget extends StatefulWidget {
final MyReferredPatientModel myReferredPatientModel;
final ReferredPatientViewModel model;
MyReferredPatientWidget({Key key, this.myReferredPatientModel});
MyReferredPatientWidget({Key key, this.myReferredPatientModel, this.model});
@override
_MyReferredPatientWidgetState createState() =>
@ -293,23 +288,17 @@ class _MyReferredPatientWidgetState extends State<MyReferredPatientWidget> {
child: Button(
onTap: () async {
try {
setState(() {
_isLoading = true;
});
await Provider.of<MyReferredPatientProvider>(context, listen: false).verify(widget.myReferredPatientModel);
setState(() {
_isLoading = false;
});
await widget.model.verify(widget.myReferredPatientModel);
DrAppToastMsg.showSuccesToast('Verify Successfully');
} catch (e) {
setState(() {
_isLoading = false;
});
DrAppToastMsg.showErrorToast(e);
}
},
title: TranslationBase.of(context).verify,
loading: _isLoading,
loading: widget.model.state == ViewState.BusyLocal,
),
)
],

@ -1,8 +1,5 @@
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import './profile_general_info_content_widget.dart';
import '../../../config/size_config.dart';

@ -1,7 +1,12 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.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/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/profile_image_widget.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import './profile_medical_info_widget.dart';
/*
@ -19,54 +24,401 @@ class PatientProfileWidget extends StatelessWidget {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
return CustomScrollView(primary: false, slivers: <Widget>[
SliverList(
delegate: SliverChildListDelegate(
[
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Column(children: <Widget>[
Container(
padding: EdgeInsets.only(top: 20),
child: ProfileImageWidget(
url:
"https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
name: patient.firstName + ' ' + patient.lastName,
fontsize: 24.0,
color: Colors.black,
return Container(
color: Color(0XFFF2F2F2),
child: CustomScrollView(primary: false, slivers: <Widget>[
SliverList(
delegate: SliverChildListDelegate(
[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.grey.shade300,
blurRadius: 10.0,
spreadRadius: 0,
offset: Offset(0, 10)
),
],
color: Colors.white
),
child: Column(children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
),
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
patient.firstName + ' ' + patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Row(
children: [
AppText(
TranslationBase.of(context).fileNo,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 20,
),
AppText(
patient.patientId.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
)
],
)
],
),
),
Container(
child: Column(
children: <Widget>[
AppText(
'File No: ' + patient.patientId.toString(),
fontWeight: FontWeight.normal,
fontSize: 16,
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
Container(
height: 10 * SizeConfig.textMultiplier,
child: Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).age,
fontWeight: FontWeight.bold,
fontSize: 2 * SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
"${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${patient.age}",
fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
],
),
),
),
Container(
width: 1,
color: Color(0xffCCCCCC),
),
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).nationality,
fontWeight: FontWeight.bold,
fontSize: 2 * SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
patient.nationalityName,
fontWeight: FontWeight.normal,
fontSize: 1.7 * SizeConfig.textMultiplier,
),
],
),
),
),
Container(
width: 1,
color: Color(0xffCCCCCC),
),
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).gender,
fontWeight: FontWeight.bold,
fontSize: 2 * SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
patient.genderDescription,
fontWeight: FontWeight.normal,
fontSize: 1.8 * SizeConfig.textMultiplier,
),
],
),
),
),
AppText(
patient.genderDescription.toString() +
', ' +
patient.age,
fontWeight: FontWeight.normal,
fontSize: 16,
)
],
),
)
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
]),
]),
),
],
),
Container(
margin: EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).admissionDetail,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 1.8 * SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
Container(
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB),
width: 1,
)),
),
child: Column(
children: [
Padding(
padding: EdgeInsets.all(16),
child: Column(
children: [
Row(
children: [
Container(
width: 14 * SizeConfig.textMultiplier,
child: AppText(
TranslationBase.of(context).dateTime,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
),
AppText(
"${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}",
color: Colors.black,
fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Container(
width: 14 * SizeConfig.textMultiplier,
child: AppText(
TranslationBase.of(context).admissionNo,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
),
AppText(
patient.admissionNo,
color: Colors.black,
fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
Container(
width: 14 * SizeConfig.textMultiplier,
child: AppText(
TranslationBase.of(context).losNo,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
),
AppText(
DateUtils.differenceBetweenServerDateAndCurrent(patient.admissionDate),
color: Colors.black,
fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
],
),
],
),
),
const Divider(
color: Color(0xffCCCCCC),
height: 5,
thickness: 1,
indent: 0,
endIndent: 0,
),
Container(
height: 10 * SizeConfig.textMultiplier,
child: Row(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).area,
fontWeight: FontWeight.bold,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
SizedBox(
height: 4,
),
AppText(
patient.clinicDescription,
fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
],
),
),
),
Container(
width: 1,
color: Color(0xffCCCCCC),
),
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).room,
fontWeight: FontWeight.bold,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
SizedBox(
width: 4,
),
AppText(
"${patient.nursingStationName}\n${patient.roomId}",
fontWeight: FontWeight.normal,
fontSize: 1.4 * SizeConfig.textMultiplier,
),
],
),
),
SizedBox(
height: 4,
),
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).bed,
fontWeight: FontWeight.bold,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
SizedBox(
width: 4,
),
AppText(
"${patient.bedId}",
fontWeight: FontWeight.normal,
fontSize: 1.6 * SizeConfig.textMultiplier,
),
],
),
),
],
),
),
),
],
),
)
],
),
)
],
),
),
],
),
],
),
),
SliverPadding(
padding: const EdgeInsets.all(16.0),
sliver: ProfileMedicalInfoWidget(
patient: patient,
))
]),
);
}
}
class AvatarWidget extends StatelessWidget {
final Widget avatarIcon;
AvatarWidget(this.avatarIcon);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.08),
offset: Offset(0.0, 5.0),
blurRadius: 16.0)
],
borderRadius: BorderRadius.all(Radius.circular(35.0)),
color: Color(0xffCCCCCC),
),
SliverPadding(
padding: const EdgeInsets.fromLTRB(20, 30, 15, 10),
sliver: ProfileMedicalInfoWidget(
patient: patient,
))
]);
child: avatarIcon,
);
}
}

@ -30,11 +30,11 @@ class ProfileGeneralInfoContentWidget extends StatelessWidget {
title,
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.w700,
color: Hexcolor('#58434F'),
color: HexColor('#58434F'),
),
AppText(
info,
color: Hexcolor('#707070'),
color: HexColor('#707070'),
fontSize: SizeConfig.textMultiplier * 2,
)
],

@ -33,7 +33,7 @@ class ProfileHeaderWidget extends StatelessWidget {
des: patient.patientId.toString(),
height: SizeConfig.heightMultiplier * 17,
width: SizeConfig.heightMultiplier * 17,
color: Hexcolor('#58434F')),
color: HexColor('#58434F')),
);
}
}

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../config/size_config.dart';
@ -29,26 +30,30 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
PatientProfileButton(
key: key,
patient: patient,
name: TranslationBase.of(context).vitalSign,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS,
icon: 'heartbeat.png'),
PatientProfileButton(
key: key,
patient: patient,
route: LAB_ORDERS,
name: TranslationBase.of(context).labOrder,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'lab.png'),
PatientProfileButton(
key: key,
patient: patient,
route: PRESCRIPTIONS,
name: TranslationBase.of(context).prescription,
nameLine1: TranslationBase.of(context).medicines,
nameLine2: TranslationBase.of(context).prescription,
icon: 'note.png'),
PatientProfileButton(
key: key,
patient: patient,
route: RADIOLOGY,
name: TranslationBase.of(context).radiology,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
icon: 'radiology-1.png'),
Visibility(
visible: selectedPatientType != 0 && selectedPatientType != 5,
@ -56,13 +61,15 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
key: key,
patient: patient,
route: PROGRESS_NOTE,
name: TranslationBase.of(context).progressNote,
nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note,
icon: 'heartbeat.png')),
PatientProfileButton(
key: key,
patient: patient,
route: PATIENT_INSURANCE_APPROVALS,
name: TranslationBase.of(context).insuranceApprovals,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).approvals,
icon: 'lab.png'),
Visibility(
visible: selectedPatientType != 0 &&
@ -72,7 +79,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
key: key,
patient: patient,
route: REFER_PATIENT,
name: TranslationBase.of(context).myReferralPatient,
nameLine1: TranslationBase.of(context).myReferral,
nameLine2: TranslationBase.of(context).patient,
icon: 'note.png')),
Visibility(
visible: selectedPatientType != 0 && selectedPatientType != 5,
@ -80,7 +88,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
key: key,
patient: patient,
route: PATIENT_ORDERS,
name: TranslationBase.of(context).orders,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).list,
icon: 'radiology-1.png')),
]);
}
@ -114,7 +123,7 @@ class CircleAvatarWidget extends StatelessWidget {
decoration: new BoxDecoration(
// color: Colors.green, // border color
shape: BoxShape.circle,
border: Border.all(color: Hexcolor('#B7831A'), width: 1.5)),
border: Border.all(color: HexColor('#B7831A'), width: 1.5)),
child: CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12,
child: Image.asset(url),
@ -136,13 +145,14 @@ class CircleAvatarWidget extends StatelessWidget {
}
class PatientProfileButton extends StatelessWidget {
final String name;
final String nameLine1;
final String nameLine2;
final String icon;
final dynamic route;
final PatiantInformtion patient;
final String url = "assets/images/";
PatientProfileButton(
{Key key, this.patient, this.name, this.icon, this.route})
{Key key, this.patient, this.nameLine1, this.nameLine2, this.icon, this.route})
: super(key: key);
@override
Widget build(BuildContext context) {
@ -156,12 +166,25 @@ class PatientProfileButton extends StatelessWidget {
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.all(5),
child: new AppText(
this.name,
color: Colors.red,
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
this.nameLine1,
color: Color(0xFFB9382C),
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
),
AppText(
this.nameLine2,
color: Colors.black,
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
),
],
),
),
Expanded(
@ -181,6 +204,10 @@ class PatientProfileButton extends StatelessWidget {
// border: Border.all(),
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB),
width: 1,
)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),

@ -32,11 +32,11 @@ class ProfileStatusInfoWidget extends StatelessWidget {
'Insurance approval',
fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.w700,
color: Hexcolor('#58434F'),
color: HexColor('#58434F'),
),
AppText(
'Approved',
color: Hexcolor('#707070'),
color: HexColor('#707070'),
fontSize: SizeConfig.textMultiplier * 2.5,
)
],

@ -54,7 +54,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
@ -71,7 +71,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
Container(
child: Container(
decoration: BoxDecoration(
color: Hexcolor('#515B5D'),
color: HexColor('#515B5D'),
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),

@ -226,7 +226,7 @@ class _TextsState extends State<Texts> {
},
child: Text(hidden ? "Read More" : "Read less",
style: _getFontStyle().copyWith(
color: Hexcolor('#FF0000'),
color: HexColor('#FF0000'),
fontWeight: FontWeight.w800,
fontFamily: "WorkSans"
)

@ -95,7 +95,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
? 22.0
: 19),
decoration: BoxDecoration(
color: Hexcolor('#515b5d'),
color: HexColor('#515b5d'),
borderRadius: BorderRadius.all(Radius.circular(10.0)),
boxShadow: [
BoxShadow(
@ -121,7 +121,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
child: CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>(
Hexcolor('#FFDDD9'),
HexColor('#FFDDD9'),
),
),
),

@ -26,7 +26,7 @@ class AppButton extends StatefulWidget {
Widget build(BuildContext context) {
return
RawMaterialButton(
fillColor: widget.color != null ? widget.color : Hexcolor("#B8382C"),
fillColor: widget.color != null ? widget.color : HexColor("#B8382C"),
splashColor: widget.color,
child: Padding(
padding: EdgeInsets.only(

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/providers/auth_provider.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/translations_delegate_base.dart';
import 'package:flutter/material.dart';
@ -40,7 +40,7 @@ class _AppDrawerState extends State<AppDrawer> {
@override
Widget build(BuildContext context) {
AuthProvider authProvider = Provider.of(context);
AuthViewModel authProvider = Provider.of(context);
return RoundedContainer(
child: Container(
color: Colors.white,

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
@ -33,7 +33,7 @@ class AppScaffold extends StatelessWidget {
appBar: isShowAppBar
? AppBar(
elevation: 0,
backgroundColor: Hexcolor('#515B5D'),
backgroundColor: HexColor('#515B5D'),
textTheme: TextTheme(headline6: TextStyle(color: Colors.white)),
title: Text(appBarTitle.toUpperCase()),
leading: Builder(builder: (BuildContext context) {

@ -55,12 +55,12 @@ class AppTextFormField extends FormField<String> {
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(6)),
borderSide: BorderSide(
color: borderColor != null ? borderColor : Hexcolor(
color: borderColor != null ? borderColor : HexColor(
"#CCCCCC")),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: borderColor != null ? borderColor : Hexcolor(
color: borderColor != null ? borderColor : HexColor(
"#CCCCCC")),
borderRadius: BorderRadius.all(Radius.circular(6)),
)

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
@ -31,7 +31,7 @@ class CardWithBgWidgetNew extends StatelessWidget {
),
child: Material(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
color: Hexcolor('#FFFFFF'),
color: HexColor('#FFFFFF'),
child: Stack(
children: [
Center(

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
@ -26,7 +26,7 @@ class CardWithBgWidget extends StatelessWidget {
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Hexcolor('#707070'), width: 2.0),
border: Border.all(color: HexColor('#707070'), width: 2.0),
),
child: Material(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -36,7 +36,7 @@ class CardWithBgWidget extends StatelessWidget {
Positioned(
child: Container(
width: 10,
color: Hexcolor('#58434F'),
color: HexColor('#58434F'),
),
bottom: 0,
top: 0,
@ -46,7 +46,7 @@ class CardWithBgWidget extends StatelessWidget {
Positioned(
child: Container(
width: 10,
color: Hexcolor('#58434F'),
color: HexColor('#58434F'),
),
bottom: 0,
top: 0,

@ -0,0 +1,67 @@
import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart';
class HeaderBodyExpandableNotifier extends StatefulWidget {
final Widget headerWidget;
final Widget bodyWidget;
final Widget collapsed;
final bool isExpand;
bool expandFlag = false;
var controller = new ExpandableController();
HeaderBodyExpandableNotifier({this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand});
@override
_HeaderBodyExpandableNotifierState createState() =>
_HeaderBodyExpandableNotifierState();
}
class _HeaderBodyExpandableNotifierState
extends State<HeaderBodyExpandableNotifier> {
@override
Widget build(BuildContext context) {
setState(() {
if (widget.isExpand == true) {
widget.expandFlag = widget.isExpand;
widget.controller.expanded = true;
}
});
return ExpandableNotifier(
child: Padding(
padding: const EdgeInsets.only(left: 0, right: 0),
child: Column(
children: <Widget>[
SizedBox(
child: widget.headerWidget,
),
ScrollOnExpand(
scrollOnExpand: true,
scrollOnCollapse: false,
child: ExpandablePanel(
theme: const ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center,
tapBodyToCollapse: true,
),
// header: widget.headerWidget,
collapsed: Container(),
expanded: widget.bodyWidget,
builder: (_, collapsed, expanded) {
return Padding(
padding: EdgeInsets.only(left: 0, right: 0, bottom: 0),
child: Expandable(
controller: widget.controller,
collapsed: collapsed,
expanded: expanded,
theme: const ExpandableThemeData(crossFadePoint: 0),
),
);
},
),
),
],
),
),
);
}
}

@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "12.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "0.39.8"
version: "0.40.6"
archive:
dependency: transitive
description:
@ -49,7 +49,7 @@ packages:
name: bazel_worker
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.23+1"
version: "0.1.25"
boolean_selector:
dependency: transitive
description:
@ -63,14 +63,14 @@ packages:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.2"
version: "1.5.2"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.2"
version: "0.4.4"
build_daemon:
dependency: transitive
description:
@ -84,35 +84,35 @@ packages:
name: build_modules
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.1"
version: "3.0.1"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.7"
version: "1.4.4"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
version: "1.10.7"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "5.1.0"
version: "6.1.2"
build_web_compilers:
dependency: "direct dev"
description:
name: build_web_compilers
url: "https://pub.dartlang.org"
source: hosted
version: "2.9.0"
version: "2.12.2"
built_collection:
dependency: transitive
description:
@ -162,6 +162,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
cli_util:
dependency: transitive
description:
name: cli_util
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
clock:
dependency: transitive
description:
@ -175,7 +182,7 @@ packages:
name: code_builder
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.1"
version: "3.5.0"
collection:
dependency: transitive
description:
@ -189,21 +196,28 @@ packages:
name: connectivity
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8+2"
version: "0.4.9+5"
connectivity_for_web:
dependency: transitive
description:
name: connectivity_for_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.1+4"
connectivity_macos:
dependency: transitive
description:
name: connectivity_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0+2"
version: "0.1.0+7"
connectivity_platform_interface:
dependency: transitive
description:
name: connectivity_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.0.6"
convert:
dependency: transitive
description:
@ -217,14 +231,7 @@ packages:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
csslib:
dependency: transitive
description:
name: csslib
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
version: "2.1.5"
cupertino_icons:
dependency: "direct main"
description:
@ -238,21 +245,28 @@ packages:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.4"
version: "1.3.10"
device_info:
dependency: "direct main"
description:
name: device_info
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.2+4"
version: "0.4.2+10"
device_info_platform_interface:
dependency: transitive
description:
name: device_info_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
eva_icons_flutter:
dependency: "direct main"
description:
name: eva_icons_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.1"
expandable:
dependency: "direct main"
description:
@ -267,6 +281,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
ffi:
dependency: transitive
description:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "5.2.1"
fixnum:
dependency: transitive
description:
@ -304,7 +332,7 @@ packages:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.7"
version: "1.0.11"
flutter_test:
dependency: "direct dev"
description: flutter
@ -342,21 +370,14 @@ packages:
name: hexcolor
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
html:
dependency: transitive
description:
name: html
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.0+3"
version: "1.0.6"
http:
dependency: "direct main"
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.1"
version: "0.12.2"
http_interceptor:
dependency: "direct main"
description:
@ -384,7 +405,7 @@ packages:
name: imei_plugin
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.2.0"
intl:
dependency: "direct main"
description:
@ -405,21 +426,21 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.1+1"
version: "0.6.2"
json_annotation:
dependency: transitive
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
version: "3.1.1"
local_auth:
dependency: "direct main"
description:
name: local_auth
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.2+1"
version: "0.6.3+4"
logging:
dependency: transitive
description:
@ -433,7 +454,7 @@ packages:
name: maps_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.2.2+2"
matcher:
dependency: transitive
description:
@ -454,7 +475,7 @@ packages:
name: mime
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.6+3"
version: "0.9.7"
nested:
dependency: transitive
description:
@ -468,14 +489,14 @@ packages:
name: node_interop
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
version: "1.2.1"
node_io:
dependency: transitive
description:
name: node_io
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1+2"
version: "1.2.0"
package_config:
dependency: transitive
description:
@ -490,34 +511,55 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.1"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+2"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+3"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0+1"
version: "1.9.2"
percent_indicator:
dependency: "direct main"
description:
name: percent_indicator
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1+1"
version: "2.1.8"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0+hotfix.5"
version: "5.0.1+1"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.1"
platform:
dependency: transitive
description:
@ -531,7 +573,7 @@ packages:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
version: "1.0.3"
pool:
dependency: transitive
description:
@ -539,6 +581,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
process:
dependency: transitive
description:
name: process
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.13"
progress_hud_v2:
dependency: "direct main"
description:
@ -552,14 +601,14 @@ packages:
name: protobuf
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.1.0"
provider:
dependency: "direct main"
description:
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.5+1"
version: "4.3.2+3"
pub_semver:
dependency: transitive
description:
@ -580,7 +629,7 @@ packages:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.1.5"
scratch_space:
dependency: transitive
description:
@ -594,35 +643,49 @@ packages:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.7"
version: "0.5.12+4"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.2+4"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+7"
version: "0.0.1+11"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
version: "1.0.4"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2+4"
version: "0.1.2+7"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+3"
shelf:
dependency: transitive
description:
name: shelf
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.5"
version: "0.7.9"
shelf_web_socket:
dependency: transitive
description:
@ -718,28 +781,42 @@ packages:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "5.4.5"
version: "5.7.10"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+4"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+5"
version: "0.0.1+9"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.6"
version: "1.0.9"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1+4"
version: "0.1.5+1"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+3"
vector_math:
dependency: transitive
description:
@ -761,6 +838,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.4"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
yaml:
dependency: transitive
description:
@ -769,5 +860,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
dart: ">=2.10.0 <2.11.0"
flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save