Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into app_translation

 Conflicts:
	lib/core/viewModel/PatientSearchViewModel.dart
	lib/screens/patients/PatientsInPatientScreen.dart
	lib/screens/patients/out_patient/out_patient_screen.dart
	lib/screens/patients/patient_search/patient_search_result_screen.dart
	lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart
	lib/screens/sick-leave/add-sickleave.dart
app_translation
hussam al-habibeh 5 years ago
commit 9457e04825

@ -88,7 +88,6 @@ class BaseAppClient {
onFailure(Helpers.generateContactAdminMsg(), statusCode); onFailure(Helpers.generateContactAdminMsg(), statusCode);
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],
parsed['AndroidLink'], parsed['IOSLink']); parsed['AndroidLink'], parsed['IOSLink']);
@ -99,7 +98,7 @@ class BaseAppClient {
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);
} else if (!isAllowAny) { } else if (!isAllowAny) {
await Helpers.logout(); await Helpers.logout();
Helpers.showErrorToast('Your session expired Please login agian'); Helpers.showErrorToast('Your session expired Please login again');
} }
if (isAllowAny) { if (isAllowAny) {
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);
@ -147,7 +146,7 @@ class BaseAppClient {
: SETUP_ID; : SETUP_ID;
} }
body['VersionID'] = 5.9; body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2; body['LanguageID'] = languageID == 'ar' ? 1 : 2;

@ -337,7 +337,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z'; const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9'; const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 5.9; const VERSION_ID = 6.0;
const CHANNEL = 9; const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt'; const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true; const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -47,9 +47,9 @@ const Map<String, Map<String, String>> localizedValues = {
'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'},
'service': {'en': 'Service', 'ar': 'خدمة'}, 'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'الإحالة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'},
'inPatient': {'en': 'My InPatients', 'ar': 'المريض الداخلي'}, 'inPatient': {'en': 'InPatients', 'ar': 'مرضاي'},
'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'},
'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى الداخليين'}, 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'},
'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'},
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'}, 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'},
@ -276,8 +276,8 @@ const Map<String, Map<String, String>> localizedValues = {
'age2': {'en': 'Age: ', 'ar': 'العمر: '}, 'age2': {'en': 'Age: ', 'ar': 'العمر: '},
'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'}, 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'},
"sick-leaves": {"en": "Patient Sick Leave", "ar": "الاجازات المرضية"}, "sick-leaves": {"en": "Patient Sick Leave", "ar": "الاجازات المرضية"},
"patient-sick": {"en": "Patient Sick", "ar": "المرضية"}, "patient-sick": {"en": "Patient Sick", "ar": "مرضية"},
"leave": {"en": "Leave", "ar": "غادر"}, "leave": {"en": "Leave", "ar": "مغادره"},
"submit": {"en": "Submit", "ar": "ارسال"}, "submit": {"en": "Submit", "ar": "ارسال"},
"doc-name": {"en": "Doctor Name", "ar": "اسم الطبيب"}, "doc-name": {"en": "Doctor Name", "ar": "اسم الطبيب"},
"clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"}, "clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"},
@ -654,8 +654,8 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
'progressNoteSOAP': {'en': "Progress Note", 'ar': "ملاحظة التقدم"}, 'progressNoteSOAP': {'en': "Progress Note", 'ar': "ملاحظة التقدم"},
'addProgressNote': {'en': "Add Progress Note", 'ar': "أضف ملاحظة التقدم"}, 'addProgressNote': {'en': "Add Progress Note", 'ar': "أضف ملاحظة التقدم"},
'createdBy': {'en': "Created By :", 'ar': "أضيفت : "}, 'createdBy': {'en': "Created By :", 'ar': "أضيفت من قبل : "},
'editedBy': {'en': "Edited By :", 'ar': "عدلت : "}, 'editedBy': {'en': "Edited By :", 'ar': "عدلت من قبل : "},
'currentMedications': {'en': "Current Medications", 'ar': "الأدوية الحالية"}, 'currentMedications': {'en': "Current Medications", 'ar': "الأدوية الحالية"},
'noItem': { 'noItem': {
'en': "No items exists in this list", 'en': "No items exists in this list",
@ -756,12 +756,12 @@ const Map<String, Map<String, String>> localizedValues = {
'ar': "الإجازة المرضية في حالة الانتظار لهذا المريض" 'ar': "الإجازة المرضية في حالة الانتظار لهذا المريض"
}, },
'no-clinic': {'en': "No Clinic", 'ar': "لا عيادة"}, 'no-clinic': {'en': "No Clinic", 'ar': "لا عيادة"},
'otherStatistic': {'en': "Other Statistics", 'ar': "دیگر شماریات"}, 'otherStatistic': {'en': "Other Statistics", 'ar': "إحصائيات أخرى"},
'ptientsreferral': {'en': "Patient's Referrals", 'ar': "مریض کا حوالہ"}, 'ptientsreferral': {'en': "Patient's Referrals", 'ar': "إحالات المريض"},
'arrivalpatient': {'en': "Arrival Patients", 'ar': "مریضوں کی آمد"}, 'arrivalpatient': {'en': "Arrival Patients", 'ar': "المرضى القادمون"},
'searchmedicinepatient': { 'searchmedicinepatient': {
'en': "Search patient or Medicines", 'en': "Search patient or Medicines",
'ar': "مریض یا دوائیں تلاش کریں" 'ar': "ابحث عن المريض أو الأدوية"
}, },
'appointmentDate': {'en': "Appointment Date", 'ar': "تاريخ الموعد"}, 'appointmentDate': {'en': "Appointment Date", 'ar': "تاريخ الموعد"},
'arrived_p': {'en': "Arrived", 'ar': "وصل"}, 'arrived_p': {'en': "Arrived", 'ar': "وصل"},
@ -783,7 +783,7 @@ const Map<String, Map<String, String>> localizedValues = {
"open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"},
'fileNumber': {'en': "File Number: ", 'ar': " :رقم الملف"}, 'fileNumber': {'en': "File Number: ", 'ar': "رقم الملف : "},
'searchPatient-name': { 'searchPatient-name': {
'en': 'Search Name, Medical File, Phone Number', 'en': 'Search Name, Medical File, Phone Number',
'ar': "اسم البحث ، الملف الطبي ، رقم الهاتف" 'ar': "اسم البحث ، الملف الطبي ، رقم الهاتف"
@ -819,7 +819,7 @@ const Map<String, Map<String, String>> localizedValues = {
"add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"},
"update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"},
"sick_leave": {"en": "Sick Leave", "ar": "أجازة مرضية"}, "sick_leave": {"en": "Sick Leave", "ar": "إجازة مرضية"},
"addSickLeaveRequest": { "addSickLeaveRequest": {
"en": "Add Sick Leave Request", "en": "Add Sick Leave Request",
"ar": "إضافة طلب إجازة مرضية" "ar": "إضافة طلب إجازة مرضية"
@ -847,7 +847,7 @@ const Map<String, Map<String, String>> localizedValues = {
"en": "Apply Reschedule Leave", "en": "Apply Reschedule Leave",
"ar": "التقدم بطلب أو إعادة جدولة الإجازة" "ar": "التقدم بطلب أو إعادة جدولة الإجازة"
}, },
"myQRCode": {"en": "My QR Code", "ar": "My QR Code"}, "myQRCode": {"en": "My QR Code", "ar": " كود QR "},
"patientIDMobilenational": { "patientIDMobilenational": {
"en": "Patient ID, National ID, Mobile Number", "en": "Patient ID, National ID, Mobile Number",
"ar": "هوية المريض ، الهوية الوطنية ، رقم الهاتف المحمول" "ar": "هوية المريض ، الهوية الوطنية ، رقم الهاتف المحمول"
@ -859,7 +859,7 @@ const Map<String, Map<String, String>> localizedValues = {
"numOfDays": {"en": "Number of Days", "ar": "عدد الأيام"}, "numOfDays": {"en": "Number of Days", "ar": "عدد الأيام"},
"replayBefore": {"en": "Replay Before", "ar": "رد قبل"}, "replayBefore": {"en": "Replay Before", "ar": "رد قبل"},
"try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'}, "try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'},
"refClinic": {"en": "Ref Clinic", "ar": "Ref Clinic"}, "refClinic": {"en": "Ref Clinic", "ar": "العيادة المرجعية"},
"acknowledged": {"en": "Acknowledged", "ar": "إقرار"}, "acknowledged": {"en": "Acknowledged", "ar": "إقرار"},
"didntCatch": { "didntCatch": {
"en": "Didn't catch that. Try Speaking again", "en": "Didn't catch that. Try Speaking again",
@ -928,8 +928,8 @@ const Map<String, Map<String, String>> localizedValues = {
"newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب الأشعة الجديد"}, "newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب الأشعة الجديد"},
"orderDate": {"en": "Order Date", "ar": "تاريخ الطلب"}, "orderDate": {"en": "Order Date", "ar": "تاريخ الطلب"},
"examType": {"en": "Exam Type", "ar": "نوع الفحص"}, "examType": {"en": "Exam Type", "ar": "نوع الفحص"},
"health": {"en": "Health", "ar": "التقرير"}, "health": {"en": "Health", "ar": "الصحي"},
"summary": {"en": "Summary", "ar": "الصحي"}, "summary": {"en": "Summary", "ar": "التقرير"},
"applyForNewPrescriptionsOrder": { "applyForNewPrescriptionsOrder": {
"en": "Apply for New Prescriptions Order", "en": "Apply for New Prescriptions Order",
"ar": "التقدم بطلب للحصول على وصفات طبية جديدة " "ar": "التقدم بطلب للحصول على وصفات طبية جديدة "
@ -946,4 +946,29 @@ const Map<String, Map<String, String>> localizedValues = {
"approvals22": {"en": "Approvals", "ar": "التامين"}, "approvals22": {"en": "Approvals", "ar": "التامين"},
"severe": {"en": "Severe", "ar": "الشدة"}, "severe": {"en": "Severe", "ar": "الشدة"},
"graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"},
"addNewOrderSheet": {
"en": "Add a New Order Sheet",
"ar": "أضف ورقة طلب جديدة"
},
"addNewProgressNote": {
"en": "Add a New Progress Note",
"ar": "أضف ملاحظة تقدم جديدة"
},
"notePending": {"en": "Pending", "ar": "قيد الانتظار"},
"noteCanceled": {"en": "Canceled", "ar": "ألغيت"},
"noteVerified": {"en": "Verified", "ar": "تم التحقق"},
'noteVerify': {'en': 'Verify', 'ar': 'تحقق'},
'noteConfirm': {'en': 'Confirm', 'ar': 'تاكيد'},
'noteAdd': {'en': 'Add ', 'ar': 'اضف '},
'noteUpdateْْ': {'en': 'Update ', 'ar': 'تحديت'},
'orderSheet': {'en': 'Order Sheet', 'ar': 'ورقة الطلب'},
'order': {'en': 'Order', 'ar': 'الطلب'},
'sheet': {'en': 'Sheet', 'ar': 'ورقة'},
'medical': {'en': 'Medical', 'ar': 'الطبي'},
'report': {'en': 'Report', 'ar': 'التقرير'},
'discharge': {'en': 'Discharge', 'ar': 'discharge'},
"discharged": {"en": "Discharged", "ar": "المفرغين"},
"none": {"en": "None", "ar": "لا شيء"},
"notRepliedYet": {"en": "Not Replied yet", "ar": "لم يرد بعد"},
"clearText": {"en": "Clear Text", "ar": "نص واضح"},
}; };

@ -44,7 +44,7 @@ class DischargedPatientService extends BaseService {
Future gtMyDischargeReferralPatient() async { Future gtMyDischargeReferralPatient() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
await getDoctorProfile(); await getDoctorProfile(isGetProfile: true);
body['DoctorID'] = doctorProfile.doctorID; body['DoctorID'] = doctorProfile.doctorID;
body['FirstName'] = "0"; body['FirstName'] = "0";
body['MiddleName'] = "0"; body['MiddleName'] = "0";

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
class PatientInPatientService extends BaseService { class PatientInPatientService extends BaseService {
List<PatiantInformtion> inPatientList = List(); List<PatiantInformtion> inPatientList = List();
List<PatiantInformtion> myInPatientList = List();
Future getInPatientList( Future getInPatientList(
PatientSearchRequestModel requestModel, bool isMyInpatient) async { PatientSearchRequestModel requestModel, bool isMyInpatient) async {
@ -21,9 +22,14 @@ class PatientInPatientService extends BaseService {
GET_PATIENT_IN_PATIENT_LIST, GET_PATIENT_IN_PATIENT_LIST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
inPatientList.clear(); inPatientList.clear();
myInPatientList.clear();
response['List_MyInPatient'].forEach((v) { response['List_MyInPatient'].forEach((v) {
inPatientList.add(PatiantInformtion.fromJson(v)); PatiantInformtion patient = PatiantInformtion.fromJson(v);
inPatientList.add(patient);
if(patient.doctorId == doctorProfile.doctorID){
myInPatientList.add(patient);
}
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart';
@ -70,11 +71,10 @@ class PatientSearchViewModel extends BaseViewModel {
} }
} }
getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async {
{bool isLocalBusy = false}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _outPatientService await _outPatientService.getPatientFileInformation(
.getPatientFileInformation(patientSearchRequestModel); patientSearchRequestModel);
if (_outPatientService.hasError) { if (_outPatientService.hasError) {
error = _outPatientService.error; error = _outPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -84,21 +84,21 @@ class PatientSearchViewModel extends BaseViewModel {
} }
} }
getPatientBasedOnDate(
{item,
PatientSearchRequestModel patientSearchRequestModel, getPatientBasedOnDate (
PatientType selectedPatientType, {item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType,
bool isSearchWithKeyInfo}) async { bool isSearchWithKeyInfo,OutPatientFilterType outPatientFilterType })async {
String dateTo; String dateTo;
String dateFrom; String dateFrom;
if (item == 'Previous') { if (OutPatientFilterType.Previous == outPatientFilterType) {
selectedFromDate = DateTime( selectedFromDate = DateTime(
DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); DateTime.now().year, DateTime.now().month - 1, DateTime.now().day);
selectedToDate = DateTime( selectedToDate = DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); DateTime.now().year, DateTime.now().month, DateTime.now().day - 1);
dateTo = DateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd'); dateTo = DateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd');
dateFrom = DateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd'); dateFrom = DateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd');
} else if (item == 'Next Week') { } else if (OutPatientFilterType.NextWeek == outPatientFilterType) {
dateTo = DateUtils.convertDateToFormat( dateTo = DateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month, DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 6), DateTime.now().day + 6),
@ -128,55 +128,75 @@ class PatientSearchViewModel extends BaseViewModel {
currentModel.to = dateTo; currentModel.to = dateTo;
await getOutPatient(currentModel, isLocalBusy: true); await getOutPatient(currentModel, isLocalBusy: true);
filterData = _outPatientService.patientList; filterData = _outPatientService.patientList;
} }
PatientInPatientService _inPatientService = PatientInPatientService _inPatientService =
locator<PatientInPatientService>(); locator<PatientInPatientService>();
List<PatiantInformtion> get _inPatientList => _inPatientService.inPatientList; List<PatiantInformtion> get inPatientList => _inPatientService.inPatientList;
List<PatiantInformtion> get myIinPatientList =>
_inPatientService.myInPatientList;
List<PatiantInformtion> filteredInPatientItems = List(); List<PatiantInformtion> filteredInPatientItems = List();
Future getInPatientList(PatientSearchRequestModel requestModel, Future getInPatientList(PatientSearchRequestModel requestModel,
{bool isMyInpatient = false, bool isFirstTime = true}) async { {bool isMyInpatient = false}) async {
await getDoctorProfile(); await getDoctorProfile();
if (isFirstTime)
setState(ViewState.Busy); setState(ViewState.Busy);
else
setState(ViewState.BusyLocal); if (inPatientList.length == 0)
await _inPatientService.getInPatientList(requestModel, false); await _inPatientService.getInPatientList(requestModel, false);
if (_inPatientService.hasError) { if (_inPatientService.hasError) {
error = _inPatientService.error; error = _inPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
filteredInPatientItems.clear(); // setDefaultInPatientList();
if (_inPatientList.length > 0)
filteredInPatientItems.addAll(_inPatientList);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future setDefaultInPatientList() async {
setState(ViewState.BusyLocal);
await getDoctorProfile();
filteredInPatientItems.clear();
if (inPatientList.length > 0)
filteredInPatientItems.addAll(inPatientList);
setState(ViewState.Idle);
}
void clearPatientList(){
_inPatientService.inPatientList = [];
_inPatientService.myInPatientList = [];
}
void filterSearchResults(String query) { void filterSearchResults(String query) {
var strExist = query.length > 0 ? true : false; var strExist = query.length > 0 ? true : false;
if (strExist) { if (strExist) {
filteredInPatientItems = []; filteredInPatientItems = [];
for (var i = 0; i < _inPatientList.length; i++) { for (var i = 0; i < inPatientList.length; i++) {
String firstName = _inPatientList[i].firstName.toUpperCase(); String firstName = inPatientList[i].firstName.toUpperCase();
String lastName = _inPatientList[i].lastName.toUpperCase(); String lastName = inPatientList[i].lastName.toUpperCase();
String mobile = _inPatientList[i].mobileNumber.toUpperCase(); String mobile = inPatientList[i].mobileNumber.toUpperCase();
String patientID = _inPatientList[i].patientId.toString(); String patientID = inPatientList[i].patientId.toString();
if (firstName.contains(query.toUpperCase()) || if (firstName.contains(query.toUpperCase()) ||
lastName.contains(query.toUpperCase()) || lastName.contains(query.toUpperCase()) ||
mobile.contains(query) || mobile.contains(query) ||
patientID.contains(query)) { patientID.contains(query)) {
filteredInPatientItems.add(_inPatientList[i]); filteredInPatientItems.add(inPatientList[i]);
} }
} }
notifyListeners(); notifyListeners();
} else { } else {
if (_inPatientList.length > 0) filteredInPatientItems.clear(); if (inPatientList.length > 0) filteredInPatientItems.clear();
filteredInPatientItems.addAll(_inPatientList); filteredInPatientItems.addAll(inPatientList);
notifyListeners(); notifyListeners();
} }
} }
} }

@ -90,7 +90,7 @@ class _LandingPageState extends State<LandingPage> {
case 2: case 2:
return TranslationBase.of(context).qr; return TranslationBase.of(context).qr;
case 3: case 3:
return TranslationBase.of(context).replay; return TranslationBase.of(context).replay2;
} }
} }
} }

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/root_page.dart'; import 'package:doctor_app_flutter/root_page.dart';
import 'package:doctor_app_flutter/screens/medical-file/medical_file_page.dart'; import 'package:doctor_app_flutter/screens/medical-file/health_summary_page.dart';
import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/ECGPage.dart';
import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-detail-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-detail-screen.dart';
@ -17,7 +17,6 @@ import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart';
import './screens/auth/login_screen.dart'; import './screens/auth/login_screen.dart';
import './screens/auth/verification_methods_screen.dart'; import './screens/auth/verification_methods_screen.dart';
import './screens/patients/patients_screen.dart';
import 'screens/patients/profile/profile_screen/patient_profile_screen.dart'; import 'screens/patients/profile/profile_screen/patient_profile_screen.dart';
import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart';
import 'landing_page.dart'; import 'landing_page.dart';
@ -37,7 +36,7 @@ const String PATIENTS = 'patients/patients';
const String PATIENTS_PROFILE = 'patients/patients-profile'; const String PATIENTS_PROFILE = 'patients/patients-profile';
const String IN_PATIENTS_PROFILE = 'inpatients/patients-profile'; const String IN_PATIENTS_PROFILE = 'inpatients/patients-profile';
const String LAB_RESULT = 'patients/lab_result'; const String LAB_RESULT = 'patients/lab_result';
const String MEDICAL_FILE = 'patients/radiology'; const String HEALTH_SUMMARY = 'patients/health-summary';
const String PROGRESS_NOTE = 'patients/progress-note'; const String PROGRESS_NOTE = 'patients/progress-note';
const String ORDER_NOTE = 'patients/order-note'; const String ORDER_NOTE = 'patients/order-note';
@ -66,11 +65,10 @@ var routes = {
ROOT: (_) => RootPage(), ROOT: (_) => RootPage(),
HOME: (_) => LandingPage(), HOME: (_) => LandingPage(),
LOGIN: (_) => Loginsreen(), LOGIN: (_) => Loginsreen(),
PATIENTS: (_) => PatientsScreen(),
VERIFICATION_METHODS: (_) => VerificationMethodsScreen(), VERIFICATION_METHODS: (_) => VerificationMethodsScreen(),
PATIENTS_PROFILE: (_) => PatientProfileScreen(), PATIENTS_PROFILE: (_) => PatientProfileScreen(),
LAB_RESULT: (_) => LabsHomePage(), LAB_RESULT: (_) => LabsHomePage(),
MEDICAL_FILE: (_) => MedicalFilePage(), HEALTH_SUMMARY: (_) => HealthSummaryPage(),
PROGRESS_NOTE: (_) => ProgressNoteScreen(visitType: 5,), PROGRESS_NOTE: (_) => ProgressNoteScreen(visitType: 5,),
ORDER_NOTE: (_) => ProgressNoteScreen(visitType: 3,), ORDER_NOTE: (_) => ProgressNoteScreen(visitType: 3,),
REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(), REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(),

@ -8,8 +8,6 @@ class HomePageCard extends StatelessWidget {
@required this.child, @required this.child,
this.onTap, this.onTap,
Key key, Key key,
this.width,
this.height,
this.color, this.color,
this.opacity = 0.4, this.opacity = 0.4,
this.margin}) this.margin})
@ -18,8 +16,6 @@ class HomePageCard extends StatelessWidget {
final String imageName; final String imageName;
final Widget child; final Widget child;
final Function onTap; final Function onTap;
final double width;
final double height;
final Color color; final Color color;
final double opacity; final double opacity;
final EdgeInsets margin; final EdgeInsets margin;
@ -28,12 +24,10 @@ class HomePageCard extends StatelessWidget {
return InkWell( return InkWell(
onTap: onTap, onTap: onTap,
child: Container( child: Container(
width: width != null ? width : MediaQuery.of(context).size.width * 0.28, width: 120,
height: height != null height: MediaQuery.of(context).orientation == Orientation.portrait
? height ? 130
: MediaQuery.of(context).orientation == Orientation.portrait : 250,
? MediaQuery.of(context).size.height * 0.18
: MediaQuery.of(context).size.height * 0.36,
margin: this.margin, margin: this.margin,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !hasBorder color: !hasBorder

@ -19,9 +19,8 @@ import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart';
import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart';
import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart';
import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_result_screen.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
@ -504,8 +503,7 @@ class _HomeScreenState extends State<HomeScreen> {
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: AppText( child: AppText(
TranslationBase.of(context) "My\n"+TranslationBase.of(context).inPatient,
.inPatient,
color: Colors.white, color: Colors.white,
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontSize: 15, fontSize: 15,
@ -520,15 +518,6 @@ class _HomeScreenState extends State<HomeScreen> {
page: PatientInPatientScreen(), page: PatientInPatientScreen(),
), ),
); );
// getRequestHeader(true);
// Navigator.of(context)
// .pushNamed(PATIENTS, arguments: {
// "patientSearchForm":
// _patientSearchFormValues,
// "selectedType": "1",
// "arrivalType": "1",
// "isInpatient": true
// });
}, },
), ),
HomePageCard( HomePageCard(
@ -655,84 +644,6 @@ class _HomeScreenState extends State<HomeScreen> {
); );
}, },
), ),
// HomePageCard(
// color: Colors.red[800],
// margin: EdgeInsets.all(5),
// child: Column(
// mainAxisAlignment:
// MainAxisAlignment.center,
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: <Widget>[
// Padding(
// padding: EdgeInsets.only(
// top: 10, left: 10, right: 0),
// child: Icon(
// DoctorApp.discharge_patients,
// size: 35,
// color: Colors.white,
// )),
// Container(
// padding: EdgeInsets.all(10),
// child: AppText(
// 'Discharged Patients',
// color: Colors.white,
// textAlign: TextAlign.start,
// fontSize: 15,
// ))
// ],
// ),
// hasBorder: false,
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// DischargedPatient(),
// // MyReferredPatient(),
// ),
// );
// },
// ),
// HomePageCard(
// color: Colors.grey[300],
// margin: EdgeInsets.all(5),
// child: Column(
// mainAxisAlignment:
// MainAxisAlignment.center,
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: <Widget>[
// Padding(
// padding: EdgeInsets.only(
// top: 10, left: 10, right: 0),
// child: Icon(
// DoctorApp.referral_discharge,
// size: 35,
// color: Colors.black,
// )),
// Container(
// padding: EdgeInsets.all(10),
// child: AppText(
// 'Referral Discharged',
// color: Colors.black,
// textAlign: TextAlign.start,
// fontSize: 15,
// ))
// ],
// ),
// hasBorder: false,
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// ReferralDischargedPatientPage(),
// // MyReferredPatient(),
// ),
// );
// },
// ),
HomePageCard( HomePageCard(
color: Color(0xffD02127), color: Color(0xffD02127),
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
@ -782,7 +693,7 @@ class _HomeScreenState extends State<HomeScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
PatientSearchScreenNew(), PatientSearchScreen(),
)); ));
}, },
), ),

@ -11,12 +11,12 @@ import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class MedicalFilePage extends StatefulWidget { class HealthSummaryPage extends StatefulWidget {
@override @override
_MedicalFilePageState createState() => _MedicalFilePageState(); _HealthSummaryPageState createState() => _HealthSummaryPageState();
} }
class _MedicalFilePageState extends State<MedicalFilePage> { class _HealthSummaryPageState extends State<HealthSummaryPage> {
PatiantInformtion patient; PatiantInformtion patient;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -1,112 +0,0 @@
import 'dart:ui';
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search_screen.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class SearchMedicinePatientScreen extends StatefulWidget {
@override
_SearchMedicinePatientScreen createState() => _SearchMedicinePatientScreen();
}
class _SearchMedicinePatientScreen extends State<SearchMedicinePatientScreen>
with SingleTickerProviderStateMixin {
TabController _tabController;
var activeIndex = 0;
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
}
@override
void dispose() {
super.dispose();
_tabController.dispose();
}
@override
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).searchmedicinepatient,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(65.0),
child: Center(
child: Container(
height: 60.0,
margin: EdgeInsets.only(top: 10.0),
width: MediaQuery.of(context).size.width * 0.92, // 0.9,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor,
width: 0.9), //width: 0.7
),
color: Colors.white),
child: TabBar(
isScrollable: true,
onTap: (index) {
setState(() {
activeIndex = index;
});
},
controller: _tabController,
indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor,
labelPadding:
EdgeInsets.only(top: 4.0, left: 30.0, right: 30.0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: Center(
child: AppText(
TranslationBase.of(context).searchPatient,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 14,
),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: Center(
child: AppText(
TranslationBase.of(context).searchMedicine,
fontWeight: FontWeight.bold,
fontSize: 14,
color: Colors.black),
),
),
],
),
),
),
),
body: Column(
children: <Widget>[
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
PatientSearchScreen(),
MedicineSearchScreen()
],
),
)
],
),
));
}
}

