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

 Conflicts:
	lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart
merge-requests/225/head
Elham Rababah 5 years ago
commit 1cda486268

Binary file not shown.

@ -0,0 +1,7 @@
<svg id="enter" xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 42 42">
<path id="Path_1146" data-name="Path 1146" d="M17.938,210.625H1.313a1.313,1.313,0,1,1,0-2.625H17.938a1.313,1.313,0,1,1,0,2.625Zm0,0" transform="translate(22.749 -190.938)"/>
<path id="Path_1147" data-name="Path 1147" d="M123.984,143.736a1.313,1.313,0,0,1-.928-2.242l5.635-5.635-5.635-5.633a1.313,1.313,0,0,1,1.857-1.857l6.563,6.562a1.313,1.313,0,0,1,0,1.857l-6.562,6.562A1.31,1.31,0,0,1,123.984,143.736Zm0,0" transform="translate(-89.86 -117.486)"/>
<path id="Path_1148" data-name="Path 1148" d="M312.668,42.076a3.5,3.5,0,0,0,3.5-3.5V7.076A3.522,3.522,0,0,0,313.8,3.753L303.284.248a3.537,3.537,0,0,0-4.616,3.329v31.5a3.524,3.524,0,0,0,2.368,3.321L311.553,41.9A3.662,3.662,0,0,0,312.668,42.076ZM302.168,2.7a1.03,1.03,0,0,1,.313.046l10.47,3.491a.9.9,0,0,1,.592.838v31.5a.922.922,0,0,1-1.188.83l-10.47-3.491a.905.905,0,0,1-.591-.838V3.576A.876.876,0,0,1,302.168,2.7Zm0,0" transform="translate(-298.668 -0.076)"/>
<path id="Path_1149" data-name="Path 1149" d="M195.168,8.75a1.313,1.313,0,0,0,1.313-1.312V4.813A4.816,4.816,0,0,0,191.668,0H171.98a1.313,1.313,0,0,0,0,2.625h19.688a2.19,2.19,0,0,1,2.187,2.188V7.438A1.313,1.313,0,0,0,195.168,8.75Zm0,0" transform="translate(-168.48)"/>
<path id="Path_1150" data-name="Path 1150" d="M171.98,350.082h7a4.816,4.816,0,0,0,4.812-4.813v-2.625a1.313,1.313,0,0,0-2.625,0v2.625a2.19,2.19,0,0,1-2.187,2.188h-7a1.313,1.313,0,0,0,0,2.625Zm0,0" transform="translate(-155.793 -313.332)"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -107,6 +107,15 @@ const ARRIVED_PATIENT_URL =
const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave';
const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves'; const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves';
const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave';
const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
const GET_COVERING_DOCTORS =
'Services/DoctorApplication.svc/REST/GetCoveringDoctor';
const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition';
const UPDATE_RESCHDEULE =
'Services/DoctorApplication.svc/REST/PatchRequisition';
const GET_RESCHEDULE_LEAVE =
'Services/DoctorApplication.svc/REST/GetRequisition';
const GET_PRESCRIPTION_LIST = const GET_PRESCRIPTION_LIST =
'Services/DoctorApplication.svc/REST/GetPrescription'; 'Services/DoctorApplication.svc/REST/GetPrescription';
@ -130,13 +139,14 @@ const POST_CHIEF_COMPLAINT =
const POST_PHYSICAL_EXAM = const POST_PHYSICAL_EXAM =
'Services/DoctorApplication.svc/REST/PostPhysicalExam'; 'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE = const POST_PROGRESS_NOTE =
'Services/DoctorApplication.svc/REST/PostProgressNote'; '/Services/DoctorApplication.svc/REST/PostProgressNote';
const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment';
const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies';
const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory';
const PATCH_CHIEF_COMPLAINT = const PATCH_CHIEF_COMPLAINT =
'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint';
const PATCH_PHYSICAL_EXAM = const PATCH_PHYSICAL_EXAM =
'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; 'Services/DoctorApplication.svc/REST/PatchPhysicalExam';
const PATCH_PROGRESS_NOTE = const PATCH_PROGRESS_NOTE =
@ -156,6 +166,7 @@ const GET_CATEGORISE_PROCEDURE =
const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure';
const UPDATE_PRESCRIPTION = const UPDATE_PRESCRIPTION =
'Services/DoctorApplication.svc/REST/PatchPrescription'; 'Services/DoctorApplication.svc/REST/PatchPrescription';
const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList';
const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile';

@ -354,6 +354,14 @@ const Map<String, Map<String, String>> localizedValues = {
'instruction': {'en': 'Instructions', 'ar': 'إرشادات'}, 'instruction': {'en': 'Instructions', 'ar': 'إرشادات'},
'addMedication': {'en': 'ADD MEDICATION', 'ar': 'اضف الدواء'}, 'addMedication': {'en': 'ADD MEDICATION', 'ar': 'اضف الدواء'},
'route': {'en': 'Route', 'ar': 'المسار'}, 'route': {'en': 'Route', 'ar': 'المسار'},
'reschedule-leave': {
'en': 'Reschedule and leaves',
'ar': 'إعادة الجدولة والأوراق'
},
'no-reschedule-leave': {
'en': 'No Reschedule and leaves',
'ar': 'لا إعادة جدولة ويغادر'
},
'weight': {'en': "Weight", 'ar': 'الوزن'}, 'weight': {'en': "Weight", 'ar': 'الوزن'},
'kg': {'en': "kg", 'ar': 'كغ'}, 'kg': {'en': "kg", 'ar': 'كغ'},
'height': {'en': "Height", 'ar': 'الطول'}, 'height': {'en': "Height", 'ar': 'الطول'},
@ -369,66 +377,136 @@ const Map<String, Map<String, String>> localizedValues = {
'rhythm': {'en': "Rhythm", 'ar': 'الإيقاع'}, 'rhythm': {'en': "Rhythm", 'ar': 'الإيقاع'},
'respBeats': {'en': 'RESP (beats/minute)', 'ar': ' (دقة/دقيقة)التنفس'}, 'respBeats': {'en': 'RESP (beats/minute)', 'ar': ' (دقة/دقيقة)التنفس'},
'patternOfRespiration': {'en': "Pattern Of Respiration", 'ar': 'نمط التنفس'}, 'patternOfRespiration': {'en': "Pattern Of Respiration", 'ar': 'نمط التنفس'},
'bloodPressureDiastoleAndSystole': {'en': 'Blood Pressure (Sys, Dias)', 'ar': 'ضغط الدم (العظمى, الصغرى)'}, 'bloodPressureDiastoleAndSystole': {
'en': 'Blood Pressure (Sys, Dias)',
'ar': 'ضغط الدم (العظمى, الصغرى)'
},
'cuffLocation': {'en': "Cuff Location", 'ar': 'موقع الكف'}, 'cuffLocation': {'en': "Cuff Location", 'ar': 'موقع الكف'},
'cuffSize': {'en': "Cuff Size", 'ar': 'حجم الكف'}, 'cuffSize': {'en': "Cuff Size", 'ar': 'حجم الكف'},
'patientPosition': {'en': "Patient Position", 'ar': 'موقع المريض'}, 'patientPosition': {'en': "Patient Position", 'ar': 'موقع المريض'},
'fio2': {'en': "FIO2(%)", 'ar': 'FIO2(%)'}, 'fio2': {'en': "FIO2(%)", 'ar': 'FIO2(%)'},
'sao2': {'en': "SAO2(%)", 'ar': 'SAO2(%)'}, 'sao2': {'en': "SAO2(%)", 'ar': 'SAO2(%)'},
'painManagement': {'en': "Pain Management", 'ar': 'إدارة الألم'}, 'painManagement': {'en': "Pain Management", 'ar': 'إدارة الألم'},
'holiday': {'en': "Holiday", 'ar': 'يوم الاجازة'},
'to': {'en': "To", 'ar': 'إلى'},
'coveringDoctor': {'en': "Covering Doctor", 'ar': 'تغطية دكتور'},
'requestLeave': {'en': 'Request Leave', 'ar': 'طلب إجازة'},
'pleaseEnterDate': {
'en': 'Please enter leave start date',
'ar': 'الرجاء إدخال تاريخ بدء الإجازة'
},
'pleaseEnterNoOfDays': {
'en': 'Please enter sick leave days',
'ar': 'الرجاء إدخال أيام الإجازة المرضية'
},
'pleaseEnterRemarks': {
'en': 'Please enter remarks',
'ar': 'الرجاء إدخال الملاحظات'
},
'update': {'en': 'Update', 'ar': 'تحديث'},
'admission': {'en': "Admission", 'ar': 'قبول'}, 'admission': {'en': "Admission", 'ar': 'قبول'},
'request': {'en': "Request", 'ar': 'طلب'}, 'request': {'en': "Request", 'ar': 'طلب'},
'admissionRequest': {'en': "Admission Request", 'ar': 'طلب قبول'}, 'admissionRequest': {'en': "Admission Request", 'ar': 'طلب قبول'},
'patientDetails': {'en': "Patient Details", 'ar': 'تفاصيل المريض'}, 'patientDetails': {'en': "Patient Details", 'ar': 'تفاصيل المريض'},
'specialityAndDoctorDetail': {'en': "SPECIALITY AND DOCTOR DETAILS", 'ar': 'تفاصيل التخصص والطبيب'}, 'specialityAndDoctorDetail': {
'en': "SPECIALITY AND DOCTOR DETAILS",
'ar': 'تفاصيل التخصص والطبيب'
},
'referringDate': {'en': "Referring Date", 'ar': 'تاريخ الإحالة'}, 'referringDate': {'en': "Referring Date", 'ar': 'تاريخ الإحالة'},
'referringDoctor': {'en': "Referring Doctor", 'ar': 'دكتور الإحالة'}, 'referringDoctor': {'en': "Referring Doctor", 'ar': 'دكتور الإحالة'},
'otherInformation': {'en': "Other Information", 'ar': 'معلومات أخرى'}, 'otherInformation': {'en': "Other Information", 'ar': 'معلومات أخرى'},
'expectedDays': {'en': "Expected Days", 'ar': 'الأيام المتوقعة'}, 'expectedDays': {'en': "Expected Days", 'ar': 'الأيام المتوقعة'},
'expectedAdmissionDate': {'en': "Expected Admission Date", 'ar': 'تاريخ القبول المتوقع'}, 'expectedAdmissionDate': {
'en': "Expected Admission Date",
'ar': 'تاريخ القبول المتوقع'
},
'emergencyAdmission': {'en': "EMERGENCY ADMISSION", 'ar': 'دخول الطوارئ'}, 'emergencyAdmission': {'en': "EMERGENCY ADMISSION", 'ar': 'دخول الطوارئ'},
'patientPregnant': {'en': "Patient Pregnant", 'ar': 'حمل المريض'}, 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'حمل المريض'},
'treatmentLine': {'en': "Main line of treatment", 'ar': 'الخط الرئيسي للعلاج'}, 'treatmentLine': {
'en': "Main line of treatment",
'ar': 'الخط الرئيسي للعلاج'
},
'ward': {'en': "Ward", 'ar': 'رعاية'}, 'ward': {'en': "Ward", 'ar': 'رعاية'},
'preAnesthesiaReferred': {'en': "PRE ANESTHESIA REFERRED", 'ar': 'الاحالة قبل التخدير'}, 'preAnesthesiaReferred': {
'en': "PRE ANESTHESIA REFERRED",
'ar': 'الاحالة قبل التخدير'
},
'admissionType': {'en': "Admission Type", 'ar': 'نوع القبول'}, 'admissionType': {'en': "Admission Type", 'ar': 'نوع القبول'},
'diagnosis': {'en': "Diagnosis", 'ar': 'التشخيص'}, 'diagnosis': {'en': "Diagnosis", 'ar': 'التشخيص'},
'allergies': {'en': "Allergies", 'ar': 'الحساسية'}, 'allergies': {'en': "Allergies", 'ar': 'الحساسية'},
'preOperativeOrders': {'en': "Pre Operative Orders", 'ar': 'أوامر ما قبل العملية'}, 'preOperativeOrders': {
'elementForImprovement': {'en': "Element For Improvement", 'ar': 'عنصر للتحسين'}, 'en': "Pre Operative Orders",
'ar': 'أوامر ما قبل العملية'
},
'elementForImprovement': {
'en': "Element For Improvement",
'ar': 'عنصر للتحسين'
},
'dischargeDate': {'en': "Discharge Date", 'ar': 'تاريخ التفريغ'}, 'dischargeDate': {'en': "Discharge Date", 'ar': 'تاريخ التفريغ'},
'dietType': {'en': "Diet Type", 'ar': 'نوع النظام الغذائي'}, 'dietType': {'en': "Diet Type", 'ar': 'نوع النظام الغذائي'},
'dietTypeRemarks': {'en': "Remarks on diet type", 'ar': 'ملاحظات على نوع النظام الغذائي'}, 'dietTypeRemarks': {
'en': "Remarks on diet type",
'ar': 'ملاحظات على نوع النظام الغذائي'
},
'save': {'en': "SAVE", 'ar': 'حفظ'}, 'save': {'en': "SAVE", 'ar': 'حفظ'},
'postPlansEstimatedCost': {'en': "POST PLANS & ESTIMATED COST", 'ar': 'خطط البريد والتكلفة المقدرة'}, 'postPlansEstimatedCost': {
'en': "POST PLANS & ESTIMATED COST",
'ar': 'خطط البريد والتكلفة المقدرة'
},
'ucaf': {'en': "UCAF", 'ar': 'UCAF'}, 'ucaf': {'en': "UCAF", 'ar': 'UCAF'},
'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'}, 'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'},
'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'}, 'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'},
'chiefComplaintsAndSymptoms': {'en': "CHIEF COMPLAINTS & OTHER SYMPTOMS", 'ar': 'شكاوى الرئيس وأعراض أخرى'}, 'chiefComplaintsAndSymptoms': {
'patientFeelsPainInHisBackAndCough': {'en': "Patient Feels pain in his back and cough", 'ar': 'يشعر المريض بألم في ظهره ويسعل'}, 'en': "CHIEF COMPLAINTS & OTHER SYMPTOMS",
'additionalTextComplaints': {'en': "Additional text to add about Complaints", 'ar': 'نص إضافي لإضافته حول الشكاوى'}, 'ar': 'شكاوى الرئيس وأعراض أخرى'
},
'patientFeelsPainInHisBackAndCough': {
'en': "Patient Feels pain in his back and cough",
'ar': 'يشعر المريض بألم في ظهره ويسعل'
},
'additionalTextComplaints': {
'en': "Additional text to add about Complaints",
'ar': 'نص إضافي لإضافته حول الشكاوى'
},
'otherConditions': {'en': "OTHER CONDITIONS", 'ar': 'شروط أخرى'}, 'otherConditions': {'en': "OTHER CONDITIONS", 'ar': 'شروط أخرى'},
'other': {'en': "Other", 'ar': 'أخرى'}, 'other': {'en': "Other", 'ar': 'أخرى'},
'how': {'en': "How", 'ar': 'كيف'}, 'how': {'en': "How", 'ar': 'كيف'},
'when': {'en': "When", 'ar': 'متى'}, 'when': {'en': "When", 'ar': 'متى'},
'where': {'en': "Where", 'ar': 'أين'}, 'where': {'en': "Where", 'ar': 'أين'},
'specifyPossibleLineManagement': {'en': "Specify possible line of management", 'ar': 'حدد خط الإدارة المحتمل'}, 'specifyPossibleLineManagement': {
'en': "Specify possible line of management",
'ar': 'حدد خط الإدارة المحتمل'
},
'significantSigns': {'en': "SIGNIFICANT SIGNS", 'ar': 'علامات مهمة'}, 'significantSigns': {'en': "SIGNIFICANT SIGNS", 'ar': 'علامات مهمة'},
'backAbdomen': {'en': "Back : Abdomen", 'ar': 'الظهر: البطن'}, 'backAbdomen': {'en': "Back : Abdomen", 'ar': 'الظهر: البطن'},
'reasons': {'en': "Reasons", 'ar': 'الأسباب'},
'createNew': {'en': "Create New", 'ar': 'انشاء '}, 'createNew': {'en': "Create New", 'ar': 'انشاء '},
'episode': {'en': "Episode", 'ar': 'Episode'}, 'episode': {'en': "Episode", 'ar': 'Episode'},
'update': {'en': "Update", 'ar': 'تعديل'},
'chiefComplaints': {'en': "Chief Complaints", 'ar': 'الشكاوى'}, 'chiefComplaints': {'en': "Chief Complaints", 'ar': 'الشكاوى'},
'addChiefComplaints': {'en': "Add Chief Complaints", 'ar': ' اضافه الشكاوى'}, 'addChiefComplaints': {'en': "Add Chief Complaints", 'ar': ' اضافه الشكاوى'},
'histories': {'en': "Histories", 'ar': 'التاريخ المرضي'}, 'histories': {'en': "Histories", 'ar': 'التاريخ المرضي'},
'allergiesSoap': {'en': "Allergies", 'ar': 'الحساسية'}, 'allergiesSoap': {'en': "Allergies", 'ar': 'الحساسية'},
'historyOfPresentIllness': {'en': "History of Present Illness", 'ar': 'تاريخ المرض الحالي'}, 'historyOfPresentIllness': {
'requiredMsg': {'en': "Please add required field correctly", 'ar':"الرجاء إضافة الحقل المطلوب بشكل صحيح" }, 'en': "History of Present Illness",
'addHistory': {'en': "Add History", 'ar':"اضافه تاريخ مرضي" }, 'ar': 'تاريخ المرض الحالي'
'searchHistory': {'en': "Search History", 'ar':" البحث" }, },
'addSelectedHistories': {'en': "add selected histories", 'ar':" اضافه تاريخ مرضي" }, 'requiredMsg': {
'addAllergies': {'en': "Add Allergies", 'ar':"أضف الحساسية" }, 'en': "Please add required field correctly",
'itemExist': {'en': "This item already exist", 'ar':"هذا العنصر موجود" }, 'ar': "الرجاء إضافة الحقل المطلوب بشكل صحيح"
'selectAllergy': {'en': "Select Allergy", 'ar':"أختر الحساسية" }, },
'selectSeverity': {'en': "Select Severity", 'ar':"أختر الدرجه" }, 'addHistory': {'en': "Add History", 'ar': "اضافه تاريخ مرضي"},
'searchHistory': {'en': "Search History", 'ar': " البحث"},
'addSelectedHistories': {
'en': "add selected histories",
'ar': " اضافه تاريخ مرضي"
},
'addAllergies': {'en': "Add Allergies", 'ar': "أضف الحساسية"},
'itemExist': {'en': "This item already exist", 'ar': "هذا العنصر موجود"},
'selectAllergy': {'en': "Select Allergy", 'ar': "أختر الحساسية"},
'selectSeverity': {'en': "Select Severity", 'ar': "أختر الدرجه"},
'medications': {'en': "Medications", 'ar':"الأدوية" },
'procedures': {'en': "Procedures", 'ar':"الإجراءات" },
'vitalSignEmptyMsg': {'en': "There is no vital signs for this patient", 'ar':"لا توجد علامات حيوية لهذا المريض" },
'referralEmptyMsg': {'en': "There is no referral data", 'ar':"لا توجد بيانات إحالة" },
'referralSuccessMsg': {'en': "You make referral successfully", 'ar':"You make referral successfully" },
}; };

