Merge branch 'feature--patient-referral' into 'development'

Feature  patient referral

See merge request Cloud_Solution/doctor_app_flutter!194
merge-requests/197/merge
Elham 4 years ago
commit debcefe7ce

@ -41,9 +41,12 @@ class BaseAppClient {
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null)
body['DoctorID'] = doctorProfile?.doctorID;
body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID;
}
if (body['ClinicID'] == null)
body['ClinicID'] = doctorProfile?.clinicID;
}
@ -76,16 +79,16 @@ class BaseAppClient {
'Accept': 'application/json'
});
final int statusCode = response.statusCode;
print("status: $statusCode}");
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
var parsed = json.decode(response.body.toString());
print("IsAuthenticated? ${parsed['IsAuthenticated']}");
if (!parsed['IsAuthenticated']) {
await helpers.logout();
helpers.showErrorToast('Your session expired Please login agian');
} else
if (parsed['MessageStatus'] == 1) {
helpers.showErrorToast('Your session expired Please login again');
} else if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode);
} else {
String error =
@ -94,17 +97,19 @@ class BaseAppClient {
if (parsed["ValidationErrors"] != null) {
if (parsed["ValidationErrors"]["ValidationErrors"] != null &&
parsed["ValidationErrors"]["ValidationErrors"].length != 0) {
error ='';
error = '';
for (var i = 0;
i < parsed["ValidationErrors"]["ValidationErrors"].length;
i++) {
error = error +parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] +"\n";
error = error +
parsed["ValidationErrors"]["ValidationErrors"][i]
["Messages"][0] +
"\n";
}
}
}
onFailure(error,
statusCode);
onFailure(error, statusCode);
}
}
} else {

@ -24,6 +24,8 @@ const PATIENT_GET_LIST_REFERAL_URL =
"Services/Lists.svc/REST/GetList_STPReferralFrequency";
const PATIENT_GET_CLINIC_BY_PROJECT_URL =
"Services/DoctorApplication.svc/REST/GetClinicsByProjectID";
const PROJECT_GET_INFO =
"Services/DoctorApplication.svc/REST/GetProjectInfo";
const GET_PROJECTS = 'Services/Lists.svc/REST/GetProjectForDoctorAPP';
const GET_PATIENT_VITAL_SIGN =
@ -59,6 +61,12 @@ const ADD_REFERRED_DOCTOR_REMARKS =
const GET_MY_REFERRED_PATIENT =
'Services/DoctorApplication.svc/REST/GtMyReferredPatient';
const GET_PENDING_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/PendingReferrals';
const CREATE_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/CreateReferral';
const GET_DOCTOR_WORKING_HOURS_TABLE =
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
@ -88,6 +96,9 @@ const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin';
const END_CALL = 'LiveCareApi/DoctorApp/EndCall';
const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge';
const GET_PATIENT_ARRIVAL_LIST =
'Services/DoctorApplication.svc/REST/PatientArrivalList';
// SOAP

@ -49,6 +49,7 @@ const Map<String, Map<String, String>> localizedValues = {
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'},
'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'},
'referPatient': {'en': 'Refer Patient', 'ar': 'إحالة مريض'},
'myReferral': {'en': 'My Referral', 'ar': 'إحالة'},
'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'},
'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'},
@ -283,4 +284,20 @@ const Map<String, Map<String, String>> localizedValues = {
"en": "Please enter message",
"ar": "يرجى ادخال الموضوع"
},
'referTo': {'en': "Refer To", 'ar': 'محال إلى'},
'referredFrom': {'en': "Referred From", 'ar': 'محال من'},
'branch': {'en': "Branch", 'ar': 'الفرع'},
'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'},
'appointmentNo': {'en': "Appointment #:", 'ar': '# الموعد:'},
'refer': {'en': "REFER", 'ar': 'إحالة'},
'approved': {'en': "Approved", 'ar': 'موافق عليه'},
'rejected': {'en': "Rejected", 'ar': 'مرفوض'},
'sameBranch': {'en': "Same Branch", 'ar': 'نفس الفرع'},
'otherBranch': {'en': "Other Branch", 'ar': 'فرع آخر'},
'dr': {'en': "DR.", 'ar': 'د.'},
'previewHealth': {'en': "Preview Health", 'ar': 'معاينة الصحة'},
'summaryReport': {'en': "Summary Report", 'ar': 'تقرير موجز'},
'accept': {'en': "ACCEPT", 'ar': 'قبول'},
'reject': {'en': "REJECT", 'ar': 'رفض'},
'noAppointmentsErrorMsg': {'en': "There is no appointments for at this date", 'ar': 'لا توجد مواعيد في هذا التاريخ'},
};

@ -6,7 +6,8 @@ enum MasterKeysService {
HistorySports,
HistorySurgical,
PhysicalExamination,
AllergySeverity
AllergySeverity,
physiotherapyGoals
}
extension SelectedMasterKeysService on MasterKeysService {
@ -37,6 +38,9 @@ extension SelectedMasterKeysService on MasterKeysService {
case MasterKeysService.AllergySeverity:
return 55;
break;
case MasterKeysService.physiotherapyGoals:
return 117;
break;
}
}
}

@ -1,8 +1,59 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
class BaseService {
String error;
bool hasError = false;
BaseAppClient baseAppClient = BaseAppClient();
//TODO add the user login model when we need it
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
DoctorProfileModel doctorProfile;
List<PatientArrivalEntity> patientArrivalList = [];
//TODO add the user login model when we need it
Future<DoctorProfileModel> getDoctorProfile() async {
if (doctorProfile == null) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
doctorProfile = DoctorProfileModel.fromJson(profile);
if (doctorProfile != null) {
return doctorProfile;
}
}
return null;
} else {
return doctorProfile;
}
}
Future getPatientArrivalList(String date) async{
hasError = false;
Map<String, dynamic> body = Map();
body['From'] = date;
body['To'] = date;
body['PageIndex'] = 0;
body['PageSize'] = 0;
await baseAppClient.post(
GET_PATIENT_ARRIVAL_LIST,
onSuccess: (dynamic response, int statusCode) {
patientArrivalList.clear();
response['patientArrivalList']['entityList'].forEach((v) {
PatientArrivalEntity item = PatientArrivalEntity.fromJson(v);
patientArrivalList.add(item);
});
},
onFailure: (String error, int statusCode) {
hasError = true;
this.error = error;
},
body: body,
);
}
}

@ -26,6 +26,8 @@ class LookupService extends BaseService {
List<MasterKeyModel> get historySurgicalList => _historySurgicalList;
List<MasterKeyModel> _historySurgicalList = [];
List<MasterKeyModel> listOfPhysiotherapyGoals = [];
Future getMasterLookup(MasterKeysService masterKeys) async {
Map<String, dynamic> body = {
"MasterInput": masterKeys.getMasterKeyService()
@ -93,6 +95,13 @@ class LookupService extends BaseService {
.add(MasterKeyModel.fromJson(v));
});
break;
case MasterKeysService.physiotherapyGoals:
listOfPhysiotherapyGoals.clear();
entryList.forEach((v) {
listOfPhysiotherapyGoals
.add(MasterKeyModel.fromJson(v));
});
break;
}
}
}