@ -26,15 +26,18 @@ class _DischargedPatientState extends State<DischargedPatient> {
return BaseView<DischargedPatientViewModel>( return BaseView<DischargedPatientViewModel>(
onModelReady: (model) => model.getDischargedPatient(), onModelReady: (model) => model.getDischargedPatient(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
appBarTitle: 'Discharged Patient', //appBarTitle: 'Discharged Patient',
subtitle: "Last Three Months", //subtitle: "Last Three Months",
backgroundColor: Colors.grey[200], backgroundColor: Colors.grey[200],
isShowAppBar: true, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: model.myDischargedPatient.isEmpty?Center( body: model.myDischargedPatient.isEmpty? Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
),
SizedBox( SizedBox(
height: 100, height: 100,
), ),
@ -53,6 +56,9 @@ class _DischargedPatientState extends State<DischargedPatient> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
),
SizedBox(height: 12,), SizedBox(height: 12,),
Container( Container(
width: double.maxFinite, width: double.maxFinite,
@ -97,10 +103,10 @@ class _DischargedPatientState extends State<DischargedPatient> {
}), }),
])), ])),
SizedBox(height: 5,), SizedBox(height: 5,),
Expanded( Expanded(child: SingleChildScrollView(
child: ListView.builder( child: Column(
itemCount: model.filterData.length, children: [
itemBuilder: (context,index)=>InkWell( ...List.generate(model.filterData.length, (index) => InkWell(
onTap: () { onTap: () {
Navigator.of(context) Navigator.of(context)
.pushNamed( .pushNamed(
@ -324,8 +330,9 @@ class _DischargedPatientState extends State<DischargedPatient> {
), ),
), ),
)), )),
), ],
),
))
], ],
), ),
), ),

@ -0,0 +1,164 @@
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.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/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import '../../routes.dart';
class InPatientPage extends StatefulWidget {
final bool isMyInPatient;
InPatientPage(this.isMyInPatient);
@override
_InPatientPageState createState() => _InPatientPageState();
}
class _InPatientPageState extends State<InPatientPage> {
TextEditingController _searchController = TextEditingController();
@override
void dispose() {
_searchController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {
await model.setDefaultInPatientList();
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
),
Container(
margin: EdgeInsets.all(16.0),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).searchPatientName,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
),
onPressed: () {},
),
controller: _searchController,
onChanged: (value) {
model.filterSearchResults(value);
}),
),
model.filteredInPatientItems.length > 0
? Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...List.generate(
model.filteredInPatientItems.length, (index) {
if (!widget.isMyInPatient)
return PatientCard(
patientInfo:
model.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model
.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model
.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else if (model.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID &&
widget.isMyInPatient)
return PatientCard(
patientInfo:
model.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model
.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model
.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else
return SizedBox();
}),
SizedBox(
height: 15,
)
],
),
),
),
)
: Expanded(
child: SingleChildScrollView(
child: Container(
child: ErrorMessage(
error:
TranslationBase.of(context).noDataAvailable)),
),
),
],
),
),
);
}
}

@ -1,44 +1,55 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../routes.dart'; import 'DischargedPatientPage.dart';
import 'InPatientPage.dart';
class PatientInPatientScreen extends StatefulWidget { class PatientInPatientScreen extends StatefulWidget {
@override @override
_PatientInPatientScreenState createState() => _PatientInPatientScreenState(); _PatientInPatientScreenState createState() => _PatientInPatientScreenState();
} }
class _PatientInPatientScreenState extends State<PatientInPatientScreen> { class _PatientInPatientScreenState extends State<PatientInPatientScreen> with SingleTickerProviderStateMixin{
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
TabController _tabController;
int _activeTab = 0; int _activeTab = 0;
TextEditingController _searchController = TextEditingController(); @override
void initState() {
super.initState();
_tabController = TabController(length: 3, vsync: this);
_tabController.addListener(_handleTabSelection);
}
@override @override
void dispose() { void dispose() {
_searchController.dispose();
super.dispose(); super.dispose();
_tabController.dispose();
}
_handleTabSelection() {
setState(() {
_activeTab = _tabController.index;
});
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) => model.getInPatientList(requestModel), onModelReady: (model) async {
model.clearPatientList();
model.getInPatientList(requestModel);
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
@ -65,193 +76,112 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
fontSize: SizeConfig.textMultiplier * 2.8, fontSize: SizeConfig.textMultiplier * 2.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
fontFamily: 'Poppins',
), ),
), ),
]), ]),
), ),
), ),
tabsBar(context, screenSize, model), Expanded(
Container( child: Scaffold(
margin: EdgeInsets.all(16.0), extendBodyBehindAppBar: true,
child: AppTextFieldCustom( appBar: PreferredSize(
hintText: TranslationBase.of(context).searchPatientName, preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070),
isTextFieldHasSuffix: true, child: Container(
suffixIcon: IconButton( height: MediaQuery.of(context).size.height * 0.070,
icon: Icon( decoration: BoxDecoration(
Icons.search, border: Border(
color: Colors.black, bottom: BorderSide(
), color: Theme.of(context).dividerColor,
onPressed: () {}, width: 0.5), //width: 0.7
),
controller: _searchController,
onChanged: (value) {
model.filterSearchResults(value);
}),
),
model.filteredInPatientItems.length > 0
? Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// const SizedBox(
// height: 16,
// ),
...List.generate(
model.filteredInPatientItems.length, (index) {
if (_activeTab == 0)
return PatientCard(
patientInfo:
model.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model
.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model
.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else if (model.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID &&
_activeTab == 1)
return PatientCard(
patientInfo:
model.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model
.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model
.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else
return SizedBox();
}),
SizedBox(
height: 15,
)
],
), ),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorColor: Colors.transparent,
indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0),
unselectedLabelColor: Colors.grey[800],
tabs: [
tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length),
tabWidget(screenSize, _activeTab == 1, "My InPatients", counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged),
],
), ),
), ),
)
: Expanded(
child: SingleChildScrollView(
child: Container(
child: ErrorMessage(
error:
TranslationBase.of(context).noDataAvailable)),
),
), ),
),
body: Column(
children: [
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: [
InPatientPage(false),
InPatientPage(true),
DischargedPatient(),
],
),
),
],
),
),
),
], ],
), ),
), ),
); );
} }
Widget tabsBar( Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}){
BuildContext context, Size screenSize, PatientSearchViewModel model) {
List<String> _tabs = [
TranslationBase.of(context).inPatientAll.toUpperCase(),
TranslationBase.of(context).inPatient.toUpperCase(),
];
return Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _tabs.map((item) {
bool _isActive = _tabs[_activeTab] == item ? true : false;
return Expanded( return Center(
child: InkWell( child: Container(
onTap: () async { height: screenSize.height * 0.070,
setState(() { decoration: TextFieldsUtils.containerBorderDecoration(
_activeTab = _tabs.indexOf(item); isActive
}); ? Color(0xFFD02127 /*B8382B*/)
FocusScopeNode currentFocus = FocusScope.of(context); : Color(0xFFEAEAEA),
if (!currentFocus.hasPrimaryFocus) { isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
currentFocus.unfocus(); borderRadius: 4,
} borderWidth: 0),
if (_activeTab == 0) { child: Row(
GifLoaderDialogUtils.showMyDialog(context); mainAxisAlignment: MainAxisAlignment.center,
await model.getInPatientList(requestModel, children: [
isMyInpatient: _activeTab == 1, isFirstTime: false); AppText(
GifLoaderDialogUtils.hideDialog(context); title,
} fontSize: SizeConfig.textMultiplier * 1.5,
}, color: isActive ? Colors.white : Color(0xFF2B353E),
child: Center( fontWeight: FontWeight.w700,
child: Container( ),
height: screenSize.height * 0.070, if (counter != -1)
decoration: TextFieldsUtils.containerBorderDecoration( Container(
_isActive margin: EdgeInsets.all(4),
? Color(0xFFD02127 /*B8382B*/) width: 15,
: Color(0xFFEAEAEA), height: 15,
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), decoration: BoxDecoration(
borderRadius: 4, color: isActive
borderWidth: 0), ? Colors.white
child: Center( : Color(0xFFD02127),
shape: BoxShape.circle,
),
child: Center(
child: FittedBox(
child: AppText( child: AppText(
item, "$counter",
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.5,
color: _isActive ? Colors.white : Color(0xFF2B353E), color: !isActive ? Colors.white : Color(0xFFD02127),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
), ),
), ),
), ],
); ),
}).toList(),
), ),
); );
} }

@ -506,7 +506,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"Dr ${referredPatient.referringDoctorName}", "${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: 1.5 * fontSize: 1.5 *

