Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into fix-issues

merge-requests/305/head
hussam al-habibeh 5 years ago
commit 255f36598b

@ -18,7 +18,7 @@ PODS:
- Firebase/Messaging (6.33.0): - Firebase/Messaging (6.33.0):
- Firebase/CoreOnly - Firebase/CoreOnly
- FirebaseMessaging (~> 4.7.0) - FirebaseMessaging (~> 4.7.0)
- firebase_core (0.5.2): - firebase_core (0.5.3):
- Firebase/CoreOnly (~> 6.33.0) - Firebase/CoreOnly (~> 6.33.0)
- Flutter - Flutter
- firebase_core_web (0.1.0): - firebase_core_web (0.1.0):
@ -250,7 +250,7 @@ SPEC CHECKSUMS:
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
firebase_core: 350ba329d1641211bc6183a3236893cafdacfea7 firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659
firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1
firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75
FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd

@ -72,7 +72,7 @@ const CREATE_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/CreateReferral'; 'Services/DoctorApplication.svc/REST/CreateReferral';
const RESPONSE_PENDING_REFERRAL_PATIENT = const RESPONSE_PENDING_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/CreateReferral'; 'Services/DoctorApplication.svc/REST/RespondReferral';
const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal'; const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal';
@ -192,7 +192,9 @@ const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList';
const DRUG_TO_DRUG = const DRUG_TO_DRUG =
'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction';
const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile';
const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors';
const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards';
const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories';
const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes';
const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes';
const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes';

@ -598,6 +598,7 @@ const Map<String, Map<String, String>> localizedValues = {
'allergicTO': {'en': "ALLERGIC TO ", 'ar': " حساس من"}, 'allergicTO': {'en': "ALLERGIC TO ", 'ar': " حساس من"},
'normal': {'en': "Normal", 'ar': "عادي"}, 'normal': {'en': "Normal", 'ar': "عادي"},
'abnormal': {'en': "Abnormal", 'ar': " غير عادي"}, 'abnormal': {'en': "Abnormal", 'ar': " غير عادي"},
'notExamined': {'en': "Not Examined", 'ar': "لم يتم الفحص"},
"systolic-lng": {"en": "Systolic", "ar": "الإنقباض"}, "systolic-lng": {"en": "Systolic", "ar": "الإنقباض"},
"diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"}, "diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"},
"mass": {"en": "Mass", "ar": "كتلة"}, "mass": {"en": "Mass", "ar": "كتلة"},
@ -697,5 +698,17 @@ const Map<String, Map<String, String>> localizedValues = {
'referralResponse': {'en': "Referral Response : ", 'ar': " : استجابة الإحالة"}, 'referralResponse': {'en': "Referral Response : ", 'ar': " : استجابة الإحالة"},
'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"}, 'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"},
'diagnosisDetail': {'en': "Diagnosis Detail : ", 'ar': "تفاصيل التشخيص"}, 'diagnosisDetail': {'en': "Diagnosis Detail : ", 'ar': "تفاصيل التشخيص"},
'referralSuccessMsgAccept': {'en': "Referral Accepted Successfully", 'ar': "تم قبول الإحالة بنجاح"},
'referralSuccessMsgReject': {'en': "Referral Rejected Successfully", 'ar': "تم رفض الإحالة بنجاح"},
'sickLeaveComments': {'en': "Sick leave comments", 'ar': "تعليقات إجازة مرضية"},
'pastMedicalHistory': {'en': "Past medical history", 'ar': "التاريخ الطبي"},
'pastSurgicalHistory': {'en': "Past surgical history", 'ar': "التاريخ الجراحي"},
'complications': {'en': "Complications", 'ar': "المضاعفات"},
'floor': {'en': "Floor", 'ar': "الطابق"},
'roomCategory': {'en': "Room category", 'ar': "فئة الغرفة"},
'otherDepartmentsInterventions': {'en': "Other departments interventions", 'ar': "تدخلات الأقسام الأخرى"},
'otherProcedure': {'en': "Other procedure", 'ar': "إجراء آخر"},
'admissionRequestSuccessMsg': {'en': "Admission Request Created Successfully", 'ar': "تم إنشاء طلب القبول بنجاح"},
// 'icd': {'en': "ICD", 'ar': " "}, // 'icd': {'en': "ICD", 'ar': " "},
'orderNo': {'en': "Order No : ", 'ar': "رقم الطلب"},
}; };

@ -13,3 +13,4 @@ final DASHBOARD_DATA = 'dashboard-data';
final OTP_TYPE = 'otp-type'; final OTP_TYPE = 'otp-type';
final LAST_LOGIN_USER = 'last-login-user'; final LAST_LOGIN_USER = 'last-login-user';
final PASSWORD = 'password'; final PASSWORD = 'password';
final CLINIC_NAME = 'clinic-name';