@ -0,0 +1,206 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/lookups/hospital_lookup.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart';
import 'base/lookup-service.dart';
class PatientReferralService extends LookupService {
List<dynamic> projectsList = [];
List<dynamic> clinicsList = [];
List<dynamic> doctorsList = [];
List<MyReferredPatientModel> listMyReferredPatientModel = [];
List<PendingReferral> pendingReferralList = [];
String setupID = "0";
Future getProjectsList() async {
hasError = false;
const url = GET_PROJECTS;
var info = {
"LanguageID": 1,
"stamp": "2020-02-26T13:51:44.111Z",
"IPAdress": "11.11.11.11",
"VersionID": 1.2,
"Channel": 9,
"TokenID": "",
"SessionID": "i1UJwCTSqt",
"IsLoginForDoctorApp": true
};
dynamic localRes;
await baseAppClient.post(url, onSuccess: (response, statusCode) async {
if (response['MessageStatus'] == 1) {
projectsList = response['ListProject'];
} else {
// handel error
projectsList = ListProject;
}
}, onFailure: (String error, int statusCode) {
projectsList = ListProject;
}, body: info);
}
Future getProjectInfo(int projectId) async {
Map<String, dynamic> body = Map();
body['ProjectID'] = projectId;
await baseAppClient.post(
PROJECT_GET_INFO,
onSuccess: (dynamic response, int statusCode) {
setupID = response['ProjectInfo'][0]['facilityGroupId'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
}
Future getClinicsList(int projectId) async {
hasError = false;
ClinicByProjectIdRequest _clinicByProjectIdRequest =
ClinicByProjectIdRequest();
_clinicByProjectIdRequest.projectID = projectId;
await baseAppClient.post(
PATIENT_GET_CLINIC_BY_PROJECT_URL,
onSuccess: (dynamic response, int statusCode) {
clinicsList = [];
clinicsList = response['List_Clinic_All'];
print(response['List_Clinic_All']);
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _clinicByProjectIdRequest.toJson(),
);
}
Future getDoctorsList(String clinicId) async {
hasError = false;
DoctorsByClinicIdRequest _doctorsByClinicIdRequest =
DoctorsByClinicIdRequest();
_doctorsByClinicIdRequest.clinicID = clinicId;
await baseAppClient.post(
PATIENT_GET_DOCTOR_BY_CLINIC_URL,
onSuccess: (dynamic response, int statusCode) {
doctorsList = [];
doctorsList = response['List_Doctors_All'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _doctorsByClinicIdRequest.toJson(),
);
}
Future getMyReferredPatient() async {
hasError = false;
RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel();
DoctorProfileModel doctorProfile = await getDoctorProfile();
await baseAppClient.post(
GET_MY_REFERRED_PATIENT,
onSuccess: (dynamic response, int statusCode) {
listMyReferredPatientModel.clear();
response['List_MyReferredPatient'].forEach((v) {
MyReferredPatientModel item = MyReferredPatientModel.fromJson(v);
if (doctorProfile != null) {
item.isReferralDoctorSameBranch =
doctorProfile.projectID == item.projectId;
} else {
item.isReferralDoctorSameBranch = false;
}
listMyReferredPatientModel.add(item);
});
// print(response['List_MyReferredPatient']);
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _requestMyReferralPatient.toJson(),
);
}
Future getPendingReferralList() async {
hasError = false;
DoctorProfileModel doctorProfile = await getDoctorProfile();
Map<String, dynamic> body = Map();
body['ClinicID'] = 0;
body['DoctorID'] = doctorProfile.doctorID;
await baseAppClient.post(
GET_PENDING_REFERRAL_PATIENT,
onSuccess: (dynamic response, int statusCode) {
pendingReferralList.clear();
response['PendingReferralList'].forEach((v) {
PendingReferral item = PendingReferral.fromJson(v);
item.isReferralDoctorSameBranch =
item.targetProjectId == item.sourceProjectId;
pendingReferralList.add(item);
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
}
Future makeReferral(
PatientArrivalEntity patientArrivalEntity,
String isoStringDate,
int projectID,
int clinicID,
int doctorID,
String remarks) async {
hasError = false;
Map<String, dynamic> body = Map();
List<dynamic> physiotheraphyGoalsList = [];
listOfPhysiotherapyGoals.forEach((element) {
physiotheraphyGoalsList
.add({"goalId": element.id, "remarks": element.remarks});
});
body['PatientMRN'] = patientArrivalEntity.patientMRN;
body['AppointmentNo'] = patientArrivalEntity.appointmentNo;
body['SetupID'] = setupID;
body['appointmentDate'] = isoStringDate;
body['SlotStart'] = isoStringDate;
body['SlotEnd'] = isoStringDate;
body['Remarks'] = remarks;
body['ProjectID'] = projectID;
body['ClinicID'] = clinicID;
body['DoctorID'] = doctorID;
body['noOfSessions'] = 1;
body['physiotheraphyGoalsList'] = physiotheraphyGoalsList;
await baseAppClient.post(
CREATE_REFERRAL_PATIENT,
onSuccess: (dynamic response, int statusCode) {
print(response.toString());
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
}
}

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/request_schedule.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_list_stp_referral_frequency_request.dart';
@ -82,8 +83,6 @@ class PatientService extends BaseService {
ClinicByProjectIdRequest();
ReferToDoctorRequest _referToDoctorRequest;
RequestSchedule _requestSchedule = RequestSchedule();
Future<dynamic> getPatientList(PatientModel patient, patientType) async {
hasError = false;
int val = int.parse(patientType);

@ -24,6 +24,7 @@ class ReferralPatientService extends BaseService {
response['List_MyReferralPatient'].forEach((v) {
listMyReferralPatientModel.add(MyReferralPatientModel.fromJson(v));
});
print(response['List_MyReferralPatient']);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -11,8 +11,6 @@ class ReferredPatientService extends BaseService {
List<MyReferredPatientModel> get listMyReferredPatientModel =>
_listMyReferredPatientModel;
Helpers helpers = Helpers();
RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel();
VerifyReferralDoctorRemarks _verifyreferraldoctorremarks =
@ -26,6 +24,7 @@ class ReferredPatientService extends BaseService {
response['List_MyReferredPatient'].forEach((v) {
listMyReferredPatientModel.add(MyReferredPatientModel.fromJson(v));
});
// print(response['List_MyReferredPatient']);
},
onFailure: (String error, int statusCode) {
hasError = true;

@ -1,17 +1,39 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/material.dart';
class BaseViewModel extends ChangeNotifier {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
DoctorProfileModel doctorProfile;
ViewState _state = ViewState.Idle;
bool isInternetConnection = true;
ViewState get state => _state;
String error = "";
//TODO add the user login model when we need it
void setState(ViewState viewState) {
_state = viewState;
notifyListeners();
}
Future<DoctorProfileModel> getDoctorProfile() async {
if (doctorProfile == null) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
doctorProfile = DoctorProfileModel.fromJson(profile);
if (doctorProfile != null) {
return doctorProfile;
}
}
return null;
} else {
return doctorProfile;
}
}
}

@ -0,0 +1,146 @@
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/viewstate.dart';
import 'package:doctor_app_flutter/core/service/patient-doctor-referral-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import '../../locator.dart';
class PatientReferralViewModel extends BaseViewModel {
PatientReferralService _referralPatientService =
locator<PatientReferralService>();
List<dynamic> get branchesList => _referralPatientService.projectsList;
List<dynamic> get clinicsList => _referralPatientService.clinicsList;
List<dynamic> get doctorsList => _referralPatientService.doctorsList;
List<MyReferredPatientModel> get listMyReferredPatientModel =>
_referralPatientService.listMyReferredPatientModel;
List<PendingReferral> get pendingReferral =>
_referralPatientService.pendingReferralList;
List<PatientArrivalEntity> get patientArrivalList =>
_referralPatientService.patientArrivalList;
Future getMasterLookup(MasterKeysService masterKeys) async {
setState(ViewState.Busy);
await _referralPatientService.getMasterLookup(masterKeys);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
await getBranches();
}
Future getBranches() async {
setState(ViewState.Busy);
await _referralPatientService.getProjectsList();
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future getClinics(int projectId) async {
setState(ViewState.Busy);
await _referralPatientService.getClinicsList(projectId);
await _referralPatientService.getProjectInfo(projectId);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getClinicDoctors(String clinicId) async {
setState(ViewState.Busy);
await _referralPatientService.getDoctorsList(clinicId);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future<dynamic> getDoctorBranch() async {
DoctorProfileModel doctorProfile = await getDoctorProfile();
if (doctorProfile != null) {
dynamic _selectedBranch = {
"ID": doctorProfile.projectID,
"Desciption": doctorProfile.projectName
};
return _selectedBranch;
}
return null;
}
Future getMyReferredPatient() async {
setState(ViewState.Busy);
await _referralPatientService.getMyReferredPatient();
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
MyReferredPatientModel getReferredPatientItem(int index) {
return listMyReferredPatientModel[index];
}
Future getPendingReferralPatients() async {
setState(ViewState.Busy);
await _referralPatientService.getPendingReferralList();
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPatientArrivalList(String date) async {
setState(ViewState.Busy);
await _referralPatientService.getPatientArrivalList(date);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
List<dynamic> getAppointmentsByPatientName(String patientName) {
List<dynamic> appointments = [];
patientArrivalList.forEach((element) {
if (element.patientName == patientName) {
appointments.add(element.toJson());
}
});
return appointments;
}
Future makeReferral(PatientArrivalEntity patientArrivalEntity,
String isoStringDate,
int projectID,
int clinicID,
int doctorID,
String remarks) async {
setState(ViewState.Busy);
await _referralPatientService.makeReferral(patientArrivalEntity, isoStringDate, projectID, clinicID, doctorID, remarks);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}

@ -43,12 +43,15 @@ class PatientViewModel extends BaseViewModel {
get patientProgressNoteList => _patientService.patientProgressNoteList;
List<dynamic> get clinicsList => _patientService.clinicsList;
List<dynamic> get doctorsList => _patientService.doctorsList;
List<dynamic> get referralFrequencyList => _patientService.referalFrequancyList;
List<dynamic> get referralFrequencyList =>
_patientService.referalFrequancyList;
Future getPatientList(PatientModel patient, patientType,
{bool isBusyLocal = false}) async {
if(isBusyLocal) {
if (isBusyLocal) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
@ -56,11 +59,12 @@ class PatientViewModel extends BaseViewModel {
return _patientService.getPatientList(patient, patientType);
if (_patientService.hasError) {
error = _patientService.error;
if(isBusyLocal) {
if (isBusyLocal) {
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Error);
} } else
}
} else
setState(ViewState.Idle);
}
@ -183,8 +187,9 @@ class PatientViewModel extends BaseViewModel {
}
List getDoctorNameList() {
var doctorNamelist =
_patientService.doctorsList.map((value) => value['DoctorName'].toString()).toList();
var doctorNamelist = _patientService.doctorsList
.map((value) => value['DoctorName'].toString())
.toList();
return doctorNamelist;
}
@ -194,6 +199,7 @@ class PatientViewModel extends BaseViewModel {
.toList();
return clinicsNameslist;
}
Future getReferralFrequancyList() async {
setState(ViewState.Busy);
await _patientService.getReferralFrequancyList();

@ -5,12 +5,14 @@ import 'package:get_it/get_it.dart';
import 'core/service/SOAP_service.dart';
import 'core/service/doctor_reply_service.dart';
import 'core/service/medicine_service.dart';
import 'core/service/patient-doctor-referral-service.dart';
import 'core/service/referral_patient_service.dart';
import 'core/service/referred_patient_service.dart';
import 'core/service/schedule_service.dart';
import 'core/viewModel/SOAP_view_model.dart';
import 'core/viewModel/doctor_replay_view_model.dart';
import 'core/viewModel/medicine_view_model.dart';
import 'core/viewModel/patient-doctor-referral-viewModel.dart';
import 'core/viewModel/referral_view_model.dart';
import 'core/viewModel/referred_view_model.dart';
import 'core/viewModel/schedule_view_model.dart';
@ -27,6 +29,7 @@ void setupLocator() {
locator.registerLazySingleton(() => MedicineService());
locator.registerLazySingleton(() => PatientService());
locator.registerLazySingleton(() => SOAPService());
locator.registerLazySingleton(() => PatientReferralService());
/// View Model
locator.registerFactory(() => DoctorReplayViewModel());
@ -36,4 +39,5 @@ void setupLocator() {
locator.registerFactory(() => MedicineViewModel());
locator.registerFactory(() => PatientViewModel());
locator.registerFactory(() => SOAPViewModel());
locator.registerFactory(() => PatientReferralViewModel());
}

@ -60,7 +60,7 @@ class MyApp extends StatelessWidget {
buttonColor: HexColor('#B8382C'),
fontFamily: 'WorkSans',
dividerColor: Colors.grey[350],
backgroundColor: Color.fromRGBO(255,255,255, 1)
backgroundColor: Color.fromRGBO(255,255,255, 1),
),
initialRoute: INIT_ROUTE,
routes: routes,

@ -0,0 +1,84 @@
class PatientArrivalEntity {
String age;
String appointmentDate;
int appointmentNo;
String appointmentType;
String arrivedOn;
String companyName;
String endTime;
int episodeNo;
int fallRiskScore;
String gender;
int medicationOrders;
String mobileNumber;
String nationality;
int patientMRN;
String patientName;
int rowCount;
String startTime;
String visitType;
PatientArrivalEntity(
{this.age,
this.appointmentDate,
this.appointmentNo,
this.appointmentType,
this.arrivedOn,
this.companyName,
this.endTime,
this.episodeNo,
this.fallRiskScore,
this.gender,
this.medicationOrders,
this.mobileNumber,
this.nationality,
this.patientMRN,
this.patientName,
this.rowCount,
this.startTime,
this.visitType});
PatientArrivalEntity.fromJson(Map<String, dynamic> json) {
age = json['age'];
appointmentDate = json['appointmentDate'];
appointmentNo = json['appointmentNo'];
appointmentType = json['appointmentType'];
arrivedOn = json['arrivedOn'];
companyName = json['companyName'];
endTime = json['endTime'];
episodeNo = json['episodeNo'];
fallRiskScore = json['fallRiskScore'];
gender = json['gender'];
medicationOrders = json['medicationOrders'];
mobileNumber = json['mobileNumber'];
nationality = json['nationality'];
patientMRN = json['patientMRN'];
patientName = json['patientName'];
rowCount = json['rowCount'];
startTime = json['startTime'];
visitType = json['visitType'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['age'] = this.age;
data['appointmentDate'] = this.appointmentDate;
data['appointmentNo'] = this.appointmentNo;
data['appointmentType'] = this.appointmentType;
data['arrivedOn'] = this.arrivedOn;
data['companyName'] = this.companyName;
data['endTime'] = this.endTime;
data['episodeNo'] = this.episodeNo;
data['fallRiskScore'] = this.fallRiskScore;
data['gender'] = this.gender;
data['medicationOrders'] = this.medicationOrders;
data['mobileNumber'] = this.mobileNumber;
data['nationality'] = this.nationality;
data['patientMRN'] = this.patientMRN;
data['patientName'] = this.patientName;
data['rowCount'] = this.rowCount;
data['startTime'] = this.startTime;
data['visitType'] = this.visitType;
return data;
}
}

@ -0,0 +1,119 @@
class PendingReferral {
String responded;
String answerFromTarget;
String createdOn;
int data;
String editedOn;
int interBranchReferral;
int patientID;
String patientName;
int patientType;
int referralNo;
String referralStatus;
String referredByDoctorInfo;
String referredFromBranchName;
String referredOn;
String referredType;
String remarksFromSource;
String respondedOn;
int sourceAppointmentNo;
int sourceProjectId;
String sourceSetupID;
String startDate;
int targetAppointmentNo;
String targetClinicID;
String targetDoctorID;
int targetProjectId;
String targetSetupID;
bool isReferralDoctorSameBranch;
PendingReferral(
{this.responded,
this.answerFromTarget,
this.createdOn,
this.data,
this.editedOn,
this.interBranchReferral,
this.patientID,
this.patientName,
this.patientType,
this.referralNo,
this.referralStatus,
this.referredByDoctorInfo,
this.referredFromBranchName,
this.referredOn,
this.referredType,
this.remarksFromSource,
this.respondedOn,
this.sourceAppointmentNo,
this.sourceProjectId,
this.sourceSetupID,
this.startDate,
this.targetAppointmentNo,
this.targetClinicID,
this.targetDoctorID,
this.targetProjectId,
this.targetSetupID,
this.isReferralDoctorSameBranch,
});
PendingReferral.fromJson(Map<String, dynamic> json) {
responded = json['Responded'];
answerFromTarget = json['answerFromTarget'];
createdOn = json['createdOn'];
data = json['data'];
editedOn = json['editedOn'];
interBranchReferral = json['interBranchReferral'];
patientID = json['patientID'];
patientName = json['patientName'];
patientType = json['patientType'];
referralNo = json['referralNo'];
referralStatus = json['referralStatus'];
referredByDoctorInfo = json['referredByDoctorInfo'];
referredFromBranchName = json['referredFromBranchName'];
referredOn = json['referredOn'];
referredType = json['referredType'];
remarksFromSource = json['remarksFromSource'];
respondedOn = json['respondedOn'];
sourceAppointmentNo = json['sourceAppointmentNo'];
sourceProjectId = json['sourceProjectId'];
sourceSetupID = json['sourceSetupID'];
startDate = json['startDate'];
targetAppointmentNo = json['targetAppointmentNo'];
targetClinicID = json['targetClinicID'];
targetDoctorID = json['targetDoctorID'];
targetProjectId = json['targetProjectId'];
targetSetupID = json['targetSetupID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Responded'] = this.responded;
data['answerFromTarget'] = this.answerFromTarget;
data['createdOn'] = this.createdOn;
data['data'] = this.data;
data['editedOn'] = this.editedOn;
data['interBranchReferral'] = this.interBranchReferral;
data['patientID'] = this.patientID;
data['patientName'] = this.patientName;
data['patientType'] = this.patientType;
data['referralNo'] = this.referralNo;
data['referralStatus'] = this.referralStatus;
data['referredByDoctorInfo'] = this.referredByDoctorInfo;
data['referredFromBranchName'] = this.referredFromBranchName;
data['referredOn'] = this.referredOn;
data['referredType'] = this.referredType;
data['remarksFromSource'] = this.remarksFromSource;
data['respondedOn'] = this.respondedOn;
data['sourceAppointmentNo'] = this.sourceAppointmentNo;
data['sourceProjectId'] = this.sourceProjectId;
data['sourceSetupID'] = this.sourceSetupID;
data['startDate'] = this.startDate;
data['targetAppointmentNo'] = this.targetAppointmentNo;
data['targetClinicID'] = this.targetClinicID;
data['targetDoctorID'] = this.targetDoctorID;
data['targetProjectId'] = this.targetProjectId;
data['targetSetupID'] = this.targetSetupID;
return data;
}
}

@ -59,6 +59,7 @@ class MyReferredPatientModel {
this.priorityDescription,
this.referralClinicDescription,
this.referralDoctorName,
this.isReferralDoctorSameBranch,
});
int projectId;
@ -111,6 +112,7 @@ class MyReferredPatientModel {
String priorityDescription;
String referralClinicDescription;
String referralDoctorName;
bool isReferralDoctorSameBranch;
factory MyReferredPatientModel.fromJson(Map<String, dynamic> json) => MyReferredPatientModel(
projectId: json["ProjectID"],

@ -38,6 +38,8 @@ import './screens/settings/settings_screen.dart';
import 'landing_page.dart';
import 'screens/doctor/doctor_reply_screen.dart';
import 'screens/live_care/panding_list.dart';
import 'screens/patients/profile/referral/my-referral-detail-screen.dart';
import 'screens/patients/profile/referral/refer-patient-screen.dart';
const String INIT_ROUTE = ROOT;
const String ROOT = 'root';
@ -66,6 +68,8 @@ const String PRESCRIPTIONS = 'patients/prescription';
const String RADIOLOGY = 'patients/radiology';
const String PROGRESS_NOTE = 'patients/progress-note';
const String REFER_PATIENT = 'patients/refer-patient';
const String MY_REFERRAL_DETAIL = 'my_referral_detail';
const String REFER_PATIENT_TO_DOCTOR = 'patients/refer-to-doctor';
const String PATIENT_ORDERS = 'patients/patient_orders';
const String PATIENT_INSURANCE_APPROVALS =
'patients/patient_insurance_approvals';
@ -105,6 +109,7 @@ var routes = {
RADIOLOGY: (_) => RadiologyScreen(),
PROGRESS_NOTE: (_) => ProgressNoteScreen(),
REFER_PATIENT: (_) => ReferPatientScreen(),
REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(),
PATIENT_ORDERS: (_) => PatientsOrdersScreen(),
PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(),
VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(),
@ -114,4 +119,5 @@ var routes = {
// VIDEO_CALL: (_) => VideoCallPage(patientData: null),
LIVECARE_PENDING_LIST: (_) => LiveCarePandingListScreen(),
// LIVECARE_END_DIALOG: (_) => EndCallDialogBox()
MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(),
};

@ -7,9 +7,11 @@ import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -23,6 +25,7 @@ import 'doctor/doctor_reply_screen.dart';
import 'doctor/my_referral_patient_screen.dart';
import 'doctor/my_referred_patient_screen.dart';
import 'medicine/medicine_search_screen.dart';
import 'patients/profile/referral/referred-patient-screen.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = Helpers();
@ -80,65 +83,24 @@ class _DashboardScreenState extends State<DashboardScreen> {
Stack(children: [
Column(
children: <Widget>[
Container(
height: 140,
color: HexColor('#515B5D'),
width: double.infinity,
child: FractionallySizedBox(
widthFactor: 0.9,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
AppText(
TranslationBase
.of(context)
.welcome,
fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.white,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
'Dr. ${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.white,
)
],
),
SizedBox(
height: 4,
),
ProfileWelcomeWidget(
InkWell(
onTap: () async {
showCupertinoPicker(
decKey: '',
context: context,
actionList: projectsProvider
.doctorClinicsList);
actionList: projectsProvider.doctorClinicsList);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
child: AppText(
authProvider.selectedClinicName !=
null
authProvider.selectedClinicName != null
? authProvider.selectedClinicName
: authProvider.doctorProfile
.clinicDescription,
fontSize:
SizeConfig.textMultiplier * 1.7,
: authProvider
.doctorProfile.clinicDescription,
fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.white,
textAlign: TextAlign.center,
),
@ -147,67 +109,31 @@ class _DashboardScreenState extends State<DashboardScreen> {
: Alignment.topLeft,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
InkWell(
child: Container(
margin: EdgeInsets.only(
left: 5,
top: projectsProvider
.isArabic ? 0 : 5,
top: projectsProvider.isArabic
? 0
: 5,
right: 10,
bottom: projectsProvider
.isArabic ? 15 : 7),
bottom: projectsProvider.isArabic
? 15
: 7),
child: Icon(
DoctorApp.sync_icon,
color: Colors.white,
size: SizeConfig
.textMultiplier *
1.8,
size: SizeConfig.textMultiplier * 1.8,
)),
),
],
),
]),
),
],
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Container(
decoration: BoxDecoration(
color: Theme
.of(context)
.backgroundColor,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
),
height: 50,
width: 60,
child: Image.network(
authProvider.doctorProfile
.doctorImageURL,
// fit: BoxFit.fill,
),
),
],
),
),
],
),
),
),
Container(
color: Colors.white,
@ -246,14 +172,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
AppText("38",
fontSize:
SizeConfig.textMultiplier * 3.7,
AppText(
"38",
fontSize: SizeConfig.textMultiplier * 3.7,
color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold,),
AppText(TranslationBase
.of(context)
.outPatients,
fontWeight: FontWeight.bold,
),
AppText(
TranslationBase.of(context).outPatients,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.4,
color: HexColor('#5D4C35'),
@ -418,15 +344,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.white,
),
AppText(
TranslationBase
.of(context)
.labResult,
TranslationBase.of(context).labResult,
color: Colors.white,
)
],
),
),
],
),
imageName: '1.png',
@ -446,7 +369,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
Container(
margin: EdgeInsets.only(bottom: 10),
child: Column(
children: <Widget>[
AppText(
@ -455,15 +377,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.white,
),
AppText(
TranslationBase
.of(context)
.radiology,
TranslationBase.of(context).radiology,
color: Colors.white,
)
],
),
),
],
),
imageName: '2.png',
@ -481,10 +400,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.white,
),
),
Container(
margin: EdgeInsets.only(bottom: 10),
child: Column(
children: <Widget>[
AppText(
@ -493,20 +410,16 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.white,
),
AppText(
TranslationBase
.of(context)
.referral,
TranslationBase.of(context).referral,
color: Colors.white,
)
],
),
),
],
),
imageName: '3.png',
opacity: 0.9,
),
],
),
@ -542,9 +455,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.white,
),
AppText(
TranslationBase
.of(context)
.inPatient,
TranslationBase.of(context).inPatient,
color: Colors.white,
)
],
@ -555,21 +466,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
imageName: '4.png',
color: HexColor('#B8382C'),
hasBorder: false,
width: MediaQuery
.of(context)
.size
.width * 0.44,
height: MediaQuery
.of(context)
.orientation == Orientation.portrait
? MediaQuery
.of(context)
.size
.height * 0.13:
MediaQuery
.of(context)
.size
.height * 0.25,
width: MediaQuery.of(context).size.width * 0.44,
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.13
: MediaQuery.of(context).size.height * 0.25,
),
DashboardItem(
child: Padding(
@ -596,9 +497,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.white,
),
AppText(
TranslationBase
.of(context)
.operations,
TranslationBase.of(context).operations,
color: Colors.white,
)
],
@ -609,21 +508,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
imageName: '5.png',
color: HexColor('#B8382C'),
hasBorder: false,
width: MediaQuery
.of(context)
.size
.width * 0.44,
height: MediaQuery
.of(context)
.orientation == Orientation.portrait
? MediaQuery
.of(context)
.size
.height * 0.13:
MediaQuery
.of(context)
.size
.height * 0.25,
width: MediaQuery.of(context).size.width * 0.44,
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.13
: MediaQuery.of(context).size.height * 0.25,
),
],
),
@ -633,9 +522,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Row(
children: <Widget>[
AppText(
TranslationBase
.of(context)
.patientServices,
TranslationBase.of(context).patientServices,
fontSize: SizeConfig.textMultiplier * 3,
),
],
@ -691,16 +578,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
Column(
children: [
AppText(
TranslationBase
.of(context)
.theDoctor,
TranslationBase.of(context).theDoctor,
textAlign: TextAlign.center,
color: Colors.black,
),
AppText(
TranslationBase
.of(context)
.reply,
TranslationBase.of(context).reply,
textAlign: TextAlign.center,
color: Colors.black,
),
@ -713,8 +596,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
DoctorReplyScreen(),
builder: (context) => DoctorReplyScreen(),
),
);
},
@ -729,9 +611,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.black,
),
AppText(
TranslationBase
.of(context)
.searchMedicine,
TranslationBase.of(context).searchMedicine,
color: Colors.black,
textAlign: TextAlign.center,
)
@ -742,8 +622,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
MedicineSearchScreen(),
builder: (context) => MedicineSearchScreen(),
),
);
},
@ -777,12 +656,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
AppText(
projectsProvider.isArabic
? TranslationBase
.of(context)
.qr
: TranslationBase
.of(context)
.reader,
? TranslationBase.of(context).qr
: TranslationBase.of(context).reader,
color: Colors.black,
textAlign: TextAlign.center,
),
@ -806,9 +681,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.black,
),
AppText(
TranslationBase
.of(context)
.myReferralPatient,
TranslationBase.of(context).myReferralPatient,
textAlign: TextAlign.center,
color: Colors.black,
)
@ -820,7 +693,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
context,
MaterialPageRoute(
builder: (context) =>
MyReferralPatient(),
MyReferralPatientScreen(),
),
);
},
@ -835,9 +708,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
color: Colors.black,
),
AppText(
TranslationBase
.of(context)
.myReferredPatient,
TranslationBase.of(context).myReferredPatient,
color: Colors.black,
textAlign: TextAlign.center,
)
@ -848,8 +719,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
MyReferredPatient(),
builder: (context) => ReferredPatientScreen(),
// MyReferredPatient(),
),
);
},
@ -890,9 +761,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
CupertinoButton(
child: AppText(TranslationBase
.of(context)
.cancel
child: AppText(TranslationBase.of(context).cancel
// style: TextStyle(context)
),
onPressed: () {
@ -900,9 +769,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
},
),
CupertinoButton(
child: AppText(TranslationBase
.of(context)
.done
child: AppText(TranslationBase.of(context).done
// style: textStyle(context),
),
onPressed: () {
@ -927,8 +794,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: AppText(
e.clinicName,
fontSize:
SizeConfig.textMultiplier *
1.9,
SizeConfig.textMultiplier * 1.9,
)),
),
))
@ -969,10 +835,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
});
}
}
// TODO Move to it file
class DashboardItem extends StatelessWidget {
const DashboardItem({
this.hasBorder = false,
const DashboardItem(
{this.hasBorder = false,
this.imageName,
@required this.child,
this.onTap,
@ -980,8 +847,8 @@ class DashboardItem extends StatelessWidget {
this.width,
this.height,
this.color,
this.opacity = 0.4
}) : super(key: key);
this.opacity = 0.4})
: super(key: key);
final bool hasBorder;
final String imageName;
final Widget child;
@ -996,38 +863,34 @@ class DashboardItem extends StatelessWidget {
return InkWell(
onTap: onTap,
child: Container(
width: width != null ? width : MediaQuery
.of(context)
.size
.width * 0.29,
height: height != null ? height : MediaQuery
.of(context)
.orientation == Orientation.portrait ? MediaQuery
.of(context)
.size
.height * 0.19 : MediaQuery
.of(context)
.size
.height * 0.35,
width: width != null ? width : MediaQuery.of(context).size.width * 0.29,
height: height != null
? height
: MediaQuery.of(context).orientation == Orientation.portrait
? MediaQuery.of(context).size.height * 0.19
: MediaQuery.of(context).size.height * 0.35,
decoration: BoxDecoration(
color: !hasBorder ? color != null ? color : HexColor('#050705')
.withOpacity(opacity) : Colors
.white,
color: !hasBorder
? color != null
? color
: HexColor('#050705').withOpacity(opacity)
: Colors.white,
borderRadius: BorderRadius.circular(6.0),
border: hasBorder ? Border.all(
width: 1.0, color: const Color(0xffcccccc)) : Border.all(
width: 0.0, color: Colors.transparent),
image: imageName != null ? DecorationImage(
border: hasBorder
? Border.all(width: 1.0, color: const Color(0xffcccccc))
: Border.all(width: 0.0, color: Colors.transparent),
image: imageName != null
? DecorationImage(
image: AssetImage('assets/images/dashboard/${imageName}'),
fit: BoxFit.cover,
colorFilter: new ColorFilter.mode(
Colors.black.withOpacity(0.2), BlendMode.dstIn),
) : null,
)
: null,
),
child: Center(
child: child,
),
child: Center(child: child,),
),
);
}

@ -293,6 +293,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
}
});
}).catchError((error) {
setState(() {
_isError = true;
_isLoading = false;

@ -0,0 +1,147 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-doctor-referral-viewModel.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MyReferralDetailScreen extends StatelessWidget {
PendingReferral pendingReferral;
@override
Widget build(BuildContext context) {
final gridHeight = (MediaQuery.of(context).size.width * 0.3) * 1.8;
AuthViewModel authProvider = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
pendingReferral = routeArgs['referral'];
return BaseView<PatientReferralViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ProfileWelcomeWidget(
AppText(
authProvider.selectedClinicName != null
? authProvider.selectedClinicName
: authProvider.doctorProfile.clinicDescription,
fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.white,
textAlign: TextAlign.center,
),
height: 100,
),
SizedBox(
height: 16,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: AppText(
TranslationBase.of(context).myReferralPatient,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
PatientReferralItemWidget(
patientName: pendingReferral.patientName,
referralStatus: null,
isReferredTo: false,
isSameBranch: pendingReferral.isReferralDoctorSameBranch,
referralDoctorName: pendingReferral.referredByDoctorInfo,
clinicDescription: null,
remark: pendingReferral.remarksFromSource,
),
SizedBox(
child: GridView.count(
childAspectRatio: 1.8,
crossAxisSpacing: 8,
mainAxisSpacing: 10,
controller: new ScrollController(keepScrollOffset: false),
shrinkWrap: true,
padding: const EdgeInsets.all(4.0),
crossAxisCount: 2,
children: [
PatientProfileButton(
key: key,
// patient: patient,
// route: RADIOLOGY,
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'radiology-1.png'),
PatientProfileButton(
key: key,
// patient: patient,
// route: LAB_ORDERS,
nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result,
icon: 'lab.png'),
PatientProfileButton(
key: key,
// patient: patient,
// route: VITAL_SIGN_DETAILS,
nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs,
icon: 'heartbeat.png'),
],
),
),
],
),
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Row(
children: [
Expanded(
child: BorderedButton(
TranslationBase.of(context).accept,
backgroundColor: Color(0xFF4BA821),
textColor: Colors.white,
fontSize: 16,
hPadding: 8,
vPadding: 12,
handler: null,
),
),
SizedBox(
height: 8,
),
Expanded(
child: BorderedButton(
TranslationBase.of(context).reject,
backgroundColor: Color(0xFFB9382C),
textColor: Colors.white,
fontSize: 16,
hPadding: 8,
vPadding: 12,
handler: null,
),
),
],
),
),
],
),
),
);
}
}