@ -1,7 +1,7 @@
class MedicalFileModel { class MedicalFileModel {
List<EntityList> entityList; List<EntityList> entityList;
int rowcount; int rowcount;
dynamic statusMessage; Null statusMessage;
MedicalFileModel({this.entityList, this.rowcount, this.statusMessage}); MedicalFileModel({this.entityList, this.rowcount, this.statusMessage});
@ -190,12 +190,12 @@ class LstDischargeDiag {
projectName = json['ProjectName']; projectName = json['ProjectName'];
remarks = json['Remarks']; remarks = json['Remarks'];
setupID = json['SetupID']; setupID = json['SetupID'];
// if (json['TimeLineEvents'] != null) { if (json['TimeLineEvents'] != null) {
// timeLineEvents = new List<TimeLineEvents>(); timeLineEvents = new List<TimeLineEvents>();
// json['TimeLineEvents'].forEach((v) { json['TimeLineEvents'].forEach((v) {
// timeLineEvents.add(new TimeLineEvents.fromJson(v)); timeLineEvents.add(new TimeLineEvents.fromJson(v));
// }); });
// } }
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -246,49 +246,49 @@ class TimeLineEvents {
this.radReports, this.radReports,
this.toolTip}); this.toolTip});
// TimeLineEvents.fromJson(Map<String, dynamic> json) { TimeLineEvents.fromJson(Map<String, dynamic> json) {
// if (json['Admissions'] != null) { // if (json['Admissions'] != null) {
// admissions = new List<Null>(); // admissions = new List<Null>();
// json['Admissions'].forEach((v) { // json['Admissions'].forEach((v) {
// admissions.add(new Null.fromJson(v)); // admissions.add(new Null.fromJson(v));
// }); // });
// } // }
// colorClass = json['ColorClass']; // colorClass = json['ColorClass'];
// if (json['Consulations'] != null) { // if (json['Consulations'] != null) {
// consulations = new List<Null>(); // consulations = new List<Null>();
// json['Consulations'].forEach((v) { // json['Consulations'].forEach((v) {
// consulations.add(new Null.fromJson(v)); // consulations.add(new Null.fromJson(v));
// }); // });
// } // }
// disPlayName = json['DisPlayName']; disPlayName = json['DisPlayName'];
// doctorName = json['DoctorName']; doctorName = json['DoctorName'];
// eRData = eRData =
// json['ERData'] != null ? new ERData.fromJson(json['ERData']) : null; json['ERData'] != null ? new ERData.fromJson(json['ERData']) : null;
// eventId = json['EventId']; eventId = json['EventId'];
// fullName = json['FullName']; fullName = json['FullName'];
// iconClass = json['IconClass']; iconClass = json['IconClass'];
// isDisabled = json['IsDisabled']; isDisabled = json['IsDisabled'];
// if (json['LabOrders'] != null) { // if (json['LabOrders'] != null) {
// labOrders = new List<Null>(); // labOrders = new List<Null>();
// json['LabOrders'].forEach((v) { // json['LabOrders'].forEach((v) {
// labOrders.add(new Null.fromJson(v)); // labOrders.add(new Null.fromJson(v));
// }); // });
// } // }
// if (json['RadReports'] != null) { // if (json['RadReports'] != null) {
// radReports = new List<Null>(); // radReports = new List<Null>();
// json['RadReports'].forEach((v) { // json['RadReports'].forEach((v) {
// radReports.add(new Null.fromJson(v)); // radReports.add(new Null.fromJson(v));
// }); // });
// } // }
// toolTip = json['ToolTip']; toolTip = json['ToolTip'];
// } }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
// if (this.admissions != null) { // if (this.admissions != null) {
// data['Admissions'] = this.admissions.map((v) => v.toJson()).toList(); // data['Admissions'] = this.admissions.map((v) => v.toJson()).toList();
// } // }
data['ColorClass'] = this.colorClass; // data['ColorClass'] = this.colorClass;
// if (this.consulations != null) { // if (this.consulations != null) {
// data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); // data['Consulations'] = this.consulations.map((v) => v.toJson()).toList();
// } // }
@ -326,38 +326,38 @@ class ERData {
this.radReports, this.radReports,
this.lstErDischargeSummary}); this.lstErDischargeSummary});
// ERData.fromJson(Map<String, dynamic> json) { ERData.fromJson(Map<String, dynamic> json) {
// if (json['Admissions'] != null) { // if (json['Admissions'] != null) {
// admissions = new List<Null>(); // admissions = new List<Null>();
// json['Admissions'].forEach((v) { // json['Admissions'].forEach((v) {
// admissions.add(new Null.fromJson(v)); // admissions.add(new Null.fromJson(v));
// }); // });
// } // }
// if (json['Consulations'] != null) { // if (json['Consulations'] != null) {
// consulations = new List<Null>(); // consulations = new List<Null>();
// json['Consulations'].forEach((v) { // json['Consulations'].forEach((v) {
// consulations.add(new Null.fromJson(v)); // consulations.add(new Null.fromJson(v));
// }); // });
// } // }
// if (json['LabOrders'] != null) { // if (json['LabOrders'] != null) {
// labOrders = new List<Null>(); // labOrders = new List<Null>();
// json['LabOrders'].forEach((v) { // json['LabOrders'].forEach((v) {
// labOrders.add(new Null.fromJson(v)); // labOrders.add(new Null.fromJson(v));
// }); // });
// } // }
// if (json['RadReports'] != null) { // if (json['RadReports'] != null) {
// radReports = new List<Null>(); // radReports = new List<Null>();
// json['RadReports'].forEach((v) { // json['RadReports'].forEach((v) {
// radReports.add(new Null.fromJson(v)); // radReports.add(new Null.fromJson(v));
// }); // });
// } // }
// if (json['lstErDischargeSummary'] != null) { // if (json['lstErDischargeSummary'] != null) {
// lstErDischargeSummary = new List<Null>(); // lstErDischargeSummary = new List<Null>();
// json['lstErDischargeSummary'].forEach((v) { // json['lstErDischargeSummary'].forEach((v) {
// lstErDischargeSummary.add(new Null.fromJson(v)); // lstErDischargeSummary.add(new Null.fromJson(v));
// }); // });
// } // }
// } }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
@ -827,6 +827,7 @@ class DoctorWisePatientEpisodes {
String setupID; String setupID;
int doctorID; int doctorID;
String doctorName; String doctorName;
List<LstEpisodes> lstEpisodes;
DoctorWisePatientEpisodes( DoctorWisePatientEpisodes(
{this.clinicName, {this.clinicName,
@ -835,7 +836,8 @@ class DoctorWisePatientEpisodes {
this.projectName, this.projectName,
this.setupID, this.setupID,
this.doctorID, this.doctorID,
this.doctorName}); this.doctorName,
this.lstEpisodes});
DoctorWisePatientEpisodes.fromJson(Map<String, dynamic> json) { DoctorWisePatientEpisodes.fromJson(Map<String, dynamic> json) {
clinicName = json['ClinicName']; clinicName = json['ClinicName'];
@ -845,6 +847,12 @@ class DoctorWisePatientEpisodes {
setupID = json['SetupID']; setupID = json['SetupID'];
doctorID = json['doctorID']; doctorID = json['doctorID'];
doctorName = json['doctorName']; doctorName = json['doctorName'];
if (json['lstEpisodes'] != null) {
lstEpisodes = new List<LstEpisodes>();
json['lstEpisodes'].forEach((v) {
lstEpisodes.add(new LstEpisodes.fromJson(v));
});
}
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -856,6 +864,256 @@ class DoctorWisePatientEpisodes {
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['doctorID'] = this.doctorID; data['doctorID'] = this.doctorID;
data['doctorName'] = this.doctorName; data['doctorName'] = this.doctorName;
if (this.lstEpisodes != null) {
data['lstEpisodes'] = this.lstEpisodes.map((v) => v.toJson()).toList();
}
return data;
}
}
class LstEpisodes {
int admissionNo;
String appointmentDate;
int appointmentNo;
String appointmentType;
String clinicID;
String clinicName;
int doctorID;
String doctorName;
String endTime;
String episodeDate;
int episodeID;
int patientID;
int projectID;
String projectName;
String remarks;
String setupID;
String startTime;
String visitFor;
String visitType;
String dispalyName;
List<LstAssessments> lstAssessments;
List<LstPhysicalExam> lstPhysicalExam;
LstEpisodes(
{this.admissionNo,
this.appointmentDate,
this.appointmentNo,
this.appointmentType,
this.clinicID,
this.clinicName,
this.doctorID,
this.doctorName,
this.endTime,
this.episodeDate,
this.episodeID,
this.patientID,
this.projectID,
this.projectName,
this.remarks,
this.setupID,
this.startTime,
this.visitFor,
this.visitType,
this.dispalyName,
this.lstAssessments,
this.lstPhysicalExam});
LstEpisodes.fromJson(Map<String, dynamic> json) {
admissionNo = json['AdmissionNo'];
appointmentDate = json['AppointmentDate'];
appointmentNo = json['AppointmentNo'];
appointmentType = json['AppointmentType'];
clinicID = json['ClinicID'];
clinicName = json['ClinicName'];
doctorID = json['DoctorID'];
doctorName = json['DoctorName'];
endTime = json['EndTime'];
episodeDate = json['EpisodeDate'];
episodeID = json['EpisodeID'];
patientID = json['PatientID'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
remarks = json['Remarks'];
setupID = json['SetupID'];
startTime = json['StartTime'];
visitFor = json['VisitFor'];
visitType = json['VisitType'];
dispalyName = json['dispalyName'];
if (json['lstAssessments'] != null) {
lstAssessments = new List<LstAssessments>();
json['lstAssessments'].forEach((v) {
lstAssessments.add(new LstAssessments.fromJson(v));
});
}
if (json['lstPhysicalExam'] != null) {
lstPhysicalExam = new List<LstPhysicalExam>();
json['lstPhysicalExam'].forEach((v) {
lstPhysicalExam.add(new LstPhysicalExam.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AdmissionNo'] = this.admissionNo;
data['AppointmentDate'] = this.appointmentDate;
data['AppointmentNo'] = this.appointmentNo;
data['AppointmentType'] = this.appointmentType;
data['ClinicID'] = this.clinicID;
data['ClinicName'] = this.clinicName;
data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName;
data['EndTime'] = this.endTime;
data['EpisodeDate'] = this.episodeDate;
data['EpisodeID'] = this.episodeID;
data['PatientID'] = this.patientID;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['Remarks'] = this.remarks;
data['SetupID'] = this.setupID;
data['StartTime'] = this.startTime;
data['VisitFor'] = this.visitFor;
data['VisitType'] = this.visitType;
data['dispalyName'] = this.dispalyName;
if (this.lstAssessments != null) {
data['lstAssessments'] =
this.lstAssessments.map((v) => v.toJson()).toList();
}
if (this.lstPhysicalExam != null) {
data['lstPhysicalExam'] =
this.lstPhysicalExam.map((v) => v.toJson()).toList();
}
return data;
}
}
class LstAssessments {
int appointmentNo;
String condition;
String description;
int episodeID;
String iCD10;
int patientID;
String patientType;
int projectID;
String projectName;
String remarks;
String setupID;
String type;
String dispalyName;
LstAssessments(
{this.appointmentNo,
this.condition,
this.description,
this.episodeID,
this.iCD10,
this.patientID,
this.patientType,
this.projectID,
this.projectName,
this.remarks,
this.setupID,
this.type,
this.dispalyName});
LstAssessments.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo'];
condition = json['Condition'];
description = json['Description'];
episodeID = json['EpisodeID'];
iCD10 = json['ICD10'];
patientID = json['PatientID'];
patientType = json['PatientType'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
remarks = json['Remarks'];
setupID = json['SetupID'];
type = json['Type'];
dispalyName = json['dispalyName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AppointmentNo'] = this.appointmentNo;
data['Condition'] = this.condition;
data['Description'] = this.description;
data['EpisodeID'] = this.episodeID;
data['ICD10'] = this.iCD10;
data['PatientID'] = this.patientID;
data['PatientType'] = this.patientType;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['Remarks'] = this.remarks;
data['SetupID'] = this.setupID;
data['Type'] = this.type;
data['dispalyName'] = this.dispalyName;
return data;
}
}
class LstPhysicalExam {
String abnormal;
int appointmentNo;
int episodeID;
String examDesc;
String examID;
String examType;
int patientID;
String patientType;
int projectID;
String projectName;
String remarks;
String setupID;
String dispalyName;
LstPhysicalExam(
{this.abnormal,
this.appointmentNo,
this.episodeID,
this.examDesc,
this.examID,
this.examType,
this.patientID,
this.patientType,
this.projectID,
this.projectName,
this.remarks,
this.setupID,
this.dispalyName});
LstPhysicalExam.fromJson(Map<String, dynamic> json) {
abnormal = json['Abnormal'];
appointmentNo = json['AppointmentNo'];
episodeID = json['EpisodeID'];
examDesc = json['ExamDesc'];
examID = json['ExamID'];
examType = json['ExamType'];
patientID = json['PatientID'];
patientType = json['PatientType'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
remarks = json['Remarks'];
setupID = json['SetupID'];
dispalyName = json['dispalyName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Abnormal'] = this.abnormal;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeID;
data['ExamDesc'] = this.examDesc;
data['ExamID'] = this.examID;
data['ExamType'] = this.examType;
data['PatientID'] = this.patientID;
data['PatientType'] = this.patientType;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['Remarks'] = this.remarks;
data['SetupID'] = this.setupID;
data['dispalyName'] = this.dispalyName;
return data; return data;
} }
} }

@ -34,7 +34,7 @@ class EntityList {
String genderValidation; String genderValidation;
String group; String group;
String orderedValidation; String orderedValidation;
int price; dynamic price;
String procedureId; String procedureId;
String procedureName; String procedureName;
String specialPermission; String specialPermission;

@ -0,0 +1,65 @@
class SearchDrugModel {
List<EntityList> entityList;
int rowcount;
dynamic statusMessage;
SearchDrugModel({this.entityList, this.rowcount, this.statusMessage});
SearchDrugModel.fromJson(Map<String, dynamic> json) {
if (json['entityList'] != null) {
entityList = new List<EntityList>();
json['entityList'].forEach((v) {
entityList.add(new EntityList.fromJson(v));
});
}
rowcount = json['rowcount'];
statusMessage = json['statusMessage'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.entityList != null) {
data['entityList'] = this.entityList.map((v) => v.toJson()).toList();
}
data['rowcount'] = this.rowcount;
data['statusMessage'] = this.statusMessage;
return data;
}
}
class EntityList {
dynamic description;
dynamic genericName;
dynamic itemId;
dynamic keywords;
dynamic price;
dynamic quantity;
EntityList(
{this.description,
this.genericName,
this.itemId,
this.keywords,
this.price,
this.quantity});
EntityList.fromJson(Map<String, dynamic> json) {
description = json['Description'];
genericName = json['GenericName'];
itemId = json['ItemId'];
keywords = json['Keywords'];
price = json['Price'];
quantity = json['Quantity'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Description'] = this.description;
data['GenericName'] = this.genericName;
data['ItemId'] = this.itemId;
data['Keywords'] = this.keywords;
data['Price'] = this.price;
data['Quantity'] = this.quantity;
return data;
}
}

@ -0,0 +1,18 @@
class SearchDrugRequestModel {
List<String> search;
String vidaAuthTokenID;
SearchDrugRequestModel({this.search, this.vidaAuthTokenID});
SearchDrugRequestModel.fromJson(Map<String, dynamic> json) {
search = json['Search'].cast<String>();
vidaAuthTokenID = json['VidaAuthTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Search'] = this.search;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
return data;
}
}

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_reque
import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart'; import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart';
import 'base/lookup-service.dart'; import 'base/lookup-service.dart';
@ -188,7 +189,7 @@ class PatientReferralService extends LookupService {
} }
Future makeReferral( Future makeReferral(
PatientArrivalEntity patientArrivalEntity, PatiantInformtion patient,
String isoStringDate, String isoStringDate,
int projectID, int projectID,
int clinicID, int clinicID,
@ -203,8 +204,8 @@ class PatientReferralService extends LookupService {
.add({"goalId": element.id, "remarks": element.remarks}); .add({"goalId": element.id, "remarks": element.remarks});
}); });
body['PatientMRN'] = patientArrivalEntity.patientMRN; body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patientArrivalEntity.appointmentNo; body['AppointmentNo'] = patient.appointmentNo;
body['SetupID'] = setupID; body['SetupID'] = setupID;
body['appointmentDate'] = isoStringDate; body['appointmentDate'] = isoStringDate;
body['SlotStart'] = isoStringDate; body['SlotStart'] = isoStringDate;

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart'; import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart';
@ -46,18 +47,18 @@ class VitalSignsService extends BaseService{
); );
} // Vit*/ } // Vit*/
Future getPatientVitalSign(PatientArrivalEntity patientArrivalEntity) async { Future getPatientVitalSign(PatiantInformtion patient) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = patientArrivalEntity.patientMRN; body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patientArrivalEntity.appointmentNo; body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = patientArrivalEntity.episodeNo; body['EpisodeID'] = patient.episodeNo;
await baseAppClient.post( await baseAppClient.post(
GET_PATIENT_VITAL_SIGN_DATA, GET_PATIENT_VITAL_SIGN_DATA,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
if(response['VitalSignsList'] != null){ if(response['VitalSignsList'] != null){
if(response['VitalSignsList']['entityList'] = null && (response['VitalSignsList']['entityList'] as List).length > 0){ if(response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0){
patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList']['0']); patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList']['0']);
} }
} }

@ -2,17 +2,26 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart';
import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/model/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class PrescriptionService extends BaseService { class PrescriptionService extends BaseService {
List<PrescriptionModel> _prescriptionList = List(); List<PrescriptionModel> _prescriptionList = List();
List<PrescriptionModel> get prescriptionList => _prescriptionList; List<PrescriptionModel> get prescriptionList => _prescriptionList;
List<SearchDrugModel> _drugsList = List();
List<SearchDrugModel> get drugsList => _drugsList;
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel( PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(
patientMRN: 3120877, patientMRN: 3120877,
vidaAuthTokenID: vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiNzNiNmUyZDctMjA0ZC00NzAyLTkxMDYtODE3MzI3OTZkYzI5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NjIwOSIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNRURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFUT1JTIiwiTEFCIEFETUlOSVNUUkFUT1IiLCJMQUIgVEVDSE5JQ0lBTiIsIkJVU0lORVNTIE9GRklDRSBTVEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgyMzY2MjAsImV4cCI6MTYwOTEwMDYyMCwiaWF0IjoxNjA4MjM2NjIwfQ.z4Lh0dCRr9GWXvaTo7x5GPV7R5z8ONyh3-0uk3PXMu8", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiNzNiNmUyZDctMjA0ZC00NzAyLTkxMDYtODE3MzI3OTZkYzI5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NjIwOSIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNRURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFUT1JTIiwiTEFCIEFETUlOSVNUUkFUT1IiLCJMQUIgVEVDSE5JQ0lBTiIsIkJVU0lORVNTIE9GRklDRSBTVEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgyMzY2MjAsImV4cCI6MTYwOTEwMDYyMCwiaWF0IjoxNjA4MjM2NjIwfQ.z4Lh0dCRr9GWXvaTo7x5GPV7R5z8ONyh3-0uk3PXMu8",
); );
SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel(
search: ["panadol"],
vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio",
);
PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel _postPrescriptionReqModel =
PostPrescriptionReqModel(); PostPrescriptionReqModel();
@ -30,6 +39,18 @@ class PrescriptionService extends BaseService {
}, body: _prescriptionReqModel.toJson()); }, body: _prescriptionReqModel.toJson());
} }
Future getDrugs() async {
hasError = false;
_drugsList.clear();
await baseAppClient.post(SEARCH_DRUG,
onSuccess: (dynamic response, int statusCode) {
_drugsList.add(SearchDrugModel.fromJson(response['MedicationList']));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _drugRequestModel.toJson());
}
Future postPrescription( Future postPrescription(
PostPrescriptionReqModel postProcedureReqModel) async { PostPrescriptionReqModel postProcedureReqModel) async {
hasError = false; hasError = false;

@ -14,10 +14,10 @@ class ProcedureService extends BaseService {
List<Procedures> procedureslist = List(); List<Procedures> procedureslist = List();
GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel(
clinicId: 0, clinicId: 17,
pageSize: 10, pageSize: 10,
pageIndex: 1, pageIndex: 1,
patientMRN: 0, patientMRN: 3120725,
//categoryId: null, //categoryId: null,
vidaAuthTokenID: vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI",

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart';
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
@ -8,9 +9,18 @@ import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.d
class SickLeaveService extends BaseService { class SickLeaveService extends BaseService {
Map get sickLeavestatisitics => _statistics; Map get sickLeavestatisitics => _statistics;
Map _statistics = {}; Map _statistics = {};
List get getOffTimeList => offTime;
List offTime = [];
List get getReasons => reasonse;
List reasonse = [];
List<GetAllSickLeaveResponse> get getAllSickLeave => _getAllsickLeave; List<GetAllSickLeaveResponse> get getAllSickLeave => _getAllsickLeave;
List<GetAllSickLeaveResponse> _getAllsickLeave = []; List<GetAllSickLeaveResponse> _getAllsickLeave = [];
List get coveringDoctorsList => _coveringDoctors;
List _coveringDoctors = [];
List<GetRescheduleLeavesResponse> get getAllRescheduleLeave =>
_getReScheduleLeave;
List<GetRescheduleLeavesResponse> _getReScheduleLeave = [];
Future getStatistics(appoNo, patientMRN) async { Future getStatistics(appoNo, patientMRN) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
@ -29,14 +39,14 @@ class SickLeaveService extends BaseService {
} }
Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async {
addSickLeaveRequest.appointmentNo = '2016054661'; // addSickLeaveRequest.appointmentNo = '2016054661';
addSickLeaveRequest.patientMRN = '3120746'; // addSickLeaveRequest.patientMRN = '3120746';
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
ADD_SICK_LEAVE, ADD_SICK_LEAVE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
Future.value(response); Future.value(response);
print(response); //print(response);
// _statistics = {}; // _statistics = {};
// _statistics = response['SickLeaveStatistics']; // _statistics = response['SickLeaveStatistics'];
}, },
@ -72,7 +82,7 @@ class SickLeaveService extends BaseService {
); );
} }
Future getSickLeave() async { Future getSickLeave(patientMRN) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
GET_SICK_LEAVE, GET_SICK_LEAVE,
@ -87,7 +97,109 @@ class SickLeaveService extends BaseService {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, },
body: {'PatientMRN': 3120772}, body: {'PatientMRN': patientMRN},
);
}
Future getRescheduleLeave() async {
hasError = false;
await baseAppClient.post(
GET_RESCHEDULE_LEAVE,
onSuccess: (dynamic response, int statusCode) {
Future.value(response);
_getReScheduleLeave.clear();
response['requisitionList']['entityList'].forEach((v) {
_getReScheduleLeave.add(GetRescheduleLeavesResponse.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {'ClinicID': 1},
);
}
Future getOffTime() async {
hasError = false;
await baseAppClient.post(
GET_OFFTIME,
onSuccess: (dynamic response, int statusCode) {
offTime = [];
offTime = response['MasterLookUpList']['entityList'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {"MasterInput": 2013},
);
}
Future getReasonsByID({id}) async {
hasError = false;
await baseAppClient.post(
GET_OFFTIME,
onSuccess: (dynamic response, int statusCode) {
reasonse = [];
reasonse = response['MasterLookUpList']['entityList'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {"MasterInput": id ?? 18},
);
}
Future getCoveringDoctors() async {
hasError = false;
await baseAppClient.post(
GET_COVERING_DOCTORS,
onSuccess: (dynamic response, int statusCode) {
_coveringDoctors = [];
_coveringDoctors = response['coveringDoctorList']['entityList'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {"ClinicID": 1},
);
}
addReschedule(request) async {
hasError = false;
await baseAppClient.post(
ADD_RESCHDEULE,
onSuccess: (dynamic response, int statusCode) {
Future.value(response);
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: request,
);
}
updateReschedule(request) async {
hasError = false;
await baseAppClient.post(
UPDATE_RESCHDEULE,
onSuccess: (dynamic response, int statusCode) {
Future.value(response);
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: request,
); );
} }
} }

@ -0,0 +1,52 @@
class GetRescheduleLeavesResponse {
int clinicId;
var coveringDoctorId;
String date;
String dateTimeFrom;
String dateTimeTo;
int doctorId;
int reasonId;
int requisitionNo;
int requisitionType;
int status;
GetRescheduleLeavesResponse(
{this.clinicId,
this.coveringDoctorId,
this.date,
this.dateTimeFrom,
this.dateTimeTo,
this.doctorId,
this.reasonId,
this.requisitionNo,
this.requisitionType,
this.status});
GetRescheduleLeavesResponse.fromJson(Map<String, dynamic> json) {
clinicId = json['clinicId'];
coveringDoctorId = json['coveringDoctorId'];
date = json['date'];
dateTimeFrom = json['dateTimeFrom'];
dateTimeTo = json['dateTimeTo'];
doctorId = json['doctorId'];
reasonId = json['reasonId'];
requisitionNo = json['requisitionNo'];
requisitionType = json['requisitionType'];
status = json['status'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['clinicId'] = this.clinicId;
data['coveringDoctorId'] = this.coveringDoctorId;
data['date'] = this.date;
data['dateTimeFrom'] = this.dateTimeFrom;
data['dateTimeTo'] = this.dateTimeTo;
data['doctorId'] = this.doctorId;
data['reasonId'] = this.reasonId;
data['requisitionNo'] = this.requisitionNo;
data['requisitionType'] = this.requisitionType;
data['status'] = this.status;
return data;
}
}

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart'; import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import '../../locator.dart'; import '../../locator.dart';
@ -40,7 +41,7 @@ class PatientReferralViewModel extends BaseViewModel {
} }
Future getBranches() async { Future getBranches() async {
setState(ViewState.Busy); setState(ViewState.BusyLocal);
await _referralPatientService.getProjectsList(); await _referralPatientService.getProjectsList();
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
@ -51,7 +52,7 @@ class PatientReferralViewModel extends BaseViewModel {
} }
Future getClinics(int projectId) async { Future getClinics(int projectId) async {
setState(ViewState.Busy); setState(ViewState.BusyLocal);
await _referralPatientService.getClinicsList(projectId); await _referralPatientService.getClinicsList(projectId);
await _referralPatientService.getProjectInfo(projectId); await _referralPatientService.getProjectInfo(projectId);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
@ -62,7 +63,7 @@ class PatientReferralViewModel extends BaseViewModel {
} }
Future getClinicDoctors(String clinicId) async { Future getClinicDoctors(String clinicId) async {
setState(ViewState.Busy); setState(ViewState.BusyLocal);
await _referralPatientService.getDoctorsList(clinicId); await _referralPatientService.getDoctorsList(clinicId);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
@ -117,35 +118,14 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getPatientArrivalList(String date) async { Future makeReferral(PatiantInformtion patient,
setState(ViewState.Busy);
await _referralPatientService.getPatientArrivalList(date);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
List<dynamic> getAppointmentsByPatientName(String patientName) {
List<dynamic> appointments = [];
patientArrivalList.forEach((element) {
if (element.patientName == patientName) {
appointments.add(element.toJson());
}
});
return appointments;
}
Future makeReferral(PatientArrivalEntity patientArrivalEntity,
String isoStringDate, String isoStringDate,
int projectID, int projectID,
int clinicID, int clinicID,
int doctorID, int doctorID,
String remarks) async { String remarks) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _referralPatientService.makeReferral(patientArrivalEntity, isoStringDate, projectID, clinicID, doctorID, remarks); await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -16,17 +16,17 @@ class VitalSignsViewModel extends BaseViewModel {
VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns;
Future getPatientArrivalList(String date, PatiantInformtion patient, /*Future getPatientArrivalList(String date, PatiantInformtion patient,
{String fromDate}) async { {String fromDate}) async {
// TODO when arrival list work un comment below lines // TODO when arrival list work un comment below lines
/* setState(ViewState.Busy); *//* setState(ViewState.Busy);
await _vitalSignService.getPatientArrivalList(date, fromDate: fromDate); await _vitalSignService.getPatientArrivalList(date, fromDate: fromDate);
if (_vitalSignService.hasError) { if (_vitalSignService.hasError) {
error = _vitalSignService.error; error = _vitalSignService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
await getPatientVitalSign(patient); await getPatientVitalSign(patient);
}*/ }*//*
makeVitalSignDemoData(); makeVitalSignDemoData();
} }
@ -43,27 +43,18 @@ class VitalSignsViewModel extends BaseViewModel {
// print("patient index: $index"); // print("patient index: $index");
} }
return null; return null;
} }*/
Future getPatientVitalSign(PatiantInformtion patient) async { Future getPatientVitalSign(PatiantInformtion patient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
PatientArrivalEntity patientArrivalEntity = await _vitalSignService.getPatientVitalSign(patient);
getPatientAppointmentEntity(patient); if (_vitalSignService.hasError) {
if (patientArrivalEntity == null) {
_vitalSignService.hasError = true;
error = "There is no appointments for this patient";
setState(ViewState.Error);
return;
}
await _vitalSignService.getPatientVitalSign(patientArrivalEntity);
// TODO remove (not) from below condition
if (!_vitalSignService.hasError) {
error = _vitalSignService.error; error = _vitalSignService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
if (patientVitalSigns == null) { // if (patientVitalSigns == null) {
makeVitalSignDemoData(); // makeVitalSignDemoData();
} // }
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

@ -49,7 +49,7 @@ class PatientViewModel extends BaseViewModel {
List<dynamic> get referralFrequencyList => List<dynamic> get referralFrequencyList =>
_patientService.referalFrequancyList; _patientService.referalFrequancyList;
Future getPatientList( patient, patientType, Future getPatientList(patient, patientType,
{bool isBusyLocal = false}) async { {bool isBusyLocal = false}) async {
if (isBusyLocal) { if (isBusyLocal) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug_model.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
@ -11,6 +12,7 @@ class PrescriptionViewModel extends BaseViewModel {
List<PrescriptionModel> get prescriptionList => List<PrescriptionModel> get prescriptionList =>
_prescriptionService.prescriptionList; _prescriptionService.prescriptionList;
List<SearchDrugModel> get drugsList => _prescriptionService.drugsList;
Future getPrescription() async { Future getPrescription() async {
hasError = false; hasError = false;
@ -53,4 +55,16 @@ class PrescriptionViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future getDrugs() async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _prescriptionService.getDrugs();
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
} }

@ -12,6 +12,10 @@ class SickLeaveViewModel extends BaseViewModel {
SickLeaveService _sickLeaveService = locator<SickLeaveService>(); SickLeaveService _sickLeaveService = locator<SickLeaveService>();
get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics;
get getAllSIckLeave => _sickLeaveService.getAllSickLeave; get getAllSIckLeave => _sickLeaveService.getAllSickLeave;
List get allOffTime => _sickLeaveService.getOffTimeList;
List get allReasons => _sickLeaveService.getReasons;
List get coveringDoctors => _sickLeaveService.coveringDoctorsList;
get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave;
Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _sickLeaveService.addSickLeave(addSickLeaveRequest); await _sickLeaveService.addSickLeave(addSickLeaveRequest);
@ -42,9 +46,69 @@ class SickLeaveViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getSickLeave() async { Future getSickLeave(patientMRN) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _sickLeaveService.getSickLeave(); await _sickLeaveService.getSickLeave(patientMRN);
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getRescheduleLeave() async {
setState(ViewState.Busy);
await _sickLeaveService.getRescheduleLeave();
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getOffTime() async {
setState(ViewState.Busy);
await _sickLeaveService.getOffTime();
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getReasons(id) async {
setState(ViewState.Busy);
await _sickLeaveService.getReasonsByID(id: id);
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getCoveringDoctors() async {
setState(ViewState.Busy);
await _sickLeaveService.getCoveringDoctors();
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future addReschedule(request) async {
setState(ViewState.Busy);
await _sickLeaveService.addReschedule(request);
if (_sickLeaveService.hasError) {
error = _sickLeaveService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future updateReschedule(request) async {
setState(ViewState.Busy);
await _sickLeaveService.updateReschedule(request);
if (_sickLeaveService.hasError) { if (_sickLeaveService.hasError) {
error = _sickLeaveService.error; error = _sickLeaveService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -384,6 +384,34 @@
"sync" "sync"
] ]
}, },
{
"uid": "a0f7dbb184f90f285a9cba8cf09a9b6a",
"css": "drawer_icon",
"code": 59429,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M1564.7 1000H68C30.6 1000 0 958.7 0 908.2H0C0 857.6 30.6 816.3 68 816.3H1564.7C1602 816.3 1632.7 857.6 1632.7 908.2H1632.7C1632.7 958.7 1602 1000 1564.7 1000ZM911.6 591.8H68C30.6 591.8 0 550.5 0 500H0C0 449.5 30.6 408.2 68 408.2H911.6C949 408.2 979.6 449.5 979.6 500H979.6C979.6 550.5 949 591.8 911.6 591.8ZM1238.1 183.7H68C30.6 183.7 0 142.4 0 91.8H0C0 41.3 30.6 0 68 0H1238.1C1275.5 0 1306.1 41.3 1306.1 91.8H1306.1C1306.1 142.4 1275.5 183.7 1238.1 183.7Z",
"width": 1633
},
"search": [
"drawer_icon"
]
},
{
"uid": "764baf138776221a3e1e845391b188a4",
"css": "leaves",
"code": 59446,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M968.7 468.7H572.9A31.3 31.3 0 1 1 572.9 406.2H968.7A31.3 31.3 0 1 1 968.7 468.7ZM968.7 468.7M812.5 625A31.3 31.3 0 0 1 790.4 571.6L924.5 437.5 790.4 303.3A31.3 31.3 0 0 1 834.6 259.1L990.9 415.4A31.3 31.3 0 0 1 990.9 459.6L834.6 615.8A31.2 31.2 0 0 1 812.5 625ZM812.5 625M333.3 1000A83.3 83.3 0 0 0 416.7 916.7V166.7A83.9 83.9 0 0 0 360.3 87.5L109.9 4.1A84.2 84.2 0 0 0 0 83.4V833.4A83.9 83.9 0 0 0 56.4 912.4L306.8 995.8A87.2 87.2 0 0 0 333.3 1000ZM83.3 62.5A24.5 24.5 0 0 1 90.8 63.6L340.1 146.7A21.4 21.4 0 0 1 354.2 166.6V916.6A22 22 0 0 1 325.9 936.4L76.6 853.3A21.5 21.5 0 0 1 62.5 833.3V83.3A20.9 20.9 0 0 1 83.3 62.5ZM83.3 62.5M635.4 208.3A31.3 31.3 0 0 0 666.7 177.1V114.6A114.7 114.7 0 0 0 552.1 0H83.3A31.3 31.3 0 0 0 83.3 62.5H552.1A52.1 52.1 0 0 1 604.2 114.6V177.1A31.3 31.3 0 0 0 635.4 208.3ZM635.4 208.3M385.4 875H552.1A114.7 114.7 0 0 0 666.6 760.4V697.9A31.3 31.3 0 0 0 604.1 697.9V760.4A52.1 52.1 0 0 1 552.1 812.5H385.4A31.3 31.3 0 0 0 385.4 875ZM385.4 875",
"width": 1000
},
"search": [
"leaves"
]
},
{ {
"uid": "740f78c2b53c8cc100a8b0d283bbd34f", "uid": "740f78c2b53c8cc100a8b0d283bbd34f",
"css": "home_icon-1", "css": "home_icon-1",
@ -481,19 +509,6 @@
"search": [ "search": [
"scdedule_icon_active" "scdedule_icon_active"
] ]
}, {
"uid": "a0f7dbb184f90f285a9cba8cf09a9b6a",
"css": "drawer_icon",
"code": 59429,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M1564.7 1000H68C30.6 1000 0 958.7 0 908.2H0C0 857.6 30.6 816.3 68 816.3H1564.7C1602 816.3 1632.7 857.6 1632.7 908.2H1632.7C1632.7 958.7 1602 1000 1564.7 1000ZM911.6 591.8H68C30.6 591.8 0 550.5 0 500H0C0 449.5 30.6 408.2 68 408.2H911.6C949 408.2 979.6 449.5 979.6 500H979.6C979.6 550.5 949 591.8 911.6 591.8ZM1238.1 183.7H68C30.6 183.7 0 142.4 0 91.8H0C0 41.3 30.6 0 68 0H1238.1C1275.5 0 1306.1 41.3 1306.1 91.8H1306.1C1306.1 142.4 1275.5 183.7 1238.1 183.7Z",
"width": 1633
},
"search": [
"drawer_icon"
]
} }
] ]
} }

@ -11,7 +11,7 @@
/// fonts: /// fonts:
/// - asset: fonts/DoctorApp.ttf /// - asset: fonts/DoctorApp.ttf
/// ///
/// ///
/// ///
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
@ -19,35 +19,64 @@ class DoctorApp {
DoctorApp._(); DoctorApp._();
static const _kFontFam = 'DoctorApp'; static const _kFontFam = 'DoctorApp';
static const _kFontPkg = null; static const String _kFontPkg = null;
static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData male = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData reject_icon = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData home_icon_active = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData menu_icon = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData menu_icon_active = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData message_icon = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData message_icon_active = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData scdedule_icon_active = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData schedule_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData discharge_patient = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData approved_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData pending_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData in_patient_white = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData lab_results = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData home_icon = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData operations = IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData out_patient = IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData patient = IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData radiology = IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData mail = IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData medicine_search = IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData qr_code = IconData(0xe820, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData referral = IconData(0xe821, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData referred = IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData search_patient = IconData(0xe823, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData sync_icon = IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData drawer_icon = IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData female_icon =
IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData male =
IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData reject_icon =
IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData home_icon_active =
IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData menu_icon =
IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData menu_icon_active =
IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData message_icon =
IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData message_icon_active =
IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData scdedule_icon_active =
IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData schedule_icon =
IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData discharge_patient =
IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData approved_icon =
IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData pending_icon =
IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData in_patient_white =
IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData lab_results =
IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData home_icon =
IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData operations =
IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData out_patient =
IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData patient =
IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData qr_code =
IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData radiology =
IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData referral =
IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData search_patient =
IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData mail =
IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData medicine_search =
IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData referred =
IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData sync_icon =
IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData drawer_icon =
IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData leaves =
IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg);
} }

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
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/medical_file_page.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-detail-screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-input-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-input-screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart';
@ -91,6 +92,7 @@ const String PATIENT_ADMISSION_REQUEST = 'patients/admission-request';
const String PATIENT_ADMISSION_REQUEST_2 = 'patients/admission-request-second'; const String PATIENT_ADMISSION_REQUEST_2 = 'patients/admission-request-second';
const String PATIENT_ADMISSION_REQUEST_3 = 'patients/admission-request-third'; const String PATIENT_ADMISSION_REQUEST_3 = 'patients/admission-request-third';
const String PATIENT_UCAF_REQUEST = 'patients/ucaf'; const String PATIENT_UCAF_REQUEST = 'patients/ucaf';
const String PATIENT_UCAF_DETAIL = 'patients/ucaf/detail';
const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String BODY_MEASUREMENTS = 'patients/body-measurements';
const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details';
@ -155,4 +157,5 @@ var routes = {
// LIVECARE_END_DIALOG: (_) => EndCallDialogBox() // LIVECARE_END_DIALOG: (_) => EndCallDialogBox()
MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(),
PATIENT_UCAF_REQUEST: (_) => UCAFInputScreen(), PATIENT_UCAF_REQUEST: (_) => UCAFInputScreen(),
PATIENT_UCAF_DETAIL: (_) => UcafDetailScreen(),
}; };

@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_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/profile/referral/my-referral-patient-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart';
import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.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/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -184,7 +185,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
Container( Container(
color: Colors.white, color: Colors.white,
height: this.isExpanded ? 150 : 110, height: this.isExpanded
? MediaQuery.of(context).size.height * 0.19
: MediaQuery.of(context).size.height * 0.12,
), ),
], ],
), ),
@ -953,6 +956,40 @@ class _DashboardScreenState extends State<DashboardScreen> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Row(
children: [
DashboardItem(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Icon(
DoctorApp.leaves,
size: 50,
),
AppText(
TranslationBase.of(context).rescheduleLeaves,
color: Colors.black,
textAlign: TextAlign.center,
)
],
),
hasBorder: true,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
AddRescheduleLeavScreen(),
// MyReferredPatient(),
),
);
},
)
],
),
SizedBox(
height: 20,
),
], ],
), ),
), ),

@ -0,0 +1,112 @@
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class UcafDetailScreen extends StatefulWidget {
@override
_UcafDetailScreenState createState() => _UcafDetailScreenState();
}
class _UcafDetailScreenState extends State<UcafDetailScreen> {
int _activeTap = 0;
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
final screenSize = MediaQuery.of(context).size;
return BaseView<UcafViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).ucaf,
body: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
PatientHeaderWidgetNoAvatar(patient),
SizedBox(
height: 10,
),
Container(
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column(
children: [
treatmentStepsBar(context, screenSize),
SizedBox(
height: 16,
),
getSelectedTreatmentStepItem(context),
],
),
),
],
),
),
),
));
}
Widget treatmentStepsBar(BuildContext _context, Size screenSize) {
List<String> __treatmentSteps = [
TranslationBase.of(context).diagnosis.toUpperCase(),
TranslationBase.of(context).medications.toUpperCase(),
TranslationBase.of(context).procedures.toUpperCase(),
];
return Container(
height: screenSize.height * 0.070,
decoration:
Helpers.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: __treatmentSteps.map((item) {
bool _isActive = __treatmentSteps[_activeTap] == item ? true : false;
return Expanded(
child: InkWell(
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: Helpers.containerBorderDecoration(
_isActive ? HexColor("#B8382B") : Colors.white,
_isActive ? HexColor("#B8382B") : Colors.white),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.bold,
),
),
)),
),
onTap: () {
print(__treatmentSteps.indexOf(item));
setState(() {
_activeTap = __treatmentSteps.indexOf(item);
});
},
),
);
}).toList(),
),
);
}
Widget getSelectedTreatmentStepItem(BuildContext _context) {
return Container();
}
}

