merge-requests/301/head
Sultan Khan 5 years ago
commit f0539860c2

@ -25,6 +25,7 @@ const PATIENT_GET_LIST_REFERAL_URL =
const PATIENT_GET_CLINIC_BY_PROJECT_URL = const PATIENT_GET_CLINIC_BY_PROJECT_URL =
"Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; "Services/DoctorApplication.svc/REST/GetClinicsByProjectID";
const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo";
const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics";
//const GET_PROJECTS = 'Services/Lists.svc/REST/GetProjectForDoctorAPP'; //const GET_PROJECTS = 'Services/Lists.svc/REST/GetProjectForDoctorAPP';
const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo';
@ -71,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';
@ -191,8 +192,13 @@ 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_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes';
const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest';
var selectedPatientType = 1; var selectedPatientType = 1;

@ -425,7 +425,8 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "Expected Admission Date", 'en': "Expected Admission Date",
'ar': 'تاريخ القبول المتوقع' 'ar': 'تاريخ القبول المتوقع'
}, },
'emergencyAdmission': {'en': "EMERGENCY ADMISSION", 'ar': 'دخول الطوارئ'}, // 'emergencyAdmission': {'en': "EMERGENCY ADMISSION", 'ar': 'دخول الطوارئ'},
'isSickLeaveRequired': {'en': "Is Sick Leave Required", 'ar': 'هل الإجازة المرضية مطلوبة'},
'patientPregnant': {'en': "Patient Pregnant", 'ar': 'حمل المريض'}, 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'حمل المريض'},
'treatmentLine': { 'treatmentLine': {
'en': "Main line of treatment", 'en': "Main line of treatment",
@ -458,6 +459,10 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "POST PLANS & ESTIMATED COST", 'en': "POST PLANS & ESTIMATED COST",
'ar': 'خطط البريد والتكلفة المقدرة' 'ar': 'خطط البريد والتكلفة المقدرة'
}, },
'postPlans': {
'en': "POST PLANS",
'ar': 'خطط البريد'
},
'ucaf': {'en': "UCAF", 'ar': 'UCAF'}, 'ucaf': {'en': "UCAF", 'ar': 'UCAF'},
'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'}, 'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'},
'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'}, 'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'},
@ -530,6 +535,7 @@ const Map<String, Map<String, String>> localizedValues = {
'condition': {'en': "Condition", 'ar': "الحالة"}, 'condition': {'en': "Condition", 'ar': "الحالة"},
'id': {'en': "ID", 'ar': "بطاقة هوية"}, 'id': {'en': "ID", 'ar': "بطاقة هوية"},
'quantity': {'en': "Quantity", 'ar': "الكمية"}, 'quantity': {'en': "Quantity", 'ar': "الكمية"},
'durDays': {'en': "Dur.(days)", 'ar': "الفترة(أيام)"},
'codeNo': {'en': "Code #", 'ar': "# الرمز"}, 'codeNo': {'en': "Code #", 'ar': "# الرمز"},
'covered': {'en': "Covered", 'ar': "مغطى"}, 'covered': {'en': "Covered", 'ar': "مغطى"},
'approvalRequired': {'en': "Approval Required", 'ar': "الموافقة مطلوبة"}, 'approvalRequired': {'en': "Approval Required", 'ar': "الموافقة مطلوبة"},
@ -592,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": "كتلة"},
@ -688,5 +695,20 @@ const Map<String, Map<String, String>> localizedValues = {
'clinicSearch': {'en': "Search Clinic", 'ar': "بحث عن عيادة"}, 'clinicSearch': {'en': "Search Clinic", 'ar': "بحث عن عيادة"},
'doctorSearch': {'en': "Search Doctor", 'ar': "بحث عن طبيب"}, 'doctorSearch': {'en': "Search Doctor", 'ar': "بحث عن طبيب"},
'referralResponse': {'en': "Referral Response : ", 'ar': " : استجابة الإحالة"},
'estimatedCost': {'en': "Estimated Cost", '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': "رقم الطلب"},
}; };

@ -21,6 +21,7 @@ enum MasterKeysService {
MedicationIndications, MedicationIndications,
AdmissionRequestType, AdmissionRequestType,
DiagnosisSelectionType,
} }
extension SelectedMasterKeysService on MasterKeysService { extension SelectedMasterKeysService on MasterKeysService {
@ -86,6 +87,9 @@ extension SelectedMasterKeysService on MasterKeysService {
case MasterKeysService.AdmissionRequestType: case MasterKeysService.AdmissionRequestType:
return 2019; return 2019;
break; break;
case MasterKeysService.DiagnosisSelectionType:
return 2024;
break;
} }
} }
} }