@ -0,0 +1,98 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-doctor-referral-viewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../routes.dart';
class MyReferralPatientScreen extends StatelessWidget {
// previous design page is: MyReferralPatient
@override
Widget build(BuildContext context) {
AuthViewModel authProvider = Provider.of(context);
return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getPendingReferralPatients(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
body: model.pendingReferral == null ||
model.pendingReferral.length == 0
? Center(
child: AppText(
TranslationBase.of(context).errorNoSchedule,
color: Theme.of(context).errorColor,
),
)
: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ProfileWelcomeWidget(
AppText(
authProvider.selectedClinicName != null
? authProvider.selectedClinicName
: authProvider.doctorProfile.clinicDescription,
fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.white,
textAlign: TextAlign.center,
),
height: 100,
),
SizedBox(
height: 16,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: AppText(
TranslationBase.of(context).myReferralPatient,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
...List.generate(
model.pendingReferral.length,
(index) => PatientReferralItemWidget(
patientName: model.pendingReferral[index].patientName,
referralStatus: null,
isReferredTo: false,
isSameBranch: model.pendingReferral[index]
.isReferralDoctorSameBranch,
referralDoctorName:
model.pendingReferral[index].referredByDoctorInfo,
clinicDescription: null,
remark:
model.pendingReferral[index].remarksFromSource,
infoIcon: InkWell(
onTap: () {
Navigator.of(context).pushNamed(
MY_REFERRAL_DETAIL,
arguments: {
'referral': model.pendingReferral[index]
});
},
child: Icon(
Icons.info_outline,
color: Colors.black,
size: 30,
),
),
),
),
],
),
),
),
),
);
}
}

