Merge branch 'development' into feature-ucaf

merge-requests/273/head
mosazaid 5 years ago
commit e75318799f

Binary file not shown.

@ -26,7 +26,9 @@ 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_PROJECTS = 'Services/Lists.svc/REST/GetProjectForDoctorAPP'; //const GET_PROJECTS = 'Services/Lists.svc/REST/GetProjectForDoctorAPP';
const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo';
const GET_PATIENT_VITAL_SIGN = const GET_PATIENT_VITAL_SIGN =
'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_VITAL_SIGN_DATA = const GET_PATIENT_VITAL_SIGN_DATA =

@ -7,7 +7,7 @@ const Map<String, Map<String, String>> localizedValues = {
'theDoctor': {'en': 'Doctor', 'ar': 'الطبيب'}, 'theDoctor': {'en': 'Doctor', 'ar': 'الطبيب'},
'reply': {'en': 'Reply', 'ar': 'رد'}, 'reply': {'en': 'Reply', 'ar': 'رد'},
'time': {'en': 'Time', 'ar': 'الوقت'}, 'time': {'en': 'Time', 'ar': 'الوقت'},
'fileNo': {'en': 'File No:', 'ar': 'رقم الملف:'}, 'fileNo': {'en': 'File No : ', 'ar': 'رقم الملف :'},
'mobileNo': {'en': 'Mobile No', 'ar': 'رقم الموبايل'}, 'mobileNo': {'en': 'Mobile No', 'ar': 'رقم الموبايل'},
'messagesScreenToolbarTitle': {'en': 'Messages', 'ar': 'الرسائل'}, 'messagesScreenToolbarTitle': {'en': 'Messages', 'ar': 'الرسائل'},
'mySchedule': {'en': 'Schedule', 'ar': 'جدولي'}, 'mySchedule': {'en': 'Schedule', 'ar': 'جدولي'},
@ -29,7 +29,7 @@ const Map<String, Map<String, String>> localizedValues = {
'en': 'Answer/Suggestions', 'en': 'Answer/Suggestions',
'ar': 'ملاحضات وتفاصيل العيادة' 'ar': 'ملاحضات وتفاصيل العيادة'
}, },
'outPatients': {'en': 'Out-Patients', 'ar': 'ةالمريض الخارجي'}, 'outPatients': {'en': 'Out-Patients', 'ar': 'المريض الخارجي'},
'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'}, 'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'},
'searchAbout': {'en': 'Search', 'ar': 'البحث عن'}, 'searchAbout': {'en': 'Search', 'ar': 'البحث عن'},
'patient': {'en': 'Patient', 'ar': ' مريض'}, 'patient': {'en': 'Patient', 'ar': ' مريض'},
@ -37,14 +37,14 @@ const Map<String, Map<String, String>> localizedValues = {
'lab': {'en': 'Lab', 'ar': 'المختبر'}, 'lab': {'en': 'Lab', 'ar': 'المختبر'},
'result': {'en': 'Result', 'ar': 'نتيجة'}, 'result': {'en': 'Result', 'ar': 'نتيجة'},
'todayStatistics': {'en': 'Today Statistics', 'ar': 'إحصائيات اليوم'}, 'todayStatistics': {'en': 'Today Statistics', 'ar': 'إحصائيات اليوم'},
'arrived': {'en': 'Arrived', 'ar': 'وصل'}, 'arrived': {'en': 'Arrival Patients', 'ar': ' المرضى الواصلين'},
'er': {'en': 'ER', 'ar': 'حالة طوارئ'}, 'er': {'en': 'ER', 'ar': 'حالة طوارئ'},
'walkIn': {'en': 'Walk-in', 'ar': 'ادخل'}, 'walkIn': {'en': 'Walk-in', 'ar': 'ادخل'},
'notArrived': {'en': 'Not Arrived', 'ar': 'لم يصل'}, 'notArrived': {'en': 'Not Arrived', 'ar': 'لم يصل'},
'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'},
'service': {'en': 'Service', 'ar': 'خدمة'}, 'service': {'en': 'Service', 'ar': 'خدمة'},
'referral': {'en': 'Referral', 'ar': 'االإحالة'}, 'referral': {'en': 'Referral', 'ar': 'االإحالة'},
'inPatient': {'en': 'In-Patient', 'ar': 'االمريض الداخلي'}, 'inPatient': {'en': 'In-Patient', 'ar': 'المريض الداخلي'},
'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'},
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, 'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'},
@ -329,7 +329,7 @@ const Map<String, Map<String, String>> localizedValues = {
'referredFrom': {'en': "Referred From", 'ar': 'محال من'}, 'referredFrom': {'en': "Referred From", 'ar': 'محال من'},
'branch': {'en': "Branch", 'ar': 'الفرع'}, 'branch': {'en': "Branch", 'ar': 'الفرع'},
'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'}, 'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'},
'appointmentNo': {'en': "Appointment #:", 'ar': '# الموعد:'}, 'appointmentNo': {'en': "Appointment # : ", 'ar': '# الموعد:'},
'refer': {'en': "REFER", 'ar': 'إحالة'}, 'refer': {'en': "REFER", 'ar': 'إحالة'},
'rejected': {'en': "Rejected", 'ar': 'مرفوض'}, 'rejected': {'en': "Rejected", 'ar': 'مرفوض'},
'sameBranch': {'en': "Same Branch", 'ar': 'نفس الفرع'}, 'sameBranch': {'en': "Same Branch", 'ar': 'نفس الفرع'},
@ -582,7 +582,7 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
'searchExamination': {'en': "Search Examination", 'ar': "فحص البحث"}, 'searchExamination': {'en': "Search Examination", 'ar': "فحص البحث"},
'addExamination': {'en': "Add Examination", 'ar': "اضافه"}, 'addExamination': {'en': "Add Examination", 'ar': "اضافه"},
'doc': {'en': "Doc :", 'ar': " د: "}, 'doc': {'en': "Doc : ", 'ar': " د : "},
'patientNoDetailErrMsg': { 'patientNoDetailErrMsg': {
'en': "There is no detail for this patient", 'en': "There is no detail for this patient",
'ar': "لا توجد تفاصيل لهذا المريض" 'ar': "لا توجد تفاصيل لهذا المريض"

@ -0,0 +1,18 @@
class Controls {
String code;
String controlValue;
Controls({this.code, this.controlValue});
Controls.fromJson(Map<String, dynamic> json) {
code = json['Code'];
controlValue = json['ControlValue'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Code'] = this.code;
data['ControlValue'] = this.controlValue;
return data;
}
}

@ -1,3 +1,5 @@
import 'ControlsModel.dart';
class PostProcedureReqModel { class PostProcedureReqModel {
int patientMRN; int patientMRN;
int appointmentNo; int appointmentNo;
@ -66,22 +68,3 @@ class Procedures {
return data; return data;
} }
} }
class Controls {
String code;
String controlValue;
Controls({this.code, this.controlValue});
Controls.fromJson(Map<String, dynamic> json) {
code = json['Code'];
controlValue = json['ControlValue'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Code'] = this.code;
data['ControlValue'] = this.controlValue;
return data;
}
}

@ -0,0 +1,75 @@
import 'ControlsModel.dart';
class UpdateProcedureRequestModel {
int orderNo;
int patientMRN;
int appointmentNo;
int episodeID;
int lineItemNo;
ProcedureDetail procedureDetail;
String vidaAuthTokenID;
UpdateProcedureRequestModel(
{this.orderNo,
this.patientMRN,
this.appointmentNo,
this.episodeID,
this.lineItemNo,
this.procedureDetail,
this.vidaAuthTokenID});
UpdateProcedureRequestModel.fromJson(Map<String, dynamic> json) {
orderNo = json['OrderNo'];
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeID = json['EpisodeID'];
lineItemNo = json['LineItemNo'];
procedureDetail = json['procedureDetail'] != null
? new ProcedureDetail.fromJson(json['procedureDetail'])
: null;
vidaAuthTokenID = json['VidaAuthTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['OrderNo'] = this.orderNo;
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeID;
data['LineItemNo'] = this.lineItemNo;
if (this.procedureDetail != null) {
data['procedureDetail'] = this.procedureDetail.toJson();
}
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
return data;
}
}
class ProcedureDetail {
String procedure;
String category;
List<Controls> controls;
ProcedureDetail({this.procedure, this.category, this.controls});
ProcedureDetail.fromJson(Map<String, dynamic> json) {
procedure = json['Procedure'];
category = json['Category'];
if (json['Controls'] != null) {
controls = new List<Controls>();
json['Controls'].forEach((v) {
controls.add(new Controls.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Procedure'] = this.procedure;
data['Category'] = this.category;
if (this.controls != null) {
data['Controls'] = this.controls.map((v) => v.toJson()).toList();
}
return data;
}
}

@ -217,7 +217,9 @@ class SOAPService extends LookupService {
await baseAppClient.post (GET_ALLERGY, await baseAppClient.post (GET_ALLERGY,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success");
patientAllergiesList.clear(); patientAllergiesList.clear();
response['List_Allergies']['entityList'].forEach((v) { response['List_Allergies']['entityList'].forEach((v) {
patientAllergiesList.add(GetAllergiesResModel.fromJson(v)); patientAllergiesList.add(GetAllergiesResModel.fromJson(v));
}); });

@ -24,11 +24,7 @@ class PrescriptionService extends BaseService {
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel();
SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel(
//search: ["Acetaminophen"], //search: ["Acetaminophen"],
// vidaAuthTokenID:
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio",
search: ["Amoxicillin"], search: ["Amoxicillin"],
//vidaAuthTokenID:
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio",
); );
PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel _postPrescriptionReqModel =
@ -65,17 +61,17 @@ class PrescriptionService extends BaseService {
Future getMedicationList() async { Future getMedicationList() async {
hasError = false; hasError = false;
_drugRequestModel.search =[""]; _drugRequestModel.search = [""];
await baseAppClient.post(SEARCH_DRUG, await baseAppClient.post(SEARCH_DRUG,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
allMedicationList = []; allMedicationList = [];
response['MedicationList']['entityList'].forEach((v) { response['MedicationList']['entityList'].forEach((v) {
allMedicationList.add(GetMedicationResponseModel.fromJson(v)); allMedicationList.add(GetMedicationResponseModel.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _drugRequestModel.toJson()); }, body: _drugRequestModel.toJson());
} }
Future postPrescription( Future postPrescription(

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_re
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/update_procedure_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:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
@ -104,7 +105,8 @@ class ProcedureService extends BaseService {
}, body: postProcedureReqModel.toJson()); }, body: postProcedureReqModel.toJson());
} }
Future updateProcedure(PostProcedureReqModel postProcedureReqModel) async { Future updateProcedure(
UpdateProcedureRequestModel updateProcedureRequestModel) async {
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post(UPDATE_PROCEDURE, await baseAppClient.post(UPDATE_PROCEDURE,
@ -113,6 +115,6 @@ class ProcedureService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: postProcedureReqModel.toJson()); }, body: updateProcedureRequestModel.toJson());
} }
} }

@ -24,6 +24,8 @@ class SickLeaveService extends BaseService {
dynamic get postReschedule => _postReschedule; dynamic get postReschedule => _postReschedule;
dynamic _postReschedule; dynamic _postReschedule;
dynamic get sickLeaveResponse => _sickLeaveResponse;
dynamic _sickLeaveResponse;
Future getStatistics(appoNo, patientMRN) async { Future getStatistics(appoNo, patientMRN) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
@ -48,10 +50,8 @@ class SickLeaveService extends BaseService {
await baseAppClient.post( await baseAppClient.post(
ADD_SICK_LEAVE, ADD_SICK_LEAVE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
Future.value(response); _sickLeaveResponse = response;
//print(response); return Future.value(response);
// _statistics = {};
// _statistics = response['SickLeaveStatistics'];
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -72,10 +72,8 @@ class SickLeaveService extends BaseService {
await baseAppClient.post( await baseAppClient.post(
EXTEND_SICK_LEAVE, EXTEND_SICK_LEAVE,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
Future.value(response); _sickLeaveResponse = response;
print(response); return Future.value(response);
// _statistics = {};
// _statistics = response['SickLeaveStatistics'];
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -237,13 +237,18 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP,
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { {isLocalBusy = false}) async {
if (isLocalBusy) {
setState(ViewState.Busy); setState(ViewState.BusyLocal);
} else
setState(ViewState.Busy);
await _SOAPService.getPatientAllergy(generalGetReqForSOAP); await _SOAPService.getPatientAllergy(generalGetReqForSOAP);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
if (isLocalBusy) {
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Error); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);

@ -6,7 +6,7 @@ import 'package:flutter/cupertino.dart';
class HospitalViewModel with ChangeNotifier { class HospitalViewModel with ChangeNotifier {
BaseAppClient baseAppClient = BaseAppClient(); BaseAppClient baseAppClient = BaseAppClient();
Future<Map> getProjectsList() async { Future<Map> getProjectsList(memberID) async {
const url = GET_PROJECTS; const url = GET_PROJECTS;
// TODO create model or remove it if no info need // TODO create model or remove it if no info need
var info = { var info = {
@ -17,7 +17,8 @@ class HospitalViewModel with ChangeNotifier {
"Channel": 9, "Channel": 9,
"TokenID": "", "TokenID": "",
"SessionID": "i1UJwCTSqt", "SessionID": "i1UJwCTSqt",
"IsLoginForDoctorApp": true "IsLoginForDoctorApp": true,
"MemberID": memberID
}; };
dynamic localRes; dynamic localRes;

@ -12,8 +12,8 @@ class MedicineViewModel extends BaseViewModel {
get pharmaciesList => _medicineService.pharmaciesList; get pharmaciesList => _medicineService.pharmaciesList;
PrescriptionService _prescriptionService = locator<PrescriptionService>(); PrescriptionService _prescriptionService = locator<PrescriptionService>();
List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList; List<GetMedicationResponseModel> get allMedicationList =>
_prescriptionService.allMedicationList;
Future getMedicineItem(String itemName) async { Future getMedicineItem(String itemName) async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -24,6 +24,7 @@ class MedicineViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getMedicationList() async { Future getMedicationList() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService.getMedicationList(); await _prescriptionService.getMedicationList();

@ -2,7 +2,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient_service.dart';
import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart';
import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart'; import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart';
@ -50,22 +49,23 @@ class PatientViewModel extends BaseViewModel {
_patientService.referalFrequancyList; _patientService.referalFrequancyList;
Future getPatientList(patient, patientType, Future getPatientList(patient, patientType,
{bool isBusyLocal = false}) async { {bool isBusyLocal = false}) async {
var localRes ;
if (isBusyLocal) { if (isBusyLocal) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
return _patientService.getPatientList(patient, patientType); localRes = await _patientService.getPatientList(patient, patientType);
if (_patientService.hasError) { if (_patientService.hasError) {
error = _patientService.error; error = _patientService.error;
if (isBusyLocal) { setState(ViewState.Error);
setState(ViewState.ErrorLocal);
} else { }
setState(ViewState.Error); return localRes;
}
} else
setState(ViewState.Idle);
} }
Future getPatientVitalSign(patient) async { Future getPatientVitalSign(patient) async {

@ -1,5 +1,6 @@
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/model/Prescription_model.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/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart';
@ -13,11 +14,13 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-
class PrescriptionViewModel extends BaseViewModel { class PrescriptionViewModel extends BaseViewModel {
bool hasError = false; bool hasError = false;
PrescriptionService _prescriptionService = locator<PrescriptionService>(); PrescriptionService _prescriptionService = locator<PrescriptionService>();
List<GetMedicationResponseModel> get allMedicationList =>
_prescriptionService.allMedicationList;
List<PrescriptionModel> get prescriptionList => List<PrescriptionModel> get prescriptionList =>
_prescriptionService.prescriptionList; _prescriptionService.prescriptionList;
List<dynamic> get drugsList => _prescriptionService.doctorsList; List<dynamic> get drugsList => _prescriptionService.doctorsList;
List<dynamic> get allMedicationList => _prescriptionService.allMedicationList; //List<dynamic> get allMedicationList => _prescriptionService.allMedicationList;
Future getPrescription({int mrn}) async { Future getPrescription({int mrn}) async {
hasError = false; hasError = false;
@ -46,6 +49,16 @@ class PrescriptionViewModel extends BaseViewModel {
} }
} }
Future getMedicationList() async {
setState(ViewState.Busy);
await _prescriptionService.getMedicationList();
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future updatePrescription( Future updatePrescription(
PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async { PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async {
hasError = false; hasError = false;

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dar
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart';
import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/service/procedure_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/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
@ -68,16 +69,17 @@ class ProcedureViewModel extends BaseViewModel {
} }
Future updateProcedure( Future updateProcedure(
{PostProcedureReqModel postProcedureReqModel, int mrn}) async { {UpdateProcedureRequestModel updateProcedureRequestModel,
int mrn}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.updateProcedure(postProcedureReqModel); await _procedureService.updateProcedure(updateProcedureRequestModel);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
await getProcedure(mrn: mrn); // await getProcedure(mrn: mrn);
} }
} }

@ -17,6 +17,7 @@ class SickLeaveViewModel extends BaseViewModel {
List get coveringDoctors => _sickLeaveService.coveringDoctorsList; List get coveringDoctors => _sickLeaveService.coveringDoctorsList;
get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave; get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave;
get postSechedule => _sickLeaveService.postReschedule; get postSechedule => _sickLeaveService.postReschedule;
get sickleaveResponse => _sickLeaveService.sickLeaveResponse;
Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _sickLeaveService.addSickLeave(addSickLeaveRequest); await _sickLeaveService.addSickLeave(addSickLeaveRequest);

@ -412,6 +412,20 @@
"leaves" "leaves"
] ]
}, },
{
"uid": "4477771717c5280f9030b8e410040eda",
"css": "search_patient-1",
"code": 59465,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M1142.7 436.8A165.2 165.2 0 1 0 1307.8 601.9 165.4 165.4 0 0 0 1142.7 436.8ZM1142.7 748.8A146.9 146.9 0 1 1 1289.5 601.9 147 147 0 0 1 1142.7 748.8ZM1023.4 611.1H1041.7A110.3 110.3 0 0 1 1151.8 500.9V482.7A128.5 128.5 0 0 0 1023.4 611.1ZM1476.4 883.8L1489.3 870.9 1357.9 739.4 1345 752.4 1322 729.4A219.8 219.8 0 1 0 1270.1 781.5L1293.1 804.5 1280.2 817.4 1411.4 948.7 1424.4 935.7 1306 817.3 1357.9 765.4ZM1142.6 803.9A201.9 201.9 0 1 1 1344.4 602 202.2 202.2 0 0 1 1142.6 803.9ZM1306 791.3L1284.7 770.1A220.1 220.1 0 0 0 1310.7 744.1L1332.1 765.5ZM48.4 483.9H301.4A96.4 96.4 0 0 1 276.7 346.5 305.1 305.1 0 0 1 257.9 242V201.9A201.8 201.8 0 0 1 564.5 29.2 201.8 201.8 0 0 1 871 201.8V205.4L887 177.2 957.1 299.9A80.6 80.6 0 0 1 869.7 417.5 96.9 96.9 0 0 1 785.1 499.2 226.4 226.4 0 0 1 645.1 662.2V696.2L780.4 720.8A267.4 267.4 0 0 1 999.9 983.9V999.9H129V983.9A267.4 267.4 0 0 1 348.6 720.8L483.9 696.2V662.3A224.6 224.6 0 0 1 396.8 602.3C396 602.6 395.1 602.8 394.3 603.1A92.8 92.8 0 0 1 352.9 612.9H48.4A48.4 48.4 0 0 1 0 564.5V532.3A48.4 48.4 0 0 1 48.4 483.9ZM339.5 465.8C339.3 461.1 338.7 456.4 338.7 451.7V341A64.2 64.2 0 0 0 339.5 465.7ZM838.7 242V201.9A169.6 169.6 0 0 0 575.1 60.8L564.5 67.8 554 60.8A169.6 169.6 0 0 0 290.3 201.9V242A273.2 273.2 0 0 0 302.3 322.2 96.2 96.2 0 0 1 338.7 308.1V282.4L403.2 234V193.5A32.3 32.3 0 0 1 435.5 161.3H693.5A32.3 32.3 0 0 1 725.8 193.5V233.9L790.3 282.3V307.8A95.4 95.4 0 0 1 810.8 313.9 78.8 78.8 0 0 1 817 299.9L837.7 263.6C838.3 256.4 838.7 249.2 838.7 242ZM435.5 290.4H693.6V193.5H435.5ZM887.9 387.2A47.6 47.6 0 0 0 929.3 316L887.1 242.2 844.9 315.9A47.6 47.6 0 0 0 887.6 387.1ZM838.8 403.2A79.4 79.4 0 0 1 807.4 348.1 63.2 63.2 0 0 0 790.4 340.9V451.6C790.4 456.4 790 461 789.7 465.7A64.5 64.5 0 0 0 838.7 403.2ZM758.1 451.6V298.4L725.9 274.3V290.4A32.3 32.3 0 0 1 693.6 322.6H435.5A32.3 32.3 0 0 1 403.2 290.4V274.3L370.9 298.4V451.6A195.2 195.2 0 0 0 374.4 486.4 92.8 92.8 0 0 1 394.3 493.6 60.6 60.6 0 0 0 421.2 500H532.2A48.4 48.4 0 1 1 532.2 596.7H436.9A193.2 193.2 0 0 0 758.1 451.6ZM532.3 564.5A16 16 0 1 0 532.3 532.2H516.3V564.5ZM637.4 727.6A80.7 80.7 0 0 1 583.6 771.6 64.5 64.5 0 0 0 645.1 806.4C680.7 806.4 709.6 784.7 709.6 758A36.4 36.4 0 0 0 704.4 739.7ZM161.8 967.8H967.2A235 235 0 0 0 774.7 752.6L740.8 746.5A64.8 64.8 0 0 1 742 758.2C742 802.6 698.6 838.8 645.2 838.8A102.9 102.9 0 0 1 564.6 802.6 102.9 102.9 0 0 1 483.9 838.7C430.4 838.7 387.1 802.5 387.1 758.1A65.9 65.9 0 0 1 388.2 746.4L354.4 752.6A235 235 0 0 0 161.8 967.8ZM424.5 739.9A36.4 36.4 0 0 0 419.4 758.2C419.4 784.9 448.3 806.6 483.9 806.6A64.5 64.5 0 0 0 545.4 771.8 80.6 80.6 0 0 1 491.6 727.7ZM516 677.4V693.4A48.4 48.4 0 1 0 612.8 693.4V672.1A222.6 222.6 0 0 1 516 672.1ZM379.6 574.3A92.9 92.9 0 0 1 421 564.5H483.9V532.3H421.2A93.1 93.1 0 0 1 379.9 522.5 60.6 60.6 0 0 0 352.9 516H129V580.5H352.9A60.6 60.6 0 0 0 379.9 574.3ZM32.1 564.5A16 16 0 0 0 48.1 580.5H96.8V516H48.4A16 16 0 0 0 32.4 532ZM524.9 368.4L507 341.5 410.3 406.1 428.2 432.9ZM718.5 405.8L621.8 341.3 603.9 368.1 700.6 432.7Z",
"width": 1489
},
"search": [
"search_patient"
]
},
{ {
"uid": "740f78c2b53c8cc100a8b0d283bbd34f", "uid": "740f78c2b53c8cc100a8b0d283bbd34f",
"css": "home_icon-1", "css": "home_icon-1",

@ -1,5 +1,5 @@
/// Flutter icons DoctorApp /// Flutter icons DoctorApp
/// Copyright (C) 2020 by original authors @ fluttericon.com, fontello.com /// Copyright (C) 2021 by original authors @ fluttericon.com, fontello.com
/// This font was generated by FlutterIcon.com, which is derived from Fontello. /// This font was generated by FlutterIcon.com, which is derived from Fontello.
/// ///
/// To use this font, place it in your fonts/ directory and include the /// To use this font, place it in your fonts/ directory and include the
@ -11,7 +11,7 @@
/// fonts: /// fonts:
/// - asset: fonts/DoctorApp.ttf /// - asset: fonts/DoctorApp.ttf
/// ///
/// ///
/// ///
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
@ -19,64 +19,36 @@ class DoctorApp {
DoctorApp._(); DoctorApp._();
static const _kFontFam = 'DoctorApp'; static const _kFontFam = 'DoctorApp';
static const String _kFontPkg = null; static const _kFontPkg = null;
static const IconData female_icon = static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData male = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData male = static const IconData reject_icon = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData home_icon_active = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData reject_icon = static const IconData menu_icon = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData menu_icon_active = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData home_icon_active = static const IconData message_icon = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData message_icon_active = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData menu_icon = static const IconData scdedule_icon_active = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData schedule_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData menu_icon_active = static const IconData discharge_patient = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData approved_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData message_icon = static const IconData pending_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData in_patient_white = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData message_icon_active = static const IconData lab_results = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData home_icon = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData scdedule_icon_active = static const IconData operations = IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData out_patient = IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData schedule_icon = static const IconData patient = IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData qr_code = IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData discharge_patient = static const IconData radiology = IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData referral = IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData approved_icon = static const IconData search_patient = IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData mail = IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData pending_icon = static const IconData medicine_search = IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData referred = IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData in_patient_white = static const IconData sync_icon = IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData drawer_icon = IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData lab_results = static const IconData leaves = IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg);
IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData search_patient_1 = IconData(0xe849, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData home_icon =
IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData operations =
IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData out_patient =
IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData patient =
IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData qr_code =
IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData radiology =
IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData referral =
IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData search_patient =
IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData mail =
IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData medicine_search =
IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData referred =
IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData sync_icon =
IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData drawer_icon =
IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData leaves =
IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg);
} }

@ -11,6 +11,7 @@ class GetAllergiesResModel {
bool isUpdatedByNurse; bool isUpdatedByNurse;
int severity; int severity;
String severityName; String severityName;
String remarks;
GetAllergiesResModel( GetAllergiesResModel(
{this.allergyDiseaseId, {this.allergyDiseaseId,
@ -24,7 +25,7 @@ class GetAllergiesResModel {
this.isChecked, this.isChecked,
this.isUpdatedByNurse, this.isUpdatedByNurse,
this.severity, this.severity,
this.severityName}); this.severityName, this.remarks=''});
GetAllergiesResModel.fromJson(Map<String, dynamic> json) { GetAllergiesResModel.fromJson(Map<String, dynamic> json) {
allergyDiseaseId = json['allergyDiseaseId']; allergyDiseaseId = json['allergyDiseaseId'];
@ -39,6 +40,7 @@ class GetAllergiesResModel {
isUpdatedByNurse = json['isUpdatedByNurse']; isUpdatedByNurse = json['isUpdatedByNurse'];
severity = json['severity']; severity = json['severity'];
severityName = json['severityName']; severityName = json['severityName'];
remarks = json['remarks'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -55,6 +57,7 @@ class GetAllergiesResModel {
data['isUpdatedByNurse'] = this.isUpdatedByNurse; data['isUpdatedByNurse'] = this.isUpdatedByNurse;
data['severity'] = this.severity; data['severity'] = this.severity;
data['severityName'] = this.severityName; data['severityName'] = this.severityName;
data['remarks'] = this.remarks;
return data; return data;
} }
} }

@ -6,15 +6,17 @@ class GetPatientArrivalListRequestModel {
int pageIndex; int pageIndex;
int pageSize; int pageSize;
int clinicID; int clinicID;
int patientMRN;
GetPatientArrivalListRequestModel( GetPatientArrivalListRequestModel(
{this.vidaAuthTokenID, {this.vidaAuthTokenID,
this.from, this.from,
this.to, this.to,
this.doctorID, this.doctorID,
this.pageIndex, this.pageIndex,
this.pageSize, this.pageSize,
this.clinicID}); this.clinicID,
this.patientMRN});
GetPatientArrivalListRequestModel.fromJson(Map<String, dynamic> json) { GetPatientArrivalListRequestModel.fromJson(Map<String, dynamic> json) {
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
@ -24,6 +26,7 @@ class GetPatientArrivalListRequestModel {
pageIndex = json['PageIndex']; pageIndex = json['PageIndex'];
pageSize = json['PageSize']; pageSize = json['PageSize'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
patientMRN = json['PatientMRN'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -35,6 +38,8 @@ class GetPatientArrivalListRequestModel {
data['PageSize'] = this.pageSize; data['PageSize'] = this.pageSize;
data['ClinicID'] = this.clinicID; data['ClinicID'] = this.clinicID;
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['PatientMRN'] = this.patientMRN;
return data; return data;
} }

@ -33,8 +33,8 @@ class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ChangeNotifierProvider<T>( return ChangeNotifierProvider<T>.value(
create: (BuildContext context) => model, value: model,
child: Consumer<T>(builder: widget.builder), child: Consumer<T>(builder: widget.builder),
); );
} }

@ -141,16 +141,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row(
children: <Widget>[
AppText(
TranslationBase.of(context).welcome,
fontSize:
SizeConfig.textMultiplier * 1.7,
color: Colors.white,
)
],
),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
@ -804,7 +794,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: <Widget>[ children: <Widget>[
Center( Center(
child: Icon( child: Icon(
DoctorApp.search_patient, DoctorApp.search_patient_1,
size: 50, size: 50,
color: Colors.black, color: Colors.black,
), ),
@ -1201,8 +1191,8 @@ class DashboardItem extends StatelessWidget {
height: height != null height: height != null
? height ? height
: MediaQuery.of(context).orientation == Orientation.portrait : MediaQuery.of(context).orientation == Orientation.portrait
? MediaQuery.of(context).size.height * 0.19 ? MediaQuery.of(context).size.height * 0.20
: MediaQuery.of(context).size.height * 0.35, : MediaQuery.of(context).size.height * 0.36,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !hasBorder color: !hasBorder
? color != null ? color != null

@ -638,7 +638,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
.medicalFileList[ .medicalFileList[
0] 0]
.entityList[0] .entityList[0]
.timelines[0] .timelines[
encounterNumber]
.timeLineEvents[0] .timeLineEvents[0]
.consulations[0] .consulations[0]
.lstProcedure[ .lstProcedure[

@ -117,7 +117,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if(model.allMedicationList.isNotEmpty) if(model.allMedicationList.length == 0)
await model.getMedicationList(); await model.getMedicationList();
}, },
builder: (_, model, w) => builder: (_, model, w) =>
@ -214,13 +214,15 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
.startsWith(input.toLowerCase()), .startsWith(input.toLowerCase()),
) )
: TextField( : TextField(
minLines: 2,
maxLines: 2,
decoration: textFieldSelectorDecoration( decoration: textFieldSelectorDecoration(
TranslationBase TranslationBase
.of(context) .of(context)
.searchMedicineNameHere, .searchMedicineNameHere,
_selectedMedication != null _selectedMedication != null
? _selectedMedication.description + ? _selectedMedication.description +
('${_selectedMedication.genericName}') (' (${_selectedMedication.genericName} )')
: null, : null,
true, true,
icon: EvaIcons.search), icon: EvaIcons.search),
@ -245,72 +247,6 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
], ],
), ),
), ),
Column(
children: [
Container(
margin: EdgeInsets.only(
left: SizeConfig.heightMultiplier * 2),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase
.of(context)
.youCanFind +
model.pharmacyItemsList.length
.toString() +
" " +
TranslationBase
.of(context)
.itemsInSearch,
fontWeight: FontWeight.bold,
),
],
),
),
Container(
height: MediaQuery
.of(context)
.size
.height * 0.35,
child: Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.pharmacyItemsList == null
? 0
: model.pharmacyItemsList.length,
itemBuilder: (BuildContext context,
int index) {
return InkWell(
child: MedicineItemWidget(
label: model.pharmacyItemsList[index]
["ItemDescription"],
url: model.pharmacyItemsList[index]
["ImageSRCUrl"],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
PharmaciesListScreen(
itemID:
model.pharmacyItemsList[
index]["ItemID"],
url: model
.pharmacyItemsList[
index]["ImageSRCUrl"]),
),
);
},
);
},
),
),
),
],
),
], ],
), ),
), ),
@ -337,10 +273,19 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
return; return;
} }
GifLoaderDialogUtils.showMyDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
Navigator.push(
await model.getMedicineItem(_selectedMedication.description); context,
GifLoaderDialogUtils.hideDialog(context); MaterialPageRoute(
builder: (context) =>
PharmaciesListScreen(
itemID:_selectedMedication.itemId,
selectedMedication: _selectedMedication,
),
),
);
// await model.getMedicineItem(_selectedMedication.description);
// GifLoaderDialogUtils.hideDialog(context);
} }

@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_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/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
@ -22,9 +23,11 @@ class PharmaciesListScreen extends StatefulWidget {
final int itemID; final int itemID;
final String url; final String url;
final GetMedicationResponseModel selectedMedication;
// In the constructor, require a item id. // In the constructor, require a item id.
PharmaciesListScreen({Key key, @required this.itemID, this.url}) PharmaciesListScreen(
{Key key, @required this.itemID, this.url, this.selectedMedication})
: super(key: key); : super(key: key);
@override @override
@ -49,18 +52,25 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(
onModelReady: (model) => model.getPharmaciesList(widget.itemID), onModelReady: (model) async {
builder: (_, model, w) => AppScaffold( await model.getPharmaciesList(widget.selectedMedication.itemId);
baseViewModel: model, await model.getMedicineItem(widget.selectedMedication.description);
appBarTitle: TranslationBase.of(context).pharmaciesList,
body: Container( },
height: SizeConfig.screenHeight, builder: (_, model, w) =>
child: ListView( AppScaffold(
shrinkWrap: true, baseViewModel: model,
scrollDirection: Axis.vertical, appBarTitle: TranslationBase
physics: const AlwaysScrollableScrollPhysics(), .of(context)
children: <Widget>[ .pharmaciesList,
model.pharmaciesList.length > 0 body: Container(
height: SizeConfig.screenHeight,
child: ListView(
shrinkWrap: true,
scrollDirection: Axis.vertical,
physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[
model.pharmaciesList.length > 0 && model.pharmacyItemsList.length > 0
? RoundedContainer( ? RoundedContainer(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
@ -69,9 +79,10 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
child: ClipRRect( child: ClipRRect(
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(7)), BorderRadius.all(Radius.circular(7)),
child: widget.url != null child: model.pharmacyItemsList[0]
["ImageSRCUrl"]!= null
? Image.network( ? Image.network(
widget.url, model.pharmacyItemsList[0]["ImageSRCUrl"],
height: height:
SizeConfig.imageSizeMultiplier * SizeConfig.imageSizeMultiplier *
21, 21,

@ -44,6 +44,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
bool _autoValidate = false; bool _autoValidate = false;
bool onlyArrived = true; bool onlyArrived = true;
bool isFormSubmitted = false;
var _patientSearchFormValues = PatientModel( var _patientSearchFormValues = PatientModel(
FirstName: "0", FirstName: "0",
MiddleName: "0", MiddleName: "0",
@ -64,7 +66,9 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
PatientOutSA: false); PatientOutSA: false);
void _validateInputs() async { void _validateInputs() async {
setState(() {
isFormSubmitted = true;
});
try { try {
if (_formKey.currentState.validate()) { if (_formKey.currentState.validate()) {
@ -73,8 +77,11 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
if ((_patientSearchFormValues.From == "0" || if ((_patientSearchFormValues.From == "0" ||
_patientSearchFormValues.To == "0") && _patientSearchFormValues.To == "0") &&
_selectedType == "7") { _selectedType == "7") {
helpers.showErrorToast("Please Choose The Dates"); // helpers.showErrorToast("Please Choose The Dates");
} else { } else {
setState(() {
isFormSubmitted = false;
});
Navigator.of(context).pushNamed(PATIENTS, arguments: { Navigator.of(context).pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues, "patientSearchForm": _patientSearchFormValues,
"selectedType": _selectedType "selectedType": _selectedType
@ -112,7 +119,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
children: <Widget>[ children: <Widget>[
Container( Container(
child: Icon( child: Icon(
DoctorApp.search_patient, DoctorApp.search_patient_1,
size: 100, size: 100,
color: Colors.black, color: Colors.black,
), ),
@ -403,7 +410,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
), ),
), ),
(!(_selectedType == '2' || _selectedType == '4')) (!(_selectedType == '2' || _selectedType == '4'))
? DynamicElements(_patientSearchFormValues) ? DynamicElements(_patientSearchFormValues, isFormSubmitted)
: SizedBox( : SizedBox(
height: 0, height: 0,
), ),

@ -262,7 +262,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; GetPatientArrivalListRequestModel getPatientArrivalListRequestModel;
if (val2 == 7) { if (val2 == 7) {
getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel(
from: patient.From, to: patient.To, pageIndex: 0, pageSize: 0); from: patient.From, to: patient.To, pageIndex: 0, pageSize: 0,patientMRN: patient.getPatientID);
} }
model model
@ -273,7 +273,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
patientType) patientType)
.then((res) { .then((res) {
setState(() { setState(() {
_isLoading = false;
if (res != null && res['MessageStatus'] == 1) { if (res != null && res['MessageStatus'] == 1) {
if (val2 == 7) { if (val2 == 7) {
@ -302,10 +302,13 @@ class _PatientsScreenState extends State<PatientsScreen> {
responseModelList = new ModelResponse.fromJson(parsed).list; responseModelList = new ModelResponse.fromJson(parsed).list;
responseModelList2 = responseModelList; responseModelList2 = responseModelList;
_isError = false; _isError = false;
} else { } else {
_isError = true; _isError = true;
error = model.error; //res['ErrorEndUserMessage'] ?? res['ErrorMessage']; error = model.error??res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
} }
_isLoading = false;
}); });
}).catchError((error) { }).catchError((error) {
setState(() { setState(() {

@ -1,31 +1,27 @@
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/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/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/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/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.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';
import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.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/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/dynamic_elements.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_text_form_field.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:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
addPrescriptionForm(context, PrescriptionViewModel model, addPrescriptionForm(context, PrescriptionViewModel model,
PatiantInformtion patient, prescription) { PatiantInformtion patient, prescription) {
@ -105,6 +101,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
TextEditingController instructionController = TextEditingController(); TextEditingController instructionController = TextEditingController();
DateTime selectedDate; DateTime selectedDate;
dynamic selectedDrug; dynamic selectedDrug;
GetMedicationResponseModel _selectedMedication;
GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
TextEditingController drugIdController = TextEditingController(); TextEditingController drugIdController = TextEditingController();
TextEditingController doseController = TextEditingController(); TextEditingController doseController = TextEditingController();
@ -190,14 +189,25 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
dynamic route25 = {"id": 37, "name": "Inserted into Vagina"}; dynamic route25 = {"id": 37, "name": "Inserted into Vagina"};
dynamic route26 = {"id": 36, "name": "Inserted into Rectum"}; dynamic route26 = {"id": 36, "name": "Inserted into Rectum"};
dynamic route27 = {"id": 31, "name": "In Each Nostril"}; dynamic route27 = {"id": 31, "name": "In Each Nostril"};
dynamic frequency1 = {"id": 1, "name": "2 Times a day"}; dynamic frequency1 = {"id": 2, "name": "2 Times a day"};
dynamic frequency2 = {"id": 2, "name": "3 Times a day"}; dynamic frequency2 = {"id": 3, "name": "3 Times a day"};
dynamic frequency3 = {"id": 3, "name": "4 Times a day"}; dynamic frequency3 = {"id": 4, "name": "4 Times a day"};
dynamic frequency4 = {"id": 8, "name": "As Needed"}; dynamic frequency4 = {"id": 8, "name": "As Needed"};
dynamic frequency5 = {"id": 9, "name": "Bed Time"}; dynamic frequency5 = {"id": 9, "name": "Bed Time"};
dynamic frequency6 = {"id": 11, "name": "Every Other Day"}; dynamic frequency6 = {"id": 11, "name": "Every Other Day"};
dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"}; dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"};
dynamic frequency8 = {"id": 34, "name": "As Directed"}; dynamic frequency8 = {"id": 34, "name": "As Directed"};
dynamic frequency9 = {"id": 22, "name": "Once Per Month"};
dynamic frequency10 = {"id": 2, "name": "3 Times a day"};
dynamic frequency11 = {"id": 21, "name": "Every 3 hours"};
dynamic frequency12 = {"id": 20, "name": "Once a Week"};
dynamic frequency13 = {"id": 12, "name": "Every Half Hour"};
dynamic frequency14 = {"id": 10, "name": "4 Times a Day"};
dynamic frequency15 = {"id": 24, "name": "Once Every 2 Months"};
dynamic frequency16 = {"id": 25, "name": "Every One Hour"};
dynamic frequency17 = {"id": 26, "name": "Every Two Hours"};
dynamic frequency18 = {"id": 28, "name": "Every Six Hours"};
dynamic duration1 = {"id": 1, "name": "For 1 Day"}; dynamic duration1 = {"id": 1, "name": "For 1 Day"};
dynamic duration2 = {"id": 2, "name": "For 2 Days"}; dynamic duration2 = {"id": 2, "name": "For 2 Days"};
dynamic duration3 = {"id": 3, "name": "For 3 Days"}; dynamic duration3 = {"id": 3, "name": "For 3 Days"};
@ -226,6 +236,15 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
dynamic doseTime10 = {"id": 10, "name": "While wake"}; dynamic doseTime10 = {"id": 10, "name": "While wake"};
dynamic doseTime11 = {"id": 12, "name": "Any Time"}; dynamic doseTime11 = {"id": 12, "name": "Any Time"};
dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; dynamic doseTime12 = {"id": 21, "name": "Bed Time"};
dynamic doseTime13 = {"id": 13, "name": "30 Minutes Before Meals"};
dynamic doseTime14 = {"id": 14, "name": "1 Hour Before Meals"};
dynamic doseTime15 = {"id": 15, "name": "2 Hours After Meal"};
dynamic doseTime16 = {"id": 16, "name": "After Breakfast"};
dynamic doseTime17 = {"id": 17, "name": "Before Lunch"};
dynamic doseTime18 = {"id": 18, "name": "After Lunch"};
dynamic doseTime19 = {"id": 20, "name": "After Dinner"};
dynamic doseTime20 = {"id": 21, "name": "Bed Time"};
dynamic doseTime21 = {"id": 11, "name": "Now"};
dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"};
dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"};
dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; dynamic indication3 = {"id": 547, "name": "Hypertrichosis"};
@ -265,6 +284,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
doseTimeList.add(doseTime9); doseTimeList.add(doseTime9);
doseTimeList.add(doseTime10); doseTimeList.add(doseTime10);
doseTimeList.add(doseTime11); doseTimeList.add(doseTime11);
doseTimeList.add(doseTime12);
doseTimeList.add(doseTime13);
doseTimeList.add(doseTime14);
doseTimeList.add(doseTime15);
doseTimeList.add(doseTime16);
doseTimeList.add(doseTime17);
doseTimeList.add(doseTime18);
doseTimeList.add(doseTime19);
doseTimeList.add(doseTime20);
doseTimeList.add(doseTime21);
doseTimeList.add(doseTime12); doseTimeList.add(doseTime12);
frequencyList.add(frequency1); frequencyList.add(frequency1);
frequencyList.add(frequency2); frequencyList.add(frequency2);
@ -274,6 +304,16 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
frequencyList.add(frequency6); frequencyList.add(frequency6);
frequencyList.add(frequency7); frequencyList.add(frequency7);
frequencyList.add(frequency8); frequencyList.add(frequency8);
frequencyList.add(frequency9);
frequencyList.add(frequency10);
frequencyList.add(frequency11);
frequencyList.add(frequency12);
frequencyList.add(frequency13);
frequencyList.add(frequency14);
frequencyList.add(frequency15);
frequencyList.add(frequency16);
frequencyList.add(frequency17);
frequencyList.add(frequency18);
routeList.add(route1); routeList.add(route1);
routeList.add(route2); routeList.add(route2);
routeList.add(route3); routeList.add(route3);
@ -343,11 +383,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// 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<PrescriptionViewModel>( return BaseView<MedicineViewModel>(
onModelReady: (model) => model.getDrugs(drugName: textSeartch), onModelReady: (model) async {
builder: await model.getMedicationList();
(BuildContext context, PrescriptionViewModel model, Widget child) => },
NetworkBaseView( builder: (BuildContext context, MedicineViewModel model, Widget child) =>
NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: DraggableScrollableSheet( child: DraggableScrollableSheet(
initialChildSize: 0.90, initialChildSize: 0.90,
@ -378,152 +419,73 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
//mainAxisAlignment: MainAxisAlignment.end, //mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Container( Container(
height: screenSize.height * 0.070, height: MediaQuery.of(context).size.height *
0.070,
child: InkWell( child: InkWell(
onTap: model.drugsList != null && onTap: model.allMedicationList != null
model.drugsList.length > 0
? () { ? () {
return drugDialog = setState(() {
ListSelectDialog( _selectedMedication = null;
list: model.drugsList, });
attributeName: 'GenericName',
attributeValueId: 'ItemId',
okText:
TranslationBase.of(context)
.ok,
okFunction: (selectedValue) {
setState(() {
selectedDrug = selectedValue;
});
},
/* searchWidget: Row(
children: [
Expanded(
child: TextField(
decoration: Helpers
.textFieldSelectorDecoration(
TranslationBase.of(
context)
.search,
searchController.text !=
null &&
searchController
.text !=
""
? searchController
.text
: null,
false,
),
onChanged: (String str) {
textSeartch = str;
},
controller:
searchController,
enabled: true,
),
),
Container(
child: InkWell(
child: Icon(
Icons.search,
color: Colors.black,
),
onTap: () async {
Navigator.of(context)
.pop();
await searchMedicine(
context,
model,
textSeartch);
showDialog(
barrierDismissible:
false,
context: context,
builder: (BuildContext
context) {
return drugDialog;
},
);
},
),
margin:
EdgeInsets.symmetric(
horizontal: 8),
)
],
),*/
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return drugDialog;
},
);
} }
: null, : null,
child: Row( child: _selectedMedication == null
children: [ ? AutoCompleteTextField<
Expanded( GetMedicationResponseModel>(
child: TextField( decoration:
decoration: Helpers textFieldSelectorDecoration(
.textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
.search, .searchMedicineNameHere,
searchController.text != null && _selectedMedication != null
searchController.text != ? _selectedMedication
"" .genericName
? searchController.text
: null, : null,
false, true,
), ),
onChanged: (String str) { itemSubmitted: (item) => setState(
textSeartch = str; () =>
}, _selectedMedication = item),
controller: searchController, key: key,
enabled: true, suggestions:
), model.allMedicationList,
), itemBuilder: (context,
Container( suggestion) =>
child: InkWell( new Padding(
child: Icon( child: Texts(suggestion
Icons.search, .description +
color: Colors.black, '/' +
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,
_selectedMedication != null
? _selectedMedication
.description +
('${_selectedMedication.genericName}')
: null,
true,
), ),
onTap: () async { enabled: false,
// Navigator.of(context)
// .pop();
await searchMedicine(
context, model, textSeartch);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
return drugDialog;
},
);
},
), ),
margin: EdgeInsets.symmetric(
horizontal: 8),
)
],
), /*TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.searchMedicine,
selectedDrug != null
? selectedDrug['GenericName']
: null,
true,
suffixIcon: Icon(
Icons.search,
color: Colors.black,
)),
enabled: true,
),*/
), ),
), ),
SizedBox( SizedBox(
@ -554,46 +516,6 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
], ],
), ),
), ),
// Container(
// height: screenSize.height * 0.070,
// child: InkWell(
// onTap: referToList != null
// ? () {
// ListSelectDialog dialog =
// ListSelectDialog(
// list: referToList,
// attributeName: 'name',
// attributeValueId: 'id',
// okText:
// TranslationBase.of(context)
// .ok,
// okFunction: (selectedValue) {
// setState(() {
// type = selectedValue;
// _selectedBranch = null;
// });
// },
// );
// showDialog(
// barrierDismissible: false,
// context: context,
// builder:
// (BuildContext context) {
// return dialog;
// },
// );
// }
// : null,
// child: TextField(
// decoration: textFieldSelectorDecoration(
// TranslationBase.of(context)
// .orderType,
// type != null ? type['name'] : null,
// true),
// enabled: false,
// ),
// ),
// ),
SizedBox(height: spaceBetweenTextFileds), SizedBox(height: spaceBetweenTextFileds),
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
@ -603,47 +525,21 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
width: width:
MediaQuery.of(context).size.width * MediaQuery.of(context).size.width *
0.5, 0.650,
child: InkWell( child: TextFields(
onTap: strengthList != null hintText: TranslationBase.of(context)
? () { .strength,
ListSelectDialog dialog = controller: strengthController,
ListSelectDialog( keyboardType: TextInputType.number,
list: strengthList, validator: (value) {
attributeName: 'name', if (value.isEmpty &&
attributeValueId: 'id', strengthController.text.length >
okText: TranslationBase.of( 4)
context) return TranslationBase.of(context)
.ok, .emptyMessage;
okFunction: else
(selectedValue) { return null;
setState(() { },
strength =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder:
(BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration:
textFieldSelectorDecoration(
TranslationBase.of(context)
.strength,
strength != null
? strength['name']
: null,
true),
enabled: false,
),
), ),
), ),
SizedBox( SizedBox(
@ -652,7 +548,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container( Container(
width: width:
MediaQuery.of(context).size.width * MediaQuery.of(context).size.width *
0.40, 0.250,
child: InkWell( child: InkWell(
onTap: unitsList != null onTap: unitsList != null
? () { ? () {
@ -959,14 +855,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// formKey.currentState.save(); // formKey.currentState.save();
// Navigator.pop(context); // Navigator.pop(context);
// openDrugToDrug(); // openDrugToDrug();
if (strength == null || if (route == null ||
route == null ||
frequency == null || frequency == null ||
indication == null || indication == null ||
doseTime == null || doseTime == null ||
duration == null || duration == null ||
selectedDrug == null || selectedDate == null ||
selectedDate == null) { units == null) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
"Please Fill All Fields"); "Please Fill All Fields");
return; return;
@ -974,7 +869,32 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
if (formKey.currentState.validate()) { if (formKey.currentState.validate()) {
Navigator.pop(context); Navigator.pop(context);
openDrugToDrug(); {
postProcedure(
dose: strengthController.text,
doseUnit:
units['id'].toString(),
patient: widget.patient,
doseTimeIn:
doseTime['id'].toString(),
model: widget.model,
duration:
duration['id'].toString(),
frequency: frequency['id']
.toString(),
route: route['id'].toString(),
drugId: _selectedMedication
.itemId
.toString(),
strength:
strengthController.text,
indication:
indicationController.text,
instruction:
instructionController
.text,
doseTime: selectedDate);
}
} }
{ {
// Navigator.push( // Navigator.push(
@ -1070,7 +990,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
title: TranslationBase.of(context).addMedication, title: TranslationBase.of(context).addMedication,
onPressed: () { onPressed: () {
postProcedure( postProcedure(
dose: strength['id'].toString(), dose: strengthController.text,
doseUnit: units['id'].toString(), doseUnit: units['id'].toString(),
patient: widget.patient, patient: widget.patient,
doseTimeIn: doseTime['id'].toString(), doseTimeIn: doseTime['id'].toString(),
@ -1079,7 +999,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
frequency: frequency['id'].toString(), frequency: frequency['id'].toString(),
route: route['id'].toString(), route: route['id'].toString(),
drugId: selectedDrug['ItemId'].toString(), drugId: selectedDrug['ItemId'].toString(),
strength: strength['id'].toString(), strength: strengthController.text,
indication: indicationController.text, indication: indicationController.text,
instruction: instructionController.text, instruction: instructionController.text,
doseTime: selectedDate); doseTime: selectedDate);
@ -1093,41 +1013,4 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
); );
}); });
} }
// searchData(String str, PrescriptionViewModel model) {
// var strExist = str.length > 0 ? true : false;
//
// if (strExist) {
// filteredNotesList = null;
// filteredNotesList = model.drugsList
// .where((note) =>
// note["GenericName"].toString().contains(str.toUpperCase()))
// .toList();
// setState(() {
// notesList = filteredNotesList;
// });
// } else {
// setState(() {
// notesList = model.drugsList;
// });
// }
// }
searchMedicine(context, PrescriptionViewModel model, String str) async {
FocusScope.of(context).unfocus();
// if (searchController.text.isEmpty()) {
// helpers.showErrorToast(TranslationBase.of(context).typeMedicineName);
// //"Type Medicine Name")
// return;
// }
if (searchController.text.length < 0) {
helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter);
return;
}
GifLoaderDialogUtils.showMyDialog(context);
await model.getDrugs(drugName: searchController.text);
GifLoaderDialogUtils.hideDialog(context);
}
} }

@ -49,14 +49,24 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
doseTimeList = List(); doseTimeList = List();
frequencyList = List(); frequencyList = List();
dynamic frequency1 = {"id": 1, "name": "2 Times a day"}; dynamic frequency1 = {"id": 2, "name": "2 Times a day"};
dynamic frequency2 = {"id": 2, "name": "3 Times a day"}; dynamic frequency2 = {"id": 3, "name": "3 Times a day"};
dynamic frequency3 = {"id": 3, "name": "4 Times a day"}; dynamic frequency3 = {"id": 4, "name": "4 Times a day"};
dynamic frequency4 = {"id": 8, "name": "As Needed"}; dynamic frequency4 = {"id": 8, "name": "As Needed"};
dynamic frequency5 = {"id": 9, "name": "Bed Time"}; dynamic frequency5 = {"id": 9, "name": "Bed Time"};
dynamic frequency6 = {"id": 11, "name": "Every Other Day"}; dynamic frequency6 = {"id": 11, "name": "Every Other Day"};
dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"}; dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"};
dynamic frequency8 = {"id": 34, "name": "As Directed"}; dynamic frequency8 = {"id": 34, "name": "As Directed"};
dynamic frequency9 = {"id": 22, "name": "Once Per Month"};
dynamic frequency10 = {"id": 2, "name": "3 Times a day"};
dynamic frequency11 = {"id": 21, "name": "Every 3 hours"};
dynamic frequency12 = {"id": 20, "name": "Once a Week"};
dynamic frequency13 = {"id": 12, "name": "Every Half Hour"};
dynamic frequency14 = {"id": 10, "name": "4 Times a Day"};
dynamic frequency15 = {"id": 24, "name": "Once Every 2 Months"};
dynamic frequency16 = {"id": 25, "name": "Every One Hour"};
dynamic frequency17 = {"id": 26, "name": "Every Two Hours"};
dynamic frequency18 = {"id": 28, "name": "Every Six Hours"};
dynamic doseTime1 = {"id": 1, "name": "Before Meals"}; dynamic doseTime1 = {"id": 1, "name": "Before Meals"};
dynamic doseTime2 = {"id": 2, "name": "After Meals"}; dynamic doseTime2 = {"id": 2, "name": "After Meals"};
dynamic doseTime3 = {"id": 3, "name": "With Meals"}; dynamic doseTime3 = {"id": 3, "name": "With Meals"};
@ -69,6 +79,15 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
dynamic doseTime10 = {"id": 10, "name": "While wake"}; dynamic doseTime10 = {"id": 10, "name": "While wake"};
dynamic doseTime11 = {"id": 12, "name": "Any Time"}; dynamic doseTime11 = {"id": 12, "name": "Any Time"};
dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; dynamic doseTime12 = {"id": 21, "name": "Bed Time"};
dynamic doseTime13 = {"id": 13, "name": "30 Minutes Before Meals"};
dynamic doseTime14 = {"id": 14, "name": "1 Hour Before Meals"};
dynamic doseTime15 = {"id": 15, "name": "2 Hours After Meal"};
dynamic doseTime16 = {"id": 16, "name": "After Breakfast"};
dynamic doseTime17 = {"id": 17, "name": "Before Lunch"};
dynamic doseTime18 = {"id": 18, "name": "After Lunch"};
dynamic doseTime19 = {"id": 20, "name": "After Dinner"};
dynamic doseTime20 = {"id": 21, "name": "Bed Time"};
dynamic doseTime21 = {"id": 11, "name": "Now"};
dynamic route1 = {"id": 7, "name": "By Mouth"}; dynamic route1 = {"id": 7, "name": "By Mouth"};
dynamic route2 = {"id": 10, "name": "Inhale by Mouth"}; dynamic route2 = {"id": 10, "name": "Inhale by Mouth"};
dynamic route3 = {"id": 15, "name": "for INJECTION"}; dynamic route3 = {"id": 15, "name": "for INJECTION"};
@ -78,6 +97,24 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
dynamic route7 = {"id": 27, "name": "In Both EYES"}; dynamic route7 = {"id": 27, "name": "In Both EYES"};
dynamic route8 = {"id": 28, "name": "In Both Ears"}; dynamic route8 = {"id": 28, "name": "In Both Ears"};
dynamic route9 = {"id": 32, "name": "Intramuscular"}; dynamic route9 = {"id": 32, "name": "Intramuscular"};
dynamic route10 = {"id": 60, "name": "TRANSDERMAL"};
dynamic route11 = {"id": 59, "name": "OROPHARYNGEAL"};
dynamic route12 = {"id": 15, "name": "for INJECTION"};
dynamic route13 = {"id": 58, "name": "SUBCUTANEOUS"};
dynamic route14 = {"id": 57, "name": "NASOGASTRIC"};
dynamic route15 = {"id": 56, "name": "IRRIGATION"};
dynamic route16 = {"id": 55, "name": "INTRAVITREAL"};
dynamic route17 = {"id": 54, "name": "INTRAVENOUS BOLUS"};
dynamic route18 = {"id": 51, "name": "EPIDURAL"};
dynamic route19 = {"id": 47, "name": "Parenteral"};
dynamic route20 = {"id": 43, "name": "IM"};
dynamic route21 = {"id": 42, "name": "IV"};
dynamic route22 = {"id": 41, "name": "Sublingual"};
dynamic route23 = {"id": 40, "name": "For Nebulization"};
dynamic route24 = {"id": 39, "name": "Nasal"};
dynamic route25 = {"id": 37, "name": "Inserted into Vagina"};
dynamic route26 = {"id": 36, "name": "Inserted into Rectum"};
dynamic route27 = {"id": 31, "name": "In Each Nostril"};
frequencyList.add(frequency1); frequencyList.add(frequency1);
frequencyList.add(frequency2); frequencyList.add(frequency2);
@ -87,6 +124,16 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
frequencyList.add(frequency6); frequencyList.add(frequency6);
frequencyList.add(frequency7); frequencyList.add(frequency7);
frequencyList.add(frequency8); frequencyList.add(frequency8);
frequencyList.add(frequency9);
frequencyList.add(frequency10);
frequencyList.add(frequency11);
frequencyList.add(frequency12);
frequencyList.add(frequency13);
frequencyList.add(frequency14);
frequencyList.add(frequency15);
frequencyList.add(frequency16);
frequencyList.add(frequency17);
frequencyList.add(frequency18);
doseTimeList.add(doseTime1); doseTimeList.add(doseTime1);
doseTimeList.add(doseTime2); doseTimeList.add(doseTime2);
doseTimeList.add(doseTime3); doseTimeList.add(doseTime3);
@ -99,6 +146,15 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
doseTimeList.add(doseTime10); doseTimeList.add(doseTime10);
doseTimeList.add(doseTime11); doseTimeList.add(doseTime11);
doseTimeList.add(doseTime12); doseTimeList.add(doseTime12);
doseTimeList.add(doseTime13);
doseTimeList.add(doseTime14);
doseTimeList.add(doseTime15);
doseTimeList.add(doseTime16);
doseTimeList.add(doseTime17);
doseTimeList.add(doseTime18);
doseTimeList.add(doseTime19);
doseTimeList.add(doseTime20);
doseTimeList.add(doseTime21);
routeList.add(route1); routeList.add(route1);
routeList.add(route2); routeList.add(route2);
routeList.add(route3); routeList.add(route3);
@ -108,6 +164,24 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
routeList.add(route7); routeList.add(route7);
routeList.add(route8); routeList.add(route8);
routeList.add(route9); routeList.add(route9);
routeList.add(route10);
routeList.add(route11);
routeList.add(route12);
routeList.add(route13);
routeList.add(route14);
routeList.add(route15);
routeList.add(route16);
routeList.add(route17);
routeList.add(route18);
routeList.add(route19);
routeList.add(route20);
routeList.add(route21);
routeList.add(route22);
routeList.add(route23);
routeList.add(route24);
routeList.add(route25);
routeList.add(route26);
routeList.add(route27);
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -754,8 +828,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
route = selectedValue; route = selectedValue;
}); });
if (route == null) { if (route == null) {
helpers route = route['id'];
.showErrorToast('plase fill');
} }
}, },
); );
@ -904,10 +977,15 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
model: model, model: model,
drugId: drugId, drugId: drugId,
remarks: remarksController.text, remarks: remarksController.text,
route: route['id'].toString(), route: route != null
frequency: ? route['id'].toString()
frequencyUpdate['id'].toString(), : rouat,
dose: doseTime['id'].toString(), frequency: frequencyUpdate != null
? frequencyUpdate['id'].toString()
: frequency,
dose: doseTime != null
? doseTime['id'].toString()
: dose,
enteredRemarks: enteredRemarks); enteredRemarks: enteredRemarks);
Navigator.pop(context); Navigator.pop(context);
}, },

@ -2,8 +2,10 @@ import 'package:doctor_app_flutter/client/base_app_client.dart';
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/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_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/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
@ -676,10 +678,11 @@ postProcedure(
postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN; postProcedureReqModel.patientMRN = patient.patientMRN;
entityList.forEach((element) {
controls.add( controls.add(
Controls(code: remarks.isEmpty ? '' : remarks, controlValue: 'test'), Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks),
); );
});
entityList.forEach((element) { entityList.forEach((element) {
controlsProcedure.add(Procedures( controlsProcedure.add(Procedures(
@ -693,6 +696,7 @@ postProcedure(
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added'); DrAppToastMsg.showSuccesToast('procedure has been added');
} }
@ -704,30 +708,37 @@ updateProcedure(
String procedureId, String procedureId,
PatiantInformtion patient, PatiantInformtion patient,
String categorieId}) async { String categorieId}) async {
PostProcedureReqModel updateProcedureReqModel = new PostProcedureReqModel(); UpdateProcedureRequestModel updateProcedureReqModel =
new UpdateProcedureRequestModel();
List<Controls> controls = List(); List<Controls> controls = List();
List<Procedures> controlsProcedure = List(); ProcedureDetail controlsProcedure = new ProcedureDetail();
updateProcedureReqModel.appointmentNo = patient.appointmentNo; updateProcedureReqModel.appointmentNo = patient.appointmentNo;
updateProcedureReqModel.episodeID = patient.episodeNo; updateProcedureReqModel.episodeID = patient.episodeNo;
updateProcedureReqModel.patientMRN = patient.patientMRN; updateProcedureReqModel.patientMRN = patient.patientMRN;
updateProcedureReqModel.lineItemNo = 1;
updateProcedureReqModel.orderNo = 0;
controls.add( controls.add(
Controls( Controls(code: "02", controlValue: remarks.isEmpty ? '' : remarks),
code: remarks.isEmpty ? '' : remarks,
controlValue: 'Testing',
),
); );
controlsProcedure.add(Procedures(
category: categorieId, procedure: procedureId, controls: controls)); controlsProcedure.procedure = procedureId;
updateProcedureReqModel.procedures = controlsProcedure; controlsProcedure.category = categorieId;
controlsProcedure.controls = controls;
// controlsProcedure.add(ProcedureDetail(
// category: categorieId, procedure: procedureId, controls: controls));
updateProcedureReqModel.procedureDetail = controlsProcedure;
await model.updateProcedure( await model.updateProcedure(
postProcedureReqModel: updateProcedureReqModel, mrn: patient.patientMRN); updateProcedureRequestModel: updateProcedureReqModel,
mrn: patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been updated'); DrAppToastMsg.showSuccesToast('procedure has been updated');
} }

@ -52,8 +52,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
var fromDate; var fromDate;
var toDate; var toDate;
var clinicID; var clinicID;
var fromTime; String fromTime;
var toTime; String toTime;
TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller4 = new TextEditingController();
TextEditingController _controller5 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController();
void _presentDatePicker(id) { void _presentDatePicker(id) {
@ -764,7 +764,9 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
//df.format(DateTime.parse(widget.updateData.dateTimeFrom)); //df.format(DateTime.parse(widget.updateData.dateTimeFrom));
this.fromTime = this.fromTime =
df.format(DateTime.parse(widget.updateData.dateTimeFrom)); df.format(DateTime.parse(widget.updateData.dateTimeFrom));
this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3);
this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo));
this.toTime = this.toTime.substring(0, this.toTime.length - 3);
_toDateController2.text = _toDateController2.text =
dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo));
_controller5.text = toTime; _controller5.text = toTime;
@ -820,8 +822,8 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"weekDayId": 1, "weekDayId": 1,
"shiftId": 1, "shiftId": 1,
"isOpen": true, "isOpen": true,
"timeFrom": "", "timeFrom": fromTime,
"timeTo": "", "timeTo": toTime,
"timeFromstr": "", "timeFromstr": "",
"timeTostr": "" "timeTostr": ""
} }
@ -845,17 +847,17 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
} }
updateRecheduleLeave(model) { updateRecheduleLeave(model) {
final df = new DateFormat('yyyy-MM-ddTHH:MM:ss'); // final df = new DateFormat('yyyy-MM-ddTHH:MM:ss');
final dateFormat = new DateFormat('yyyy-MM-dd'); final df = new DateFormat('yyyy-MM-dd');
var fromDates = fromDate; var fromDates = fromDate;
var toDates = toDate; var toDates = toDate;
if (offTime == '1') { if (offTime == '1') {
fromDate = df.format(DateTime.parse(fromDates)) + fromDate = df.format(DateTime.parse(_toDateController.text)) +
'T' + 'T' +
fromTime + fromTime +
':' + ':' +
DateTime.now().second.toString(); DateTime.now().second.toString();
toDate = df.format(DateTime.parse(fromDates)) + toDate = df.format(DateTime.parse(_toDateController.text)) +
'T' + 'T' +
toTime + toTime +
':' + ':' +
@ -883,10 +885,10 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
"weekDayId": 1, "weekDayId": 1,
"shiftId": 1, "shiftId": 1,
"isOpen": true, "isOpen": true,
"timeFrom": fromTime, "timeFrom": "",
"timeTo": toTime, "timeTo": "",
"timeFromstr": "", "timeFromstr": fromTime,
"timeTostr": "" "timeTostr": toTime
} }
] ]
} }

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/config.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/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -34,7 +35,7 @@ class SettingsScreen extends StatelessWidget {
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 350), duration: Duration(milliseconds: 350),
decoration: BoxDecoration( decoration: BoxDecoration(
color: !projectsProvider.isArabic ? HexColor('#58434F') : Colors.transparent, color: !projectsProvider.isArabic ? AppGlobal.appPrimaryColor : Colors.transparent,
border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0)) border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
), ),
child: Center(child: AppText(TranslationBase.of(context).lanEnglish, color: !projectsProvider.isArabic ? Colors.white : Colors.grey[500])) child: Center(child: AppText(TranslationBase.of(context).lanEnglish, color: !projectsProvider.isArabic ? Colors.white : Colors.grey[500]))
@ -47,7 +48,7 @@ class SettingsScreen extends StatelessWidget {
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 350), duration: Duration(milliseconds: 350),
decoration: BoxDecoration( decoration: BoxDecoration(
color: projectsProvider.isArabic ? HexColor('#58434F') : Colors.transparent, color: projectsProvider.isArabic ? AppGlobal.appPrimaryColor : Colors.transparent,
border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0)) border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
), ),
child: Center(child: AppText(TranslationBase.of(context).lanArabic, color: projectsProvider.isArabic ? Colors.white : Colors.grey[500],)) child: Center(child: AppText(TranslationBase.of(context).lanArabic, color: projectsProvider.isArabic ? Colors.white : Colors.grey[500],))

@ -4,7 +4,9 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -116,6 +118,10 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
borderColor: Colors.white, borderColor: Colors.white,
onChanged: (value) { onChanged: (value) {
addSickLeave.noOfDays = value; addSickLeave.noOfDays = value;
if (widget.extendedData != null) {
widget.extendedData.noOfDays =
int.parse(value);
}
}, },
hintText: widget.extendedData != null hintText: widget.extendedData != null
? widget.extendedData.noOfDays ? widget.extendedData.noOfDays
@ -163,6 +169,10 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onChanged: (value) { onChanged: (value) {
addSickLeave.startDate = value; addSickLeave.startDate = value;
if (widget.extendedData != null) {
widget.extendedData.startDate =
value;
}
}), }),
], ],
)), )),
@ -323,6 +333,9 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
.remarks), .remarks),
onChanged: (value) { onChanged: (value) {
addSickLeave.remarks = value; addSickLeave.remarks = value;
if (widget.extendedData != null) {
widget.extendedData.remarks = value;
}
}, },
) )
], ],
@ -338,14 +351,26 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
title: widget.isExtended == true title: widget.isExtended == true
? TranslationBase.of(context).extend ? TranslationBase.of(context).extend
: TranslationBase.of(context).add, : TranslationBase.of(context).add,
onPressed: () { onPressed: () async {
if (widget.isExtended) { if (widget.isExtended) {
model2 await model2.extendSickLeave(
.extendSickLeave( widget.extendedData);
widget.extendedData)
.then((value) => (value) { DrAppToastMsg.showSuccesToast(
print(value); model2.sickleaveResponse[
}); 'ListSickLeavesToExtent']
['success']);
Navigator.of(context).popUntil((route) {
return route.settings.name ==
PATIENTS_PROFILE;
});
Navigator.of(context).pushNamed(
ADD_SICKLEAVE,
arguments: {
'patient': widget.patient
});
//print(value);
//});
} else { } else {
_validateInputs(model2); _validateInputs(model2);
} }

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
class DrAppToastMsg {
class DrAppToastMsg {
void showLongToast(msg) { void showLongToast(msg) {
FlutterFlexibleToast.showToast( FlutterFlexibleToast.showToast(
message: msg, message: msg,
@ -8,7 +9,7 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
); );
} }
static void showSuccesToast(msg) { static void showSuccesToast(msg) {
FlutterFlexibleToast.showToast( FlutterFlexibleToast.showToast(
message: msg, message: msg,
toastLength: Toast.LENGTH_SHORT, toastLength: Toast.LENGTH_SHORT,
@ -19,7 +20,6 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
textColor: Colors.white); textColor: Colors.white);
} }
static void showErrorToast(msg) { static void showErrorToast(msg) {
FlutterFlexibleToast.showToast( FlutterFlexibleToast.showToast(
message: msg, message: msg,
@ -29,7 +29,7 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
icon: ICON.CLOSE, icon: ICON.CLOSE,
fontSize: 16, fontSize: 16,
imageSize: 35, imageSize: 35,
timeInSeconds: 110, timeInSeconds: 185,
textColor: Colors.white); textColor: Colors.white);
} }
@ -75,4 +75,4 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
void cancelToast(msg) { void cancelToast(msg) {
FlutterFlexibleToast.cancel(); FlutterFlexibleToast.cancel();
} }
} }

@ -63,7 +63,7 @@ class _LoginFormState extends State<LoginForm> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProv = Provider.of<AuthViewModel>(context); authProv = Provider.of<AuthViewModel>(context);
projectsProv = Provider.of<HospitalViewModel>(context); projectsProv = Provider.of<HospitalViewModel>(context);
getProjects();
return Form( return Form(
key: loginFormKey, key: loginFormKey,
child: Container( child: Container(
@ -88,9 +88,13 @@ class _LoginFormState extends State<LoginForm> {
onSaved: (value) { onSaved: (value) {
userInfo.userID = value.trim(); userInfo.userID = value.trim();
}, },
onChanged: (value) {
userInfo.userID = value.trim();
},
onFieldSubmitted: (_) { onFieldSubmitted: (_) {
focusPass.nextFocus(); focusPass.nextFocus();
}, },
onEditingComplete: () {},
autofocus: false, autofocus: false,
), ),
buildSizedBox(), buildSizedBox(),
@ -113,8 +117,11 @@ class _LoginFormState extends State<LoginForm> {
}, },
onFieldSubmitted: (_) { onFieldSubmitted: (_) {
focusPass.nextFocus(); focusPass.nextFocus();
helpers.showCupertinoPicker( // helpers.showCupertinoPicker(
context, projectsList, 'Name', onSelectProject); // context, projectsList, 'facilityName', onSelectProject);
},
onTap: () {
this.getProjects(userInfo.userID);
}, },
), ),
buildSizedBox(), buildSizedBox(),
@ -123,8 +130,8 @@ class _LoginFormState extends State<LoginForm> {
focusNode: focusProject, focusNode: focusProject,
controller: projectIdController, controller: projectIdController,
onTap: () { onTap: () {
helpers.showCupertinoPicker( // helpers.showCupertinoPicker(context, projectsList,
context, projectsList, 'Name', onSelectProject); // 'facilityName', onSelectProject);
}, },
showCursor: false, showCursor: false,
readOnly: true, readOnly: true,
@ -143,7 +150,7 @@ class _LoginFormState extends State<LoginForm> {
readOnly: true, readOnly: true,
decoration: buildInputDecoration( decoration: buildInputDecoration(
context, context,
TranslationBase.of(context).loading, TranslationBase.of(context).pleaseEnterYourProject,
'assets/images/password_icon.png')), 'assets/images/password_icon.png')),
buildSizedBox(), buildSizedBox(),
Row( Row(
@ -322,13 +329,15 @@ class _LoginFormState extends State<LoginForm> {
}); });
} }
getProjectsList() { getProjectsList(memberID) {
//showLoading(); //showLoading();
projectsProv.getProjectsList().then((res) { projectsProv.getProjectsList(memberID).then((res) {
//hideLoading(); //hideLoading();
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
projectsList = res['ProjectInfo'];
setState(() { setState(() {
projectsList = res['ListProject']; userInfo.projectID = projectsList[0]["facilityId"];
projectIdController.text = projectsList[0]['facilityName'];
}); });
} else { } else {
// handel error // handel error
@ -350,8 +359,8 @@ class _LoginFormState extends State<LoginForm> {
onSelectProject(index) { onSelectProject(index) {
setState(() { setState(() {
userInfo.projectID = projectsList[index]["ID"]; userInfo.projectID = projectsList[index]["facilityId"];
projectIdController.text = projectsList[index]['Name']; projectIdController.text = projectsList[index]['facilityName'];
}); });
primaryFocus.unfocus(); primaryFocus.unfocus();
@ -371,10 +380,10 @@ class _LoginFormState extends State<LoginForm> {
Navigator.pop(context); Navigator.pop(context);
} }
getProjects() { getProjects(value) {
if (_isInit) { if (value != null && value != '') {
if (projectsList.length == 0) { if (projectsList.length == 0) {
getProjectsList(); getProjectsList(value);
} }
} }
_isInit = false; _isInit = false;

@ -1,13 +1,15 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/custom_validation_error.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
class DynamicElements extends StatefulWidget { class DynamicElements extends StatefulWidget {
final PatientModel _patientSearchFormValues; final PatientModel _patientSearchFormValues;
DynamicElements(this._patientSearchFormValues); final bool isFormSubmitted;
DynamicElements(this._patientSearchFormValues, this.isFormSubmitted);
@override @override
_DynamicElementsState createState() => _DynamicElementsState(); _DynamicElementsState createState() => _DynamicElementsState();
} }
@ -113,6 +115,10 @@ class _DynamicElementsState extends State<DynamicElements> {
), ),
SizedBox( SizedBox(
height: 5,
),
if(widget._patientSearchFormValues.From == "0" && widget.isFormSubmitted)
CustomValidationError(),SizedBox(
height: 10, height: 10,
), ),
AppTextFormField( AppTextFormField(
@ -137,6 +143,10 @@ class _DynamicElementsState extends State<DynamicElements> {
} }
}, },
), ),
if(widget._patientSearchFormValues.To == "0" && widget.isFormSubmitted)
CustomValidationError(),SizedBox(
height: 10,
),
], ],
); );
}, },

@ -91,7 +91,7 @@ class PatientPageHeaderWidget extends StatelessWidget {
), ),
], ],
), ),
model.patientAllergiesList.isNotEmpty ?AppText( model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?AppText(
TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic),
color: Color(0xFFB9382C), color: Color(0xFFB9382C),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

@ -94,7 +94,7 @@ class PatientProfileWidget extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
SizedBox( SizedBox(
width: 20, width: 4,
), ),
AppText( AppText(
patient.patientId.toString(), patient.patientId.toString(),

@ -43,7 +43,8 @@ final double height;
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'Dr. ${authProvider.doctorProfile.doctorName}', TranslationBase.of(context).dr +
' ${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.white, color: Colors.white,

@ -83,19 +83,17 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
child: Expanded( child: Texts(
child: Texts( projectViewModel.isArabic
projectViewModel.isArabic ? selectedAllergy.selectedAllergy.nameAr
? selectedAllergy.selectedAllergy.nameAr : selectedAllergy.selectedAllergy.nameEn
: selectedAllergy.selectedAllergy.nameEn .toUpperCase(),
.toUpperCase(), variant: "bodyText",
variant: "bodyText", textDecoration: selectedAllergy.isChecked
textDecoration: selectedAllergy.isChecked ? null
? null : TextDecoration.lineThrough,
: TextDecoration.lineThrough, bold: true,
bold: true, color: Colors.black),
color: Colors.black),
),
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
), ),
Texts( Texts(

@ -83,18 +83,16 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Container( Container(
child: Expanded( child: Texts(
child: Texts( projectViewModel.isArabic
projectViewModel.isArabic ? myHistory.selectedHistory.nameAr
? myHistory.selectedHistory.nameAr : myHistory.selectedHistory.nameEn,
: myHistory.selectedHistory.nameEn, variant: "bodyText",
variant: "bodyText", textDecoration: myHistory.isChecked
textDecoration: myHistory.isChecked ? null
? null : TextDecoration.lineThrough,
: TextDecoration.lineThrough, bold: true,
bold: true, color: Colors.black),
color: Colors.black),
),
width: MediaQuery.of(context).size.width * 0.7, width: MediaQuery.of(context).size.width * 0.7,
), ),
if (myHistory.isChecked) if (myHistory.isChecked)
@ -212,7 +210,9 @@ class _PriorityBarState extends State<PriorityBar> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: _priorities.map((item,) { children: _priorities.map((item,) {
bool _isActive = _priorities[_activePriority] == item ? true : false; bool _isActive = _priorities[_activePriority] == item ? true : false;
index++; if(index <2){
index++;
}
return Expanded( return Expanded(
child: InkWell( child: InkWell(
child: Center( child: Center(

@ -181,6 +181,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
selectedAllergy: selectedAllergy, selectedAllergy: selectedAllergy,
isChecked: element.isChecked, isChecked: element.isChecked,
createdBy: element.createdBy, createdBy: element.createdBy,
remark: element.remarks,
selectedAllergySeverity: selectedAllergySeverity); selectedAllergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null) if (selectedAllergy != null && selectedAllergySeverity != null)
widget.myAllergiesList.add(mySelectedAllergy); widget.myAllergiesList.add(mySelectedAllergy);
@ -522,7 +523,6 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
null) null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
//TODO: make static value dynamic
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(
ListHisProgNotePatientAllergyDiseaseVM( ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseId: allergy.selectedAllergy.id,
@ -545,6 +545,14 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
await model.patchAllergy(postAllergyRequestModel); await model.patchAllergy(postAllergyRequestModel);
} }
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
doctorID: '',
editedBy: '');
await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy : true);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
} }

@ -1,5 +1,6 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.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/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
@ -8,6 +9,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_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/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -263,7 +265,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).dType+':', TranslationBase.of(context).dType+' : ',
fontWeight: FontWeight fontWeight: FontWeight
.bold, .bold,
fontSize: 16, fontSize: 16,
@ -330,7 +332,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
children: [ children: [
AppText( AppText(
"ICD: ".toUpperCase(), "ICD : ".toUpperCase(),
fontWeight: FontWeight fontWeight: FontWeight
.bold, .bold,
fontSize: 16, fontSize: 16,
@ -788,7 +790,11 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
helpers helpers
.showErrorToast(model.error); .showErrorToast(model.error);
} else { } else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code;
mySelectedAssessment.doctorName = doctorProfile.doctorName;
if (!isUpdate) { if (!isUpdate) {
// widget.mySelectedAssessmentList.add(mySelectedAssessment); // widget.mySelectedAssessmentList.add(mySelectedAssessment);

@ -132,7 +132,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
), ),
Column( Column(
children: [ children: [
if(widget.patientProgressNote==null) if(widget.patientProgressNote.planNote == null)
Container( Container(
margin: margin:
EdgeInsets.only(left: 10, right: 10, top: 15), EdgeInsets.only(left: 10, right: 10, top: 15),
@ -161,7 +161,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
if (progressNoteController.text !='') if ( widget.patientProgressNote.planNote != null)
Container( Container(
margin: margin:
EdgeInsets.only(left: 5, right: 5, top: 15), EdgeInsets.only(left: 5, right: 5, top: 15),
@ -308,12 +308,16 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
planNote: progressNoteController.text, doctorID: '', editedBy: ''); planNote: widget.patientProgressNote.planNote, doctorID: '', editedBy: '');
if(model.patientProgressNoteList.isEmpty){ if(model.patientProgressNoteList.isEmpty){
await model.postProgressNote(postProgressNoteRequestModel); await model.postProgressNote(postProgressNoteRequestModel);
}else { }else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
postProgressNoteRequestModel.editedBy =doctorProfile.doctorID;
await model.patchProgressNote(postProgressNoteRequestModel); await model.patchProgressNote(postProgressNoteRequestModel);
} }
@ -335,12 +339,12 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
context: context, context: context,
builder: (context) { builder: (context) {
return FractionallySizedBox( return FractionallySizedBox(
heightFactor: 0.5, heightFactor: 0.6,
child: Container( child: Container(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Column( child: ListView(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 16, height: 16,
@ -355,6 +359,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
), ),
Container( Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15), margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: TextFields( child: TextFields(
hintText: TranslationBase.of(context).addProgressNote, hintText: TranslationBase.of(context).addProgressNote,
fontSize: 13.5, fontSize: 13.5,
@ -383,6 +388,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName??doctorProfile.doctorName; widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName??doctorProfile.doctorName;
widget.patientProgressNote.editedByName=doctorProfile.doctorName; widget.patientProgressNote.editedByName=doctorProfile.doctorName;
widget.patientProgressNote.createdOn= DateTime.now().toString() ; widget.patientProgressNote.createdOn= DateTime.now().toString() ;
widget.patientProgressNote.planNote = progressNoteController.text;
setState(() { setState(() {
print(progressNoteController.text); print(progressNoteController.text);
}); });

@ -37,6 +37,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel();
changePageViewIndex(pageIndex) { changePageViewIndex(pageIndex) {
changeLoadingState(true);
_controller.jumpToPage(pageIndex); _controller.jumpToPage(pageIndex);
} }

@ -1,9 +1,10 @@
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
@ -28,6 +29,7 @@ class _AppDrawerState extends State<AppDrawer> {
bool _isInit = true; bool _isInit = true;
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
ProjectViewModel projectsProvider; ProjectViewModel projectsProvider;
// @override // @override
// void didChangeDependencies() { // void didChangeDependencies() {
// super.didChangeDependencies(); // super.didChangeDependencies();
@ -47,119 +49,126 @@ class _AppDrawerState extends State<AppDrawer> {
// margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2), // margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2),
child: Drawer( child: Drawer(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
flex: 4, flex: 4,
child: ListView(padding: EdgeInsets.zero, children: <Widget>[ child: ListView(padding: EdgeInsets.zero, children: <Widget>[
Container( Container(
height: SizeConfig.heightMultiplier * 50, height: SizeConfig.heightMultiplier * 50,
child: InkWell( child: InkWell(
child: DrawerHeader( child: DrawerHeader(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Container(
child: Image.asset('assets/images/logo.png'), child: Image.asset(
margin: EdgeInsets.only(top: 10, bottom: 15), 'assets/images/logo.png',
),
SizedBox(
height: 1,
child: Container(
color: Colors.black26,
), ),
margin: EdgeInsets.only(top: 10, bottom: 15),
), ),
SizedBox(height: 15), SizedBox(
authProvider.doctorProfile != null height: 1,
? CircleAvatar( child: Container(
radius: SizeConfig.imageSizeMultiplier * 12, color: Colors.black26,
backgroundImage: NetworkImage( ),
authProvider.doctorProfile.doctorImageURL), ),
backgroundColor: Colors.white, SizedBox(height: 15),
) InkWell(
: SizedBox(), onTap: (){
authProvider.doctorProfile != null Navigator.of(context).pushNamed(PROFILE, arguments: {
? Padding( 'title': authProvider.doctorProfile.doctorName,
padding: EdgeInsets.only(top: 10), "doctorProfileall": authProvider.doctorProfile
child: AppText( });
authProvider.doctorProfile?.doctorName, },
fontWeight: FontWeight.bold, child: Column(
color: Colors.black, children: [
fontSize: SizeConfig.textMultiplier * 2, authProvider.doctorProfile != null
)) ? CircleAvatar(
: SizedBox(), radius: SizeConfig.imageSizeMultiplier * 12,
AppText( backgroundImage: NetworkImage(
projectsProvider.isArabic authProvider.doctorProfile.doctorImageURL),
? authProvider backgroundColor: Colors.white,
.doctorProfile.titleDescriptionN ?? )
"" : SizedBox(),
: authProvider authProvider.doctorProfile != null
.doctorProfile?.titleDescription ?? ? Padding(
"", padding: EdgeInsets.only(top: 10),
fontWeight: FontWeight.normal, child: AppText(
color: Colors.black87), authProvider.doctorProfile?.doctorName,
RaisedButton( fontWeight: FontWeight.bold,
shape: RoundedRectangleBorder( color: Colors.black,
borderRadius: BorderRadius.circular(18.0), fontSize: SizeConfig.textMultiplier * 2,
side: BorderSide(color: Colors.red)), ))
child: AppText( : SizedBox(),
TranslationBase.of(context).logout, AppText(
color: Colors.white, projectsProvider.isArabic
), ? authProvider
onPressed: () async { .doctorProfile.titleDescriptionN ??
Navigator.pop(context); ""
await helpers.logout(); : authProvider
}, .doctorProfile?.titleDescription ??
"",
fontWeight: FontWeight.normal,
color: Colors.black87),
],
),
),
RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
side: BorderSide(color: Colors.red)),
child: AppText(
TranslationBase.of(context).logout,
color: Colors.white,
),
onPressed: () async {
Navigator.pop(context);
await helpers.logout();
},
),
],
), ),
], ),
), ),
), ),
onTap: () { InkWell(
//Navigator.of(context).pushNamed(PROFILE); child: DrawerItem(
Navigator.of(context).pushNamed(PROFILE, arguments: { TranslationBase.of(context).settings, Icons.settings),
'title': authProvider.doctorProfile.doctorName, onTap: () {
"doctorProfileall": authProvider.doctorProfile Navigator.pop(context);
}); Navigator.of(context).pushNamed(SETTINGS);
}, },
), ),
), InkWell(
InkWell( child: DrawerItem(
child: DrawerItem( TranslationBase.of(context).qr +
TranslationBase.of(context).settings, Icons.settings), TranslationBase.of(context).reader,
onTap: () { DoctorApp.qr_code),
Navigator.pop(context); onTap: () {
Navigator.of(context).pushNamed(SETTINGS); Navigator.pop(context);
}, Navigator.of(context).pushNamed(QR_READER);
), },
InkWell( ),
child: DrawerItem( ]),
TranslationBase.of(context).qr +
TranslationBase.of(context).reader,
DoctorApp.qr_code),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(QR_READER);
},
), ),
]), Expanded(
), flex: 1,
Expanded( child: Column(children: <Widget>[
flex: 1, Container(
child: Column(children: <Widget>[ // This align moves the children to the bottom
Container( child: Align(
// This align moves the children to the bottom alignment: FractionalOffset.bottomCenter,
child: Align( child: Container(
alignment: FractionalOffset.bottomCenter, child: Column(
child: Container( children: <Widget>[
child: Column( Text("Powered by"),
children: <Widget>[ Image.asset(
Text("Powered by"), 'assets/images/cs_logo_container.png',
Image.asset( width: SizeConfig.imageSizeMultiplier * 30,
'assets/images/cs_logo_container.png', )
width: SizeConfig.imageSizeMultiplier * 30, ],
) ))))
], ]))
)))) ])),
]))
])),
), ),
width: SizeConfig.realScreenWidth * 0.60, width: SizeConfig.realScreenWidth * 0.60,
margin: 0, margin: 0,

@ -1,11 +1,12 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.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/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.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 'package:provider/provider.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import '../../widgets/shared/app_loader_widget.dart'; import '../../widgets/shared/app_loader_widget.dart';
import 'app_texts_widget.dart'; import 'app_texts_widget.dart';
import 'network_base_view.dart'; import 'network_base_view.dart';
@ -64,20 +65,21 @@ class AppScaffold extends StatelessWidget {
children: <Widget>[body, buildAppLoaderWidget(isLoading)]) children: <Widget>[body, buildAppLoaderWidget(isLoading)])
: Center( : Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
"assets/images/undraw_connected_world_wuay.png", "assets/images/undraw_connected_world_wuay.png",
height: 250, height: 250,
), ),
AppText('No Internet Connection') AppText('No Internet Connection')
], ],
), ),
)); ),
);
} }
Widget buildAppLoaderWidget(bool isloading) { Widget buildAppLoaderWidget(bool isLoading) {
return isloading ? AppLoaderWidget() : Container(); return isLoading ? AppLoaderWidget() : Container();
} }
} }

@ -28,7 +28,7 @@ class _DrawerItemState extends State<DrawerItem> {
return Container( return Container(
margin: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10), margin: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Icon( Icon(
widget.icon, widget.icon,
@ -37,12 +37,15 @@ class _DrawerItemState extends State<DrawerItem> {
), ),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
widget.title, widget.title,
color: widget.color ?? Colors.black, color: widget.color ?? Colors.black,
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
margin: 5, // margin: 5,
marginLeft: 5,
marginRight: 5,
fontSize: SizeConfig.textMultiplier * 2.3, fontSize: SizeConfig.textMultiplier * 2.3,
), ),
AppText( AppText(

Loading…
Cancel
Save