Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into design-updates

 Conflicts:
	lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart
merge-requests/213/head
Mohammad Aljammal 5 years ago
commit f0f98280b4

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

@ -82,12 +82,10 @@ class BaseAppClient {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
// if (!parsed['IsAuthenticated']) { if (!parsed['IsAuthenticated']) {
// // TODO: return it back when IsAuthenticated work fine in all service await helpers.logout();
// // await helpers.logout(); helpers.showErrorToast('Your session expired Please login agian');
// } else
// helpers.showErrorToast('Your session expired Please login agian');
// } else
if (parsed['MessageStatus'] == 1) { if (parsed['MessageStatus'] == 1) {
if (!parsed['IsAuthenticated']) if (!parsed['IsAuthenticated'])
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);

@ -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 =

@ -278,6 +278,7 @@ const Map<String, Map<String, String>> localizedValues = {
"sick-leave-days": {"en": "Sick leave days", "ar": "عدد ايام الاجازة."}, "sick-leave-days": {"en": "Sick leave days", "ar": "عدد ايام الاجازة."},
'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '}, 'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '},
'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'}, 'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'},
'date': {'en': 'Date', 'ar': 'التاريخ'},
'admissionNo': {'en': 'ADMISSION #: ', 'ar': 'قبول #:'}, 'admissionNo': {'en': 'ADMISSION #: ', 'ar': 'قبول #:'},
'losNo': {'en': 'LOS #:', 'ar': 'LOS #:'}, 'losNo': {'en': 'LOS #:', 'ar': 'LOS #:'},
'area': {'en': 'AREA:', 'ar': 'المنطقة'}, 'area': {'en': 'AREA:', 'ar': 'المنطقة'},
@ -353,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': 'الطول'},
@ -368,11 +377,131 @@ 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': 'قبول'},
'request': {'en': "Request", 'ar': 'طلب'},
'admissionRequest': {'en': "Admission Request", 'ar': 'طلب قبول'},
'patientDetails': {'en': "Patient Details", 'ar': 'تفاصيل المريض'},
'specialityAndDoctorDetail': {
'en': "SPECIALITY AND DOCTOR DETAILS",
'ar': 'تفاصيل التخصص والطبيب'
},
'referringDate': {'en': "Referring Date", 'ar': 'تاريخ الإحالة'},
'referringDoctor': {'en': "Referring Doctor", 'ar': 'دكتور الإحالة'},
'otherInformation': {'en': "Other Information", 'ar': 'معلومات أخرى'},
'expectedDays': {'en': "Expected Days", 'ar': 'الأيام المتوقعة'},
'expectedAdmissionDate': {
'en': "Expected Admission Date",
'ar': 'تاريخ القبول المتوقع'
},
'emergencyAdmission': {'en': "EMERGENCY ADMISSION", 'ar': 'دخول الطوارئ'},
'patientPregnant': {'en': "Patient Pregnant", 'ar': 'حمل المريض'},
'treatmentLine': {
'en': "Main line of treatment",
'ar': 'الخط الرئيسي للعلاج'
},
'ward': {'en': "Ward", 'ar': 'رعاية'},
'preAnesthesiaReferred': {
'en': "PRE ANESTHESIA REFERRED",
'ar': 'الاحالة قبل التخدير'
},
'admissionType': {'en': "Admission Type", 'ar': 'نوع القبول'},
'diagnosis': {'en': "Diagnosis", 'ar': 'التشخيص'},
'allergies': {'en': "Allergies", 'ar': 'الحساسية'},
'preOperativeOrders': {
'en': "Pre Operative Orders",
'ar': 'أوامر ما قبل العملية'
},
'elementForImprovement': {
'en': "Element For Improvement",
'ar': 'عنصر للتحسين'
},
'dischargeDate': {'en': "Discharge Date", 'ar': 'تاريخ التفريغ'},
'dietType': {'en': "Diet Type", 'ar': 'نوع النظام الغذائي'},
'dietTypeRemarks': {
'en': "Remarks on diet type",
'ar': 'ملاحظات على نوع النظام الغذائي'
},
'save': {'en': "SAVE", 'ar': 'حفظ'},
'postPlansEstimatedCost': {
'en': "POST PLANS & ESTIMATED COST",
'ar': 'خطط البريد والتكلفة المقدرة'
},
'ucaf': {'en': "UCAF", 'ar': 'UCAF'},
'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'},
'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'},
'chiefComplaintsAndSymptoms': {
'en': "CHIEF COMPLAINTS & OTHER SYMPTOMS",
'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': 'شروط أخرى'},
'other': {'en': "Other", 'ar': 'أخرى'},
'how': {'en': "How", 'ar': 'كيف'},
'when': {'en': "When", 'ar': 'متى'},
'where': {'en': "Where", 'ar': 'أين'},
'specifyPossibleLineManagement': {
'en': "Specify possible line of management",
'ar': 'حدد خط الإدارة المحتمل'
},
'significantSigns': {'en': "SIGNIFICANT SIGNS", 'ar': 'علامات مهمة'},
'backAbdomen': {'en': "Back : Abdomen", 'ar': 'الظهر: البطن'},
'reasons': {'en': "Reasons", 'ar': 'الأسباب'},
'createNew': {'en': "Create New", 'ar': 'انشاء '},
'episode': {'en': "Episode", 'ar': 'Episode'},
'chiefComplaints': {'en': "Chief Complaints", 'ar': 'الشكاوى'},
'addChiefComplaints': {'en': "Add Chief Complaints", 'ar': ' اضافه الشكاوى'},
'histories': {'en': "Histories", 'ar': 'التاريخ المرضي'},
'allergiesSoap': {'en': "Allergies", 'ar': 'الحساسية'},
'historyOfPresentIllness': {
'en': "History of Present Illness",
'ar': 'تاريخ المرض الحالي'
},
'requiredMsg': {
'en': "Please add required field correctly",
'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': "أختر الدرجه"},
}; };

@ -10,7 +10,9 @@ enum MasterKeysService {
physiotherapyGoals, physiotherapyGoals,
DiagnosisCondition, DiagnosisCondition,
DiagnosisType, DiagnosisType,
ICD10 ICD10,
TemperatureMethods,
Speciality
} }
extension SelectedMasterKeysService on MasterKeysService { extension SelectedMasterKeysService on MasterKeysService {
@ -51,6 +53,10 @@ extension SelectedMasterKeysService on MasterKeysService {
break; break;
case MasterKeysService.ICD10: case MasterKeysService.ICD10:
return 2500; return 2500;
case MasterKeysService.TemperatureMethods:
return 2005;
case MasterKeysService.Speciality:
return 10;
break; break;
} }
} }

@ -3,6 +3,8 @@ import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintR
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart';
@ -27,6 +29,7 @@ class SOAPService extends LookupService {
List<GetHistoryResModel> patientHistoryList = []; List<GetHistoryResModel> patientHistoryList = [];
List<GetPhysicalExamResModel> patientPhysicalExamList = []; List<GetPhysicalExamResModel> patientPhysicalExamList = [];
List<GetGetProgressNoteResModel> patientProgressNoteList = []; List<GetGetProgressNoteResModel> patientProgressNoteList = [];
List<GetAssessmentResModel> patientAssessmentList = [];
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
await baseAppClient.post( await baseAppClient.post(
@ -209,17 +212,18 @@ class SOAPService extends LookupService {
} }
Future getPatientHistories( Future getPatientHistories(
GetHistoryReqModel getHistoryReqModel) async { GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async {
hasError = false; hasError = false;
await baseAppClient.post (GET_HISTORY, await baseAppClient.post(GET_HISTORY,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
patientHistoryList.clear(); if (isFirst)
response['List_History']['entityList'].forEach((v) { patientHistoryList.clear();
patientHistoryList.add(GetHistoryResModel.fromJson(v)); response['List_History']['entityList'].forEach((v) {
}); patientHistoryList.add(GetHistoryResModel.fromJson(v));
}, onFailure: (String error, int statusCode) { });
hasError = true; }, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error; super.error = error;
}, body: getHistoryReqModel.toJson()); }, body: getHistoryReqModel.toJson());
} }
@ -266,6 +270,7 @@ class SOAPService extends LookupService {
response['ProgressNoteList']['entityList'].forEach((v) { response['ProgressNoteList']['entityList'].forEach((v) {
patientProgressNoteList.add(GetGetProgressNoteResModel.fromJson(v)); patientProgressNoteList.add(GetGetProgressNoteResModel.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -273,14 +278,18 @@ class SOAPService extends LookupService {
} }
Future getPatientAssessment( Future getPatientAssessment(
PostAssessmentRequestModel getPatientAssessmentRequestModel) async { GetAssessmentReqModel getAssessmentReqModel) async {
hasError = false; hasError = false;
await baseAppClient.post (GET_ASSESSMENT, await baseAppClient.post (GET_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
patientAssessmentList.clear();
response['AssessmentList']['entityList'].forEach((v) {
patientAssessmentList.add(GetAssessmentResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: getPatientAssessmentRequestModel.toJson()); }, body: getAssessmentReqModel.toJson());
} }
} }

@ -35,6 +35,8 @@ class LookupService extends BaseService {
List<MasterKeyModel> listOfDiagnosisType = []; List<MasterKeyModel> listOfDiagnosisType = [];
List<MasterKeyModel> listOfDiagnosisCondition = []; List<MasterKeyModel> listOfDiagnosisCondition = [];
List<MasterKeyModel> listOfICD10 = []; List<MasterKeyModel> listOfICD10 = [];
List<MasterKeyModel> listOfTemperatureMethods = [];
List<MasterKeyModel> listOfSpeciality = [];
Future getMasterLookup(MasterKeysService masterKeys) async { Future getMasterLookup(MasterKeysService masterKeys) async {
hasError = false; hasError = false;
@ -122,13 +124,27 @@ class LookupService extends BaseService {
.add(MasterKeyModel.fromJson(v)); .add(MasterKeyModel.fromJson(v));
}); });
break; break;
case MasterKeysService.ICD10: case MasterKeysService.ICD10:
listOfICD10.clear(); listOfICD10.clear();
entryList.forEach((v) { entryList.forEach((v) {
listOfICD10 listOfICD10
.add(MasterKeyModel.fromJson(v)); .add(MasterKeyModel.fromJson(v));
}); });
break; break;
case MasterKeysService.TemperatureMethods:
listOfTemperatureMethods.clear();
entryList.forEach((v) {
listOfTemperatureMethods
.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.Speciality:
listOfSpeciality.clear();
entryList.forEach((v) {
listOfSpeciality
.add(MasterKeyModel.fromJson(v));
});
break;
} }
} }

@ -0,0 +1,31 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
class AdmissionRequestService extends LookupService {
List<dynamic> doctorsList = [];
List<dynamic> specialityList = [];
setSpecialityList() {
specialityList.clear();
listOfSpeciality.forEach((element) {
specialityList.add(element.toJson());
});
}
Future getDoctorsList() async {
hasError = false;
await baseAppClient.post(
PATIENT_GET_DOCTOR_BY_CLINIC_URL,
onSuccess: (dynamic response, int statusCode) {
doctorsList = [];
doctorsList = response['List_Doctors_All'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: Map(),
);
}
}

@ -0,0 +1,5 @@
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class UcafService extends BaseService {
}

@ -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,
); );
} }
} }