@ -0,0 +1,459 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-doctor-referral-viewModel.dart';
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../QR_reader_screen.dart';
class PatientMakeReferralScreen extends StatefulWidget {
// previous design page is: ReferPatientScreen
@override
_PatientMakeReferralScreenState createState() =>
_PatientMakeReferralScreenState();
}
class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
PatiantInformtion patient;
List<dynamic> referToList;
dynamic _referTo;
dynamic _selectedBranch;
dynamic _selectedClinic;
dynamic _selectedDoctor;
DateTime appointmentDate;
final _remarksController = TextEditingController();
PatientArrivalEntity _selectedPatientArrivalEntity;
@override
void initState() {
super.initState();
referToList = List();
dynamic sameBranch = {"id": 1, "name": "Same Branch"};
dynamic otherBranch = {"id": 2, "name": "Other Branch"};
referToList.add(sameBranch);
referToList.add(otherBranch);
appointmentDate = DateTime.now();
}
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
final screenSize = MediaQuery.of(context).size;
return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getBranches(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
body: SingleChildScrollView(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
children: [
Container(
height: 75,
child: AppText(
"This is where upper view for avatar.. etc placed",
fontWeight: FontWeight.normal,
fontSize: 16,
),
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
Container(
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).referPatient,
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
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(() {
_referTo = selectedValue;
_selectedBranch = null;
_selectedClinic = null;
_selectedDoctor = null;
model
.getDoctorBranch()
.then((value) {
_selectedBranch = value;
if (_referTo['id'] == 1) {
model.getClinics(
_selectedBranch['ID']);
}
});
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).referTo,
_referTo != null ? _referTo['name'] : null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.branchesList != null &&
model.branchesList.length > 0 &&
_referTo != null &&
_referTo['id'] == 2
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.branchesList,
attributeName: 'Desciption',
attributeValueId: 'ID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedBranch = selectedValue;
_selectedClinic = null;
_selectedDoctor = null;
model.getClinics(
_selectedBranch['ID']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).branch,
_selectedBranch != null
? _selectedBranch['Desciption']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedBranch != null &&
model.clinicsList != null &&
model.clinicsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.clinicsList,
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = null;
_selectedClinic = selectedValue;
model.getClinicDoctors(
_selectedClinic['ClinicID']
.toString());
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).clinic,
_selectedClinic != null
? _selectedClinic['ClinicDescription']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedClinic != null &&
model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doctor,
_selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () => _selectDate(context, model),
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.chooseAppointment,
_selectedPatientArrivalEntity != null
? "${TranslationBase.of(context).appointmentNo} ${_selectedPatientArrivalEntity.appointmentNo}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).remarks,
null,
false),
enabled: true,
controller: _remarksController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_LETTERS))
],
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
],
),
),
],
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: AppButton(
title: TranslationBase.of(context).refer,
color: HexColor("#B8382B"),
onPressed: () {
if (_selectedPatientArrivalEntity == null ||
_selectedBranch == null ||
_selectedClinic == null ||
_selectedDoctor == null ||
_remarksController.text == null) return;
model.makeReferral(
_selectedPatientArrivalEntity,
appointmentDate.toIso8601String(),
_selectedBranch['ID'],
_selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'],
_remarksController.text).then((_) => Navigator.pop(context));
},
),
)
],
),
),
),
),
);
}
_selectDate(BuildContext context, PatientReferralViewModel model) async {
// https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference
// https://stackoverflow.com/a/63147062/6246772 to customize a date picker
final DateTime picked = await showDatePicker(
context: context,
initialDate: appointmentDate,
firstDate: appointmentDate.add(Duration(hours: 2)),
lastDate: DateTime(2040),
initialEntryMode: DatePickerEntryMode.calendar,
);
if (picked != null && picked != appointmentDate) {
appointmentDate = picked;
model
.getPatientArrivalList(DateUtils.convertStringToDateFormat(
appointmentDate.toString(), "yyyy-MM-dd"))
.then((_) {
if (model.patientArrivalList != null &&
model.patientArrivalList.length > 0) {
List<dynamic> appointments = model.getAppointmentsByPatientName(
"${patient.firstName} ${patient.middleName} ${patient.lastName}");
if (appointments.length > 0) {
ListSelectDialog dialog = ListSelectDialog(
list: appointments,
attributeName: 'appointmentNo',
attributeValueId: 'appointmentNo',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedPatientArrivalEntity =
PatientArrivalEntity.fromJson(selectedValue);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
} else {
setState(() {
_selectedPatientArrivalEntity = null;
});
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).noAppointmentsErrorMsg);
}
} else {
setState(() {
_selectedPatientArrivalEntity = null;
});
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).noAppointmentsErrorMsg);
}
});
}
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(6)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: 2.0,
)),
);
}
}