@ -5,6 +5,7 @@ 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/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -12,6 +13,8 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import '../../../../routes.dart';
class UCAFInputScreen extends StatefulWidget { class UCAFInputScreen extends StatefulWidget {
@override @override
_UCAFInputScreenState createState() => _UCAFInputScreenState(); _UCAFInputScreenState createState() => _UCAFInputScreenState();
@ -58,7 +61,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
PatientHeaderWidget(patient), PatientHeaderWidgetNoAvatar(patient),
Container( Container(
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column( child: Column(
@ -349,7 +352,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
title: TranslationBase.of(context).next, title: TranslationBase.of(context).next,
color: HexColor("#B8382B"), color: HexColor("#B8382B"),
onPressed: (){ onPressed: (){
// Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {'patient': patient}); Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, arguments: {'patient': patient});
}, },
), ),
], ],
@ -362,72 +365,3 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
); );
} }
} }
class PatientHeaderWidget extends StatelessWidget {
final PatiantInformtion patient;
PatientHeaderWidget(this.patient);
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
margin: EdgeInsets.all(16),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
patient.firstName + ' ' + patient.lastName,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.2,
),
Row(
children: [
AppText(
"VIP",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.2,
),
SizedBox(
width: 8,
),
AppText(
" ${patient.age}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
AppText(
"NEW VISIT",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${patient.companyName}",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
),
Icon(
Icons.info_outline,
color: Colors.black,
),
],
),
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
],
);
}
}