@ -25,7 +25,7 @@ class _ReferralDischargedPatientPageState extends State<ReferralDischargedPatien
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
appBarTitle: 'Referral Discharged ', appBarTitle: 'Referral Discharged ',
backgroundColor: Colors.grey[200], backgroundColor: Colors.grey[200],
isShowAppBar: true, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: model.myDischargeReferralPatient.isEmpty?Center( body: model.myDischargeReferralPatient.isEmpty?Center(
child: Column( child: Column(

@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -9,7 +11,7 @@ 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/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -40,19 +42,18 @@ class OutPatientsScreen extends StatefulWidget {
final bool isSearchAndOut; final bool isSearchAndOut;
final String searchKey; final String searchKey;
OutPatientsScreen( OutPatientsScreen(
{this.patientSearchForm, {this.patientSearchForm,
this.selectedType, this.selectedType,
this.isAppbar = true, this.isAppbar = true,
this.arrivalType, this.arrivalType,
this.isView, this.isView,
this.selectedPatientType, this.selectedPatientType,
this.patientSearchRequestModel, this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true, this.isSearchWithKeyInfo = true,
this.isSearch = false, this.isSearch = false,
this.isInpatient = false, this.isInpatient = false, this.searchKey, this.isSearchAndOut=false});
this.searchKey,
this.isSearchAndOut = false});
@override @override
_OutPatientsScreenState createState() => _OutPatientsScreenState(); _OutPatientsScreenState createState() => _OutPatientsScreenState();
@ -81,11 +82,20 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProvider = Provider.of(context); authProvider = Provider.of(context);
_times = [ _times = [
TranslationBase.of(context).previous, TranslationBase
TranslationBase.of(context).today, .of(context)
TranslationBase.of(context).nextWeek, .previous,
TranslationBase
.of(context)
.today,
TranslationBase
.of(context)
.nextWeek,
]; ];
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery
.of(context)
.size;
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
@ -94,126 +104,150 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
appBarTitle: "Search Patient", appBarTitle: "Search Patient",
isShowAppBar: true, isShowAppBar: true,
appBar: HeaderInSearch( appBar: PatientSearchHeader(
title: "My Out patient", title: "My Out patient",
), ),
baseViewModel: model, baseViewModel: model,
body: Column( body: Column(
children: [ children: [
Container( Container(
// color: Colors.red, // color: Colors.red,
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration( decoration: TextFieldsUtils
Color(0Xffffffff), Color(0xFFCCCCCC), .containerBorderDecoration(
borderRadius: 4, borderWidth: 0), Color(0Xffffffff),
child: Row( Color(0xFFCCCCCC),
mainAxisSize: MainAxisSize.max, borderRadius: 4,
crossAxisAlignment: CrossAxisAlignment.center, borderWidth: 0),
children: _times.map((item) { child: Row(
bool _isActive = mainAxisSize: MainAxisSize.max,
_times[_activeLocation] == item ? true : false; crossAxisAlignment: CrossAxisAlignment.center,
children: _times.map((item) {
bool _isActive = _times[_activeLocation] == item
? true
: false;
return Expanded( return Expanded(
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
setState(() { setState(() {
_activeLocation = _times.indexOf(item); _activeLocation = _times.indexOf(item);
outPatientFilterType = _activeLocation == 0 outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==1?OutPatientFilterType.Today:OutPatientFilterType.NextWeek;
? OutPatientFilterType.Previous _controller.text="";
: _activeLocation == 0 });
? OutPatientFilterType.Today model.searchData("");
: OutPatientFilterType.NextWeek; FocusScope.of(context).requestFocus(new FocusNode());
_controller.text = ""; GifLoaderDialogUtils.showMyDialog(context);
}); await model.getPatientBasedOnDate(item: item,
model.searchData(""); selectedPatientType: widget.selectedPatientType,
FocusScope.of(context).requestFocus(new FocusNode()); patientSearchRequestModel: widget
GifLoaderDialogUtils.showMyDialog(context); .patientSearchRequestModel,
await model.getPatientBasedOnDate( isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType);
item: item, GifLoaderDialogUtils.hideDialog(context);
selectedPatientType: widget.selectedPatientType, },
patientSearchRequestModel: child: Center(
widget.patientSearchRequestModel, child: Container(
isSearchWithKeyInfo: widget.isSearchWithKeyInfo); height: screenSize.height * 0.070,
GifLoaderDialogUtils.hideDialog(context); decoration: TextFieldsUtils.containerBorderDecoration(
}, _isActive
child: Center( ? Color(0xFFD02127 /*B8382B*/)
child: Container( : Color(0xFFEAEAEA),
height: screenSize.height * 0.070, _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
decoration: borderRadius: 4,
TextFieldsUtils.containerBorderDecoration( borderWidth: 0),
_isActive child: Center(
? Color(0xFFD02127 /*B8382B*/) child: Row(
: Color(0xFFEAEAEA), mainAxisAlignment: MainAxisAlignment.center,
_isActive children: [
? Color(0xFFD02127) AppText(
: Color(0xFFEAEAEA), item,
borderRadius: 4, fontSize: SizeConfig.textMultiplier * 1.8,
borderWidth: 0), color: _isActive ? Colors.white : Color(0xFF2B353E),
child: Center( fontWeight: FontWeight.w700,
child: AppText( ),
item, _isActive&&_activeLocation!=0&&model.state == ViewState.Idle ?Container(
fontSize: SizeConfig.textMultiplier * 1.8, padding: EdgeInsets.all(2),
color: _isActive margin: EdgeInsets.symmetric(horizontal: 5),
? Colors.white decoration:
: Color(0xFF2B353E), new BoxDecoration(
fontWeight: FontWeight.w700, color: Colors.white,
borderRadius:
BorderRadius.circular(
50),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: new Text(
model.filterData.length.toString(),
style: new TextStyle(
color: Colors.red,
fontSize: 10
),
textAlign:
TextAlign.center,
),
):Container(),
],
),
), ),
), ),
), ),
), ),
), );
); }).toList(),
}).toList(), ),
), ),
),
SizedBox(height: 18.5), SizedBox(height: 18.5),
Container( Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
height: 75, height: 75,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"), color: HexColor("#CCCCCC"),
), ),
color: Colors.white), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(left: 10, top: 10), padding: EdgeInsets.only(
left: 10, top: 10),
child: AppText( child: AppText(
TranslationBase.of(context).searchPatientName, TranslationBase.of(
context)
.searchPatientName,
fontSize: 13, fontSize: 13,
)), )),
AppTextFormField( AppTextFormField(
// focusNode: focusProject, // focusNode: focusProject,
controller: _controller, controller: _controller,
borderColor: Colors.white, borderColor: Colors.white
,
prefix: IconButton( prefix: IconButton(
icon: Icon( icon: Icon(
_activeLocation != 0 _activeLocation !=0
? DoctorApp.filter_1 ? DoctorApp.filter_1
: FontAwesomeIcons.slidersH, : FontAwesomeIcons.slidersH,
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20,
padding: EdgeInsets.only(bottom: 30), padding:
onPressed: _activeLocation != 0 EdgeInsets.only(
? null bottom: 30),
: () { onPressed: _activeLocation !=0 ? null : () {
Navigator.push( Navigator.push(context, MaterialPageRoute(
context, builder: (BuildContext context) =>
MaterialPageRoute( FilterDatePage(outPatientFilterType: outPatientFilterType,patientSearchViewModel: model,)));
builder: (BuildContext context) => },
FilterDatePage(
outPatientFilterType:
outPatientFilterType,
patientSearchViewModel:
model,
)));
},
), ),
onChanged: (String str) { onChanged: (String str) {
model.searchData(str); model.searchData(str);
}), }),
@ -221,60 +255,58 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
SizedBox( SizedBox(
height: 10.0, height: 10.0,
), ),
Expanded( Expanded(
child: Container( child: Container(
child: model.filterData.isEmpty child: model.filterData.isEmpty
? Center( ? Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context) error: TranslationBase.of(context)
.youDontHaveAnyPatient, .youDontHaveAnyPatient,
), ),
) )
: ListView.builder( : ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.filterData.length, itemCount: model.filterData.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
if (_activeLocation != 0 || if(_activeLocation !=0 || (model.filterData[index].patientStatusType !=null && model.filterData[index].patientStatusType==43))
(model.filterData[index].patientStatusType != return
null && Padding(
model.filterData[index] padding: EdgeInsets.all(8.0),
.patientStatusType == child: PatientCard(
43)) patientInfo: model.filterData[index],
return Padding( patientType: patientType,
padding: EdgeInsets.all(8.0), arrivalType: arrivalType,
child: PatientCard( isFromSearch:widget.isSearchAndOut,
patientInfo: model.filterData[index], isInpatient: widget.isInpatient,
patientType: patientType, onTap: () {
arrivalType: arrivalType, // TODO change the parameter to daynamic
isFromSearch: widget.isSearchAndOut, Navigator.of(context).pushNamed(
isInpatient: widget.isInpatient, PATIENTS_PROFILE,
onTap: () { arguments: {
// TODO change the parameter to daynamic "patient": model.filterData[index],
Navigator.of(context).pushNamed( "patientType": "1",
PATIENTS_PROFILE, "from": widget
arguments: { .patientSearchRequestModel.from,
"patient": model.filterData[index], "to": widget
"patientType": "1", .patientSearchRequestModel.from,
"from": widget "isSearch": false,
.patientSearchRequestModel.from, "isInpatient": false,
"to": widget "arrivalType": "7",
.patientSearchRequestModel.from, "isSearchAndOut": false,
"isSearch": false, });
"isInpatient": false, },
"arrivalType": "7", // isFromSearch: widget.isSearch,
"isSearchAndOut": false, ),
}); );
}, else
// isFromSearch: widget.isSearch, return SizedBox();
), })),
);
else
return SizedBox();
})),
), ),
], ],
)), )
),
); );
} }
} }

@ -2,10 +2,10 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class HeaderInSearch extends StatelessWidget with PreferredSizeWidget { class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget {
final String title; final String title;
const HeaderInSearch({Key key, this.title}) : super(key: key); const PatientSearchHeader({Key key, this.title}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -0,0 +1,184 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.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/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
// ignore: must_be_immutable
class PatientsSearchResultScreen extends StatefulWidget {
final PatientType selectedPatientType;
final PatientSearchRequestModel patientSearchRequestModel;
final bool isSearchWithKeyInfo;
final bool isSearch;
final bool isInpatient;
final bool isSearchAndOut;
final String searchKey;
PatientsSearchResultScreen(
{
this.selectedPatientType,
this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true,
this.isSearch = false,
this.isInpatient = false,
this.searchKey,
this.isSearchAndOut = false});
@override
_PatientsSearchResultScreenState createState() =>
_PatientsSearchResultScreenState();
}
class _PatientsSearchResultScreenState
extends State<PatientsSearchResultScreen> {
int clinicId;
AuthViewModel authProvider;
String patientType;
String patientTypeTitle;
var selectedFilter = 1;
String arrivalType;
ProjectViewModel projectsProvider;
var isView;
final _controller = TextEditingController();
PatientModel patient;
@override
Widget build(BuildContext context) {
authProvider = Provider.of(context);
return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {
if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) {
await model.getOutPatient(widget.patientSearchRequestModel);
} else {
await model.getPatientFileInformation(widget.patientSearchRequestModel);
}
},
builder: (_, model, w) => AppScaffold(
appBarTitle: "Search Patient",
isShowAppBar: true,
appBar: PatientSearchHeader(
title: "Search for ${widget.searchKey}",
),
baseViewModel: model,
body: Column(
children: [
SizedBox(height: 18.5),
Container(
width: SizeConfig.screenWidth * 0.9,
height: 75,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
left: 10, top: 10),
child: AppText(
TranslationBase.of(
context)
.searchPatientName,
fontSize: 13,
)),
AppTextFormField(
// focusNode: focusProject,
controller: _controller,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(
DoctorApp.filter_1,
color: Colors.black,
),
iconSize: 20,
padding:
EdgeInsets.only(
bottom: 30),
),
onChanged: (String str) {
model.searchData(str);
}),
])),
SizedBox(
height: 10.0,
),
Expanded(
child: Container(
child: model.filterData.isEmpty
? Center(
child: ErrorMessage(
error: TranslationBase.of(context)
.youDontHaveAnyPatient,
),
)
: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.filterData.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: PatientCard(
patientInfo: model.filterData[index],
patientType: patientType,
arrivalType: arrivalType,
isFromSearch:widget.isSearchAndOut,
isInpatient: widget.isInpatient,
onTap: () {
// TODO change the parameter to daynamic
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model.filterData[index],
"patientType": "1",
"from": widget
.patientSearchRequestModel.from,
"to": widget
.patientSearchRequestModel.from,
"isSearch": widget.isSearch,
"isInpatient": widget.isInpatient,
"arrivalType": "7",
"isSearchAndOut": widget.isSearchAndOut,
});
},
// isFromSearch: widget.isSearch,
),
);
})),
),
],
)
),
);
}
}

@ -4,11 +4,10 @@ import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_result_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
@ -17,12 +16,12 @@ import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class PatientSearchScreenNew extends StatefulWidget { class PatientSearchScreen extends StatefulWidget {
@override @override
_PatientSearchScreenNewState createState() => _PatientSearchScreenNewState(); _PatientSearchScreenState createState() => _PatientSearchScreenState();
} }
class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> { class _PatientSearchScreenState extends State<PatientSearchScreen> {
bool showOther = false; bool showOther = false;
bool isFormSubmitted = false; bool isFormSubmitted = false;
TextEditingController patientFileInfoController = TextEditingController(); TextEditingController patientFileInfoController = TextEditingController();
@ -57,46 +56,6 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
SizedBox( SizedBox(
height: 16, height: 16,
), ),
// AppText(
// 'Patient Type',
// fontWeight: FontWeight.w600,
// ),
// Row(
// children: [
// Row(
// children: [
// Radio(
// activeColor: Color(0xFFB9382C),
// value: PatientType.inPatient,
// groupValue: selectedPatientType,
// onChanged: (value) {
// setState(() {
// selectedPatientType =
// PatientType.inPatient;
// });
// },
// ),
// Text('InPatient'),
// ],
// ),
// Row(
// children: [
// Radio(
// activeColor: Color(0xFFB9382C),
// value: PatientType.OutPatient,
// groupValue: selectedPatientType,
// onChanged: (value) {
// setState(() {
// selectedPatientType =
// PatientType.OutPatient;
// });
// },
// ),
// Text('OutPatient'),
// ],
// ),
// ],
// ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -133,78 +92,6 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
SizedBox( SizedBox(
height: 5, height: 5,
), ),
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// InkWell(
// child: this.showOther == false
// ? AppText(
// TranslationBase.of(context)
// .searchWithOther,
// color: Colors.red,
// fontWeight: FontWeight.bold,
// )
// : AppText(
// TranslationBase.of(context)
// .hideOtherCriteria,
// color: Colors.red,
// fontWeight: FontWeight.bold),
// onTap: () {
// setState(() {
// this.showOther = !this.showOther;
// });
// },
// )
// ],
// ),
// SizedBox(
// height: 30,
// ),
// if (showOther)
// Column(
// children: [
// AppTextFieldCustom(
// hintText:
// TranslationBase.of(context).firstName,
// controller: firstNameInfoController,
// maxLines: 1,
// minLines: 1,
// hasBorder: true,
// onChanged: (_) {},
// // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
// ),
// SizedBox(
// height: 10,
// ),
// AppTextFieldCustom(
// hintText:
// TranslationBase.of(context).middleName,
// controller: middleNameInfoController,
// maxLines: 1,
// minLines: 1,
// onChanged: (_) {},
// hasBorder: true,
// // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
// ),
// SizedBox(
// height: 10,
// ),
// AppTextFieldCustom(
// hintText:
// TranslationBase.of(context).lastName,
// controller: lastNameFileInfoController,
// maxLines: 1,
// minLines: 1,
// onChanged: (_) {},
// hasBorder: true,
// // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
// ),
// SizedBox(
// height: 10,
// ),
// ],
// ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.12, height: MediaQuery.of(context).size.height * 0.12,
), ),
@ -311,7 +198,7 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => PatientsScreenNew( builder: (BuildContext context) => PatientsSearchResultScreen(
selectedPatientType: selectedPatientType, selectedPatientType: selectedPatientType,
patientSearchRequestModel: patientSearchRequestModel, patientSearchRequestModel: patientSearchRequestModel,
isSearchWithKeyInfo: isSearchWithKeyInfo:

@ -1,255 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.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/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
// ignore: must_be_immutable
class PatientsScreenNew extends StatefulWidget {
final patientSearchForm;
final selectedType;
final isAppbar;
final arrivalType;
final isView;
final PatientType selectedPatientType;
final PatientSearchRequestModel patientSearchRequestModel;
final bool isSearchWithKeyInfo;
final bool isSearch;
final bool isInpatient;
final bool isSearchAndOut;
final String searchKey;
PatientsScreenNew(
{this.patientSearchForm,
this.selectedType,
this.isAppbar = true,
this.arrivalType,
this.isView,
this.selectedPatientType,
this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true,
this.isSearch = false,
this.isInpatient = false,
this.searchKey,
this.isSearchAndOut = false});
@override
_PatientsScreenNewState createState() => _PatientsScreenNewState();
}
class _PatientsScreenNewState extends State<PatientsScreenNew> {
int clinicId;
AuthViewModel authProvider;
List<String> _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week'];
int _activeLocation = 0;
String patientType;
String patientTypeTitle;
var selectedFilter = 1;
String arrivalType;
ProjectViewModel projectsProvider;
var isView;
final _controller = TextEditingController();
PatientModel patient;
@override
Widget build(BuildContext context) {
authProvider = Provider.of(context);
_locations = [
TranslationBase.of(context).today,
TranslationBase.of(context).tomorrow,
TranslationBase.of(context).nextWeek,
];
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {
if (!widget.isSearchWithKeyInfo &&
widget.selectedPatientType == PatientType.OutPatient) {
await model.getOutPatient(widget.patientSearchRequestModel);
} else {
await model
.getPatientFileInformation(widget.patientSearchRequestModel);
}
},
builder: (_, model, w) => AppScaffold(
appBarTitle: "Search Patient",
isShowAppBar: true,
appBar: !widget.isSearch && !widget.isInpatient
? HeaderInSearch(
title: "My Out patient",
)
: HeaderInSearch(
title: "Search for ${widget.searchKey}",
),
baseViewModel: model,
body: Column(
children: [
if (!widget.isInpatient && !widget.isSearch)
Container(
// color: Colors.red,
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _locations.map((item) {
bool _isActive =
_locations[_activeLocation] == item ? true : false;
return Expanded(
child: InkWell(
onTap: () async {
setState(() {
_activeLocation = _locations.indexOf(item);
});
GifLoaderDialogUtils.showMyDialog(context);
await model.getPatientBasedOnDate(
item: item,
selectedPatientType: widget.selectedPatientType,
patientSearchRequestModel:
widget.patientSearchRequestModel,
isSearchWithKeyInfo:
widget.isSearchWithKeyInfo);
GifLoaderDialogUtils.hideDialog(context);
},
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration:
TextFieldsUtils.containerBorderDecoration(
_isActive
? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA),
_isActive
? Color(0xFFD02127)
: Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
item,
fontSize: SizeConfig.textMultiplier * 1.8,
color: _isActive
? Colors.white
: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
),
),
),
);
}).toList(),
),
),
SizedBox(height: 18.5),
Container(
width: SizeConfig.screenWidth * 0.9,
height: 75,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 10, top: 10),
child: AppText(
TranslationBase.of(context).searchPatientName,
fontSize: 13,
)),
AppTextFormField(
// focusNode: focusProject,
controller: _controller,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(
DoctorApp.filter_1,
color: Colors.black,
),
iconSize: 20,
padding: EdgeInsets.only(bottom: 30),
),
onChanged: (String str) {
model.searchData(str);
}),
])),
SizedBox(
height: 10.0,
),
Expanded(
child: Container(
child: model.filterData.isEmpty
? Center(
child: ErrorMessage(
error: TranslationBase.of(context)
.youDontHaveAnyPatient,
),
)
: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.filterData.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: PatientCard(
patientInfo: model.filterData[index],
patientType: patientType,
arrivalType: arrivalType,
isFromSearch: widget.isSearchAndOut,
isInpatient: widget.isInpatient,
onTap: () {
// TODO change the parameter to daynamic
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model.filterData[index],
"patientType": "1",
"from": widget
.patientSearchRequestModel.from,
"to": widget
.patientSearchRequestModel.from,
"isSearch": widget.isSearch,
"isInpatient": widget.isInpatient,
"arrivalType": "7",
"isSearchAndOut":
widget.isSearchAndOut,
});
},
// isFromSearch: widget.isSearch,
),
);
})),
),
],
)),
);
}
}