@ -0,0 +1,74 @@
import 'package:doctor_app_flutter/core/viewModel/patient-doctor-referral-viewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class ReferredPatientScreen extends StatelessWidget {
// previous design page is: MyReferredPatient
@override
Widget build(BuildContext context) {
return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getMyReferredPatient(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
body: model.listMyReferredPatientModel == null ||
model.listMyReferredPatientModel.length == 0
? Center(
child: AppText(
TranslationBase.of(context).errorNoSchedule,
color: Theme.of(context).errorColor,
),
)
: SingleChildScrollView(
child: Container(
child: Column(
children: [
Container(
height: 75,
child: AppText(
"This is where upper view for avatar.. etc placed",
fontWeight: FontWeight.normal,
fontSize: 16,
),
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
...List.generate(
model.listMyReferredPatientModel.length,
(index) => PatientReferralItemWidget(
patientName:
"${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
referralStatus:
"${model.getReferredPatientItem(index).referralStatus}",
isReferredTo: true,
isSameBranch: model
.getReferredPatientItem(index)
.isReferralDoctorSameBranch,
referralDoctorName: model
.getReferredPatientItem(index)
.referralDoctorName,
clinicDescription: model
.getReferredPatientItem(index)
.referralClinicDescription,
remark: model
.getReferredPatientItem(index)
.referringDoctorRemarks,
),
),
],
),
),
),
),
);
}
}