@ -0,0 +1,200 @@
class AdmissionRequest {
int patientMRN;
int admitToClinic;
bool isPregnant;
int pregnancyWeeks;
int pregnancyType;
int noOfBabies;
int mrpDoctorID;
String admissionDate;
int expectedDays;
int admissionType;
int admissionLocationID;
int roomCategoryID;
int wardID;
bool isSickLeaveRequired;
String sickLeaveComments;
bool isTransport;
String transportComments;
bool isPhysioAppointmentNeeded;
String physioAppointmentComments;
bool isOPDFollowupAppointmentNeeded;
String opdFollowUpComments;
bool isDietType;
int dietType;
String dietRemarks;
bool isPhysicalActivityModification;
String physicalActivityModificationComments;
int orStatus;
String mainLineOfTreatment;
int estimatedCost;
String elementsForImprovement;
bool isPackagePatient;
String complications;
String otherDepartmentInterventions;
String otherProcedures;
String pastMedicalHistory;
String pastSurgicalHistory;
List<dynamic> admissionRequestDiagnoses;
List<dynamic> admissionRequestProcedures;
int appointmentNo;
int episodeID;
int admissionRequestNo;
AdmissionRequest(
{this.patientMRN,
this.admitToClinic,
this.isPregnant,
this.pregnancyWeeks = 0,
this.pregnancyType = 0,
this.noOfBabies = 0,
this.mrpDoctorID,
this.admissionDate,
this.expectedDays,
this.admissionType,
this.admissionLocationID = 0,
this.roomCategoryID = 0,
this.wardID,
this.isSickLeaveRequired,
this.sickLeaveComments = "",
this.isTransport = false,
this.transportComments = "",
this.isPhysioAppointmentNeeded = false,
this.physioAppointmentComments = "",
this.isOPDFollowupAppointmentNeeded = false,
this.opdFollowUpComments = "",
this.isDietType,
this.dietType,
this.dietRemarks,
this.isPhysicalActivityModification = false,
this.physicalActivityModificationComments = "",
this.orStatus = 1,
this.mainLineOfTreatment,
this.estimatedCost,
this.elementsForImprovement,
this.isPackagePatient = false,
this.complications = "",
this.otherDepartmentInterventions = "",
this.otherProcedures = "",
this.pastMedicalHistory = "",
this.pastSurgicalHistory = "",
this.admissionRequestDiagnoses,
this.admissionRequestProcedures,
this.appointmentNo,
this.episodeID,
this.admissionRequestNo});
AdmissionRequest.fromJson(Map<String, dynamic> json) {
patientMRN = json['patientMRN'];
admitToClinic = json['admitToClinic'];
isPregnant = json['isPregnant'];
pregnancyWeeks = json['pregnancyWeeks'];
pregnancyType = json['pregnancyType'];
noOfBabies = json['noOfBabies'];
mrpDoctorID = json['mrpDoctorID'];
admissionDate = json['admissionDate'];
expectedDays = json['expectedDays'];
admissionType = json['admissionType'];
admissionLocationID = json['admissionLocationID'];
roomCategoryID = json['roomCategoryID'];
wardID = json['wardID'];
isSickLeaveRequired = json['isSickLeaveRequired'];
sickLeaveComments = json['sickLeaveComments'];
isTransport = json['isTransport'];
transportComments = json['transportComments'];
isPhysioAppointmentNeeded = json['isPhysioAppointmentNeeded'];
physioAppointmentComments = json['physioAppointmentComments'];
isOPDFollowupAppointmentNeeded = json['isOPDFollowupAppointmentNeeded'];
opdFollowUpComments = json['opdFollowUpComments'];
isDietType = json['isDietType'];
dietType = json['dietType'];
dietRemarks = json['dietRemarks'];
isPhysicalActivityModification = json['isPhysicalActivityModification'];
physicalActivityModificationComments =
json['physicalActivityModificationComments'];
orStatus = json['orStatus'];
mainLineOfTreatment = json['mainLineOfTreatment'];
estimatedCost = json['estimatedCost'];
elementsForImprovement = json['elementsForImprovement'];
isPackagePatient = json['isPackagePatient'];
complications = json['complications'];
otherDepartmentInterventions = json['otherDepartmentInterventions'];
otherProcedures = json['otherProcedures'];
pastMedicalHistory = json['pastMedicalHistory'];
pastSurgicalHistory = json['pastSurgicalHistory'];
if (json['admissionRequestDiagnoses'] != null) {
admissionRequestDiagnoses = new List<dynamic>();
json['admissionRequestDiagnoses'].forEach((v) {
admissionRequestDiagnoses.add(v);
// admissionRequestDiagnoses
// .add(new AdmissionRequestDiagnoses.fromJson(v));
});
}
if (json['admissionRequestProcedures'] != null) {
admissionRequestProcedures = new List<dynamic>();
json['admissionRequestProcedures'].forEach((v) {
admissionRequestProcedures.add(v);
// admissionRequestProcedures
// .add(new AdmissionRequestProcedures.fromJson(v));
});
}
appointmentNo = json['appointmentNo'];
episodeID = json['episodeID'];
admissionRequestNo = json['admissionRequestNo'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['patientMRN'] = this.patientMRN;
data['admitToClinic'] = this.admitToClinic;
data['isPregnant'] = this.isPregnant;
data['pregnancyWeeks'] = this.pregnancyWeeks;
data['pregnancyType'] = this.pregnancyType;
data['noOfBabies'] = this.noOfBabies;
data['mrpDoctorID'] = this.mrpDoctorID;
data['admissionDate'] = this.admissionDate;
data['expectedDays'] = this.expectedDays;
data['admissionType'] = this.admissionType;
data['admissionLocationID'] = this.admissionLocationID;
data['roomCategoryID'] = this.roomCategoryID;
data['wardID'] = this.wardID;
data['isSickLeaveRequired'] = this.isSickLeaveRequired;
data['sickLeaveComments'] = this.sickLeaveComments;
data['isTransport'] = this.isTransport;
data['transportComments'] = this.transportComments;
data['isPhysioAppointmentNeeded'] = this.isPhysioAppointmentNeeded;
data['physioAppointmentComments'] = this.physioAppointmentComments;
data['isOPDFollowupAppointmentNeeded'] =
this.isOPDFollowupAppointmentNeeded;
data['opdFollowUpComments'] = this.opdFollowUpComments;
data['isDietType'] = this.isDietType;
data['dietType'] = this.dietType;
data['dietRemarks'] = this.dietRemarks;
data['isPhysicalActivityModification'] =
this.isPhysicalActivityModification;
data['physicalActivityModificationComments'] =
this.physicalActivityModificationComments;
data['orStatus'] = this.orStatus;
data['mainLineOfTreatment'] = this.mainLineOfTreatment;
data['estimatedCost'] = this.estimatedCost;
data['elementsForImprovement'] = this.elementsForImprovement;
data['isPackagePatient'] = this.isPackagePatient;
data['complications'] = this.complications;
data['otherDepartmentInterventions'] = this.otherDepartmentInterventions;
data['otherProcedures'] = this.otherProcedures;
data['pastMedicalHistory'] = this.pastMedicalHistory;
data['pastSurgicalHistory'] = this.pastSurgicalHistory;
if (this.admissionRequestDiagnoses != null) {
data['admissionRequestDiagnoses'] = this.admissionRequestDiagnoses;
// this.admissionRequestDiagnoses.map((v) => v.toJson()).toList();
}
if (this.admissionRequestProcedures != null) {
data['admissionRequestProcedures'] =
this.admissionRequestProcedures.map((v) => v.toJson()).toList();
}
data['appointmentNo'] = this.appointmentNo;
data['episodeID'] = this.episodeID;
data['admissionRequestNo'] = this.admissionRequestNo;
return data;
}
}

@ -0,0 +1,33 @@
class Clinic {
int clinicGroupID;
String clinicGroupName;
int clinicID;
String clinicNameArabic;
String clinicNameEnglish;
Clinic(
{this.clinicGroupID,
this.clinicGroupName,
this.clinicID,
this.clinicNameArabic,
this.clinicNameEnglish});
Clinic.fromJson(Map<String, dynamic> json) {
clinicGroupID = json['clinicGroupID'];
clinicGroupName = json['clinicGroupName'];
clinicID = json['clinicID'];
clinicNameArabic = json['clinicNameArabic'];
clinicNameEnglish = json['clinicNameEnglish'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['clinicGroupID'] = this.clinicGroupID;
data['clinicGroupName'] = this.clinicGroupName;
data['clinicID'] = this.clinicID;
data['clinicNameArabic'] = this.clinicNameArabic;
data['clinicNameEnglish'] = this.clinicNameEnglish;
return data;
}
}

@ -57,6 +57,8 @@ class EntityList {
dynamic status; dynamic status;
dynamic stopDate; dynamic stopDate;
dynamic uom; dynamic uom;
dynamic pharmacistRemarks;
dynamic refill;
EntityList( EntityList(
{this.appointmentNo, {this.appointmentNo,
@ -87,7 +89,9 @@ class EntityList {
this.startDate, this.startDate,
this.status, this.status,
this.stopDate, this.stopDate,
this.uom}); this.uom,
this.pharmacistRemarks,
this.refill});
EntityList.fromJson(Map<String, dynamic> json) { EntityList.fromJson(Map<String, dynamic> json) {
appointmentNo = json['appointmentNo']; appointmentNo = json['appointmentNo'];
@ -119,6 +123,8 @@ class EntityList {
status = json['status']; status = json['status'];
stopDate = json['stopDate']; stopDate = json['stopDate'];
uom = json['uom']; uom = json['uom'];
pharmacistRemarks = json['pharmacistRemarks'];
refill = json['refill'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -152,6 +158,8 @@ class EntityList {
data['status'] = this.status; data['status'] = this.status;
data['stopDate'] = this.stopDate; data['stopDate'] = this.stopDate;
data['uom'] = this.uom; data['uom'] = this.uom;
data['pharmacistRemarks'] = this.pharmacistRemarks;
data['refill'] = this.refill;
return data; return data;
} }
} }

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -17,6 +18,7 @@ class LookupService extends BaseService {
List<dynamic> medicationFrequencyList = []; List<dynamic> medicationFrequencyList = [];
List<dynamic> medicationDoseTimeList = []; List<dynamic> medicationDoseTimeList = [];
List<dynamic> medicationIndicationsList = []; List<dynamic> medicationIndicationsList = [];
List<GetAssessmentResModel> patientAssessmentList = [];
List<MasterKeyModel> get historyFamilyList => _historyFamilyList; List<MasterKeyModel> get historyFamilyList => _historyFamilyList;
List<MasterKeyModel> _historyFamilyList = []; List<MasterKeyModel> _historyFamilyList = [];
@ -45,6 +47,7 @@ class LookupService extends BaseService {
List<MasterKeyModel> listOfTemperatureMethods = []; List<MasterKeyModel> listOfTemperatureMethods = [];
List<MasterKeyModel> listOfSpeciality = []; List<MasterKeyModel> listOfSpeciality = [];
List<dynamic> listOfAdmissionType = []; List<dynamic> listOfAdmissionType = [];
List<dynamic> listOfDiagnosisSelectionTypes = [];
Future getMasterLookup(MasterKeysService masterKeys) async { Future getMasterLookup(MasterKeysService masterKeys) async {
hasError = false; hasError = false;
@ -191,6 +194,13 @@ class LookupService extends BaseService {
listOfAdmissionType.add(v); listOfAdmissionType.add(v);
}); });
break; break;
case MasterKeysService.DiagnosisSelectionType:
listOfDiagnosisSelectionTypes.clear();
entryList.forEach((v) {
// listOfAdmissionType.add(MasterKeyModel.fromJson(v));
listOfDiagnosisSelectionTypes.add(v);
});
break;
} }
} }
} }

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/doctor/request_schedule.dart'; import 'package:doctor_app_flutter/models/doctor/request_schedule.dart';
import 'package:doctor_app_flutter/models/pharmacies/pharmacies_List_request_model.dart'; import 'package:doctor_app_flutter/models/pharmacies/pharmacies_List_request_model.dart';
import 'package:doctor_app_flutter/models/pharmacies/pharmacies_items_request_model.dart'; import 'package:doctor_app_flutter/models/pharmacies/pharmacies_items_request_model.dart';
@ -10,6 +12,8 @@ class MedicineService extends BaseService {
get pharmacyItemsList => _pharmacyItemsList; get pharmacyItemsList => _pharmacyItemsList;
get pharmaciesList => _pharmaciesList; get pharmaciesList => _pharmaciesList;
List<GetAssessmentResModel> patientAssessmentList = [];
PharmaciesItemsRequestModel _itemsRequestModel = PharmaciesItemsRequestModel _itemsRequestModel =
PharmaciesItemsRequestModel(); PharmaciesItemsRequestModel();
PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel(); PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel();

@ -1,14 +1,21 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/ward-model.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/ward-model.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class AdmissionRequestService extends LookupService { class AdmissionRequestService extends LookupService {
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> icdCodes = [];
setSpecialityList() { setSpecialityList() {
specialityList.clear(); specialityList.clear();
@ -24,9 +31,12 @@ class AdmissionRequestService extends LookupService {
}); });
} }
Future getDoctorsList() async { Future getDoctorsList(int clinicId) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map();
body['ClinicID'] = clinicId;
await baseAppClient.post( await baseAppClient.post(
PATIENT_GET_DOCTOR_BY_CLINIC_URL, PATIENT_GET_DOCTOR_BY_CLINIC_URL,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
@ -37,6 +47,48 @@ class AdmissionRequestService extends LookupService {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, },
body: body,
);
}
Future getClinics() async {
hasError = false;
await baseAppClient.post(
GET_CLINICS,
onSuccess: (dynamic response, int statusCode) {
clinicList.clear();
if (response['listClinics'] != null &&
response['listClinics']['entityList'] != null) {
clinicList.addAll(response['listClinics']['entityList']);
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: Map(),
);
}
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(), body: Map(),
); );
} }
@ -64,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;
@ -86,4 +160,74 @@ class AdmissionRequestService extends LookupService {
body: Map(), body: Map(),
); );
} }
Future getDietTypesList() async {
hasError = false;
await baseAppClient.post(
GET_DIET_TYPES,
onSuccess: (dynamic response, int statusCode) {
dietTypesList.clear();
if (response['DietTypeList'] != null &&
response['DietTypeList']['entityList'] != null) {
response['DietTypeList']['entityList'].forEach((v) {
// diagnosisTypesList.add(MasterKeyModel.fromJson(v));
dietTypesList.add(v);
});
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: Map(),
);
}
Future getICDCodes(int patientMrn) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patientMrn;
body['isPatientDiagnosisOnly'] = true;
await baseAppClient.post(
GET_ICD_CODES,
onSuccess: (dynamic response, int statusCode) {
icdCodes.clear();
if (response['ICDCodesList'] != null) {
icdCodes.addAll(response['ICDCodesList']);
// response['ICDCodesList'].forEach((v) {
// diagnosisTypesList.add(MasterKeyModel.fromJson(v));
// icdCodes.add(v);
// });
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
}
Future makeAdmissionRequest(AdmissionRequest admissionRequest) async{
hasError = false;
Map<String, dynamic> body = Map();
body['AdmissionRequestViewModel'] = admissionRequest.toJson();
await baseAppClient.post(
POST_ADMISSION_REQUEST,
onSuccess: (dynamic response, int statusCode) {
print(response["admissionResponse"]["success"]);
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
}
} }

@ -197,17 +197,19 @@ class PatientReferralService extends LookupService {
DoctorProfileModel doctorProfile = await getDoctorProfile(); DoctorProfileModel doctorProfile = await getDoctorProfile();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['IsAccepted'] = isAccepted;
body['AppointmentNo'] = pendingReferral.sourceAppointmentNo;
body['PatientMRN'] = pendingReferral.patientID; body['PatientMRN'] = pendingReferral.patientID;
body['AppointmentNo'] = pendingReferral.sourceAppointmentNo;
body['SetupID'] = pendingReferral.sourceSetupID;
body['ProjectID'] = pendingReferral.sourceProjectId;
body['IsAccepted'] = isAccepted;
body['PatientName'] = pendingReferral.patientName; body['PatientName'] = pendingReferral.patientName;
body['ReferralResponse'] = pendingReferral.remarksFromSource; body['ReferralResponse'] = pendingReferral.remarksFromSource;
body['SetupID'] = pendingReferral.sourceSetupID;
body['DoctorName'] = doctorProfile.doctorName; body['DoctorName'] = doctorProfile.doctorName;
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;

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/prescription_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart';
@ -14,6 +15,7 @@ class UcafService extends LookupService {
VitalSignData patientVitalSigns; VitalSignData patientVitalSigns;
List<GetAssessmentResModel> patientAssessmentList = []; List<GetAssessmentResModel> patientAssessmentList = [];
List<OrderProcedure> orderProcedureList = []; List<OrderProcedure> orderProcedureList = [];
PrescriptionModel prescriptionList;
Future getPatientChiefComplaint(PatiantInformtion patient) async { Future getPatientChiefComplaint(PatiantInformtion patient) async {
hasError = false; hasError = false;
@ -81,6 +83,25 @@ class UcafService extends LookupService {
}, body: body); }, body: body);
} }
Future getPrescription(PatiantInformtion patient) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = patient.episodeNo;
hasError = false;
prescriptionList = null;
await baseAppClient.post(GET_PRESCRIPTION_LIST,
onSuccess: (dynamic response, int statusCode) {
prescriptionList = PrescriptionModel.fromJson(response['PrescriptionList']);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getOrderProcedures(PatiantInformtion patient) async { Future getOrderProcedures(PatiantInformtion patient) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();

@ -8,6 +8,8 @@ import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
@ -30,6 +32,21 @@ class PrescriptionService extends LookupService {
PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel _postPrescriptionReqModel =
PostPrescriptionReqModel(); PostPrescriptionReqModel();
Future getPatientAssessment(
GetAssessmentReqModel getAssessmentReqModel) async {
hasError = false;
await baseAppClient.post(GET_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientAssessmentList.clear();
response['AssessmentList']['entityList'].forEach((v) {
patientAssessmentList.add(GetAssessmentResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getAssessmentReqModel.toJson());
}
Future getPrescription({int mrn}) async { Future getPrescription({int mrn}) async {
_prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn); _prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn);

@ -4,6 +4,8 @@ import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart
import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; import 'package:doctor_app_flutter/core/service/SOAP_service.dart';
import 'package:doctor_app_flutter/core/service/medicine_service.dart'; import 'package:doctor_app_flutter/core/service/medicine_service.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
@ -28,6 +30,8 @@ class MedicineViewModel extends BaseViewModel {
_prescriptionService.medicationIndicationsList; _prescriptionService.medicationIndicationsList;
get medicationDoseTimeList => _prescriptionService.medicationDoseTimeList; get medicationDoseTimeList => _prescriptionService.medicationDoseTimeList;
List<GetAssessmentResModel> get patientAssessmentList =>
_prescriptionService.patientAssessmentList;
List<GetMedicationResponseModel> get allMedicationList => List<GetMedicationResponseModel> get allMedicationList =>
_prescriptionService.allMedicationList; _prescriptionService.allMedicationList;
@ -52,6 +56,17 @@ class MedicineViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getPatientAssessment(
GetAssessmentReqModel getAssessmentReqModel) async {
setState(ViewState.Busy);
await _prescriptionService.getPatientAssessment(getAssessmentReqModel);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getMedicationStrength() async { Future getMedicationStrength() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService await _prescriptionService

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart';
import 'package:doctor_app_flutter/core/model/admissionRequest/ward-model.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/ward-model.dart';
import 'package:doctor_app_flutter/core/service/patient-admission-request-service.dart'; import 'package:doctor_app_flutter/core/service/patient-admission-request-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
@ -12,45 +13,72 @@ class AdmissionRequestViewModel extends BaseViewModel{
AdmissionRequestService _admissionRequestService = locator<AdmissionRequestService>(); AdmissionRequestService _admissionRequestService = locator<AdmissionRequestService>();
List<dynamic> get clinicList => _admissionRequestService.clinicList;
List<dynamic> get doctorsList => _admissionRequestService.doctorsList; List<dynamic> get doctorsList => _admissionRequestService.doctorsList;
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;
List<dynamic> get allergiesList => _admissionRequestService.allergiesLookupList; List<dynamic> get allergiesList => _admissionRequestService.allergiesLookupList;
String selectedLanguage; List<dynamic> get dietTypesList => _admissionRequestService.dietTypesList;
Future getLanguage() async { List<dynamic> get icdCodes => _admissionRequestService.icdCodes;
selectedLanguage = await sharedPref.getString(APP_Language);
} List<dynamic> get listOfDiagnosisSelectionTypes => _admissionRequestService.listOfDiagnosisSelectionTypes;
AdmissionRequest admissionRequestData;
Future getSpecialityList() async { Future getSpecialityList() async {
await getLanguage();
await getMasterLookup(MasterKeysService.Speciality); await getMasterLookup(MasterKeysService.Speciality);
if (!_admissionRequestService.hasError) { if (!_admissionRequestService.hasError) {
_admissionRequestService.setSpecialityList(); _admissionRequestService.setSpecialityList();
await getClinicDoctors(); await getClinicDoctors(1);
} }
} }
Future getClinicDoctors() async { Future getClinics() async {
setState(ViewState.Busy); setState(ViewState.BusyLocal);
await _admissionRequestService.getDoctorsList(); await _admissionRequestService.getClinics();
if (_admissionRequestService.hasError) { if (_admissionRequestService.hasError) {
error = _admissionRequestService.error; error = _admissionRequestService.error;
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getClinicDoctors(int clinicId) async {
setState(ViewState.BusyLocal);
await _admissionRequestService.getDoctorsList(clinicId);
if (_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getFloors() async {
setState(ViewState.BusyLocal);
await _admissionRequestService.getFloors();
if (_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getWards() async { Future getWards() async {
setState(ViewState.Busy); setState(ViewState.BusyLocal);
await _admissionRequestService.getWardList(); await _admissionRequestService.getWardList();
if (_admissionRequestService.hasError) { if (_admissionRequestService.hasError) {
error = _admissionRequestService.error; error = _admissionRequestService.error;
@ -59,8 +87,18 @@ 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.Busy); setState(ViewState.BusyLocal);
await _admissionRequestService.getDiagnosisTypesList(); await _admissionRequestService.getDiagnosisTypesList();
if (_admissionRequestService.hasError) { if (_admissionRequestService.hasError) {
error = _admissionRequestService.error; error = _admissionRequestService.error;
@ -76,8 +114,38 @@ class AdmissionRequestViewModel extends BaseViewModel{
} }
} }
Future getMasterLookup(MasterKeysService keysService) async { Future getDietTypes() async {
setState(ViewState.BusyLocal);
await _admissionRequestService.getDietTypesList();
if (_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getICDCodes(int patientMrn) async {
setState(ViewState.BusyLocal);
await _admissionRequestService.getICDCodes(patientMrn);
if (_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future makeAdmissionRequest() async{
setState(ViewState.Busy); setState(ViewState.Busy);
await _admissionRequestService.makeAdmissionRequest(admissionRequestData);
if (_admissionRequestService.hasError) {
error = _admissionRequestService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getMasterLookup(MasterKeysService keysService) async {
setState(ViewState.BusyLocal);
await _admissionRequestService.getMasterLookup(keysService); await _admissionRequestService.getMasterLookup(keysService);
if (_admissionRequestService.hasError) { if (_admissionRequestService.hasError) {
error = _admissionRequestService.error; error = _admissionRequestService.error;

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/prescription_model.dart';
import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart'; import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
@ -29,10 +30,18 @@ class UcafViewModel extends BaseViewModel {
List<MasterKeyModel> get diagnosisConditions => List<MasterKeyModel> get diagnosisConditions =>
_ucafService.listOfDiagnosisCondition; _ucafService.listOfDiagnosisCondition;
PrescriptionModel get prescriptionList => _ucafService.prescriptionList;
List<OrderProcedure> get orderProcedures => _ucafService.orderProcedureList; List<OrderProcedure> get orderProcedures => _ucafService.orderProcedureList;
String selectedLanguage; String selectedLanguage;
resetDataInFirst(){
_ucafService.patientAssessmentList = [];
_ucafService.orderProcedureList = [];
_ucafService.prescriptionList = null;
}
Future getLanguage() async { Future getLanguage() async {
selectedLanguage = await sharedPref.getString(APP_Language); selectedLanguage = await sharedPref.getString(APP_Language);
} }
@ -90,6 +99,19 @@ class UcafViewModel extends BaseViewModel {
} }
} }
Future getPrescription(PatiantInformtion patient) async {
if (prescriptionList == null) {
setState(ViewState.Busy);
await _ucafService.getPrescription(patient);
if (_ucafService.hasError) {
error = _ucafService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}
MasterKeyModel findMasterDataById( MasterKeyModel findMasterDataById(
{@required MasterKeysService masterKeys, dynamic id}) { {@required MasterKeysService masterKeys, dynamic id}) {
switch (masterKeys) { switch (masterKeys) {

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

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

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

@ -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,9 +138,10 @@ var routes = {
PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(),
VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(),
PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(),
PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestDetailScreen(), 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(),
CREATE_EPISODE: (_) => UpdateSoapIndex(isUpdate: true,), CREATE_EPISODE: (_) => UpdateSoapIndex(isUpdate: true,),
UPDATE_EPISODE: (_) => UpdateSoapIndex( UPDATE_EPISODE: (_) => UpdateSoapIndex(
isUpdate: true, isUpdate: true,

@ -419,93 +419,6 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container(
height: 40.0,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1.0,
style: BorderStyle.solid,
color: HexColor("#CCCCCC")),
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
),
),
width: double.infinity,
child: Padding(
padding: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 0.9,
bottom: SizeConfig.widthMultiplier * 0.9,
right: SizeConfig.widthMultiplier * 3,
left: SizeConfig.widthMultiplier * 3),
child: Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
// add Expanded to have your dropdown button fill remaining space
child: DropdownButtonHideUnderline(
child: DropdownButton(
isExpanded: true,
value: _selectedLocation,
iconSize: 25,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return LOCATIONS.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
!projectsProvider.isArabic
? AppText(
item['text'],
fontSize: SizeConfig
.textMultiplier *
2.1,
)
: AppText(
item['text-ar'],
fontSize: SizeConfig
.textMultiplier *
2.1,
)
],
);
}).toList();
},
onChanged: (String newValue) {
setState(() {
_selectedLocation = newValue;
});
if (newValue == '1')
{
_patientSearchFormValues
.PatientOutSA = false;
}
else
{
_patientSearchFormValues
.PatientOutSA = true;
}
},
items: LOCATIONS.map((item) {
!projectsProvider.isArabic
? itemText2 = item['text']
: itemText2 = item['text-ar'];
return DropdownMenuItem(
child: Text(
itemText2,
textAlign: TextAlign.end,
),
value: item['val'],
);
}).toList(),
)),
),
],
),
),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),

@ -1,6 +1,7 @@
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/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/prescription_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
@ -35,6 +36,7 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
return BaseView<UcafViewModel>( return BaseView<UcafViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.resetDataInFirst();
await model.getLanguage(); await model.getLanguage();
await model.getPatientAssessment(patient); await model.getPatientAssessment(patient);
}, },
@ -54,8 +56,8 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
height: 10, height: 10,
), ),
Container( Container(
margin: margin: EdgeInsets.symmetric(
EdgeInsets.symmetric(vertical: 16, horizontal: 16), vertical: 16, horizontal: 16),
child: Column( child: Column(
children: [ children: [
treatmentStepsBar( treatmentStepsBar(
@ -63,7 +65,8 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
SizedBox( SizedBox(
height: 16, height: 16,
), ),
...getSelectedTreatmentStepItem(context, model), ...getSelectedTreatmentStepItem(
context, model),
], ],
), ),
), ),
@ -73,8 +76,7 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
), ),
), ),
Container( Container(
margin: margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: BorderedButton( child: BorderedButton(
TranslationBase.of(context).save, TranslationBase.of(context).save,
hasBorder: true, hasBorder: true,
@ -85,21 +87,22 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
textColor: Colors.white, textColor: Colors.white,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
handler: () async { handler: () async {
await model.postUCAF(patient); await model.postUCAF(patient);
if(model.state == ViewState.Idle){ if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).postUcafSuccessMsg); DrAppToastMsg.showSuccesToast(
Navigator.of(context).popUntil((route){ TranslationBase.of(context).postUcafSuccessMsg);
return route.settings.name == PATIENTS_PROFILE; Navigator.of(context).popUntil((route) {
}); return route.settings.name == PATIENTS_PROFILE;
} else { });
DrAppToastMsg.showErrorToast(model.error); } else {
} DrAppToastMsg.showErrorToast(model.error);
}
}, },
), ),
), ),
Container( Container(
margin: margin: EdgeInsets.only(
EdgeInsets.only(left: 16, right: 16, top: 0.0, bottom: 8), left: 16, right: 16, top: 0.0, bottom: 8),
child: BorderedButton( child: BorderedButton(
TranslationBase.of(context).cancel, TranslationBase.of(context).cancel,
hasBorder: true, hasBorder: true,
@ -110,10 +113,9 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
textColor: HexColor("#B8382B"), textColor: HexColor("#B8382B"),
fontSize: SizeConfig.textMultiplier * 2.2, fontSize: SizeConfig.textMultiplier * 2.2,
handler: () { handler: () {
Navigator.of(context).popUntil((route){ Navigator.of(context).popUntil((route) {
return route.settings.name == PATIENTS_PROFILE; return route.settings.name == PATIENTS_PROFILE;
}); });
}, },
), ),
), ),
@ -164,7 +166,7 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
if (__treatmentSteps.indexOf(item) == 0) { if (__treatmentSteps.indexOf(item) == 0) {
await model.getPatientAssessment(patient); await model.getPatientAssessment(patient);
} else if (__treatmentSteps.indexOf(item) == 1) { } else if (__treatmentSteps.indexOf(item) == 1) {
print("call Medications"); await model.getPrescription(patient);
} }
if (__treatmentSteps.indexOf(item) == 2) { if (__treatmentSteps.indexOf(item) == 2) {
await model.getOrderProcedures(patient); await model.getOrderProcedures(patient);
@ -198,7 +200,14 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
} }
break; break;
case 1: case 1:
return [...List.generate(2, (index) => MedicationWidget()).toList()]; return [
...List.generate(
model.prescriptionList != null
? model.prescriptionList.entityList.length
: 0,
(index) => MedicationWidget(
model, model.prescriptionList.entityList[index])).toList()
];
break; break;
case 2: case 2:
if (model.orderProcedures != null) { if (model.orderProcedures != null) {
@ -326,6 +335,11 @@ class DiagnosisWidget extends StatelessWidget {
} }
class MedicationWidget extends StatelessWidget { class MedicationWidget extends StatelessWidget {
final UcafViewModel model;
final EntityList prescription;
MedicationWidget(this.model, this.prescription);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
@ -339,7 +353,7 @@ class MedicationWidget extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
AppText( AppText(
"6", "${prescription.medicineCode}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
@ -352,7 +366,7 @@ class MedicationWidget extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
AppText( AppText(
"35.6", "${prescription.medicationPrice}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
@ -365,7 +379,24 @@ class MedicationWidget extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
AppText( AppText(
"3", "${prescription.quantity}",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).durDays}: ",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0,
),
AppText(
"${prescription.doseDurationDays}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
@ -378,7 +409,7 @@ class MedicationWidget extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
"EVE SKIN CREAM WITH HONEY -170GM", "${prescription.medicationName}",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
@ -392,7 +423,7 @@ class MedicationWidget extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
"Every other day for 5 days", "${prescription.doseDetail}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),

@ -233,7 +233,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
controller: _additionalComplaintsController, controller: _additionalComplaintsController,
keyboardType: TextInputType.multiline, keyboardType: TextInputType.multiline,
minLines: 1, minLines: 1,
maxLines: 15, maxLines: 20,
)), )),
SizedBox( SizedBox(
height: 16, height: 16,

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/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/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
@ -32,6 +34,7 @@ class _AdmissionRequestDetailScreenState
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'];
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<AdmissionRequestViewModel>( return BaseView<AdmissionRequestViewModel>(
onModelReady: (model) => model.getSpecialityList(), onModelReady: (model) => model.getSpecialityList(),
@ -124,7 +127,7 @@ class _AdmissionRequestDetailScreenState
ListSelectDialog( ListSelectDialog(
list: model.speciality, list: model.speciality,
attributeName: attributeName:
model.selectedLanguage == 'ar' projectViewModel.isArabic
? 'nameAr' ? 'nameAr'
: 'nameEn', : 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
@ -151,8 +154,7 @@ class _AdmissionRequestDetailScreenState
TranslationBase.of(context) TranslationBase.of(context)
.speciality, .speciality,
_selectedSpeciality != null _selectedSpeciality != null
? model.selectedLanguage == ? projectViewModel.isArabic
'ar'
? _selectedSpeciality[ ? _selectedSpeciality[
'nameAr'] 'nameAr']
: _selectedSpeciality[ : _selectedSpeciality[

@ -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,62 +1,187 @@
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/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';
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/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.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/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../../routes.dart';
class AdmissionRequestThirdScreen extends StatefulWidget { class AdmissionRequestThirdScreen extends StatefulWidget {
@override @override
_AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState(); _AdmissionRequestThirdScreenState createState() =>
_AdmissionRequestThirdScreenState();
} }
class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScreen> { class _AdmissionRequestThirdScreenState
extends State<AdmissionRequestThirdScreen> {
final _treatmentLineController = TextEditingController();
final _complicationsController = TextEditingController();
final _otherProceduresController = TextEditingController();
final _postPlansEstimatedCostController = TextEditingController(); dynamic _selectedAdmissionType;
final _dietTypeRemarksController = TextEditingController(); dynamic _selectedDiagnosis;
DateTime _dischargeDate; 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);
return BaseView<AdmissionRequestViewModel>( return BaseView<AdmissionRequestViewModel>(
// onModelReady: (model) => model.getMasterLookup(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).admissionRequest, appBarTitle: TranslationBase.of(context).admissionRequest,
body: model.doctorsList != null body: GestureDetector(
? Column( onTap: () {
children: [ FocusScopeNode currentFocus = FocusScope.of(context);
Expanded( if (!currentFocus.hasPrimaryFocus) {
child: SingleChildScrollView( currentFocus.unfocus();
}
},
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
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(
height: 10,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).treatmentLine,
null,
false),
enabled: true,
controller: _treatmentLineController,
keyboardType: TextInputType.text,
minLines: 3,
maxLines: 5,
)),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).complications,
null,
false),
enabled: true,
controller: _complicationsController,
keyboardType: TextInputType.text,
minLines: 3,
maxLines: 5,
)),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).otherProcedure,
null,
false),
enabled: true,
controller: _otherProceduresController,
keyboardType: TextInputType.text,
minLines: 3,
maxLines: 5,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.admissionTypeList != null &&
model.admissionTypeList.length > 0
? () {
openListDialogField('nameEn', 'id',
model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType =
selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getMasterLookup(MasterKeysService
.AdmissionRequestType)
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.admissionTypeList.length > 0) {
openListDialogField('nameEn', 'id',
model.admissionTypeList,
(selectedValue) {
setState(() {
_selectedAdmissionType =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).admissionType,
_selectedAdmissionType != null
? _selectedAdmissionType['nameEn']
: null,
true),
enabled: false,
),
),
),
SizedBox( SizedBox(
height: 16, height: 16,
), ),
AppText( AppText(
TranslationBase.of(context).postPlansEstimatedCost, TranslationBase.of(context).diagnosisDetail,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
), ),
@ -64,50 +189,105 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
height: 10, height: 10,
), ),
Container( Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.diagnosisTypesList != null &&
model.diagnosisTypesList.length > 0
? () {
openListDialogField('nameEn', 'id',
model.diagnosisTypesList,
(selectedValue) {
setState(() {
_selectedDiagnosis = selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getDiagnosis().then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.diagnosisTypesList.length > 0) {
openListDialogField('nameEn', 'id',
model.diagnosisTypesList,
(selectedValue) {
setState(() {
_selectedDiagnosis = selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField( child: TextField(
decoration: decoration: Helpers.textFieldSelectorDecoration(
Helpers.textFieldSelectorDecoration( TranslationBase.of(context).diagnosis,
TranslationBase.of(context) _selectedDiagnosis != null
.postPlansEstimatedCost, ? _selectedDiagnosis['nameEn']
null, : null,
false), true),
enabled: true, enabled: false,
controller: _postPlansEstimatedCostController, ),
keyboardType: TextInputType.text, ),
minLines: 4, ),
maxLines: 6,
)),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( 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(
_selectDate( 'description', 'code', model.icdCodes,
context, _dischargeDate, (selectedValue) {
(picked) { setState(() {
setState(() { _selectedIcd = selectedValue;
_dischargeDate = picked; });
}); });
}); }
}, : () async {
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(() {
_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,
), ),
), ),
@ -118,36 +298,59 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: /*model.doctorsList != null && onTap: model.listOfDiagnosisSelectionTypes !=
model.doctorsList.length > 0 null &&
? () { model.listOfDiagnosisSelectionTypes
ListSelectDialog dialog = .length >
ListSelectDialog( 0
list: model.doctorsList, ? () {
attributeName: 'DoctorName', openListDialogField('description', 'code',
attributeValueId: 'DoctorID', model.listOfDiagnosisSelectionTypes,
okText: TranslationBase.of(context).ok, (selectedValue) {
okFunction: (selectedValue) { setState(() {
_selectedDiagnosisType =
selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getMasterLookup(MasterKeysService
.DiagnosisSelectionType)
.then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.listOfDiagnosisSelectionTypes
.length >
0) {
openListDialogField(
'description',
'code',
model.listOfDiagnosisSelectionTypes,
(selectedValue) {
setState(() { setState(() {
_selectedDoctor = selectedValue; _selectedDiagnosisType =
selectedValue;
}); });
}, });
); } else if (model.state ==
showDialog( ViewState.ErrorLocal) {
barrierDismissible: false, DrAppToastMsg.showErrorToast(
context: context, model.error);
builder: (BuildContext context) { } else {
return dialog; DrAppToastMsg.showErrorToast(
}, "Empty List");
); }
} },
:*/ null,
child: TextField( child: TextField(
decoration: Helpers.textFieldSelectorDecoration( decoration: Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).dietType, TranslationBase.of(context).diagnoseType,
/* _admissionType != null _selectedDiagnosisType != null
? _admissionType['DoctorName'] ? _selectedDiagnosisType['description']
:*/ null, : null,
true), true),
enabled: false, enabled: false,
), ),
@ -156,53 +359,90 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
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(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).next,
color: HexColor("#B8382B"),
onPressed: () async {
if (_treatmentLineController.text != "" &&
_complicationsController.text != "" &&
_otherProceduresController.text != "" &&
_selectedAdmissionType != null &&
_selectedDiagnosis != null &&
_selectedIcd != null &&
_selectedDiagnosisType != null) {
model.admissionRequestData = admissionRequest;
model.admissionRequestData.mainLineOfTreatment =
_treatmentLineController.text;
model.admissionRequestData.complications =
_complicationsController.text;
model.admissionRequestData.otherProcedures =
_otherProceduresController.text;
model.admissionRequestData.admissionType =
_selectedAdmissionType['id'];
dynamic admissionRequestDiagnoses = [
{
'diagnosisDescription': _selectedDiagnosis['nameEn'],
'diagnosisType': _selectedDiagnosis['id'],
'icdCode': _selectedIcd['code'],
'icdCodeDescription': _selectedIcd['description'],
'type': _selectedDiagnosisType['code'],
'remarks': "",
'isActive': true,
}
];
model.admissionRequestData.admissionRequestDiagnoses =
admissionRequestDiagnoses;
await model.makeAdmissionRequest();
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
} else {
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).admissionRequestSuccessMsg);
Navigator.popUntil(context, ModalRoute.withName(PATIENTS_PROFILE));
}
} else {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseFill);
}
},
),
), ),
), ],
Container( ),
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), ),
child: AppButton(
title: TranslationBase.of(context).save,
color: HexColor("#B8382B"),
onPressed: null,
),
),
],
)
: Container(),
), ),
); );
} }
Future _selectDate(BuildContext context, DateTime dateTime, void openListDialogField(String attributeName, String attributeValueId,
Function(DateTime picked) updateDate) async { List<dynamic> list, Function(dynamic selectedValue) okFunction) {
final DateTime picked = await showDatePicker( 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, context: context,
initialDate: dateTime, builder: (BuildContext context) {
firstDate: DateTime.now(), return dialog;
lastDate: DateTime(2040), },
initialEntryMode: DatePickerEntryMode.calendar,
); );
if (picked != null && picked != dateTime) {
updateDate(picked);
}
} }
} }

@ -2,6 +2,7 @@ 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/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/viewModel/patient-admission-request-viewmodel.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/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -15,6 +16,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -30,425 +32,410 @@ 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;
bool _patientPregnant = false; dynamic _selectedFloor;
bool _preAnesthesiaReferred = false;
dynamic _selectedWard; dynamic _selectedWard;
dynamic _selectedAdmissionType; dynamic _selectedRoomCategory;
dynamic _selectedDiagnosis;
dynamic _selectedAllergies;
@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);
return BaseView<AdmissionRequestViewModel>( return BaseView<AdmissionRequestViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).admissionRequest, appBarTitle: TranslationBase.of(context).admissionRequest,
body: model.doctorsList != null body: GestureDetector(
? Column( onTap: () {
children: [ FocusScopeNode currentFocus = FocusScope.of(context);
Expanded( if (!currentFocus.hasPrimaryFocus) {
child: SingleChildScrollView( currentFocus.unfocus();
child: Column( }
crossAxisAlignment: CrossAxisAlignment.start, },
children: [ child: Column(
PatientPageHeaderWidget(patient), children: [
Container( Expanded(
margin: EdgeInsets.symmetric( child: SingleChildScrollView(
vertical: 16, horizontal: 16), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ PatientPageHeaderWidget(patient),
SizedBox( Container(
height: 16, margin: EdgeInsets.symmetric(
), vertical: 16, horizontal: 16),
AppText( child: Column(
TranslationBase.of(context).otherInformation, crossAxisAlignment: CrossAxisAlignment.start,
fontWeight: FontWeight.bold, children: [
fontSize: SizeConfig.textMultiplier * 2.5, SizedBox(
), height: 16,
SizedBox( ),
height: 10, AppText(
), TranslationBase.of(context)
Container( .postPlansEstimatedCost,
height: screenSize.height * 0.070, fontWeight: FontWeight.bold,
child: TextField( fontSize: SizeConfig.textMultiplier * 2.5,
decoration: ),
Helpers.textFieldSelectorDecoration( SizedBox(
TranslationBase.of(context) height: 10,
.expectedDays, ),
null, Container(
false),
enabled: true,
controller: _expectedDaysController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
keyboardType: TextInputType.number,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: TextField(
onTap: () { decoration:
if (_expectedAdmissionDate == null) { Helpers.textFieldSelectorDecoration(
_expectedAdmissionDate = DateTime.now(); TranslationBase.of(context)
} .estimatedCost,
_selectDate( null,
context, _expectedAdmissionDate, false),
(picked) { enabled: true,
setState(() { controller: _estimatedCostController,
_expectedAdmissionDate = picked; 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(
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.otherDepartmentsInterventions,
null,
false),
enabled: true,
controller:
_otherDepartmentsInterventionsController,
keyboardType: TextInputType.multiline,
minLines: 2,
maxLines: 4,
)),
SizedBox(
height: 10,
),
AppText(
TranslationBase.of(context).otherInformation,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.expectedDays,
null,
false),
enabled: true,
controller: _expectedDaysController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
keyboardType: TextInputType.number,
)),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () {
if (_expectedAdmissionDate == null) {
_expectedAdmissionDate = DateTime.now();
}
_selectDate(context, _expectedAdmissionDate,
(picked) {
setState(() {
_expectedAdmissionDate = picked;
}); });
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.expectedAdmissionDate,
_expectedAdmissionDate != null
? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context)
.emergencyAdmission,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.1,
),
value: _emergencyAdmission,
onChanged: (newValue) {
setState(() {
_emergencyAdmission = newValue;
}); });
}, },
controlAffinity: child: TextField(
ListTileControlAffinity.leading, decoration: Helpers.textFieldSelectorDecoration(
contentPadding: EdgeInsets.all(0), TranslationBase.of(context)
), .expectedAdmissionDate,
CheckboxListTile( _expectedAdmissionDate != null
title: AppText( ? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}"
TranslationBase.of(context).patientPregnant, : null,
fontWeight: FontWeight.normal, true,
fontSize: SizeConfig.textMultiplier * 2.1, suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
), ),
value: _patientPregnant,
onChanged: (newValue) {
setState(() {
_patientPregnant = newValue;
});
},
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
Container(
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.treatmentLine,
null,
false),
enabled: true,
controller: _treatmentLineController,
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
SizedBox(
height: 10,
), ),
Container( ),
height: screenSize.height * 0.070, SizedBox(
child: InkWell( height: 10,
onTap: model.wardList != null && ),
model.wardList.length > 0 Container(
? () { height: screenSize.height * 0.070,
child: InkWell(
onTap: model.floorList != null &&
model.floorList.length > 0
? () {
openListDialogField(
'description',
'floorID',
model.floorList, (selectedValue) {
setState(() {
_selectedFloor = selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model.getFloors().then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle &&
model.floorList.length > 0) {
openListDialogField('description', openListDialogField('description',
'description', model.wardList, 'floorID', model.floorList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedWard = selectedValue; _selectedFloor = selectedValue;
}); });
}); });
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
} }
: () async { },
await model.getWards(); child: TextField(
if (model.state == ViewState.Idle && decoration:
model.wardList.length > 0) { Helpers.textFieldSelectorDecoration(
openListDialogField('description', TranslationBase.of(context).floor,
'description', model.wardList, _selectedFloor != null
(selectedValue) { ? _selectedFloor['description']
setState(() { : null,
_selectedWard = selectedValue; true),
}); enabled: false,
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).ward,
_selectedWard != null
? _selectedWard['description']
: null,
true),
enabled: false,
),
),
),
CheckboxListTile(
title: AppText(
TranslationBase.of(context)
.preAnesthesiaReferred,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.1,
), ),
value: _preAnesthesiaReferred,
onChanged: (newValue) {
setState(() {
_preAnesthesiaReferred = newValue;
});
},
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
), ),
Container( ),
height: screenSize.height * 0.070, SizedBox(
child: InkWell( height: 10,
onTap: model.admissionTypeList != null && ),
model.admissionTypeList.length > 0 Container(
? () { height: screenSize.height * 0.070,
openListDialogField('nameEn', 'id', child: InkWell(
model.admissionTypeList, onTap: model.wardList != null &&
(selectedValue) { model.wardList.length > 0
setState(() { ? () {
_selectedAdmissionType = openListDialogField(
selectedValue; 'description',
}); 'nursingStationID',
model.wardList, (selectedValue) {
setState(() {
_selectedWard = selectedValue;
}); });
} });
: () async { }
await model.getMasterLookup( : () async {
MasterKeysService GifLoaderDialogUtils.showMyDialog(
.AdmissionRequestType); context);
if (model.state == ViewState.Idle && await model.getWards().then((_) =>
model.admissionTypeList.length > GifLoaderDialogUtils.hideDialog(
0) { context));
openListDialogField('nameEn', if (model.state == ViewState.Idle &&
'id', model.admissionTypeList, model.wardList.length > 0) {
(selectedValue) { openListDialogField(
setState(() { 'description',
_selectedAdmissionType = 'nursingStationID',
selectedValue; model.wardList,
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.admissionType,
_selectedAdmissionType != null
? _selectedAdmissionType[
'nameEn']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.diagnosisTypesList != null &&
model.diagnosisTypesList.length > 0
? () {
openListDialogField('nameEn', 'id',
model.diagnosisTypesList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedDiagnosis = _selectedWard = selectedValue;
selectedValue;
}); });
}); });
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
} }
: () async { },
await model.getDiagnosis(); child: TextField(
if (model.state == ViewState.Idle && decoration:
model.diagnosisTypesList Helpers.textFieldSelectorDecoration(
.length > TranslationBase.of(context).ward,
0) { _selectedWard != null
openListDialogField( ? _selectedWard['description']
'nameEn', : null,
'id', true),
model.diagnosisTypesList, enabled: false,
(selectedValue) {
setState(() {
_selectedDiagnosis =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.diagnosis,
_selectedDiagnosis != null
? _selectedDiagnosis['nameEn']
: null,
true),
enabled: false,
),
), ),
), ),
SizedBox( ),
height: 10, SizedBox(
), height: 10,
Container( ),
child: TextField( Container(
decoration: height: screenSize.height * 0.070,
Helpers.textFieldSelectorDecoration( child: InkWell(
TranslationBase.of(context) onTap: model.roomCategoryList != null &&
.preOperativeOrders, model.roomCategoryList.length > 0
null, ? () {
false), openListDialogField(
enabled: true, 'description',
controller: _preOperativeOrdersController, 'categoryID',
keyboardType: TextInputType.text, model.roomCategoryList,
minLines: 4, (selectedValue) {
maxLines: 6, setState(() {
)), _selectedRoomCategory =
SizedBox( selectedValue;
height: 10, });
), });
Container( }
height: screenSize.height * 0.070, : () async {
child: InkWell( GifLoaderDialogUtils.showMyDialog(
onTap: model.allergiesList != null && context);
model.allergiesList.length > 0 await model.getRoomCategories().then(
? () { (_) => GifLoaderDialogUtils
openListDialogField('nameEn', 'id', .hideDialog(context));
model.allergiesList, if (model.state == ViewState.Idle &&
model.roomCategoryList.length >
0) {
openListDialogField(
'description',
'categoryID',
model.roomCategoryList,
(selectedValue) { (selectedValue) {
setState(() { setState(() {
_selectedAllergies = _selectedRoomCategory =
selectedValue; selectedValue;
}); });
}); });
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
} }
: () async { },
await model.getAllergies(); child: TextField(
if (model.state == ViewState.Idle && decoration:
model.allergiesList.length > Helpers.textFieldSelectorDecoration(
0) { TranslationBase.of(context)
openListDialogField('nameEn', .roomCategory,
'id', model.allergiesList, _selectedRoomCategory != null
(selectedValue) { ? _selectedRoomCategory[
setState(() { 'description']
_selectedAllergies = : null,
selectedValue; true),
}); enabled: false,
});
} 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,
),
), ),
), ),
], ),
), SizedBox(
height: 10,
),
],
), ),
], ),
), ],
), ),
), ),
Container( ),
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), Container(
child: AppButton( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
title: TranslationBase.of(context).next, child: AppButton(
color: HexColor("#B8382B"), title: TranslationBase.of(context).next,
onPressed: () { color: HexColor("#B8382B"),
Navigator.of(context).pushNamed( onPressed: () async {
PATIENT_ADMISSION_REQUEST_3, if (_estimatedCostController.text != "" &&
arguments: {'patient': patient}); _postPlansEstimatedCostController.text != "" &&
}, _expectedDaysController.text != "" &&
), _expectedAdmissionDate != null &&
_otherDepartmentsInterventionsController.text != "" &&
_selectedFloor != null &&
_selectedRoomCategory !=
null /*_selectedWard is not required*/) {
model.admissionRequestData = admissionRequest;
model.admissionRequestData.estimatedCost =
int.parse(_estimatedCostController.text);
model.admissionRequestData.elementsForImprovement =
_postPlansEstimatedCostController.text;
model.admissionRequestData.expectedDays =
int.parse(_expectedDaysController.text);
model.admissionRequestData.admissionDate =
_expectedAdmissionDate.toIso8601String();
model.admissionRequestData
.otherDepartmentInterventions =
_otherDepartmentsInterventionsController.text;
model.admissionRequestData.admissionLocationID =
_selectedFloor['floorID'];
model.admissionRequestData.wardID =
_selectedWard != null
? _selectedWard['nursingStationID']
: 0;
model.admissionRequestData.roomCategoryID =
_selectedRoomCategory['categoryID'];
model.admissionRequestData.admissionRequestProcedures =
[];
Navigator.of(context)
.pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {
'patient': patient,
'admission-data': model.admissionRequestData
});
} else {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseFill);
}
},
), ),
], ),
) ],
: Container(), ),
), )),
); );
} }
@ -486,38 +473,4 @@ class _AdmissionRequestSecondScreenState
}, },
); );
} }
/*
onTap: model.wardList != null &&
model.wardList.length > 0
? () {
openListDialogField('description',
'description', model.wardList,
(selectedValue) {
setState(() {
_selectedWard = selectedValue;
});
});
}
: () async {
await model.getWards();
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");
}
},
*/
} }