@ -1,641 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_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';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../config/config.dart';
import '../../config/size_config.dart';
import '../../lookups/patient_lookup.dart';
import '../../widgets/patients/dynamic_elements.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
import '../../widgets/shared/app_texts_widget.dart';
import '../../widgets/shared/buttons/app_buttons_widget.dart';
import '../../widgets/shared/rounded_container_widget.dart';
import '../../widgets/shared/text_fields/app_text_form_field.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = Helpers();
// OWNER : Ibrahim albitar
// DATE : 19-04-2020
// DESCRIPTION : Patient Search Screen.
class PatientSearchScreen extends StatefulWidget {
@override
_PatientSearchScreenState createState() => _PatientSearchScreenState();
}
class _PatientSearchScreenState extends State<PatientSearchScreen> {
String _selectedType = '1';
String _selectedLocation = '1';
String error = '';
ProjectViewModel projectsProvider;
String itemText = '';
String itemText2 = '';
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
bool _autoValidate = false;
bool onlyArrived = true;
bool isView = false;
bool isFormSubmitted = false;
FocusNode _nodeText1 = FocusNode();
FocusNode _nodeText2 = FocusNode();
FocusNode _nodeText3 = FocusNode();
var _patientSearchFormValues = PatientModel(
FirstName: "0",
MiddleName: "0",
LastName: "0",
PatientMobileNumber: "0",
PatientIdentificationID: "0",
MobileNo: '0',
PatientID: 0,
From: "0",
To: "0",
LanguageID: 2,
stamp: "2020-03-02T13:56:39.170Z",
IPAdress: "11.11.11.11",
VersionID: 5.8,
Channel: 9,
TokenID: "2Fi7HoIHB0eDyekVa6tCJg==",
SessionID: "5G0yXn0Jnq",
IsLoginForDoctorApp: true,
IdentificationNo: '0',
PatientOutSA: false);
void _validateInputs() async {
setState(() {
isFormSubmitted = true;
});
try {
if (_formKey.currentState.validate()) {
_formKey.currentState.save();
if ((_patientSearchFormValues.From == "0" ||
_patientSearchFormValues.To == "0") &&
_selectedType == "7" ||
((_patientSearchFormValues.From == "0" ||
_patientSearchFormValues.To == "0") &&
_selectedType == "6")) {
// Helpers.showErrorToast("Please Choose The Dates");
} else {
setState(() {
isFormSubmitted = false;
});
Navigator.of(context).pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues,
"selectedType": _selectedType,
"isSearch": true,
"isView": isView
});
}
} else {
setState(() {
_autoValidate = true;
});
}
} catch (err) {
error = err.toString();
}
}
handelCatchErrorCase(err) {
//isLoading = false;
//isError = true;
error = Helpers.generateContactAdminMsg(err);
//notifyListeners();
throw err;
}
@override
Widget build(BuildContext context) {
projectsProvider = Provider.of(context);
return GestureDetector(
onTap: () {
FocusScope.of(context).requestFocus(new FocusNode());
},
child: AppScaffold(
appBarTitle: TranslationBase.of(context).searchPatient,
isShowAppBar: true,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RoundedContainer(
showBorder: false,
child: Column(
children: <Widget>[
Column(
children: <Widget>[
// Container(
// child: Icon(
// DoctorApp.search_patient_1,
// size: 100,
// color: Colors.black,
// ),
// margin: EdgeInsets.only(top: 10),
// ),
// Padding(
// padding: const EdgeInsets.only(top: 12.0),
// child: AppText(
// TranslationBase.of(context)
// .searchPatientImageCaptionTitle
// .toUpperCase(),
// fontWeight: FontWeight.bold,
// fontSize: SizeConfig.heightMultiplier * 2.5,
// ),
// ),
// Padding(
// padding: const EdgeInsets.only(top: 5.0),
// child: AppText(
// TranslationBase.of(context)
// .searchPatientImageCaptionBody,
// fontSize: SizeConfig.heightMultiplier * 2,
// ),
// )
],
),
Container(
padding: EdgeInsets.all(15),
width: SizeConfig.screenWidth * 1,
child: Form(
key: _formKey,
autovalidate: _autoValidate,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 15,
),
if (_selectedType != '7')
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
labelText: TranslationBase.of(context)
.patpatientIDMobilenationalientID,
borderColor: Colors.white,
textInputType: TextInputType.number,
textInputAction: TextInputAction.done,
inputFormatter: ONLY_NUMBERS,
focusNode: _nodeText1,
onSaved: (value) {
if (value != null && value != '') {
if (value.length == 10 &&
(value[0] == '2' ||
value[0] == '1')) {
_patientSearchFormValues
.IdentificationNo = value;
_patientSearchFormValues.Searchtype = 2;
_patientSearchFormValues.setPatientID =
0;
} else if ((value.length == 10 ||
value.length == 9) &&
((value[0] == '0' &&
value[1] == '5') ||
value[0] == '5')) {
_patientSearchFormValues.MobileNo =
value;
_patientSearchFormValues.Searchtype = 0;
} else {
_patientSearchFormValues.setPatientID =
int.parse(value);
_patientSearchFormValues.Searchtype = 1;
}
}
// else{
// }
// value == null || value == ''
// ? _patientSearchFormValues.setPatientID =
// 0
// : _patientSearchFormValues.setPatientID =
// int.parse(value);
// if (value != null &&
// value.toString().trim().isEmpty) {
// _patientSearchFormValues.setPatientID = 0;
// }
},
),
),
SizedBox(
height: 10,
),
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// InkWell(
// child: this.isView == false
// ? AppText(
// TranslationBase.of(context)
// .searchWithOther,
// color: Colors.red,
// fontWeight: FontWeight.bold,
// )
// : AppText(
// TranslationBase.of(context)
// .hideOtherCriteria,
// color: Colors.red,
// fontWeight: FontWeight.bold),
// onTap: () {
// setState(() {
// this.isView = !this.isView;
// });
// },
// )
// ],
// ),
isView == true
? Column(children: [
SizedBox(
height: 10,
),
Container(
height: 65.0,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1.0,
style: BorderStyle.solid,
color: HexColor("#CCCCCC")),
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
),
),
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier *
0.9,
bottom: SizeConfig.widthMultiplier *
0.9,
right:
SizeConfig.widthMultiplier * 3,
left:
SizeConfig.widthMultiplier * 3),
child: Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
// 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_Des.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_Des.map(
(item) {
!projectsProvider.isArabic
? itemText = item['text']
: itemText =
item['text_ar'];
return DropdownMenuItem(
child: Text(
itemText,
textAlign: TextAlign.end,
),
value: item['val'],
);
}).toList(),
)),
),
],
),
),
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
labelText: TranslationBase.of(context)
.firstName,
borderColor: Colors.white,
onSaved: (value) {
value == null || value == ''
? _patientSearchFormValues
.setFirstName = "0"
: _patientSearchFormValues
.setFirstName = value;
if (value != null &&
value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues
.setFirstName = "0";
}
},
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_LETTERS),
),
SizedBox(
height: 10,
),
if (_selectedType != '7')
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
labelText: TranslationBase.of(context)
.phoneNumber,
borderColor: Colors.white,
textInputType: TextInputType.number,
textInputAction: TextInputAction.done,
inputFormatter: ONLY_NUMBERS,
focusNode: _nodeText1,
onSaved: (value) {
value == null || value == ''
? _patientSearchFormValues
.setPatientMobileNumber =
"0"
: _patientSearchFormValues
.setPatientMobileNumber =
value;
if (value != null &&
value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues
.setPatientMobileNumber = "0";
}
},
),
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
labelText: TranslationBase.of(context)
.middleName,
borderColor: Colors.white,
onSaved: (value) {
value == null || value == ''
? _patientSearchFormValues
.setMiddleName = "0"
: _patientSearchFormValues
.setMiddleName = value;
if (value != null &&
value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues
.setMiddleName = "0";
}
},
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_LETTERS),
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
labelText: TranslationBase.of(context)
.lastName,
borderColor: Colors.white,
onSaved: (value) {
value == null || value == ''
? _patientSearchFormValues
.setLastName = "0"
: _patientSearchFormValues
.setLastName = value;
if (value != null &&
value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues
.setLastName = "0";
}
},
inputFormatter: ONLY_LETTERS),
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
labelText: TranslationBase.of(context)
.patientID,
borderColor: Colors.white,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
focusNode: _nodeText2,
onSaved: (value) {
value == null || value == ''
? _patientSearchFormValues
.setPatientID = 0
: _patientSearchFormValues
.setPatientID =
int.parse(value);
if (value != null &&
value
.trim()
.toString()
.isEmpty) {
_patientSearchFormValues
.setPatientID = 0;
}
}),
),
SizedBox(
height: 10,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
labelText: TranslationBase.of(context)
.patientFile,
borderColor: Colors.white,
textInputType: TextInputType.number,
focusNode: _nodeText3,
inputFormatter: ONLY_NUMBERS,
onSaved: (value) {},
),
),
(!(_selectedType == '2' ||
_selectedType == '4'))
? DynamicElements(
_patientSearchFormValues,
isFormSubmitted)
: SizedBox(
height: 0,
),
SizedBox(
height: 10,
),
Container(
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: onlyArrived,
checkColor: HexColor("#2A930A"),
activeColor: Colors.white,
onChanged: (bool newValue) {
setState(() {
onlyArrived = newValue;
});
}),
),
SizedBox(
width: 12,
),
AppText(
TranslationBase.of(context)
.onlyArrivedPatient,
fontSize:
SizeConfig.textMultiplier *
2),
])),
SizedBox(
height: 10,
),
])
: SizedBox(
height: 0,
),
],
),
),
),
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context).search,
color: Colors.red[800],
onPressed: () {
_validateInputs();
},
),
],
),
),
],
),
]),
),
);
}
}

File diff suppressed because it is too large Load Diff

@ -325,7 +325,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).other, hintText: TranslationBase.of(context).other,
dropDownText: "None", dropDownText: TranslationBase.of(context).none,
enabled: false, enabled: false,
), ),
SizedBox( SizedBox(
@ -333,7 +333,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase.of(context).how, hintText: TranslationBase.of(context).how,
dropDownText: "None", dropDownText: TranslationBase.of(context).none,
enabled: false, enabled: false,
), ),
SizedBox( SizedBox(
@ -345,7 +345,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: hintText:
TranslationBase.of(context).when, TranslationBase.of(context).when,
dropDownText: "None", dropDownText: TranslationBase.of(context).none,
enabled: false, enabled: false,
), ),
), ),
@ -356,7 +356,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: hintText:
TranslationBase.of(context).where, TranslationBase.of(context).where,
dropDownText: "None", dropDownText: TranslationBase.of(context).none,
enabled: false, enabled: false,
), ),
), ),
@ -369,7 +369,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
height: screenSize.height * 0.1, height: screenSize.height * 0.1,
hintText: TranslationBase.of(context) hintText: TranslationBase.of(context)
.specifyPossibleLineManagement, .specifyPossibleLineManagement,
dropDownText: "None", dropDownText: TranslationBase.of(context).none,
enabled: false, enabled: false,
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,

@ -141,7 +141,7 @@ class _InPatientProfileScreenState extends State<InPatientProfileScreen>with Sin
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: MEDICAL_FILE, route: HEALTH_SUMMARY,
nameLine1: "Health", nameLine1: "Health",
//TranslationBase.of(context).medicalReport, //TranslationBase.of(context).medicalReport,
nameLine2: "Summary", nameLine2: "Summary",
@ -152,7 +152,7 @@ class _InPatientProfileScreenState extends State<InPatientProfileScreen>with Sin
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
isDisable: true, isDisable: true,
route: MEDICAL_FILE, route: HEALTH_SUMMARY,
nameLine1: "Medical", //Health nameLine1: "Medical", //Health
//TranslationBase.of(context).medicalReport, //TranslationBase.of(context).medicalReport,
nameLine2: "Report", //Report nameLine2: "Report", //Report