@ -41,7 +41,7 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
timeInSeconds: 1);
}
void showTopShortToast(msg) {
static void showTopShortToast(msg) {
FlutterFlexibleToast.showToast(
message: msg,
toastLength: Toast.LENGTH_SHORT,

@ -348,6 +348,7 @@ class Helpers {
String lang = await sharedPref.getString(APP_Language);
await clearSharedPref();
sharedPref.setString(APP_Language, lang);
Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN);
// Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN);
Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN)));
}
}

@ -80,6 +80,7 @@ class TranslationBase {
String get searchMedicine =>
localizedValues['searchMedicine'][locale.languageCode];
String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode];
String get referPatient => localizedValues['referPatient'][locale.languageCode];
String get myReferral => localizedValues['myReferral'][locale.languageCode];
String get myReferredPatient =>
localizedValues['myReferredPatient'][locale.languageCode];
@ -301,6 +302,22 @@ class TranslationBase {
String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode];
String get emptyMessage => localizedValues['empty-message'][locale.languageCode];
String get referTo => localizedValues['referTo'][locale.languageCode];
String get referredFrom => localizedValues['referredFrom'][locale.languageCode];
String get branch => localizedValues['branch'][locale.languageCode];
String get chooseAppointment => localizedValues['chooseAppointment'][locale.languageCode];
String get appointmentNo => localizedValues['appointmentNo'][locale.languageCode];
String get refer => localizedValues['refer'][locale.languageCode];
String get approved => localizedValues['approved'][locale.languageCode];
String get rejected => localizedValues['rejected'][locale.languageCode];
String get sameBranch => localizedValues['sameBranch'][locale.languageCode];
String get otherBranch => localizedValues['otherBranch'][locale.languageCode];
String get dr => localizedValues['dr'][locale.languageCode];
String get previewHealth => localizedValues['previewHealth'][locale.languageCode];
String get summaryReport => localizedValues['summaryReport'][locale.languageCode];
String get accept => localizedValues['accept'][locale.languageCode];
String get reject => localizedValues['reject'][locale.languageCode];
String get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -0,0 +1,143 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class PatientReferralItemWidget extends StatelessWidget {
final String patientName;
final String referralStatus;
final isReferredTo;
final isSameBranch;
final String referralDoctorName;
final String clinicDescription;
final String remark;
final Widget infoIcon;
PatientReferralItemWidget({
this.patientName,
this.referralStatus,
this.isReferredTo = false,
this.isSameBranch,
this.referralDoctorName,
this.clinicDescription,
this.remark,
this.infoIcon,
});
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.all(16.0),
child: Column(
children: [
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Center(
child: AppText(
patientName,
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
if (referralStatus != null)
Container(
color: Color(0xFF4BA821),
padding: EdgeInsets.all(4),
child: AppText(
referralStatus == "46"
? TranslationBase.of(context).approved
: TranslationBase.of(context).rejected,
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12,
),
),
SizedBox(
height: 8,
),
Row(
children: [
AppText(
isReferredTo
? "${TranslationBase.of(context).referTo}: "
: "${TranslationBase.of(context).referredFrom}: ",
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText(
isSameBranch
? TranslationBase.of(context).sameBranch
: TranslationBase.of(context).otherBranch,
color: Colors.grey,
fontWeight: FontWeight.normal,
fontSize: 12,
),
],
),
SizedBox(
height: 8,
),
AppText(
"${TranslationBase.of(context).dr} $referralDoctorName",
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
SizedBox(
height: 8,
),
if (clinicDescription != null)
Row(
children: [
AppText(
"${TranslationBase.of(context).clinic}: ",
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 12,
),
AppText(
clinicDescription,
color: Colors.grey,
fontWeight: FontWeight.normal,
fontSize: 12,
),
],
),
SizedBox(
height: 8,
),
AppText(
remark,
color: Colors.grey,
fontWeight: FontWeight.normal,
fontSize: 12,
),
SizedBox(
height: 16,
),
],
),
),
if (infoIcon != null) infoIcon,
],
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 8,
),
],
),
);
}
}