@ -49,7 +49,7 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
patientID: patient.patientId, patientID: patient.patientId,
projectID: patient.projectId, projectID: patient.projectId,
tokenID: token, tokenID: token,
patientTypeID: patient.patientType, patientTypeID: patient.patientType??1,
languageID: 2); languageID: 2);
model.getLabResultOrders(labOrdersReqModel.toJson()); model.getLabResultOrders(labOrdersReqModel.toJson());
@ -143,6 +143,9 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
if(model
.patientLabResultOrdersList[index]
.doctorName != null )
AppText( AppText(
'${model '${model
.patientLabResultOrdersList[index] .patientLabResultOrdersList[index]
@ -171,7 +174,7 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
' Invoice No :', TranslationBase.of(context).invoiceNo,
fontSize: 2 * fontSize: 2 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
@ -187,6 +190,30 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
color: Colors.grey[800], color: Colors.grey[800],
), ),
], ],
),SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).orderNo,
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${model
.patientLabResultOrdersList[index]
.orderNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
],
) )
], ],
), ),

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

@ -154,6 +154,9 @@ 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);
} }
}, },
), ),
@ -174,6 +177,9 @@ 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);
} }
}, },
), ),

@ -73,6 +73,8 @@ class MyReferralPatientScreen extends StatelessWidget {
remark: remark:
model.pendingReferral[index].remarksFromSource, model.pendingReferral[index].remarksFromSource,
referredOn: model.pendingReferral[index].referredOn, referredOn: model.pendingReferral[index].referredOn,
answerFromTarget:
model.pendingReferral[index].answerFromTarget,
infoIcon: InkWell( infoIcon: InkWell(
onTap: () { onTap: () {
Navigator.of(context) Navigator.of(context)

@ -91,18 +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:
model.patientReferral[model.patientReferral.length -1].answerFromTarget,
), ),
], ],
), ),
@ -271,7 +273,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
attributeName: 'ClinicDescription', attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID', attributeValueId: 'ClinicID',
usingSearch: true, usingSearch: true,
hintSearchText: TranslationBase.of(context).clinicSearch, hintSearchText:
TranslationBase.of(context).clinicSearch,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
@ -321,7 +324,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
attributeName: 'DoctorName', attributeName: 'DoctorName',
attributeValueId: 'DoctorID', attributeValueId: 'DoctorID',
usingSearch: true, usingSearch: true,
hintSearchText: TranslationBase.of(context).doctorSearch, hintSearchText:
TranslationBase.of(context).doctorSearch,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
@ -380,9 +384,9 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
TranslationBase.of(context).remarks, null, false), TranslationBase.of(context).remarks, null, false),
enabled: true, enabled: true,
controller: _remarksController, controller: _remarksController,
inputFormatters: [ // inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS)) // FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))
], // ],
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
minLines: 4, minLines: 4,
maxLines: 6, maxLines: 6,
@ -406,53 +410,6 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
setState(() { setState(() {
appointmentDate = picked; appointmentDate = picked;
}); });
/* model
.getPatientArrivalList(DateUtils.convertStringToDateFormat(
appointmentDate.toString(), "yyyy-MM-dd"))
.then((_) {
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
return;
}
if (model.patientArrivalList != null &&
model.patientArrivalList.length > 0) {
List<dynamic> appointments = model.getAppointmentsByPatientName(
"${patient.firstName} ${patient.middleName} ${patient.lastName}");
if (appointments.length > 0) {
ListSelectDialog dialog = ListSelectDialog(
list: appointments,
attributeName: 'appointmentNo',
attributeValueId: 'appointmentNo',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedPatientArrivalEntity =
PatientArrivalEntity.fromJson(selectedValue);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
} else {
setState(() {
_selectedPatientArrivalEntity = null;
});
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).noAppointmentsErrorMsg);
}
} else {
setState(() {
_selectedPatientArrivalEntity = null;
});
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).noAppointmentsErrorMsg);
}
});*/
} }
} }
} }

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/drugtodrug.dart'; import 'package:doctor_app_flutter/screens/prescription/drugtodrug.dart';
@ -47,6 +48,7 @@ postProcedure(
PrescriptionViewModel model, PrescriptionViewModel model,
DateTime doseTime, DateTime doseTime,
String doseUnit, String doseUnit,
String icdCode,
PatiantInformtion patient}) async { PatiantInformtion patient}) async {
PostPrescriptionReqModel postProcedureReqModel = PostPrescriptionReqModel postProcedureReqModel =
new PostPrescriptionReqModel(); new PostPrescriptionReqModel();
@ -66,7 +68,7 @@ postProcedure(
frequency: frequency.isEmpty ? 1 : int.parse(frequency), frequency: frequency.isEmpty ? 1 : int.parse(frequency),
remarks: instruction, remarks: instruction,
approvalRequired: true, approvalRequired: true,
icdcode10Id: "test2", icdcode10Id: icdCode.toString(),
doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn),
duration: duration.isEmpty ? 1 : int.parse(duration), duration: duration.isEmpty ? 1 : int.parse(duration),
doseStartDate: doseTime.toIso8601String())); doseStartDate: doseTime.toIso8601String()));
@ -126,6 +128,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
dynamic doseTime; dynamic doseTime;
dynamic indication; dynamic indication;
dynamic units; dynamic units;
dynamic x;
List<dynamic> indicationList; List<dynamic> indicationList;
String routeInatial = 'By Mouth'; String routeInatial = 'By Mouth';
@ -175,20 +178,35 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ListSelectDialog drugDialog; ListSelectDialog drugDialog;
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
// final routeArgs = ModalRoute.of(context).settings.arguments as Map; // final routeArgs = ModalRoute.of(context).settings.arguments as Map;
// patient = routeArgs['patient']; // patient = routeArgs['patient'];
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
x = model.patientAssessmentList.map((element) {
return element.icdCode10ID;
});
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: widget.patient.patientMRN,
episodeID: widget.patient.episodeNo.toString(),
editedBy: '',
doctorID: '',
appointmentNo: widget.patient.appointmentNo);
await model.getMedicationList(); await model.getMedicationList();
await model.getMedicationStrength(); await model.getMedicationStrength();
await model.getMedicationDuration(); await model.getMedicationDuration();
await model.getMedicationRoute(); await model.getMedicationRoute();
await model.getMedicationFrequency(); await model.getMedicationFrequency();
await model.getMedicationDoseTime(); await model.getMedicationDoseTime();
await model.getMedicationIndications(); //await model.getMedicationIndications();
await model.getPatientAssessment(getAssessmentReqModel);
}, },
builder: (BuildContext context, MedicineViewModel model, Widget child) => builder: (
BuildContext context,
MedicineViewModel model,
Widget child,
) =>
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: DraggableScrollableSheet( child: DraggableScrollableSheet(
@ -198,7 +216,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
builder: (BuildContext context, ScrollController scrollController) { builder: (BuildContext context, ScrollController scrollController) {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
height: 980, height: 1010,
child: Padding( child: Padding(
padding: padding:
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
@ -298,22 +316,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
AppText('Order Type'), AppText('Order Type'),
Radio( Radio(
activeColor: Color(0xFFB9382C), activeColor: Color(0xFFB9382C),
value: 0, value: 1,
groupValue: selectedType, groupValue: selectedType,
onChanged: (value) { onChanged: (value) {
setSelectedType(value); setSelectedType(value);
}, },
), ),
Text('Regular'), Text('Regular'),
Radio(
activeColor: Color(0xFFB9382C),
groupValue: selectedType,
value: 1,
onChanged: (value) {
setSelectedType(value);
},
),
Text('Urgent'),
], ],
), ),
), ),
@ -534,46 +543,57 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( //model.patientAssessmentList.forEach((element) { }).
height: screenSize.height * 0.070, Column(
child: InkWell( children: model.patientAssessmentList
onTap: indicationList != null .map((element) {
? () { return Container(
ListSelectDialog dialog = height: screenSize.height * 0.070,
ListSelectDialog( child: InkWell(
list: indicationList, onTap: indicationList != null
attributeName: 'name', ? () {
attributeValueId: 'id', ListSelectDialog dialog =
okText: ListSelectDialog(
TranslationBase.of(context) list: indicationList,
attributeName: 'name',
attributeValueId: 'id',
okText: TranslationBase.of(
context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
indication = selectedValue; indication =
}); selectedValue;
}, });
); },
showDialog( );
barrierDismissible: false, showDialog(
context: context, barrierDismissible: false,
builder: (BuildContext context) { context: context,
return dialog; builder:
}, (BuildContext context) {
); return dialog;
} },
: null, );
child: TextField( }
decoration: textFieldSelectorDecoration( : null,
TranslationBase.of(context) child: TextField(
.indication, decoration:
indication != null textFieldSelectorDecoration(
? indication['name'] element.icdCode10ID
: null, .toString(),
true), indication != null
enabled: false, ? indication['name']
), : null,
), true),
enabled: true,
readOnly: true,
),
),
);
}).toList(),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
@ -677,7 +697,6 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// openDrugToDrug(); // openDrugToDrug();
if (route == null || if (route == null ||
frequency == null || frequency == null ||
indication == null ||
doseTime == null || doseTime == null ||
duration == null || duration == null ||
selectedDate == null || selectedDate == null ||
@ -690,30 +709,54 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
if (formKey.currentState.validate()) { if (formKey.currentState.validate()) {
Navigator.pop(context); Navigator.pop(context);
{ {
// var x = model
// .patientAssessmentList
// .map((value) =>
// value.icdCode10ID)
// .toList()
// .join(',');
postProcedure( postProcedure(
dose: strengthController.text, icdCode: model
doseUnit: .patientAssessmentList[
units['id'].toString(), 0]
patient: widget.patient, .icdCode10ID
doseTimeIn: .isEmpty
doseTime['id'].toString(), ? "test"
model: widget.model, : model
duration: .patientAssessmentList[
duration['id'].toString(), 0]
frequency: frequency['id'] .icdCode10ID
.toString(), .toString(),
route: route['id'].toString(), // icdCode: model
drugId: _selectedMedication // .patientAssessmentList
.itemId // .map((value) => value
.toString(), // .icdCode10ID
strength: // .trim())
strengthController.text, // .toList()
indication: // .join(' '),
indicationController.text, dose: strengthController.text,
instruction: doseUnit:
instructionController units['id'].toString(),
.text, patient: widget.patient,
doseTime: selectedDate); doseTimeIn:
doseTime['id'].toString(),
model: widget.model,
duration:
duration['id'].toString(),
frequency:
frequency['id'].toString(),
route: route['id'].toString(),
drugId: _selectedMedication
.itemId
.toString(),
strength:
strengthController.text,
indication:
indicationController.text,
instruction:
instructionController.text,
doseTime: selectedDate,
);
} }
} }
{ {

@ -181,6 +181,13 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
(index) => Container( (index) => Container(
child: Column( child: Column(
children: [ children: [
SizedBox(
height: MediaQuery.of(
context)
.size
.height *
0.022,
),
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment MainAxisAlignment
@ -193,7 +200,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.23, 0.33,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -232,7 +239,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.3019, 0.3899,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -328,7 +335,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
], ],
), ),
SizedBox( SizedBox(
height: 3.0, height: 10.0,
), ),
Row( Row(
children: [ children: [
@ -351,7 +358,29 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
], ],
), ),
SizedBox( SizedBox(
height: 18.0, height:
5.0),
Row(
children: [
AppText(
'pharmacist Remarks : ',
fontWeight:
FontWeight
.w700,
fontSize:
17.0,
),
Expanded(
child: AppText(
model.prescriptionList[0].entityList[index].pharmacistRemarks == null
? ""
: model.prescriptionList[0].entityList[index].pharmacistRemarks,
fontSize: 15.0),
)
],
),
SizedBox(
height: 20.0,
), ),
Row( Row(
children: [ children: [
@ -376,21 +405,23 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
) )
], ],
), ),
SizedBox(
height: 8.0,
),
Row( Row(
children: [ children: [
Expanded( Expanded(
child: child:
Container( Container(
height: height:
30, 25,
child: child:
AppText( AppText(
model model.prescriptionList[0].entityList[index].remarks == null
.prescriptionList[0] ? ""
.entityList[index] : model.prescriptionList[0].entityList[index].remarks,
.remarks,
fontSize: fontSize:
11.5, 12.5,
), ),
), ),
), ),
@ -400,13 +431,6 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
height: 10.0, height: 10.0,
), ),
Divider(
height: 0,
thickness:
1.0,
color: Colors
.grey,
),
// SizedBox( // SizedBox(
// height: 40, // height: 40,
// ), // ),
@ -418,7 +442,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.05, 0.16,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -432,32 +456,31 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.edit), .edit),
onTap: () { onTap: () {
updatePrescriptionForm( updatePrescriptionForm(
doseUnit: drugNameGeneric: model
model.prescriptionList[0].entityList[index].doseDailyUnitID
.toString(),
doseStreangth:
model.prescriptionList[0].entityList[index].doseDailyQuantity
.toString(),
duration:
model.prescriptionList[0].entityList[index].doseDurationDays
.toString(),
startDate:
model.prescriptionList[0].entityList[index].startDate
.toString(),
dose: model
.prescriptionList[ .prescriptionList[
0] 0]
.entityList[ .entityList[
index] index]
.doseTimingID .medicationName,
doseUnit: model.prescriptionList[0].entityList[index].doseDailyUnitID
.toString(),
doseStreangth: model.prescriptionList[0].entityList[index].doseDailyQuantity
.toString(),
duration: model.prescriptionList[0].entityList[index].doseDurationDays
.toString(), .toString(),
frequency: model startDate:
model.prescriptionList[0].entityList[index].startDate
.toString(),
dose: model
.prescriptionList[ .prescriptionList[
0] 0]
.entityList[ .entityList[
index] index]
.frequencyID .doseTimingID
.toString(), .toString(),
frequency:
model.prescriptionList[0].entityList[index].frequencyID
.toString(),
rouat: model rouat: model
.prescriptionList[ .prescriptionList[
0] 0]
@ -484,6 +507,11 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
), ),
], ],
), ),
Divider(
height: 0,
thickness: 1.0,
color: Colors.grey,
),
], ],
), ),
), ),