@ -8,12 +8,15 @@ class AdmissionRequestService extends LookupService {
List<dynamic> clinicList = []; List<dynamic> clinicList = [];
List<dynamic> doctorsList = []; List<dynamic> doctorsList = [];
List<dynamic> specialityList = []; List<dynamic> specialityList = [];
List<dynamic> floorList = [];
List<dynamic> wardList = []; List<dynamic> wardList = [];
List<dynamic> roomCategoryList = [];
List<dynamic> diagnosisTypesList = []; List<dynamic> diagnosisTypesList = [];
List<dynamic> allergiesLookupList = []; List<dynamic> allergiesLookupList = [];
List<dynamic> dietTypesList = []; List<dynamic> dietTypesList = [];
List<dynamic> icdCodes = []; List<dynamic> icdCodes = [];
setSpecialityList() { setSpecialityList() {
specialityList.clear(); specialityList.clear();
listOfSpeciality.forEach((element) { listOfSpeciality.forEach((element) {
@ -68,6 +71,28 @@ class AdmissionRequestService extends LookupService {
); );
} }
Future getFloors() async {
hasError = false;
await baseAppClient.post(
GET_FLOORS,
onSuccess: (dynamic response, int statusCode) {
floorList.clear();
if (response['AdmissionMasterList'] != null &&
response['AdmissionMasterList']['entityList'] != null) {
response['AdmissionMasterList']['entityList'].forEach((v) {
floorList.add(v);
});
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: Map(),
);
}
Future getWardList() async { Future getWardList() async {
hasError = false; hasError = false;
@ -91,6 +116,28 @@ class AdmissionRequestService extends LookupService {
); );
} }
Future getRoomCategories() async {
hasError = false;
await baseAppClient.post(
GET_ROOM_CATEGORIES,
onSuccess: (dynamic response, int statusCode) {
roomCategoryList.clear();
if (response['AdmissionMasterList'] != null &&
response['AdmissionMasterList']['entityList'] != null) {
response['AdmissionMasterList']['entityList'].forEach((v) {
roomCategoryList.add(v);
});
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: Map(),
);
}
Future getDiagnosisTypesList() async { Future getDiagnosisTypesList() async {
hasError = false; hasError = false;
@ -173,7 +220,7 @@ class AdmissionRequestService extends LookupService {
await baseAppClient.post( await baseAppClient.post(
POST_ADMISSION_REQUEST, POST_ADMISSION_REQUEST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print(response); print(response["admissionResponse"]["success"]);
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -198,9 +198,9 @@ class PatientReferralService extends LookupService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = pendingReferral.patientID; body['PatientMRN'] = pendingReferral.patientID;
body['AppointmentNo'] = pendingReferral.sourceAppointmentNo; body['AppointmentNo'] = pendingReferral.targetAppointmentNo;
body['SetupID'] = pendingReferral.sourceSetupID; body['SetupID'] = pendingReferral.targetSetupID;
body['ProjectID'] = pendingReferral.sourceProjectId; body['ProjectID'] = pendingReferral.targetProjectId;
body['IsAccepted'] = isAccepted; body['IsAccepted'] = isAccepted;
body['PatientName'] = pendingReferral.patientName; body['PatientName'] = pendingReferral.patientName;
body['ReferralResponse'] = pendingReferral.remarksFromSource; body['ReferralResponse'] = pendingReferral.remarksFromSource;
@ -209,6 +209,7 @@ class PatientReferralService extends LookupService {
await baseAppClient.post( await baseAppClient.post(
RESPONSE_PENDING_REFERRAL_PATIENT, RESPONSE_PENDING_REFERRAL_PATIENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print(response);
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -106,8 +106,8 @@ class UcafService extends LookupService {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN; body['PatientMRN'] = patient.patientMRN;
// body['AppointmentNo'] = patient.appointmentNo; body['AppointmentNo'] = patient.appointmentNo;
// body['EpisodeID'] = patient.episodeNo; body['EpisodeID'] = patient.episodeNo;
await baseAppClient.post (GET_ORDER_PROCEDURE, await baseAppClient.post (GET_ORDER_PROCEDURE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {

@ -19,8 +19,12 @@ class AdmissionRequestViewModel extends BaseViewModel{
List<dynamic> get speciality => _admissionRequestService.specialityList; List<dynamic> get speciality => _admissionRequestService.specialityList;
List<dynamic> get floorList => _admissionRequestService.floorList;
List<dynamic> get wardList => _admissionRequestService.wardList; List<dynamic> get wardList => _admissionRequestService.wardList;
List<dynamic> get roomCategoryList => _admissionRequestService.roomCategoryList;
List<dynamic> get admissionTypeList => _admissionRequestService.listOfAdmissionType; List<dynamic> get admissionTypeList => _admissionRequestService.listOfAdmissionType;
List<dynamic> get diagnosisTypesList => _admissionRequestService.diagnosisTypesList; List<dynamic> get diagnosisTypesList => _admissionRequestService.diagnosisTypesList;
@ -63,6 +67,16 @@ class AdmissionRequestViewModel extends BaseViewModel{
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getFloors() async {
setState(ViewState.BusyLocal);
await _admissionRequestService.getFloors();
if (_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getWards() async { Future getWards() async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _admissionRequestService.getWardList(); await _admissionRequestService.getWardList();
@ -73,6 +87,16 @@ class AdmissionRequestViewModel extends BaseViewModel{
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getRoomCategories() async {
setState(ViewState.BusyLocal);
await _admissionRequestService.getRoomCategories();
if (_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getDiagnosis() async { Future getDiagnosis() async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _admissionRequestService.getDiagnosisTypesList(); await _admissionRequestService.getDiagnosisTypesList();

@ -1,13 +1,19 @@
class GetPhysicalExamResModel { class GetPhysicalExamResModel {
int appointmentNo; int appointmentNo;
int createdBy; int createdBy;
String createdByName;
String createdOn; String createdOn;
int editedBy; Null editedBy;
String editedByName;
String editedOn; String editedOn;
int episodeId; int episodeId;
int examId; int examId;
String examName;
int examType; int examType;
int examinationType;
String examinationTypeName;
bool isAbnormal; bool isAbnormal;
bool isNew;
bool isNormal; bool isNormal;
bool notExamined; bool notExamined;
int patientMRN; int patientMRN;
@ -16,13 +22,19 @@ class GetPhysicalExamResModel {
GetPhysicalExamResModel( GetPhysicalExamResModel(
{this.appointmentNo, {this.appointmentNo,
this.createdBy, this.createdBy,
this.createdByName,
this.createdOn, this.createdOn,
this.editedBy, this.editedBy,
this.editedByName,
this.editedOn, this.editedOn,
this.episodeId, this.episodeId,
this.examId, this.examId,
this.examName,
this.examType, this.examType,
this.examinationType,
this.examinationTypeName,
this.isAbnormal, this.isAbnormal,
this.isNew,
this.isNormal, this.isNormal,
this.notExamined, this.notExamined,
this.patientMRN, this.patientMRN,
@ -31,13 +43,19 @@ class GetPhysicalExamResModel {
GetPhysicalExamResModel.fromJson(Map<String, dynamic> json) { GetPhysicalExamResModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['appointmentNo']; appointmentNo = json['appointmentNo'];
createdBy = json['createdBy']; createdBy = json['createdBy'];
createdByName = json['createdByName'];
createdOn = json['createdOn']; createdOn = json['createdOn'];
editedBy = json['editedBy']; editedBy = json['editedBy'];
editedByName = json['editedByName'];
editedOn = json['editedOn']; editedOn = json['editedOn'];
episodeId = json['episodeId']; episodeId = json['episodeId'];
examId = json['examId']; examId = json['examId'];
examName = json['examName'];
examType = json['examType']; examType = json['examType'];
examinationType = json['examinationType'];
examinationTypeName = json['examinationTypeName'];
isAbnormal = json['isAbnormal']; isAbnormal = json['isAbnormal'];
isNew = json['isNew'];
isNormal = json['isNormal']; isNormal = json['isNormal'];
notExamined = json['notExamined']; notExamined = json['notExamined'];
patientMRN = json['patientMRN']; patientMRN = json['patientMRN'];
@ -48,13 +66,19 @@ class GetPhysicalExamResModel {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['appointmentNo'] = this.appointmentNo; data['appointmentNo'] = this.appointmentNo;
data['createdBy'] = this.createdBy; data['createdBy'] = this.createdBy;
data['createdByName'] = this.createdByName;
data['createdOn'] = this.createdOn; data['createdOn'] = this.createdOn;
data['editedBy'] = this.editedBy; data['editedBy'] = this.editedBy;
data['editedByName'] = this.editedByName;
data['editedOn'] = this.editedOn; data['editedOn'] = this.editedOn;
data['episodeId'] = this.episodeId; data['episodeId'] = this.episodeId;
data['examId'] = this.examId; data['examId'] = this.examId;
data['examName'] = this.examName;
data['examType'] = this.examType; data['examType'] = this.examType;
data['examinationType'] = this.examinationType;
data['examinationTypeName'] = this.examinationTypeName;
data['isAbnormal'] = this.isAbnormal; data['isAbnormal'] = this.isAbnormal;
data['isNew'] = this.isNew;
data['isNormal'] = this.isNormal; data['isNormal'] = this.isNormal;
data['notExamined'] = this.notExamined; data['notExamined'] = this.notExamined;
data['patientMRN'] = this.patientMRN; data['patientMRN'] = this.patientMRN;

@ -5,13 +5,17 @@ class MySelectedExamination {
String remark; String remark;
bool isNormal; bool isNormal;
bool isAbnormal; bool isAbnormal;
bool notExamined;
bool isNew;
int createdBy; int createdBy;
MySelectedExamination( MySelectedExamination(
{this.selectedExamination, {this.selectedExamination,
this.remark, this.remark,
this.isNormal = true, this.isNormal = false,
this.isAbnormal = false, this.isAbnormal = false,
this.notExamined = true,
this.isNew = true,
this.createdBy}); this.createdBy});
MySelectedExamination.fromJson(Map<String, dynamic> json) { MySelectedExamination.fromJson(Map<String, dynamic> json) {
@ -19,8 +23,10 @@ class MySelectedExamination {
? new MasterKeyModel.fromJson(json['selectedExamination']) ? new MasterKeyModel.fromJson(json['selectedExamination'])
: null; : null;
remark = json['remark']; remark = json['remark'];
remark = json['isNormal']; isNormal = json['isNormal'];
remark = json['isAbnormal']; isAbnormal = json['isAbnormal'];
notExamined = json['notExamined'];
isNew = json['isNew'];
createdBy = json['createdBy']; createdBy = json['createdBy'];
} }
@ -33,6 +39,8 @@ class MySelectedExamination {
data['remark'] = this.remark; data['remark'] = this.remark;
data['isNormal'] = this.isNormal; data['isNormal'] = this.isNormal;
data['isAbnormal'] = this.isAbnormal; data['isAbnormal'] = this.isAbnormal;
data['notExamined'] = this.notExamined;
data['isNew'] = this.isNew;
data['createdBy'] = this.createdBy; data['createdBy'] = this.createdBy;
return data; return data;
} }

@ -25,75 +25,91 @@ class PostPhysicalExamRequestModel {
} }
} }
class ListHisProgNotePhysicalExaminationVM { class ListHisProgNotePhysicalExaminationVM {
int episodeId; int episodeId;
int appointmentNo; int appointmentNo;
int examType; int examType;
int examId; int examId;
int patientMRN; int patientMRN;
bool isNormal; bool isNormal;
bool isAbnormal; bool isAbnormal;
String remarks; bool notExamined;
int createdBy; String examName;
String createdOn; String examinationTypeName;
int editedBy; int examinationType;
String editedOn; String remarks;
bool notExamined; bool isNew;
MasterKeyModel masterDescription; int createdBy;
String createdOn;
String createdByName;
int editedBy;
String editedOn;
String editedByName;
ListHisProgNotePhysicalExaminationVM( ListHisProgNotePhysicalExaminationVM(
{this.episodeId, {this.episodeId,
this.appointmentNo, this.appointmentNo,
this.examType, this.examType,
this.examId, this.examId,
this.patientMRN, this.patientMRN,
this.isNormal, this.isNormal,
this.isAbnormal, this.isAbnormal,
this.remarks, this.notExamined,
this.createdBy, this.examName,
this.createdOn, this.examinationTypeName,
this.editedBy, this.examinationType,
this.editedOn, this.remarks,
this.notExamined, this.isNew,
this.masterDescription}); this.createdBy,
this.createdOn,
this.createdByName,
this.editedBy,
this.editedOn,
this.editedByName});
ListHisProgNotePhysicalExaminationVM.fromJson(Map<String, dynamic> json) { ListHisProgNotePhysicalExaminationVM.fromJson(Map<String, dynamic> json) {
episodeId = json['episodeId']; episodeId = json['episodeId'];
appointmentNo = json['appointmentNo']; appointmentNo = json['appointmentNo'];
examType = json['examType']; examType = json['examType'];
examId = json['examId']; examId = json['examId'];
patientMRN = json['patientMRN']; patientMRN = json['patientMRN'];
isNormal = json['isNormal']; isNormal = json['isNormal'];
isAbnormal = json['isAbnormal']; isAbnormal = json['isAbnormal'];
remarks = json['remarks']; notExamined = json['notExamined'];
createdBy = json['createdBy']; examName = json['examName'];
createdOn = json['createdOn']; examinationTypeName = json['examinationTypeName'];
editedBy = json['editedBy']; examinationType = json['examinationType'];
editedOn = json['editedOn']; remarks = json['remarks'];
notExamined = json['notExamined']; isNew = json['isNew'];
masterDescription = json['masterDescription'] != null createdBy = json['createdBy'];
? new MasterKeyModel.fromJson(json['masterDescription']) createdOn = json['createdOn'];
: null; createdByName = json['createdByName'];
} editedBy = json['editedBy'];
editedOn = json['editedOn'];
editedByName = json['editedByName'];
}
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['episodeId'] = this.episodeId; data['episodeId'] = this.episodeId;
data['appointmentNo'] = this.appointmentNo; data['appointmentNo'] = this.appointmentNo;
data['examType'] = this.examType; data['examType'] = this.examType;
data['examId'] = this.examId; data['examId'] = this.examId;
data['patientMRN'] = this.patientMRN; data['patientMRN'] = this.patientMRN;
data['isNormal'] = this.isNormal; data['isNormal'] = this.isNormal;
data['isAbnormal'] = this.isAbnormal; data['isAbnormal'] = this.isAbnormal;
data['remarks'] = this.remarks; data['notExamined'] = this.notExamined;
data['createdBy'] = this.createdBy; data['examName'] = this.examName;
data['createdOn'] = this.createdOn; data['examinationTypeName'] = this.examinationTypeName;
data['editedBy'] = this.editedBy; data['examinationType'] = this.examinationType;
data['editedOn'] = this.editedOn; data['remarks'] = this.remarks;
data['notExamined'] = this.notExamined; data['isNew'] = this.isNew;
if (this.masterDescription != null) { data['createdBy'] = this.createdBy;
data['masterDescription'] = this.masterDescription.toJson(); data['createdOn'] = this.createdOn;
data['createdByName'] = this.createdByName;
data['editedBy'] = this.editedBy;
data['editedOn'] = this.editedOn;
data['editedByName'] = this.editedByName;
return data;
} }
return data;
} }
}

@ -54,6 +54,7 @@ class PatiantInformtion {
String genderDescription; String genderDescription;
String nursingStationName; String nursingStationName;
String startTime; String startTime;
String visitType;
PatiantInformtion({ PatiantInformtion({
this.list, this.list,
@ -105,7 +106,9 @@ class PatiantInformtion {
this.genderInt, this.genderInt,
this.isSigned, this.isSigned,
this.medicationOrders, this.medicationOrders,
this.nationality,this.patientMRN this.nationality,
this.patientMRN,
this.visitType,
}); });
factory PatiantInformtion.fromJson(Map<String, dynamic> json) => factory PatiantInformtion.fromJson(Map<String, dynamic> json) =>
@ -159,6 +162,7 @@ class PatiantInformtion {
medicationOrders :json['medicationOrders'], medicationOrders :json['medicationOrders'],
nationality :json['nationality']??json['NationalityNameN'], nationality :json['nationality']??json['NationalityNameN'],
patientMRN :json['patientMRN'] ?? json['PatientMRN'], patientMRN :json['patientMRN'] ?? json['PatientMRN'],
visitType :json['visitType'] ?? json['visitType'],
); );
} }

@ -45,6 +45,7 @@ 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-detail-screen.dart';
import 'screens/patients/profile/admission-request/admission-request-first-screen.dart';
import 'screens/patients/profile/admission-request/admission-request-third-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/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';
@ -137,7 +138,7 @@ 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(),
PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestThirdScreen(), PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestFirstScreen(),
PATIENT_ADMISSION_REQUEST_2: (_) => AdmissionRequestSecondScreen(), PATIENT_ADMISSION_REQUEST_2: (_) => AdmissionRequestSecondScreen(),
PATIENT_ADMISSION_REQUEST_3: (_) => AdmissionRequestThirdScreen(), PATIENT_ADMISSION_REQUEST_3: (_) => AdmissionRequestThirdScreen(),
// PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestDetailScreen(), // PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestDetailScreen(),

@ -58,6 +58,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
DoctorProfileModel profile; DoctorProfileModel profile;
bool isExpanded = false; bool isExpanded = false;
String isInpatient = ""; String isInpatient = "";
var clinicName = [];
void didChangeDependencies() async { void didChangeDependencies() async {
super.didChangeDependencies(); super.didChangeDependencies();
if (_isInit) { if (_isInit) {
@ -72,7 +73,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
.listen((IosNotificationSettings settings) { .listen((IosNotificationSettings settings) {
print("Settings registered: $settings"); print("Settings registered: $settings");
}); });
clinicName = await sharedPref.getObj(CLINIC_NAME);
print(clinicName);
_firebaseMessaging.getToken().then((String token) async { _firebaseMessaging.getToken().then((String token) async {
if (token != '') { if (token != '') {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
@ -721,10 +723,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
AppText( AppText(
model.dashboardItemsList.length > 0 clinicName.length.toString(),
? getPatientCount(
model.dashboardItemsList[6])
: "",
fontSize: SizeConfig.textMultiplier * 6, fontSize: SizeConfig.textMultiplier * 6,
color: Colors.white, color: Colors.white,
), ),

@ -1,12 +1,3 @@
/*
*@author: Amjad Amireh Merge to Elham rababah
*@Date:27/4/2020
*@param:
*@return:PatientsScreen
*@desc:
*/
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/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/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -19,6 +10,7 @@ import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
@ -93,14 +85,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
} }
} }
/*
*@author: Amjad Amireh
*@Date:5/5/2020
*@param:
*@return:Convert time from Milesecond to date with time
*@desc:
*/
convertDate(String str) { convertDate(String str) {
String timeConvert; String timeConvert;
const start = "/Date("; const start = "/Date(";
@ -129,14 +113,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
return newDateformat.toString(); return newDateformat.toString();
} }
/*
*@author: Amjad Amireh
*@Date:5/5/2020
*@param:
*@return:Convert time from Milesecond to date
*@desc:
*/
convertDateFormat(String str) { convertDateFormat(String str) {
String timeConvert; String timeConvert;
const start = "/Date("; const start = "/Date(";
@ -156,24 +132,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
return newDate.toString(); return newDate.toString();
} }
convertDateFormat2(String str) {
String timeConvert;
const start = "/Date(";
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
String newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
return newDate.toString();
}
filterBooking(String str) { filterBooking(String str) {
this.responseModelList = this.responseModelList2; this.responseModelList = this.responseModelList2;
@ -228,14 +186,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
return TranslationBase.of(context).all; return TranslationBase.of(context).all;
} }
/*
*@author: Amjad Amireh Modified New design
*@Date:21/5/2020
*@param:
*@return:PatientsScreen
*@desc:
*/
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_locations = [ _locations = [
@ -401,322 +351,19 @@ class _PatientsScreenState extends State<PatientsScreen> {
children: responseModelList children: responseModelList
.map((PatiantInformtion .map((PatiantInformtion
item) { item) {
return Container( return PatientCard(patientInfo: item,
decoration: patientType: patientType,
myBoxDecoration(), onTap: () {
child: InkWell( Navigator.of(context)
child: Row( .pushNamed(
children: <Widget>[ PATIENTS_PROFILE,
Column( arguments: {
mainAxisAlignment: "patient": item,
MainAxisAlignment "patientType":patientType,
.start, "from" : patient.getFrom,
children: < "to" : patient.getTo,
Widget>[ });
Padding( },);
padding: EdgeInsets
.only(
left:
12.0),
child:
Container(
decoration:
BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(
0,
0,
0,
0.08),
offset: Offset(0.0,
5.0),
blurRadius:
16.0)
],
borderRadius:
BorderRadius.all(
Radius.circular(35.0)),
color: Color(
0xffCCCCCC),
),
width: 70,
height: 70,
child: Icon(
item.genderDescription ==
"Male"
? DoctorApp
.male
: DoctorApp
.female_icon,
size: 70,
color: Colors
.white,
),
),
),
],
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Column(
children: [
SizedBox(
height:
10.0,
),
AppText(
item.firstName +
" " +
item.lastName,
fontSize:
2.0 * SizeConfig.textMultiplier,
fontWeight:
FontWeight.bold,
backGroundcolor:
Colors.white,
),
SizedBox(
height:
5,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <
Widget>[
Wrap(
children: [
AppText(
TranslationBase.of(context).fileNo,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
),
AppText(
item.patientId.toString(),
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
SizedBox(
width: 10,
),
],
),
SizedBox(
height:
2.5,
),
Container(
child:
AppText(
TranslationBase.of(context).nationality + " : " + (item.nationalityName ?? item.nationality),
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
),
margin:
EdgeInsets.only(right: projectsProvider.isArabic ? 0 : 10, left: projectsProvider.isArabic ? 10 : 0),
),
SizedBox(
width:
10,
),
SizedBox(
height:
15.5,
),
SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient"
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
item.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 0.5,
)
],
)
: SizedBox(
height: 5,
),
],
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
// mainAxisAlignment:
// MainAxisAlignment
// .spaceBetween,
children: <
Widget>[
SizedBox(
height:
0.5,
),
SizedBox(
height:
0,
),
Wrap(
children: [
AppText(
TranslationBase
.of(
context)
.age2,
fontSize: 1.8 *
SizeConfig
.textMultiplier,
fontWeight: FontWeight
.bold,
backGroundcolor: Colors
.white,
),
AppText(
" ${DateUtils.getAgeByBirthday(item.dateofBirth, context)}",
fontSize: 1.8 *
SizeConfig
.textMultiplier,
fontWeight: FontWeight
.w300,
backGroundcolor: Colors
.white,
),
SizedBox(
width: 10,
),
],
),
SizedBox(
height:
2.5,
),
Wrap(
children: [
AppText(
TranslationBase.of(context).gender2,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
),
AppText(
item.gender.toString() == '1' ? 'Male' : 'Female',
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
],
),
SizedBox(
height:
8,
),
SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient"
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
item.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 25.5,
),
],
)
: SizedBox(
height: 15,
),
],
),
),
],
),
],
),
),
// Divider(color: Colors.grey)
],
),
onTap: () {
Navigator.of(context)
.pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": item,
"patientType":patientType,
"from" : patient.getFrom,
"to" : patient.getTo,
});
},
),
);
}).toList(), }).toList(),
) )
: Center( : Center(
@ -754,88 +401,78 @@ class _PatientsScreenState extends State<PatientsScreen> {
} }
Widget _locationBar(BuildContext _context) { Widget _locationBar(BuildContext _context) {
return Expanded( return Container(
child: Container( height: MediaQuery.of(context).size.height * 0.0619,
height: MediaQuery.of(context).size.height * 0.0619, width: SizeConfig.screenWidth * 0.94,
width: SizeConfig.screenWidth * 0.94, decoration: BoxDecoration(
decoration: BoxDecoration( color: Color(0Xffffffff),
color: Color(0Xffffffff), borderRadius: BorderRadius.circular(12.5),
borderRadius: BorderRadius.circular(12.5), border: Border.all(
border: Border.all( width: 0.5,
width: 0.5,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _locations.map((item) {
bool _isActive = _locations[_activeLocation] == item ? true : false;
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
InkWell(
child: Center(
child: Expanded(
child: Container(
height: MediaQuery.of(context).size.height * 0.058,
width: SizeConfig.screenWidth * 0.2334,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(12.5),
topRight: Radius.circular(12.5),
topLeft: Radius.circular(9.5),
bottomLeft: Radius.circular(9.5)),
color:
_isActive ? HexColor("#B8382B") : Colors.white,
),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.normal,
),
),
)),
),
),
onTap: () {
filterBooking(item.toString());
setState(() {
_activeLocation = _locations.indexOf(item);
});
}),
_isActive
? Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10),
topRight: Radius.circular(10)),
color: Colors.white),
alignment: Alignment.center,
height: 1,
width: SizeConfig.screenWidth * 0.23,
)
: Container()
]);
}).toList(),
), ),
), ),
); child: Row(
} mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _locations.map((item) {
bool _isActive = _locations[_activeLocation] == item ? true : false;
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
InkWell(
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.058,
width: SizeConfig.screenWidth * 0.2334,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(12.5),
topRight: Radius.circular(12.5),
topLeft: Radius.circular(9.5),
bottomLeft: Radius.circular(9.5)),
color:
_isActive ? HexColor("#B8382B") : Colors.white,
),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.normal,
),
),
)),
),
onTap: () {
filterBooking(item.toString());
myBoxDecoration() { setState(() {
return BoxDecoration( _activeLocation = _locations.indexOf(item);
border: Border( });
bottom: BorderSide( }),
color: Color(0xffCCCCCC), _isActive
width: 0.5, ? Container(
), decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10),
topRight: Radius.circular(10)),
color: Colors.white),
alignment: Alignment.center,
height: 1,
width: SizeConfig.screenWidth * 0.23,
)
: Container()
]);
}).toList(),
), ),
); );
} }
} }

@ -0,0 +1,487 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/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:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../../routes.dart';
class AdmissionRequestFirstScreen extends StatefulWidget {
@override
_AdmissionRequestThirdScreenState createState() =>
_AdmissionRequestThirdScreenState();
}
class _AdmissionRequestThirdScreenState
extends State<AdmissionRequestFirstScreen> {
final _dietTypeRemarksController = TextEditingController();
final _sickLeaveCommentsController = TextEditingController();
final _postMedicalHistoryController = TextEditingController();
final _postSurgicalHistoryController = TextEditingController();
dynamic _selectedClinic;
dynamic _selectedDoctor;
dynamic _selectedDietType;
bool _isSickLeaveRequired = false;
bool _patientPregnant = 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;
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<AdmissionRequestViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).admissionRequest,
body: GestureDetector(
onTap: (){
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
},
child: 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)
.specialityAndDoctorDetail,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.clinicList != null &&
model.clinicList.length > 0
? () {
openListDialogField(
'clinicGroupName',
'clinicID',
model.clinicList,
(selectedValue) {
setState(() {
_selectedClinic = selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getClinics().then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.clinicList.length > 0) {
openListDialogField(
'clinicGroupName',
'clinicID',
model.clinicList,
(selectedValue) {
setState(() {
_selectedClinic =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.clinic,
_selectedClinic != null
? _selectedClinic[
'clinicGroupName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 20,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedClinic != null
? model.doctorsList != null &&
model.doctorsList.length > 0
? () {
openListDialogField(
'DoctorName',
'DoctorID',
model.doctorsList,
(selectedValue) {
setState(() {
_selectedDoctor =
selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils
.showMyDialog(context);
await model
.getClinicDoctors(
_selectedClinic[
'clinicID'])
.then((_) =>
GifLoaderDialogUtils
.hideDialog(
context));
if (model.state ==
ViewState.Idle &&
model.doctorsList.length >
0) {
openListDialogField(
'DoctorName',
'DoctorID',
model.doctorsList,
(selectedValue) {
setState(() {
_selectedDoctor =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
}
: null,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.doctor,
_selectedDoctor != null
? _selectedDoctor[
'DoctorName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).patientDetails,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
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),
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context)
.isSickLeaveRequired,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.1,
),
value: _isSickLeaveRequired,
onChanged: (newValue) {
setState(() {
_isSickLeaveRequired = newValue;
});
},
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
Container(
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.sickLeaveComments,
null,
false),
enabled: true,
controller: _sickLeaveCommentsController,
keyboardType: TextInputType.text,
minLines: 2,
maxLines: 4,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.dietTypesList != null &&
model.dietTypesList.length > 0
? () {
openListDialogField('nameEn', 'id',
model.dietTypesList,
(selectedValue) {
setState(() {
_selectedDietType =
selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getDietTypes().then(
(_) => GifLoaderDialogUtils
.hideDialog(context));
if (model.state == ViewState.Idle &&
model.dietTypesList.length >
0) {
openListDialogField('nameEn',
'id', model.dietTypesList,
(selectedValue) {
setState(() {
_selectedDietType =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.dietType,
_selectedDietType != null
? _selectedDietType['nameEn']
: 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,
)),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.pastMedicalHistory,
null,
false),
enabled: true,
controller: _postMedicalHistoryController,
keyboardType: TextInputType.text,
minLines: 2,
maxLines: 4,
)),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.pastSurgicalHistory,
null,
false),
enabled: true,
controller: _postSurgicalHistoryController,
keyboardType: TextInputType.text,
minLines: 2,
maxLines: 4,
)),
],
),
),
],
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).next,
color: HexColor("#B8382B"),
onPressed: () {
model.admissionRequestData = AdmissionRequest();
if (_selectedClinic != null &&
_selectedDoctor != null &&
_sickLeaveCommentsController.text != "" &&
_postMedicalHistoryController.text != "" &&
_postSurgicalHistoryController.text != "") {
model.admissionRequestData.patientMRN =
patient.patientMRN;
model.admissionRequestData.appointmentNo =
patient.appointmentNo;
model.admissionRequestData.episodeID =
patient.episodeNo;
model.admissionRequestData.admissionRequestNo = 0;
model.admissionRequestData.admitToClinic =
_selectedClinic['clinicID'];
model.admissionRequestData.mrpDoctorID =
_selectedDoctor['DoctorID'];
model.admissionRequestData.isPregnant =
_patientPregnant;
model.admissionRequestData.isSickLeaveRequired =
_isSickLeaveRequired;
model.admissionRequestData.sickLeaveComments =
_sickLeaveCommentsController.text;
model.admissionRequestData.isDietType =
_selectedDietType != null ? true : false;
model.admissionRequestData.dietType =
_selectedDietType != null
? _selectedDietType['id']
: 0;
model.admissionRequestData.dietRemarks =
_dietTypeRemarksController.text;
model.admissionRequestData.pastMedicalHistory =
_postMedicalHistoryController.text;
model.admissionRequestData.pastSurgicalHistory =
_postSurgicalHistoryController.text;
Navigator.of(context).pushNamed(
PATIENT_ADMISSION_REQUEST_2,
arguments: {
'patient': patient,
'admission-data': model.admissionRequestData
});
} else {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseFill);
}
},
),
),
],
),
),
),
);
}
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);
}
}
void openListDialogField(String attributeName, String attributeValueId,
List<dynamic> list, Function(dynamic selectedValue) okFunction) {
ListSelectDialog dialog = ListSelectDialog(
list: list,
attributeName: attributeName,
attributeValueId: attributeValueId,
usingSearch: true,
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
okFunction(selectedValue);
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
}

@ -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/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart';
@ -31,19 +32,21 @@ class AdmissionRequestThirdScreen extends StatefulWidget {
class _AdmissionRequestThirdScreenState class _AdmissionRequestThirdScreenState
extends State<AdmissionRequestThirdScreen> { extends State<AdmissionRequestThirdScreen> {
final _postPlansEstimatedCostController = TextEditingController(); final _treatmentLineController = TextEditingController();
final _dietTypeRemarksController = TextEditingController(); final _complicationsController = TextEditingController();
final _estimatedCostController = TextEditingController(); final _otherProceduresController = TextEditingController();
// DateTime _dischargeDate; dynamic _selectedAdmissionType;
dynamic _selectedClinic; dynamic _selectedDiagnosis;
dynamic _selectedDoctor; dynamic _selectedIcd;
dynamic _selectedDietType; dynamic _selectedDiagnosisType;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
AdmissionRequest admissionRequest = routeArgs['admission-data'];
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -51,375 +54,375 @@ class _AdmissionRequestThirdScreenState
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).admissionRequest, appBarTitle: TranslationBase.of(context).admissionRequest,
body: model.doctorsList != null body: GestureDetector(
? Column( onTap: () {
children: [ FocusScopeNode currentFocus = FocusScope.of(context);
Expanded( if (!currentFocus.hasPrimaryFocus) {
child: SingleChildScrollView( currentFocus.unfocus();
}
},
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
PatientPageHeaderWidget(patient),
Container(
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
PatientPageHeaderWidget(patient), SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).treatmentLine,
null,
false),
enabled: true,
controller: _treatmentLineController,
keyboardType: TextInputType.text,
minLines: 3,
maxLines: 5,
)),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).complications,
null,
false),
enabled: true,
controller: _complicationsController,
keyboardType: TextInputType.text,
minLines: 3,
maxLines: 5,
)),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).otherProcedure,
null,
false),
enabled: true,
controller: _otherProceduresController,
keyboardType: TextInputType.text,
minLines: 3,
maxLines: 5,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.admissionTypeList != null &&
model.admissionTypeList.length > 0
? () {
openListDialogField('nameEn', 'id',
model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType =
selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getMasterLookup(MasterKeysService
.AdmissionRequestType)
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.admissionTypeList.length > 0) {
openListDialogField('nameEn', 'id',
model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).admissionType,
_selectedAdmissionType != null
? _selectedAdmissionType['nameEn']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).diagnosisDetail,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container( Container(
margin: EdgeInsets.symmetric( height: screenSize.height * 0.070,
vertical: 16, horizontal: 16), child: InkWell(
child: Column( onTap: model.diagnosisTypesList != null &&
crossAxisAlignment: CrossAxisAlignment.start, model.diagnosisTypesList.length > 0
children: [ ? () {
SizedBox( openListDialogField('nameEn', 'id',
height: 16, model.diagnosisTypesList,
), (selectedValue) {
AppText( setState(() {
TranslationBase.of(context) _selectedDiagnosis = selectedValue;
.specialityAndDoctorDetail, });
fontWeight: FontWeight.bold, });
fontSize: SizeConfig.textMultiplier * 2.5, }
), : () async {
SizedBox( GifLoaderDialogUtils.showMyDialog(
height: 10, context);
), await model.getDiagnosis().then((_) =>
SizedBox( GifLoaderDialogUtils.hideDialog(
height: 20, context));
), if (model.state == ViewState.Idle &&
Container( model.diagnosisTypesList.length > 0) {
height: screenSize.height * 0.070, openListDialogField('nameEn', 'id',
child: InkWell( model.diagnosisTypesList,
onTap: model.clinicList != null && (selectedValue) {
model.clinicList.length > 0 setState(() {
? () { _selectedDiagnosis = selectedValue;
openListDialogField( });
'clinicGroupName', });
'clinicID', } else if (model.state ==
model.clinicList, ViewState.ErrorLocal) {
(selectedValue) { DrAppToastMsg.showErrorToast(
setState(() { model.error);
_selectedClinic = selectedValue; } else {
}); DrAppToastMsg.showErrorToast(
}); "Empty List");
} }
: () async { },
GifLoaderDialogUtils.showMyDialog( child: TextField(
context); decoration: Helpers.textFieldSelectorDecoration(
await model.getClinics().then((_) => TranslationBase.of(context).diagnosis,
GifLoaderDialogUtils.hideDialog( _selectedDiagnosis != null
context)); ? _selectedDiagnosis['nameEn']
if (model.state == ViewState.Idle &&
model.clinicList.length > 0) {
openListDialogField(
'clinicGroupName',
'clinicID',
model.clinicList,
(selectedValue) {
setState(() {
_selectedClinic =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.clinic,
_selectedClinic != null
? _selectedClinic[
'clinicGroupName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 20,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedClinic != null
? model.doctorsList != null &&
model.doctorsList.length > 0
? () {
openListDialogField(
'DoctorName',
'DoctorID',
model.doctorsList,
(selectedValue) {
setState(() {
_selectedDoctor =
selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils
.showMyDialog(context);
await model
.getClinicDoctors(
_selectedClinic[
'clinicID'])
.then((_) =>
GifLoaderDialogUtils
.hideDialog(
context));
if (model.state ==
ViewState.Idle &&
model.doctorsList.length >
0) {
openListDialogField(
'DoctorName',
'DoctorID',
model.doctorsList,
(selectedValue) {
setState(() {
_selectedDoctor =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
}
: null, : null,
child: TextField( true),
decoration: enabled: false,
Helpers.textFieldSelectorDecoration( ),
TranslationBase.of(context) ),
.doctor, ),
_selectedDoctor != null SizedBox(
? _selectedDoctor[ height: 10,
'DoctorName'] ),
: null, Container(
true), height: screenSize.height * 0.070,
enabled: false, child: InkWell(
), onTap: model.icdCodes != null &&
), model.icdCodes.length > 0
), ? () {
SizedBox( openListDialogField(
height: 10, 'description', 'code', model.icdCodes,
), (selectedValue) {
AppText( setState(() {
TranslationBase.of(context) _selectedIcd = selectedValue;
.postPlansEstimatedCost, });
fontWeight: FontWeight.bold, });
fontSize: SizeConfig.textMultiplier * 2.5, }
), : () async {
SizedBox( GifLoaderDialogUtils.showMyDialog(
height: 10, context);
), await model
Container( .getICDCodes(patient.patientMRN)
height: screenSize.height * 0.070, .then((_) =>
child: TextField( GifLoaderDialogUtils.hideDialog(
decoration: context));
Helpers.textFieldSelectorDecoration( if (model.state == ViewState.Idle &&
TranslationBase.of(context) model.icdCodes.length > 0) {
.estimatedCost, openListDialogField(
null, 'description',
false), 'code',
enabled: true, model.icdCodes, (selectedValue) {
controller: _estimatedCostController, setState(() {
inputFormatters: [ _selectedIcd = selectedValue;
FilteringTextInputFormatter.allow( });
RegExp(ONLY_NUMBERS)) });
], } else if (model.state ==
keyboardType: TextInputType.number, ViewState.ErrorLocal) {
)), DrAppToastMsg.showErrorToast(
SizedBox( model.error);
height: 10, } else {
), DrAppToastMsg.showErrorToast(
Container( "Empty List");
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).postPlans,
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) { child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).icd,
_selectedIcd != null
? _selectedIcd['description']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.listOfDiagnosisSelectionTypes !=
null &&
model.listOfDiagnosisSelectionTypes
.length >
0
? () {
openListDialogField('description', 'code',
model.listOfDiagnosisSelectionTypes,
(selectedValue) {
setState(() { setState(() {
_dischargeDate = picked; _selectedDiagnosisType =
selectedValue;
}); });
}); });
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getMasterLookup(MasterKeysService
.DiagnosisSelectionType)
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.listOfDiagnosisSelectionTypes
.length >
0) {
openListDialogField(
'description',
'code',
model.listOfDiagnosisSelectionTypes,
(selectedValue) {
setState(() {
_selectedDiagnosisType =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
}, },
child: TextField( child: TextField(
decoration: decoration: Helpers.textFieldSelectorDecoration(
Helpers.textFieldSelectorDecoration( TranslationBase.of(context).diagnoseType,
TranslationBase.of(context) _selectedDiagnosisType != null
.expectedAdmissionDate, ? _selectedDiagnosisType['description']
_dischargeDate != null : null,
? "${DateUtils.convertStringToDateFormat(_dischargeDate.toString(), "yyyy-MM-dd")}" true),
: null, enabled: false,
true, ),
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 10,
),*/
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.dietTypesList != null &&
model.dietTypesList.length > 0
? () {
openListDialogField('nameEn', 'id',
model.dietTypesList,
(selectedValue) {
setState(() {
_selectedDietType =
selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getDietTypes().then(
(_) => GifLoaderDialogUtils
.hideDialog(context));
if (model.state == ViewState.Idle &&
model.dietTypesList.length >
0) {
openListDialogField('nameEn',
'id', model.dietTypesList,
(selectedValue) {
setState(() {
_selectedDietType =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.dietType,
_selectedDietType != null
? _selectedDietType['nameEn']
: 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,
)),
],
), ),
), ),
SizedBox(
height: 10,
),
], ],
), ),
), ),
), ],
Container( ),
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), )),
child: AppButton( Container(
title: TranslationBase.of(context).next, margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
color: HexColor("#B8382B"), child: AppButton(
onPressed: () { title: TranslationBase.of(context).next,
model.admissionRequestData = AdmissionRequest(); color: HexColor("#B8382B"),
if (_selectedClinic != null && onPressed: () async {
_selectedDoctor != null && if (_treatmentLineController.text != "" &&
_estimatedCostController.text != "" && _complicationsController.text != "" &&
_postPlansEstimatedCostController.text != "") { _otherProceduresController.text != "" &&
model.admissionRequestData.patientMRN = patient.patientMRN; _selectedAdmissionType != null &&
model.admissionRequestData.appointmentNo = patient.appointmentNo; _selectedDiagnosis != null &&
model.admissionRequestData.episodeID = patient.episodeNo; _selectedIcd != null &&
model.admissionRequestData.admissionRequestNo = 0; _selectedDiagnosisType != null) {
model.admissionRequestData = admissionRequest;
model.admissionRequestData.mainLineOfTreatment =
_treatmentLineController.text;
model.admissionRequestData.complications =
_complicationsController.text;
model.admissionRequestData.otherProcedures =
_otherProceduresController.text;
model.admissionRequestData.admissionType =
_selectedAdmissionType['id'];
model.admissionRequestData.admitToClinic = _selectedClinic['clinicID']; dynamic admissionRequestDiagnoses = [
model.admissionRequestData.mrpDoctorID = _selectedDoctor['DoctorID']; {
model.admissionRequestData.estimatedCost = int.parse(_estimatedCostController.text); 'diagnosisDescription': _selectedDiagnosis['nameEn'],
model.admissionRequestData.elementsForImprovement = _postPlansEstimatedCostController.text; 'diagnosisType': _selectedDiagnosis['id'],
model.admissionRequestData.isDietType = _selectedDietType != null ? true : false; 'icdCode': _selectedIcd['code'],
model.admissionRequestData.dietType = _selectedDietType != null ? _selectedDietType['id'] : 0; 'icdCodeDescription': _selectedIcd['description'],
model.admissionRequestData.dietRemarks = _dietTypeRemarksController.text; 'type': _selectedDiagnosisType['code'],
Navigator.of(context).pushNamed( 'remarks': "",
PATIENT_ADMISSION_REQUEST_2, 'isActive': true,
arguments: {'patient': patient, 'admission-data' : model.admissionRequestData});
} else {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseFill);
} }
}, ];
), model.admissionRequestData.admissionRequestDiagnoses =
), admissionRequestDiagnoses;
],
)
: Container(),
),
);
}
Future _selectDate(BuildContext context, DateTime dateTime, await model.makeAdmissionRequest();
Function(DateTime picked) updateDate) async { if (model.state == ViewState.ErrorLocal) {
final DateTime picked = await showDatePicker( DrAppToastMsg.showErrorToast(model.error);
context: context, } else {
initialDate: dateTime, DrAppToastMsg.showSuccesToast(
firstDate: DateTime.now(), TranslationBase.of(context).admissionRequestSuccessMsg);
lastDate: DateTime(2040), Navigator.popUntil(context, ModalRoute.withName(PATIENTS_PROFILE));
initialEntryMode: DatePickerEntryMode.calendar, }
} else {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseFill);
}
},
),
),
],
),
),
),
); );
if (picked != null && picked != dateTime) {
updateDate(picked);
}
} }
void openListDialogField(String attributeName, String attributeValueId, void openListDialogField(String attributeName, String attributeValueId,

@ -32,24 +32,16 @@ class AdmissionRequestSecondScreen extends StatefulWidget {
class _AdmissionRequestSecondScreenState class _AdmissionRequestSecondScreenState
extends State<AdmissionRequestSecondScreen> { extends State<AdmissionRequestSecondScreen> {
final _postPlansEstimatedCostController = TextEditingController();
final _estimatedCostController = TextEditingController();
final _expectedDaysController = TextEditingController(); final _expectedDaysController = TextEditingController();
final _treatmentLineController = TextEditingController(); final _otherDepartmentsInterventionsController = TextEditingController();
// final _preOperativeOrdersController = TextEditingController();
DateTime _expectedAdmissionDate; DateTime _expectedAdmissionDate;
// bool _emergencyAdmission = false; dynamic _selectedFloor;
bool _isSickLeaveRequired = false;
bool _patientPregnant = false;
// bool _preAnesthesiaReferred = false;
dynamic _selectedWard; dynamic _selectedWard;
dynamic _selectedAdmissionType; dynamic _selectedRoomCategory;
dynamic _selectedDiagnosis;
dynamic _selectedIcd;
dynamic _selectedDiagnosisType;
// dynamic _selectedAllergies;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -62,614 +54,388 @@ class _AdmissionRequestSecondScreenState
return BaseView<AdmissionRequestViewModel>( return BaseView<AdmissionRequestViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).admissionRequest, appBarTitle: TranslationBase.of(context).admissionRequest,
body: model.doctorsList != null body: GestureDetector(
? Column( onTap: () {
children: [ FocusScopeNode currentFocus = FocusScope.of(context);
Expanded( if (!currentFocus.hasPrimaryFocus) {
child: SingleChildScrollView( currentFocus.unfocus();
child: Column( }
crossAxisAlignment: CrossAxisAlignment.start, },
children: [ child: Column(
PatientPageHeaderWidget(patient), children: [
Container( Expanded(
margin: EdgeInsets.symmetric( child: SingleChildScrollView(
vertical: 16, horizontal: 16), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ PatientPageHeaderWidget(patient),
SizedBox( Container(
height: 16, margin: EdgeInsets.symmetric(
), vertical: 16, horizontal: 16),
AppText( child: Column(
TranslationBase.of(context).otherInformation, crossAxisAlignment: CrossAxisAlignment.start,
fontWeight: FontWeight.bold, children: [
fontSize: SizeConfig.textMultiplier * 2.5, SizedBox(
), height: 16,
SizedBox( ),
height: 10, AppText(
), TranslationBase.of(context)
Container( .postPlansEstimatedCost,
height: screenSize.height * 0.070, fontWeight: FontWeight.bold,
child: TextField( fontSize: SizeConfig.textMultiplier * 2.5,
decoration: ),
Helpers.textFieldSelectorDecoration( SizedBox(
TranslationBase.of(context) height: 10,
.expectedDays, ),
null, Container(
false), height: screenSize.height * 0.070,
enabled: true, child: TextField(
controller: _expectedDaysController, decoration:
inputFormatters: [ Helpers.textFieldSelectorDecoration(
FilteringTextInputFormatter.allow( TranslationBase.of(context)
RegExp(ONLY_NUMBERS)) .estimatedCost,
], null,
keyboardType: TextInputType.number, false),
)), enabled: true,
SizedBox( controller: _estimatedCostController,
height: 10, inputFormatters: [
), FilteringTextInputFormatter.allow(
Container( RegExp(ONLY_NUMBERS))
],
keyboardType: TextInputType.number,
)),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).postPlans,
null,
false),
enabled: true,
controller: _postPlansEstimatedCostController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.otherDepartmentsInterventions,
null,
false),
enabled: true,
controller:
_otherDepartmentsInterventionsController,
keyboardType: TextInputType.multiline,
minLines: 2,
maxLines: 4,
)),
SizedBox(
height: 10,
),
AppText(
TranslationBase.of(context).otherInformation,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: TextField(
onTap: () { decoration:
if (_expectedAdmissionDate == null) { Helpers.textFieldSelectorDecoration(
_expectedAdmissionDate = DateTime.now(); TranslationBase.of(context)
} .expectedDays,
_selectDate( null,
context, _expectedAdmissionDate, false),
(picked) { enabled: true,
setState(() { controller: _expectedDaysController,
_expectedAdmissionDate = picked; 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: child: TextField(
ListTileControlAffinity.leading, decoration: Helpers.textFieldSelectorDecoration(
contentPadding: EdgeInsets.all(0), TranslationBase.of(context)
), .expectedAdmissionDate,
*/ _expectedAdmissionDate != null
CheckboxListTile( ? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}"
title: AppText( : null,
TranslationBase.of(context) true,
.isSickLeaveRequired, suffixIcon: Icon(
fontWeight: FontWeight.normal, Icons.calendar_today,
fontSize: SizeConfig.textMultiplier * 2.1, color: Colors.black,
)),
enabled: false,
), ),
value: _isSickLeaveRequired,
onChanged: (newValue) {
setState(() {
_isSickLeaveRequired = 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, SizedBox(
child: InkWell( height: 10,
onTap: model.wardList != null && ),
model.wardList.length > 0 Container(
? () { height: screenSize.height * 0.070,
child: InkWell(
onTap: model.floorList != null &&
model.floorList.length > 0
? () {
openListDialogField(
'description',
'floorID',
model.floorList, (selectedValue) {
setState(() {
_selectedFloor = selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getFloors().then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.floorList.length > 0) {
openListDialogField('description', openListDialogField('description',
'description', model.wardList, 'floorID', model.floorList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedWard = selectedValue; _selectedFloor = selectedValue;
}); });
}); });
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
} }
: () async { },
GifLoaderDialogUtils.showMyDialog( child: TextField(
context); decoration:
await model.getWards().then((_) => Helpers.textFieldSelectorDecoration(
GifLoaderDialogUtils.hideDialog( TranslationBase.of(context).floor,
context)); _selectedFloor != null
if (model.state == ViewState.Idle && ? _selectedFloor['description']
model.wardList.length > 0) { : null,
openListDialogField('description', true),
'description', model.wardList, enabled: false,
(selectedValue) {
setState(() {
_selectedWard = selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).ward,
_selectedWard != null
? _selectedWard['description']
: null,
true),
enabled: false,
),
), ),
), ),
/* CheckboxListTile( ),
title: AppText( SizedBox(
TranslationBase.of(context) height: 10,
.preAnesthesiaReferred, ),
fontWeight: FontWeight.normal, Container(
fontSize: SizeConfig.textMultiplier * 2.1, height: screenSize.height * 0.070,
), child: InkWell(
value: _preAnesthesiaReferred, onTap: model.wardList != null &&
onChanged: (newValue) { model.wardList.length > 0
setState(() { ? () {
_preAnesthesiaReferred = newValue; openListDialogField(
}); 'description',
}, 'nursingStationID',
controlAffinity: model.wardList, (selectedValue) {
ListTileControlAffinity.leading, setState(() {
contentPadding: EdgeInsets.all(0), _selectedWard = selectedValue;
),*/
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.admissionTypeList != null &&
model.admissionTypeList.length > 0
? () {
openListDialogField('nameEn', 'id',
model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType =
selectedValue;
});
}); });
} });
: () async { }
GifLoaderDialogUtils.showMyDialog( : () async {
context); GifLoaderDialogUtils.showMyDialog(
await model context);
.getMasterLookup( await model.getWards().then((_) =>
MasterKeysService GifLoaderDialogUtils.hideDialog(
.AdmissionRequestType) context));
.then((_) => if (model.state == ViewState.Idle &&
GifLoaderDialogUtils model.wardList.length > 0) {
.hideDialog(context)); openListDialogField(
if (model.state == ViewState.Idle && 'description',
model.admissionTypeList.length > 'nursingStationID',
0) { model.wardList,
openListDialogField('nameEn',
'id', model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.admissionType,
_selectedAdmissionType != null
? _selectedAdmissionType[
'nameEn']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).diagnosisDetail,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.diagnosisTypesList != null &&
model.diagnosisTypesList.length > 0
? () {
openListDialogField('nameEn', 'id',
model.diagnosisTypesList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDiagnosis = _selectedWard = selectedValue;
selectedValue;
}); });
}); });
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
} }
: () async { },
GifLoaderDialogUtils.showMyDialog( child: TextField(
context); decoration:
await model.getDiagnosis().then( Helpers.textFieldSelectorDecoration(
(_) => GifLoaderDialogUtils TranslationBase.of(context).ward,
.hideDialog(context)); _selectedWard != null
if (model.state == ViewState.Idle && ? _selectedWard['description']
model.diagnosisTypesList : null,
.length > true),
0) { enabled: false,
openListDialogField(
'nameEn',
'id',
model.diagnosisTypesList,
(selectedValue) {
setState(() {
_selectedDiagnosis =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.diagnosis,
_selectedDiagnosis != null
? _selectedDiagnosis['nameEn']
: null,
true),
enabled: false,
),
), ),
), ),
SizedBox( ),
height: 10, SizedBox(
), height: 10,
Container( ),
height: screenSize.height * 0.070, Container(
child: InkWell( height: screenSize.height * 0.070,
onTap: model.icdCodes != null && child: InkWell(
model.icdCodes.length > 0 onTap: model.roomCategoryList != null &&
? () { model.roomCategoryList.length > 0
openListDialogField('description', ? () {
'code', model.icdCodes, openListDialogField(
(selectedValue) { 'description',
setState(() { 'categoryID',
_selectedIcd = selectedValue; model.roomCategoryList,
}); (selectedValue) {
setState(() {
_selectedRoomCategory =
selectedValue;
}); });
} });
: () async { }
GifLoaderDialogUtils.showMyDialog( : () async {
context); GifLoaderDialogUtils.showMyDialog(
await model context);
.getICDCodes(patient.patientMRN) await model.getRoomCategories().then(
.then((_) => (_) => GifLoaderDialogUtils
GifLoaderDialogUtils .hideDialog(context));
.hideDialog(context)); if (model.state == ViewState.Idle &&
if (model.state == ViewState.Idle && model.roomCategoryList.length >
model.icdCodes.length > 0) { 0) {
openListDialogField('description',
'code', model.icdCodes,
(selectedValue) {
setState(() {
_selectedIcd = selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).icd,
_selectedIcd != null
? _selectedIcd['description']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.listOfDiagnosisSelectionTypes !=
null &&
model.listOfDiagnosisSelectionTypes
.length >
0
? () {
openListDialogField( openListDialogField(
'description', 'description',
'code', 'categoryID',
model model.roomCategoryList,
.listOfDiagnosisSelectionTypes,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDiagnosisType = _selectedRoomCategory =
selectedValue; selectedValue;
}); });
}); });
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
} }
: () async { },
GifLoaderDialogUtils.showMyDialog( child: TextField(
context); decoration:
await model Helpers.textFieldSelectorDecoration(
.getMasterLookup( TranslationBase.of(context)
MasterKeysService .roomCategory,
.DiagnosisSelectionType) _selectedRoomCategory != null
.then((_) => ? _selectedRoomCategory[
GifLoaderDialogUtils 'description']
.hideDialog(context)); : null,
if (model.state == ViewState.Idle && true),
model.listOfDiagnosisSelectionTypes enabled: false,
.length >
0) {
openListDialogField(
'description',
'code',
model
.listOfDiagnosisSelectionTypes,
(selectedValue) {
setState(() {
_selectedDiagnosisType =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.diagnoseType,
_selectedDiagnosisType != null
? _selectedDiagnosisType[
'description']
: null,
true),
enabled: false,
),
), ),
), ),
SizedBox( ),
height: 10, 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.allergiesList != null &&
model.allergiesList.length > 0
? () {
openListDialogField('nameEn', 'id',
model.allergiesList,
(selectedValue) {
setState(() {
_selectedAllergies =
selectedValue;
});
});
}
: () async {
await model.getAllergies();
if (model.state == ViewState.Idle &&
model.allergiesList.length >
0) {
openListDialogField('nameEn',
'id', model.allergiesList,
(selectedValue) {
setState(() {
_selectedAllergies =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.allergies,
_selectedAllergies != null
? _selectedAllergies['nameEn']
: null,
true),
enabled: false,
),
),
),*/
],
),
), ),
], ),
), ],
), ),
), ),
Container( ),
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), Container(
child: AppButton( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
title: TranslationBase.of(context).save, child: AppButton(
color: HexColor("#B8382B"), title: TranslationBase.of(context).next,
onPressed: () async { color: HexColor("#B8382B"),
if (_expectedDaysController.text != "" && onPressed: () async {
_expectedAdmissionDate != null && if (_estimatedCostController.text != "" &&
_treatmentLineController.text != "" && _postPlansEstimatedCostController.text != "" &&
_selectedWard != null && _expectedDaysController.text != "" &&
_selectedAdmissionType != null && _expectedAdmissionDate != null &&
_selectedDiagnosis != null && _otherDepartmentsInterventionsController.text != "" &&
_selectedIcd != null && _selectedFloor != null &&
_selectedDiagnosisType != null) { _selectedRoomCategory !=
model.admissionRequestData = admissionRequest; null /*_selectedWard is not required*/) {
model.admissionRequestData = admissionRequest;
model.admissionRequestData.expectedDays = int.parse(_expectedDaysController.text); model.admissionRequestData.estimatedCost =
model.admissionRequestData.admissionDate = _expectedAdmissionDate.toIso8601String(); int.parse(_estimatedCostController.text);
model.admissionRequestData.isSickLeaveRequired = _isSickLeaveRequired; model.admissionRequestData.elementsForImprovement =
model.admissionRequestData.isPregnant = _patientPregnant; _postPlansEstimatedCostController.text;
model.admissionRequestData.mainLineOfTreatment = _treatmentLineController.text;
model.admissionRequestData.wardID = 0; model.admissionRequestData.expectedDays =
model.admissionRequestData.admissionType = _selectedAdmissionType['id']; int.parse(_expectedDaysController.text);
dynamic admissionRequestDiagnoses = [ model.admissionRequestData.admissionDate =
{ _expectedAdmissionDate.toIso8601String();
'diagnosisDescription' : _selectedDiagnosis['nameEn'], model.admissionRequestData
'diagnosisType' : _selectedDiagnosis['id'], .otherDepartmentInterventions =
'icdCode' : _selectedIcd['code'], _otherDepartmentsInterventionsController.text;
'icdCodeDescription' : _selectedIcd['description'], model.admissionRequestData.admissionLocationID =
'type' : _selectedDiagnosisType['code'], _selectedFloor['floorID'];
'remarks' : "", model.admissionRequestData.wardID =
'isActive' : true, _selectedWard != null
} ? _selectedWard['nursingStationID']
]; : 0;
model.admissionRequestData.admissionRequestDiagnoses = admissionRequestDiagnoses; model.admissionRequestData.roomCategoryID =
model.admissionRequestData.admissionRequestProcedures = []; _selectedRoomCategory['categoryID'];
await model.makeAdmissionRequest();
if(model.state == ViewState.ErrorLocal){ model.admissionRequestData.admissionRequestProcedures =
DrAppToastMsg.showErrorToast( [];
model.error); Navigator.of(context)
} .pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {
} else { 'patient': patient,
DrAppToastMsg.showErrorToast( 'admission-data': model.admissionRequestData
TranslationBase.of(context).pleaseFill); });
} } else {
}, DrAppToastMsg.showErrorToast(
), TranslationBase.of(context).pleaseFill);
}
},
), ),
], ),
) ],
: Container(), ),
), )),
); );
} }

@ -143,6 +143,9 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
if(model
.patientLabResultOrdersList[index]
.doctorName != null )
AppText( AppText(
'${model '${model
.patientLabResultOrdersList[index] .patientLabResultOrdersList[index]
@ -171,7 +174,7 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
' Invoice No :', TranslationBase.of(context).invoiceNo,
fontSize: 2 * fontSize: 2 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
@ -187,6 +190,30 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
color: Colors.grey[800], color: Colors.grey[800],
), ),
], ],
),SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).orderNo,
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${model
.patientLabResultOrdersList[index]
.orderNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
],
) )
], ],
), ),