@ -5,6 +5,8 @@ import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintR
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart';
@ -64,14 +66,19 @@ class SOAPViewModel extends BaseViewModel {
List<GetAllergiesResModel> get patientAllergiesList => List<GetAllergiesResModel> get patientAllergiesList =>
_SOAPService.patientAllergiesList; _SOAPService.patientAllergiesList;
List<GetHistoryResModel> get patientHistoryList => List<GetHistoryResModel> get patientHistoryList =>
_SOAPService.patientHistoryList; _SOAPService.patientHistoryList;
List<GetPhysicalExamResModel> get patientPhysicalExamList =>
List<GetPhysicalExamResModel> get patientPhysicalExamList =>
_SOAPService.patientPhysicalExamList; _SOAPService.patientPhysicalExamList;
List<GetGetProgressNoteResModel> get patientProgressNoteList => List<GetGetProgressNoteResModel> get patientProgressNoteList =>
_SOAPService.patientProgressNoteList; _SOAPService.patientProgressNoteList;
List<GetAssessmentResModel> get patientAssessmentList =>
_SOAPService.patientAssessmentList;
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getAllergies(getAllergiesRequestModel); await _SOAPService.getAllergies(getAllergiesRequestModel);
@ -219,17 +226,17 @@ class SOAPViewModel extends BaseViewModel {
await _SOAPService.getPatientAllergy(generalGetReqForSOAP); await _SOAPService.getPatientAllergy(generalGetReqForSOAP);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
setState(ViewState.Busy); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getPatientHistories(GetHistoryReqModel getHistoryReqModel) async { Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getPatientHistories(getHistoryReqModel); await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: isFirst);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
setState(ViewState.Busy); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
@ -240,7 +247,7 @@ class SOAPViewModel extends BaseViewModel {
await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel); await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
setState(ViewState.Busy); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
@ -266,24 +273,22 @@ class SOAPViewModel extends BaseViewModel {
} }
Future getPatientAssessment( Future getPatientAssessment(
PostAssessmentRequestModel getPatientAssessmentRequestModel) async { GetAssessmentReqModel getAssessmentReqModel) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getPatientAssessment(getPatientAssessmentRequestModel); await _SOAPService.getPatientAssessment(getAssessmentReqModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
setState(ViewState.Busy); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
// ignore: missing_return // ignore: missing_return
MasterKeyModel getOneMasterKey( MasterKeyModel getOneMasterKey(
{@required MasterKeysService masterKeys, int id, int typeId}) { {@required MasterKeysService masterKeys, dynamic id, int typeId}) {
switch (masterKeys) { switch (masterKeys) {
case MasterKeysService.Allergies: case MasterKeysService.Allergies:
List<MasterKeyModel> result = allergiesList.where((element) { List<MasterKeyModel> result = allergiesList.where((element) {
print(element.id == id);
return element.id == id && return element.id == id &&
element.typeId == masterKeys.getMasterKeyService(); element.typeId == masterKeys.getMasterKeyService();
}).toList(); }).toList();
@ -294,7 +299,6 @@ class SOAPViewModel extends BaseViewModel {
case MasterKeysService.HistoryFamily: case MasterKeysService.HistoryFamily:
List<MasterKeyModel> result = historyFamilyList.where((element) { List<MasterKeyModel> result = historyFamilyList.where((element) {
print(element.id == id);
return element.id == id && return element.id == id &&
element.typeId == masterKeys.getMasterKeyService(); element.typeId == masterKeys.getMasterKeyService();
}).toList(); }).toList();
@ -304,7 +308,6 @@ class SOAPViewModel extends BaseViewModel {
break; break;
case MasterKeysService.HistoryMedical: case MasterKeysService.HistoryMedical:
List<MasterKeyModel> result = historyMedicalList.where((element) { List<MasterKeyModel> result = historyMedicalList.where((element) {
print(element.id == id);
return element.id == id && return element.id == id &&
element.typeId == masterKeys.getMasterKeyService(); element.typeId == masterKeys.getMasterKeyService();
}).toList(); }).toList();
@ -314,7 +317,6 @@ class SOAPViewModel extends BaseViewModel {
break; break;
case MasterKeysService.HistorySocial: case MasterKeysService.HistorySocial:
List<MasterKeyModel> result = historySocialList.where((element) { List<MasterKeyModel> result = historySocialList.where((element) {
print(element.id == id);
return element.id == id && return element.id == id &&
element.typeId == masterKeys.getMasterKeyService(); element.typeId == masterKeys.getMasterKeyService();
}).toList(); }).toList();
@ -324,7 +326,6 @@ class SOAPViewModel extends BaseViewModel {
break; break;
case MasterKeysService.HistorySports: case MasterKeysService.HistorySports:
List<MasterKeyModel> result = historySocialList.where((element) { List<MasterKeyModel> result = historySocialList.where((element) {
print(element.id == id);
return element.id == id && return element.id == id &&
element.typeId == masterKeys.getMasterKeyService(); element.typeId == masterKeys.getMasterKeyService();
}).toList(); }).toList();
@ -334,17 +335,13 @@ class SOAPViewModel extends BaseViewModel {
break; break;
case MasterKeysService.HistorySurgical: case MasterKeysService.HistorySurgical:
List<MasterKeyModel> result = historySurgicalList.where((element) { List<MasterKeyModel> result = historySurgicalList.where((element) {
print(element.id == id); return element.id == id;}).toList();
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) { if (result.isNotEmpty) {
return result.first; return result.first;
} }
break; break;
case MasterKeysService.PhysicalExamination: case MasterKeysService.PhysicalExamination:
List<MasterKeyModel> result = physicalExaminationList.where((element) { List<MasterKeyModel> result = physicalExaminationList.where((element) {
print(element.id == id);
return element.id == id && return element.id == id &&
element.typeId == masterKeys.getMasterKeyService(); element.typeId == masterKeys.getMasterKeyService();
}).toList(); }).toList();
@ -354,7 +351,6 @@ class SOAPViewModel extends BaseViewModel {
break; break;
case MasterKeysService.AllergySeverity: case MasterKeysService.AllergySeverity:
List<MasterKeyModel> result = allergySeverityList.where((element) { List<MasterKeyModel> result = allergySeverityList.where((element) {
print(element.id == id);
return element.id == id && return element.id == id &&
element.typeId == masterKeys.getMasterKeyService(); element.typeId == masterKeys.getMasterKeyService();
}).toList(); }).toList();
@ -371,7 +367,6 @@ class SOAPViewModel extends BaseViewModel {
case MasterKeysService.DiagnosisType: case MasterKeysService.DiagnosisType:
List<MasterKeyModel> result = listOfDiagnosisType.where((element) { List<MasterKeyModel> result = listOfDiagnosisType.where((element) {
print(element.id == id);
return element.id == id && return element.id == id &&
element.typeId == masterKeys.getMasterKeyService(); element.typeId == masterKeys.getMasterKeyService();
}).toList(); }).toList();
@ -381,7 +376,6 @@ class SOAPViewModel extends BaseViewModel {
break; break;
case MasterKeysService.DiagnosisCondition: case MasterKeysService.DiagnosisCondition:
List<MasterKeyModel> result = listOfDiagnosisCondition.where((element) { List<MasterKeyModel> result = listOfDiagnosisCondition.where((element) {
print(element.id == id);
return element.id == id && return element.id == id &&
element.typeId == masterKeys.getMasterKeyService(); element.typeId == masterKeys.getMasterKeyService();
}).toList(); }).toList();
@ -390,11 +384,8 @@ class SOAPViewModel extends BaseViewModel {
} }
break; break;
case MasterKeysService.ICD10: case MasterKeysService.ICD10:
listOfICD10.clear();
List<MasterKeyModel> result = listOfICD10.where((element) { List<MasterKeyModel> result = listOfICD10.where((element) {
print(element.id == id); return element.code == id ;
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList(); }).toList();
if (result.isNotEmpty) { if (result.isNotEmpty) {
return result.first; return result.first;

@ -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;
}
}

@ -0,0 +1,46 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.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/service/patient-admission-request-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import '../../locator.dart';
class AdmissionRequestViewModel extends BaseViewModel{
AdmissionRequestService _admissionRequestService = locator<AdmissionRequestService>();
List<dynamic> get doctorsList => _admissionRequestService.doctorsList;
List<dynamic> get speciality => _admissionRequestService.specialityList;
String selectedLanguage;
Future getLanguage() async {
selectedLanguage = await sharedPref.getString(APP_Language);
}
Future getMasterLookup() async {
setState(ViewState.Busy);
await getLanguage();
await _admissionRequestService.getMasterLookup(MasterKeysService.Speciality);
if (_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.Error);
} else {
_admissionRequestService.setSpecialityList();
await getClinicDoctors();
}
}
Future getClinicDoctors() async {
setState(ViewState.Busy);
await _admissionRequestService.getDoctorsList();
if (_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -0,0 +1,9 @@
import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import '../../locator.dart';
class UcafViewModel extends BaseViewModel {
UcafService _ucafService = locator<UcafService>();
}

@ -18,14 +18,16 @@ class VitalSignsViewModel extends BaseViewModel {
Future getPatientArrivalList(String date, PatiantInformtion patient, Future getPatientArrivalList(String date, PatiantInformtion patient,
{String fromDate}) async { {String fromDate}) async {
setState(ViewState.Busy); // TODO when arrival list work un comment below lines
/* 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();
} }
PatientArrivalEntity getPatientAppointmentEntity(PatiantInformtion patient) { PatientArrivalEntity getPatientAppointmentEntity(PatiantInformtion patient) {
@ -60,41 +62,73 @@ class VitalSignsViewModel extends BaseViewModel {
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
if (patientVitalSigns == null) { if (patientVitalSigns == null) {
_vitalSignService.patientVitalSigns = VitalSignData( makeVitalSignDemoData();
appointmentNo: 2016053265,
bloodPressureCuffLocation: 0,
bloodPressureCuffSize: 0,
bloodPressureHigher: 38,
bloodPressureLower: 32,
bloodPressurePatientPosition: 1,
bodyMassIndex: 31.11,
fio2: 0,
headCircumCm: 0,
heightCm: 150,
idealBodyWeightLbs: -2,
isPainManagementDone: false,
isVitalsRequired: true,
leanBodyWeightLbs: 0,
painCharacter: null,
painDuration: null,
painFrequency: null,
painLocation: null,
painScore: 0,
patientMRN: 3333274,
patientType: 1,
pulseBeatPerMinute: 0,
pulseRhythm: 0,
respirationBeatPerMinute: 0,
respirationPattern: 0,
sao2: 0,
status: 47,
temperatureCelcius: 40,
temperatureCelciusMethod: 1,
waistSizeInch: 39,
weightKg: 70,
);
} }
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
makeVitalSignDemoData(){
_vitalSignService.patientVitalSigns = VitalSignData(
appointmentNo: 2016053265,
bloodPressureCuffLocation: 0,
bloodPressureCuffSize: 0,
bloodPressureHigher: 38,
bloodPressureLower: 32,
bloodPressurePatientPosition: 1,
bodyMassIndex: 31.11,
fio2: 0,
headCircumCm: 0,
heightCm: 150,
idealBodyWeightLbs: -2,
isPainManagementDone: false,
isVitalsRequired: true,
leanBodyWeightLbs: 0,
painCharacter: null,
painDuration: null,
painFrequency: null,
painLocation: null,
painScore: 0,
patientMRN: 3333274,
patientType: 1,
pulseBeatPerMinute: 0,
pulseRhythm: 0,
respirationBeatPerMinute: 0,
respirationPattern: 0,
sao2: 0,
status: 47,
temperatureCelcius: 40,
temperatureCelciusMethod: 1,
waistSizeInch: 39,
weightKg: 70,
);
}
String getBMI(double bodyMassIndex) {
if (bodyMassIndex <= 18.5) {
return "Underweight";
} else if (bodyMassIndex <= 25.0) {
return "Normal";
} else if (bodyMassIndex <= 30) {
return "Overweight";
} else { // > 30.0
return "Obese";
}
}
String getTempratureMethod(int temperatureCelciusMethod){
// temperatureCelciusMethod ( vital sign response field )- master 2005
if(temperatureCelciusMethod == 1){
return "Oral";
} else if(temperatureCelciusMethod == 2){
return "Axilla";
} else if(temperatureCelciusMethod == 3){
return "Rectal";
} else if(temperatureCelciusMethod == 4){
return "Tympanic";
} else if(temperatureCelciusMethod == 5){
return "Temporal";
}
}
} }

@ -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);

@ -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);
} }

@ -13,8 +13,10 @@ import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'core/service/SOAP_service.dart'; import 'core/service/SOAP_service.dart';
import 'core/service/patient-admission-request-service.dart';
import 'core/service/doctor_reply_service.dart'; import 'core/service/doctor_reply_service.dart';
import 'core/service/medicine_service.dart'; import 'core/service/medicine_service.dart';
import 'core/service/patient-ucaf-service.dart';
import 'core/service/patient-vital-signs-service.dart'; import 'core/service/patient-vital-signs-service.dart';
import 'core/service/patient-doctor-referral-service.dart'; import 'core/service/patient-doctor-referral-service.dart';
import 'core/service/referral_patient_service.dart'; import 'core/service/referral_patient_service.dart';
@ -23,6 +25,8 @@ import 'core/service/schedule_service.dart';
import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/SOAP_view_model.dart';
import 'core/viewModel/doctor_replay_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart';
import 'core/viewModel/medicine_view_model.dart'; import 'core/viewModel/medicine_view_model.dart';
import 'core/viewModel/patient-admission-request-viewmodel.dart';
import 'core/viewModel/patient-ucaf-viewmodel.dart';
import 'core/viewModel/patient-vital-sign-viewmodel.dart'; import 'core/viewModel/patient-vital-sign-viewmodel.dart';
import 'core/viewModel/patient-referral-viewmodel.dart'; import 'core/viewModel/patient-referral-viewmodel.dart';
import 'core/viewModel/referral_view_model.dart'; import 'core/viewModel/referral_view_model.dart';
@ -48,6 +52,8 @@ void setupLocator() {
locator.registerLazySingleton(() => ProcedureService()); locator.registerLazySingleton(() => ProcedureService());
locator.registerLazySingleton(() => VitalSignsService()); locator.registerLazySingleton(() => VitalSignsService());
locator.registerLazySingleton(() => MedicalFileService()); locator.registerLazySingleton(() => MedicalFileService());
locator.registerLazySingleton(() => AdmissionRequestService());
locator.registerLazySingleton(() => UcafService());
/// View Model /// View Model
locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => DoctorReplayViewModel());
@ -63,5 +69,7 @@ void setupLocator() {
locator.registerFactory(() => PrescriptionViewModel()); locator.registerFactory(() => PrescriptionViewModel());
locator.registerFactory(() => ProcedureViewModel()); locator.registerFactory(() => ProcedureViewModel());
locator.registerFactory(() => VitalSignsViewModel()); locator.registerFactory(() => VitalSignsViewModel());
locator.registerFactory(() => AdmissionRequestViewModel());
locator.registerFactory(() => UcafViewModel());
locator.registerFactory(() => MedicalFileViewModel()); locator.registerFactory(() => MedicalFileViewModel());
} }

@ -0,0 +1,40 @@
class GetAssessmentReqModel {
int patientMRN;
int appointmentNo;
String episodeID;
String from;
String to;
int clinicID;
int doctorID;
GetAssessmentReqModel(
{this.patientMRN,
this.appointmentNo,
this.episodeID,
this.from,
this.to,
this.clinicID,
this.doctorID});
GetAssessmentReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeID = json['EpisodeID'];
from = json['From'];
to = json['To'];
clinicID = json['ClinicID'];
doctorID = json['DoctorID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeID;
data['From'] = this.from;
data['To'] = this.to;
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
return data;
}
}

@ -0,0 +1,72 @@
class GetAssessmentResModel {
int appointmentNo;
String asciiDesc;
String clinicDescription;
int clinicID;
bool complexDiagnosis;
int conditionID;
int createdBy;
String createdOn;
int diagnosisTypeID;
int doctorID;
String doctorName;
int episodeId;
String icdCode10ID;
int patientMRN;
String remarks;
GetAssessmentResModel(
{this.appointmentNo,
this.asciiDesc,
this.clinicDescription,
this.clinicID,
this.complexDiagnosis,
this.conditionID,
this.createdBy,
this.createdOn,
this.diagnosisTypeID,
this.doctorID,
this.doctorName,
this.episodeId,
this.icdCode10ID,
this.patientMRN,
this.remarks});
GetAssessmentResModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['appointmentNo'];
asciiDesc = json['ascii_Desc'];
clinicDescription = json['clinicDescription'];
clinicID = json['clinicID'];
complexDiagnosis = json['complexDiagnosis'];
conditionID = json['conditionID'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
diagnosisTypeID = json['diagnosisTypeID'];
doctorID = json['doctorID'];
doctorName = json['doctorName'];
episodeId = json['episodeId'];
icdCode10ID = json['icdCode10ID'];
patientMRN = json['patientMRN'];
remarks = json['remarks'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['appointmentNo'] = this.appointmentNo;
data['ascii_Desc'] = this.asciiDesc;
data['clinicDescription'] = this.clinicDescription;
data['clinicID'] = this.clinicID;
data['complexDiagnosis'] = this.complexDiagnosis;
data['conditionID'] = this.conditionID;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['diagnosisTypeID'] = this.diagnosisTypeID;
data['doctorID'] = this.doctorID;
data['doctorName'] = this.doctorName;
data['episodeId'] = this.episodeId;
data['icdCode10ID'] = this.icdCode10ID;
data['patientMRN'] = this.patientMRN;
data['remarks'] = this.remarks;
return data;
}
}

@ -1,18 +1,45 @@
class GetHistoryReqModel { class GetHistoryReqModel {
int patientMRN; int patientMRN;
int historyType; int historyType;
String episodeID;
String from;
String to;
int clinicID;
int doctorID;
int appointmentNo;
GetHistoryReqModel({this.patientMRN, this.historyType}); GetHistoryReqModel(
{this.patientMRN,
this.historyType,
this.episodeID,
this.from,
this.to,
this.clinicID,
this.doctorID,
this.appointmentNo});
GetHistoryReqModel.fromJson(Map<String, dynamic> json) { GetHistoryReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
historyType = json['HistoryType']; historyType = json['HistoryType'];
episodeID = json['EpisodeID'];
from = json['From'];
to = json['To'];
clinicID = json['ClinicID'];
doctorID = json['DoctorID'];
appointmentNo = json['AppointmentNo'];
} }
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>();
data['PatientMRN'] = this.patientMRN; data['PatientMRN'] = this.patientMRN;
data['HistoryType'] = this.historyType; data['HistoryType'] = this.historyType;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeID;
data['From'] = this.from;
data['To'] = this.to;
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
return data; return data;
} }
} }

@ -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-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';
import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart';
@ -10,7 +11,6 @@ import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_pat
import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; import 'package:doctor_app_flutter/screens/live_care/video_call.dart';
import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart'; import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.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/widgets/patients/profile/SOAP/add_SOAP_index.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_soap_index.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_soap_index.dart';
@ -43,6 +43,9 @@ import './screens/settings/settings_screen.dart';
import 'landing_page.dart'; import 'landing_page.dart';
import 'screens/doctor/doctor_reply_screen.dart'; import 'screens/doctor/doctor_reply_screen.dart';
import 'screens/live_care/panding_list.dart'; import 'screens/live_care/panding_list.dart';
import 'screens/patients/profile/admission-request/admission-request-detail-screen.dart';
import 'screens/patients/profile/admission-request/admission-request-third-screen.dart';
import 'screens/patients/profile/admission-request/admission-request_second-screen.dart';
import 'screens/patients/profile/referral/my-referral-detail-screen.dart'; import 'screens/patients/profile/referral/my-referral-detail-screen.dart';
import 'screens/patients/profile/referral/refer-patient-screen.dart'; import 'screens/patients/profile/referral/refer-patient-screen.dart';
import 'screens/prescription/prescription_screen.dart'; import 'screens/prescription/prescription_screen.dart';
@ -84,6 +87,10 @@ const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details';
const String CREATE_EPISODE = 'patients/create-episode'; const String CREATE_EPISODE = 'patients/create-episode';
const String UPDATE_EPISODE = 'patients/update-episode'; const String UPDATE_EPISODE = 'patients/update-episode';
const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data'; const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data';
const String PATIENT_ADMISSION_REQUEST = 'patients/admission-request';
const String PATIENT_ADMISSION_REQUEST_2 = 'patients/admission-request-second';
const String PATIENT_ADMISSION_REQUEST_3 = 'patients/admission-request-third';
const String PATIENT_UCAF_REQUEST = 'patients/ucaf';
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';
@ -128,7 +135,10 @@ var routes = {
PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(),
VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(),
PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(),
CREATE_EPISODE: (_) => AddSOAPIndex(), PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestDetailScreen(),
PATIENT_ADMISSION_REQUEST_2: (_) => AdmissionRequestSecondScreen(),
PATIENT_ADMISSION_REQUEST_3: (_) => AdmissionRequestThirdScreen(),
CREATE_EPISODE: (_) => UpdateSoapIndex(isUpdate: true,),
UPDATE_EPISODE: (_) => UpdateSoapIndex( UPDATE_EPISODE: (_) => UpdateSoapIndex(
isUpdate: true, isUpdate: true,
), ),
@ -144,4 +154,5 @@ var routes = {
// LIVECARE_END_DIALOG: (_) => EndCallDialogBox() // LIVECARE_END_DIALOG: (_) => EndCallDialogBox()
MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(),
PATIENT_UCAF_REQUEST: (_) => UCAFInputScreen(),
}; };

@ -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,
),
], ],
), ),
), ),

@ -274,34 +274,35 @@ class _PatientsScreenState extends State<PatientsScreen> {
.then((res) { .then((res) {
setState(() { setState(() {
_isLoading = false; _isLoading = false;
// if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (val2 == 7) { if (val2 == 7) {
print("Assad"); if (res[SERVICES_PATIANT2[val2]] == null) {
if (res[SERVICES_PATIANT2[val2]] == null) { _isError = true;
_isError = true; _isLoading = false;
_isLoading = false; this.error = error.toString();
this.error = error.toString(); } else {
var localList = [];
res["patientArrivalList"]["entityList"].forEach((v) {
Map<String, dynamic> mergedPatient = {
...v,
...v["patientDetails"]
};
localList.add(mergedPatient);
});
print(localList.toString());
lItems = localList;
}
} else { } else {
lItems = res[SERVICES_PATIANT2[val2]];
var localList=[];
res["patientArrivalList"]["entityList"].forEach((v) {
Map<String,dynamic> mergedPatient= {...v,...v["patientDetails"]};
localList.add(mergedPatient);
});
print(localList.toString());
lItems = localList;//res[SERVICES_PATIANT2[val2]]["entityList"];
} }
parsed = lItems;
responseModelList = new ModelResponse.fromJson(parsed).list;
responseModelList2 = responseModelList;
_isError = false;
} else { } else {
lItems = res[SERVICES_PATIANT2[val2]]; _isError = true;
error = res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
} }
parsed = lItems;
responseModelList = new ModelResponse.fromJson(parsed).list;
responseModelList2 = responseModelList;
_isError = false;
// } else {
// _isError = true;
// error = res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
// }
}); });
}).catchError((error) { }).catchError((error) {
setState(() { setState(() {
@ -679,7 +680,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
.pushNamed( .pushNamed(
PATIENTS_PROFILE, PATIENTS_PROFILE,
arguments: { arguments: {
"patient": item "patient": item,
"patientType":patientType
}); });
}, },
), ),

@ -0,0 +1,433 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
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/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
class UCAFInputScreen extends StatefulWidget {
@override
_UCAFInputScreenState createState() => _UCAFInputScreenState();
}
class _UCAFInputScreenState extends State<UCAFInputScreen> {
bool _inPatient = false;
bool _emergencyCase = false;
final _durationOfIllnessController = TextEditingController();
final _additionalComplaintsController = TextEditingController();
final _otherController = TextEditingController();
final _howController = TextEditingController();
final _whenController = TextEditingController();
final _whereController = TextEditingController();
final _managementsLineController = TextEditingController();
final _signsController = TextEditingController();
List<Map> conditionsData = [
{"name": "CHRONIC", "isChecked": false},
{"name": "RTA", "isChecked": false},
{"name": "PSYCHIATRIC", "isChecked": false},
{"name": "WORK RELATED", "isChecked": false},
{"name": "VACCINATION", "isChecked": false},
{"name": "CONGENITAL", "isChecked": false},
{"name": "INFERTILITY", "isChecked": false},
{"name": "CHECK-UP", "isChecked": false},
{"name": "PREGNANCY/INDICATE MP", "isChecked": false},
{"name": "CLEANING", "isChecked": false},
{"name": "ORTHO DONTICS", "isChecked": false},
{"name": "SPORTS RELATED", "isChecked": false},
{"name": "REGULAR DENTAL TREATMENT", "isChecked": false},
{"name": "IS TRAUMA TREATMENT SPECIFY ETA", "isChecked": false},
];
@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: SingleChildScrollView(
child: Column(
children: [
PatientHeaderWidget(patient),
Container(
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CheckboxListTile(
title: AppText(
TranslationBase.of(context).inPatient,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.1,
),
value: _inPatient,
onChanged: (newValue) {
setState(() {
_inPatient = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context).emergencyCase,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.1,
),
value: _emergencyCase,
onChanged: (newValue) {
setState(() {
_emergencyCase = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
Container(
height: screenSize.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).durationOfIllness,
null,
false),
enabled: true,
controller: _durationOfIllnessController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
keyboardType: TextInputType.number,
)),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"BP (H/L)",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"120/80",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
Row(
children: [
AppText(
"${TranslationBase.of(context).temperature}",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"37.5(C), 98.6(F)",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
SizedBox(
height: 4,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(
"${TranslationBase.of(context).pulseBeats} :",
fontSize: SizeConfig.textMultiplier * 1.8,
color: Colors.black,
fontWeight: FontWeight.w700,
),
SizedBox(
width: 8,
),
AppText(
"80",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800,
fontWeight: FontWeight.normal,
),
],
),
],
),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).chiefComplaintsAndSymptoms,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 8,
),
AppText(
TranslationBase.of(context)
.patientFeelsPainInHisBackAndCough,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
SizedBox(
height: 8,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).additionalTextComplaints,
null,
false),
enabled: true,
controller: _additionalComplaintsController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).otherConditions,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
...List.generate(
conditionsData.length,
(index) => CheckboxListTile(
title: AppText(
conditionsData[index]['name'],
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.1,
),
value: conditionsData[index]['isChecked'],
onChanged: (newValue) {
setState(() {
conditionsData[index]['isChecked'] = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
)),
SizedBox(
height: 8,
),
Container(
height: screenSize.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).other,
null,
false),
enabled: true,
controller: _otherController,
keyboardType: TextInputType.text,
)),
SizedBox(
height: 8,
),
Container(
height: screenSize.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).how,
null,
false),
enabled: true,
controller: _howController,
keyboardType: TextInputType.text,
)),
SizedBox(
height: 8,
),
Row(
children: [
Expanded(
child: Container(
height: screenSize.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).when,
null,
false),
enabled: true,
controller: _whenController,
keyboardType: TextInputType.text,
)),
),
SizedBox(
width: 4,
),
Expanded(
child: Container(
height: screenSize.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).where,
null,
false),
enabled: true,
controller: _whereController,
keyboardType: TextInputType.text,
)),
),
],
),
SizedBox(
height: 8,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).specifyPossibleLineManagement,
null,
false),
enabled: true,
controller: _managementsLineController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context)
.significantSigns,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
SizedBox(
height: 8,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).backAbdomen,
null,
false),
enabled: true,
controller: _signsController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 16,
),
AppButton(
title: TranslationBase.of(context).next,
color: HexColor("#B8382B"),
onPressed: (){
// Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {'patient': patient});
},
),
],
),
),
],
),
),
),
);
}
}
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),
),
],
);
}
}

@ -0,0 +1,285 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-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/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-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_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../../routes.dart';
import 'admission-request_second-screen.dart';
class AdmissionRequestDetailScreen extends StatefulWidget {
@override
_AdmissionRequestDetailScreenState createState() =>
_AdmissionRequestDetailScreenState();
}
class _AdmissionRequestDetailScreenState
extends State<AdmissionRequestDetailScreen> {
DateTime selectedDate;
dynamic _selectedSpeciality;
dynamic _selectedDoctor;
@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<AdmissionRequestViewModel>(
onModelReady: (model) => model.getMasterLookup(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).admissionRequest,
body: model.doctorsList != null
? Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
PatientPageHeaderWidget(patient),
Container(
margin: EdgeInsets.symmetric(
vertical: 16, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).patientDetails,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container(
decoration:
Helpers.containerBorderDecoration(
Color(0xFFEEEEEE),
Color(0xFFCCCCCC),
borderWidth: 0.0),
height: screenSize.height * 0.070,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
"Pre Admission Number :01",
null,
false),
enabled: false,
// controller: _remarksController,
keyboardType: TextInputType.text,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () => _selectDate(context, model),
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).date,
selectedDate != null
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context)
.specialityAndDoctorDetail,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.speciality,
attributeName: model.selectedLanguage == 'ar' ? 'nameAr' :'nameEn' ,
attributeValueId: 'id',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
_selectedSpeciality =
selectedValue;
});
});
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.speciality,
_selectedSpeciality != null
? model.selectedLanguage == 'ar' ? _selectedSpeciality['nameAr'] : _selectedSpeciality['nameEn']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).doctor,
_selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
decoration:
Helpers.containerBorderDecoration(
Color(0xFFEEEEEE),
Color(0xFFCCCCCC),
borderWidth: 0.0),
child: InkWell(
onTap: () => null,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).referringDate,
null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Color(0xFFCCCCCC),
)),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
decoration:
Helpers.containerBorderDecoration(
Color(0xFFEEEEEE),
Color(0xFFCCCCCC),
borderWidth: 0.0),
height: screenSize.height * 0.070,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).referringDoctor,
null,
true, dropDownColor: Color(0xFFCCCCCC)),
enabled: false,
// controller: _remarksController,
keyboardType: TextInputType.text,
)),
],
),
),
],
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).next,
color: HexColor("#B8382B"),
onPressed: (){
Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {'patient': patient});
},
),
),
],
)
: Container(),
),
);
}
_selectDate(BuildContext context, AdmissionRequestViewModel model) async {
selectedDate = DateTime.now();
final DateTime picked = await showDatePicker(
context: context,
initialDate: selectedDate,
firstDate: DateTime.now().add(Duration(hours: 2)),
lastDate: DateTime(2040),
initialEntryMode: DatePickerEntryMode.calendar,
);
if (picked != null && picked != selectedDate) {
setState(() {
selectedDate = picked;
});
}
}
}

@ -0,0 +1,208 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-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/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-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_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
class AdmissionRequestThirdScreen extends StatefulWidget {
@override
_AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState();
}
class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScreen> {
final _postPlansEstimatedCostController = TextEditingController();
final _dietTypeRemarksController = TextEditingController();
DateTime _dischargeDate;
dynamic _selectedDietType;
@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<AdmissionRequestViewModel>(
// onModelReady: (model) => model.getMasterLookup(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).admissionRequest,
body: model.doctorsList != null
? Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
PatientPageHeaderWidget(patient),
Container(
margin: EdgeInsets.symmetric(
vertical: 16, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).postPlansEstimatedCost,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.postPlansEstimatedCost,
null,
false),
enabled: true,
controller: _postPlansEstimatedCostController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () {
if (_dischargeDate == null) {
_dischargeDate = DateTime.now();
}
_selectDate(
context, _dischargeDate,
(picked) {
setState(() {
_dischargeDate = picked;
});
});
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.expectedAdmissionDate,
_dischargeDate != null
? "${DateUtils.convertStringToDateFormat(_dischargeDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: /*model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
:*/ null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).dietType,
/* _admissionType != null
? _admissionType['DoctorName']
:*/ null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.dietTypeRemarks,
null,
false),
enabled: true,
controller: _dietTypeRemarksController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
],
),
),
],
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).save,
color: HexColor("#B8382B"),
onPressed: null,
),
),
],
)
: Container(),
),
);
}
Future _selectDate(BuildContext context, DateTime dateTime,
Function(DateTime picked) updateDate) async {
final DateTime picked = await showDatePicker(
context: context,
initialDate: dateTime,
firstDate: DateTime.now(),
lastDate: DateTime(2040),
initialEntryMode: DatePickerEntryMode.calendar,
);
if (picked != null && picked != dateTime) {
updateDate(picked);
}
}
}

@ -0,0 +1,402 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-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/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-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_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../../routes.dart';
class AdmissionRequestSecondScreen extends StatefulWidget {
@override
_AdmissionRequestSecondScreenState createState() =>
_AdmissionRequestSecondScreenState();
}
class _AdmissionRequestSecondScreenState
extends State<AdmissionRequestSecondScreen> {
final _expectedDaysController = TextEditingController();
final _treatmentLineController = TextEditingController();
final _preOperativeOrdersController = TextEditingController();
DateTime _expectedAdmissionDate;
bool _emergencyAdmission = false;
bool _patientPregnant = false;
bool _preAnesthesiaReferred = false;
dynamic _selectedWard;
dynamic _selectedAdmissionType;
@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<AdmissionRequestViewModel>(
// onModelReady: (model) => model.getMasterLookup(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).admissionRequest,
body: model.doctorsList != null
? Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
PatientPageHeaderWidget(patient),
Container(
margin: EdgeInsets.symmetric(
vertical: 16, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).otherInformation,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.expectedDays,
null,
false),
enabled: true,
controller: _expectedDaysController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
keyboardType: TextInputType.number,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () {
if (_expectedAdmissionDate == null) {
_expectedAdmissionDate = DateTime.now();
}
_selectDate(
context, _expectedAdmissionDate,
(picked) {
setState(() {
_expectedAdmissionDate = picked;
});
});
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.expectedAdmissionDate,
_expectedAdmissionDate != null
? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context)
.emergencyAdmission,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.1,
),
value: _emergencyAdmission,
onChanged: (newValue) {
setState(() {
_emergencyAdmission = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context)
.patientPregnant,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.1,
),
value: _patientPregnant,
onChanged: (newValue) {
setState(() {
_patientPregnant = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).treatmentLine,
null,
false),
enabled: true,
controller: _treatmentLineController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: /*model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
:*/ null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).ward,
/* _selectedWard != null
? _selectedWard['DoctorName']
:*/ null,
true),
enabled: false,
),
),
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context)
.preAnesthesiaReferred,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.1,
),
value: _preAnesthesiaReferred,
onChanged: (newValue) {
setState(() {
_preAnesthesiaReferred = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: /*model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
:*/ null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).admissionType,
/* _admissionType != null
? _admissionType['DoctorName']
:*/ null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: /*model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
:*/ null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).diagnosis,
/* _admissionType != null
? _admissionType['DoctorName']
:*/ null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).preOperativeOrders,
null,
false),
enabled: true,
controller: _preOperativeOrdersController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: /*model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
:*/ null,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).allergies,
/* _admissionType != null
? _admissionType['DoctorName']
:*/ null,
true),
enabled: false,
),
),
),
],
),
),
],
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).next,
color: HexColor("#B8382B"),
onPressed: (){
Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {'patient': patient});
},
),
),
],
)
: Container(),
),
);
}
Future _selectDate(BuildContext context, DateTime dateTime,
Function(DateTime picked) updateDate) async {
final DateTime picked = await showDatePicker(
context: context,
initialDate: dateTime,
firstDate: DateTime.now(),
lastDate: DateTime(2040),
initialEntryMode: DatePickerEntryMode.calendar,
);
if (picked != null && picked != dateTime) {
updateDate(picked);
}
}
}