@ -1,6 +1,8 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.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/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
@ -8,6 +10,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -31,6 +34,7 @@ class UpdatePrescriptionForm extends StatefulWidget {
final String enteredRemarks; final String enteredRemarks;
final String startDate; final String startDate;
final String frequency; final String frequency;
final String drugNameGeneric;
final PrescriptionViewModel model; final PrescriptionViewModel model;
UpdatePrescriptionForm( UpdatePrescriptionForm(
@ -46,7 +50,8 @@ class UpdatePrescriptionForm extends StatefulWidget {
this.doseUnit, this.doseUnit,
this.enteredRemarks, this.enteredRemarks,
this.frequency, this.frequency,
this.model}); this.model,
this.drugNameGeneric});
@override @override
_UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState(); _UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState();
} }
@ -62,6 +67,9 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
dynamic frequencyUpdate; dynamic frequencyUpdate;
dynamic updatedDuration; dynamic updatedDuration;
dynamic units; dynamic units;
GetMedicationResponseModel newSelectedMedication;
GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
@override @override
void initState() { void initState() {
@ -80,7 +88,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
await model.getMedicationRoute(); await model.getMedicationRoute();
await model.getMedicationFrequency(); await model.getMedicationFrequency();
await model.getMedicationDoseTime(); await model.getMedicationDoseTime();
await model.getMedicationIndications(); //await model.getMedicationIndications();
route = model.getLookupById(model.medicationRouteList, widget.route); route = model.getLookupById(model.medicationRouteList, widget.route);
doseTime = doseTime =
model.getLookupById(model.medicationDoseTimeList, widget.dose); model.getLookupById(model.medicationDoseTimeList, widget.dose);
@ -96,13 +104,13 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: DraggableScrollableSheet( child: DraggableScrollableSheet(
initialChildSize: 0.90, initialChildSize: 0.95,
maxChildSize: 0.90, maxChildSize: 0.99,
minChildSize: 0.6, minChildSize: 0.6,
builder: builder:
(BuildContext context, ScrollController scrollController) { (BuildContext context, ScrollController scrollController) {
return Container( return Container(
height: MediaQuery.of(context).size.height * 1.0, height: MediaQuery.of(context).size.height * 1.3,
child: Form( child: Form(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
@ -119,6 +127,78 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
), ),
Column( Column(
children: [ children: [
// Container(
// height: MediaQuery.of(context).size.height *
// 0.070,
// child: InkWell(
// onTap: model.allMedicationList != null
// ? () {
// setState(() {
// newSelectedMedication = null;
// });
// }
// : null,
// child: newSelectedMedication == null
// ? AutoCompleteTextField<
// GetMedicationResponseModel>(
// decoration:
// textFieldSelectorDecoration(
// widget.drugNameGeneric,
// newSelectedMedication != null
// ? newSelectedMedication
// .genericName
// : null,
// true,
// ),
// itemSubmitted: (item) => setState(
// () => newSelectedMedication =
// item),
// key: key,
// suggestions:
// model.allMedicationList,
// itemBuilder: (context,
// suggestion) =>
// new Padding(
// child: Texts(suggestion
// .description +
// '/' +
// suggestion.genericName),
// padding:
// EdgeInsets.all(8.0)),
// itemSorter: (a, b) => 1,
// itemFilter: (suggestion, input) =>
// suggestion.genericName
// .toLowerCase()
// .startsWith(
// input.toLowerCase()) ||
// suggestion.description
// .toLowerCase()
// .startsWith(
// input.toLowerCase()) ||
// suggestion.keywords
// .toLowerCase()
// .startsWith(
// input.toLowerCase()),
// )
// : TextField(
// decoration:
// textFieldSelectorDecoration(
// TranslationBase.of(context)
// .searchMedicineNameHere,
// newSelectedMedication != null
// ? newSelectedMedication
// .description +
// ('${newSelectedMedication.genericName}')
// : null,
// true,
// ),
// enabled: false,
// ),
// ),
// ),
// SizedBox(
// height: 12,
// ),
Container( Container(
height: MediaQuery.of(context).size.height * height: MediaQuery.of(context).size.height *
0.060, 0.060,
@ -128,13 +208,16 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
Container( Container(
width: width:
MediaQuery.of(context).size.width * MediaQuery.of(context).size.width *
0.500, 0.4900,
height:
MediaQuery.of(context).size.height *
0.55,
child: TextFields( child: TextFields(
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter(4) LengthLimitingTextInputFormatter(4)
], ],
hintText: TranslationBase.of(context) hintText: widget.doseStreangth,
.strength, fontSize: 15.0,
controller: strengthController, controller: strengthController,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
onChanged: (String value) { onChanged: (String value) {
@ -521,6 +604,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
updatePrescription( updatePrescription(
{PrescriptionViewModel model, {PrescriptionViewModel model,
int drugId, int drugId,
String newDrugId,
String frequencyId, String frequencyId,
String remarks, String remarks,
String dose, String dose,
@ -585,6 +669,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
void updatePrescriptionForm( void updatePrescriptionForm(
{context, {context,
String drugName, String drugName,
String drugNameGeneric,
int drugId, int drugId,
String remarks, String remarks,
PrescriptionViewModel model, PrescriptionViewModel model,
@ -619,6 +704,7 @@ void updatePrescriptionForm(
route: rouat, route: rouat,
startDate: startDate, startDate: startDate,
model: model, model: model,
drugNameGeneric: drugNameGeneric,
); );
}); });
} }

@ -195,6 +195,13 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
(index) => Container( (index) => Container(
child: Column( child: Column(
children: [ children: [
SizedBox(
height:
MediaQuery.of(context)
.size
.height *
0.022,
),
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment MainAxisAlignment
@ -298,17 +305,20 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
FontWeight FontWeight
.w700, .w700,
fontSize: fontSize:
15.0, 14.0,
), ),
AppText( Expanded(
model.procedureList[0].entityList[index].orderType == child:
1 AppText(
? 'Regular' model.procedureList[0].entityList[index].orderType ==
: 'Urgent', 1
fontSize: ? 'Regular'
13.0, : 'Urgent',
color: Color( fontSize:
0xFFB9382C), 13.0,
color: Color(
0xFFB9382C),
),
), ),
], ],
), ),
@ -391,7 +401,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
height: MediaQuery.of(context) height: MediaQuery.of(context)
.size .size
.height * .height *
0.052, 0.047,
width: MediaQuery.of(context) width: MediaQuery.of(context)
.size .size
.width * .width *
@ -413,12 +423,6 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
height: 20.0, height: 20.0,
), ),
Divider(
height: 1.0,
thickness: 1.0,
color:
Colors.grey,
)
// SizedBox( // SizedBox(
// height: 40, // height: 40,
// ), // ),
@ -468,9 +472,14 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
) )
], ],
), ),
) ),
], ],
), ),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey,
),
], ],
), ),
), ),