@ -37,19 +37,39 @@ class _LabResultState extends State<LabResult> {
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
CardWithBgWidgetNew( CardWithBgWidgetNew(
widget: Row( widget: Column(
mainAxisAlignment: MainAxisAlignment.start, children: [
children: <Widget>[ Row(
AppText( mainAxisAlignment: MainAxisAlignment.start,
TranslationBase.of(context).invoiceNo, children: <Widget>[
fontSize: 2 * SizeConfig.textMultiplier, AppText(
color: Colors.grey[800], TranslationBase.of(context).orderNo,
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${widget.labOrders.orderNo}',
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
],
), ),
AppText( Row(
' ${widget.labOrders.invoiceNo}', mainAxisAlignment: MainAxisAlignment.start,
fontSize: 2 * SizeConfig.textMultiplier, children: <Widget>[
color: Colors.grey[800], AppText(
TranslationBase.of(context).invoiceNo,
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${widget.labOrders.invoiceNo}',
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
],
), ),
], ],
), ),
), ),

@ -154,6 +154,10 @@ class MyReferralDetailScreen extends StatelessWidget {
pendingReferral, true); pendingReferral, true);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept);
Navigator.pop(context);
Navigator.pop(context);
} }
}, },
), ),
@ -174,6 +178,10 @@ class MyReferralDetailScreen extends StatelessWidget {
pendingReferral, true); pendingReferral, true);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject);
Navigator.pop(context);
Navigator.pop(context);
} }
}, },
), ),