@ -0,0 +1,8 @@
import 'package:flutter/cupertino.dart';
class MedicalReportPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container();
}
}

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/model/note/note_model.dart';
import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/progress_note_request.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/screens/base/base_view.dart';
@ -42,9 +43,10 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
var _isInit = true; var _isInit = true;
bool isDischargedPatient = false; bool isDischargedPatient = false;
AuthViewModel authProvider; AuthViewModel authProvider;
ProjectViewModel projectViewModel;
getProgressNoteList(BuildContext context, PatientViewModel model,
getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { {bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
@ -59,7 +61,10 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
tokenID: token, tokenID: token,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
languageID: 2); languageID: 2);
model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) { model
.getPatientProgressNote(progressNoteRequest.toJson(),
isLocalBusy: isLocalBusy)
.then((c) {
notesList = model.patientProgressNoteList; notesList = model.patientProgressNoteList;
}); });
} }
@ -67,97 +72,124 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProvider = Provider.of(context); authProvider = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map; projectViewModel = Provider.of(context);
final routeArgs = ModalRoute
.of(context)
.settings
.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
if(routeArgs.containsKey('isDischargedPatient')) if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient']; isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => getProgressNoteList(context, model), onModelReady: (model) => getProgressNoteList(context, model),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) =>
baseViewModel: model, AppScaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor, baseViewModel: model,
// appBarTitle: TranslationBase.of(context).progressNote, backgroundColor: Theme
appBar: PatientProfileHeaderNewDesignAppBar( .of(context)
patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: true,), .scaffoldBackgroundColor,
body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 // appBarTitle: TranslationBase.of(context).progressNote,
? DrAppEmbeddedError( appBar: PatientProfileHeaderNewDesignAppBar(
error: TranslationBase.of(context).errorNoProgressNote) patient,
: Container( patient.patientType.toString() ?? '0',
color: Colors.grey[200], arrivalType,
isInpatient: true,
),
body: model.patientProgressNoteList == null ||
model.patientProgressNoteList.length == 0
? DrAppEmbeddedError(
error: TranslationBase
.of(context)
.errorNoProgressNote)
: Container(
color: Colors.grey[200],
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
if(!isDischargedPatient) if (!isDischargedPatient)
AddNewOrder( onTap: () { AddNewOrder(
Navigator.push( onTap: () {
context, Navigator.push(
MaterialPageRoute( context,
builder: (context) => UpdateNoteOrder( MaterialPageRoute(
patientModel: model, builder: (context) =>
patient: patient, UpdateNoteOrder(
visitType: widget.visitType, patientModel: model,
isUpdate: false, patient: patient,
)), visitType: widget.visitType,
); isUpdate: false,
},label: widget.visitType ==3?'Add a New Order Sheet':'Create a New Progress Note',), )),
Expanded( );
child: Container( },
label: widget.visitType == 3
child: ListView.builder( ? TranslationBase
itemCount: model.patientProgressNoteList.length, .of(context)
itemBuilder: (BuildContext ctxt, int index) { .addNewOrderSheet
return FractionallySizedBox( : TranslationBase
widthFactor: 0.95, .of(context)
child: CardWithBgWidget( .addProgressNote,
hasBorder: false, ),
bgColor: model.patientProgressNoteList[index] Expanded(
.status == child: Container(
1 && child: ListView.builder(
authProvider.doctorProfile.doctorID != itemCount: model.patientProgressNoteList.length,
model itemBuilder: (BuildContext ctxt, int index) {
.patientProgressNoteList[ return FractionallySizedBox(
index] widthFactor: 0.95,
.createdBy child: CardWithBgWidget(
? Color(0xFFCC9B14):model hasBorder: false,
.patientProgressNoteList[ bgColor: model.patientProgressNoteList[index]
index] .status ==
.status == 1 &&
4?Colors.red.shade700 authProvider.doctorProfile.doctorID !=
: model model
.patientProgressNoteList[ .patientProgressNoteList[
index] index]
.status == .createdBy
2?Colors.green[600]:Color(0xFFCC9B14), ? Color(0xFFCC9B14)
widget: Column( : model.patientProgressNoteList[index]
children: [ .status ==
Column( 4
crossAxisAlignment: ? Colors.red.shade700
CrossAxisAlignment.start, : model.patientProgressNoteList[index]
children: [ .status ==
if (model 2
.patientProgressNoteList[ ? Colors.green[600]
index] : Color(0xFFCC9B14),
.status == widget: Column(
1 && children: [
authProvider Column(
.doctorProfile.doctorID != crossAxisAlignment:
model CrossAxisAlignment.start,
.patientProgressNoteList[ children: [
index] if (model
.createdBy) .patientProgressNoteList[
AppText( index]
'Pending', .status ==
fontWeight: FontWeight.bold, 1 &&
color: Color(0xFFCC9B14), authProvider
fontSize: 12, .doctorProfile.doctorID !=
), model
.patientProgressNoteList[
index]
.createdBy)
AppText(
TranslationBase
.of(context)
.notePending,
fontWeight: FontWeight.bold,
color: Color(0xFFCC9B14),
fontSize: 12,
),
if (model if (model
.patientProgressNoteList[ .patientProgressNoteList[
index] index]
.status == .status ==
4) 4)
AppText( AppText(
'Canceled', TranslationBase
.of(context)
.noteCanceled,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.red.shade700, color: Colors.red.shade700,
fontSize: 12, fontSize: 12,
@ -168,7 +200,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
.status == .status ==
2) 2)
AppText( AppText(
'Verified', TranslationBase
.of(context)
.noteVerified,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.green[600], color: Colors.green[600],
fontSize: 12, fontSize: 12,
@ -229,7 +263,10 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
width: 2, width: 2,
), ),
AppText( AppText(
'Update', TranslationBase
.of(
context)
.update,
fontSize: 10, fontSize: 10,
color: Colors.white, color: Colors.white,
), ),
@ -309,7 +346,10 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
width: 2, width: 2,
), ),
AppText( AppText(
'Verify', TranslationBase
.of(
context)
.noteVerify,
fontSize: 10, fontSize: 10,
color: Colors.white, color: Colors.white,
), ),
@ -325,22 +365,26 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
onTap: () async { onTap: () async {
showMyDialog( showMyDialog(
context: context, context: context,
actionName: "cancel", actionName:
TranslationBase
.of(
context)
.cancel,
confirmFun: () async { confirmFun: () async {
GifLoaderDialogUtils GifLoaderDialogUtils
.showMyDialog( .showMyDialog(
context, context,
); );
UpdateNoteReqModel UpdateNoteReqModel
reqModel = reqModel =
UpdateNoteReqModel( UpdateNoteReqModel(
admissionNo: int admissionNo: int
.parse(patient .parse(patient
.admissionNo), .admissionNo),
cancelledNote: true, cancelledNote: true,
lineItemNo: model lineItemNo: model
.patientProgressNoteList[ .patientProgressNoteList[
index] index]
.lineItemNo, .lineItemNo,
createdBy: model createdBy: model
.patientProgressNoteList[ .patientProgressNoteList[
@ -398,7 +442,6 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
padding: EdgeInsets.all(6), padding: EdgeInsets.all(6),
), ),
), ),
SizedBox( SizedBox(
width: 10, width: 10,
) )
@ -428,7 +471,10 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
.start, .start,
children: [ children: [
AppText( AppText(
'Created By: ', TranslationBase
.of(
context)
.createdBy,
fontSize: 10, fontSize: 10,
), ),
Expanded( Expanded(
@ -452,26 +498,34 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
children: [ children: [
AppText( AppText(
model model
.patientProgressNoteList[
index]
.createdOn !=
null
? DateUtils
.getDayMonthYearDateFormatted(
DateUtils
.getDateTimeFromServerFormat(
model
.patientProgressNoteList[ .patientProgressNoteList[
index] index]
.createdOn != .createdOn),
null isArabic:
? DateUtils.getDayMonthYearDateFormatted( projectViewModel
DateUtils.getDateTimeFromServerFormat( .isArabic)
model
.patientProgressNoteList[
index]
.createdOn))
: DateUtils : DateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.now()), DateTime.now(),
isArabic:
projectViewModel
.isArabic),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
AppText( AppText(
model model
.patientProgressNoteList[ .patientProgressNoteList[
index] index]
.createdOn != .createdOn !=
null null
? DateUtils.getHour(DateUtils ? DateUtils.getHour(DateUtils
@ -508,21 +562,21 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
), ),
), ),
]) ])
], ],
), ),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
], ],
),
), ),
); ),
}), );
), }),
), ),
], ),
],
), ),
), ),
), ),
); );
} }
@ -541,38 +595,49 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
isShowAppBar: false, isShowAppBar: false,
body: Container( body: Container(
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
// SizedBox(height: 20,), // SizedBox(height: 20,),
SizedBox(height: 10,), SizedBox(
height: 10,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
AppText( AppText(
"Confirm", fontWeight: FontWeight.w600, TranslationBase
.of(context)
.noteConfirm,
fontWeight: FontWeight.w600,
color: Colors.black, color: Colors.black,
fontSize: 16,), fontSize: 16,
),
], ],
), ),
SizedBox(height: 10,), SizedBox(
height: 10,
),
DividerWithSpacesAround(), DividerWithSpacesAround(),
SizedBox(height: 12,), SizedBox(
height: 12,
),
Container( Container(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
color: Colors.white, color: Colors.white,
child: AppText( child: AppText(
'Are you sure you want $actionName this order?', projectViewModel.isArabic?"هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟":'Are you sure you want $actionName this order?',
fontSize: 15, fontSize: 15,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
SizedBox(height: 8,), SizedBox(
height: 8,
),
DividerWithSpacesAround(), DividerWithSpacesAround(),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.75, widthFactor: 0.75,
@ -581,22 +646,29 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
children: [ children: [
FlatButton( FlatButton(
child: AppText( child: AppText(
"Cancel", fontWeight: FontWeight.w600, TranslationBase
.of(context)
.cancel,
fontWeight: FontWeight.w600,
color: Colors.black, color: Colors.black,
fontSize: 16,),//Text("Cancel"), fontSize: 16,
), //Text("Cancel"),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}), }),
FlatButton( FlatButton(
child: AppText( child: AppText(
"Confirm", fontWeight: FontWeight.w600, TranslationBase
.of(context)
.noteConfirm,
fontWeight: FontWeight.w600,
color: Colors.red.shade700, color: Colors.red.shade700,
fontSize: 16,), //Text("Confirm", ), fontSize: 16,
), //Text("Confirm", ),
onPressed: () async { onPressed: () async {
await confirmFun(); await confirmFun();
Navigator.of(context).pop(); Navigator.of(context).pop();
}) })
], ],
), ),
) )
@ -608,8 +680,4 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
), ),
)); ));
} }
} }

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/model/note/note_model.dart';
import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -22,6 +23,7 @@ import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.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_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
@ -51,6 +53,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var reconizedWord;
var event = RobotProvider(); var event = RobotProvider();
ProjectViewModel projectViewModel;
TextEditingController progressNoteController = TextEditingController(); TextEditingController progressNoteController = TextEditingController();
setSelectedType(int val) { setSelectedType(int val) {
@ -74,6 +78,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
if (widget.note != null) { if (widget.note != null) {
progressNoteController.text = widget.note.notes; progressNoteController.text = widget.note.notes;
} }
@ -91,8 +97,14 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: [ children: [
BottomSheetTitle( BottomSheetTitle(
title: widget.visitType == 3 title: widget.visitType == 3
? (widget.isUpdate ? 'Update' : 'Add') + ' Order Sheet' ? (widget.isUpdate
: (widget.isUpdate ? 'Update' : 'Add') + ' Progress Note', ? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).orderSheet
: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).progressNote,
), ),
SizedBox( SizedBox(
height: 10.0, height: 10.0,
@ -106,10 +118,18 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
hintText: widget.visitType == 3 hintText: widget.visitType == 3
? (widget.isUpdate ? 'Update' : 'Add') + ? (widget.isUpdate
' Order Sheet' ? TranslationBase.of(context)
: (widget.isUpdate ? 'Update' : 'Add') + .noteUpdate
' Progress Note', : TranslationBase.of(context)
.noteAdd) +
TranslationBase.of(context).orderSheet
: (widget.isUpdate
? TranslationBase.of(context)
.noteUpdate
: TranslationBase.of(context)
.noteAdd) +
TranslationBase.of(context).progressNote,
//TranslationBase.of(context).addProgressNote, //TranslationBase.of(context).addProgressNote,
controller: progressNoteController, controller: progressNoteController,
maxLines: 35, maxLines: 35,
@ -124,19 +144,23 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
: null, : null,
), ),
Positioned( Positioned(
top: 0, //MediaQuery.of(context).size.height * 0, top:
right: 15, -2, //MediaQuery.of(context).size.height * 0,
child: IconButton( right: projectViewModel.isArabic
icon: Icon( ? MediaQuery.of(context).size.width * 0.75
DoctorApp.speechtotext, : 15,
color: Colors.black, child: Column(
), children: [
onPressed: () { IconButton(
initSpeechState() icon: Icon(DoctorApp.speechtotext,
.then((value) => {onVoiceText()}); color: Colors.black, size: 35),
}, onPressed: () {
), initSpeechState()
) .then((value) => {onVoiceText()});
},
),
],
))
], ],
), ),
], ],
@ -149,79 +173,100 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: progressNoteController.text.isNotEmpty? 130:70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap( child: Column(
alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( if(progressNoteController.text.isNotEmpty)
title: widget.visitType == 3 Container(
? (widget.isUpdate ? 'Update' : 'Add') + ' Order Sheet' margin: EdgeInsets.all(5),
: (widget.isUpdate ? 'Update' : 'Add') + ' Progress Note', child: AppButton(
color: Color(0xff359846), title: TranslationBase.of(context).clearText,
// disabled: progressNoteController.text.isEmpty, onPressed: () {
fontWeight: FontWeight.w700, setState(() {
onPressed: () async { progressNoteController.text = '';
setState(() { });
isSubmitted = true; },
}); ),
if (progressNoteController.text.trim().isNotEmpty) { ),
GifLoaderDialogUtils.showMyDialog(context); Container(
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); margin: EdgeInsets.all(5),
child: AppButton(
DoctorProfileModel doctorProfile = title: widget.visitType == 3
DoctorProfileModel.fromJson(profile); ? (widget.isUpdate
? TranslationBase.of(context).noteUpdate
if (widget.isUpdate) { : TranslationBase.of(context).noteAdd) +
UpdateNoteReqModel reqModel = UpdateNoteReqModel( TranslationBase.of(context).orderSheet
admissionNo: int.parse(widget.patient.admissionNo), : (widget.isUpdate
cancelledNote: false, ? TranslationBase.of(context).noteUpdate
lineItemNo: widget.note.lineItemNo, : TranslationBase.of(context).noteAdd) +
createdBy: widget.note.createdBy, TranslationBase.of(context).progressNote,
notes: progressNoteController.text, color: Color(0xff359846),
verifiedNote: false, // disabled: progressNoteController.text.isEmpty,
patientTypeID: widget.patient.patientType, fontWeight: FontWeight.w700,
patientOutSA: false, onPressed: () async {
); setState(() {
await widget.patientModel isSubmitted = true;
.updatePatientProgressNote(reqModel); });
} else { if (progressNoteController.text.trim().isNotEmpty) {
CreateNoteModel reqModel = CreateNoteModel( GifLoaderDialogUtils.showMyDialog(context);
admissionNo: int.parse(widget.patient.admissionNo), Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
createdBy: doctorProfile.doctorID,
visitType: widget.visitType,
patientID: widget.patient.patientId,
nursingRemarks: ' ',
patientTypeID: widget.patient.patientType,
patientOutSA: false,
notes: progressNoteController.text);
await widget.patientModel DoctorProfileModel doctorProfile =
.createPatientProgressNote(reqModel); DoctorProfileModel.fromJson(profile);
}
if (widget.patientModel.state == ViewState.ErrorLocal) { if (widget.isUpdate) {
Helpers.showErrorToast(widget.patientModel.error); UpdateNoteReqModel reqModel = UpdateNoteReqModel(
} else { admissionNo: int.parse(widget.patient.admissionNo),
ProgressNoteRequest progressNoteRequest = cancelledNote: false,
ProgressNoteRequest( lineItemNo: widget.note.lineItemNo,
visitType: widget.visitType, createdBy: widget.note.createdBy,
// if equal 5 then this will return progress note notes: progressNoteController.text,
verifiedNote: false,
patientTypeID: widget.patient.patientType,
patientOutSA: false,
);
await widget.patientModel
.updatePatientProgressNote(reqModel);
} else {
CreateNoteModel reqModel = CreateNoteModel(
admissionNo: admissionNo:
int.parse(widget.patient.admissionNo), int.parse(widget.patient.admissionNo),
projectID: widget.patient.projectId, createdBy: doctorProfile.doctorID,
visitType: widget.visitType,
patientID: widget.patient.patientId,
nursingRemarks: ' ',
patientTypeID: widget.patient.patientType, patientTypeID: widget.patient.patientType,
languageID: 2); patientOutSA: false,
await widget.patientModel notes: progressNoteController.text);
.getPatientProgressNote(progressNoteRequest.toJson());
} await widget.patientModel
GifLoaderDialogUtils.hideDialog(context); .createPatientProgressNote(reqModel);
DrAppToastMsg.showSuccesToast( }
"Your Order added Successfully");
Navigator.of(context).pop(); if (widget.patientModel.state == ViewState.ErrorLocal) {
} else { Helpers.showErrorToast(widget.patientModel.error);
Helpers.showErrorToast("You cant add only spaces"); } else {
} ProgressNoteRequest progressNoteRequest =
}), ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo:
int.parse(widget.patient.admissionNo),
projectID: widget.patient.projectId,
patientTypeID: widget.patient.patientType,
languageID: 2);
await widget.patientModel.getPatientProgressNote(
progressNoteRequest.toJson());
}
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(
"Your Order added Successfully");
Navigator.of(context).pop();
} else {
Helpers.showErrorToast("You cant add only spaces");
}
})),
], ],
), ),
), ),
@ -268,7 +313,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
speech.stop(); speech.stop();
progressNoteController.text = reconizedWord; progressNoteController.text += reconizedWord + '\n';
}); });
} else { } else {
print(result.finalResult); print(result.finalResult);

@ -0,0 +1,25 @@
class PatientProfileCardModel {
final String nameLine1;
final String nameLine2;
final dynamic route;
final String icon;
final bool isInPatient;
final bool isDisable;
final bool isLoading;
final Function onTap;
final bool isDischargedPatient;
final bool isSelectInpatient;
PatientProfileCardModel(
this.nameLine1,
this.nameLine2,
this.route,
this.icon, {
this.isInPatient = false,
this.isDisable = false,
this.isLoading = false,
this.onTap,
this.isDischargedPatient = false,
this.isSelectInpatient = false,
});
}

@ -1,7 +1,9 @@
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
@ -17,258 +19,135 @@ class ProfileGridForInPatient extends StatelessWidget {
String from; String from;
String to; String to;
ProfileGridForInPatient( ProfileGridForInPatient(
{Key key, {Key key,
this.patient, this.patient,
this.patientType, this.patientType,
this.arrivalType, this.arrivalType,
this.height, this.height,
this.isInpatient, this.from,this.to, this.isDischargedPatient, this.isFromSearch}) this.isInpatient,
this.from,
this.to,
this.isDischargedPatient,
this.isFromSearch})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(
TranslationBase.of(context).vital,
TranslationBase.of(context).signs,
VITAL_SIGN_DETAILS,
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).result,
LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).radiology,
TranslationBase.of(context).result,
RADIOLOGY_PATIENT,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW,
'patient/order_prescription.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).progress,
TranslationBase.of(context).note,
PROGRESS_NOTE,
'patient/Progress_notes.png',
isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient),
PatientProfileCardModel(
TranslationBase.of(context).order,
TranslationBase.of(context).sheet,
ORDER_NOTE,
'patient/Progress_notes.png',
isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).procedures,
ORDER_PROCEDURE,
'patient/Order_Procedures.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).health,
TranslationBase.of(context).summary,
HEALTH_SUMMARY,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).medical,
TranslationBase.of(context).report,
HEALTH_SUMMARY,
'patient/health_summary.png',
isInPatient: isInpatient,
isDisable: true),
PatientProfileCardModel(
TranslationBase.of(context).referral,
TranslationBase.of(context).patient,
REFER_IN_PATIENT_TO_DOCTOR,
'patient/refer_patient.png',
isInPatient: isInpatient,
isDisable: isDischargedPatient || isFromSearch,
),
PatientProfileCardModel(
TranslationBase.of(context).insurance,
TranslationBase.of(context).approvals,
PATIENT_INSURANCE_APPROVALS_NEW,
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).discharge,
TranslationBase.of(context).report,
null,
'patient/patient_sick_leave.png',
isInPatient: isInpatient,
isDisable: true),
PatientProfileCardModel(
TranslationBase.of(context).patientSick,
TranslationBase.of(context).leave,
ADD_SICKLEAVE,
'patient/patient_sick_leave.png',
isInPatient: isInpatient,
),
];
return Padding( return Padding(
padding: padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
const EdgeInsets.symmetric( child: StaggeredGridView.countBuilder(
vertical: 15.0,
horizontal: 15),
child: GridView.count(
shrinkWrap: true, shrinkWrap: true,
physics: physics: NeverScrollableScrollPhysics(),
NeverScrollableScrollPhysics(),
crossAxisSpacing: 10, crossAxisSpacing: 10,
mainAxisSpacing: 10, mainAxisSpacing: 10,
childAspectRatio: 1 / 1.0,
crossAxisCount: 3, crossAxisCount: 3,
children: [ itemCount: cardsList.length,
PatientProfileButton( staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
patient: patient, itemBuilder: (BuildContext context, int index) => PatientProfileButton(
patientType: patientType, patient: patient,
arrivalType: arrivalType, patientType: patientType,
from: from, arrivalType: arrivalType,
to: to, from: from,
nameLine1: to: to,
TranslationBase nameLine1: cardsList[index].nameLine1,
.of( nameLine2: cardsList[index].nameLine2,
context) route: cardsList[index].route,
.vital, icon: cardsList[index].icon,
nameLine2: isInPatient: cardsList[index].isInPatient,
TranslationBase isDischargedPatient: cardsList[index].isDischargedPatient,
.of( isDisable: cardsList[index].isDisable,
context) onTap: cardsList[index].onTap,
.signs, isLoading: cardsList[index].isLoading,
route: VITAL_SIGN_DETAILS, ),
isInPatient: true,
icon:
'patient/vital_signs.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: LAB_RESULT,
isInPatient: true,
nameLine1:
TranslationBase
.of(
context)
.lab,
nameLine2:
TranslationBase
.of(
context)
.result,
icon:
'patient/lab_results.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInPatient: isInpatient,
route: RADIOLOGY_PATIENT,
nameLine1:
TranslationBase
.of(
context)
.radiology,
nameLine2:
TranslationBase
.of(
context)
.result,
icon:
'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
isInPatient: isInpatient,
patientType: patientType,
arrivalType: arrivalType,
route:
ORDER_PRESCRIPTION_NEW,
isSelectInpatient: true,
nameLine1:
TranslationBase
.of(
context)
.patient,
nameLine2:
TranslationBase
.of(
context)
.prescription,
icon:
'patient/order_prescription.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PROGRESS_NOTE,
isInPatient: isInpatient,
isDischargedPatient:
isDischargedPatient,
nameLine1:
TranslationBase
.of(
context)
.progress,
nameLine2:
TranslationBase
.of(
context)
.note,
icon:
'patient/Progress_notes.png'),
PatientProfileButton(
patient: patient,
isInPatient: isInpatient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_NOTE,
isDischargedPatient:
isDischargedPatient,
nameLine1:
"Order",
//"Text",
nameLine2:
"Sheet",
//TranslationBase.of(context).orders,
icon:
'patient/Progress_notes.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PROCEDURE,
isInPatient: isInpatient,
nameLine1:
TranslationBase
.of(
context)
.orders,
nameLine2:
TranslationBase
.of(
context)
.procedures,
icon:
'patient/Order_Procedures.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1: "Health",
isInPatient: isInpatient,
nameLine2: "Summary",
//TranslationBase.of(context).summaryReport,
icon:
'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: MEDICAL_FILE,
nameLine1:
"Medical",
//Health
isInPatient: isInpatient,
nameLine2:
"Report",
//Report
//TranslationBase.of(context).summaryReport,
icon:
'patient/health_summary.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route:
REFER_IN_PATIENT_TO_DOCTOR,
isInPatient: true,
isDisable:
isDischargedPatient ||
isFromSearch,
nameLine1:
TranslationBase
.of(
context)
.referral,
nameLine2:
TranslationBase
.of(
context)
.patient,
icon:
'patient/refer_patient.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route:
PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1:
TranslationBase
.of(
context)
.insurance,
nameLine2:
TranslationBase
.of(
context)
.approvals,
icon:
'patient/vital_signs.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: null,
nameLine1: "Discharge",
nameLine2: "Summery",
icon:
'patient/patient_sick_leave.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ADD_SICKLEAVE,
nameLine1:
TranslationBase
.of(
context)
.patientSick,
nameLine2:
TranslationBase
.of(
context)
.leave,
icon:
'patient/patient_sick_leave.png'),
],
), ),
); );
} }