@ -27,7 +27,7 @@ class MyReferralPatientScreen extends StatelessWidget {
model.pendingReferral.length == 0 model.pendingReferral.length == 0
? Center( ? Center(
child: AppText( child: AppText(
TranslationBase.of(context).errorNoSchedule, TranslationBase.of(context).referralEmptyMsg,
color: Theme.of(context).errorColor, color: Theme.of(context).errorColor,
), ),
) )

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart'; import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
@ -9,6 +10,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
@ -19,7 +21,7 @@ import 'package:hexcolor/hexcolor.dart';
import '../../../QR_reader_screen.dart'; import '../../../QR_reader_screen.dart';
class PatientMakeReferralScreen extends StatefulWidget { class PatientMakeReferralScreen extends StatefulWidget {
// previous design page is: MyReferralPatient // previous design page is: ReferPatientScreen
@override @override
_PatientMakeReferralScreenState createState() => _PatientMakeReferralScreenState createState() =>
_PatientMakeReferralScreenState(); _PatientMakeReferralScreenState();
@ -34,7 +36,6 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
dynamic _selectedDoctor; dynamic _selectedDoctor;
DateTime appointmentDate; DateTime appointmentDate;
final _remarksController = TextEditingController(); final _remarksController = TextEditingController();
PatientArrivalEntity _selectedPatientArrivalEntity;
@override @override
void initState() { void initState() {
@ -55,7 +56,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<PatientReferralViewModel>( return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getBranches(), onModelReady: (model) =>
model.getMasterLookup(MasterKeysService.physiotherapyGoals),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
@ -64,6 +66,14 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
if (model.state == ViewState.BusyLocal)
Container(
color: Colors.white,
width: 50,
height: 50,
child: AppLoaderWidget(
containerColor: Colors.white,
)),
Column( Column(
children: [ children: [
PatientPageHeaderWidget(patient), PatientPageHeaderWidget(patient),
@ -284,8 +294,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
.chooseAppointment, .chooseAppointment,
_selectedPatientArrivalEntity != null appointmentDate != null
? "${TranslationBase.of(context).appointmentNo} ${_selectedPatientArrivalEntity.appointmentNo}" ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
: null, : null,
true, true,
suffixIcon: Icon( suffixIcon: Icon(
@ -326,20 +336,24 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
title: TranslationBase.of(context).refer, title: TranslationBase.of(context).refer,
color: HexColor("#B8382B"), color: HexColor("#B8382B"),
onPressed: () { onPressed: () {
if (_selectedPatientArrivalEntity == null || if (appointmentDate == null ||
_selectedBranch == null || _selectedBranch == null ||
_selectedClinic == null || _selectedClinic == null ||
_selectedDoctor == null || _selectedDoctor == null ||
_remarksController.text == null) return; _remarksController.text == null) return;
model model
.makeReferral( .makeReferral(
_selectedPatientArrivalEntity, patient,
appointmentDate.toIso8601String(), appointmentDate.toIso8601String(),
_selectedBranch['ID'], _selectedBranch['ID'],
_selectedClinic['ClinicID'], _selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'], _selectedDoctor['DoctorID'],
_remarksController.text) _remarksController.text)
.then((_) => Navigator.pop(context)); .then((_) {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).referralSuccessMsg);
Navigator.pop(context);
});
}, },
), ),
) )
@ -362,8 +376,10 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
initialEntryMode: DatePickerEntryMode.calendar, initialEntryMode: DatePickerEntryMode.calendar,
); );
if (picked != null && picked != appointmentDate) { if (picked != null && picked != appointmentDate) {
appointmentDate = picked; setState(() {
model appointmentDate = picked;
});
/* model
.getPatientArrivalList(DateUtils.convertStringToDateFormat( .getPatientArrivalList(DateUtils.convertStringToDateFormat(
appointmentDate.toString(), "yyyy-MM-dd")) appointmentDate.toString(), "yyyy-MM-dd"))
.then((_) { .then((_) {
@ -409,7 +425,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context).noAppointmentsErrorMsg); TranslationBase.of(context).noAppointmentsErrorMsg);
} }
}); });*/
} }
} }

@ -19,7 +19,7 @@ class ReferredPatientScreen extends StatelessWidget {
model.listMyReferredPatientModel.length == 0 model.listMyReferredPatientModel.length == 0
? Center( ? Center(
child: AppText( child: AppText(
TranslationBase.of(context).errorNoSchedule, TranslationBase.of(context).referralEmptyMsg,
color: Theme.of(context).errorColor, color: Theme.of(context).errorColor,
), ),
) )
@ -27,14 +27,14 @@ class ReferredPatientScreen extends StatelessWidget {
child: Container( child: Container(
child: Column( child: Column(
children: [ children: [
Container( /*Container(
height: 75, height: 75,
child: AppText( child: AppText(
"This is where upper view for avatar.. etc placed", "This is where upper view for avatar.. etc placed",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 16, fontSize: 16,
), ),
), ),*/
const Divider( const Divider(
color: Color(0xffCCCCCC), color: Color(0xffCCCCCC),
height: 1, height: 1,

@ -11,6 +11,7 @@ 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/expandable-widget-header-body.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class PatientVitalSignScreen extends StatelessWidget { class PatientVitalSignScreen extends StatelessWidget {
@override @override
@ -19,10 +20,7 @@ class PatientVitalSignScreen extends StatelessWidget {
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
return BaseView<VitalSignsViewModel>( return BaseView<VitalSignsViewModel>(
onModelReady: (model) => model.getPatientArrivalList( onModelReady: (model) => model.getPatientVitalSign(patient),
DateUtils.convertDateToFormat(DateTime.now(), "yyyy-MM-dd"), patient,
fromDate: DateUtils.convertDateToFormat(
DateTime.now().subtract(Duration(days: 500)), "yyyy-MM-dd")),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).vitalSign, appBarTitle: TranslationBase.of(context).vitalSign,
@ -213,10 +211,12 @@ class PatientVitalSignScreen extends StatelessWidget {
Container( Container(
color: Colors.green, color: Colors.green,
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(vertical: 2, horizontal: 8), padding: EdgeInsets.symmetric(
vertical: 2, horizontal: 8),
child: AppText( child: AppText(
"${model.getBMI(model.patientVitalSigns.bodyMassIndex)}", "${model.getBMI(model.patientVitalSigns.bodyMassIndex)}",
fontSize: SizeConfig.textMultiplier * 2, fontSize:
SizeConfig.textMultiplier * 2,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -357,7 +357,14 @@ class PatientVitalSignScreen extends StatelessWidget {
), ),
), ),
) )
: Container(), : Center(
child: AppText(
"${TranslationBase.of(context).vitalSignEmptyMsg}",
fontSize: SizeConfig.textMultiplier * 2.5,
color: HexColor("#B8382B"),
fontWeight: FontWeight.normal,
),
),
), ),
); );
} }
@ -485,7 +492,6 @@ class _TemperatureWidgetState extends State<TemperatureWidget> {
} }
class PulseWidget extends StatefulWidget { class PulseWidget extends StatefulWidget {
final VitalSignData vitalSign; final VitalSignData vitalSign;
PulseWidget(this.vitalSign); PulseWidget(this.vitalSign);
@ -496,6 +502,7 @@ class PulseWidget extends StatefulWidget {
class _PulseWidgetState extends State<PulseWidget> { class _PulseWidgetState extends State<PulseWidget> {
bool isExpand = false; bool isExpand = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -578,7 +585,6 @@ class _PulseWidgetState extends State<PulseWidget> {
} }
class RespirationWidget extends StatefulWidget { class RespirationWidget extends StatefulWidget {
final VitalSignData vitalSign; final VitalSignData vitalSign;
RespirationWidget(this.vitalSign); RespirationWidget(this.vitalSign);
@ -672,7 +678,6 @@ class _RespirationWidgetState extends State<RespirationWidget> {
} }
class BloodPressureWidget extends StatefulWidget { class BloodPressureWidget extends StatefulWidget {
final VitalSignData vitalSign; final VitalSignData vitalSign;
BloodPressureWidget(this.vitalSign); BloodPressureWidget(this.vitalSign);
@ -812,7 +817,6 @@ class _BloodPressureWidgetState extends State<BloodPressureWidget> {
} }
class OxygenationWidget extends StatefulWidget { class OxygenationWidget extends StatefulWidget {
final VitalSignData vitalSign; final VitalSignData vitalSign;
OxygenationWidget(this.vitalSign); OxygenationWidget(this.vitalSign);
@ -906,7 +910,6 @@ class _OxygenationWidgetState extends State<OxygenationWidget> {
} }
class PainScaleWidget extends StatefulWidget { class PainScaleWidget extends StatefulWidget {
final VitalSignData vitalSign; final VitalSignData vitalSign;
PainScaleWidget(this.vitalSign); PainScaleWidget(this.vitalSign);
@ -998,8 +1001,3 @@ class _PainScaleWidgetState extends State<PainScaleWidget> {
); );
} }
} }

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart'; import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
@ -29,303 +30,333 @@ void addPrescriptionForm(context, PrescriptionViewModel model) {
TextEditingController doseController = TextEditingController(); TextEditingController doseController = TextEditingController();
final GlobalKey<FormState> formKey = GlobalKey<FormState>(); final GlobalKey<FormState> formKey = GlobalKey<FormState>();
final double spaceBetweenTextFileds = 12; final double spaceBetweenTextFileds = 12;
showModalBottomSheet( showModalBottomSheet(
isScrollControlled: true, isScrollControlled: true,
context: context, context: context,
builder: (BuildContext bc) { builder: (BuildContext bc) {
return DraggableScrollableSheet( return //BaseView<PrescriptionViewModel>(
initialChildSize: 0.90, //onModelReady: (model) => model.getDrugs(),
maxChildSize: 0.90, //builder: (BuildContext context, PrescriptionViewModel model,
minChildSize: 0.9, //Widget child) =>
builder: (BuildContext context, ScrollController scrollController) { DraggableScrollableSheet(
return SingleChildScrollView( initialChildSize: 0.90,
child: Container( maxChildSize: 0.90,
height: 980, minChildSize: 0.9,
child: Padding( builder:
padding: (BuildContext context, ScrollController scrollController) {
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), return SingleChildScrollView(
child: Column( child: Container(
crossAxisAlignment: CrossAxisAlignment.start, height: 980,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly, child: Padding(
children: [ padding: EdgeInsets.symmetric(
AppText( horizontal: 12.0, vertical: 10.0),
TranslationBase.of(context).medicines.toUpperCase(), child: Column(
fontWeight: FontWeight.w900, crossAxisAlignment: CrossAxisAlignment.start,
), //mainAxisAlignment: MainAxisAlignment.spaceEvenly,
SizedBox( children: [
height: spaceBetweenTextFileds, AppText(
), TranslationBase.of(context)
Container( .medicines
child: Form( .toUpperCase(),
key: formKey, fontWeight: FontWeight.w900,
child: Column( ),
//mainAxisAlignment: MainAxisAlignment.end, SizedBox(
children: [ height: spaceBetweenTextFileds,
Container( ),
decoration: BoxDecoration( Container(
borderRadius: BorderRadius.all( child: Form(
Radius.circular(6.0)), key: formKey,
border: Border.all( child: Column(
width: 1.0, //mainAxisAlignment: MainAxisAlignment.end,
color: HexColor("#CCCCCC"))), children: [
child: TextFields( Container(
hintText: TranslationBase.of(context) decoration: BoxDecoration(
.searchMedicine, borderRadius: BorderRadius.all(
controller: drugIdController, Radius.circular(6.0)),
keyboardType: TextInputType.number, border: Border.all(
validator: (value) { width: 1.0,
if (value.isEmpty) color: HexColor("#CCCCCC"))),
return TranslationBase.of(context) child: TextFields(
.emptyMessage; hintText: TranslationBase.of(context)
else .searchMedicine,
return null; controller: drugIdController,
}), keyboardType: TextInputType.number,
), validator: (value) {
SizedBox( if (value.isEmpty)
height: spaceBetweenTextFileds, return TranslationBase.of(context)
), .emptyMessage;
Container( else
decoration: BoxDecoration( return null;
borderRadius: BorderRadius.all( }),
Radius.circular(6.0)), ),
border: Border.all( SizedBox(
width: 1.0, height: spaceBetweenTextFileds,
color: HexColor("#CCCCCC"))), ),
child: TextFields( Container(
hintText: decoration: BoxDecoration(
TranslationBase.of(context).orderType, borderRadius: BorderRadius.all(
), Radius.circular(6.0)),
), border: Border.all(
SizedBox(height: spaceBetweenTextFileds), width: 1.0,
Container( color: HexColor("#CCCCCC"))),
decoration: BoxDecoration( child: TextFields(
borderRadius: BorderRadius.all( hintText: TranslationBase.of(context)
Radius.circular(6.0)), .orderType,
border: Border.all( ),
width: 1.0, ),
color: HexColor("#CCCCCC"))), SizedBox(height: spaceBetweenTextFileds),
child: TextFields( Container(
hintText: decoration: BoxDecoration(
TranslationBase.of(context).strength, borderRadius: BorderRadius.all(
keyboardType: TextInputType.number, Radius.circular(6.0)),
controller: strengthController, border: Border.all(
validator: (value) { width: 1.0,
if (value.isEmpty) color: HexColor("#CCCCCC"))),
return TranslationBase.of(context) child: TextFields(
.emptyMessage; hintText: TranslationBase.of(context)
else .strength,
return null; keyboardType: TextInputType.number,
}, controller: strengthController,
), validator: (value) {
), if (value.isEmpty)
SizedBox(height: spaceBetweenTextFileds), return TranslationBase.of(context)
Container( .emptyMessage;
decoration: BoxDecoration( else
borderRadius: BorderRadius.all( return null;
Radius.circular(6.0)), },
border: Border.all( ),
width: 1.0, ),
color: HexColor("#CCCCCC"))), SizedBox(height: spaceBetweenTextFileds),
child: TextFields( Container(
hintText: TranslationBase.of(context).route, decoration: BoxDecoration(
controller: routeController, borderRadius: BorderRadius.all(
keyboardType: TextInputType.number, Radius.circular(6.0)),
validator: (value) { border: Border.all(
if (value.isEmpty) width: 1.0,
return TranslationBase.of(context) color: HexColor("#CCCCCC"))),
.emptyMessage; child: TextFields(
else hintText:
return null; TranslationBase.of(context).route,
}, controller: routeController,
), keyboardType: TextInputType.number,
), validator: (value) {
SizedBox(height: spaceBetweenTextFileds), if (value.isEmpty)
Container( return TranslationBase.of(context)
decoration: BoxDecoration( .emptyMessage;
borderRadius: BorderRadius.all( else
Radius.circular(6.0)), return null;
border: Border.all( },
width: 1.0, ),
color: HexColor("#CCCCCC"))), ),
child: TextFields( SizedBox(height: spaceBetweenTextFileds),
hintText: Container(
TranslationBase.of(context).frequency, decoration: BoxDecoration(
controller: frequencyController, borderRadius: BorderRadius.all(
keyboardType: TextInputType.number, Radius.circular(6.0)),
validator: (value) { border: Border.all(
if (value.isEmpty) width: 1.0,
return TranslationBase.of(context) color: HexColor("#CCCCCC"))),
.emptyMessage; child: TextFields(
else hintText: TranslationBase.of(context)
return null; .frequency,
}, controller: frequencyController,
), keyboardType: TextInputType.number,
), validator: (value) {
SizedBox(height: spaceBetweenTextFileds), if (value.isEmpty)
Container( return TranslationBase.of(context)
decoration: BoxDecoration( .emptyMessage;
borderRadius: BorderRadius.all( else
Radius.circular(6.0)), return null;
border: Border.all( },
width: 1.0, ),
color: HexColor("#CCCCCC"))), ),
child: TextFields( SizedBox(height: spaceBetweenTextFileds),
hintText: Container(
TranslationBase.of(context).doseTime, decoration: BoxDecoration(
controller: doseController, borderRadius: BorderRadius.all(
keyboardType: TextInputType.number, Radius.circular(6.0)),
validator: (value) { border: Border.all(
if (value.isEmpty) width: 1.0,
return TranslationBase.of(context) color: HexColor("#CCCCCC"))),
.emptyMessage; child: TextFields(
else hintText: TranslationBase.of(context)
return null; .doseTime,
}, controller: doseController,
), keyboardType: TextInputType.number,
), validator: (value) {
SizedBox(height: spaceBetweenTextFileds), if (value.isEmpty)
Container( return TranslationBase.of(context)
decoration: BoxDecoration( .emptyMessage;
borderRadius: BorderRadius.all( else
Radius.circular(6.0)), return null;
border: Border.all( },
width: 1.0, ),
color: HexColor("#CCCCCC"))), ),
child: TextFields( SizedBox(height: spaceBetweenTextFileds),
hintText: Container(
TranslationBase.of(context).indication, decoration: BoxDecoration(
controller: indicationController, borderRadius: BorderRadius.all(
keyboardType: TextInputType.number, Radius.circular(6.0)),
validator: (value) { border: Border.all(
if (value.isEmpty) width: 1.0,
return TranslationBase.of(context) color: HexColor("#CCCCCC"))),
.emptyMessage; child: TextFields(
else hintText: TranslationBase.of(context)
return null; .indication,
}, controller: indicationController,
), keyboardType: TextInputType.number,
), validator: (value) {
SizedBox(height: spaceBetweenTextFileds), if (value.isEmpty)
Container( return TranslationBase.of(context)
decoration: BoxDecoration( .emptyMessage;
borderRadius: BorderRadius.all( else
Radius.circular(6.0)), return null;
border: Border.all( },
width: 1.0, ),
color: HexColor("#CCCCCC"))), ),
child: TextFields( SizedBox(height: spaceBetweenTextFileds),
hintText: Container(
TranslationBase.of(context).fromDate, decoration: BoxDecoration(
keyboardType: TextInputType.datetime, borderRadius: BorderRadius.all(
validator: (value) { Radius.circular(6.0)),
if (value.isEmpty) border: Border.all(
return TranslationBase.of(context) width: 1.0,
.emptyMessage; color: HexColor("#CCCCCC"))),
else child: TextFields(
return null; hintText: TranslationBase.of(context)
}, .fromDate,
), keyboardType: TextInputType.datetime,
), validator: (value) {
SizedBox(height: spaceBetweenTextFileds), if (value.isEmpty)
Container( return TranslationBase.of(context)
decoration: BoxDecoration( .emptyMessage;
borderRadius: BorderRadius.all( else
Radius.circular(6.0)), return null;
border: Border.all( },
width: 1.0, ),
color: HexColor("#CCCCCC"))), ),
child: TextFields( SizedBox(height: spaceBetweenTextFileds),
hintText: Container(
TranslationBase.of(context).duration, decoration: BoxDecoration(
// borderColor: Colors.white, borderRadius: BorderRadius.all(
keyboardType: TextInputType.number, Radius.circular(6.0)),
controller: durationController, border: Border.all(
validator: (value) { width: 1.0,
if (value.isEmpty) color: HexColor("#CCCCCC"))),
return TranslationBase.of(context) child: TextFields(
.emptyMessage; hintText: TranslationBase.of(context)
else .duration,
return null; // borderColor: Colors.white,
}), keyboardType: TextInputType.number,
), controller: durationController,
SizedBox(height: spaceBetweenTextFileds), validator: (value) {
Container( if (value.isEmpty)
decoration: BoxDecoration( return TranslationBase.of(context)
borderRadius: BorderRadius.all( .emptyMessage;
Radius.circular(6.0)), else
border: Border.all( return null;
width: 1.0, }),
color: HexColor("#CCCCCC"))), ),
child: TextFields( SizedBox(height: spaceBetweenTextFileds),
hintText: Container(
TranslationBase.of(context).instruction, decoration: BoxDecoration(
controller: indicationController, borderRadius: BorderRadius.all(
keyboardType: TextInputType.number, Radius.circular(6.0)),
validator: (value) { border: Border.all(
if (value.isEmpty) width: 1.0,
return TranslationBase.of(context) color: HexColor("#CCCCCC"))),
.emptyMessage; child: TextFields(
else hintText: TranslationBase.of(context)
return null; .instruction,
}, controller: indicationController,
), keyboardType: TextInputType.number,
), validator: (value) {
SizedBox(height: spaceBetweenTextFileds), if (value.isEmpty)
Container( return TranslationBase.of(context)
margin: EdgeInsets.all( .emptyMessage;
SizeConfig.widthMultiplier * 5), else
child: Wrap( return null;
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.addMedication,
onPressed: () {
formKey.currentState.save();
if (formKey.currentState.validate()) {
postProcedure(
model: model,
duration: durationController.text,
dose: doseController.text,
frequency:
frequencyController.text,
route: routeController.text,
drugId: drugIdController.text,
strength: strengthController.text,
indication:
indicationController.text,
instruction:
indicationController.text,
);
Navigator.pop(context);
}
{
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// NewPrescriptionScreen()),
// );
}
}, },
), ),
], ),
), SizedBox(height: spaceBetweenTextFileds),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.addMedication,
onPressed: () {
formKey.currentState.save();
if (formKey.currentState
.validate()) {
postProcedure(
model: model,
duration:
durationController.text,
dose: doseController.text,
frequency:
frequencyController.text,
route: routeController.text,
drugId: drugIdController.text,
strength:
strengthController.text,
indication:
indicationController.text,
instruction:
indicationController.text,
);
Navigator.pop(context);
}
{
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) =>
// NewPrescriptionScreen()),
// );
}
},
),
],
),
),
],
), ),
], ),
), ),
), ],
), ),
], ),
), ),
), );
), });
); //);
});
}); });
} }
// openAllergiesList(BuildContext context) {
// showModalBottomSheet(
// backgroundColor: Colors.white,
// isScrollControlled: true,
// context: context,
// builder: (context) {
// return AddAllergies(
// addAllergiesFun: (MySelectedAllergy mySelectedAllergy) {
// setState(() {
// widget.myAllergiesList.add(mySelectedAllergy);
// Navigator.of(context).pop();
// });
// },
// );
// });
// }
postProcedure( postProcedure(
{String duration, {String duration,
String dose, String dose,

@ -420,7 +420,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
} }
} }
postProcedure({ProcedureViewModel model}) async { postProcedure({ProcedureViewModel model, String remarks}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
List<Controls> controls = List(); List<Controls> controls = List();
List<Procedures> controlsProcedure = List(); List<Procedures> controlsProcedure = List();
@ -433,10 +433,10 @@ postProcedure({ProcedureViewModel model}) async {
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI'; 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI';
controls.add( controls.add(
Controls(code: 'Remarks', controlValue: 'Testing'), Controls(code: remarks.isEmpty ? '' : remarks, controlValue: 'sssssssss'),
); );
controlsProcedure.add( controlsProcedure.add(
Procedures(category: "02", procedure: "02011002", controls: controls)); Procedures(category: "02", procedure: "02011009", controls: controls));
postProcedureReqModel.procedures = controlsProcedure; postProcedureReqModel.procedures = controlsProcedure;
await model.postProcedure(postProcedureReqModel); await model.postProcedure(postProcedureReqModel);
@ -448,7 +448,8 @@ postProcedure({ProcedureViewModel model}) async {
} }
} }
updateProcedure({ProcedureViewModel model, String remarks}) async { updateProcedure(
{ProcedureViewModel model, String remarks, String procedureId}) async {
PostProcedureReqModel updateProcedureReqModel = new PostProcedureReqModel(); PostProcedureReqModel updateProcedureReqModel = new PostProcedureReqModel();
List<Controls> controls = List(); List<Controls> controls = List();
List<Procedures> controlsProcedure = List(); List<Procedures> controlsProcedure = List();
@ -500,6 +501,7 @@ class AddSelectedProcedure extends StatefulWidget {
class _AddSelectedProcedureState extends State<AddSelectedProcedure> { class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
TextEditingController procedureController = TextEditingController(); TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List(); List<EntityList> entityList = List();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -559,6 +561,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
), ),
TextFields( TextFields(
hintText: 'Remarks', hintText: 'Remarks',
controller: remarksController,
minLines: 3, minLines: 3,
maxLines: 5, maxLines: 5,
), ),
@ -574,7 +577,9 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
title: 'add Selected Procedures'.toUpperCase(), title: 'add Selected Procedures'.toUpperCase(),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
postProcedure(model: widget.model); postProcedure(
model: widget.model,
remarks: remarksController.text);
}, },
), ),
], ],