@ -91,20 +91,20 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
model.patientReferral.length == 0 model.patientReferral.length == 0
? ReferralForm(model, screenSize) ? ReferralForm(model, screenSize)
: PatientReferralItemWidget( : PatientReferralItemWidget(
"${model.patientReferral[0].patientID}", "${model.patientReferral[model.patientReferral.length -1].patientID}",
patientName: model.patientReferral[0].patientName, patientName: model.patientReferral[model.patientReferral.length -1].patientName,
referralStatus: referralStatus:
"${model.patientReferral[0].referralStatus}", "${model.patientReferral[model.patientReferral.length -1].referralStatus}",
isReferredTo: true, isReferredTo: true,
isSameBranch: model isSameBranch: model
.patientReferral[0].isReferralDoctorSameBranch, .patientReferral[model.patientReferral.length -1].isReferralDoctorSameBranch,
referralDoctorName: referralDoctorName:
model.patientReferral[0].referredByDoctorInfo, model.patientReferral[model.patientReferral.length -1].referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
remark: model.patientReferral[0].remarksFromSource, remark: model.patientReferral[model.patientReferral.length -1].remarksFromSource,
referredOn: model.patientReferral[0].referredOn, referredOn: model.patientReferral[model.patientReferral.length -1].referredOn,
answerFromTarget: answerFromTarget:
model.patientReferral[0].answerFromTarget, model.patientReferral[model.patientReferral.length -1].answerFromTarget,
), ),
], ],
), ),

