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

merge-requests/298/head
Elham Rababah 5 years ago
commit 753ef3bfb0

@ -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';
@ -193,6 +194,9 @@ const DRUG_TO_DRUG =
const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile';
const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards';
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': "الموافقة مطلوبة"},
@ -689,5 +695,8 @@ 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': "تفاصيل التشخيص"},
// 'icd': {'en': "ICD", 'ar': " "}, // 'icd': {'en': "ICD", '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,18 @@
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> wardList = []; List<dynamic> wardList = [];
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 +28,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 +44,26 @@ 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(), body: Map(),
); );
} }
@ -86,4 +113,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);
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
}
} }

@ -197,12 +197,13 @@ 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(

@ -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,6 +13,8 @@ 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;
@ -24,33 +27,44 @@ class AdmissionRequestViewModel extends BaseViewModel{
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 } 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;
@ -60,7 +74,7 @@ class AdmissionRequestViewModel extends BaseViewModel{
} }
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 +90,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) {

@ -137,9 +137,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: (_) => AdmissionRequestThirdScreen(),
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,

@ -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,
@ -86,9 +88,10 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
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);
Navigator.of(context).popUntil((route) {
return route.settings.name == PATIENTS_PROFILE; return route.settings.name == PATIENTS_PROFILE;
}); });
} else { } else {
@ -98,8 +101,8 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
), ),
), ),
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[

@ -1,29 +1,43 @@
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/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 _postPlansEstimatedCostController = TextEditingController(); final _postPlansEstimatedCostController = TextEditingController();
final _dietTypeRemarksController = TextEditingController(); final _dietTypeRemarksController = TextEditingController();
DateTime _dischargeDate; final _estimatedCostController = TextEditingController();
// DateTime _dischargeDate;
dynamic _selectedClinic;
dynamic _selectedDoctor;
dynamic _selectedDietType; dynamic _selectedDietType;
@override @override
@ -31,9 +45,9 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
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.getMasterLookup(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).admissionRequest, appBarTitle: TranslationBase.of(context).admissionRequest,
@ -56,19 +70,181 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
height: 16, height: 16,
), ),
AppText( AppText(
TranslationBase.of(context).postPlansEstimatedCost, TranslationBase.of(context)
.specialityAndDoctorDetail,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
SizedBox(
height: 20,
),
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( 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( child: TextField(
decoration: decoration:
Helpers.textFieldSelectorDecoration( Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.doctor,
_selectedDoctor != null
? _selectedDoctor[
'DoctorName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
AppText(
TranslationBase.of(context) TranslationBase.of(context)
.postPlansEstimatedCost, .postPlansEstimatedCost,
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)
.estimatedCost,
null,
false),
enabled: true,
controller: _estimatedCostController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
keyboardType: TextInputType.number,
)),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).postPlans,
null, null,
false), false),
enabled: true, enabled: true,
@ -80,15 +256,14 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( /* Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (_dischargeDate == null) { if (_dischargeDate == null) {
_dischargeDate = DateTime.now(); _dischargeDate = DateTime.now();
} }
_selectDate( _selectDate(context, _dischargeDate,
context, _dischargeDate,
(picked) { (picked) {
setState(() { setState(() {
_dischargeDate = picked; _dischargeDate = picked;
@ -114,40 +289,56 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),*/
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: /*model.doctorsList != null && onTap: model.dietTypesList != null &&
model.doctorsList.length > 0 model.dietTypesList.length > 0
? () { ? () {
ListSelectDialog dialog = openListDialogField('nameEn', 'id',
ListSelectDialog( model.dietTypesList,
list: model.doctorsList, (selectedValue) {
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() { setState(() {
_selectedDoctor = selectedValue; _selectedDietType =
selectedValue;
});
}); });
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
} }
:*/ null, : () 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( child: TextField(
decoration: Helpers.textFieldSelectorDecoration( decoration:
TranslationBase.of(context).dietType, Helpers.textFieldSelectorDecoration(
/* _admissionType != null TranslationBase.of(context)
? _admissionType['DoctorName'] .dietType,
:*/ null, _selectedDietType != null
? _selectedDietType['nameEn']
: null,
true), true),
enabled: false, enabled: false,
), ),
@ -180,9 +371,34 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton( child: AppButton(
title: TranslationBase.of(context).save, title: TranslationBase.of(context).next,
color: HexColor("#B8382B"), color: HexColor("#B8382B"),
onPressed: null, onPressed: () {
model.admissionRequestData = AdmissionRequest();
if (_selectedClinic != null &&
_selectedDoctor != null &&
_estimatedCostController.text != "" &&
_postPlansEstimatedCostController.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.estimatedCost = int.parse(_estimatedCostController.text);
model.admissionRequestData.elementsForImprovement = _postPlansEstimatedCostController.text;
model.admissionRequestData.isDietType = _selectedDietType != null ? true : false;
model.admissionRequestData.dietType = _selectedDietType != null ? _selectedDietType['id'] : 0;
model.admissionRequestData.dietRemarks = _dietTypeRemarksController.text;
Navigator.of(context).pushNamed(
PATIENT_ADMISSION_REQUEST_2,
arguments: {'patient': patient, 'admission-data' : model.admissionRequestData});
} else {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseFill);
}
},
), ),
), ),
], ],
@ -205,4 +421,25 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
updateDate(picked); 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;
},
);
}
} }