@ -207,6 +207,21 @@ class PatientVitalSignScreen extends StatelessWidget {
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
SizedBox(
width: 8,
),
Container(
color: Colors.green,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 2, horizontal: 8),
child: AppText(
"${model.getBMI(model.patientVitalSigns.bodyMassIndex)}",
fontSize: SizeConfig.textMultiplier * 2,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
)
], ],
), ),
], ],
@ -251,7 +266,7 @@ class PatientVitalSignScreen extends StatelessWidget {
SizedBox( SizedBox(
height: 16, height: 16,
), ),
TemperatureWidget(model.patientVitalSigns), TemperatureWidget(model, model.patientVitalSigns),
SizedBox( SizedBox(
height: 16, height: 16,
), ),
@ -349,9 +364,10 @@ class PatientVitalSignScreen extends StatelessWidget {
} }
class TemperatureWidget extends StatefulWidget { class TemperatureWidget extends StatefulWidget {
final VitalSignsViewModel model;
final VitalSignData vitalSign; final VitalSignData vitalSign;
TemperatureWidget(this.vitalSign); TemperatureWidget(this.model, this.vitalSign);
@override @override
_TemperatureWidgetState createState() => _TemperatureWidgetState(); _TemperatureWidgetState createState() => _TemperatureWidgetState();
@ -450,7 +466,7 @@ class _TemperatureWidgetState extends State<TemperatureWidget> {
width: 8, width: 8,
), ),
AppText( AppText(
"${widget.vitalSign.temperatureCelciusMethod}", "${widget.model.getTempratureMethod(widget.vitalSign.temperatureCelciusMethod)}",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
color: Colors.grey.shade800, color: Colors.grey.shade800,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,

@ -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(() {

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:html/parser.dart';
import '../config/size_config.dart'; import '../config/size_config.dart';
import '../util/dr_app_toast_msg.dart'; import '../util/dr_app_toast_msg.dart';
@ -352,4 +353,56 @@ class Helpers {
// TODO Fix it // TODO Fix it
// Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN))); // Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN)));
} }
String parseHtmlString(String htmlString) {
final document = parse(htmlString);
final String parsedString = parse(document.body.text).documentElement.text;
return parsedString;
}
static InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon, Color dropDownColor}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: dropDownColor != null ? dropDownColor : Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
static BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor, {double borderWidth = -1}) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: borderWidth == -1 ? 2.0 : borderWidth,
)),
);
}
} }