@ -1,7 +1,9 @@
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
@ -15,292 +17,128 @@ class ProfileGridForOther extends StatelessWidget {
String from; String from;
String to; String to;
ProfileGridForOther( ProfileGridForOther(
{Key key, {Key key,
this.patient, this.patient,
this.patientType, this.patientType,
this.arrivalType, this.arrivalType,
this.height, this.height,
this.isInpatient, this.from,this.to}) this.isInpatient,
this.from,
this.to})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(
TranslationBase.of(context).vital,
TranslationBase.of(context).signs,
VITAL_SIGN_DETAILS,
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).result,
LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).radiology,
TranslationBase.of(context).service,
RADIOLOGY_PATIENT,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW,
'patient/order_prescription.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).health,
TranslationBase.of(context).summary,
HEALTH_SUMMARY,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patient,
"ECG",
PATIENT_ECG,
'patient/patient_sick_leave.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).procedures,
ORDER_PROCEDURE,
'patient/Order_Procedures.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).insurance,
TranslationBase.of(context).service,
PATIENT_INSURANCE_APPROVALS_NEW,
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patientSick,
TranslationBase.of(context).leave,
ADD_SICKLEAVE,
'patient/patient_sick_leave.png',
isInPatient: isInpatient),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).ucaf,
PATIENT_UCAF_REQUEST,
'patient/ucaf.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel(
TranslationBase.of(context).referral,
TranslationBase.of(context).patient,
REFER_PATIENT_TO_DOCTOR,
'patient/refer_patient.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel(
TranslationBase.of(context).admission,
TranslationBase.of(context).request,
PATIENT_ADMISSION_REQUEST,
'patient/admission_req.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
];
return Column( return Column(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
.symmetric( child: StaggeredGridView.countBuilder(
vertical: 15.0,
horizontal: 15),
child: GridView.count(
shrinkWrap: true, shrinkWrap: true,
physics: physics: NeverScrollableScrollPhysics(),
NeverScrollableScrollPhysics(),
crossAxisSpacing: 10, crossAxisSpacing: 10,
mainAxisSpacing: 10, mainAxisSpacing: 10,
childAspectRatio: 1 / 1.0,
crossAxisCount: 3, crossAxisCount: 3,
children: [ itemCount: cardsList.length,
PatientProfileButton( staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
isInPatient: itemBuilder: (BuildContext context, int index) => PatientProfileButton(
isInpatient, patient: patient,
patient: patient, patientType: patientType,
patientType: arrivalType: arrivalType,
patientType, from: from,
arrivalType: to: to,
arrivalType, nameLine1: cardsList[index].nameLine1,
from: from, nameLine2: cardsList[index].nameLine2,
to: to, route: cardsList[index].route,
nameLine1: icon: cardsList[index].icon,
TranslationBase.of( isInPatient: cardsList[index].isInPatient,
context) isDischargedPatient: cardsList[index].isDischargedPatient,
.vital, isDisable: cardsList[index].isDisable,
nameLine2: onTap: cardsList[index].onTap,
TranslationBase.of( isLoading: cardsList[index].isLoading,
context) ),
.signs,
route:
VITAL_SIGN_DETAILS,
icon:
'patient/vital_signs.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route: LAB_RESULT,
nameLine1:
TranslationBase.of(
context)
.lab,
nameLine2:
TranslationBase.of(
context)
.result,
icon:
'patient/lab_results.png'),
PatientProfileButton(
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
isInPatient:
isInpatient,
route:
RADIOLOGY_PATIENT,
nameLine1:
TranslationBase.of(
context)
.radiology,
nameLine2:
TranslationBase.of(
context)
.service,
icon:
'patient/health_summary.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route:
ORDER_PRESCRIPTION_NEW,
nameLine1:
TranslationBase.of(
context)
.orders,
nameLine2:
TranslationBase.of(
context)
.prescription,
icon:
'patient/order_prescription.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route: MEDICAL_FILE,
nameLine1: "Health",
//TranslationBase.of(context).medicalReport,
nameLine2: "Summary",
//TranslationBase.of(context).summaryReport,
icon:
'patient/health_summary.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route: PATIENT_ECG,
nameLine1:
TranslationBase.of(
context)
.patient,
nameLine2: "ECG",
icon:
'patient/patient_sick_leave.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route:
ORDER_PROCEDURE,
nameLine1:
TranslationBase.of(
context)
.orders,
nameLine2:
TranslationBase.of(
context)
.procedures,
icon:
'patient/Order_Procedures.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route:
PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1:
TranslationBase.of(
context)
.insurance,
nameLine2:
TranslationBase.of(
context)
.service,
icon:
'patient/vital_signs.png'),
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route: ADD_SICKLEAVE,
nameLine1:
TranslationBase.of(
context)
.patientSick,
nameLine2:
TranslationBase.of(
context)
.leave,
icon:
'patient/patient_sick_leave.png'),
if (patient.appointmentNo !=
null &&
patient.appointmentNo !=
0)
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route:
PATIENT_UCAF_REQUEST,
isDisable:
patient.patientStatusType !=
43
? true
: false,
nameLine1:
TranslationBase.of(
context)
.patient,
nameLine2:
TranslationBase.of(
context)
.ucaf,
icon:
'patient/ucaf.png'),
if (patient.appointmentNo !=
null &&
patient.appointmentNo !=
0)
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route:
REFER_PATIENT_TO_DOCTOR,
isDisable: patient
.patientStatusType !=
43
? true
: false,
nameLine1:
TranslationBase.of(
context)
.referral,
nameLine2:
TranslationBase.of(
context)
.patient,
icon:
'patient/refer_patient.png'),
if (patient.appointmentNo !=
null &&
patient.appointmentNo !=
0)
PatientProfileButton(
isInPatient:
isInpatient,
patient: patient,
patientType:
patientType,
arrivalType:
arrivalType,
route:
PATIENT_ADMISSION_REQUEST,
isDisable:
patient.patientStatusType !=
43
? true
: false,
nameLine1:
TranslationBase.of(
context)
.admission,
nameLine2:
TranslationBase.of(
context)
.request,
icon:
'patient/admission_req.png'),
],
), ),
), ),
], ],

@ -1,7 +1,9 @@
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
@ -25,137 +27,115 @@ class ProfileGridForSearch extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(
TranslationBase.of(context).vital,
TranslationBase.of(context).signs,
VITAL_SIGN_DETAILS,
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).result,
LAB_RESULT,
'patient/lab_results.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).radiology,
TranslationBase.of(context).service,
RADIOLOGY_PATIENT,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW,
'patient/order_prescription.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).health,
TranslationBase.of(context).summary,
HEALTH_SUMMARY,
'patient/health_summary.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patient,
"ECG",
PATIENT_ECG,
'patient/patient_sick_leave.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).procedures,
ORDER_PROCEDURE,
'patient/Order_Procedures.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).insurance,
TranslationBase.of(context).service,
PATIENT_INSURANCE_APPROVALS_NEW,
'patient/vital_signs.png',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patientSick,
TranslationBase.of(context).leave,
ADD_SICKLEAVE,
'patient/patient_sick_leave.png',
isInPatient: isInpatient),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).ucaf,
PATIENT_UCAF_REQUEST,
'patient/ucaf.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel(
TranslationBase.of(context).referral,
TranslationBase.of(context).patient,
REFER_PATIENT_TO_DOCTOR,
'patient/refer_patient.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileCardModel(
TranslationBase.of(context).admission,
TranslationBase.of(context).request,
PATIENT_ADMISSION_REQUEST,
'patient/admission_req.png',
isInPatient: isInpatient,
isDisable: patient.patientStatusType != 43 ? true : false),
];
return Column( return Column(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
child: GridView.count( child: StaggeredGridView.countBuilder(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
crossAxisSpacing: 10, crossAxisSpacing: 10,
mainAxisSpacing: 10, mainAxisSpacing: 10,
childAspectRatio: 1 / 1.0,
crossAxisCount: 3, crossAxisCount: 3,
children: [ itemCount: cardsList.length,
PatientProfileButton( staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
isInPatient: isInpatient, itemBuilder: (BuildContext context, int index) => PatientProfileButton(
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
from: from, from: from,
to: to, to: to,
nameLine1: TranslationBase.of(context).vital, nameLine1: cardsList[index].nameLine1,
nameLine2: TranslationBase.of(context).signs, nameLine2: cardsList[index].nameLine2,
route: VITAL_SIGN_DETAILS, route: cardsList[index].route,
icon: 'patient/vital_signs.png'), icon: cardsList[index].icon,
PatientProfileButton( isInPatient: cardsList[index].isInPatient,
isInPatient: isInpatient, isDischargedPatient: cardsList[index].isDischargedPatient,
patient: patient, isDisable: cardsList[index].isDisable,
patientType: patientType, onTap: cardsList[index].onTap,
arrivalType: arrivalType, isLoading: cardsList[index].isLoading,
route: LAB_RESULT, ),
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'patient/lab_results.png'),
PatientProfileButton(
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isInPatient: isInpatient,
route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/health_summary.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PRESCRIPTION_NEW,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription,
icon: 'patient/order_prescription.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: MEDICAL_FILE,
nameLine1: "Health",
//TranslationBase.of(context).medicalReport,
nameLine2: "Summary",
//TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient,
nameLine2: "ECG",
icon: 'patient/patient_sick_leave.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PROCEDURE,
nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).procedures,
icon: 'patient/Order_Procedures.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service,
icon: 'patient/vital_signs.png'),
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave,
icon: 'patient/patient_sick_leave.png'),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_UCAF_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf,
icon: 'patient/ucaf.png'),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: REFER_PATIENT_TO_DOCTOR,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
if (patient.appointmentNo != null && patient.appointmentNo != 0)
PatientProfileButton(
isInPatient: isInpatient,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: PATIENT_ADMISSION_REQUEST,
isDisable: patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'),
],
), ),
), ),
], ],

@ -22,7 +22,7 @@ import 'package:speech_to_text/speech_to_text.dart' as stt;
class AddReplayOnReferralPatient extends StatefulWidget { class AddReplayOnReferralPatient extends StatefulWidget {
final PatientReferralViewModel patientReferralViewModel; final PatientReferralViewModel patientReferralViewModel;
final MyReferralPatientModel myReferralInPatientModel; final MyReferralPatientModel myReferralInPatientModel;
//TODO Jammal
const AddReplayOnReferralPatient( const AddReplayOnReferralPatient(
{Key key, this.patientReferralViewModel, this.myReferralInPatientModel}) {Key key, this.patientReferralViewModel, this.myReferralInPatientModel})
: super(key: key); : super(key: key);
@ -32,19 +32,20 @@ class AddReplayOnReferralPatient extends StatefulWidget {
_AddReplayOnReferralPatientState(); _AddReplayOnReferralPatientState();
} }
class _AddReplayOnReferralPatientState class _AddReplayOnReferralPatientState extends State<AddReplayOnReferralPatient> {
extends State<AddReplayOnReferralPatient> {
bool isSubmitted = false; bool isSubmitted = false;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var reconizedWord;
var event = RobotProvider(); var event = RobotProvider();
TextEditingController progressNoteController = TextEditingController(); TextEditingController replayOnReferralController = TextEditingController();
@override @override
void initState() { void initState() {
requestPermissions(); requestPermissions();
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
@ -71,12 +72,12 @@ class _AddReplayOnReferralPatientState
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
hintText: 'Replay your responses here', hintText: 'Replay your responses here',
controller: progressNoteController, controller: replayOnReferralController,
maxLines: 35, maxLines: 35,
minLines: 25, minLines: 25,
hasBorder: true, hasBorder: true,
validationError: validationError:
progressNoteController.text.isEmpty && replayOnReferralController.text.isEmpty &&
isSubmitted isSubmitted
? TranslationBase.of(context).emptyMessage ? TranslationBase.of(context).emptyMessage
: null, : null,
@ -88,6 +89,7 @@ class _AddReplayOnReferralPatientState
icon: Icon( icon: Icon(
DoctorApp.speechtotext, DoctorApp.speechtotext,
color: Colors.black, color: Colors.black,
size: 35,
), ),
onPressed: () { onPressed: () {
onVoiceText(); onVoiceText();
@ -106,41 +108,57 @@ class _AddReplayOnReferralPatientState
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: replayOnReferralController.text.isNotEmpty? 130:70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap( child: Column(
alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( replayOnReferralController.text.isEmpty
title: 'Submit Replay', ? SizedBox()
color: Color(0xff359846), : Container(
fontWeight: FontWeight.w700, margin: EdgeInsets.all(5),
onPressed: () async { child: Expanded(
setState(() { child: AppButton(
isSubmitted = true; title: TranslationBase.of(context).clearText,
}); onPressed: () {
if (progressNoteController.text.isNotEmpty) { setState(() {
GifLoaderDialogUtils.showMyDialog(context); replayOnReferralController.text = '';
await widget.patientReferralViewModel.replay( });
progressNoteController.text.trim(), },
widget.myReferralInPatientModel); )),
if (widget.patientReferralViewModel.state == ),
ViewState.ErrorLocal) { Container(
Helpers.showErrorToast( margin: EdgeInsets.all(5),
widget.patientReferralViewModel.error); child: AppButton(
} else { title: 'Submit Replay',
GifLoaderDialogUtils.hideDialog(context); color: Color(0xff359846),
DrAppToastMsg.showSuccesToast( fontWeight: FontWeight.w700,
"Your Replay Added Successfully"); onPressed: () async {
Navigator.of(context).pop(); setState(() {
Navigator.of(context).pop(); isSubmitted = true;
} });
} else { if (replayOnReferralController.text.isNotEmpty) {
Helpers.showErrorToast("You can't add empty replay"); GifLoaderDialogUtils.showMyDialog(context);
setState(() { await widget.patientReferralViewModel.replay(
isSubmitted = false; replayOnReferralController.text.trim(),
}); widget.myReferralInPatientModel);
} if (widget.patientReferralViewModel.state ==
}), ViewState.ErrorLocal) {
Helpers.showErrorToast(
widget.patientReferralViewModel.error);
} else {
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(
"Your Replay Added Successfully");
Navigator.of(context).pop();
Navigator.of(context).pop();
}
} else {
Helpers.showErrorToast("You can't add empty replay");
setState(() {
isSubmitted = false;
});
}
})),
], ],
), ),
), ),
@ -182,7 +200,7 @@ class _AddReplayOnReferralPatientState
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
progressNoteController.text = reconizedWord; replayOnReferralController.text += reconizedWord + '\n';
}); });
} }
} }

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../ReferralDischargedPatientPage.dart';
import 'my-referral-inpatient-screen.dart'; import 'my-referral-inpatient-screen.dart';
class PatientReferralScreen extends StatefulWidget { class PatientReferralScreen extends StatefulWidget {
@ -24,7 +25,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 3, vsync: this);
_tabController.addListener(_handleTabSelection); _tabController.addListener(_handleTabSelection);
} }
@ -74,7 +75,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.50, width: MediaQuery.of(context).size.width * 0.33,
height: MediaQuery.of(context).size.height * 0.070, height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration( decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC), Color(0Xffffffff), Color(0xFFCCCCCC),
@ -101,7 +102,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.50, width: MediaQuery.of(context).size.width * 0.34,
height: MediaQuery.of(context).size.height * 0.070, height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration( decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC), Color(0Xffffffff), Color(0xFFCCCCCC),
@ -127,6 +128,33 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
), ),
), ),
), ),
Container(
width: MediaQuery.of(context).size.width * 0.33,
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
index == 2
? Color(0xFFD02127 )
: Color(0xFFEAEAEA),
index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
TranslationBase.of(context).discharged,
fontSize: SizeConfig.textMultiplier * 1.8,
color: index == 2 ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
),
),
),
], ],
), ),
@ -143,6 +171,7 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
children: <Widget>[ children: <Widget>[
ReferredPatientScreen(), ReferredPatientScreen(),
MyReferralInPatientScreen(), MyReferralInPatientScreen(),
ReferralDischargedPatientPage()
// MyReferredPatient(), // MyReferredPatient(),
], ],
), ),

@ -22,6 +22,7 @@ import 'package:intl/intl.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
class PatientMakeInPatientReferralScreen extends StatefulWidget { class PatientMakeInPatientReferralScreen extends StatefulWidget {
@override @override
_PatientMakeInPatientReferralScreenState createState() => _PatientMakeInPatientReferralScreenState createState() =>
@ -104,7 +105,7 @@ class _PatientMakeInPatientReferralScreenState
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
speech.stop(); speech.stop();
_remarksController.text = reconizedWord; _remarksController.text += reconizedWord + '\n';
}); });
} else { } else {
print(result.finalResult); print(result.finalResult);
@ -140,13 +141,17 @@ class _PatientMakeInPatientReferralScreenState
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<PatientReferralViewModel>( return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getReferralFrequencyList(), onModelReady: (model) => model.getReferralFrequencyList(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileHeaderNewDesignAppBar( appBar: PatientProfileHeaderNewDesignAppBar(
patient, patientType, arrivalType,isInpatient: isInpatient,), patient,
patientType,
arrivalType,
isInpatient: isInpatient,
),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
@ -466,19 +471,21 @@ class _PatientMakeInPatientReferralScreenState
Stack( Stack(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
hintText:"Remarks", hintText: "Remarks",
controller: _remarksController, controller: _remarksController,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,
), ),
Positioned( Positioned(
top: 0, //MediaQuery.of(context).size.height * 0, top:
0, //MediaQuery.of(context).size.height * 0,
right: 15, right: 15,
child: IconButton( child: IconButton(
icon: Icon( icon: Icon(
DoctorApp.speechtotext, DoctorApp.speechtotext,
color: Colors.black, color: Colors.black,
size: 35,
), ),
onPressed: () { onPressed: () {
initSpeechState() initSpeechState()
@ -493,73 +500,91 @@ class _PatientMakeInPatientReferralScreenState
) )
], ],
), ),
Container( Column(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), children: [
child: AppButton( _remarksController.text.isEmpty
title: TranslationBase.of(context).refer, ? SizedBox()
fontWeight: FontWeight.w700, : Container(
color: Color(0XFF359846), margin: EdgeInsets.all(5),
onPressed: () async{ child: Expanded(
setState(() { child: AppButton(
if (_referTo == null) { title: TranslationBase.of(context).clearText,
branchError = onPressed: () {
TranslationBase.of(context).fieldRequired; setState(() {
} else { _remarksController.text = '';
branchError = null; });
} },
if (_selectedBranch == null) { ))),
hospitalError = Container(
TranslationBase.of(context).fieldRequired; margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
} else { child: AppButton(
hospitalError = null; title: TranslationBase.of(context).refer,
} fontWeight: FontWeight.w700,
if (_selectedClinic == null) { color: Color(0XFF359846),
clinicError = onPressed: () async {
TranslationBase.of(context).fieldRequired; setState(() {
} else { if (_referTo == null) {
clinicError = null; branchError =
} TranslationBase.of(context).fieldRequired;
if (_selectedDoctor == null) { } else {
doctorError = branchError = null;
TranslationBase.of(context).fieldRequired; }
} else { if (_selectedBranch == null) {
doctorError = null; hospitalError =
} TranslationBase.of(context).fieldRequired;
if (_selectedFrequency == null) { } else {
frequencyError = hospitalError = null;
TranslationBase.of(context).fieldRequired; }
} else { if (_selectedClinic == null) {
frequencyError = null; clinicError =
} TranslationBase.of(context).fieldRequired;
}); } else {
if (_selectedFrequency == null || clinicError = null;
_selectedBranch == null || }
_selectedClinic == null || if (_selectedDoctor == null) {
_selectedDoctor == null || doctorError =
_remarksController.text == null || TranslationBase.of(context).fieldRequired;
_extController.text == null) return;{ } else {
doctorError = null;
await model.makeInPatientReferral( }
patient: patient, if (_selectedFrequency == null) {
projectID: _selectedBranch['facilityId'], frequencyError =
clinicID: _selectedClinic['ClinicID'], TranslationBase.of(context).fieldRequired;
doctorID: _selectedDoctor['DoctorID'], } else {
frequencyCode: _selectedFrequency['ParameterCode'], frequencyError = null;
ext: _extController.text, }
remarks: _remarksController.text, });
priority: _activePriority, if (_selectedFrequency == null ||
referralDate: appointmentDate _selectedBranch == null ||
); _selectedClinic == null ||
if(model.state == ViewState.ErrorLocal) _selectedDoctor == null ||
DrAppToastMsg.showErrorToast(model.error); _remarksController.text == null ||
else{ _extController.text == null) return;
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg); {
Navigator.pop(context); await model.makeInPatientReferral(
} patient: patient,
projectID: _selectedBranch['facilityId'],
clinicID: _selectedClinic['ClinicID'],
doctorID: _selectedDoctor['DoctorID'],
frequencyCode:
_selectedFrequency['ParameterCode'],
ext: _extController.text,
remarks: _remarksController.text,
priority: _activePriority,
referralDate: appointmentDate);
if (model.state == ViewState.ErrorLocal)
DrAppToastMsg.showErrorToast(model.error);
else {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.referralSuccessMsg);
Navigator.pop(context);
}
} }
}, },
), ),
)
],
) )
], ],
), ),