@ -248,6 +248,7 @@ class TranslationBase {
localizedValues['errorNoProgressNote'][locale.languageCode]; localizedValues['errorNoProgressNote'][locale.languageCode];
String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode];
String get orderNo => localizedValues['orderNo'][locale.languageCode];
String get generalResult => String get generalResult =>
localizedValues['generalResult'][locale.languageCode]; localizedValues['generalResult'][locale.languageCode];
@ -946,6 +947,7 @@ class TranslationBase {
String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; String get allergicTO => localizedValues['allergicTO'][locale.languageCode];
String get normal => localizedValues['normal'][locale.languageCode]; String get normal => localizedValues['normal'][locale.languageCode];
String get notExamined => localizedValues['notExamined'][locale.languageCode];
String get abnormal => localizedValues['abnormal'][locale.languageCode]; String get abnormal => localizedValues['abnormal'][locale.languageCode];
@ -1086,12 +1088,22 @@ class TranslationBase {
String get referralResponse => localizedValues['referralResponse'][locale.languageCode]; String get referralResponse => localizedValues['referralResponse'][locale.languageCode];
String get estimatedCost => localizedValues['estimatedCost'][locale.languageCode]; String get estimatedCost => localizedValues['estimatedCost'][locale.languageCode];
String get diagnosisDetail => localizedValues['diagnosisDetail'][locale.languageCode]; String get diagnosisDetail => localizedValues['diagnosisDetail'][locale.languageCode];
String get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept'][locale.languageCode];
String get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject'][locale.languageCode];
String get patientName => String get patientName =>
localizedValues['patient-name'][locale.languageCode]; localizedValues['patient-name'][locale.languageCode];
String get appointmentNumber => String get appointmentNumber => localizedValues['appointmentNumber'][locale.languageCode];
localizedValues['appointmentNumber'][locale.languageCode]; String get sickLeaveComments => localizedValues['sickLeaveComments'][locale.languageCode];
String get pastMedicalHistory => localizedValues['pastMedicalHistory'][locale.languageCode];
String get pastSurgicalHistory => localizedValues['pastSurgicalHistory'][locale.languageCode];
String get complications => localizedValues['complications'][locale.languageCode];
String get floor => localizedValues['floor'][locale.languageCode];
String get roomCategory => localizedValues['roomCategory'][locale.languageCode];
String get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions'][locale.languageCode];
String get otherProcedure => localizedValues['otherProcedure'][locale.languageCode];
String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -486,7 +486,11 @@ class _VerificationMethodsState extends State<VerificationMethods> {
case 3: case 3:
return InkWell( return InkWell(
onTap: () => { onTap: () => {
authenticateUser(3, BiometricType.fingerprint.index, authProv) if (checkIfBiometricAvailable(BiometricType.fingerprint))
{
authenticateUser(
3, BiometricType.fingerprint.index, authProv)
}
}, },
child: RoundedContainer( child: RoundedContainer(
backgroundColor: backgroundColor:
@ -518,8 +522,11 @@ class _VerificationMethodsState extends State<VerificationMethods> {
break; break;
case 4: case 4:
return InkWell( return InkWell(
onTap: () => onTap: () {
{authenticateUser(4, BiometricType.face.index, authProv)}, if (checkIfBiometricAvailable(BiometricType.face)) {
authenticateUser(4, BiometricType.face.index, authProv);
}
},
child: RoundedContainer( child: RoundedContainer(
backgroundColor: checkIfBiometricAvailable(BiometricType.face) backgroundColor: checkIfBiometricAvailable(BiometricType.face)
? Colors.white ? Colors.white
@ -739,7 +746,9 @@ class _VerificationMethodsState extends State<VerificationMethods> {
sharedPref.setString(TOKEN, res['AuthenticationTokenID']); sharedPref.setString(TOKEN, res['AuthenticationTokenID']);
if (res['List_DoctorProfile'] != null) { if (res['List_DoctorProfile'] != null) {
loginProcessCompleted(res['List_DoctorProfile'][0], authProv); loginProcessCompleted(res['List_DoctorProfile'][0], authProv);
sharedPref.setObj(CLINIC_NAME, res['List_DoctorsClinic']);
} else { } else {
sharedPref.setObj(CLINIC_NAME, res['List_DoctorsClinic']);
ClinicModel clinic = ClinicModel clinic =
ClinicModel.fromJson(res['List_DoctorsClinic'][0]); ClinicModel.fromJson(res['List_DoctorsClinic'][0]);
getDocProfiles(clinic, authProv); getDocProfiles(clinic, authProv);

@ -27,7 +27,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(

@ -0,0 +1,244 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class PatientCard extends StatelessWidget {
final PatiantInformtion patientInfo;
final Function onTap;
final String patientType;
const PatientCard({Key key, this.patientInfo, this.onTap, this.patientType}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(10),
decoration: myBoxDecoration(),
margin: EdgeInsets.only(bottom: 12),
child: InkWell(
child: Row(
children: <Widget>[
Column(
mainAxisAlignment:
MainAxisAlignment
.start,
children: <
Widget>[
Padding(
padding: EdgeInsets
.only(
left:
12.0),
child:
Container(
decoration:
BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(
0,
0,
0,
0.08),
offset: Offset(0.0,
5.0),
blurRadius:
16.0)
],
borderRadius:
BorderRadius.all(
Radius.circular(35.0)),
color: Color(
0xffCCCCCC),
),
width: 70,
height: 70,
child: Icon(
patientInfo.genderDescription ==
"Male"
? DoctorApp
.male
: DoctorApp
.female_icon,
size: 70,
color: Colors
.white,
),
),
),
],
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment:CrossAxisAlignment.start,
children: [
AppText(
patientInfo.firstName +
" " +
patientInfo.lastName,
fontSize:
2.0 * SizeConfig.textMultiplier,
fontWeight:
FontWeight.bold,
backGroundcolor:
Colors.white,
),
SizedBox(height: 12,),
Table(
border: TableBorder.symmetric(
// inside: BorderSide(width: 2.0, color: Colors.white),
),
// defaultVerticalAlignment:TableCellVerticalAlignment.middle ,
children: [
TableRow(children: [
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).fileNo,
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 2.2 * SizeConfig.textMultiplier)),
new TextSpan(text: patientInfo.patientId.toString()),
],),),
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).age+ " : ",
style: TextStyle(fontWeight: FontWeight.w700, )),
new TextSpan(text: "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}"),
],),),
),
]
),
TableRow(children: [
SizedBox(height: 5,),
SizedBox(height: 5,)
]),
TableRow(children: [
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).nationality + " : ",
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 2.2 * SizeConfig.textMultiplier)),
new TextSpan(text: (patientInfo.nationalityName ?? patientInfo.nationality)),
],),),
),
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context).gender + " : ",
style: TextStyle(fontWeight: FontWeight.w700, )),
new TextSpan(text: patientInfo.gender.toString() == '1' ? 'Male' : 'Female'),
],),),
),
]
),
],
),
if(SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient")
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
patientInfo.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(patientInfo.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 0.5,
)
],
),
margin: EdgeInsets.only(top: 8,),
)
],
),
),
// Divider(color: Colors.grey)
],
),
onTap: onTap,
),
);
}
convertDateFormat2(String str) {
String timeConvert;
const start = "/Date(";
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
String newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
return newDate.toString();
}
myBoxDecoration() {
return BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color(0xffCCCCCC),
width: 0.5,
),
),
);
}
}