@ -0,0 +1,292 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.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/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.dart';
import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.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_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class AddRescheduleLeavScreen extends StatelessWidget {
ProjectViewModel projectsProvider;
@override
Widget build(BuildContext context) {
projectsProvider = Provider.of(context);
return BaseView<SickLeaveViewModel>(
onModelReady: (model) =>
{model.getRescheduleLeave(), model.getCoveringDoctors()},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).rescheduleLeaves,
body: model.getReschduleLeave.length > 0
? SingleChildScrollView(
child: Column(
children: [
Container(
margin:
EdgeInsets.only(left: 15, right: 15, top: 20),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppTextFormField(
hintText:
TranslationBase.of(context).requestLeave,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(
Icons.add_circle,
color: Colors.red,
)),
textInputType: TextInputType.text,
onTap: () {
openLeave(
context,
false,
);
},
inputFormatter: ONLY_LETTERS,
)
],
),
),
Column(
children: model.getReschduleLeave.map<Widget>(
(GetRescheduleLeavesResponse item) {
return CardWithBgWidgetNew(
widget: Column(
children: [
Container(
padding:
EdgeInsets.only(left: 10, right: 10),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 4,
child: Wrap(
children: <Widget>[
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
padding:
EdgeInsets.all(3),
child: AppText(
item.status == 1
? TranslationBase
.of(context)
.approved
: item.status == 2
? TranslationBase.of(
context)
.pending
: TranslationBase.of(
context)
.rejected,
fontWeight:
FontWeight.bold,
color: Colors.white,
),
color: item.status == 1
? Colors.green
: item.status == 2
? Colors
.yellow[800]
: Colors.red[800],
),
SizedBox(
height: 5,
),
Container(
child: AppText(
TranslationBase.of(
context)
.holiday +
' ',
fontWeight:
FontWeight.bold,
)),
Row(
children: [
Flexible(
child: Text(
item.dateTimeFrom +
' ' +
TranslationBase.of(
context)
.to +
' ' +
item.dateTimeTo,
// overflow:
// TextOverflow.ellipsis,
))
],
),
SizedBox(
height: 5,
),
AppText(
TranslationBase.of(
context)
.coveringDoctor,
fontWeight:
FontWeight.bold,
),
model.coveringDoctors
.length >
0
? Row(children: [
AppText(getDoctor(
model
.coveringDoctors,
item.doctorId))
])
: SizedBox(),
AppText(
TranslationBase.of(
context)
.reasons,
fontWeight:
FontWeight.bold,
),
model.allReasons.length > 0
? Row(children: [
AppText(getReasons(
model
.allReasons,
item.reasonId))
])
: SizedBox(),
],
),
SizedBox(
width: 10,
),
],
),
),
(item.status == 1)
? Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.edit_outlined,
size: 30,
),
// color: Colors.green, //Colors.black,
onPressed: () => {
openLeave(context, true,
extendedData: item)
},
))
: SizedBox(),
],
)),
SizedBox(
height: 10,
),
Divider(
height: 1,
),
],
));
}).toList(),
)
],
),
)
: new Builder(builder: (context) {
return Center(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(40),
decoration: BoxDecoration(
border: Border.all(
color: HexColor('#B8382C'), width: 4),
borderRadius:
BorderRadius.all(Radius.circular(100))),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
),
onPressed: () {
openLeave(
context,
false,
);
}),
),
Padding(
child: AppText(
TranslationBase.of(context).noReScheduleLeave,
fontWeight: FontWeight.bold,
),
padding: EdgeInsets.all(10),
),
AppText(
TranslationBase.of(context).applyNow,
fontWeight: FontWeight.bold,
color: HexColor('#B8382C'),
)
],
),
));
}),
));
}
openLeave(BuildContext context, isExtend, {extendedData}) {
showModalBottomSheet(
context: context,
builder: (context) {
return new Container(
child: RescheduleLeaveScreen(
isExtend,
extendedData,
));
});
}
getDoctor(model, doctorId) {
var obj;
obj = model.where((i) => i['doctorID'] == doctorId).toList();
print(obj);
return obj.length > 0 ? obj[0]['doctorName'] : "";
}
getReasons(model, reasonID) {
var obj;
obj = model.where((i) => i['id'] == reasonID).toList();
print(obj);
return obj.length > 0
? projectsProvider.isArabic == true
? obj[0]['nameAr']
: obj[0]['nameEn']
: "";
}
}