@ -0,0 +1,86 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class PatientProfileButton extends StatelessWidget {
final String nameLine1;
final String nameLine2;
final String icon;
final dynamic route;
final PatiantInformtion patient;
final String url = "assets/images/";
PatientProfileButton(
{Key key, this.patient, this.nameLine1, this.nameLine2, this.icon, this.route})
: super(key: key);
@override
Widget build(BuildContext context) {
return new Container(
margin: new EdgeInsets.symmetric(horizontal: 4.0),
child: InkWell(
onTap: () {
navigator(context, this.route);
},
child: Column(children: <Widget>[
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.all(5),
child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
this.nameLine1,
color: Color(0xFFB9382C),
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
),
AppText(
this.nameLine2,
color: Colors.black,
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
),
],
),
),
Expanded(
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
padding: EdgeInsets.all(10),
child: new Image.asset(url + icon))
],
)),
)
]),
),
decoration: BoxDecoration(
// border: Border.all(),
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB),
width: 1,
)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],
),
padding: EdgeInsets.fromLTRB(5, 10, 5, 5),
);
}
void navigator(BuildContext context, route) {
Navigator.of(context).pushNamed(route, arguments: {'patient': patient});
}
}

@ -0,0 +1,86 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class ProfileWelcomeWidget extends StatelessWidget {
final Widget clinicWidget;
final double height;
ProfileWelcomeWidget(this.clinicWidget, {this.height = 140});
@override
Widget build(BuildContext context) {
AuthViewModel authProvider = Provider.of(context);
return Container(
height: height,
color: HexColor('#515B5D'),
width: double.infinity,
child: FractionallySizedBox(
widthFactor: 0.9,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
AppText(
TranslationBase.of(context).welcome,
fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.white,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
'Dr. ${authProvider.doctorProfile.doctorName}',
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.5,
color: Colors.white,
)
],
),
SizedBox(
height: 4,
),
clinicWidget,
],
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Container(
decoration: BoxDecoration(
color: Theme.of(context).backgroundColor,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
),
height: 50,
width: 60,
child: Image.network(
authProvider.doctorProfile.doctorImageURL,
// fit: BoxFit.fill,
),
),
],
),
),
],
),
),
);
}
}