@ -175,6 +175,7 @@ class PatientReferralItemWidget extends StatelessWidget {
height: 8, height: 8,
), ),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).referralRemark, TranslationBase.of(context).referralRemark,
@ -182,11 +183,13 @@ class PatientReferralItemWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
AppText( Expanded(
remark, child: AppText(
color: Colors.black, remark,
fontWeight: FontWeight.bold, color: Colors.black,
fontSize: 12, fontWeight: FontWeight.bold,
fontSize: 12,
),
), ),
], ],
), ),

@ -43,7 +43,7 @@ class PatientHeaderWidgetNoAvatar extends StatelessWidget {
], ],
), ),
AppText( AppText(
"NEW VISIT", patient.visitType ?? "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -24,16 +25,20 @@ class LargeAvatar extends StatelessWidget {
Widget _getAvatar() { Widget _getAvatar() {
if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) {
return Center( return CircleAvatar(
radius:
SizeConfig.imageSizeMultiplier * 12,
// radius: (52)
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(radius)), borderRadius:BorderRadius.circular(50),
child: Image.network( child: Image.network(
url.trim(), url,
fit: BoxFit.cover, fit: BoxFit.fill,
width: width, width: 700,
height: height,
), ),
), ),
backgroundColor: Colors.transparent,
); );
} else if (name == null || name.isEmpty) { } else if (name == null || name.isEmpty) {
return Center( return Center(

@ -85,6 +85,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
remark: element.remarks, remark: element.remarks,
isNormal: element.isNormal, isNormal: element.isNormal,
createdBy: element.createdBy, createdBy: element.createdBy,
notExamined: element.notExamined,
isNew: element.isNew,
isAbnormal: element.isAbnormal); isAbnormal: element.isAbnormal);
widget.mySelectedExamination.add(tempEam); widget.mySelectedExamination.add(tempEam);
}); });
@ -243,9 +245,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
onTap: () { onTap: () {
setState(() { setState(() {
examination.isAbnormal = examination.isAbnormal =
!examination.isAbnormal; false;
examination.isNormal = examination.isNormal =
!examination.isNormal; true;
examination.notExamined = false;
}); });
}), }),
SizedBox( SizedBox(
@ -290,12 +293,63 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
), ),
)), )),
), ),
onTap: () {
setState(() {
examination.isNormal =
false;
examination.isAbnormal =
true;
examination.notExamined = false;
});
}),SizedBox(
width: 12,
),
InkWell(
child: Center(
child: Container(
height:
screenSize.height *
0.070,
decoration:
containerBorderDecoration(
examination
.notExamined
? Color(
0xFF515A5D)
: Colors
.white,
Colors.black),
child: Center(
child: Padding(
padding:
const EdgeInsets
.all(8.0),
child: Text(
"Not Examined",
style: TextStyle(
fontSize: 12,
color:
examination
.notExamined
? Colors.white
: Colors
.black,
//Colors.black,
fontWeight:
FontWeight
.bold,
),
),
),
)),
),
onTap: () { onTap: () {
setState(() { setState(() {
examination.isAbnormal = examination.isAbnormal =
!examination.isAbnormal; false;
examination.isNormal = examination.isNormal =
!examination.isNormal; false;
examination.notExamined = true;
}); });
}), }),
], ],
@ -394,13 +448,17 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
examType: exam.selectedExamination.typeId, examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal, isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal, isNormal: exam.isNormal,
masterDescription: exam.selectedExamination, // masterDescription: exam.selectedExamination,
notExamined: false notExamined: exam.notExamined,
examinationType: exam.isNormal?1:exam.isAbnormal?2:3,
examinationTypeName: exam.isNormal?"Normal":exam.isAbnormal?'AbNormal':"Not Examined",
isNew:exam.isNew
)); ));
}); });
if(model.patientPhysicalExamList.isEmpty) { if(model.patientPhysicalExamList.isEmpty) {
await model.postPhysicalExam(postPhysicalExamRequestModel); await model.postPhysicalExam(postPhysicalExamRequestModel);
} else { } else {
await model.patchPhysicalExam(postPhysicalExamRequestModel); await model.patchPhysicalExam(postPhysicalExamRequestModel);

Loading…
Cancel
Save