@ -316,6 +316,7 @@ class TranslationBase {
String get admissionDetail => String get admissionDetail =>
localizedValues['admissionDetail'][locale.languageCode]; localizedValues['admissionDetail'][locale.languageCode];
String get dateTime => localizedValues['dateTime'][locale.languageCode]; String get dateTime => localizedValues['dateTime'][locale.languageCode];
String get date => localizedValues['date'][locale.languageCode];
String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; String get admissionNo => localizedValues['admissionNo'][locale.languageCode];
String get losNo => localizedValues['losNo'][locale.languageCode]; String get losNo => localizedValues['losNo'][locale.languageCode];
String get area => localizedValues['area'][locale.languageCode]; String get area => localizedValues['area'][locale.languageCode];
@ -387,31 +388,148 @@ 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 request => localizedValues['request'][locale.languageCode];
String get admissionRequest =>
localizedValues['admissionRequest'][locale.languageCode];
String get patientDetails =>
localizedValues['patientDetails'][locale.languageCode];
String get specialityAndDoctorDetail =>
localizedValues['specialityAndDoctorDetail'][locale.languageCode];
String get referringDate =>
localizedValues['referringDate'][locale.languageCode];
String get referringDoctor =>
localizedValues['referringDoctor'][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 preAnesthesiaReferred =>
localizedValues['preAnesthesiaReferred'][locale.languageCode];
String get admissionType =>
localizedValues['admissionType'][locale.languageCode];
String get diagnosis => localizedValues['diagnosis'][locale.languageCode];
String get allergies => localizedValues['allergies'][locale.languageCode];
String get preOperativeOrders =>
localizedValues['preOperativeOrders'][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 dietTypeRemarks =>
localizedValues['dietTypeRemarks'][locale.languageCode];
String get save => localizedValues['save'][locale.languageCode];
String get postPlansEstimatedCost =>
localizedValues['postPlansEstimatedCost'][locale.languageCode];
String get ucaf => localizedValues['ucaf'][locale.languageCode];
String get emergencyCase =>
localizedValues['emergencyCase'][locale.languageCode];
String get durationOfIllness =>
localizedValues['durationOfIllness'][locale.languageCode];
String get chiefComplaintsAndSymptoms =>
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 how => localizedValues['how'][locale.languageCode];
String get when => localizedValues['when'][locale.languageCode];
String get where => localizedValues['where'][locale.languageCode];
String get specifyPossibleLineManagement =>
localizedValues['specifyPossibleLineManagement'][locale.languageCode];
String get significantSigns =>
localizedValues['significantSigns'][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 episode => localizedValues['episode'][locale.languageCode];
String get chiefComplaints =>
localizedValues['chiefComplaints'][locale.languageCode];
String get histories => localizedValues['histories'][locale.languageCode];
String get allergiesSoap =>
localizedValues['allergiesSoap'][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 addHistory => localizedValues['addHistory'][locale.languageCode];
String get searchHistory =>
localizedValues['searchHistory'][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 selectAllergy =>
localizedValues['selectAllergy'][locale.languageCode];
String get selectSeverity =>
localizedValues['selectSeverity'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,133 +0,0 @@
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/assessment_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/subjective_page.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'steps_widget.dart';
class AddSOAPIndex extends StatefulWidget {
final bool isUpdate;
const AddSOAPIndex({Key key, this.isUpdate}) : super(key: key);
@override
_AddSOAPIndexState createState() => _AddSOAPIndexState();
}
class _AddSOAPIndexState extends State<AddSOAPIndex>
with TickerProviderStateMixin {
PageController _controller;
int _currentIndex = 0;
List<MySelectedAllergy> myAllergiesList= List();
List<MasterKeyModel> myHistoryList = List();
List<MySelectedExamination> mySelectedExamination = List();
MySelectedAssessment mySelectedAssessment = new MySelectedAssessment();
changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex);
}
@override
void initState() {
// TODO: implement initState
_controller = new PageController();
super.initState();
}
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
return BaseView<DoctorReplayViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).healthRecordInformation,
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration:
BoxDecoration(boxShadow: <BoxShadow>[], color: Colors.white),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
PatientPageHeaderWidget(patient),
FractionallySizedBox(
child: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.75,
child: Column(
children: [
Container(
margin: EdgeInsets.only(
left:
MediaQuery.of(context).size.width * 0.05,
right:
MediaQuery.of(context).size.width * 0.05),
child: StepsWidget(
index: _currentIndex,
changeCurrentTab: changePageViewIndex,
),
),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
SubjectivePage(
changePageViewIndex: changePageViewIndex,
myAllergiesList: myAllergiesList,
myHistoryList: myHistoryList,
patientInfo: patient,
),
ObjectivePage(
changePageViewIndex: changePageViewIndex,
mySelectedExamination:
mySelectedExamination,
patientInfo: patient,
),
AssessmentPage(
changePageViewIndex: changePageViewIndex,
mySelectedAssessment:
mySelectedAssessment,
patientInfo: patient,
),
PlanPage(
changePageViewIndex: changePageViewIndex,
patientInfo: patient,
)
],
),
),
],
),
),
),
)
],
),
),
],
),
),
),
);
}
}

@ -1,647 +0,0 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/client/base_app_client.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/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
class AssessmentPage extends StatefulWidget {
final Function changePageViewIndex;
final MySelectedAssessment mySelectedAssessment;
final PatiantInformtion patientInfo;
AssessmentPage(
{Key key, this.changePageViewIndex, this.mySelectedAssessment, this.patientInfo});
@override
_AssessmentPageState createState() => _AssessmentPageState();
}
class _AssessmentPageState extends State<AssessmentPage> {
bool isAssessmentExpand = false;
List<dynamic> assessmentList;
dynamic _referTo;
TextEditingController remarksController = TextEditingController();
Helpers helpers = Helpers();
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<SOAPViewModel>(
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('ASSESSMENT',
variant:
isAssessmentExpand ? "bodyText" : '',
bold: isAssessmentExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isAssessmentExpand = !isAssessmentExpand;
});
},
child: Icon(isAssessmentExpand
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(children: [
SizedBox(
height: 20,
),
Column(
children: [
Container(
margin:
EdgeInsets.only(left: 5, right: 5, top: 15),
child: TextFields(
hintText: "Add ASSESSMENT",
fontSize: 13.5,
onTapTextFields: () {
openAssessmentDialog(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
if(widget.mySelectedAssessment != null &&
widget.mySelectedAssessment
.appointmentId !=
null && widget.mySelectedAssessment
.selectedDiagnosisType != null &&
widget.mySelectedAssessment
.selectedDiagnosisCondition != null)
Container(
margin: EdgeInsets.only(
left: 5, right: 5, top: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment
.spaceBetween,
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Column(
mainAxisAlignment: MainAxisAlignment
.start,
children: [
Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
"12".toUpperCase(),
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
"DEC".toUpperCase(),
fontSize: 10,
color: Colors.grey,
),
],
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Appointment #: ",
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
widget.mySelectedAssessment
.appointmentId
.toString(),
fontSize: 10,
color: Colors.grey,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn,
fontWeight: FontWeight.bold,
fontSize: 16,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Type : ",
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
widget.mySelectedAssessment
.selectedDiagnosisType
.nameEn,
fontSize: 10,
color: Colors.grey,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Doc : ",
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
"Anas Abdullah",
fontSize: 10,
color: Colors.grey,
),
],
),
SizedBox(
height: 6,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
SizedBox(
height: 6,
),
AppText(
widget.mySelectedAssessment.remark,
fontSize: 10,
color: Colors.grey,
),
],
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Row(
children: [
AppText(
"ICD: ".toUpperCase(),
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
"R07.1".toUpperCase(),
fontSize: 10,
color: Colors.grey,
),
],
)
],
),
Column(
children: [
InkWell(
onTap: () {
openAssessmentDialog(context);
},
child: Icon(EvaIcons
.edit2Outline),
)
],
),
],
),
)
],
)
]),
isExpand: isAssessmentExpand,
),
DividerWithSpacesAround(
height: 30,
),
AppButton(
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
await submitAssessment(model);
},
),
SizedBox(
height: 30,
),
],
),
),
),
)));
}
submitAssessment(SOAPViewModel model) async {
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
widget.mySelectedAssessment.selectedDiagnosisType != null) {
PostAssessmentRequestModel postAssessmentRequestModel =
new PostAssessmentRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
icdCodeDetails: [
new IcdCodeDetails(
remarks: widget.mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId:
widget.mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId:
widget.mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: "1")
]);
await model.postAssessment(postAssessmentRequestModel);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else {
widget.changePageViewIndex(3);
}
} else {
helpers.showErrorToast('Please add required field correctly');
}
widget.changePageViewIndex(3);
}
openAssessmentDialog(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return AddAssessmentDetails(
mySelectedAssessment: widget.mySelectedAssessment,
addSelectedAssessment: () {
setState(() {
Navigator.of(context).pop();
});
});
});
}
}
class AddAssessmentDetails extends StatefulWidget {
final MySelectedAssessment mySelectedAssessment;
final Function() addSelectedAssessment;
const AddAssessmentDetails(
{Key key, this.mySelectedAssessment, this.addSelectedAssessment})
: super(key: key);
@override
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
}
class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
// MasterKeyModel _selectedDiagnosisCondition;
// MasterKeyModel _selectedDiagnosisType;
TextEditingController remarkController = TextEditingController();
TextEditingController appointmentIdController = TextEditingController(
text: "234567");
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
remarkController.text = widget.mySelectedAssessment.remark??"";
final screenSize = MediaQuery
.of(context)
.size;
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown,{IconData icon}) {
//TODO: make one Input InputDecoration for all
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon??Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
return FractionallySizedBox(
heightFactor: 0.75,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.listOfDiagnosisCondition.length == 0) {
await model.getMasterLookup(MasterKeysService.DiagnosisCondition);
}
if (model.listOfDiagnosisType.length == 0) {
await model.getMasterLookup(MasterKeysService.DiagnosisType);
}
// if (model.listOfICD10.length == 0) {
// await model.getMasterLookup(MasterKeysService.ICD10);
// }
},
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: SingleChildScrollView(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
"Add Assessment Details".toUpperCase(),
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hintText: "Appointment Number",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
readOnly: true,
controller: appointmentIdController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment.selectedICD = null;
});
}
: null,
child:widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField<MasterKeyModel>(
decoration: textFieldSelectorDecoration("Name or ICD", widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search),
itemSubmitted: (item) => setState(() => widget.mySelectedAssessment.selectedICD = item),
key: key,
suggestions: model.listOfICD10,
itemBuilder: (context, suggestion) => new Padding(
child:Texts( suggestion.description +" / "+ suggestion.code.toString()),
padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.description.toLowerCase().startsWith(input.toLowerCase())
||suggestion.code.toLowerCase().startsWith(input.toLowerCase())
,
): TextField(
decoration: textFieldSelectorDecoration(
widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.code :"Name or ICD",
widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.listOfDiagnosisCondition !=
null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition,
okText: TranslationBase
.of(context)
.ok,
okFunction: (
MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment
.selectedDiagnosisCondition =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
"Condition",
widget.mySelectedAssessment
.selectedDiagnosisCondition != null
? widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.listOfDiagnosisType != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType,
okText: TranslationBase
.of(context)
.ok,
okFunction: (
MasterKeyModel selectedValue) {
setState(() {
// _selectedDiagnosisType =
// selectedValue;
widget.mySelectedAssessment
.selectedDiagnosisType =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
"Type",
widget.mySelectedAssessment
.selectedDiagnosisType != null
? widget.mySelectedAssessment
.selectedDiagnosisType.nameEn
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hintText: "Remarks",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 18,
minLines: 5,
controller: remarkController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 10,
),
AppButton(
title: "Add".toUpperCase(),
onPressed: () {
setState(() {
widget.mySelectedAssessment.remark =
remarkController.text;
widget.mySelectedAssessment
.appointmentId = int.parse(
appointmentIdController.text);
widget.addSelectedAssessment();
});
},
),
])),
),
),
))),
);
}
}