@ -6,9 +6,10 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../config/size_config.dart';
import '../../shared/app_texts_widget.dart';
import '../../shared/rounded_container_widget.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'PatientProfileButton.dart';
/*
*@author: Elham Rababah
*@Date:22/4/2020
@ -58,8 +59,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
key: key,
patient: patient,
route: RADIOLOGY,
nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service,
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'radiology-1.png'),
Visibility(
visible: selectedPatientType != 0 && selectedPatientType != 5,
@ -84,7 +85,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
child: PatientProfileButton(
key: key,
patient: patient,
route: REFER_PATIENT,
route: REFER_PATIENT_TO_DOCTOR,
nameLine1: TranslationBase.of(context).myReferral,
nameLine2: TranslationBase.of(context).patient,
icon: 'note.png')),
@ -149,85 +150,3 @@ class CircleAvatarWidget extends StatelessWidget {
);
}
}
class PatientProfileButton extends StatelessWidget {
final String nameLine1;
final String nameLine2;
final String icon;
final dynamic route;
final PatiantInformtion patient;
final String url = "assets/images/";
PatientProfileButton(
{Key key, this.patient, this.nameLine1, this.nameLine2, this.icon, this.route})
: super(key: key);
@override
Widget build(BuildContext context) {
return new Container(
margin: new EdgeInsets.symmetric(horizontal: 4.0),
child: InkWell(
onTap: () {
navigator(context, this.route);
},
child: Column(children: <Widget>[
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.all(5),
child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
this.nameLine1,
color: Color(0xFFB9382C),
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
),
AppText(
this.nameLine2,
color: Colors.black,
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
),
],
),
),
Expanded(
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
padding: EdgeInsets.all(10),
child: new Image.asset(url + icon))
],
)),
)
]),
),
decoration: BoxDecoration(
// border: Border.all(),
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB),
width: 1,
)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],
),
padding: EdgeInsets.fromLTRB(5, 10, 5, 5),
);
}
void navigator(BuildContext context, route) {
Navigator.of(context).pushNamed(route, arguments: {'patient': patient});
}
}

@ -0,0 +1,83 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/material.dart';
class BorderedButton extends StatelessWidget {
final String text;
final Function handler;
final Color textColor;
final bool hasBorder;
final Color borderColor;
final Color backgroundColor;
final double vPadding;
final double hPadding;
final double radius;
final double lPadding;
final double tPadding;
final double rPadding;
final double bPadding;
final double fontSize;
final Widget icon;
final FontWeight fontWeight;
BorderedButton(
this.text, {
this.handler,
this.textColor,
this.hasBorder = false,
this.borderColor,
this.backgroundColor,
this.vPadding = 0,
this.hPadding = 0,
this.radius = 4.0,
this.lPadding = 4.0,
this.tPadding = 0.0,
this.rPadding = 4.0,
this.bPadding = 0.0,
this.fontSize = 0,
this.icon,
this.fontWeight,
});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
handler();
},
child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: backgroundColor ?? Colors.white,
borderRadius: BorderRadius.circular(radius),
border: Border.fromBorderSide(BorderSide(
color: hasBorder ? borderColor : Colors.white,
width: 0.8,
)),
),
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
icon != null ? icon : Container(),
Container(
padding: (hPadding > 0 || vPadding > 0)
? EdgeInsets.symmetric(
vertical: vPadding, horizontal: hPadding)
: EdgeInsets.fromLTRB(
lPadding, tPadding, rPadding, bPadding),
child: Text(
text,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: fontSize == 0 ? SizeConfig.textMultiplier * 1.6 : fontSize,
fontWeight: fontWeight != null ? fontWeight : FontWeight.normal,
color: textColor ?? Color(0xffc4aa54)),
),
),
],
),
),
),
);
}
}
Loading…
Cancel
Save