@ -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';
@ -32,20 +34,29 @@ class _AdmissionRequestSecondScreenState
extends State<AdmissionRequestSecondScreen> { extends State<AdmissionRequestSecondScreen> {
final _expectedDaysController = TextEditingController(); final _expectedDaysController = TextEditingController();
final _treatmentLineController = TextEditingController(); final _treatmentLineController = TextEditingController();
final _preOperativeOrdersController = TextEditingController();
// final _preOperativeOrdersController = TextEditingController();
DateTime _expectedAdmissionDate; DateTime _expectedAdmissionDate;
bool _emergencyAdmission = false;
// bool _emergencyAdmission = false;
bool _isSickLeaveRequired = false;
bool _patientPregnant = false; bool _patientPregnant = false;
bool _preAnesthesiaReferred = false;
// bool _preAnesthesiaReferred = false;
dynamic _selectedWard; dynamic _selectedWard;
dynamic _selectedAdmissionType; dynamic _selectedAdmissionType;
dynamic _selectedDiagnosis; dynamic _selectedDiagnosis;
dynamic _selectedAllergies; dynamic _selectedIcd;
dynamic _selectedDiagnosisType;
// 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);
@ -134,6 +145,7 @@ class _AdmissionRequestSecondScreenState
SizedBox( SizedBox(
height: 10, height: 10,
), ),
/*
CheckboxListTile( CheckboxListTile(
title: AppText( title: AppText(
TranslationBase.of(context) TranslationBase.of(context)
@ -151,6 +163,24 @@ class _AdmissionRequestSecondScreenState
ListTileControlAffinity.leading, ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0), contentPadding: EdgeInsets.all(0),
), ),
*/
CheckboxListTile(
title: AppText(
TranslationBase.of(context)
.isSickLeaveRequired,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.1,
),
value: _isSickLeaveRequired,
onChanged: (newValue) {
setState(() {
_isSickLeaveRequired = newValue;
});
},
controlAffinity:
ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0),
),
CheckboxListTile( CheckboxListTile(
title: AppText( title: AppText(
TranslationBase.of(context).patientPregnant, TranslationBase.of(context).patientPregnant,
@ -199,7 +229,11 @@ class _AdmissionRequestSecondScreenState
}); });
} }
: () async { : () async {
await model.getWards(); GifLoaderDialogUtils.showMyDialog(
context);
await model.getWards().then((_) =>
GifLoaderDialogUtils.hideDialog(
context));
if (model.state == ViewState.Idle && if (model.state == ViewState.Idle &&
model.wardList.length > 0) { model.wardList.length > 0) {
openListDialogField('description', openListDialogField('description',
@ -230,7 +264,7 @@ class _AdmissionRequestSecondScreenState
), ),
), ),
), ),
CheckboxListTile( /* CheckboxListTile(
title: AppText( title: AppText(
TranslationBase.of(context) TranslationBase.of(context)
.preAnesthesiaReferred, .preAnesthesiaReferred,
@ -246,6 +280,9 @@ class _AdmissionRequestSecondScreenState
controlAffinity: controlAffinity:
ListTileControlAffinity.leading, ListTileControlAffinity.leading,
contentPadding: EdgeInsets.all(0), contentPadding: EdgeInsets.all(0),
),*/
SizedBox(
height: 10,
), ),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
@ -263,9 +300,15 @@ class _AdmissionRequestSecondScreenState
}); });
} }
: () async { : () async {
await model.getMasterLookup( GifLoaderDialogUtils.showMyDialog(
context);
await model
.getMasterLookup(
MasterKeysService MasterKeysService
.AdmissionRequestType); .AdmissionRequestType)
.then((_) =>
GifLoaderDialogUtils
.hideDialog(context));
if (model.state == ViewState.Idle && if (model.state == ViewState.Idle &&
model.admissionTypeList.length > model.admissionTypeList.length >
0) { 0) {
@ -303,6 +346,17 @@ class _AdmissionRequestSecondScreenState
SizedBox( SizedBox(
height: 10, height: 10,
), ),
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).diagnosisDetail,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 10,
),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
@ -319,7 +373,11 @@ class _AdmissionRequestSecondScreenState
}); });
} }
: () async { : () async {
await model.getDiagnosis(); GifLoaderDialogUtils.showMyDialog(
context);
await model.getDiagnosis().then(
(_) => GifLoaderDialogUtils
.hideDialog(context));
if (model.state == ViewState.Idle && if (model.state == ViewState.Idle &&
model.diagnosisTypesList model.diagnosisTypesList
.length > .length >
@ -360,6 +418,133 @@ class _AdmissionRequestSecondScreenState
height: 10, height: 10,
), ),
Container( Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.icdCodes != null &&
model.icdCodes.length > 0
? () {
openListDialogField('description',
'code', model.icdCodes,
(selectedValue) {
setState(() {
_selectedIcd = selectedValue;
});
});
}
: () 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(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).icd,
_selectedIcd != null
? _selectedIcd['description']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.listOfDiagnosisSelectionTypes !=
null &&
model.listOfDiagnosisSelectionTypes
.length >
0
? () {
openListDialogField(
'description',
'code',
model
.listOfDiagnosisSelectionTypes,
(selectedValue) {
setState(() {
_selectedDiagnosisType =
selectedValue;
});
});
}
: () async {
GifLoaderDialogUtils.showMyDialog(
context);
await model
.getMasterLookup(
MasterKeysService
.DiagnosisSelectionType)
.then((_) =>
GifLoaderDialogUtils
.hideDialog(context));
if (model.state == ViewState.Idle &&
model.listOfDiagnosisSelectionTypes
.length >
0) {
openListDialogField(
'description',
'code',
model
.listOfDiagnosisSelectionTypes,
(selectedValue) {
setState(() {
_selectedDiagnosisType =
selectedValue;
});
});
} else if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} else {
DrAppToastMsg.showErrorToast(
"Empty List");
}
},
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context)
.diagnoseType,
_selectedDiagnosisType != null
? _selectedDiagnosisType[
'description']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
/*Container(
child: TextField( child: TextField(
decoration: decoration:
Helpers.textFieldSelectorDecoration( Helpers.textFieldSelectorDecoration(
@ -425,7 +610,7 @@ class _AdmissionRequestSecondScreenState
enabled: false, enabled: false,
), ),
), ),
), ),*/
], ],
), ),
), ),
@ -436,12 +621,48 @@ class _AdmissionRequestSecondScreenState
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton( child: AppButton(
title: TranslationBase.of(context).next, title: TranslationBase.of(context).save,
color: HexColor("#B8382B"), color: HexColor("#B8382B"),
onPressed: () { onPressed: () async {
Navigator.of(context).pushNamed( if (_expectedDaysController.text != "" &&
PATIENT_ADMISSION_REQUEST_3, _expectedAdmissionDate != null &&
arguments: {'patient': patient}); _treatmentLineController.text != "" &&
_selectedWard != null &&
_selectedAdmissionType != null &&
_selectedDiagnosis != null &&
_selectedIcd != null &&
_selectedDiagnosisType != null) {
model.admissionRequestData = admissionRequest;
model.admissionRequestData.expectedDays = int.parse(_expectedDaysController.text);
model.admissionRequestData.admissionDate = _expectedAdmissionDate.toIso8601String();
model.admissionRequestData.isSickLeaveRequired = _isSickLeaveRequired;
model.admissionRequestData.isPregnant = _patientPregnant;
model.admissionRequestData.mainLineOfTreatment = _treatmentLineController.text;
model.admissionRequestData.wardID = 0;
model.admissionRequestData.admissionType = _selectedAdmissionType['id'];
dynamic admissionRequestDiagnoses = [
{
'diagnosisDescription' : _selectedDiagnosis['nameEn'],
'diagnosisType' : _selectedDiagnosis['id'],
'icdCode' : _selectedIcd['code'],
'icdCodeDescription' : _selectedIcd['description'],
'type' : _selectedDiagnosisType['code'],
'remarks' : "",
'isActive' : true,
}
];
model.admissionRequestData.admissionRequestDiagnoses = admissionRequestDiagnoses;
model.admissionRequestData.admissionRequestProcedures = [];
await model.makeAdmissionRequest();
if(model.state == ViewState.ErrorLocal){
DrAppToastMsg.showErrorToast(
model.error);
}
} else {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).pleaseFill);
}
}, },
), ),
), ),
@ -486,38 +707,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");
}
},
*/
} }

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