@ -1,518 +0,0 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class ObjectivePage extends StatefulWidget {
final Function changePageViewIndex;
final List<MySelectedExamination> mySelectedExamination;
final PatiantInformtion patientInfo;
ObjectivePage(
{Key key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo});
@override
_ObjectivePageState createState() => _ObjectivePageState();
}
class _ObjectivePageState extends State<ObjectivePage> {
bool isSysExaminationExpand = false;
TextEditingController remarksController = TextEditingController();
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 0.5,
)),
);
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<SOAPViewModel>(
// onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies),
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('Physical/System Examination',
variant:
isSysExaminationExpand ? "bodyText" : '',
bold: isSysExaminationExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isSysExaminationExpand =
!isSysExaminationExpand;
});
},
child: Icon(isSysExaminationExpand
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(children: [
SizedBox(
height: 20,
),
Column(
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add Examination",
fontSize: 13.5,
onTapTextFields: () {
openExaminationList(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
Column(
children:
widget.mySelectedExamination.map((examination) {
return Container(
margin: EdgeInsets.only(
left: 15, right: 15, top: 15),
child: Column(children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts(
examination
.selectedExamination.nameEn
.toUpperCase(),
variant: "bodyText",
bold: true,
color: Colors.black)
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
InkWell(
child: Center(
child: Container(
height:
screenSize.height *
0.070,
decoration:
containerBorderDecoration(
examination
.isNormal
? Color(
0xFF515A5D)
: Colors
.white,
Colors.grey),
child: Center(
child: Padding(
padding:
const EdgeInsets
.all(8.0),
child: Text(
"Normal",
style: TextStyle(
fontSize: 12,
color:
examination
.isNormal
? Colors.white
: Colors
.black,
//Colors.black,
fontWeight:
FontWeight
.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination.isAbnormal =
!examination.isAbnormal;
examination.isNormal =
!examination.isNormal;
});
}),
SizedBox(
width: 12,
),
InkWell(
child: Center(
child: Container(
height:
screenSize.height *
0.070,
decoration:
containerBorderDecoration(
examination
.isAbnormal
? Color(
0xFF515A5D)
: Colors
.white,
Colors.black),
child: Center(
child: Padding(
padding:
const EdgeInsets
.all(8.0),
child: Text(
"Abnormal",
style: TextStyle(
fontSize: 12,
color:
examination
.isAbnormal
? Colors.white
: Colors
.black,
//Colors.black,
fontWeight:
FontWeight
.bold,
),
),
),
)),
),
onTap: () {
setState(() {
examination.isAbnormal =
!examination.isAbnormal;
examination.isNormal =
!examination.isNormal;
});
}),
],
),
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
),
onTap: () => removeExamination(
examination.selectedExamination),
)
],
),
SizedBox(
height: 20,
),
Container(
margin: EdgeInsets.only(
left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Remarks",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 13,
controller: remarksController,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
]));
}).toList(),
)
],
)
]),
isExpand: isSysExaminationExpand,
),
DividerWithSpacesAround(height: 30,),
AppButton(
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
await submitObjectivePage(model);
},
),
SizedBox(
height: 30,
),
],
),
),
),
)));
}
submitObjectivePage(SOAPViewModel model) async {
// if(widget.mySelectedExamination.isNotEmpty){
// PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
// widget.mySelectedExamination.forEach((exam) {
// if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
// null)
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = [];
// // TODO : change createdBy editedBy
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(
// ListHisProgNotePhysicalExaminationVM(
// patientMRN: widget.patientInfo.patientMRN,
// episodeId: widget.patientInfo.episodeNo,
// appointmentNo: widget.patientInfo.appointmentNo,
// remarks: exam.remark ?? '',
// createdBy: 4709,
// createdOn: DateTime.now().toIso8601String(),
// editedBy: 4709,
// editedOn: DateTime.now().toIso8601String(),
// examId: exam.selectedExamination.id,
// examType: exam.selectedExamination.typeId,
// isAbnormal: exam.isAbnormal,
// isNormal: exam.isNormal,
// masterDescription: exam.selectedExamination,
// notExamined: false
//
// ));
// });
//
// await model.postPhysicalExam(postPhysicalExamRequestModel);
//
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// widget.changePageViewIndex(2);
// }
// } else {
// helpers.showErrorToast('Please add required field correctly');
// }
widget.changePageViewIndex(2);
}
removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = widget.mySelectedExamination
.where(
(element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0)
setState(() {
widget.mySelectedExamination.remove(history.first);
});
}
openExaminationList(BuildContext context) {
final screenSize = MediaQuery
.of(context)
.size;
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return AddExaminationDailog(
mySelectedExamination: widget.mySelectedExamination,
addSelectedExamination: () {
setState(() {
Navigator.of(context).pop();
});
},
removeExamination: (masterKey) => removeExamination(masterKey),);
});
}
}
class AddExaminationDailog extends StatefulWidget {
final List<MySelectedExamination> mySelectedExamination;
final Function addSelectedExamination;
final Function (MasterKeyModel) removeExamination;
const AddExaminationDailog(
{Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination})
: super(key: key);
@override
_AddExaminationDailogState createState() => _AddExaminationDailogState();
}
class _AddExaminationDailogState extends State<AddExaminationDailog> {
@override
Widget build(BuildContext context) {
return FractionallySizedBox(
heightFactor: 0.7,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(
MasterKeysService.PhysicalExamination);
}
},
builder: (_, model, w) =>
AppScaffold(
// baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
"Examinations",
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.physicalExaminationList,
removeHistory: (history){
setState(() {
widget.removeExamination(history);
});
},
addHistory: (history){
setState(() {
MySelectedExamination mySelectedExamination = new MySelectedExamination(
selectedExamination: history
);
widget
.mySelectedExamination
.add(
mySelectedExamination);
});
},
addSelectedHistories: (){
widget.addSelectedExamination();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
),
]),
))),
)),
);
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam =
widget
.mySelectedExamination
.where((element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
if (exam.length > 0) {
return true;
}
return false;
}
}

@ -1,349 +0,0 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class PlanPage extends StatefulWidget {
final Function changePageViewIndex;
final PatiantInformtion patientInfo;
PlanPage({Key key, this.changePageViewIndex, this.patientInfo});
@override
_PlanPageState createState() => _PlanPageState();
}
class _PlanPageState extends State<PlanPage> {
bool isProgressNoteExpand = false;
List<dynamic> progressNoteList;
TextEditingController progressNoteController =
TextEditingController(text: null);
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 0.5,
)),
);
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<SOAPViewModel>(
// onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies),
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('Progress Note',
variant:
isProgressNoteExpand ? "bodyText" : '',
bold: isProgressNoteExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isProgressNoteExpand =
!isProgressNoteExpand;
});
},
child: Icon(isProgressNoteExpand
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(children: [
SizedBox(
height: 20,
),
Column(
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add Progress Note",
fontSize: 13.5,
onTapTextFields: () {
openProgressNote(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
if (progressNoteController.text.isNotEmpty)
Container(
margin:
EdgeInsets.only(left: 5, right: 5, top: 15),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
"12".toUpperCase(),
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
"DEC".toUpperCase(),
fontSize: 10,
color: Colors.grey,
),
],
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
SizedBox(
height: 6,
),
Padding(
padding: const EdgeInsets.all(0.0),
child: Container(
width: MediaQuery
.of(context)
.size
.width * 0.6,
child: AppText(
progressNoteController.text,
fontSize: 10,
color: Colors.grey,
),
),
),
],
), SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Created By : ",
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
"Anas Abdullah on 12 De",
fontSize: 10,
color: Colors.grey,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Edited By : ",
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
"Rahim on 13 Dec",
fontSize: 10,
color: Colors.grey,
),
],
),
],
),
Column(
children: [
InkWell(
onTap: () {
openProgressNote(context);
},
child: Icon(EvaIcons.edit2Outline),
)
],
),
],
),
)
],
)
]),
isExpand: isProgressNoteExpand,
),
DividerWithSpacesAround(height: 30,),
AppButton(
title: TranslationBase
.of(context)
.next,
loading: model.state == ViewState.BusyLocal,
onPressed: () {
submitPlan(model);
// widget.changePageViewIndex(2);
},
),
SizedBox(
height: 30,
),
],
),
),
),
),),);
}
submitPlan(SOAPViewModel model) async {
if (progressNoteController.text.isNotEmpty) {
PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
planNote: progressNoteController.text);
await model.postProgressNote(postProgressNoteRequestModel);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else {
Navigator.of(context).pop();
}
}
// Navigator.of(context).pop();
}
openProgressNote(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return FractionallySizedBox(
heightFactor: 0.5,
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
"Add Progress Note",
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: TextFields(
hintText: "Add progress note here",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 16,
minLines: 8,
controller: progressNoteController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),SizedBox(
height: 10,
),
AppButton(
title: "Add".toUpperCase(),
onPressed: () {
Navigator.of(context).pop();
},
),
]),
)),
);
});
}
}

@ -1,339 +0,0 @@
import 'package:autocomplete_textfield/autocomplete_textfield.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/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
class AddAllergiesWidget extends StatefulWidget {
final List<MySelectedAllergy> myAllergiesList;
AddAllergiesWidget({Key key, this.myAllergiesList});
@override
_AddAllergiesWidgetState createState() => _AddAllergiesWidgetState();
}
class _AddAllergiesWidgetState extends State<AddAllergiesWidget> {
TextEditingController remarkController = TextEditingController();
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return Column(
children: [
Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add Allergies",
fontSize: 13.5,
onTapTextFields: () {
openAllergiesList(context);
},
readOnly: true,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
Container(
margin:
EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column(
children: widget.myAllergiesList.map((selectedAllergy) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts(selectedAllergy.selectedAllergy.nameEn.toUpperCase(),
variant: "bodyText", bold: true, color: Colors.black),
Texts(
selectedAllergy.selectedAllergySeverity.nameEn
.toUpperCase(),
variant: "bodyText",
bold: true,
color: AppGlobal.appPrimaryColor),
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
),
onTap: () => removeAllergy(selectedAllergy),
)
],
),
SizedBox(
height: 10,
),
],
);
}).toList()),
)
],
);
}
removeAllergy(MySelectedAllergy mySelectedAllergy) {
Iterable<MySelectedAllergy> allergy =
widget.myAllergiesList.where((element) => mySelectedAllergy == element);
if (allergy.length > 0)
setState(() {
widget.myAllergiesList.remove(allergy.first);
});
}
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();
});
},);
});
}
}
class AddAllergies extends StatefulWidget {
final Function addAllergiesFun;
const AddAllergies({Key key, this.addAllergiesFun}) : super(key: key);
@override
_AddAllergiesState createState() => _AddAllergiesState();
}
class _AddAllergiesState extends State<AddAllergies> {
List<MasterKeyModel> allergiesList;
List<MasterKeyModel> allergySeverityList;
MasterKeyModel _selectedAllergySeverity;
MasterKeyModel _selectedAllergy;
TextEditingController remarkController = TextEditingController();
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown,{IconData icon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
bool _isShowSearch = false;
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
final screenSize = MediaQuery
.of(context)
.size;
return FractionallySizedBox(
heightFactor: 0.7,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.allergiesList.length == 0) {
await model.getMasterLookup(MasterKeysService.Allergies);
}
if (model.allergySeverityList.length == 0) {
await model.getMasterLookup(MasterKeysService.AllergySeverity);
}
},
builder: (_, model, w) =>
AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: SingleChildScrollView(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
"Add Allergy",
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.allergiesList != null
? () {
setState(() {
_selectedAllergy = null;
});
}
: null,
child: _selectedAllergy==null? AutoCompleteTextField<MasterKeyModel>(
decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search),
itemSubmitted: (item) => setState(() => _selectedAllergy = item),
key: key,
suggestions: model.allergiesList,
itemBuilder: (context, suggestion) => new Padding(
child:Texts( projectViewModel.isArabic? suggestion.nameAr: suggestion.nameEn),
padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.nameAr.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.nameEn.toLowerCase().startsWith(input.toLowerCase()),
):TextField(
decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.allergySeverityList != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.allergySeverityList,
okText: TranslationBase
.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
_selectedAllergySeverity =
selectedValue;
// model.getDoctorBranch().then((value) {
// _selectedBranch = value;
// if (_referTo['id'] == 1) {
// model.getClinics(
// _selectedBranch['ID']);
// }
// });
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
"Select Severity",
_selectedAllergySeverity != null
? _selectedAllergySeverity.nameEn
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hintText: "Remarks",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 13,
controller: remarkController,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
), SizedBox(
height: 10,
),
AppButton(
title: "Add".toUpperCase(),
onPressed: () {
MySelectedAllergy mySelectedAllergy = new MySelectedAllergy(
remark: remarkController.text,
selectedAllergy: _selectedAllergy,
selectedAllergySeverity: _selectedAllergySeverity);
widget.addAllergiesFun(mySelectedAllergy);
},
),
]
),
),
),
)),
),
);
}
}

@ -1,360 +0,0 @@
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/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../../shared/master_key_checkbox_search_widget.dart';
class AddHistoryWidget extends StatefulWidget {
final List<MasterKeyModel> myHistoryList;
const AddHistoryWidget({Key key, this.myHistoryList}) : super(key: key);
@override
_AddHistoryWidgetState createState() => _AddHistoryWidgetState();
}
class _AddHistoryWidgetState extends State<AddHistoryWidget>
with TickerProviderStateMixin {
PageController _controller;
int _currentIndex = 0;
changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex);
}
@override
void initState() {
_controller = new PageController();
super.initState();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add History",
fontSize: 13.5,
onTapTextFields: () {
openHistoryList(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
Container(
margin:
EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column(
children: widget.myHistoryList.map((myHistory) {
return Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(myHistory.nameEn,
variant: "bodyText", bold: true, color: Colors.black),
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
),
onTap: () => removeHistory(myHistory),
)
],
),
SizedBox(
height: 20,
),
],
);
}).toList(),
),
)
],
);
}
removeHistory(MasterKeyModel masterKey) {
Iterable<MasterKeyModel> history = widget.myHistoryList.where((element) =>
masterKey.id == element.id && masterKey.typeId == element.typeId);
if (history.length > 0)
setState(() {
widget.myHistoryList.remove(history.first);
});
}
openHistoryList(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return AddHistoryDialog(
changePageViewIndex: changePageViewIndex,
controller: _controller,
myHistoryList: widget.myHistoryList,
addSelectedHistories: () {
setState(() {
Navigator.of(context).pop();
});
},
removeHistory: (masterKey) => removeHistory(masterKey),
);
});
}
}
class PriorityBar extends StatefulWidget {
final Function onTap;
const PriorityBar({Key key, this.onTap}) : super(key: key);
@override
_PriorityBarState createState() => _PriorityBarState();
}
class _PriorityBarState extends State<PriorityBar> {
int _activePriority = 0;
List<String> _priorities = [
"Family",
"Surgical/Sports",
"Medical",
];
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 2.0,
)),
);
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return Container(
height: screenSize.height * 0.070,
decoration:
containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((item) {
bool _isActive = _priorities[_activePriority] == item ? true : false;
return Expanded(
child: InkWell(
child: Center(
child: Container(
height: screenSize.height * 0.070,
decoration: 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: () {
widget.onTap(_priorities.indexOf(item));
setState(() {
_activePriority = _priorities.indexOf(item);
});
}),
);
}).toList(),
),
);
}
}
class AddHistoryDialog extends StatefulWidget {
final Function changePageViewIndex;
final PageController controller;
final List<MasterKeyModel> myHistoryList;
final Function addSelectedHistories;
final Function (MasterKeyModel) removeHistory;
const AddHistoryDialog(
{Key key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory})
: super(key: key);
@override
_AddHistoryDialogState createState() => _AddHistoryDialogState();
}
class _AddHistoryDialogState extends State<AddHistoryDialog> {
@override
Widget build(BuildContext context) {
return FractionallySizedBox(
heightFactor: 0.7,
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.historyFamilyList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistoryFamily);
}
},
builder: (_, model, w) => AppScaffold(
// baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
SizedBox(
height: 10,
),
PriorityBar(onTap: (activePriority) async {
widget.changePageViewIndex(activePriority);
if(activePriority ==1) {
if (model.historySurgicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistorySurgical);
await model.getMasterLookup(MasterKeysService.HistorySports);
}
}
if(activePriority ==2) {
if (model.historyMedicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistoryMedical);
}
}
}),
SizedBox(
height: 20,
),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: widget.controller,
onPageChanged: (index) {
setState(() {
// currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.historyFamilyList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
widget.myHistoryList.add(history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.mergeHistorySurgicalWithHistorySportList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
widget.myHistoryList.add(history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.historyMedicalList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
widget.myHistoryList.add(history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
],
),
),
],
),
)),
),
),
));
}
bool isServiceSelected(MasterKeyModel masterKey) {
Iterable<MasterKeyModel> history =
widget.myHistoryList.where((element) => masterKey.id == element.id && masterKey.typeId == element.typeId);
if (history.length > 0) {
return true;
}
return false;
}
}