@ -86,165 +86,184 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
(BuildContext context, ProcedureViewModel model, Widget child) => (BuildContext context, ProcedureViewModel model, Widget child) =>
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: Container( child: DraggableScrollableSheet(
height: MediaQuery.of(context).size.height * 0.95, minChildSize: 0.90,
child: Form( initialChildSize: 0.95,
child: Padding( maxChildSize: 1.0,
padding: builder:
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), (BuildContext context, ScrollController scrollController) {
child: Column( return SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, child: Container(
children: [ height: MediaQuery.of(context).size.height * 1.20,
AppText( child: Form(
widget.procedureName.toUpperCase(), child: Padding(
fontWeight: FontWeight.w700, padding: EdgeInsets.symmetric(
), horizontal: 20.0, vertical: 10.0),
SizedBox( child: Column(
height: 30.0, crossAxisAlignment: CrossAxisAlignment.start,
), children: [
Container( AppText(
height: screenSize.height * 0.070, widget.procedureName.toUpperCase(),
child: InkWell( fontWeight: FontWeight.w700,
onTap: model.categoryList != null && ),
model.categoryList.length > 0 SizedBox(
? () { height: 30.0,
ListSelectDialog dialog = ListSelectDialog( ),
list: model.categoryList, Container(
attributeName: 'categoryName', height: screenSize.height * 0.070,
attributeValueId: 'categoryId', child: InkWell(
okText: TranslationBase.of(context).ok, onTap: model.categoryList != null &&
okFunction: (selectedValue) { model.categoryList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.categoryList,
attributeName: 'categoryName',
attributeValueId: 'categoryId',
okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
selectedCategory =
selectedValue;
model.getProcedureCategory(
categoryName:
selectedCategory[
'categoryName']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
//model.getProcedureCategory();
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.procedureCategorise,
selectedCategory != null
? selectedCategory['categoryName']
: null,
true,
suffixIcon: Icon(
Icons.search,
color: Colors.black,
)),
enabled: false,
),
),
),
if (widget.model.categoriesList.length != 0)
NetworkBaseView(
baseViewModel: model,
child: EntityListCheckboxSearchWidget(
model: widget.model,
masterList: widget
.model.categoriesList[0].entityList,
removeHistory: (item) {
setState(() { setState(() {
selectedCategory = selectedValue; entityList.remove(item);
model.getProcedureCategory(
categoryName: selectedCategory[
'categoryName']);
}); });
}, },
); addHistory: (history) {
showDialog( setState(() {
barrierDismissible: false, entityList.add(history);
context: context, });
builder: (BuildContext context) {
return dialog;
}, },
); addSelectedHistories: () {
//model.getProcedureCategory(); //TODO build your fun herr
} // widget.addSelectedHistories();
: null, },
child: TextField( isEntityListSelected: (master) =>
decoration: textFieldSelectorDecoration( isEntityListSelected(master),
TranslationBase.of(context).procedureCategorise, ),
selectedCategory != null ),
? selectedCategory['categoryName'] Container(
: null, child: Row(
true, children: [
suffixIcon: Icon( AppText(
Icons.search, TranslationBase.of(context).orderType),
color: Colors.black, Radio(
)), activeColor: Color(0xFFB9382C),
enabled: false, value: 0,
), groupValue: selectedType,
), onChanged: (value) {
), setSelectedType(value);
if (widget.model.categoriesList.length != 0) },
NetworkBaseView( ),
baseViewModel: model, Text(TranslationBase.of(context).urgent),
child: EntityListCheckboxSearchWidget( Radio(
model: widget.model, activeColor: Color(0xFFB9382C),
masterList: groupValue: selectedType,
widget.model.categoriesList[0].entityList, value: 1,
removeHistory: (item) { onChanged: (value) {
setState(() { setSelectedType(value);
entityList.remove(item); },
}); ),
}, Text(TranslationBase.of(context).regular),
addHistory: (history) { ],
setState(() { ),
entityList.add(history); ),
}); SizedBox(
}, height: 12.0,
addSelectedHistories: () { ),
//TODO build your fun herr Container(
// widget.addSelectedHistories(); decoration: BoxDecoration(
}, borderRadius:
isEntityListSelected: (master) => BorderRadius.all(Radius.circular(6.0)),
isEntityListSelected(master), border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: widget.remarks,
fontSize: 15.0,
controller: widget.remarksController,
maxLines: 3,
minLines: 2,
),
),
SizedBox(
height: 50.0,
),
Container(
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.updateProcedure
.toUpperCase(),
onPressed: () {
Navigator.pop(context);
updateProcedure(
orderType: selectedType.toString(),
categorieId: widget.categoryId,
procedureId: widget.procedureId,
entityList: entityList,
patient: widget.patient,
model: widget.model,
remarks:
widget.remarksController.text);
// authorizationForm(context);
},
),
],
),
),
],
), ),
), ),
Container( )),
child: Row( );
children: [ }),
AppText(TranslationBase.of(context).orderType),
Radio(
activeColor: Color(0xFFB9382C),
value: 0,
groupValue: selectedType,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).urgent),
Radio(
activeColor: Color(0xFFB9382C),
groupValue: selectedType,
value: 1,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).regular),
],
),
),
SizedBox(
height: 12.0,
),
Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: widget.remarks,
controller: widget.remarksController,
maxLines: 5,
minLines: 3,
),
),
SizedBox(
height: 50.0,
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: TranslationBase.of(context)
.updateProcedure
.toUpperCase(),
onPressed: () {
Navigator.pop(context);
updateProcedure(
orderType: selectedType.toString(),
categorieId: widget.categoryId,
procedureId: widget.procedureId,
entityList: entityList,
patient: widget.patient,
model: widget.model,
remarks: widget.remarksController.text);
// authorizationForm(context);
},
),
],
),
),
],
),
),
)),
), ),
); );
}); });