@ -103,6 +103,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
clinicDescription: null, clinicDescription: null,
remark: model.patientReferral[0].remarksFromSource, remark: model.patientReferral[0].remarksFromSource,
referredOn: model.patientReferral[0].referredOn, referredOn: model.patientReferral[0].referredOn,
answerFromTarget:
model.patientReferral[0].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,7 +543,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
), ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( //model.patientAssessmentList.forEach((element) { }).
Column(
children: model.patientAssessmentList
.map((element) {
return Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: indicationList != null onTap: indicationList != null
@ -544,36 +557,43 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
list: indicationList, list: indicationList,
attributeName: 'name', attributeName: 'name',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText: TranslationBase.of(
TranslationBase.of(context) context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
indication = selectedValue; indication =
selectedValue;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) { builder:
(BuildContext context) {
return dialog; return dialog;
}, },
); );
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration:
TranslationBase.of(context) textFieldSelectorDecoration(
.indication, element.icdCode10ID
.toString(),
indication != null indication != null
? indication['name'] ? indication['name']
: null, : null,
true), true),
enabled: false, 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,7 +709,31 @@ 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(
icdCode: model
.patientAssessmentList[
0]
.icdCode10ID
.isEmpty
? "test"
: model
.patientAssessmentList[
0]
.icdCode10ID
.toString(),
// icdCode: model
// .patientAssessmentList
// .map((value) => value
// .icdCode10ID
// .trim())
// .toList()
// .join(' '),
dose: strengthController.text, dose: strengthController.text,
doseUnit: doseUnit:
units['id'].toString(), units['id'].toString(),
@ -700,8 +743,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
model: widget.model, model: widget.model,
duration: duration:
duration['id'].toString(), duration['id'].toString(),
frequency: frequency['id'] frequency:
.toString(), frequency['id'].toString(),
route: route['id'].toString(), route: route['id'].toString(),
drugId: _selectedMedication drugId: _selectedMedication
.itemId .itemId
@ -711,9 +754,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
indication: indication:
indicationController.text, indicationController.text,
instruction: instruction:
instructionController instructionController.text,
.text, doseTime: selectedDate,
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,14 +456,17 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.edit), .edit),
onTap: () { onTap: () {
updatePrescriptionForm( updatePrescriptionForm(
doseUnit: drugNameGeneric: model
model.prescriptionList[0].entityList[index].doseDailyUnitID .prescriptionList[
0]
.entityList[
index]
.medicationName,
doseUnit: model.prescriptionList[0].entityList[index].doseDailyUnitID
.toString(), .toString(),
doseStreangth: doseStreangth: model.prescriptionList[0].entityList[index].doseDailyQuantity
model.prescriptionList[0].entityList[index].doseDailyQuantity
.toString(), .toString(),
duration: duration: model.prescriptionList[0].entityList[index].doseDurationDays
model.prescriptionList[0].entityList[index].doseDurationDays
.toString(), .toString(),
startDate: startDate:
model.prescriptionList[0].entityList[index].startDate model.prescriptionList[0].entityList[index].startDate
@ -451,12 +478,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
index] index]
.doseTimingID .doseTimingID
.toString(), .toString(),
frequency: model frequency:
.prescriptionList[ model.prescriptionList[0].entityList[index].frequencyID
0]
.entityList[
index]
.frequencyID
.toString(), .toString(),
rouat: model rouat: model
.prescriptionList[ .prescriptionList[
@ -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,8 +305,10 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
FontWeight FontWeight
.w700, .w700,
fontSize: fontSize:
15.0, 14.0,
), ),
Expanded(
child:
AppText( AppText(
model.procedureList[0].entityList[index].orderType == model.procedureList[0].entityList[index].orderType ==
1 1
@ -310,6 +319,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
color: Color( color: Color(
0xFFB9382C), 0xFFB9382C),
), ),
),
], ],
), ),
Row( Row(
@ -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,12 +86,19 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
(BuildContext context, ProcedureViewModel model, Widget child) => (BuildContext context, ProcedureViewModel model, Widget child) =>
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: DraggableScrollableSheet(
minChildSize: 0.90,
initialChildSize: 0.95,
maxChildSize: 1.0,
builder:
(BuildContext context, ScrollController scrollController) {
return SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.95, height: MediaQuery.of(context).size.height * 1.20,
child: Form( child: Form(
child: Padding( child: Padding(
padding: padding: EdgeInsets.symmetric(
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), horizontal: 20.0, vertical: 10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -108,16 +115,20 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
onTap: model.categoryList != null && onTap: model.categoryList != null &&
model.categoryList.length > 0 model.categoryList.length > 0
? () { ? () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog =
ListSelectDialog(
list: model.categoryList, list: model.categoryList,
attributeName: 'categoryName', attributeName: 'categoryName',
attributeValueId: 'categoryId', attributeValueId: 'categoryId',
okText: TranslationBase.of(context).ok, okText:
TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
selectedCategory = selectedValue; selectedCategory =
selectedValue;
model.getProcedureCategory( model.getProcedureCategory(
categoryName: selectedCategory[ categoryName:
selectedCategory[
'categoryName']); 'categoryName']);
}); });
}, },
@ -134,7 +145,8 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase.of(context).procedureCategorise, TranslationBase.of(context)
.procedureCategorise,
selectedCategory != null selectedCategory != null
? selectedCategory['categoryName'] ? selectedCategory['categoryName']
: null, : null,
@ -152,8 +164,8 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
baseViewModel: model, baseViewModel: model,
child: EntityListCheckboxSearchWidget( child: EntityListCheckboxSearchWidget(
model: widget.model, model: widget.model,
masterList: masterList: widget
widget.model.categoriesList[0].entityList, .model.categoriesList[0].entityList,
removeHistory: (item) { removeHistory: (item) {
setState(() { setState(() {
entityList.remove(item); entityList.remove(item);
@ -175,7 +187,8 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
Container( Container(
child: Row( child: Row(
children: [ children: [
AppText(TranslationBase.of(context).orderType), AppText(
TranslationBase.of(context).orderType),
Radio( Radio(
activeColor: Color(0xFFB9382C), activeColor: Color(0xFFB9382C),
value: 0, value: 0,
@ -205,19 +218,22 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))), width: 1.0,
color: HexColor("#CCCCCC"))),
child: TextFields( child: TextFields(
hintText: widget.remarks, hintText: widget.remarks,
fontSize: 15.0,
controller: widget.remarksController, controller: widget.remarksController,
maxLines: 5, maxLines: 3,
minLines: 3, minLines: 2,
), ),
), ),
SizedBox( SizedBox(
height: 50.0, height: 50.0,
), ),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 2),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
@ -234,7 +250,8 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
entityList: entityList, entityList: entityList,
patient: widget.patient, patient: widget.patient,
model: widget.model, model: widget.model,
remarks: widget.remarksController.text); remarks:
widget.remarksController.text);
// authorizationForm(context); // authorizationForm(context);
}, },
), ),
@ -245,6 +262,8 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
), ),
), ),
)), )),
);
}),
), ),
); );
}); });