@ -0,0 +1,819 @@
import 'package:date_time_picker/date_time_picker.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/text_validator.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
import 'package:provider/provider.dart';
Helpers helpers = Helpers();
class RescheduleLeaveScreen extends StatefulWidget {
final isUpdate;
final updateData;
RescheduleLeaveScreen(this.isUpdate, this.updateData);
@override
_RescheduleLeaveScreen createState() => _RescheduleLeaveScreen();
}
class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
TextEditingController _toDateController = new TextEditingController();
TextEditingController _toDateController2 = new TextEditingController();
ProjectViewModel projectsProvider;
String _selectedClinic;
Map profile = {};
var offTime = '2';
var date;
var doctorID;
var reason;
var fromDate;
var toDate;
var clinicID;
TextEditingController _controller4;
void _presentDatePicker(id) {
showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime.now(),
lastDate: DateTime(2050),
).then((pickedDate) {
if (pickedDate == null) {
return;
}
setState(() {
final df = new DateFormat('yyyy-MM-dd');
if (id == 'fromDate') {
fromDate = pickedDate; //df.format();
_toDateController.text = df.format(pickedDate);
} else {
toDate = pickedDate; //
_toDateController2.text = df.format(pickedDate);
}
});
});
}
@override
void initState() {
getProfile();
super.initState();
}
@override
Widget build(BuildContext context) {
projectsProvider = Provider.of(context);
return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => BaseView<SickLeaveViewModel>(
onModelReady: (model2) => {
model2.getOffTime(),
model2.getReasons(18),
model2.getCoveringDoctors()
},
builder: (_, model2, w) => AppScaffold(
baseViewModel: model2,
isShowAppBar: false,
body: Center(
child: Container(
margin: EdgeInsets.only(top: 10),
child: FractionallySizedBox(
widthFactor: 0.9,
child: ListView(
children: [
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
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: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
// add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline(
child: new IgnorePointer(
ignoring: true,
child: DropdownButton(
focusColor: Colors.grey,
isExpanded: true,
value: getClinicName(
model) ??
"",
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext
context) {
return model
.getClinicNameList()
.map((item) {
return Row(
mainAxisSize:
MainAxisSize
.max,
children: <Widget>[
AppText(
item,
fontSize: SizeConfig
.textMultiplier *
2.1,
color:
Colors.grey,
),
],
);
}).toList();
},
onChanged: (newValue) =>
{},
items: model
.getClinicNameList()
.map((item) {
return DropdownMenuItem(
value:
item.toString(),
child: Text(
item,
textAlign:
TextAlign.end,
),
);
}).toList(),
))),
),
],
)
],
),
)),
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
new IgnorePointer(
ignoring: true,
child: AppTextFormField(
readOnly: true,
hintText: profile != null
? profile['DoctorName']
: "",
borderColor: Colors.white,
onSaved: (value) {},
inputFormatter: ONLY_NUMBERS))
],
),
),
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
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: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
model2.allOffTime.length > 0
? Expanded(
// add Expanded to have your dropdown button fill remaining space
child:
DropdownButtonHideUnderline(
child: DropdownButton(
focusColor: Colors.grey,
isExpanded: true,
value: offTime == null
? model2.allOffTime[0]
['code']
: offTime,
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return model2.allOffTime
.map((item) {
return Row(
mainAxisSize:
MainAxisSize.max,
children: <Widget>[
AppText(
item[
'description'],
fontSize: SizeConfig
.textMultiplier *
2.1,
color:
Colors.grey,
),
],
);
}).toList();
},
onChanged: (newValue) => {
setState(() {
offTime = newValue;
}),
if (offTime == '1')
{model2.getReasons(18)}
else if (offTime == '2')
{model2.getReasons(19)}
else if (offTime == '3' ||
offTime == '5')
{model2.getReasons(102)}
},
items: model2.allOffTime
.map((item) {
return DropdownMenuItem<
String>(
value: item['code']
.toString(),
child: Text(
item['description'],
textAlign:
TextAlign.end,
),
);
}).toList(),
)),
)
: SizedBox(),
],
)
],
),
)),
offTime == '1'
? Column(
children: [
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppTextFormField(
hintText: TranslationBase.of(
context)
.fromDate,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(Icons
.calendar_today)),
textInputType:
TextInputType.number,
controller: _toDateController,
onTap: () {
_presentDatePicker(
'fromDate');
},
inputFormatter: ONLY_DATE,
onChanged: (value) {
fromDate = value;
}),
],
)),
Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
// new AppTextFormField(
// readOnly: true,
// hintText: "",
// borderColor: Colors.white,
// onSaved: (value) {},
// inputFormatter: ONLY_NUMBERS),
DateTimePicker(
type:
DateTimePickerType.time,
controller: _controller4,
//initialValue: _initialValue,
// icon: Icon(Icons.access_time),
//use24HourFormat: false,
//locale: Locale('en', 'US'),
onChanged: (val) => () {
print(val);
},
validator: (val) {
print(val);
// setState(
// () => _valueToValidate4 = val);
return null;
},
onSaved: (val) => {},
)
],
),
),
),
Expanded(
child: Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
DateTimePicker(
type:
DateTimePickerType.time,
controller: _controller4,
//initialValue: _initialValue,
// icon: Icon(Icons.access_time),
//use24HourFormat: false,
//locale: Locale('en', 'US'),
onChanged: (val) => () {
print(val);
},
validator: (val) {
print(val);
// setState(
// () => _valueToValidate4 = val);
return null;
},
onSaved: (val) =>
{print(val)},
)
],
),
),
)
],
)
],
)
: Column(
children: [
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppTextFormField(
hintText: TranslationBase.of(
context)
.fromDate,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(Icons
.calendar_today)),
textInputType:
TextInputType.number,
controller: _toDateController,
onTap: () {
_presentDatePicker(
'fromDate');
},
inputFormatter: ONLY_DATE,
onChanged: (value) {
setState(() {
toDate = value;
});
}),
],
)),
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppTextFormField(
hintText: TranslationBase
.of(context)
.fromDate,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon(
Icons
.calendar_today)),
textInputType:
TextInputType.number,
controller:
_toDateController2,
onTap: () {
_presentDatePicker(
'toDate');
},
inputFormatter: ONLY_DATE,
onChanged: (value) {
setState(() {
toDate = value;
});
}),
],
))
],
),
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
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: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
model2.allReasons.length > 0
? Expanded(
// add Expanded to have your dropdown button fill remaining space
child:
DropdownButtonHideUnderline(
child: DropdownButton(
focusColor: Colors.grey,
isExpanded: true,
value: reason == null
? model2.allReasons[0]
['id']
.toString()
: reason,
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return model2.allReasons
.map((item) {
return Row(
mainAxisSize:
MainAxisSize.max,
children: <Widget>[
AppText(
projectsProvider
.isArabic
? item[
'nameAr']
: item[
'nameEn'],
fontSize: SizeConfig
.textMultiplier *
2.1,
color:
Colors.grey,
),
],
);
}).toList();
},
onChanged: (newValue) => {
setState(() {
reason = newValue;
})
},
items: model2.allReasons
.map((item) {
return DropdownMenuItem<
String>(
value: item['id']
.toString(),
child: Text(
projectsProvider
.isArabic
? item['nameAr']
: item['nameEn'],
textAlign:
TextAlign.end,
),
);
}).toList(),
)),
)
: SizedBox(),
],
)
],
),
)),
Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
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: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
model2.coveringDoctors.length > 0
? Expanded(
// add Expanded to have your dropdown button fill remaining space
child:
DropdownButtonHideUnderline(
child: DropdownButton(
focusColor: Colors.grey,
isExpanded: true,
value: doctorID == null
? model2
.coveringDoctors[0]
['doctorID']
.toString()
: doctorID,
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return model2
.coveringDoctors
.map((item) {
return Row(
mainAxisSize:
MainAxisSize.max,
children: <Widget>[
AppText(
projectsProvider
.isArabic
? item[
'doctorNameN']
: item[
'doctorName'],
fontSize: SizeConfig
.textMultiplier *
2.1,
color:
Colors.grey,
),
],
);
}).toList();
},
onChanged: (newValue) => {
setState(() {
doctorID = newValue;
})
},
items: model2
.coveringDoctors
.map((item) {
return DropdownMenuItem<
String>(
value: item['doctorID']
.toString(),
child: Text(
projectsProvider
.isArabic
? item[
'doctorNameN']
: item[
'doctorName'],
textAlign:
TextAlign.start,
),
);
}).toList(),
)),
)
: SizedBox(),
],
)
],
),
)),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: widget.isUpdate == true
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
onPressed: () {
if (widget.isUpdate == true) {
updateRecheduleLeave(model2);
} else {
addRecheduleLeave(model2);
}
},
),
],
),
),
// Column(
// children: [
// Texts(TranslationBase.of(context)
// .previousSickLeaveIssue +
// ' ')
// ],
// )
],
),
),
),
),
)));
}
getProfile() async {
Map p = await sharedPref.getObj(DOCTOR_PROFILE);
setState(() {
if (widget.updateData != null) {
this.profile = p;
this.clinicID = widget.updateData.clinicId;
_toDateController.text = widget.updateData.dateTimeFrom;
_toDateController2.text = widget.updateData.dateTimeTo;
}
});
}
getClinicName(model) {
var clinicID = this.profile['ClinicID'] ?? 1;
var clinicInfo =
model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList();
return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : "";
}
addRecheduleLeave(model) {
final df = new DateFormat('yyyy-MM-ddThh:mm:ss');
Map<String, dynamic> request = {
"Requisition": {
"requisitionNo": 0,
"requisitionType": offTime,
"clinicId": this.profile['ClinicID'],
"doctorId": this.profile['ClinicID'],
"dateTimeFrom": df.format(fromDate),
"dateTimeTo": df.format(toDate),
"date": df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId":
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
"status": 2,
"schedule": [
{
"weekDayId": 1,
"shiftId": 1,
"isOpen": true,
"timeFrom": null,
"timeTo": null,
"timeFromstr": "",
"timeTostr": ""
}
]
}
};
model.addReschedule(request).then((response) {
print(response);
});
}
updateRecheduleLeave(model) {
final df = new DateFormat('yyyy-MM-ddThh:mm:ss');
Map<String, dynamic> request = {
"Requisition": {
"requisitionNo": 0,
"requisitionType": offTime,
"clinicId": this.profile['ClinicID'],
"doctorId": this.profile['ClinicID'],
"dateTimeFrom": df.format(fromDate),
"dateTimeTo": df.format(toDate),
"date": df.format(DateTime.now()),
"reasonId": reason == null ? model.allOffTime[0]['code'] : reason,
"coveringDoctorId":
doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID,
"status": 2,
"schedule": [
{
"weekDayId": 1,
"shiftId": 1,
"isOpen": true,
"timeFrom": null,
"timeTo": null,
"timeFromstr": "",
"timeTostr": ""
}
]
}
};
model.updateReschedule(request).then((response) {
print(response);
});
}
}