@ -1,107 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class AddMedication extends StatefulWidget {
@override
_AddMedicationState createState() => _AddMedicationState();
}
class _AddMedicationState extends State<AddMedication> {
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Current Medications",
fontSize: 13.5,
onTapTextFields: () {
openMedicationsList(context);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
Container(
margin:
EdgeInsets.only(left: 15, right: 15, top: 15),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts('Abdomen Pain',
variant: "bodyText",
bold: true,
color: Colors.black),
Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
)
],
),
SizedBox(
height: 20,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Texts('Back Pain',
variant: "bodyText",
bold: true,
color: Colors.black),
Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
)
],
),
],
),
)
],
);
}
openMedicationsList(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return FractionallySizedBox(
heightFactor: 0.7,
child: Container(
child: Center(
child: Texts("dfdfd"),
)),
);
});
}
}

@ -1,402 +0,0 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_history_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class SubjectivePage extends StatefulWidget {
final Function changePageViewIndex;
final List<MySelectedAllergy> myAllergiesList;
final List<MasterKeyModel> myHistoryList;
final PatiantInformtion patientInfo;
SubjectivePage(
{Key key,
this.changePageViewIndex,
this.myAllergiesList,
this.myHistoryList,
this.patientInfo});
@override
_SubjectivePageState createState() => _SubjectivePageState();
}
class _SubjectivePageState extends State<SubjectivePage> {
bool isChiefExpand = false;
bool isHistoryExpand = false;
bool isAllergiesExpand = false;
TextEditingController illnessController = TextEditingController();
TextEditingController complaintsController = TextEditingController();
final formKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
// onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies),
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
baseViewModel: model,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('CHIEF COMPLAINTS',
variant: isChiefExpand ? "bodyText" : '',
bold: isChiefExpand ? true : false,
color: Colors.black),
Icon(
FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor,
size: 12,
)
],
),
InkWell(
onTap: () {
setState(() {
isChiefExpand = !isChiefExpand;
});
},
child: Icon(
isChiefExpand ? EvaIcons.minus : EvaIcons.plus))
],
),
bodyWidget: Form(
key: formKey,
child: Column(children: [
SizedBox(
height: 20,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add Chief Complaints",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 13,
controller: complaintsController,
validator: (value) {
if (value == null || value == "")
return TranslationBase.of(context)
.emptyMessage;
else if (value.length < 25)
return TranslationBase.of(context)
.chiefComplaintLength;
//"";
else
return null;
}),
),
SizedBox(
height: 20,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "History of Present Illness",
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 13,
controller: illnessController,
validator: (value) {
if (value == null || value =="")
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 20,
),
// TODO return it back when we need it.
// AddMedication(),
]),
),
isExpand: isChiefExpand,
),
SizedBox(
height: 30,
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('History'.toUpperCase(),
variant: isHistoryExpand ? "bodyText" : '',
bold: isHistoryExpand ? true : false,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isHistoryExpand = !isHistoryExpand;
});
},
child: Icon(isHistoryExpand
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(
children: [
AddHistoryWidget(myHistoryList: widget.myHistoryList)
],
),
isExpand: isHistoryExpand,
),
SizedBox(
height: 30,
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('Allergies'.toUpperCase(),
variant: isAllergiesExpand ? "bodyText" : '',
bold: isAllergiesExpand ? true : false,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isAllergiesExpand = !isAllergiesExpand;
});
},
child: Icon(isAllergiesExpand
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(
children: [
AddAllergiesWidget(
myAllergiesList: widget.myAllergiesList,
),
SizedBox(
height: 30,
),
],
),
isExpand: isAllergiesExpand,
),
SizedBox(
height: 30,
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
height: 30,
),
AppButton(
title: TranslationBase.of(context).next,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
addSubjectiveInfo(
model: model,
myAllergiesList: widget.myAllergiesList,
myHistoryList: widget.myHistoryList);
},
),
],
),
),
),
),
),
);
}
addSubjectiveInfo(
{SOAPViewModel model,
List<MySelectedAllergy> myAllergiesList,
List<MasterKeyModel> myHistoryList}) async {
formKey.currentState.save();
formKey.currentState.validate();
// if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) {
// await postChiefComplaint(model: model);
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// if (myHistoryList.length != 0) {
// await postHistories(model: model, myHistoryList: myHistoryList);
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// if (myAllergiesList.length != 0) {
// await postAllergy(myAllergiesList: myAllergiesList, model: model);
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// widget.changePageViewIndex(1);
// }
// } else {
// widget.changePageViewIndex(1);
//
// }
//
// }
// } else {
// if (myAllergiesList.length != 0) {
// await postAllergy(myAllergiesList: myAllergiesList, model: model);
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// widget.changePageViewIndex(1);
// }
// } else {
// widget.changePageViewIndex(1);
// }
// }
// }
// } else {
// helpers.showErrorToast('Please add required field correctly');
// }
widget.changePageViewIndex(1);
}
postAllergy(
{List<MySelectedAllergy> myAllergiesList, SOAPViewModel model}) async {
PostAllergyRequestModel postAllergyRequestModel =
new PostAllergyRequestModel();
widget.myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
//TODO: make static value dynamic
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM
.add(ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: 4709,
//
createdOn: DateTime.now()
.toIso8601String(), //"2020-08-14T20:37:22.780Z",
editedBy: 4709,
editedOn: DateTime.now()
.toIso8601String(), //"2020-08-14T20:37:22.780Z",
isChecked: false,
isUpdatedByNurse: false));
});
await model.postAllergy(postAllergyRequestModel);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
}
}
postHistories(
{List<MasterKeyModel> myHistoryList, SOAPViewModel model}) async {
PostHistoriesRequestModel postHistoriesRequestModel =
new PostHistoriesRequestModel();
widget.myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null)
postHistoriesRequestModel.listMedicalHistoryVM = [];
//TODO: make static value dynamic
postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: "",
historyId: history.id,
historyType: history.typeId,
isChecked: false,
));
});
await model.postHistories(postHistoriesRequestModel);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
}
}
postChiefComplaint({SOAPViewModel model}) async {
formKey.currentState.save();
if (formKey.currentState.validate()) {
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
//TODO: make static value dynamic
new PostChiefComplaintRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
chiefComplaint: complaintsController.text,
currentMedication: " currentMedication ",
hopi: illnessController.text,
isLactation: false,
ispregnant: false,
numberOfWeeks: 22);
await model.postChiefComplaint(postChiefComplaintRequestModel);
}
}
}

@ -44,7 +44,7 @@ class PatientPageHeaderWidget extends StatelessWidget {
height: 5, height: 5,
), ),
AppText( AppText(
patient.firstName + ' ' + patient.lastName, patient.firstName + ' ' + patient.lastName,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),

@ -22,6 +22,7 @@ class PatientProfileWidget extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
return Container( return Container(
color: Color(0XFFF2F2F2), color: Color(0XFFF2F2F2),
@ -437,7 +438,7 @@ class PatientProfileWidget extends StatelessWidget {
SliverPadding( SliverPadding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
sliver: ProfileMedicalInfoWidget( sliver: ProfileMedicalInfoWidget(
patient: patient, patient: patient, patientType:patientType
)) ))
]), ]),
); );

@ -18,8 +18,9 @@ import 'PatientProfileButton.dart';
*@desc: Profile Medical Info Widget *@desc: Profile Medical Info Widget
*/ */
class ProfileMedicalInfoWidget extends StatelessWidget { class ProfileMedicalInfoWidget extends StatelessWidget {
ProfileMedicalInfoWidget({Key key, this.patient}) : super(key: key); ProfileMedicalInfoWidget({Key key, this.patient, this.patientType});
PatiantInformtion patient; PatiantInformtion patient;
String patientType;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SliverGrid.count( return SliverGrid.count(
@ -28,27 +29,32 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
crossAxisCount: 2, crossAxisCount: 2,
childAspectRatio: 1.5, childAspectRatio: 1.5,
children: [ children: [
if(int.parse(patientType) ==7)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
nameLine1: "Create New", nameLine1: TranslationBase.of(context).createNew,
nameLine2: "Episode", nameLine2: TranslationBase.of(context).episode,
route: CREATE_EPISODE, route: CREATE_EPISODE,
icon: 'heartbeat.png'), icon: 'create-episod.png'),
if(int.parse(patientType) ==7)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
nameLine1: "Update", nameLine1: TranslationBase.of(context).update,
nameLine2: "Episode", nameLine2: TranslationBase.of(context).episode,
route: UPDATE_EPISODE, route: UPDATE_EPISODE,
icon: 'heartbeat.png'), icon: 'modilfy-episode.png'),
PatientProfileButton( Visibility(
key: key, visible: selectedPatientType == 6 || selectedPatientType == 7,
patient: patient, child: PatientProfileButton(
nameLine1: TranslationBase.of(context).vital, key: key,
nameLine2: TranslationBase.of(context).signs, patient: patient,
route: PATIENT_VITAL_SIGN, nameLine1: TranslationBase.of(context).vital,
icon: 'heartbeat.png'), nameLine2: TranslationBase.of(context).signs,
route: PATIENT_VITAL_SIGN,
icon: 'heartbeat.png'),
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -79,13 +85,23 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).progress, nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note, nameLine2: TranslationBase.of(context).note,
icon: 'heartbeat.png')), icon: 'heartbeat.png')),
PatientProfileButton( Visibility(
key: key, visible: selectedPatientType == 6 || selectedPatientType == 7,
patient: patient, child: PatientProfileButton(
route: PATIENT_INSURANCE_APPROVALS, key: key,
nameLine1: TranslationBase.of(context).insurance, patient: patient,
nameLine2: TranslationBase.of(context).approvals, route: PATIENT_ADMISSION_REQUEST,
icon: 'lab.png'), nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request,
icon: 'heartbeat.png'),
),
// PatientProfileButton(
// key: key,
// patient: patient,
// route: PATIENT_INSURANCE_APPROVALS,
// nameLine1: TranslationBase.of(context).insurance,
// nameLine2: TranslationBase.of(context).approvals,
// icon: 'lab.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -101,9 +117,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine2: 'Or Procedures', nameLine2: 'Or Procedures',
icon: 'lab.png'), icon: 'lab.png'),
Visibility( Visibility(
visible: selectedPatientType != 0 && visible: selectedPatientType == 6 || selectedPatientType == 7,
selectedPatientType != 5 &&
selectedPatientType != 2,
child: PatientProfileButton( child: PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -129,6 +143,15 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).patientSick, nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave, nameLine2: TranslationBase.of(context).leave,
icon: 'sick_leaves_icons.png')), icon: 'sick_leaves_icons.png')),
Visibility(
visible: selectedPatientType == 6 || selectedPatientType == 7,
child: PatientProfileButton(
key: key,
patient: patient,
route: PATIENT_UCAF_REQUEST,
nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf,
icon: 'lab.png')),
]); ]);
} }
} }