@ -639,68 +639,153 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model2.coveringDoctors.length > 0 model2.coveringDoctors.length > 0
? Expanded( ? Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: child: DropdownSearch(
DropdownButtonHideUnderline( mode: Mode.BOTTOM_SHEET,
child: DropdownButton(
focusColor: Colors.grey, dropdownSearchDecoration:
isExpanded: true, InputDecoration(
value: doctorID == null contentPadding:
? model2 EdgeInsets.all(
.coveringDoctors[0] 0),
['doctorID'] border: InputBorder
.toString() .none),
: doctorID, //maxHeight: 300,
iconSize: 40, items: model2
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return model2
.coveringDoctors .coveringDoctors
.map((item) { .map((item) {
return Row( return projectsProvider
mainAxisSize:
MainAxisSize.max,
children: <Widget>[
AppText(
projectsProvider
.isArabic .isArabic
? item[ ? item['doctorNameN']
'doctorNameN'] : item['doctorName'];
: item[ }).toList(),
'doctorName'], // label: "Doctor List",
fontSize: SizeConfig onChanged: (item) {
.textMultiplier * model2.coveringDoctors
2.1, .forEach((newVal) => {
), if (newVal['doctorName'] ==
], item ||
); newVal['doctorName'] ==
}).toList(); item)
}, {
onChanged: (newValue) => { doctorID =
setState(() { newVal[
doctorID = newValue; 'DoctorID']
}) }
});
}, },
items: model2 selectedItem:
.coveringDoctors getSelectedDoctor(
.map((item) { model2),
return DropdownMenuItem< showSearchBox: true,
String>( searchBoxDecoration:
value: item['doctorID'] InputDecoration(
.toString(), border:
OutlineInputBorder(),
contentPadding:
EdgeInsets.fromLTRB(
12, 12, 8, 0),
labelText:
"Search Doctor",
),
popupTitle: Container(
height: 50,
decoration: BoxDecoration(
color: Theme.of(context)
.primaryColorDark,
borderRadius:
BorderRadius.only(
topLeft:
Radius.circular(
20),
topRight:
Radius.circular(
20),
),
),
child: Center(
child: Text( child: Text(
projectsProvider '',
.isArabic style: TextStyle(
? item[ fontSize: 24,
'doctorNameN'] fontWeight:
: item[ FontWeight.bold,
'doctorName'], color: Colors.white,
textAlign:
TextAlign.start,
), ),
); ),
}).toList(), ),
)), ),
popupShape:
RoundedRectangleBorder(
borderRadius:
BorderRadius.only(
topLeft:
Radius.circular(24),
topRight:
Radius.circular(24),
),
),
),
// DropdownButtonHideUnderline(
// child: DropdownButton(
// focusColor: Colors.grey,
// isExpanded: true,
// value: doctorID == null
// ? model2
// .coveringDoctors[0]
// ['doctorID']
// .toString()
// : doctorID,
// iconSize: 40,
// elevation: 16,
// selectedItemBuilder:
// (BuildContext context) {
// return model2
// .coveringDoctors
// .map((item) {
// return Row(
// mainAxisSize:
// MainAxisSize.max,
// children: <Widget>[
// AppText(
// projectsProvider
// .isArabic
// ? item[
// 'doctorNameN']
// : item[
// 'doctorName'],
// fontSize: SizeConfig
// .textMultiplier *
// 2.1,
// ),
// ],
// );
// }).toList();
// },
// onChanged: (newValue) => {
// setState(() {
// doctorID = newValue;
// })
// },
// items: model2
// .coveringDoctors
// .map((item) {
// return DropdownMenuItem<
// String>(
// value: item['doctorID']
// .toString(),
// child: Text(
// projectsProvider
// .isArabic
// ? item[
// 'doctorNameN']
// : item[
// 'doctorName'],
// textAlign:
// TextAlign.start,
// ),
// );
// }).toList(),
// )),
) )
: SizedBox(), : SizedBox(),
], ],
@ -775,6 +860,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
toDate = _toDateController2.text; toDate = _toDateController2.text;
fromDate = _toDateController.text; fromDate = _toDateController.text;
this.reason = widget.updateData.reasonId.toString(); this.reason = widget.updateData.reasonId.toString();
doctorID = widget.updateData.coveringDoctorId;
} }
}); });
} }
@ -910,4 +996,19 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
} }
}); });
} }
getSelectedDoctor(model2) {
var doctorName;
if (doctorID == null)
return projectsProvider.isArabic
? model2.coveringDoctors[0]['doctorNameN']
: model2.coveringDoctors[0]['doctorName'];
else {
model2.coveringDoctors.forEach((newVal) => {
if (newVal['doctorID'].toString() == doctorID)
{doctorName = newVal['doctorName']}
});
return doctorName;
}
}
} }

@ -725,6 +725,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 +764,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 +869,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];
@ -1078,6 +1084,9 @@ 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 patientName => String get patientName =>
localizedValues['patient-name'][locale.languageCode]; localizedValues['patient-name'][locale.languageCode];

@ -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,
}); });
@ -207,6 +209,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,
), ),

@ -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:
(widget.bare && !widget.keepPadding) ? 0.0 : 10.0,
horizontal: 16.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