@ -412,7 +412,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"Dr ${referredPatient.referringDoctorName}", "${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: 1.5 * fontSize: 1.5 *

@ -103,7 +103,7 @@ class ReferredPatientScreen extends StatelessWidget {
.getReferredPatientItem(index) .getReferredPatientItem(index)
.doctorImageURL, .doctorImageURL,
referralDoctorName: referralDoctorName:
"Dr. ${model.getReferredPatientItem(index).referralDoctorName}", "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}",
clinicDescription: model clinicDescription: model
.getReferredPatientItem(index) .getReferredPatientItem(index)
.referralClinicDescription, .referralClinicDescription,

@ -407,7 +407,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
"Dr ${referredPatient.referralDoctorName}", "${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: 1.5 * fontSize: 1.5 *
@ -517,7 +517,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
referredPatient referredPatient
.referredDoctorRemarks.isNotEmpty .referredDoctorRemarks.isNotEmpty
? referredPatient.referredDoctorRemarks ? referredPatient.referredDoctorRemarks
: " Not Replied yet", : TranslationBase.of(context).notRepliedYet,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize: 1.6 * SizeConfig.textMultiplier,

@ -351,6 +351,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
hintText: TranslationBase.of(context).remarks, hintText: TranslationBase.of(context).remarks,
maxLines: 18, maxLines: 18,
minLines: 5, minLines: 5,
inputType: TextInputType.multiline,
controller: remarkController, controller: remarkController,
onChanged: (value) { onChanged: (value) {
widget.mySelectedAssessment.remark = widget.mySelectedAssessment.remark =

@ -33,7 +33,6 @@ class SOAPStepHeader extends StatelessWidget {
child: StepsWidget( child: StepsWidget(
index: currentIndex, index: currentIndex,
changeCurrentTab: changePageViewIndex, changeCurrentTab: changePageViewIndex,
height: 100,
), ),
), ),
SizedBox( SizedBox(

@ -20,23 +20,26 @@ class StepsWidget extends StatelessWidget {
? Stack( ? Stack(
children: [ children: [
Container( Container(
height: height == 0 ? 150 : height, height: height == 0 ? 100 : height,
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery.of(context).size.width * 0.9,
color: Colors.transparent, color: Colors.transparent,
), ),
Positioned( Positioned(
top: 30 top: 30
, ,
child: Center( child: Center(
child: Container( child: Container(
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery
child: Divider( .of(context)
color: Colors.grey, .size
height: 0.75, .width * 0.9,
thickness: 0.75, child: Divider(
), color: Colors.grey,
height: 0.75,
thickness: 0.75,
), ),
)), ),
),),
Positioned( Positioned(
top: 10, top: 10,
left: 0, left: 0,
@ -260,17 +263,26 @@ class StepsWidget extends StatelessWidget {
: Stack( : Stack(
children: [ children: [
Container( Container(
height: height == 0 ? 150 : height, height: height == 0 ? 100 : height,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width * 0.9,
color: Colors.transparent, color: Colors.transparent,
),
Positioned(
top: 30
,
child: Center( child: Center(
child: Divider( child: Container(
color: Colors.grey, width: MediaQuery
height: 0.75, .of(context)
thickness: 0.75, .size
.width * 0.9,
child: Divider(
color: Colors.grey,
height: 0.75,
thickness: 0.75,
),
), ),
), ),),
),
Positioned( Positioned(
top: 10, top: 10,
right: 0, right: 0,
@ -303,7 +315,7 @@ class StepsWidget extends StatelessWidget {
color: Colors.white, color: Colors.white,
)), )),
), ),
SizedBox(height: 5), SizedBox(height: 3),
Column( Column(
children: [ children: [
AppText( AppText(

@ -40,22 +40,28 @@ class UpdateChiefComplaints extends StatelessWidget {
maxLines: 25, maxLines: 25,
minLines: 7, minLines: 7,
hasBorder: true, hasBorder: true,
validationError:complaintsControllerError !=''?complaintsControllerError:null , inputType: TextInputType.multiline,
validationError: complaintsControllerError != ''
? complaintsControllerError
: null,
), ),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
.historyOfPresentIllness, .historyOfPresentIllness,
controller: illnessController, controller: illnessController,
maxLines: 25, inputType: TextInputType.multiline,
minLines: 7,
maxLines: 25,
minLines: 7,
hasBorder: true, hasBorder: true,
validationError:illnessControllerError !=''?illnessControllerError:null , validationError: illnessControllerError != ''
? illnessControllerError
: null,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -67,14 +73,18 @@ class UpdateChiefComplaints extends StatelessWidget {
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
.currentMedications, .currentMedications,
controller: medicationController, controller: medicationController,
maxLines: 25, maxLines: 25,
minLines: 7, minLines: 7,
hasBorder: true, hasBorder: true,
validationError:medicationControllerError !=''?medicationControllerError:null , inputType: TextInputType.multiline,
validationError: medicationControllerError != ''
? medicationControllerError
: null,
), ),
SizedBox( SizedBox(

@ -22,6 +22,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -406,6 +407,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
AppText(
_selectedMedication?.description ??
"",
bold: true,
),
Container( Container(
child: Row( child: Row(
children: [ children: [
@ -430,16 +436,25 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
SizedBox( SizedBox(
height: spaceBetweenTextFileds), height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, //height: screenSize.height * 0.062,
height: MediaQuery.of(context)
.size
.height *
0.0749,
width: double.infinity, width: double.infinity,
child: Row( child: Row(
children: [ children: [
Container( Container(
// height: MediaQuery.of(context)
// .size
// .height *
// 0.02,
width: MediaQuery.of(context) width: MediaQuery.of(context)
.size .size
.width * .width *
0.550, 0.35,
child: TextFields( child: AppTextFieldCustom(
isPrscription: true,
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter( LengthLimitingTextInputFormatter(
5), 5),
@ -450,12 +465,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TranslationBase.of( TranslationBase.of(
context) context)
.strength, .strength,
// fontWeight: FontWeight.w500,
// fontSize: 14.0,
// borderWidth: 0.2,
controller: controller:
strengthController, strengthController,
keyboardType: TextInputType // keyboardType: TextInputType
.numberWithOptions( // .numberWithOptions(
decimal: true, // decimal: true,
), // ),
onChanged: (String value) { onChanged: (String value) {
setState(() { setState(() {
strengthChar = strengthChar =
@ -470,30 +490,30 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
); );
} }
}, },
onSubmit: (_) { // onClick: (_) {
if (_selectedMedication != // if (_selectedMedication !=
null && // null &&
duration != null && // duration != null &&
frequency != null && // frequency != null &&
strengthController // strengthController
.text != // .text !=
null) { // null) {
model.getBoxQuantity( // model.getBoxQuantity(
freq: frequency[ // freq: frequency[
'parameterCode'], // 'parameterCode'],
duration: // duration:
duration['id'], // duration['id'],
itemCode: // itemCode:
_selectedMedication // _selectedMedication
.itemId, // .itemId,
strength: double.parse( // strength: double.parse(
strengthController // strengthController
.text)); // .text));
box = model.boxQuintity; // box = model.boxQuintity;
//
return; // return;
} // }
}, // },
// validator: (value) { // validator: (value) {
// if (value.isEmpty && // if (value.isEmpty &&
// strengthController.text.length > // strengthController.text.length >
@ -506,14 +526,18 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
SizedBox( SizedBox(
width: 10.0, width: 5.0,
), ),
Container( Container(
// height: MediaQuery.of(context)
// .size
// .height *
// 0.06,
color: Colors.white, color: Colors.white,
width: MediaQuery.of(context) width: MediaQuery.of(context)
.size .size
.width * .width *
0.350, 0.560,
child: InkWell( child: InkWell(
onTap: onTap:
model.itemMedicineListUnit != model.itemMedicineListUnit !=
@ -561,19 +585,18 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextField( child: TextField(
decoration: decoration:
textFieldSelectorDecoration( textFieldSelectorDecoration(
TranslationBase.of( 'Select',
context)
.unit,
model.itemMedicineListUnit model.itemMedicineListUnit
.length == .length ==
1 1
? model.itemMedicineListUnit[ ? units = model
0][ .itemMedicineListUnit[0]
[
'description'] 'description']
: units != : units !=
null null
? units[ ? units['description']
'description'] .toString()
: null, : null,
true), true),
enabled: false), enabled: false),
@ -640,10 +663,16 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TranslationBase.of( TranslationBase.of(
context) context)
.route, .route,
route != null model.itemMedicineListRoute
? route[ .length ==
'description'] 1
: null, ? model.itemMedicineListRoute[
0]
['description']
: route != null
? route[
'description']
: null,
true), true),
enabled: false, enabled: false,
), ),
@ -725,10 +754,16 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TranslationBase.of( TranslationBase.of(
context) context)
.frequency, .frequency,
frequency != null model.itemMedicineList
? frequency[ .length ==
'description'] 1
: null, ? model.itemMedicineList[
0]
['description']
: frequency != null
? frequency[
'description']
: null,
true), true),
enabled: false, enabled: false,
), ),
@ -1138,12 +1173,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
formKey.currentState.save(); formKey.currentState.save();
// Navigator.pop(context); // Navigator.pop(context);
// openDrugToDrug(); // openDrugToDrug();
if (route == null || if (frequency == null ||
frequency == null || strengthController
.text ==
"" ||
doseTime == null || doseTime == null ||
duration == null || duration == null ||
selectedDate == null || selectedDate == null) {
units == null) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of( TranslationBase.of(
context) context)
@ -1206,27 +1242,48 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// // .trim()) // // .trim())
// // .toList() // // .toList()
// // .join(' '), // // .join(' '),
// dose: // dose: strengthController
// strengthController // .text,
// .text, // doseUnit: model
// doseUnit: units[ // .itemMedicineListUnit
// 'parameterCode'] // .length ==
// .toString(), // 1
// patient: // ? model
// widget.patient, // .itemMedicineListUnit[
// 0][
// 'parameterCode']
// .toString()
// : units['parameterCode']
// .toString(),
// patient: widget.patient,
// doseTimeIn: // doseTimeIn:
// doseTime['id'] // doseTime['id']
// .toString(), // .toString(),
// model: widget.model, // model: widget.model,
// duration: // duration: duration['id']
// duration['id']
// .toString(),
// frequency: frequency[
// 'parameterCode']
// .toString(),
// route: route[
// 'parameterCode']
// .toString(), // .toString(),
// frequency: model
// .itemMedicineList
// .length ==
// 1
// ? model
// .itemMedicineList[
// 0][
// 'parameterCode']
// .toString()
// : frequency[
// 'parameterCode']
// .toString(),
// route: model.itemMedicineListRoute
// .length ==
// 1
// ? model
// .itemMedicineListRoute[
// 0][
// 'parameterCode']
// .toString()
// : route['parameterCode']
// .toString(),
// drugId: // drugId:
// _selectedMedication // _selectedMedication
// .itemId // .itemId
@ -1240,8 +1297,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// instruction: // instruction:
// instructionController // instructionController
// .text, // .text,
// doseTime: // doseTime: selectedDate,
// selectedDate,
// ); // );
} }
} }
@ -1350,7 +1406,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
children: [ children: [
DrugToDrug( DrugToDrug(
widget.patient, widget.patient,
getPriscriptionforDrug(widget.prescriptionList), getPriscriptionforDrug(widget.prescriptionList, model),
model.patientAssessmentList), model.patientAssessmentList),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3),
@ -1382,8 +1438,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
doseTimeIn: doseTime['id'].toString(), doseTimeIn: doseTime['id'].toString(),
model: widget.model, model: widget.model,
duration: duration['id'].toString(), duration: duration['id'].toString(),
frequency: frequency['parameterCode'].toString(), frequency: model.itemMedicineList.length == 1
route: route['parameterCode'].toString(), ? model.itemMedicineList[0]['parameterCode']
: frequency['parameterCode'].toString(),
route: model.itemMedicineListRoute.length == 1
? model.itemMedicineListRoute[0]['parameterCode']
: route['parameterCode'].toString(),
drugId: _selectedMedication.itemId.toString(), drugId: _selectedMedication.itemId.toString(),
strength: strengthController.text, strength: strengthController.text,
indication: indicationController.text, indication: indicationController.text,
@ -1431,7 +1491,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}); });
} }
getPriscriptionforDrug(List<PrescriptionModel> prescriptionList) { // selectedValue(itemMdeicationList,key){
// // String selected = "";
// // units[key]=itemMdeicationList.length==1? itemMdeicationList[0][key]:units[key].toString();
// //
// // selected = units[key];
// //
// // return selected;
// // }
getPriscriptionforDrug(
List<PrescriptionModel> prescriptionList, MedicineViewModel model) {
var prescriptionDetails = []; var prescriptionDetails = [];
if (prescriptionList.length > 0) { if (prescriptionList.length > 0) {
prescriptionList[0].entityList.forEach((element) { prescriptionList[0].entityList.forEach((element) {
@ -1455,11 +1525,19 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
'DrugId': _selectedMedication.mediSpanGPICode, 'DrugId': _selectedMedication.mediSpanGPICode,
'DrugName': _selectedMedication.description, 'DrugName': _selectedMedication.description,
'Dose': strengthController.text, 'Dose': strengthController.text,
'DoseType': units['parameterCode'].toString(), 'DoseType': model.itemMedicineListUnit.length == 1
'Unit': units['description'], ? model.itemMedicineListUnit[0]['parameterCode'].toString()
'FrequencyType': frequency['parameterCode'].toString(), : units['parameterCode'].toString(),
'Unit': model.itemMedicineListUnit.length == 1
? model.itemMedicineListUnit[0]['description']
: units['description'],
'FrequencyType': model.itemMedicineList.length == 1
? model.itemMedicineList[0]['parameterCode']
: frequency['parameterCode'].toString(),
'Duration': duration['id'].toString(), 'Duration': duration['id'].toString(),
'RouteID': route['parameterCode'].toString(), 'RouteID': model.itemMedicineListRoute.length == 1
? model.itemMedicineListRoute[0]['parameterCode'].toString()
: route['parameterCode'].toString(),
'IsScreen': true 'IsScreen': true
}); });
} }

@ -14,11 +14,15 @@ import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
// ignore: must_be_immutable
class AddSickLeavScreen extends StatelessWidget { class AddSickLeavScreen extends StatelessWidget {
PatiantInformtion patient; PatiantInformtion patient;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
@ -37,8 +41,6 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column(children: [ child: Column(children: [
// PatientProfileHeaderNewDesign(
// patient, routeArgs['patientType'], routeArgs['arrivalType']),
patient.patientStatusType == 43 patient.patientStatusType == 43
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -48,6 +50,7 @@ class AddSickLeavScreen extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if(!projectsProvider.isArabic)
AppText( AppText(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -190,10 +193,9 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
Flexible( Flexible(
child: AppText( child: AppText(
DateUtils.getDayMonthYearDateFormatted( DateUtils.getDayMonthYearDateFormatted(DateUtils
DateUtils .convertStringToDate(
.convertStringToDate( item.startDate)),
item.startDate)),
fontWeight: fontWeight:
FontWeight.bold, FontWeight.bold,
), ),
@ -210,10 +212,8 @@ class AddSickLeavScreen extends StatelessWidget {
), ),
Flexible( Flexible(
child: AppText( child: AppText(
DateUtils DateUtils.getDayMonthYearDateFormatted(DateUtils
.getDayMonthYearDateFormatted( .convertStringToDate(
DateUtils
.convertStringToDate(
item.endDate, item.endDate,
)), )),
fontWeight: fontWeight:

@ -1,6 +1,7 @@
import 'package:connectivity/connectivity.dart'; import 'package:connectivity/connectivity.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; import 'package:doctor_app_flutter/screens/auth/login_screen.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
@ -16,6 +17,7 @@ import '../util/dr_app_toast_msg.dart';
import 'dr_app_shared_pref.dart'; import 'dr_app_shared_pref.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class Helpers { class Helpers {
static int cupertinoPickerIndex = 0; static int cupertinoPickerIndex = 0;
@ -82,7 +84,6 @@ class Helpers {
style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), style: TextStyle(fontSize: SizeConfig.textMultiplier * 2),
); );
}).toList(), }).toList(),
itemExtent: 25, itemExtent: 25,
looping: false, looping: false,
onSelectedItemChanged: (int index) { onSelectedItemChanged: (int index) {
@ -100,6 +101,7 @@ class Helpers {
DrAppToastMsg.showErrorToast(localMsg); DrAppToastMsg.showErrorToast(localMsg);
} }
static Future<bool> checkConnection() async { static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult = ConnectivityResult connectivityResult =
await (Connectivity().checkConnectivity()); await (Connectivity().checkConnectivity());
@ -144,8 +146,13 @@ class Helpers {
String lang = await sharedPref.getString(APP_Language); String lang = await sharedPref.getString(APP_Language);
await clearSharedPref(); await clearSharedPref();
sharedPref.setString(APP_Language, lang); sharedPref.setString(APP_Language, lang);
Navigator.pushAndRemoveUntil(AppGlobal.CONTEX, FadePage(page: Loginsreen(),), (r) => false); ProjectViewModel().isLogin = false;
Navigator.pushAndRemoveUntil(
AppGlobal.CONTEX,
FadePage(
page: Loginsreen(),
),
(r) => false);
} }
navigateToUpdatePage(String message, String androidLink, iosLink) { navigateToUpdatePage(String message, String androidLink, iosLink) {
@ -158,7 +165,7 @@ class Helpers {
iosLink: iosLink, iosLink: iosLink,
), ),
), ),
(r) => false); (r) => false);
} }
static String parseHtmlString(String htmlString) { static String parseHtmlString(String htmlString) {

@ -1303,6 +1303,32 @@ class TranslationBase {
String get severe => localizedValues["severe"][locale.languageCode]; String get severe => localizedValues["severe"][locale.languageCode];
String get graphDetails => String get graphDetails =>
localizedValues["graphDetails"][locale.languageCode]; localizedValues["graphDetails"][locale.languageCode];
String get discharged => localizedValues["discharged"][locale.languageCode];
String get addNewOrderSheet =>
localizedValues["addNewOrderSheet"][locale.languageCode];
String get addNewProgressNote =>
localizedValues["addNewProgressNote"][locale.languageCode];
String get notePending => localizedValues["notePending"][locale.languageCode];
String get noteCanceled =>
localizedValues["noteCanceled"][locale.languageCode];
String get noteVerified =>
localizedValues["noteVerified"][locale.languageCode];
String get noteVerify => localizedValues["noteVerify"][locale.languageCode];
String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode];
String get noteAdd => localizedValues["noteAdd"][locale.languageCode];
String get noteUpdate => localizedValues["noteUpdate"][locale.languageCode];
String get orderSheet => localizedValues["orderSheet"][locale.languageCode];
String get order => localizedValues["order"][locale.languageCode];
String get sheet => localizedValues["sheet"][locale.languageCode];
String get medical => localizedValues["medical"][locale.languageCode];
String get report => localizedValues["report"][locale.languageCode];
String get discharge => localizedValues["discharge"][locale.languageCode];
String get none => localizedValues["none"][locale.languageCode];
String get notRepliedYet =>
localizedValues["notRepliedYet"][locale.languageCode];
String get clearText => localizedValues["clearText"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -32,36 +33,22 @@ class PatientCard extends StatelessWidget {
return Container( return Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
margin: EdgeInsets.all(6), margin: EdgeInsets.all(6),
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), padding: EdgeInsets.only(left: 0, right: 5, bottom: 0, top: 0),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(10),
color: Colors.white, color: Colors.white,
), ),
child: Stack(children: [ child: CardWithBgWidget(
if (!isInpatient&& !isMyPatient && !isFromSearch) padding: 0,
Container( marginLeft: (!isMyPatient && isInpatient)?0:10,
height: 160, marginSymmetric:isFromSearch ? 10 : 0.0,
width: 5, hasBorder: false,
decoration: BoxDecoration( bgColor:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo.patientStatusType == 43
borderRadius: BorderRadius.only( ? Colors.green[500]
topLeft: Radius.circular(10), :isMyPatient? Colors.green[500]:isInpatient?Colors.white:!isFromSearch?Colors.red[800]:Colors.white,
bottomLeft: Radius.circular(10)), widget: Container(
color: patientInfo.patientStatusType == 43 color: Colors.white,
? Colors.green[500] // padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
: Colors.red[800],
)),
if(isMyPatient && !isFromSearch)
Container(
height: 180,
width: 5,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10)),
color: Colors.green[500]
)),
Container(
padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
child: InkWell( child: InkWell(
child: Column( child: Column(
children: [ children: [
@ -82,7 +69,7 @@ class PatientCard extends StatelessWidget {
color: Colors.green, color: Colors.green,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 10,
), ),
SizedBox(width: 8,), SizedBox(width: 8,),
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
@ -92,7 +79,7 @@ class PatientCard extends StatelessWidget {
color: patientInfo.status==2? Colors.green:Colors.grey , color: patientInfo.status==2? Colors.green:Colors.grey ,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 10,
), ),
], ],
) )
@ -103,7 +90,7 @@ class PatientCard extends StatelessWidget {
color: Colors.red[800], color: Colors.red[800],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 10,
), ),
SizedBox(width: 8,), SizedBox(width: 8,),
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
@ -113,7 +100,7 @@ class PatientCard extends StatelessWidget {
color: patientInfo.status==2? Colors.green:Colors.grey , color: patientInfo.status==2? Colors.green:Colors.grey ,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 10,
), ),
], ],
): !isFromSearch && patientInfo.patientStatusType==null ? Row( ): !isFromSearch && patientInfo.patientStatusType==null ? Row(
@ -151,14 +138,15 @@ class PatientCard extends StatelessWidget {
)+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}", )+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 15,
) )
: (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)?
AppText( AppText(
//
// )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)), "${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}",
" ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 15,
):SizedBox() ):SizedBox()
], ],
)) ))
@ -181,29 +169,31 @@ class PatientCard extends StatelessWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row(children: [ Expanded(
Container( child: Row(children: [
width: 170, Expanded(
child: AppText( // width: MediaQuery.of(context).size.width*0.51,
(Helpers.capitalize(patientInfo.firstName) + child: AppText(
" " + (Helpers.capitalize(patientInfo.firstName) +
Helpers.capitalize(patientInfo.lastName)), " " +
fontSize: 16, Helpers.capitalize(patientInfo.lastName)),
fontWeight: FontWeight.bold, fontSize: 16,
fontFamily: 'Poppins', color: Color(0xff2e303a),
textOverflow: TextOverflow.ellipsis, fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
textOverflow: TextOverflow.ellipsis,
),
), ),
), if (patientInfo.gender == 1)
patientInfo.gender == 1 Icon(
? Icon( DoctorApp.male_2,
DoctorApp.male_2, color: Colors.blue,
color: Colors.blue, ) else Icon(
) DoctorApp.female_1,
: Icon( color: Colors.pink,
DoctorApp.female_1, ),
color: Colors.pink, ]),
), ),
]),
Row( Row(
children: [ children: [
AppText( AppText(
@ -280,14 +270,14 @@ class PatientCard extends StatelessWidget {
text: TranslationBase.of(context) text: TranslationBase.of(context)
.fileNumber, .fileNumber,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 12,
fontFamily: 'Poppins')), fontFamily: 'Poppins')),
new TextSpan( new TextSpan(
text: patientInfo.patientId.toString(), text: patientInfo.patientId.toString(),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 15)), fontSize: 13)),
], ],
), ),
), ),
@ -306,13 +296,13 @@ class PatientCard extends StatelessWidget {
text: text:
TranslationBase.of(context).age + TranslationBase.of(context).age +
" : ", " : ",
style: TextStyle(fontSize: 14)), style: TextStyle(fontSize: 12)),
new TextSpan( new TextSpan(
text: text:
"${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15)), fontSize: 13)),
], ],
), ),
), ),
@ -334,28 +324,35 @@ class PatientCard extends StatelessWidget {
: TranslationBase.of(context) : TranslationBase.of(context)
.admissionDate + .admissionDate +
" : ", " : ",
style: TextStyle(fontSize: 14)), style: TextStyle(fontSize: 12)),
new TextSpan( new TextSpan(
text: patientInfo.admissionDate == null text: patientInfo.admissionDate == null
? "" ? ""
: "${DateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", : "${DateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 15)), fontSize: 13)),
]))), ]))),
if (patientInfo.admissionDate != null) if (patientInfo.admissionDate != null)
Row( Container(
children: [ child: RichText(
AppText( text: new TextSpan(
"${TranslationBase.of(context).numOfDays}: ", style: new TextStyle(
fontSize: 15, fontSize:
), 2.0 * SizeConfig.textMultiplier,
AppText( color: Colors.black,
"${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", fontFamily: 'Poppins',
fontSize: 15, ),
fontWeight: FontWeight.w700), children: <TextSpan>[
], new TextSpan(
), text: TranslationBase.of(context).numOfDays + " : ",
style: TextStyle(fontSize: 12)),
new TextSpan(
text: "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
]))),
])) ]))
]), ]),
@ -395,7 +392,7 @@ class PatientCard extends StatelessWidget {
), ),
onTap: onTap, onTap: onTap,
)), )),
])); ));
} }

