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

@ -33,13 +33,18 @@ class ListHisProgNotePhysicalExaminationVM {
int patientMRN; int patientMRN;
bool isNormal; bool isNormal;
bool isAbnormal; bool isAbnormal;
bool notExamined;
String examName;
String examinationTypeName;
int examinationType;
String remarks; String remarks;
bool isNew;
int createdBy; int createdBy;
String createdOn; String createdOn;
String createdByName;
int editedBy; int editedBy;
String editedOn; String editedOn;
bool notExamined; String editedByName;
MasterKeyModel masterDescription;
ListHisProgNotePhysicalExaminationVM( ListHisProgNotePhysicalExaminationVM(
{this.episodeId, {this.episodeId,
@ -49,13 +54,18 @@ class ListHisProgNotePhysicalExaminationVM {
this.patientMRN, this.patientMRN,
this.isNormal, this.isNormal,
this.isAbnormal, this.isAbnormal,
this.notExamined,
this.examName,
this.examinationTypeName,
this.examinationType,
this.remarks, this.remarks,
this.isNew,
this.createdBy, this.createdBy,
this.createdOn, this.createdOn,
this.createdByName,
this.editedBy, this.editedBy,
this.editedOn, this.editedOn,
this.notExamined, this.editedByName});
this.masterDescription});
ListHisProgNotePhysicalExaminationVM.fromJson(Map<String, dynamic> json) { ListHisProgNotePhysicalExaminationVM.fromJson(Map<String, dynamic> json) {
episodeId = json['episodeId']; episodeId = json['episodeId'];
@ -65,15 +75,18 @@ class ListHisProgNotePhysicalExaminationVM {
patientMRN = json['patientMRN']; patientMRN = json['patientMRN'];
isNormal = json['isNormal']; isNormal = json['isNormal'];
isAbnormal = json['isAbnormal']; isAbnormal = json['isAbnormal'];
notExamined = json['notExamined'];
examName = json['examName'];
examinationTypeName = json['examinationTypeName'];
examinationType = json['examinationType'];
remarks = json['remarks']; remarks = json['remarks'];
isNew = json['isNew'];
createdBy = json['createdBy']; createdBy = json['createdBy'];
createdOn = json['createdOn']; createdOn = json['createdOn'];
createdByName = json['createdByName'];
editedBy = json['editedBy']; editedBy = json['editedBy'];
editedOn = json['editedOn']; editedOn = json['editedOn'];
notExamined = json['notExamined']; editedByName = json['editedByName'];
masterDescription = json['masterDescription'] != null
? new MasterKeyModel.fromJson(json['masterDescription'])
: null;
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -85,15 +98,18 @@ class ListHisProgNotePhysicalExaminationVM {
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['notExamined'] = this.notExamined;
data['examName'] = this.examName;
data['examinationTypeName'] = this.examinationTypeName;
data['examinationType'] = this.examinationType;
data['remarks'] = this.remarks; data['remarks'] = this.remarks;
data['isNew'] = this.isNew;
data['createdBy'] = this.createdBy; data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn; data['createdOn'] = this.createdOn;
data['createdByName'] = this.createdByName;
data['editedBy'] = this.editedBy; data['editedBy'] = this.editedBy;
data['editedOn'] = this.editedOn; data['editedOn'] = this.editedOn;
data['notExamined'] = this.notExamined; data['editedByName'] = this.editedByName;
if (this.masterDescription != null) {
data['masterDescription'] = this.masterDescription.toJson();
}
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,309 +351,8 @@ 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(),
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(
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: () { onTap: () {
Navigator.of(context) Navigator.of(context)
.pushNamed( .pushNamed(
@ -714,9 +363,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
"from" : patient.getFrom, "from" : patient.getFrom,
"to" : patient.getTo, "to" : patient.getTo,
}); });
}, },);
),
);
}).toList(), }).toList(),
) )
: Center( : Center(
@ -754,8 +401,7 @@ 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(
@ -774,7 +420,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[ return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
InkWell( InkWell(
child: Center( child: Center(
child: Expanded(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.058, height: MediaQuery.of(context).size.height * 0.058,
width: SizeConfig.screenWidth * 0.2334, width: SizeConfig.screenWidth * 0.2334,
@ -801,7 +446,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
), ),
)), )),
), ),
),
onTap: () { onTap: () {
filterBooking(item.toString()); filterBooking(item.toString());
@ -824,18 +468,11 @@ class _PatientsScreenState extends State<PatientsScreen> {
]); ]);
}).toList(), }).toList(),
), ),
),
); );
} }
myBoxDecoration() {
return BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color(0xffCCCCCC),
width: 0.5,
),
),
);
}
} }