@ -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];
@ -725,6 +726,8 @@ class TranslationBase {
String get emergencyAdmission => String get emergencyAdmission =>
localizedValues['emergencyAdmission'][locale.languageCode]; localizedValues['emergencyAdmission'][locale.languageCode];
String get isSickLeaveRequired =>
localizedValues['isSickLeaveRequired'][locale.languageCode];
String get patientPregnant => String get patientPregnant =>
localizedValues['patientPregnant'][locale.languageCode]; localizedValues['patientPregnant'][locale.languageCode];
@ -762,6 +765,8 @@ class TranslationBase {
String get postPlansEstimatedCost => String get postPlansEstimatedCost =>
localizedValues['postPlansEstimatedCost'][locale.languageCode]; localizedValues['postPlansEstimatedCost'][locale.languageCode];
String get postPlans =>
localizedValues['postPlans'][locale.languageCode];
String get ucaf => localizedValues['ucaf'][locale.languageCode]; String get ucaf => localizedValues['ucaf'][locale.languageCode];
@ -865,6 +870,8 @@ class TranslationBase {
String get quantity => localizedValues['quantity'][locale.languageCode]; String get quantity => localizedValues['quantity'][locale.languageCode];
String get durDays => localizedValues['durDays'][locale.languageCode];
String get codeNo => localizedValues['codeNo'][locale.languageCode]; String get codeNo => localizedValues['codeNo'][locale.languageCode];
String get covered => localizedValues['covered'][locale.languageCode]; String get covered => localizedValues['covered'][locale.languageCode];
@ -940,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];
@ -1077,12 +1085,25 @@ class TranslationBase {
localizedValues['clinicSearch'][locale.languageCode]; localizedValues['clinicSearch'][locale.languageCode];
String get doctorSearch => String get doctorSearch =>
localizedValues['doctorSearch'][locale.languageCode]; localizedValues['doctorSearch'][locale.languageCode];
String get referralResponse => localizedValues['referralResponse'][locale.languageCode];
String get estimatedCost => localizedValues['estimatedCost'][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> {

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

@ -12,6 +12,7 @@ class PatientReferralItemWidget extends StatelessWidget {
final String clinicDescription; final String clinicDescription;
final String remark; final String remark;
final String referredOn; final String referredOn;
final String answerFromTarget;
final Widget infoIcon; final Widget infoIcon;
PatientReferralItemWidget( PatientReferralItemWidget(
@ -24,6 +25,7 @@ class PatientReferralItemWidget extends StatelessWidget {
this.clinicDescription, this.clinicDescription,
this.remark, this.remark,
this.referredOn, this.referredOn,
this.answerFromTarget,
this.infoIcon, this.infoIcon,
}); });
@ -173,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,
@ -180,11 +183,13 @@ class PatientReferralItemWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,
), ),
AppText( Expanded(
remark, child: AppText(
color: Colors.black, remark,
fontWeight: FontWeight.bold, color: Colors.black,
fontSize: 12, fontWeight: FontWeight.bold,
fontSize: 12,
),
), ),
], ],
), ),
@ -207,6 +212,27 @@ class PatientReferralItemWidget extends StatelessWidget {
), ),
], ],
), ),
if (answerFromTarget != null)
SizedBox(
height: 8,
),
if (answerFromTarget != null)
Row(
children: [
AppText(
TranslationBase.of(context).referralResponse,
color: Colors.grey,
fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText(
answerFromTarget != "" ? answerFromTarget : '-',
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
],
),
SizedBox( SizedBox(
height: 16, height: 16,
), ),

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

@ -491,6 +491,10 @@ class AddAssessmentDetails extends StatefulWidget {
class _AddAssessmentDetailsState extends State<AddAssessmentDetails> { class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
TextEditingController remarkController = TextEditingController(); TextEditingController remarkController = TextEditingController();
TextEditingController appointmentIdController = TextEditingController(); TextEditingController appointmentIdController = TextEditingController();
TextEditingController conditionController = TextEditingController();
TextEditingController typeController = TextEditingController();
TextEditingController icdNameController = TextEditingController();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false; bool isFormSubmitted = false;
@ -501,31 +505,52 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
remarkController.text = widget.mySelectedAssessment.remark ?? ""; remarkController.text = widget.mySelectedAssessment.remark ?? "";
appointmentIdController.text = appointmentIdController.text =
widget.mySelectedAssessment.appointmentId.toString(); widget.mySelectedAssessment.appointmentId.toString();
final screenSize = MediaQuery if(widget.isUpdate){
.of(context) if(widget.mySelectedAssessment
.size; .selectedDiagnosisCondition != null)
InputDecoration textFieldSelectorDecoration(String hintText, conditionController.text = projectViewModel.isArabic
String selectedText, bool isDropDown, {IconData icon}) { ? widget.mySelectedAssessment
//TODO: make one Input InputDecoration for all .selectedDiagnosisCondition
.nameAr
: widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn;
if(widget.mySelectedAssessment
.selectedDiagnosisType !=null)
typeController.text = projectViewModel.isArabic
? widget.mySelectedAssessment
.selectedDiagnosisType
.nameAr
: widget.mySelectedAssessment
.selectedDiagnosisType
.nameEn;
if(widget.mySelectedAssessment.selectedICD !=null)
icdNameController.text = widget.mySelectedAssessment.selectedICD.code;
}
final screenSize = MediaQuery.of(context).size;
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{IconData icon}) {
return InputDecoration( return InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), borderSide: BorderSide(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
hintText: selectedText != null ? selectedText : hintText, hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon??Icons.arrow_drop_down) : null, suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 14, fontSize: 10,
color: Colors.grey.shade600, color: Theme.of(context).hintColor,
), fontWeight: FontWeight.w700),
); );
} }
return FractionallySizedBox( return FractionallySizedBox(
@ -590,46 +615,109 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: 10, height: 10,
), ),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.080,
child: InkWell( child: InkWell(
onTap: model.listOfDiagnosisType != null onTap: model.listOfICD10 != null
? () { ? () {
setState(() { setState(() {
widget.mySelectedAssessment.selectedICD = null; widget.mySelectedAssessment
}); .selectedICD = null;
} icdNameController.text = null;
: null, });
}
: null,
child: widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField<MasterKeyModel>( child: widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField<MasterKeyModel>(
decoration: textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), decoration: textFieldSelectorDecoration(
itemSubmitted: (item) => setState(() => widget.mySelectedAssessment.selectedICD = item), TranslationBase
.of(context)
.nameOrICD,
widget.mySelectedAssessment.selectedICD !=
null ? widget.mySelectedAssessment
.selectedICD.nameEn : null, true,
icon: EvaIcons.search),
itemSubmitted: (item) =>
setState(()
{
widget.mySelectedAssessment
.selectedICD = item;
icdNameController.text =item.code;
}),
key: key, key: key,
suggestions: model.listOfICD10, suggestions: model.listOfICD10,
itemBuilder: (context, suggestion) => new Padding( itemBuilder: (context, suggestion) =>
child:Texts( suggestion.description +" / "+ suggestion.code.toString()), new Padding(
child: Texts(
suggestion.description + " / " +
suggestion.code.toString()),
padding: EdgeInsets.all(8.0)), padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1, itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) => itemFilter: (suggestion, input) =>
suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.description.toLowerCase().startsWith(input.toLowerCase()) suggestion.description.toLowerCase().startsWith(
||suggestion.code.toLowerCase().startsWith(input.toLowerCase()) input.toLowerCase()) ||
suggestion.description.toLowerCase()
.startsWith(input.toLowerCase())
|| suggestion.code.toLowerCase().startsWith(
input.toLowerCase())
, ,
): TextField( )
decoration: textFieldSelectorDecoration( : TextFields(
widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.code :"Name or ICD", onTapTextFields: model.listOfICD10 != null
widget.mySelectedAssessment.selectedICD != null ? projectViewModel.isArabic?widget.mySelectedAssessment.selectedICD.nameAr:widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), ? () {
enabled: false, setState(() {
), widget.mySelectedAssessment.selectedICD =
), null;
icdNameController.text = null;
});
}
: null,
hasLabelText: icdNameController.text !=
'' ? true : false,
showLabelText: true,
hintText: TranslationBase
.of(context)
.nameOrICD,
fontSize: 13.5,
readOnly: true,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: icdNameController,
suffixIcon: EvaIcons.search,
validator: (value) {
if (value == null)
return TranslationBase
.of(context)
.emptyMessage;
else
return null;
})
// TextField(
// decoration: textFieldSelectorDecoration(
// widget.mySelectedAssessment.selectedICD !=
// null ? widget.mySelectedAssessment
// .selectedICD.code : "Name or ICD",
// widget.mySelectedAssessment.selectedICD !=
// null ? projectViewModel.isArabic
// ? widget.mySelectedAssessment
// .selectedICD.nameAr
// : widget.mySelectedAssessment
// .selectedICD.nameEn : null, true,
// icon: EvaIcons.search),
// enabled: false,
// ),
),
), ),
if(isFormSubmitted && widget.mySelectedAssessment if(isFormSubmitted &&
.selectedICD == null) widget.mySelectedAssessment
.selectedICD == null)
CustomValidationError(), CustomValidationError(),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( TextFields(
height: screenSize.height * 0.070, onTapTextFields: model
child: InkWell( .listOfDiagnosisCondition !=
onTap: model.listOfDiagnosisCondition !=
null null
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
@ -643,6 +731,14 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
widget.mySelectedAssessment widget.mySelectedAssessment
.selectedDiagnosisCondition = .selectedDiagnosisCondition =
selectedValue; selectedValue;
conditionController.text =
projectViewModel.isArabic
? widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameAr
: widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn;
}); });
}, },
); );
@ -655,32 +751,39 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
); );
} }
: null, : null,
child: TextField( hasLabelText: conditionController.text !=
decoration: textFieldSelectorDecoration( '' ? true : false,
TranslationBase.of(context).condition, showLabelText: true,
widget.mySelectedAssessment hintText: TranslationBase
.selectedDiagnosisCondition != null .of(context)
? projectViewModel.isArabic?widget.mySelectedAssessment .condition,
.selectedDiagnosisCondition fontSize: 13.5,
.nameAr:widget.mySelectedAssessment readOnly: true,
.selectedDiagnosisCondition // hintColor: Colors.black,
.nameEn fontWeight: FontWeight.w600,
: null, maxLines: 2,
true), minLines: 1,
enabled: false, controller: conditionController,
), validator: (value) {
), if (value == null)
), return TranslationBase
if(isFormSubmitted && widget.mySelectedAssessment .of(context)
.selectedDiagnosisCondition == null) .emptyMessage;
else
return null;
}),
if(isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisCondition == null)
CustomValidationError(), CustomValidationError(),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container(
height: screenSize.height * 0.070,
child: InkWell( TextFields(
onTap: model.listOfDiagnosisType != null onTapTextFields: model
.listOfDiagnosisType != null
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType, list: model.listOfDiagnosisType,
@ -695,6 +798,12 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
widget.mySelectedAssessment widget.mySelectedAssessment
.selectedDiagnosisType = .selectedDiagnosisType =
selectedValue; selectedValue;
typeController.text =
projectViewModel.isArabic
? selectedValue
.nameAr
: selectedValue
.nameEn;
}); });
}, },
); );
@ -707,22 +816,30 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
); );
} }
: null, : null,
child: TextField( hasLabelText: typeController.text !=
decoration: textFieldSelectorDecoration( '' ? true : false,
TranslationBase.of(context).dType, showLabelText: true,
widget.mySelectedAssessment hintText: TranslationBase
.selectedDiagnosisType != null .of(context)
?projectViewModel.isArabic?widget.mySelectedAssessment .dType,
.selectedDiagnosisType.nameAr: widget.mySelectedAssessment fontSize: 13.5,
.selectedDiagnosisType.nameEn readOnly: true,
: null, // hintColor: Colors.black,
true), fontWeight: FontWeight.w600,
enabled: false, maxLines: 2,
), minLines: 1,
), controller: typeController,
), validator: (value) {
if(isFormSubmitted && widget.mySelectedAssessment if (value == null)
.selectedDiagnosisType == null) return TranslationBase
.of(context)
.emptyMessage;
else
return null;
}),
if(isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisType == null)
CustomValidationError(), CustomValidationError(),
SizedBox( SizedBox(
height: 10, height: 10,
@ -731,17 +848,21 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 0, right: 0, top: 15), left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase.of(context).remarks, hintText: TranslationBase
.of(context)
.remarks,
fontSize: 13.5, fontSize: 13.5,
// hintColor: Colors.black, // hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
maxLines: 18, maxLines: 18,
minLines: 5, minLines: 5,
hasLabelText: remarkController.text != ''?true:false, hasLabelText: remarkController.text !=
'' ? true : false,
showLabelText: true, showLabelText: true,
controller: remarkController, controller: remarkController,
onChanged:(value) { onChanged: (value) {
widget.mySelectedAssessment.remark = remarkController.text; widget.mySelectedAssessment.remark =
remarkController.text;
}, },
validator: (value) { validator: (value) {
if (value == null) if (value == null)

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

@ -76,7 +76,8 @@ class TextFields extends StatefulWidget {
this.hintColor, this.hintColor,
this.hasBorder = true, this.hasBorder = true,
this.onTapTextFields, this.onTapTextFields,
this.hasLabelText = false, this.showLabelText= false}) this.hasLabelText = false,
this.showLabelText = false})
: super(key: key); : super(key: key);
final String hintText; final String hintText;
@ -233,22 +234,21 @@ class _TextFieldsState extends State<TextFields> {
maxLines: widget.maxLines ?? 1, maxLines: widget.maxLines ?? 1,
maxLengthEnforced: widget.maxLengthEnforced, maxLengthEnforced: widget.maxLengthEnforced,
initialValue: widget.initialValue, initialValue: widget.initialValue,
onChanged: (value){ onChanged: (value) {
if(widget.showLabelText) { if (widget.showLabelText) {
if((value== null || value =='' )) { if ((value == null || value == '')) {
setState(() { setState(() {
widget.hasLabelText = false; widget.hasLabelText = false;
}); });
}else{ } else {
setState(() { setState(() {
widget.hasLabelText = true; widget.hasLabelText = true;
}); });
} }
} }
widget.onChanged(value); widget.onChanged(value);
} , },
focusNode: _focusNode, focusNode: _focusNode,
maxLength: widget.maxLength ?? null, maxLength: widget.maxLength ?? null,
controller: widget.controller, controller: widget.controller,
@ -258,10 +258,8 @@ class _TextFieldsState extends State<TextFields> {
autofocus: widget.autoFocus ?? false, autofocus: widget.autoFocus ?? false,
validator: widget.validator, validator: widget.validator,
onSaved: widget.onSaved, onSaved: widget.onSaved,
style: Theme.of(context) style: Theme.of(context).textTheme.bodyText1.copyWith(
.textTheme fontSize: widget.fontSize, fontWeight: widget.fontWeight),
.bodyText1
.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[
WhitelistingTextInputFormatter.digitsOnly, WhitelistingTextInputFormatter.digitsOnly,
@ -271,33 +269,27 @@ class _TextFieldsState extends State<TextFields> {
decoration: InputDecoration( decoration: InputDecoration(
labelText: widget.hasLabelText ? widget.hintText : null, labelText: widget.hasLabelText ? widget.hintText : null,
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: widget.fontSize, fontSize: widget.fontSize,
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
color: widget.hintColor ?? Theme color: widget.hintColor ?? Theme.of(context).hintColor,
.of(context)
.hintColor,
), ),
counterText: "", counterText: "",
hintText: widget.hintText, hintText: widget.hintText,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: widget.fontSize, fontSize: widget.fontSize,
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
color: widget.hintColor ?? Theme color: widget.hintColor ?? Theme.of(context).hintColor,
.of(context)
.hintColor,
), ),
contentPadding: widget.padding != null contentPadding: widget.padding != null
? widget.padding ? widget.padding
: EdgeInsets.symmetric( : EdgeInsets.symmetric(
vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, vertical:
horizontal: 16.0), (widget.bare && !widget.keepPadding) ? 0.0 : 10.0,
horizontal: 16.0),
filled: true, filled: true,
fillColor: widget.bare fillColor: widget.bare
? Colors.transparent ? Colors.transparent
: Theme : Theme.of(context).backgroundColor,
.of(context)
.backgroundColor,
suffixIcon: _buildSuffixIcon(), suffixIcon: _buildSuffixIcon(),
prefixIcon: widget.prefixIcon, prefixIcon: widget.prefixIcon,
errorStyle: TextStyle( errorStyle: TextStyle(
@ -305,48 +297,53 @@ class _TextFieldsState extends State<TextFields> {
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
height: widget.borderOnlyError ? 0.0 : null), height: widget.borderOnlyError ? 0.0 : null),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide( borderSide: widget.hasBorder
color: Theme ? BorderSide(
.of(context) color: Theme.of(context)
.errorColor .errorColor
.withOpacity(widget.bare ? 0.0 : 0.5), .withOpacity(widget.bare ? 0.0 : 0.5),
width: 1.0) : BorderSide( width: 1.0)
color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular( borderRadius: widget.hasBorder
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),), ? BorderRadius.circular(widget.bare ? 0.0 : 8.0)
: BorderRadius.circular(0.0),
),
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide( borderSide: widget.hasBorder
color: Theme ? BorderSide(
.of(context) color: Theme.of(context)
.errorColor .errorColor
.withOpacity(widget.bare ? 0.0 : 0.5), .withOpacity(widget.bare ? 0.0 : 0.5),
width: 1.0) : BorderSide( width: 1.0)
color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide( borderSide: widget.hasBorder
color: Colors.grey, width: 1.0) : BorderSide( ? BorderSide(color: Colors.grey, width: 1.0)
color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular( borderRadius: widget.hasBorder
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),), ? BorderRadius.circular(widget.bare ? 0.0 : 8.0)
: BorderRadius.circular(0.0),
),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide( borderSide: widget.hasBorder
color: Colors.grey, width: 1.0) : BorderSide( ? BorderSide(color: Colors.grey, width: 1.0)
color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular( borderRadius: widget.hasBorder
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0)), ? BorderRadius.circular(widget.bare ? 0.0 : 8.0)
: BorderRadius.circular(0.0)),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder ? BorderSide( borderSide: widget.hasBorder
color: Colors.grey, width: 1.0) : BorderSide( ? BorderSide(color: Colors.grey, width: 1.0)
color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder ? BorderRadius.circular( borderRadius: widget.hasBorder
widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0), ? BorderRadius.circular(widget.bare ? 0.0 : 8.0)
: BorderRadius.circular(0.0),
), ),
), ),
), ),
], ],
), ),
)); ));
} }
} }

Loading…
Cancel
Save