@ -2,10 +2,12 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_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/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.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/sick-leave/sick_leave.dart'; import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
@ -13,166 +15,167 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class AddSickLeavScreen extends StatelessWidget { class AddSickLeavScreen extends StatelessWidget {
PatiantInformtion patient;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
return BaseView<SickLeaveViewModel>( return BaseView<SickLeaveViewModel>(
onModelReady: (model) => model.getSickLeave(), onModelReady: (model) => model.getSickLeave(patient.patientMRN),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).sickleave, appBarTitle: TranslationBase.of(context).sickleave,
body: model.getAllSIckLeave.length > 0 body: SingleChildScrollView(
? SingleChildScrollView( child: Column(children: [
child: Column( PatientPageHeaderWidget(patient),
children: model.getAllSIckLeave model.getAllSIckLeave.length > 0
.map<Widget>((GetAllSickLeaveResponse item) { ? Column(
return CardWithBgWidgetNew( children: model.getAllSIckLeave
widget: Column( .map<Widget>((GetAllSickLeaveResponse item) {
children: [ return CardWithBgWidgetNew(
Container( widget: Column(
padding: EdgeInsets.only(left: 10, right: 10), children: [
child: Row( Container(
mainAxisAlignment: MainAxisAlignment.start, padding: EdgeInsets.only(left: 10, right: 10),
children: <Widget>[ child: Row(
Expanded( mainAxisAlignment: MainAxisAlignment.start,
flex: 4, children: <Widget>[
child: Wrap( Expanded(
// mainAxisAlignment: flex: 4,
// MainAxisAlignment.start, child: Wrap(
children: <Widget>[ // mainAxisAlignment:
Column( // MainAxisAlignment.start,
crossAxisAlignment: children: <Widget>[
CrossAxisAlignment.start, Column(
children: <Widget>[ crossAxisAlignment:
Container( CrossAxisAlignment.start,
padding: EdgeInsets.all(3), children: <Widget>[
child: AppText( Container(
item.status == 1 padding: EdgeInsets.all(3),
? TranslationBase.of( child: AppText(
context) item.status == 1
.approved ? TranslationBase.of(
: item.status == 2
? TranslationBase
.of(context)
.extended
: TranslationBase
.of(context)
.pending,
fontWeight: FontWeight.bold,
color: Colors.white,
),
color: item.status == 1
? Colors.green
: Colors.yellow[800],
),
Row(
children: [
AppText(
TranslationBase.of(
context)
.leaveStartDate +
' ',
fontWeight:
FontWeight.bold,
),
Flexible(
child: Text(
item.startDate,
overflow:
TextOverflow.ellipsis,
))
],
),
AppText(
item.noOfDays.toString() +
' ' +
TranslationBase.of(
context) context)
.daysSickleave, .approved
: item.status == 2
? TranslationBase.of(
context)
.extended
: TranslationBase.of(
context)
.pending,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white,
), ),
Row(children: [ color: item.status == 1
? Colors.green
: Colors.yellow[800],
),
Row(
children: [
AppText( AppText(
item.remarks, TranslationBase.of(context)
) .leaveStartDate +
]), ' ',
], fontWeight: FontWeight.bold,
), ),
SizedBox( Flexible(
width: 20, child: Text(
), item.startDate,
], overflow:
), TextOverflow.ellipsis,
))
],
),
AppText(
item.noOfDays.toString() +
' ' +
TranslationBase.of(context)
.daysSickleave,
fontWeight: FontWeight.bold,
),
Row(children: [
AppText(
item.remarks,
)
]),
],
),
SizedBox(
width: 20,
),
],
), ),
(item.status == 1 || item.status == 2) ),
? Expanded( (item.status == 1 || item.status == 2)
flex: 1, ? Expanded(
child: IconButton( flex: 1,
icon: Icon( child: IconButton(
Icons.open_in_full, icon: Icon(
size: 40, Icons.open_in_full,
), size: 25,
// color: Colors.green, //Colors.black, ),
onPressed: () => { // color: Colors.green, //Colors.black,
openSickLeave(context, true, onPressed: () => {
extendedData: item) openSickLeave(context, true,
}, extendedData: item)
)) },
: SizedBox(), ))
], : SizedBox(),
)), ],
SizedBox( )),
height: 20, SizedBox(
height: 20,
),
Divider(
height: 1,
),
],
));
}).toList(),
)
: new Builder(builder: (context) {
return Container(
height: MediaQuery.of(context).size.height * .7,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(40),
decoration: BoxDecoration(
border: Border.all(
color: HexColor('#B8382C'), width: 4),
borderRadius:
BorderRadius.all(Radius.circular(100))),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
),
onPressed: () {
openSickLeave(
context,
false,
);
}),
), ),
Divider( Padding(
height: 1, child: AppText(
TranslationBase.of(context)
.noSickLeaveApplied,
fontWeight: FontWeight.bold,
),
padding: EdgeInsets.all(10),
), ),
AppText(
TranslationBase.of(context).applyNow,
fontWeight: FontWeight.bold,
color: HexColor('#B8382C'),
)
], ],
)); ));
}).toList(),
),
)
: new Builder(builder: (context) {
return Center(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(40),
decoration: BoxDecoration(
border: Border.all(
color: HexColor('#B8382C'), width: 4),
borderRadius:
BorderRadius.all(Radius.circular(100))),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
),
onPressed: () {
openSickLeave(
context,
false,
);
}),
),
Padding(
child: AppText(
TranslationBase.of(context).noSickLeaveApplied,
fontWeight: FontWeight.bold,
),
padding: EdgeInsets.all(10),
),
AppText(
TranslationBase.of(context).applyNow,
fontWeight: FontWeight.bold,
color: HexColor('#B8382C'),
)
],
),
));
}), }),
)); ]))));
} }
openSickLeave(BuildContext context, isExtend, openSickLeave(BuildContext context, isExtend,
@ -182,11 +185,15 @@ class AddSickLeavScreen extends StatelessWidget {
builder: (context) { builder: (context) {
return new Container( return new Container(
child: SickLeaveScreen( child: SickLeaveScreen(
appointmentNo: extendedData.appointmentNo, appointmentNo: isExtend == true
patientMRN: extendedData.patientMRN, ? extendedData.appointmentNo
isExtended: isExtend, : patient.appointmentNo, //extendedData.appointmentNo,
extendedData: extendedData, patientMRN: isExtend == true
)); ? extendedData.patientMRN
: patient.patientMRN,
isExtended: isExtend,
extendedData: extendedData,
patient: patient));
}); });
} }
} }