@ -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,8 +54,14 @@ 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: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
},
child: Column(
children: [ children: [
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
@ -61,57 +70,90 @@ class _AdmissionRequestThirdScreenState
children: [ children: [
PatientPageHeaderWidget(patient), PatientPageHeaderWidget(patient),
Container( Container(
margin: EdgeInsets.symmetric( margin:
vertical: 16, horizontal: 16), EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 16, height: 10,
), ),
AppText( Container(
TranslationBase.of(context) child: TextField(
.specialityAndDoctorDetail, decoration: Helpers.textFieldSelectorDecoration(
fontWeight: FontWeight.bold, TranslationBase.of(context).treatmentLine,
fontSize: SizeConfig.textMultiplier * 2.5, 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( SizedBox(
height: 10, 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( SizedBox(
height: 20, height: 10,
), ),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: model.clinicList != null && onTap: model.admissionTypeList != null &&
model.clinicList.length > 0 model.admissionTypeList.length > 0
? () { ? () {
openListDialogField( openListDialogField('nameEn', 'id',
'clinicGroupName', model.admissionTypeList,
'clinicID',
model.clinicList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedClinic = selectedValue; _selectedAdmissionType =
selectedValue;
}); });
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(
context); context);
await model.getClinics().then((_) => await model
.getMasterLookup(MasterKeysService
.AdmissionRequestType)
.then((_) =>
GifLoaderDialogUtils.hideDialog( GifLoaderDialogUtils.hideDialog(
context)); context));
if (model.state == ViewState.Idle && if (model.state == ViewState.Idle &&
model.clinicList.length > 0) { model.admissionTypeList.length > 0) {
openListDialogField( openListDialogField('nameEn', 'id',
'clinicGroupName', model.admissionTypeList,
'clinicID',
model.clinicList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedClinic = _selectedAdmissionType =
selectedValue; selectedValue;
}); });
}); });
@ -125,13 +167,10 @@ class _AdmissionRequestThirdScreenState
} }
}, },
child: TextField( child: TextField(
decoration: decoration: Helpers.textFieldSelectorDecoration(
Helpers.textFieldSelectorDecoration( TranslationBase.of(context).admissionType,
TranslationBase.of(context) _selectedAdmissionType != null
.clinic, ? _selectedAdmissionType['nameEn']
_selectedClinic != null
? _selectedClinic[
'clinicGroupName']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -139,49 +178,43 @@ class _AdmissionRequestThirdScreenState
), ),
), ),
SizedBox( SizedBox(
height: 20, height: 16,
),
AppText(
TranslationBase.of(context).diagnosisDetail,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
), ),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: _selectedClinic != null onTap: model.diagnosisTypesList != null &&
? model.doctorsList != null && model.diagnosisTypesList.length > 0
model.doctorsList.length > 0
? () { ? () {
openListDialogField( openListDialogField('nameEn', 'id',
'DoctorName', model.diagnosisTypesList,
'DoctorID',
model.doctorsList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDoctor = _selectedDiagnosis = selectedValue;
selectedValue;
}); });
}); });
} }
: () async { : () async {
GifLoaderDialogUtils GifLoaderDialogUtils.showMyDialog(
.showMyDialog(context); context);
await model await model.getDiagnosis().then((_) =>
.getClinicDoctors( GifLoaderDialogUtils.hideDialog(
_selectedClinic[
'clinicID'])
.then((_) =>
GifLoaderDialogUtils
.hideDialog(
context)); context));
if (model.state == if (model.state == ViewState.Idle &&
ViewState.Idle && model.diagnosisTypesList.length > 0) {
model.doctorsList.length > openListDialogField('nameEn', 'id',
0) { model.diagnosisTypesList,
openListDialogField(
'DoctorName',
'DoctorID',
model.doctorsList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDoctor = _selectedDiagnosis = selectedValue;
selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state ==
@ -192,16 +225,12 @@ class _AdmissionRequestThirdScreenState
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
"Empty List"); "Empty List");
} }
} },
: null,
child: TextField( child: TextField(
decoration: decoration: Helpers.textFieldSelectorDecoration(
Helpers.textFieldSelectorDecoration( TranslationBase.of(context).diagnosis,
TranslationBase.of(context) _selectedDiagnosis != null
.doctor, ? _selectedDiagnosis['nameEn']
_selectedDoctor != null
? _selectedDoctor[
'DoctorName']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -211,96 +240,75 @@ class _AdmissionRequestThirdScreenState
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppText(
TranslationBase.of(context)
.postPlansEstimatedCost,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container( Container(
height: screenSize.height * 0.070,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.estimatedCost,
null,
false),
enabled: true,
controller: _estimatedCostController,
inputFormatters: [
FilteringTextInputFormatter.allow(
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(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: () { onTap: model.icdCodes != null &&
if (_dischargeDate == null) { model.icdCodes.length > 0
_dischargeDate = DateTime.now(); ? () {
openListDialogField(
'description', 'code', model.icdCodes,
(selectedValue) {
setState(() {
_selectedIcd = selectedValue;
});
});
} }
_selectDate(context, _dischargeDate, : () async {
(picked) { GifLoaderDialogUtils.showMyDialog(
context);
await model
.getICDCodes(patient.patientMRN)
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.icdCodes.length > 0) {
openListDialogField(
'description',
'code',
model.icdCodes, (selectedValue) {
setState(() { setState(() {
_dischargeDate = picked; _selectedIcd = 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).icd,
TranslationBase.of(context) _selectedIcd != null
.expectedAdmissionDate, ? _selectedIcd['description']
_dischargeDate != null
? "${DateUtils.convertStringToDateFormat(_dischargeDate.toString(), "yyyy-MM-dd")}"
: null, : null,
true, true),
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false, enabled: false,
), ),
), ),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
),*/ ),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: model.dietTypesList != null && onTap: model.listOfDiagnosisSelectionTypes !=
model.dietTypesList.length > 0 null &&
model.listOfDiagnosisSelectionTypes
.length >
0
? () { ? () {
openListDialogField('nameEn', 'id', openListDialogField('description', 'code',
model.dietTypesList, model.listOfDiagnosisSelectionTypes,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDietType = _selectedDiagnosisType =
selectedValue; selectedValue;
}); });
}); });
@ -308,17 +316,23 @@ class _AdmissionRequestThirdScreenState
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(
context); context);
await model.getDietTypes().then( await model
(_) => GifLoaderDialogUtils .getMasterLookup(MasterKeysService
.hideDialog(context)); .DiagnosisSelectionType)
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle && if (model.state == ViewState.Idle &&
model.dietTypesList.length > model.listOfDiagnosisSelectionTypes
.length >
0) { 0) {
openListDialogField('nameEn', openListDialogField(
'id', model.dietTypesList, 'description',
'code',
model.listOfDiagnosisSelectionTypes,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDietType = _selectedDiagnosisType =
selectedValue; selectedValue;
}); });
}); });
@ -332,12 +346,10 @@ class _AdmissionRequestThirdScreenState
} }
}, },
child: TextField( child: TextField(
decoration: decoration: Helpers.textFieldSelectorDecoration(
Helpers.textFieldSelectorDecoration( TranslationBase.of(context).diagnoseType,
TranslationBase.of(context) _selectedDiagnosisType != null
.dietType, ? _selectedDiagnosisType['description']
_selectedDietType != null
? _selectedDietType['nameEn']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -347,53 +359,58 @@ class _AdmissionRequestThirdScreenState
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container(
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.dietTypeRemarks,
null,
false),
enabled: true,
controller: _dietTypeRemarksController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
], ],
), ),
), ),
], ],
), ),
), )),
),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton( child: AppButton(
title: TranslationBase.of(context).next, title: TranslationBase.of(context).next,
color: HexColor("#B8382B"), color: HexColor("#B8382B"),
onPressed: () { onPressed: () async {
model.admissionRequestData = AdmissionRequest(); if (_treatmentLineController.text != "" &&
if (_selectedClinic != null && _complicationsController.text != "" &&
_selectedDoctor != null && _otherProceduresController.text != "" &&
_estimatedCostController.text != "" && _selectedAdmissionType != null &&
_postPlansEstimatedCostController.text != "") { _selectedDiagnosis != null &&
model.admissionRequestData.patientMRN = patient.patientMRN; _selectedIcd != null &&
model.admissionRequestData.appointmentNo = patient.appointmentNo; _selectedDiagnosisType != null) {
model.admissionRequestData.episodeID = patient.episodeNo; model.admissionRequestData = admissionRequest;
model.admissionRequestData.admissionRequestNo = 0;
model.admissionRequestData.mainLineOfTreatment =
_treatmentLineController.text;
model.admissionRequestData.complications =
_complicationsController.text;
model.admissionRequestData.otherProcedures =
_otherProceduresController.text;
model.admissionRequestData.admissionType =
_selectedAdmissionType['id'];
dynamic admissionRequestDiagnoses = [
{
'diagnosisDescription': _selectedDiagnosis['nameEn'],
'diagnosisType': _selectedDiagnosis['id'],
'icdCode': _selectedIcd['code'],
'icdCodeDescription': _selectedIcd['description'],
'type': _selectedDiagnosisType['code'],
'remarks': "",
'isActive': true,
}
];
model.admissionRequestData.admissionRequestDiagnoses =
admissionRequestDiagnoses;
model.admissionRequestData.admitToClinic = _selectedClinic['clinicID']; await model.makeAdmissionRequest();
model.admissionRequestData.mrpDoctorID = _selectedDoctor['DoctorID']; if (model.state == ViewState.ErrorLocal) {
model.admissionRequestData.estimatedCost = int.parse(_estimatedCostController.text); DrAppToastMsg.showErrorToast(model.error);
model.admissionRequestData.elementsForImprovement = _postPlansEstimatedCostController.text; } else {
model.admissionRequestData.isDietType = _selectedDietType != null ? true : false; DrAppToastMsg.showSuccesToast(
model.admissionRequestData.dietType = _selectedDietType != null ? _selectedDietType['id'] : 0; TranslationBase.of(context).admissionRequestSuccessMsg);
model.admissionRequestData.dietRemarks = _dietTypeRemarksController.text; Navigator.popUntil(context, ModalRoute.withName(PATIENTS_PROFILE));
Navigator.of(context).pushNamed( }
PATIENT_ADMISSION_REQUEST_2,
arguments: {'patient': patient, 'admission-data' : model.admissionRequestData});
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseFill); TranslationBase.of(context).pleaseFill);
@ -402,26 +419,12 @@ class _AdmissionRequestThirdScreenState
), ),
), ),
], ],
) ),
: Container(), ),
), ),
); );
} }
Future _selectDate(BuildContext context, DateTime dateTime,
Function(DateTime picked) updateDate) async {
final DateTime picked = await showDatePicker(
context: context,
initialDate: dateTime,
firstDate: DateTime.now(),
lastDate: DateTime(2040),
initialEntryMode: DatePickerEntryMode.calendar,
);
if (picked != null && picked != dateTime) {
updateDate(picked);
}
}
void openListDialogField(String attributeName, String attributeValueId, void openListDialogField(String attributeName, String attributeValueId,
List<dynamic> list, Function(dynamic selectedValue) okFunction) { List<dynamic> list, Function(dynamic selectedValue) okFunction) {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(

@ -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) {
@ -64,8 +56,14 @@ class _AdmissionRequestSecondScreenState
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: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
},
child: Column(
children: [ children: [
Expanded( Expanded(
child: SingleChildScrollView( child: SingleChildScrollView(
@ -83,7 +81,8 @@ class _AdmissionRequestSecondScreenState
height: 16, height: 16,
), ),
AppText( AppText(
TranslationBase.of(context).otherInformation, TranslationBase.of(context)
.postPlansEstimatedCost,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
), ),
@ -96,11 +95,11 @@ class _AdmissionRequestSecondScreenState
decoration: decoration:
Helpers.textFieldSelectorDecoration( Helpers.textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
.expectedDays, .estimatedCost,
null, null,
false), false),
enabled: true, enabled: true,
controller: _expectedDaysController, controller: _estimatedCostController,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow( FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS)) RegExp(ONLY_NUMBERS))
@ -111,234 +110,92 @@ class _AdmissionRequestSecondScreenState
height: 10, height: 10,
), ),
Container( Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () {
if (_expectedAdmissionDate == null) {
_expectedAdmissionDate = DateTime.now();
}
_selectDate(
context, _expectedAdmissionDate,
(picked) {
setState(() {
_expectedAdmissionDate = picked;
});
});
},
child: TextField( child: TextField(
decoration: decoration: Helpers.textFieldSelectorDecoration(
Helpers.textFieldSelectorDecoration( TranslationBase.of(context).postPlans,
TranslationBase.of(context) null,
.expectedAdmissionDate, false),
_expectedAdmissionDate != null enabled: true,
? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" controller: _postPlansEstimatedCostController,
: null, keyboardType: TextInputType.text,
true, minLines: 4,
suffixIcon: Icon( maxLines: 6,
Icons.calendar_today,
color: Colors.black,
)), )),
enabled: false,
),
),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
/*
CheckboxListTile(
title: AppText(
TranslationBase.of(context)
.emergencyAdmission,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.1,
),
value: _emergencyAdmission,
onChanged: (newValue) {
setState(() {
_emergencyAdmission = newValue;
});
},
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
*/
CheckboxListTile(
title: AppText(
TranslationBase.of(context)
.isSickLeaveRequired,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.1,
),
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( Container(
child: TextField( child: TextField(
decoration: decoration:
Helpers.textFieldSelectorDecoration( Helpers.textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
.treatmentLine, .otherDepartmentsInterventions,
null, null,
false), false),
enabled: true, enabled: true,
controller: _treatmentLineController, controller:
keyboardType: TextInputType.text, _otherDepartmentsInterventionsController,
minLines: 4, keyboardType: TextInputType.multiline,
maxLines: 6, minLines: 2,
maxLines: 4,
)), )),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppText(
TranslationBase.of(context).otherInformation,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell(
onTap: model.wardList != null &&
model.wardList.length > 0
? () {
openListDialogField('description',
'description', model.wardList,
(selectedValue) {
setState(() {
_selectedWard = selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getWards().then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.wardList.length > 0) {
openListDialogField('description',
'description', model.wardList,
(selectedValue) {
setState(() {
_selectedWard = 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).ward,
_selectedWard != null
? _selectedWard['description']
: null,
true),
enabled: false,
),
),
),
/* CheckboxListTile(
title: AppText(
TranslationBase.of(context) TranslationBase.of(context)
.preAnesthesiaReferred, .expectedDays,
fontWeight: FontWeight.normal, null,
fontSize: SizeConfig.textMultiplier * 2.1, false),
), enabled: true,
value: _preAnesthesiaReferred, controller: _expectedDaysController,
onChanged: (newValue) { inputFormatters: [
setState(() { FilteringTextInputFormatter.allow(
_preAnesthesiaReferred = newValue; RegExp(ONLY_NUMBERS))
}); ],
}, keyboardType: TextInputType.number,
controlAffinity: )),
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),*/
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: model.admissionTypeList != null && onTap: () {
model.admissionTypeList.length > 0 if (_expectedAdmissionDate == null) {
? () { _expectedAdmissionDate = DateTime.now();
openListDialogField('nameEn', 'id',
model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType =
selectedValue;
});
});
} }
: () async { _selectDate(context, _expectedAdmissionDate,
GifLoaderDialogUtils.showMyDialog( (picked) {
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(() { setState(() {
_selectedAdmissionType = _expectedAdmissionDate = picked;
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) TranslationBase.of(context)
.admissionType, .expectedAdmissionDate,
_selectedAdmissionType != null _expectedAdmissionDate != null
? _selectedAdmissionType[ ? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}"
'nameEn']
: null, : null,
true), true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false, enabled: false,
), ),
), ),
@ -346,50 +203,34 @@ class _AdmissionRequestSecondScreenState
SizedBox( SizedBox(
height: 10, height: 10,
), ),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).diagnosisDetail,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: model.diagnosisTypesList != null && onTap: model.floorList != null &&
model.diagnosisTypesList.length > 0 model.floorList.length > 0
? () { ? () {
openListDialogField('nameEn', 'id', openListDialogField(
model.diagnosisTypesList, 'description',
(selectedValue) { 'floorID',
model.floorList, (selectedValue) {
setState(() { setState(() {
_selectedDiagnosis = _selectedFloor = selectedValue;
selectedValue;
}); });
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(
context); context);
await model.getDiagnosis().then( await model.getFloors().then((_) =>
(_) => GifLoaderDialogUtils GifLoaderDialogUtils.hideDialog(
.hideDialog(context)); context));
if (model.state == ViewState.Idle && if (model.state == ViewState.Idle &&
model.diagnosisTypesList model.floorList.length > 0) {
.length > openListDialogField('description',
0) { 'floorID', model.floorList,
openListDialogField(
'nameEn',
'id',
model.diagnosisTypesList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDiagnosis = _selectedFloor = selectedValue;
selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state ==
@ -404,10 +245,9 @@ class _AdmissionRequestSecondScreenState
child: TextField( child: TextField(
decoration: decoration:
Helpers.textFieldSelectorDecoration( Helpers.textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context).floor,
.diagnosis, _selectedFloor != null
_selectedDiagnosis != null ? _selectedFloor['description']
? _selectedDiagnosis['nameEn']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -420,32 +260,33 @@ class _AdmissionRequestSecondScreenState
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: model.icdCodes != null && onTap: model.wardList != null &&
model.icdCodes.length > 0 model.wardList.length > 0
? () { ? () {
openListDialogField('description', openListDialogField(
'code', model.icdCodes, 'description',
(selectedValue) { 'nursingStationID',
model.wardList, (selectedValue) {
setState(() { setState(() {
_selectedIcd = selectedValue; _selectedWard = selectedValue;
}); });
}); });
} }
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(
context); context);
await model await model.getWards().then((_) =>
.getICDCodes(patient.patientMRN) GifLoaderDialogUtils.hideDialog(
.then((_) => context));
GifLoaderDialogUtils
.hideDialog(context));
if (model.state == ViewState.Idle && if (model.state == ViewState.Idle &&
model.icdCodes.length > 0) { model.wardList.length > 0) {
openListDialogField('description', openListDialogField(
'code', model.icdCodes, 'description',
'nursingStationID',
model.wardList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedIcd = selectedValue; _selectedWard = selectedValue;
}); });
}); });
} else if (model.state == } else if (model.state ==
@ -460,9 +301,9 @@ class _AdmissionRequestSecondScreenState
child: TextField( child: TextField(
decoration: decoration:
Helpers.textFieldSelectorDecoration( Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).icd, TranslationBase.of(context).ward,
_selectedIcd != null _selectedWard != null
? _selectedIcd['description'] ? _selectedWard['description']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -475,20 +316,16 @@ class _AdmissionRequestSecondScreenState
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: model.listOfDiagnosisSelectionTypes != onTap: model.roomCategoryList != null &&
null && model.roomCategoryList.length > 0
model.listOfDiagnosisSelectionTypes
.length >
0
? () { ? () {
openListDialogField( openListDialogField(
'description', 'description',
'code', 'categoryID',
model model.roomCategoryList,
.listOfDiagnosisSelectionTypes,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDiagnosisType = _selectedRoomCategory =
selectedValue; selectedValue;
}); });
}); });
@ -496,25 +333,19 @@ class _AdmissionRequestSecondScreenState
: () async { : () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(
context); context);
await model await model.getRoomCategories().then(
.getMasterLookup( (_) => GifLoaderDialogUtils
MasterKeysService
.DiagnosisSelectionType)
.then((_) =>
GifLoaderDialogUtils
.hideDialog(context)); .hideDialog(context));
if (model.state == ViewState.Idle && if (model.state == ViewState.Idle &&
model.listOfDiagnosisSelectionTypes model.roomCategoryList.length >
.length >
0) { 0) {
openListDialogField( openListDialogField(
'description', 'description',
'code', 'categoryID',
model model.roomCategoryList,
.listOfDiagnosisSelectionTypes,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDiagnosisType = _selectedRoomCategory =
selectedValue; selectedValue;
}); });
}); });
@ -531,9 +362,9 @@ class _AdmissionRequestSecondScreenState
decoration: decoration:
Helpers.textFieldSelectorDecoration( Helpers.textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
.diagnoseType, .roomCategory,
_selectedDiagnosisType != null _selectedRoomCategory != null
? _selectedDiagnosisType[ ? _selectedRoomCategory[
'description'] 'description']
: null, : null,
true), true),
@ -544,73 +375,6 @@ class _AdmissionRequestSecondScreenState
SizedBox( SizedBox(
height: 10, 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,
),
),
),*/
], ],
), ),
), ),
@ -621,44 +385,47 @@ class _AdmissionRequestSecondScreenState
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton( child: AppButton(
title: TranslationBase.of(context).save, title: TranslationBase.of(context).next,
color: HexColor("#B8382B"), color: HexColor("#B8382B"),
onPressed: () async { onPressed: () async {
if (_expectedDaysController.text != "" && if (_estimatedCostController.text != "" &&
_postPlansEstimatedCostController.text != "" &&
_expectedDaysController.text != "" &&
_expectedAdmissionDate != null && _expectedAdmissionDate != null &&
_treatmentLineController.text != "" && _otherDepartmentsInterventionsController.text != "" &&
_selectedWard != null && _selectedFloor != null &&
_selectedAdmissionType != null && _selectedRoomCategory !=
_selectedDiagnosis != null && null /*_selectedWard is not required*/) {
_selectedIcd != null &&
_selectedDiagnosisType != null) {
model.admissionRequestData = admissionRequest; 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: {
'patient': patient,
'admission-data': model.admissionRequestData
});
} else { } else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseFill); TranslationBase.of(context).pleaseFill);
@ -667,9 +434,8 @@ class _AdmissionRequestSecondScreenState
), ),
), ),
], ],
)
: 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,7 +37,24 @@ class _LabResultState extends State<LabResult> {
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
CardWithBgWidgetNew( CardWithBgWidgetNew(
widget: Row( widget: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).orderNo,
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${widget.labOrders.orderNo}',
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
@ -52,6 +69,9 @@ class _LabResultState extends State<LabResult> {
), ),
], ],
), ),
],
),
), ),
CardWithBgWidgetNew( CardWithBgWidgetNew(
widget: LabResultWidget( widget: LabResultWidget(

@ -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,12 +183,14 @@ class PatientReferralItemWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
AppText( Expanded(
child: AppText(
remark, remark,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
),
], ],
), ),
SizedBox( SizedBox(

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