@ -24,31 +24,33 @@ class PatientProfileButton extends StatelessWidget {
final Function onTap; final Function onTap;
final bool isDischargedPatient; final bool isDischargedPatient;
final bool isSelectInpatient; final bool isSelectInpatient;
PatientProfileButton(
{Key key, PatientProfileButton({
this.patient, Key key,
this.patientType, this.patient,
this.arrivalType, this.patientType,
this.nameLine1, this.arrivalType,
this.nameLine2, this.nameLine1,
this.icon, this.nameLine2,
this.route, this.icon,
this.isDisable = false, this.route,
this.onTap, this.isDisable = false,
this.isLoading = false, this.onTap,
this.from, this.isLoading = false,
this.to, this.from,
this.isInPatient = false, this.isDischargedPatient=false, this.isSelectInpatient = false, this.to,
}) this.isInPatient = false,
: super(key: key); this.isDischargedPatient = false,
this.isSelectInpatient = false,
}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context); ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
return new Container( return Container(
margin: new EdgeInsets.symmetric(horizontal: 4.0), margin: EdgeInsets.symmetric(horizontal: 0.0),
padding: EdgeInsets.fromLTRB(10, 10, 10, 5), padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
child: InkWell( child: InkWell(
onTap: isDisable onTap: isDisable
? null ? null
@ -59,34 +61,38 @@ class PatientProfileButton extends StatelessWidget {
}, },
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Container( Container(
padding: EdgeInsets.fromLTRB(8, 0, 8, 8),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
child: new Image.asset( child: new Image.asset(
url + icon, url + icon,
width: 50, width: 30,
height: 50, height: 30,
),) fit: BoxFit.contain,
], ),
)), )
],
)),
Container( Container(
alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, alignment: projectsProvider.isArabic
padding: EdgeInsets.all(5), ? Alignment.topRight
: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 8),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
this.nameLine1, !projectsProvider.isArabic ? this.nameLine1 : nameLine2,
color: Colors.black, color: Color(0xFF2B353E),
/*Color(0xFFB9382C),*/
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
textAlign: TextAlign.left, textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 1.5, fontSize: SizeConfig.textMultiplier * 1.5,
), ),
AppText( AppText(
this.nameLine2, !projectsProvider.isArabic ? this.nameLine2 : nameLine1,
color: Colors.black, color: Color(0xFF2B353E),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
textAlign: TextAlign.left, textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 1.5, fontSize: SizeConfig.textMultiplier * 1.5,
@ -105,21 +111,12 @@ class PatientProfileButton extends StatelessWidget {
color: Color(0xffBBBBBB), color: Color(0xffBBBBBB),
width: 1, width: 1,
)), )),
/*boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],*/
), ),
); );
} }
void navigator(BuildContext context, route) { void navigator(BuildContext context, route) {
if(route == null) if (route == null) return;
return;
if (from == null) { if (from == null) {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
@ -127,7 +124,7 @@ class PatientProfileButton extends StatelessWidget {
if (to == null) { if (to == null) {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
} }
if(arrivalType == null){ if (arrivalType == null) {
arrivalType = "0"; arrivalType = "0";
} }
Navigator.of(context).pushNamed(route, arguments: { Navigator.of(context).pushNamed(route, arguments: {

@ -303,7 +303,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
"${TranslationBase.of(context).numOfDays}: ", "${TranslationBase.of(context).numOfDays}: ",
fontSize: 15, fontSize: 15,
), ),
if(isDischargedPatient) if(isDischargedPatient && patient.dischargeDate!=null)
AppText( AppText(
"${DateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", "${DateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontSize: 15, fontSize: 15,

@ -52,7 +52,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: MEDICAL_FILE, route: HEALTH_SUMMARY,
nameLine1: "Health" ,//TranslationBase.of(context).medicalReport, nameLine1: "Health" ,//TranslationBase.of(context).medicalReport,
nameLine2: "Summary",//TranslationBase.of(context).summaryReport, nameLine2: "Summary",//TranslationBase.of(context).summaryReport,
icon: 'patient/health_summary.png'), icon: 'patient/health_summary.png'),

@ -113,7 +113,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: MEDICAL_FILE, route: HEALTH_SUMMARY,
nameLine1: "Health", nameLine1: "Health",
//TranslationBase.of(context).medicalReport, //TranslationBase.of(context).medicalReport,
nameLine2: "Summary", nameLine2: "Summary",
@ -125,7 +125,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
isDisable: true, isDisable: true,
route: MEDICAL_FILE, route: HEALTH_SUMMARY,
nameLine1: "Medical", //Health nameLine1: "Medical", //Health
//TranslationBase.of(context).medicalReport, //TranslationBase.of(context).medicalReport,
nameLine2: "Report", //Report nameLine2: "Report", //Report

@ -173,7 +173,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: MEDICAL_FILE, route: HEALTH_SUMMARY,
nameLine1: "Health", nameLine1: "Health",
//TranslationBase.of(context).medicalReport, //TranslationBase.of(context).medicalReport,
nameLine2: "Summary", nameLine2: "Summary",
@ -185,7 +185,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
isDisable: true, isDisable: true,
route: MEDICAL_FILE, route: HEALTH_SUMMARY,
nameLine1: "Medical", //Health nameLine1: "Medical", //Health
//TranslationBase.of(context).medicalReport, //TranslationBase.of(context).medicalReport,
nameLine2: "Report", //Report nameLine2: "Report", //Report
@ -256,7 +256,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
patient: patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
route: MEDICAL_FILE, route: HEALTH_SUMMARY,
nameLine1: nameLine1:
"Health", //TranslationBase.of(context).medicalReport, "Health", //TranslationBase.of(context).medicalReport,
nameLine2: nameLine2:

@ -16,9 +16,6 @@ import 'app_texts_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
// OWNER : Ibrahim albitar
// DATE : 06-04-2020
// DESCRIPTION : Custom App Drawer for app.
class AppDrawer extends StatefulWidget { class AppDrawer extends StatefulWidget {
@override @override
@ -26,7 +23,6 @@ class AppDrawer extends StatefulWidget {
} }
class _AppDrawerState extends State<AppDrawer> { class _AppDrawerState extends State<AppDrawer> {
bool _isInit = true;
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
ProjectViewModel projectsProvider; ProjectViewModel projectsProvider;

@ -49,7 +49,7 @@ class _AppButtonState extends State<AppButton> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
// height: 60,//MediaQuery.of(context).size.height * 0.075, // height: MediaQuery.of(context).size.height * 0.075,
child: IgnorePointer( child: IgnorePointer(
ignoring: widget.loading ||widget.disabled, ignoring: widget.loading ||widget.disabled,
child: RawMaterialButton( child: RawMaterialButton(

@ -3,27 +3,23 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
/*
*@author: Mohammad Aljammal
*@Date:27/4/2020
*@param: Widget
*@return:
*@desc: Card With Bg Widget
*/
class CardWithBgWidget extends StatelessWidget { class CardWithBgWidget extends StatelessWidget {
final Widget widget; final Widget widget;
final Color bgColor; final Color bgColor;
final bool hasBorder; final bool hasBorder;
final double padding;
final double marginLeft;
final double marginSymmetric;
CardWithBgWidget( CardWithBgWidget(
{@required this.widget, this.bgColor, this.hasBorder = true}); {@required this.widget, this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, this.marginSymmetric=10.0});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
return Container( return Container(
margin: EdgeInsets.symmetric(vertical: 10.0), margin: EdgeInsets.symmetric(vertical: marginSymmetric),
// width: double.infinity, // width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
@ -61,15 +57,15 @@ class CardWithBgWidget extends StatelessWidget {
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10), topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10),),), bottomLeft: Radius.circular(10),),),
width: 10, width: 7,
), ),
bottom: 1, bottom: 1,
top: 1, top: 1,
left: 1, left: 1,
), ),
Container( Container(
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(padding),
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: marginLeft),
child: widget) child: widget)
], ],
), ),

@ -5,10 +5,6 @@ import 'package:flutter/material.dart';
import '../shared/app_texts_widget.dart'; import '../shared/app_texts_widget.dart';
// OWNER : Ibrahim albitar
// DATE : 08-04-2020
// DESCRIPTION : Custom Drawer item for app.
class DrawerItem extends StatefulWidget { class DrawerItem extends StatefulWidget {
final String title; final String title;
final String subTitle; final String subTitle;

@ -25,6 +25,7 @@ class AppTextFieldCustom extends StatefulWidget {
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter> inputFormatters;
final Function(String) onChanged; final Function(String) onChanged;
final String validationError; final String validationError;
final bool isPrscription;
AppTextFieldCustom({ AppTextFieldCustom({
this.height = 0, this.height = 0,
@ -37,12 +38,13 @@ class AppTextFieldCustom extends StatefulWidget {
this.suffixIcon, this.suffixIcon,
this.dropDownColor, this.dropDownColor,
this.enabled = true, this.enabled = true,
this.inputType = TextInputType.text, this.inputType,
this.minLines = 1, this.minLines = 1,
this.maxLines = 1, this.maxLines = 1,
this.inputFormatters, this.inputFormatters,
this.onChanged, this.onChanged,
this.validationError, this.validationError,
this.isPrscription = false,
}); });
@override @override
@ -57,7 +59,9 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
return Column( return Column(
children: [ children: [
Container( Container(
height: widget.height != 0 && widget.maxLines == 1 ? widget.height + 8 : null, height: widget.height != 0 && widget.maxLines == 1
? widget.height + 8
: null,
decoration: widget.hasBorder decoration: widget.hasBorder
? TextFieldsUtils.containerBorderDecoration( ? TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0Xffffffff),
@ -87,18 +91,23 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
AppText( AppText(
widget.hintText, widget.hintText,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: SizeConfig.textMultiplier * 1.4, fontSize: widget.isPrscription == false
? SizeConfig.textMultiplier * 1.3
: 0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
widget.dropDownText == null widget.dropDownText == null
? Container( ? Container(
height: widget.height != 0 && widget.maxLines == 1 ? widget.height - 22 : null, height:
child: TextField( widget.height != 0 && widget.maxLines == 1
? widget.height - 22
: null,
child: TextField(
textAlign: projectViewModel.isArabic textAlign: projectViewModel.isArabic
? TextAlign.right ? TextAlign.right
: TextAlign.left, : TextAlign.left,
decoration: decoration: TextFieldsUtils
TextFieldsUtils.textFieldSelectorDecoration( .textFieldSelectorDecoration(
widget.hintText, null, true), widget.hintText, null, true),
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.7, fontSize: SizeConfig.textMultiplier * 1.7,
@ -106,13 +115,17 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
color: Color(0xFF575757), color: Color(0xFF575757),
), ),
controller: widget.controller, controller: widget.controller,
keyboardType: widget.inputType, keyboardType: widget.inputType ??
(widget.maxLines == 1
? TextInputType.text
: TextInputType.multiline),
enabled: widget.enabled, enabled: widget.enabled,
minLines: widget.minLines, minLines: widget.minLines,
maxLines: widget.maxLines, maxLines: widget.maxLines,
inputFormatters: widget.inputFormatters != null inputFormatters:
? widget.inputFormatters widget.inputFormatters != null
: [], ? widget.inputFormatters
: [],
onChanged: (value) { onChanged: (value) {
setState(() {}); setState(() {});
if (widget.onChanged != null) { if (widget.onChanged != null) {
@ -120,7 +133,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
} }
}, },
), ),
) )
: AppText( : AppText(
widget.dropDownText, widget.dropDownText,
fontFamily: 'Poppins', fontFamily: 'Poppins',

@ -445,6 +445,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.11" version: "1.0.11"
flutter_staggered_grid_view:
dependency: "direct main"
description:
name: flutter_staggered_grid_view
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.4"
flutter_svg: flutter_svg:
dependency: transitive dependency: transitive
description: description:

@ -41,6 +41,7 @@ dependencies:
eva_icons_flutter: ^2.0.0 eva_icons_flutter: ^2.0.0
font_awesome_flutter: ^8.11.0 font_awesome_flutter: ^8.11.0
dropdown_search: ^0.4.8 dropdown_search: ^0.4.8
flutter_staggered_grid_view: ^0.3.2
expandable: ^4.1.4 expandable: ^4.1.4

Loading…
Cancel
Save