@ -295,7 +295,7 @@ class StepsWidget extends StatelessWidget {
height: index == 0 ? 5 : 10, height: index == 0 ? 5 : 10,
), ),
AppText( AppText(
"SUBJECTIVE", "شخصي",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
), ),
@ -345,7 +345,7 @@ class StepsWidget extends StatelessWidget {
height: index == 1 ? 5 : 10, height: index == 1 ? 5 : 10,
), ),
AppText( AppText(
"OBJECTIVE", "هدف",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
), ),
@ -398,7 +398,7 @@ class StepsWidget extends StatelessWidget {
padding: const EdgeInsets.only(right: 2), padding: const EdgeInsets.only(right: 2),
child: AppText( child: AppText(
"ASSESSMENT", "تقدير",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
), ),
@ -451,7 +451,7 @@ class StepsWidget extends StatelessWidget {
Container( Container(
margin: EdgeInsets.only(right:index == 3? 15:0), margin: EdgeInsets.only(right:index == 3? 15:0),
child: AppText( child: AppText(
"PLAN", "خطة",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
), ),

@ -32,14 +32,14 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; ProjectViewModel projectViewModel = Provider.of(context);
return Column( return Column(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: "Add Allergies", hintText: TranslationBase.of(context).addAllergies,
fontSize: 13.5, fontSize: 13.5,
onTapTextFields: () { onTapTextFields: () {
openAllergiesList(context); openAllergiesList(context);
@ -66,14 +66,26 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
children: widget.myAllergiesList.map((selectedAllergy) { children: widget.myAllergiesList.map((selectedAllergy) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ mainAxisAlignment: MainAxisAlignment.start,children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(selectedAllergy.selectedAllergy.nameEn.toUpperCase(), Container(
variant: "bodyText", bold: true, color: Colors.black),
child: Expanded(
child: Texts(projectViewModel.isArabic ? selectedAllergy
.selectedAllergy.nameAr : selectedAllergy
.selectedAllergy.nameEn.toUpperCase(),
variant: "bodyText",
bold: true,
color: Colors.black),
),
width: MediaQuery.of(context).size.width * 0.5,
),
Texts( Texts(
selectedAllergy.selectedAllergySeverity.nameEn projectViewModel.isArabic ? selectedAllergy
.selectedAllergySeverity.nameAr : selectedAllergy
.selectedAllergySeverity.nameEn
.toUpperCase(), .toUpperCase(),
variant: "bodyText", variant: "bodyText",
bold: true, bold: true,
@ -118,13 +130,19 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
return AddAllergies( return AddAllergies(
addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { addAllergiesFun: (MySelectedAllergy mySelectedAllergy) {
setState(() { setState(() {
widget.myAllergiesList.add(mySelectedAllergy); if (!widget.myAllergiesList.contains(mySelectedAllergy)) {
Navigator.of(context).pop(); widget.myAllergiesList.add(mySelectedAllergy);
Navigator.of(context).pop();
} else {
helpers.showErrorToast(TranslationBase
.of(context)
.itemExist);
}
}); });
}, },);
);
}); });
} }
} }
class AddAllergies extends StatefulWidget { class AddAllergies extends StatefulWidget {
@ -172,7 +190,9 @@ class _AddAllergiesState extends State<AddAllergies> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery
.of(context)
.size;
return FractionallySizedBox( return FractionallySizedBox(
heightFactor: 0.7, heightFactor: 0.7,
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
@ -198,7 +218,9 @@ class _AddAllergiesState extends State<AddAllergies> {
height: 16, height: 16,
), ),
AppText( AppText(
"Add Allergy", TranslationBase
.of(context)
.addAllergies,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
), ),
@ -218,7 +240,9 @@ class _AddAllergiesState extends State<AddAllergies> {
child: _selectedAllergy == null child: _selectedAllergy == null
? AutoCompleteTextField<MasterKeyModel>( ? AutoCompleteTextField<MasterKeyModel>(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
"Select Allergy", TranslationBase
.of(context)
.selectAllergy,
_selectedAllergy != null _selectedAllergy != null
? _selectedAllergy.nameEn ? _selectedAllergy.nameEn
: null, : null,
@ -246,9 +270,11 @@ class _AddAllergiesState extends State<AddAllergies> {
) )
: TextField( : TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
"Select Allergy", TranslationBase
.of(context)
.selectAllergy,
_selectedAllergy != null _selectedAllergy != null
? _selectedAllergy.nameEn ? projectViewModel.isArabic?_selectedAllergy.nameAr: _selectedAllergy.nameEn
: null, : null,
true, true,
icon: EvaIcons.search), icon: EvaIcons.search),
@ -271,13 +297,7 @@ class _AddAllergiesState extends State<AddAllergies> {
setState(() { setState(() {
_selectedAllergySeverity = _selectedAllergySeverity =
selectedValue; selectedValue;
// model.getDoctorBranch().then((value) {
// _selectedBranch = value;
// if (_referTo['id'] == 1) {
// model.getClinics(
// _selectedBranch['ID']);
// }
// });
}); });
}, },
); );
@ -292,9 +312,11 @@ class _AddAllergiesState extends State<AddAllergies> {
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
"Select Severity", TranslationBase
.of(context)
.selectSeverity,
_selectedAllergySeverity != null _selectedAllergySeverity != null
? _selectedAllergySeverity.nameEn ? projectViewModel.isArabic?_selectedAllergySeverity.nameAr:_selectedAllergySeverity.nameEn
: null, : null,
true), true),
enabled: false, enabled: false,
@ -307,12 +329,12 @@ class _AddAllergiesState extends State<AddAllergies> {
Container( Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15), margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hintText: "Remarks", hintText: TranslationBase.of(context).remarks,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
maxLines: 25, maxLines: 25,
minLines: 13, minLines: 10,
controller: remarkController, controller: remarkController,
validator: (value) { validator: (value) {
if (value == null) if (value == null)

@ -2,6 +2,7 @@ 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/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/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -16,6 +17,7 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class UpdateHistoryWidget extends StatefulWidget { class UpdateHistoryWidget extends StatefulWidget {
final List<MasterKeyModel> myHistoryList; final List<MasterKeyModel> myHistoryList;
@ -44,12 +46,13 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Column( return Column(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: "Add History", hintText: TranslationBase.of(context).addHistory,
fontSize: 13.5, fontSize: 13.5,
onTapTextFields: () { onTapTextFields: () {
openHistoryList(context); openHistoryList(context);
@ -81,8 +84,13 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(myHistory.nameEn, Container(
variant: "bodyText", bold: true, color: Colors.black), child: Expanded(
child: Texts(projectViewModel.isArabic?myHistory.nameAr:myHistory.nameEn,
variant: "bodyText", bold: true, color: Colors.black),
),
width: MediaQuery.of(context).size.width * 0.7,
),
InkWell( InkWell(
child: Icon( child: Icon(
FontAwesomeIcons.trash, FontAwesomeIcons.trash,
@ -147,12 +155,17 @@ class PriorityBar extends StatefulWidget {
class _PriorityBarState extends State<PriorityBar> { class _PriorityBarState extends State<PriorityBar> {
int _activePriority = 0; int _activePriority = 0;
int index =-1;
List<String> _priorities = [ List<String> _priorities = [
"Family", "Family",
"Surgical/Sports", "Surgical/Sports",
"Medical", "Medical",
]; ];
List<String> _prioritiesAr = [
"أسرة",
"جراحي / رياضي" ,
"طبي",
];
BoxDecoration containerBorderDecoration( BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) { Color containerColor, Color borderColor) {
@ -170,6 +183,7 @@ class _PriorityBarState extends State<PriorityBar> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
@ -178,8 +192,9 @@ class _PriorityBarState extends State<PriorityBar> {
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((item) { children: _priorities.map((item,) {
bool _isActive = _priorities[_activePriority] == item ? true : false; bool _isActive = _priorities[_activePriority] == item ? true : false;
index++;
return Expanded( return Expanded(
child: InkWell( child: InkWell(
child: Center( child: Center(
@ -190,7 +205,7 @@ class _PriorityBarState extends State<PriorityBar> {
_isActive ? HexColor("#B8382B") : Colors.white), _isActive ? HexColor("#B8382B") : Colors.white),
child: Center( child: Center(
child: Text( child: Text(
item, (projectViewModel.isArabic)?_prioritiesAr[index]: item,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: _isActive color: _isActive

@ -50,28 +50,25 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
TextEditingController complaintsController = TextEditingController(); TextEditingController complaintsController = TextEditingController();
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
getHistory(SOAPViewModel model) async{ getHistory(SOAPViewModel model) async{
GetHistoryReqModel getHistoryMedicalReqModel = GetHistoryReqModel( GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
historyType: episodeID: widget.patientInfo.episodeNo.toString(),
MasterKeysService.HistoryMedical.getMasterKeyService()); appointmentNo: widget.patientInfo.appointmentNo);
GetHistoryReqModel getHistorySportsReqModel = GetHistoryReqModel(
patientMRN: widget.patientInfo.patientMRN, getHistoryReqModel.historyType =
historyType: MasterKeysService.HistoryFamily.getMasterKeyService();
MasterKeysService.HistorySports.getMasterKeyService()); await model.getPatientHistories(getHistoryReqModel, isFirst: true);
GetHistoryReqModel getHistorySurgicalReqModel = GetHistoryReqModel( getHistoryReqModel.historyType =
patientMRN: widget.patientInfo.patientMRN, MasterKeysService.HistoryMedical.getMasterKeyService();
historyType: await model.getPatientHistories(getHistoryReqModel);
MasterKeysService.HistorySurgical.getMasterKeyService()); getHistoryReqModel.historyType =
GetHistoryReqModel getHistoryFamilyReqModel = GetHistoryReqModel( MasterKeysService.HistorySurgical.getMasterKeyService();
patientMRN: widget.patientInfo.patientMRN, await model.getPatientHistories(getHistoryReqModel);
historyType: getHistoryReqModel.historyType =
MasterKeysService.HistoryFamily.getMasterKeyService()); MasterKeysService.HistorySports.getMasterKeyService();
await model.getPatientHistories(getHistoryMedicalReqModel); await model.getPatientHistories(getHistoryReqModel);
await model.getPatientHistories(getHistorySportsReqModel);
await model.getPatientHistories(getHistorySurgicalReqModel);
await model.getPatientHistories(getHistoryFamilyReqModel);
if(model.patientHistoryList.isNotEmpty) { if (model.patientHistoryList.isNotEmpty) {
if (model.historyFamilyList.isEmpty) { if (model.historyFamilyList.isEmpty) {
await model.getMasterLookup(MasterKeysService.HistoryFamily); await model.getMasterLookup(MasterKeysService.HistoryFamily);
} }
@ -80,39 +77,59 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
} }
if (model.historySurgicalList.length == 0) { if (model.historySurgicalList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistorySurgical); await model.getMasterLookup(MasterKeysService.HistorySurgical);
}
if (model.historySportList.length == 0) {
await model.getMasterLookup(MasterKeysService.HistorySports); await model.getMasterLookup(MasterKeysService.HistorySports);
} }
model.patientHistoryList.forEach((element) { model.patientHistoryList.forEach((element) {
if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { if (element.historyType ==
widget.myHistoryList.add( model.getOneMasterKey( MasterKeysService.HistoryFamily.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryFamily, masterKeys: MasterKeysService.HistoryFamily,
id: element.historyId, id: element.historyId,
)); );
}if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { if (history != null) {
widget.myHistoryList.add( model.getOneMasterKey( widget.myHistoryList.add(history);
}
}
if (element.historyType ==
MasterKeysService.HistoryMedical.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistoryMedical, masterKeys: MasterKeysService.HistoryMedical,
id: element.historyId, id: element.historyId,
)); );
}if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { if (history != null) {
widget.myHistoryList.add( model.getOneMasterKey( widget.myHistoryList.add(history);
}
}
if (element.historyType ==
MasterKeysService.HistorySports.getMasterKeyService()) {
MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySports, masterKeys: MasterKeysService.HistorySports,
id: element.historyId, id: element.historyId,
)); );
if (history != null) {
widget.myHistoryList.add(history);
}
} }
if (element.historyType == if (element.historyType ==
MasterKeysService.HistorySurgical.getMasterKeyService()) { MasterKeysService.HistorySurgical.getMasterKeyService()) {
widget.myHistoryList.add(model.getOneMasterKey( MasterKeyModel history = model.getOneMasterKey(
masterKeys: MasterKeysService.HistorySurgical, masterKeys: MasterKeysService.HistorySurgical,
id: element.historyId, id: element.historyId,
)); );
if (history != null) {
widget.myHistoryList.add(history);
}
} }
}); });
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
@ -126,8 +143,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
episodeID: widget.patientInfo.episodeNo); episodeID: widget.patientInfo.episodeNo);
await model.getPatientChiefComplaint(getChiefComplaintReqModel); await model.getPatientChiefComplaint(getChiefComplaintReqModel);
if (model.patientChiefComplaintList.isNotEmpty) { if (model.patientChiefComplaintList.isNotEmpty) {
complaintsController.text = complaintsController.text = helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint)
model.patientChiefComplaintList[0].chiefComplaint; ;
illnessController.text = model.patientChiefComplaintList[0].hopi; illnessController.text = model.patientChiefComplaintList[0].hopi;
} }
await model.getPatientAllergy(generalGetReqForSOAP); await model.getPatientAllergy(generalGetReqForSOAP);
@ -177,7 +194,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
children: [ children: [
Row( Row(
children: [ children: [
Texts('CHIEF COMPLAINTS', Texts(TranslationBase.of(context).chiefComplaints.toUpperCase(),
variant: isChiefExpand ? "bodyText" : '', variant: isChiefExpand ? "bodyText" : '',
bold: isChiefExpand ? true : false, bold: isChiefExpand ? true : false,
color: Colors.black), color: Colors.black),
@ -207,7 +224,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: "Add Chief Complaints", hintText: TranslationBase
.of(context)
.addChiefComplaints,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -215,7 +234,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
minLines: 13, minLines: 13,
controller: complaintsController, controller: complaintsController,
validator: (value) { validator: (value) {
if (value == null || value =="") if (value == null || value == "")
return TranslationBase return TranslationBase
.of(context) .of(context)
.emptyMessage; .emptyMessage;
@ -223,7 +242,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
return TranslationBase return TranslationBase
.of(context) .of(context)
.chiefComplaintLength; .chiefComplaintLength;
//""; //"";
else else
return null; return null;
}), }),
@ -234,7 +253,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: "History of Present Illness", hintText: TranslationBase
.of(context)
.historyOfPresentIllness,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -242,7 +263,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
minLines: 13, minLines: 13,
controller: illnessController, controller: illnessController,
validator: (value) { validator: (value) {
if (value == null || value =="") if (value == null || value == "")
return TranslationBase return TranslationBase
.of(context) .of(context)
.emptyMessage; .emptyMessage;
@ -277,7 +298,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
children: [ children: [
Row( Row(
children: [ children: [
Texts('History'.toUpperCase(), Texts(TranslationBase
.of(context)
.histories
.toUpperCase(),
variant: isHistoryExpand ? "bodyText" : '', variant: isHistoryExpand ? "bodyText" : '',
bold: isHistoryExpand ? true : false, bold: isHistoryExpand ? true : false,
color: Colors.black), color: Colors.black),
@ -318,7 +342,10 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
children: [ children: [
Row( Row(
children: [ children: [
Texts('Allergies'.toUpperCase(), Texts(TranslationBase
.of(context)
.allergiesSoap
.toUpperCase(),
variant: isAllergiesExpand ? "bodyText" : '', variant: isAllergiesExpand ? "bodyText" : '',
bold: isAllergiesExpand ? true : false, bold: isAllergiesExpand ? true : false,
color: Colors.black), color: Colors.black),
@ -390,41 +417,29 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
await postChiefComplaint(model: model); await postChiefComplaint(model: model);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
} else { }
if (myHistoryList.length != 0) {
await postHistories(model: model, myHistoryList: myHistoryList); if (myHistoryList.length != 0) {
if (model.state == ViewState.ErrorLocal) { await postHistories(model: model, myHistoryList: myHistoryList);
helpers.showErrorToast(model.error); if (model.state == ViewState.ErrorLocal) {
} else { helpers.showErrorToast(model.error);
if (myAllergiesList.length != 0) { }
await postAllergy(myAllergiesList: myAllergiesList, model: model); }
if (model.state == ViewState.ErrorLocal) { if (myAllergiesList.length != 0) {
helpers.showErrorToast(model.error); await postAllergy(myAllergiesList: myAllergiesList, model: model);
} else { if (model.state == ViewState.ErrorLocal) {
widget.changePageViewIndex(1); helpers.showErrorToast(model.error);
}
} else {
widget.changePageViewIndex(1);
}
}
} else {
if (myAllergiesList.length != 0) {
await postAllergy(myAllergiesList: myAllergiesList, model: model);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else {
widget.changePageViewIndex(1);
}
} else {
widget.changePageViewIndex(1);
}
} }
} }
widget.changePageViewIndex(1);
} else { } else {
helpers.showErrorToast('Please add required field correctly'); helpers.showErrorToast(TranslationBase
.of(context)
.requiredMsg);
} }
widget.changePageViewIndex(1);
} }
@ -440,7 +455,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM
.add(ListHisProgNotePatientAllergyDiseaseVM( .add(ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.id, allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
@ -487,13 +502,12 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
}); });
if (model.patientAllergiesList.isEmpty) { if (model.patientHistoryList.isEmpty) {
await model.postHistories(postHistoriesRequestModel); await model.postHistories(postHistoriesRequestModel);
} else { } else {
await model.patchHistories(postHistoriesRequestModel); await model.patchHistories(postHistoriesRequestModel);
} }
await model.patchHistories(postHistoriesRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);

@ -4,6 +4,7 @@ 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/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/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart';
@ -36,19 +37,53 @@ class UpdateAssessmentPage extends StatefulWidget {
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> { class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
bool isAssessmentExpand = false; bool isAssessmentExpand = false;
List<dynamic> assessmentList;
dynamic _referTo;
TextEditingController remarksController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async{
widget.mySelectedAssessment.appointmentId =widget.patientInfo.appointmentNo;
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo: widget.patientInfo.appointmentNo);
await model.getPatientAssessment(getAssessmentReqModel);
if(model.patientAssessmentList.isNotEmpty){
if (model.listOfDiagnosisCondition.length == 0) {
await model.getMasterLookup(MasterKeysService.DiagnosisCondition);
}
if (model.listOfDiagnosisType.length == 0) {
await model.getMasterLookup(MasterKeysService.DiagnosisType);
}
if (model.listOfICD10.length == 0) {
await model.getMasterLookup(MasterKeysService.ICD10);
}
MasterKeyModel selectedICD = model.getOneMasterKey(
masterKeys: MasterKeysService.ICD10,
id: model.patientAssessmentList[0].icdCode10ID,
);
widget.mySelectedAssessment.selectedICD= selectedICD;
MasterKeyModel diagnosisCondition = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisCondition,
id: model.patientAssessmentList[0].conditionID,
);
widget.mySelectedAssessment.selectedDiagnosisCondition = diagnosisCondition;
MasterKeyModel diagnosisType = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisType,
id: model.patientAssessmentList[0].diagnosisTypeID,
);
widget.mySelectedAssessment.selectedDiagnosisType = diagnosisType;
widget.mySelectedAssessment.remark = model.patientAssessmentList[0].remarks;
}
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Center( child: Center(
@ -58,66 +93,67 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 30, height: 30,
), ),
HeaderBodyExpandableNotifier( HeaderBodyExpandableNotifier(
headerWidget: Row( headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [ children: [
Texts('ASSESSMENT', Row(
variant: children: [
Texts('ASSESSMENT',
variant:
isAssessmentExpand ? "bodyText" : '', isAssessmentExpand ? "bodyText" : '',
bold: isAssessmentExpand ? true : false, bold: isAssessmentExpand ? true : false,
color: Colors.black), color: Colors.black),
Icon( Icon(
FontAwesomeIcons.asterisk, FontAwesomeIcons.asterisk,
color: AppGlobal.appPrimaryColor, color: AppGlobal.appPrimaryColor,
size: 12, size: 12,
) )
],
),
InkWell(
onTap: () {
setState(() {
isAssessmentExpand = !isAssessmentExpand;
});
},
child: Icon(isAssessmentExpand
? EvaIcons.minus
: EvaIcons.plus))
], ],
), ),
InkWell( bodyWidget: Column(children: [
onTap: () { SizedBox(
setState(() { height: 20,
isAssessmentExpand = !isAssessmentExpand; ),
}); Column(
}, children: [
child: Icon(isAssessmentExpand Container(
? EvaIcons.minus margin:
: EvaIcons.plus))
],
),
bodyWidget: Column(children: [
SizedBox(
height: 20,
),
Column(
children: [
Container(
margin:
EdgeInsets.only(left: 5, right: 5, top: 15), EdgeInsets.only(left: 5, right: 5, top: 15),
child: TextFields( child: TextFields(
hintText: "Add ASSESSMENT", hintText: "Add ASSESSMENT",
fontSize: 13.5, fontSize: 13.5,
onTapTextFields: () { onTapTextFields: () {
openAssessmentDialog(context); openAssessmentDialog(context);
}, },
readOnly: true, readOnly: true,
// hintColor: Colors.black, // hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline, suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal.appPrimaryColor, suffixIconColor: AppGlobal
fontWeight: FontWeight.w600, .appPrimaryColor,
// controller: messageController, fontWeight: FontWeight.w600,
validator: (value) { // controller: messageController,
if (value == null) validator: (value) {
return TranslationBase if (value == null)
.of(context) return TranslationBase
.emptyMessage; .of(context)
else .emptyMessage;
return null; else
}), return null;
}),
), ),
SizedBox( SizedBox(
height: 20, height: 20,
@ -241,10 +277,13 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
SizedBox( SizedBox(
height: 6, height: 6,
), ),
AppText( Container(
widget.mySelectedAssessment.remark, width: MediaQuery.of(context).size.width * 0.5,
fontSize: 10, child: AppText(
color: Colors.grey, widget.mySelectedAssessment.remark??"",
fontSize: 10,
color: Colors.grey,
),
), ),
], ],
), ),
@ -262,10 +301,12 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
), ),
AppText( Container(
"R07.1".toUpperCase(), child: AppText(
fontSize: 10, widget.mySelectedAssessment.selectedICD.code.trim().toUpperCase()??"",
color: Colors.grey, fontSize: 10,
color: Colors.grey,
),
), ),
], ],
) )
@ -291,44 +332,68 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
isExpand: isAssessmentExpand, isExpand: isAssessmentExpand,
), ),
DividerWithSpacesAround( DividerWithSpacesAround(
height: 30, height: 30,
), ),
AppButton( AppButton(
title: TranslationBase.of(context).next, title: TranslationBase
loading: model.state == ViewState.BusyLocal, .of(context)
onPressed: () async { .next,
await submitAssessment(model); loading: model.state == ViewState.BusyLocal,
}, onPressed: () async {
), await submitAssessment(model);
SizedBox( },
height: 30, ),
SizedBox(
height: 30,
),
],
), ),
], ),
), ),
), )));
),
)));
} }
submitAssessment(SOAPViewModel model) async { submitAssessment(SOAPViewModel model) async {
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
widget.mySelectedAssessment.selectedDiagnosisType != null) { widget.mySelectedAssessment.selectedDiagnosisType != null && widget.mySelectedAssessment.selectedICD !=null ) {
PatchAssessmentReqModel patchAssessmentReqModel =
new PatchAssessmentReqModel( if(model.patientAssessmentList.isEmpty){
patientMRN: widget.patientInfo.patientMRN, PostAssessmentRequestModel postAssessmentRequestModel =
episodeId: widget.patientInfo.episodeNo, new PostAssessmentRequestModel(
appointmentNo: widget.patientInfo.appointmentNo, patientMRN: widget.patientInfo.patientMRN,
remarks: widget.mySelectedAssessment.remark, episodeId: widget.patientInfo.episodeNo,
complexDiagnosis: true, appointmentNo: widget.patientInfo.appointmentNo,
conditionId: icdCodeDetails: [
widget.mySelectedAssessment.selectedDiagnosisCondition.id, new IcdCodeDetails(
diagnosisTypeId: remarks: widget.mySelectedAssessment.remark,
widget.mySelectedAssessment.selectedDiagnosisType.id, complexDiagnosis: true,
icdcode10Id: "1", conditionId:
prevIcdCode10ID: "1" widget.mySelectedAssessment.selectedDiagnosisCondition.id,
); diagnosisTypeId:
widget.mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: widget.mySelectedAssessment.selectedICD.code)
]);
await model.postAssessment(postAssessmentRequestModel);
} else {
PatchAssessmentReqModel patchAssessmentReqModel =
PatchAssessmentReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: widget.mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId:
widget.mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId:
widget.mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: widget.mySelectedAssessment.selectedICD.code,
prevIcdCode10ID: model.patientAssessmentList[0].icdCode10ID
);
await model.patchAssessment(patchAssessmentReqModel);
}
await model.patchAssessment(patchAssessmentReqModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
@ -336,7 +401,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
widget.changePageViewIndex(3); widget.changePageViewIndex(3);
} }
} else { } else {
helpers.showErrorToast('Please add required field correctly'); helpers.showErrorToast(TranslationBase.of(context).requiredMsg);
} }
widget.changePageViewIndex(3); widget.changePageViewIndex(3);
@ -363,9 +428,9 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
class AddAssessmentDetails extends StatefulWidget { class AddAssessmentDetails extends StatefulWidget {
final MySelectedAssessment mySelectedAssessment; final MySelectedAssessment mySelectedAssessment;
final Function() addSelectedAssessment; final Function() addSelectedAssessment;
final PatiantInformtion patientInfo;
const AddAssessmentDetails( const AddAssessmentDetails(
{Key key, this.mySelectedAssessment, this.addSelectedAssessment}) {Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo})
: super(key: key); : super(key: key);
@override @override
@ -376,13 +441,13 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
// MasterKeyModel _selectedDiagnosisCondition; // MasterKeyModel _selectedDiagnosisCondition;
// MasterKeyModel _selectedDiagnosisType; // MasterKeyModel _selectedDiagnosisType;
TextEditingController remarkController = TextEditingController(); TextEditingController remarkController = TextEditingController();
TextEditingController appointmentIdController = TextEditingController( TextEditingController appointmentIdController = TextEditingController();
text: "234567");
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
remarkController.text = widget.mySelectedAssessment.remark??""; remarkController.text = widget.mySelectedAssessment.remark??"";
appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString();
final screenSize = MediaQuery final screenSize = MediaQuery
.of(context) .of(context)
.size; .size;
@ -599,7 +664,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 0, right: 0, top: 15), left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hintText: "Remarks", hintText: TranslationBase.of(context).remarks,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -644,7 +709,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
class PatchAssessmentReqModel { class PatchAssessmentReqModel {
int patientMRN; int patientMRN;
int appointmentNo; int appointmentNo;
int episodeId; int episodeID;
String icdcode10Id; String icdcode10Id;
String prevIcdCode10ID; String prevIcdCode10ID;
int conditionId; int conditionId;
@ -655,7 +720,7 @@ class PatchAssessmentReqModel {
PatchAssessmentReqModel( PatchAssessmentReqModel(
{this.patientMRN, {this.patientMRN,
this.appointmentNo, this.appointmentNo,
this.episodeId, this.episodeID,
this.icdcode10Id, this.icdcode10Id,
this.prevIcdCode10ID, this.prevIcdCode10ID,
this.conditionId, this.conditionId,
@ -664,28 +729,28 @@ class PatchAssessmentReqModel {
this.remarks}); this.remarks});
PatchAssessmentReqModel.fromJson(Map<String, dynamic> json) { PatchAssessmentReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['patientMRN']; patientMRN = json['PatientMRN'];
appointmentNo = json['appointmentNo']; appointmentNo = json['AppointmentNo'];
episodeId = json['episodeId']; episodeID = json['EpisodeID'];
icdcode10Id = json['icdcode10Id']; icdcode10Id = json['Icdcode10Id'];
prevIcdCode10ID = json['prevIcdCode10ID']; prevIcdCode10ID = json['PrevIcdCode10ID'];
conditionId = json['conditionId']; conditionId = json['ConditionId'];
diagnosisTypeId = json['diagnosisTypeId']; diagnosisTypeId = json['DiagnosisTypeId'];
complexDiagnosis = json['complexDiagnosis']; complexDiagnosis = json['ComplexDiagnosis'];
remarks = json['remarks']; remarks = json['Remarks'];
} }
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>();
data['patientMRN'] = this.patientMRN; data['PatientMRN'] = this.patientMRN;
data['appointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
data['episodeId'] = this.episodeId; data['EpisodeID'] = this.episodeID;
data['icdcode10Id'] = this.icdcode10Id; data['Icdcode10Id'] = this.icdcode10Id;
data['prevIcdCode10ID'] = this.prevIcdCode10ID; data['PrevIcdCode10ID'] = this.prevIcdCode10ID;
data['conditionId'] = this.conditionId; data['ConditionId'] = this.conditionId;
data['diagnosisTypeId'] = this.diagnosisTypeId; data['DiagnosisTypeId'] = this.diagnosisTypeId;
data['complexDiagnosis'] = this.complexDiagnosis; data['ComplexDiagnosis'] = this.complexDiagnosis;
data['remarks'] = this.remarks; data['Remarks'] = this.remarks;
return data; return data;
} }
} }

@ -84,8 +84,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
//TODO: retrun it back baseViewModel: model,
// baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Center( child: Center(
@ -305,14 +304,14 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 10, right: 10, top: 15), left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hintText: "Remarks", hintText: TranslationBase.of(context).remarks,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
maxLines: 25, maxLines: 25,
minLines: 13, minLines: 4,
controller: remarksController, controller: remarksController,
validator: (value) { validator: (value) {
if (value == null) if (value == null)
@ -379,7 +378,11 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
)); ));
}); });
await model.patchPhysicalExam(postPhysicalExamRequestModel); if(model.patientPhysicalExamList.isEmpty) {
await model.postPhysicalExam(postPhysicalExamRequestModel);
} else {
await model.patchPhysicalExam(postPhysicalExamRequestModel);
}
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
@ -387,7 +390,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
widget.changePageViewIndex(2); widget.changePageViewIndex(2);
} }
} else { } else {
helpers.showErrorToast('Please add required field correctly'); helpers.showErrorToast(TranslationBase.of(context).requiredMsg);
} }
widget.changePageViewIndex(2); widget.changePageViewIndex(2);

@ -63,8 +63,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
await model.getPatientProgressNote(getGetProgressNoteReqModel); await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) { if (model.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = progressNoteController.text = helpers
model.patientProgressNoteList[0].planNote; .parseHtmlString(model.patientProgressNoteList[0].planNote);
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(

@ -6,11 +6,7 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/assessment_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/steps_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/subjective_page.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/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart';

@ -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);

@ -1,6 +1,8 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class MasterKeyDailog extends StatefulWidget { class MasterKeyDailog extends StatefulWidget {
@ -30,10 +32,11 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return showAlertDialog(context); ProjectViewModel projectViewModel = Provider.of(context);
return showAlertDialog(context, projectViewModel);
} }
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) {
// set up the buttons // set up the buttons
Widget cancelButton = FlatButton( Widget cancelButton = FlatButton(
child: Text(TranslationBase.of(context).cancel), child: Text(TranslationBase.of(context).cancel),
@ -49,7 +52,7 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
// set up the AlertDialog // set up the AlertDialog
AlertDialog alert = AlertDialog( AlertDialog alert = AlertDialog(
// title: Text(widget.title), // title: Text(widget.title),
content: createDialogList(), content: createDialogList(projectViewModel),
actions: [ actions: [
cancelButton, cancelButton,
continueButton, continueButton,
@ -58,7 +61,7 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
return alert; return alert;
} }
Widget createDialogList() { Widget createDialogList(ProjectViewModel projectViewModel) {
return Container( return Container(
height: MediaQuery.of(context).size.height * 0.5, height: MediaQuery.of(context).size.height * 0.5,
child: SingleChildScrollView( child: SingleChildScrollView(
@ -67,7 +70,7 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
...widget.list ...widget.list
.map((item) => RadioListTile( .map((item) => RadioListTile(
title: Text( title: Text(
'${item.nameEn}' + (widget.isICD ? '/${item.code}' : '')), '${projectViewModel.isArabic?item.nameAr:item.nameEn}' + (widget.isICD ? '/${item.code}' : '')),
groupValue: widget.isICD groupValue: widget.isICD
? widget.selectedValue.code.toString() ? widget.selectedValue.code.toString()
: widget.selectedValue.id.toString(), : widget.selectedValue.id.toString(),

@ -1,6 +1,8 @@
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/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.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/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
@ -9,6 +11,7 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MasterKeyCheckboxSearchWidget extends StatefulWidget { class MasterKeyCheckboxSearchWidget extends StatefulWidget {
final SOAPViewModel model; final SOAPViewModel model;
@ -45,6 +48,8 @@ class _MasterKeyCheckboxSearchWidgetState extends State<MasterKeyCheckboxSearchW
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
child: Column( child: Column(
children: [ children: [
@ -55,59 +60,63 @@ class _MasterKeyCheckboxSearchWidgetState extends State<MasterKeyCheckboxSearchW
child: Center( child: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Colors.white),
child: ListView( child: ListView(
children: [ children: [
TextFields( TextFields(
hintText: widget.hintSearchText??'Search history', hintText: widget.hintSearchText ?? TranslationBase
suffixIcon: EvaIcons.search, .of(context)
onChanged: (value) { .searchHistory,
filterSearchResults(value); suffixIcon: EvaIcons.search,
}, onChanged: (value) {
), filterSearchResults(value);
SizedBox(height: 15,), },
Column( ),
children: items.map((historyInfo) { SizedBox(height: 15,),
return Column( Column(
children: [ children: items.map((historyInfo) {
Row( return Column(
children: [ children: [
Checkbox( Row(
value: children: [
Checkbox(
value:
widget.isServiceSelected(historyInfo), widget.isServiceSelected(historyInfo),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool newValue) { onChanged: (bool newValue) {
setState(() { setState(() {
if (widget if (widget
.isServiceSelected(historyInfo)) { .isServiceSelected(historyInfo)) {
widget.removeHistory(historyInfo); widget.removeHistory(historyInfo);
} else { } else {
widget.addHistory(historyInfo); widget.addHistory(historyInfo);
} }
}); });
}), }),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0), horizontal: 10, vertical: 0),
child: Texts(historyInfo.nameEn, child: Texts(projectViewModel.isArabic
variant: "bodyText", ? historyInfo.nameAr!=""?historyInfo.nameAr:historyInfo.nameEn
bold: true, : historyInfo.nameEn,
color: Colors.black), variant: "bodyText",
), bold: true,
color: Colors.black),
),
),
],
), ),
DividerWithSpacesAround(),
], ],
), );
DividerWithSpacesAround(), }).toList(),
], ),
); ],
}).toList(),
), ),
], )),
),
)),
), ),
), ),
SizedBox( SizedBox(
@ -115,7 +124,8 @@ class _MasterKeyCheckboxSearchWidgetState extends State<MasterKeyCheckboxSearchW
), ),
if (widget.model.state == ViewState.Idle) if (widget.model.state == ViewState.Idle)
AppButton( AppButton(
title: widget.buttonName?? "Add SELECTED HISTORIES".toUpperCase(), title: widget.buttonName?? TranslationBase.of(context).addSelectedHistories.toUpperCase(),
padding: 10,
onPressed: () { onPressed: () {
widget.addSelectedHistories(); widget.addSelectedHistories();
}, },

@ -239,6 +239,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.5" version: "2.1.5"
csslib:
dependency: transitive
description:
name: csslib
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.2"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
@ -253,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:
@ -385,6 +399,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.6" version: "1.0.6"
html:
dependency: "direct main"
description:
name: html
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.0+4"
http: http:
dependency: "direct main" dependency: "direct main"
description: description:
@ -482,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:
@ -739,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:
@ -874,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,10 @@ dependencies:
#Autocomplete TextField #Autocomplete TextField
autocomplete_textfield: ^1.7.3 autocomplete_textfield: ^1.7.3
date_time_picker: ^1.1.1
# Html
html: ^0.14.0+4

Loading…
Cancel
Save