@ -6,9 +6,11 @@ import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.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/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/text_validator.dart'; import 'package:doctor_app_flutter/util/text_validator.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -28,11 +30,13 @@ class SickLeaveScreen extends StatefulWidget {
final GetAllSickLeaveResponse extendedData; final GetAllSickLeaveResponse extendedData;
final appointmentNo; final appointmentNo;
final patientMRN; final patientMRN;
final patient;
SickLeaveScreen( SickLeaveScreen(
{this.appointmentNo, {this.appointmentNo,
this.patientMRN, this.patientMRN,
this.isExtended = false, this.isExtended = false,
this.extendedData}); this.extendedData,
this.patient});
@override @override
_SickLeaveScreenState createState() => _SickLeaveScreenState(); _SickLeaveScreenState createState() => _SickLeaveScreenState();
} }
@ -48,7 +52,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
context: context, context: context,
initialDate: DateTime.now(), initialDate: DateTime.now(),
firstDate: DateTime(2019), firstDate: DateTime(2019),
lastDate: DateTime.now(), lastDate: DateTime(2050),
).then((pickedDate) { ).then((pickedDate) {
if (pickedDate == null) { if (pickedDate == null) {
return; return;
@ -252,6 +256,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
model2.sickLeaveStatistics[ model2.sickLeaveStatistics[
'recommendedSickLeaveDays'], 'recommendedSickLeaveDays'],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
), ),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
) )
@ -339,9 +344,7 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
print(value); print(value);
}); });
} else { } else {
model2 _validateInputs(model2);
.addSickLeave(addSickLeave)
.then((value) => print(value));
} }
}, },
), ),
@ -363,6 +366,27 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
))); )));
} }
void _validateInputs(model2) async {
try {
if (addSickLeave.noOfDays == null) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseEnterNoOfDays);
} else if (addSickLeave.remarks == null) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseEnterRemarks);
} else if (addSickLeave.startDate == null) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseEnterDate);
} else {
addSickLeave.patientMRN = widget.patient.patientMRN.toString();
addSickLeave.appointmentNo = widget.patient.appointmentNo.toString();
model2.addSickLeave(addSickLeave).then((value) => print(value));
}
} catch (err) {
print(err);
}
}
getProfile() async { getProfile() async {
Map p = await sharedPref.getObj(DOCTOR_PROFILE); Map p = await sharedPref.getObj(DOCTOR_PROFILE);
setState(() { setState(() {

@ -388,88 +388,153 @@ class TranslationBase {
String get indication => localizedValues['indication'][locale.languageCode]; String get indication => localizedValues['indication'][locale.languageCode];
String get duration => localizedValues['duration'][locale.languageCode]; String get duration => localizedValues['duration'][locale.languageCode];
String get instruction => localizedValues['instruction'][locale.languageCode]; String get instruction => localizedValues['instruction'][locale.languageCode];
String get rescheduleLeaves =>
localizedValues['reschedule-leave'][locale.languageCode];
String get addMedication => String get addMedication =>
localizedValues['addMedication'][locale.languageCode]; localizedValues['addMedication'][locale.languageCode];
String get route => localizedValues['route'][locale.languageCode]; String get route => localizedValues['route'][locale.languageCode];
String get noReScheduleLeave =>
localizedValues['no-reschedule-leave'][locale.languageCode];
String get weight => localizedValues['weight'][locale.languageCode]; String get weight => localizedValues['weight'][locale.languageCode];
String get kg => localizedValues['kg'][locale.languageCode]; String get kg => localizedValues['kg'][locale.languageCode];
String get height => localizedValues['height'][locale.languageCode]; String get height => localizedValues['height'][locale.languageCode];
String get cm => localizedValues['cm'][locale.languageCode]; String get cm => localizedValues['cm'][locale.languageCode];
String get idealBodyWeight => localizedValues['idealBodyWeight'][locale.languageCode]; String get idealBodyWeight =>
localizedValues['idealBodyWeight'][locale.languageCode];
String get waistSize => localizedValues['waistSize'][locale.languageCode]; String get waistSize => localizedValues['waistSize'][locale.languageCode];
String get inch => localizedValues['inch'][locale.languageCode]; String get inch => localizedValues['inch'][locale.languageCode];
String get headCircum => localizedValues['headCircum'][locale.languageCode]; String get headCircum => localizedValues['headCircum'][locale.languageCode];
String get leanBodyWeight => localizedValues['leanBodyWeight'][locale.languageCode]; String get leanBodyWeight =>
String get bodyMassIndex => localizedValues['bodyMassIndex'][locale.languageCode]; localizedValues['leanBodyWeight'][locale.languageCode];
String get bodyMassIndex =>
localizedValues['bodyMassIndex'][locale.languageCode];
String get method => localizedValues['method'][locale.languageCode]; String get method => localizedValues['method'][locale.languageCode];
String get pulseBeats => localizedValues['pulseBeats'][locale.languageCode]; String get pulseBeats => localizedValues['pulseBeats'][locale.languageCode];
String get rhythm => localizedValues['rhythm'][locale.languageCode]; String get rhythm => localizedValues['rhythm'][locale.languageCode];
String get respBeats => localizedValues['respBeats'][locale.languageCode]; String get respBeats => localizedValues['respBeats'][locale.languageCode];
String get patternOfRespiration => localizedValues['patternOfRespiration'][locale.languageCode]; String get patternOfRespiration =>
String get bloodPressureDiastoleAndSystole => localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; localizedValues['patternOfRespiration'][locale.languageCode];
String get cuffLocation => localizedValues['cuffLocation'][locale.languageCode]; String get bloodPressureDiastoleAndSystole =>
localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode];
String get cuffLocation =>
localizedValues['cuffLocation'][locale.languageCode];
String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; String get cuffSize => localizedValues['cuffSize'][locale.languageCode];
String get patientPosition => localizedValues['patientPosition'][locale.languageCode]; String get patientPosition =>
localizedValues['patientPosition'][locale.languageCode];
String get fio2 => localizedValues['fio2'][locale.languageCode]; String get fio2 => localizedValues['fio2'][locale.languageCode];
String get sao2 => localizedValues['sao2'][locale.languageCode]; String get sao2 => localizedValues['sao2'][locale.languageCode];
String get painManagement => localizedValues['painManagement'][locale.languageCode]; String get painManagement =>
localizedValues['painManagement'][locale.languageCode];
String get holiday => localizedValues['holiday'][locale.languageCode];
String get to => localizedValues['to'][locale.languageCode];
String get coveringDoctor =>
localizedValues['coveringDoctor'][locale.languageCode];
String get requestLeave =>
localizedValues['requestLeave'][locale.languageCode];
String get pleaseEnterDate =>
localizedValues['pleaseEnterDate'][locale.languageCode];
String get pleaseEnterNoOfDays =>
localizedValues['pleaseEnterNoOfDays'][locale.languageCode];
String get pleaseEnterRemarks =>
localizedValues['pleaseEnterRemarks'][locale.languageCode];
String get update => localizedValues['update'][locale.languageCode];
String get admission => localizedValues['admission'][locale.languageCode]; String get admission => localizedValues['admission'][locale.languageCode];
String get request => localizedValues['request'][locale.languageCode]; String get request => localizedValues['request'][locale.languageCode];
String get admissionRequest => localizedValues['admissionRequest'][locale.languageCode]; String get admissionRequest =>
String get patientDetails => localizedValues['patientDetails'][locale.languageCode]; localizedValues['admissionRequest'][locale.languageCode];
String get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail'][locale.languageCode]; String get patientDetails =>
String get referringDate => localizedValues['referringDate'][locale.languageCode]; localizedValues['patientDetails'][locale.languageCode];
String get referringDoctor => localizedValues['referringDoctor'][locale.languageCode]; String get specialityAndDoctorDetail =>
String get otherInformation => localizedValues['otherInformation'][locale.languageCode]; localizedValues['specialityAndDoctorDetail'][locale.languageCode];
String get expectedDays => localizedValues['expectedDays'][locale.languageCode]; String get referringDate =>
String get expectedAdmissionDate => localizedValues['expectedAdmissionDate'][locale.languageCode]; localizedValues['referringDate'][locale.languageCode];
String get emergencyAdmission => localizedValues['emergencyAdmission'][locale.languageCode]; String get referringDoctor =>
String get patientPregnant => localizedValues['patientPregnant'][locale.languageCode]; localizedValues['referringDoctor'][locale.languageCode];
String get treatmentLine => localizedValues['treatmentLine'][locale.languageCode]; String get otherInformation =>
localizedValues['otherInformation'][locale.languageCode];
String get expectedDays =>
localizedValues['expectedDays'][locale.languageCode];
String get expectedAdmissionDate =>
localizedValues['expectedAdmissionDate'][locale.languageCode];
String get emergencyAdmission =>
localizedValues['emergencyAdmission'][locale.languageCode];
String get patientPregnant =>
localizedValues['patientPregnant'][locale.languageCode];
String get treatmentLine =>
localizedValues['treatmentLine'][locale.languageCode];
String get ward => localizedValues['ward'][locale.languageCode]; String get ward => localizedValues['ward'][locale.languageCode];
String get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred'][locale.languageCode]; String get preAnesthesiaReferred =>
String get admissionType => localizedValues['admissionType'][locale.languageCode]; localizedValues['preAnesthesiaReferred'][locale.languageCode];
String get admissionType =>
localizedValues['admissionType'][locale.languageCode];
String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; String get diagnosis => localizedValues['diagnosis'][locale.languageCode];
String get allergies => localizedValues['allergies'][locale.languageCode]; String get allergies => localizedValues['allergies'][locale.languageCode];
String get preOperativeOrders => localizedValues['preOperativeOrders'][locale.languageCode]; String get preOperativeOrders =>
String get elementForImprovement => localizedValues['elementForImprovement'][locale.languageCode]; localizedValues['preOperativeOrders'][locale.languageCode];
String get dischargeDate => localizedValues['dischargeDate'][locale.languageCode]; String get elementForImprovement =>
localizedValues['elementForImprovement'][locale.languageCode];
String get dischargeDate =>
localizedValues['dischargeDate'][locale.languageCode];
String get dietType => localizedValues['dietType'][locale.languageCode]; String get dietType => localizedValues['dietType'][locale.languageCode];
String get dietTypeRemarks => localizedValues['dietTypeRemarks'][locale.languageCode]; String get dietTypeRemarks =>
localizedValues['dietTypeRemarks'][locale.languageCode];
String get save => localizedValues['save'][locale.languageCode]; String get save => localizedValues['save'][locale.languageCode];
String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; String get postPlansEstimatedCost =>
localizedValues['postPlansEstimatedCost'][locale.languageCode];
String get ucaf => localizedValues['ucaf'][locale.languageCode]; String get ucaf => localizedValues['ucaf'][locale.languageCode];
String get emergencyCase => localizedValues['emergencyCase'][locale.languageCode]; String get emergencyCase =>
String get durationOfIllness => localizedValues['durationOfIllness'][locale.languageCode]; localizedValues['emergencyCase'][locale.languageCode];
String get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; String get durationOfIllness =>
String get patientFeelsPainInHisBackAndCough => localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; localizedValues['durationOfIllness'][locale.languageCode];
String get additionalTextComplaints => localizedValues['additionalTextComplaints'][locale.languageCode]; String get chiefComplaintsAndSymptoms =>
String get otherConditions => localizedValues['otherConditions'][locale.languageCode]; localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode];
String get patientFeelsPainInHisBackAndCough =>
localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode];
String get additionalTextComplaints =>
localizedValues['additionalTextComplaints'][locale.languageCode];
String get otherConditions =>
localizedValues['otherConditions'][locale.languageCode];
String get other => localizedValues['other'][locale.languageCode]; String get other => localizedValues['other'][locale.languageCode];
String get how => localizedValues['how'][locale.languageCode]; String get how => localizedValues['how'][locale.languageCode];
String get when => localizedValues['when'][locale.languageCode]; String get when => localizedValues['when'][locale.languageCode];
String get where => localizedValues['where'][locale.languageCode]; String get where => localizedValues['where'][locale.languageCode];
String get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement'][locale.languageCode]; String get specifyPossibleLineManagement =>
String get significantSigns => localizedValues['significantSigns'][locale.languageCode]; localizedValues['specifyPossibleLineManagement'][locale.languageCode];
String get significantSigns =>
localizedValues['significantSigns'][locale.languageCode];
String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode];
String get reasons => localizedValues['reasons'][locale.languageCode];
String get createNew => localizedValues['createNew'][locale.languageCode]; String get createNew => localizedValues['createNew'][locale.languageCode];
String get update => localizedValues['update'][locale.languageCode];
String get episode => localizedValues['episode'][locale.languageCode];
String get episode => localizedValues['episode'][locale.languageCode];
String get medications => localizedValues['medications'][locale.languageCode];
String get procedures => localizedValues['procedures'][locale.languageCode];
String get chiefComplaints=> localizedValues['chiefComplaints'][locale.languageCode]; String get chiefComplaints =>
localizedValues['chiefComplaints'][locale.languageCode];
String get histories => localizedValues['histories'][locale.languageCode]; String get histories => localizedValues['histories'][locale.languageCode];
String get allergiesSoap => localizedValues['allergiesSoap'][locale.languageCode]; String get allergiesSoap =>
String get addChiefComplaints => localizedValues['addChiefComplaints'][locale.languageCode]; localizedValues['allergiesSoap'][locale.languageCode];
String get historyOfPresentIllness => localizedValues['historyOfPresentIllness'][locale.languageCode]; String get addChiefComplaints =>
localizedValues['addChiefComplaints'][locale.languageCode];
String get historyOfPresentIllness =>
localizedValues['historyOfPresentIllness'][locale.languageCode];
String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode];
String get addHistory => localizedValues['addHistory'][locale.languageCode]; String get addHistory => localizedValues['addHistory'][locale.languageCode];
String get searchHistory => localizedValues['searchHistory'][locale.languageCode]; String get searchHistory =>
String get addSelectedHistories => localizedValues['addSelectedHistories'][locale.languageCode]; localizedValues['searchHistory'][locale.languageCode];
String get addAllergies => localizedValues['addAllergies'][locale.languageCode]; String get addSelectedHistories =>
localizedValues['addSelectedHistories'][locale.languageCode];
String get addAllergies =>
localizedValues['addAllergies'][locale.languageCode];
String get itemExist => localizedValues['itemExist'][locale.languageCode]; String get itemExist => localizedValues['itemExist'][locale.languageCode];
String get selectAllergy => localizedValues['selectAllergy'][locale.languageCode]; String get selectAllergy =>
String get selectSeverity => localizedValues['selectSeverity'][locale.languageCode]; localizedValues['selectAllergy'][locale.languageCode];
String get selectSeverity =>
localizedValues['selectSeverity'][locale.languageCode];
String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode];
String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode];
String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -0,0 +1,73 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class PatientHeaderWidgetNoAvatar extends StatelessWidget {
final PatiantInformtion patient;
PatientHeaderWidgetNoAvatar(this.patient);
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
margin: EdgeInsets.all(16),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
patient.firstName + ' ' + patient.lastName,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.2,
),
Row(
children: [
AppText(
"VIP",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.2,
),
SizedBox(
width: 8,
),
AppText(
" ${patient.age}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
AppText(
"NEW VISIT",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${patient.companyName}",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
),
Icon(
Icons.info_outline,
color: Colors.black,
),
],
),
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
],
);
}
}

@ -35,9 +35,6 @@ class _AppDrawerState extends State<AppDrawer> {
// _isInit = false; // _isInit = false;
// } // }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AuthViewModel authProvider = Provider.of(context); AuthViewModel authProvider = Provider.of(context);
@ -68,20 +65,24 @@ class _AppDrawerState extends State<AppDrawer> {
), ),
), ),
SizedBox(height: 15), SizedBox(height: 15),
CircleAvatar( authProvider.doctorProfile != null
radius: SizeConfig.imageSizeMultiplier * 12, ? CircleAvatar(
backgroundImage: radius: SizeConfig.imageSizeMultiplier * 12,
NetworkImage(authProvider.doctorProfile.doctorImageURL), backgroundImage: NetworkImage(
backgroundColor: Colors.white, authProvider.doctorProfile.doctorImageURL),
), backgroundColor: Colors.white,
Padding( )
padding: EdgeInsets.only(top: 10), : SizedBox(),
child: AppText( authProvider.doctorProfile != null
authProvider.doctorProfile?.doctorName, ? Padding(
fontWeight: FontWeight.bold, padding: EdgeInsets.only(top: 10),
color: Colors.black, child: AppText(
fontSize: SizeConfig.textMultiplier * 2, authProvider.doctorProfile?.doctorName,
)), fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: SizeConfig.textMultiplier * 2,
))
: SizedBox(),
AppText( AppText(
"Director of medical records", //TODO: Make The Dr Title Dynamic and check overflow issue. "Director of medical records", //TODO: Make The Dr Title Dynamic and check overflow issue.
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -121,7 +122,9 @@ class _AppDrawerState extends State<AppDrawer> {
), ),
InkWell( InkWell(
child: DrawerItem( child: DrawerItem(
TranslationBase.of(context).qr+ TranslationBase.of(context).reader, DoctorApp.qr_code), TranslationBase.of(context).qr +
TranslationBase.of(context).reader,
DoctorApp.qr_code),
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
Navigator.of(context).pushNamed(QR_READER); Navigator.of(context).pushNamed(QR_READER);

@ -9,9 +9,10 @@ import 'package:progress_hud_v2/progress_hud.dart';
*@desc: AppLoaderWidget to create loader *@desc: AppLoaderWidget to create loader
*/ */
class AppLoaderWidget extends StatefulWidget { class AppLoaderWidget extends StatefulWidget {
AppLoaderWidget({Key key, this.title}) : super(key: key); AppLoaderWidget({Key key, this.title, this.containerColor}) : super(key: key);
final String title; final String title;
final Color containerColor;
@override @override
_AppLoaderWidgetState createState() => new _AppLoaderWidgetState(); _AppLoaderWidgetState createState() => new _AppLoaderWidgetState();
@ -30,7 +31,7 @@ class _AppLoaderWidgetState extends State<AppLoaderWidget> {
*@desc: create loader the desing *@desc: create loader the desing
*/ */
_progressHUD = new ProgressHUD( _progressHUD = new ProgressHUD(
backgroundColor: Colors.black12, backgroundColor: widget.containerColor == null ? Colors.black12 : widget.containerColor,
color: Colors.black, color: Colors.black,
// containerColor: Colors.blue, // containerColor: Colors.blue,
borderRadius: 5.0, borderRadius: 5.0,

@ -260,6 +260,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.10" version: "1.3.10"
date_time_picker:
dependency: "direct main"
description:
name: date_time_picker
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
device_info: device_info:
dependency: "direct main" dependency: "direct main"
description: description:
@ -454,7 +461,7 @@ packages:
name: js name: js
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.3-nullsafety.1" version: "0.6.2"
json_annotation: json_annotation:
dependency: transitive dependency: transitive
description: description:
@ -496,7 +503,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.4" version: "1.3.0-nullsafety.3"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -753,7 +760,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.2" version: "1.10.0-nullsafety.1"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
@ -888,5 +895,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <=2.11.0-213.1.beta" dart: ">=2.10.0 <2.11.0"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

@ -62,6 +62,7 @@ dependencies:
#Autocomplete TextField #Autocomplete TextField
autocomplete_textfield: ^1.7.3 autocomplete_textfield: ^1.7.3
date_time_picker: ^1.1.1
# Html # Html
html: ^0.14.0+4 html: ^0.14.0+4

Loading…
Cancel
Save