LiveCare Scheduling updates

merge-update-with-lab-changes
haroon amjad 5 years ago
parent 06798ef327
commit c9256a654a

@ -47,6 +47,7 @@ const Map<String, Map<String, String>> localizedValues = {
},
'confirmAppo': {'en': 'Confirm Appointment', 'ar': 'تأكيد الموعد'},
'confirm': {'en': 'Confirm', 'ar': 'تأكيد'},
'confirmLiveCare': {'en': 'Confirm LiveCare', 'ar': 'تأكيد لايف كير'},
'appointment': {'en': 'Appointment', 'ar': 'الموعد'},
'confirmLater': {'en': 'Confirm Later', 'ar': 'تأكيد لاحقا'},
'todoList': {'en': 'Todo List', 'ar': 'مهامي'},

@ -14,3 +14,4 @@ const FAMILY_FILE = 'family-file';
const USER_LAT = 'user-lat';
const USER_LONG = 'user-long';
const IS_GO_TO_PARKING = 'IS_GO_TO_PARKING';
const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment';

@ -13,17 +13,17 @@ class PatientShareResponse {
String doctorImageURL;
String doctorNameObj;
List<String> doctorSpeciality;
Null errCode;
dynamic errCode;
int groupID;
bool iSAllowOnlineCheckedIN;
Null insurancePolicyNo;
dynamic insurancePolicyNo;
bool isExcludedForOnlineCheckin;
int isFollowup;
bool isLiveCareAppointment;
bool isOnlineCheckedIN;
String message;
int nextAction;
Null patientCardID;
dynamic patientCardID;
int patientID;
dynamic patientShare;
dynamic patientShareWithTax;
@ -32,20 +32,20 @@ class PatientShareResponse {
String patientType;
int paymentAmount;
String paymentDate;
Null paymentMethodName;
Null paymentReferenceNumber;
dynamic paymentMethodName;
dynamic paymentReferenceNumber;
int policyId;
String policyName;
String procedureName;
int projectID;
String projectName;
Null setupID;
dynamic setupID;
int sourceType;
String startTime;
int status;
int statusCode;
Null statusDesc;
Null subPolicyNo;
dynamic statusDesc;
dynamic subPolicyNo;
int userID;
PatientShareResponse(

@ -0,0 +1,64 @@
class LiveCareScheduleClinicsListResponse {
List<ClinicsHaveScheduleList> clinicsHaveScheduleList;
LiveCareScheduleClinicsListResponse({this.clinicsHaveScheduleList});
LiveCareScheduleClinicsListResponse.fromJson(Map<String, dynamic> json) {
if (json['ClinicsHaveScheduleList'] != null) {
clinicsHaveScheduleList = new List<ClinicsHaveScheduleList>();
json['ClinicsHaveScheduleList'].forEach((v) {
clinicsHaveScheduleList.add(new ClinicsHaveScheduleList.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.clinicsHaveScheduleList != null) {
data['ClinicsHaveScheduleList'] =
this.clinicsHaveScheduleList.map((v) => v.toJson()).toList();
}
return data;
}
}
class ClinicsHaveScheduleList {
int clinicID;
int serviceID;
int projectID;
String clinicDesc;
String clinicDescN;
String projectDesc;
String projectDescN;
ClinicsHaveScheduleList(
{this.clinicID,
this.serviceID,
this.projectID,
this.clinicDesc,
this.clinicDescN,
this.projectDesc,
this.projectDescN});
ClinicsHaveScheduleList.fromJson(Map<String, dynamic> json) {
clinicID = json['ClinicID'];
serviceID = json['ServiceID'];
projectID = json['ProjectID'];
clinicDesc = json['ClinicDesc'];
clinicDescN = json['ClinicDescN'];
projectDesc = json['ProjectDesc'];
projectDescN = json['ProjectDescN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ClinicID'] = this.clinicID;
data['ServiceID'] = this.serviceID;
data['ProjectID'] = this.projectID;
data['ClinicDesc'] = this.clinicDesc;
data['ClinicDescN'] = this.clinicDescN;
data['ProjectDesc'] = this.projectDesc;
data['ProjectDescN'] = this.projectDescN;
return data;
}
}

@ -24,10 +24,12 @@ class BookConfirm extends StatefulWidget {
String appoDateFormatted = "";
String appoTimeFormatted = "";
bool isLiveCareAppointment;
BookConfirm(
{@required this.doctor,
@required this.selectedDate,
@required this.isLiveCareAppointment,
@required this.selectedTime});
DoctorsListService service;
@ -358,7 +360,11 @@ class _BookConfirmState extends State<BookConfirm> {
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
insertAppointment(context, widget.doctor);
if (!widget.isLiveCareAppointment) {
insertAppointment(context, widget.doctor);
} else {
insertLiveCareScheduledAppointment(context, widget.doctor);
}
},
child: Text(TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 18.0)),
@ -375,7 +381,11 @@ class _BookConfirmState extends State<BookConfirm> {
service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () {
insertAppointment(context, docObject);
if (!widget.isLiveCareAppointment) {
insertAppointment(context, widget.doctor);
} else {
insertLiveCareScheduledAppointment(context, widget.doctor);
}
});
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
@ -434,6 +444,55 @@ class _BookConfirmState extends State<BookConfirm> {
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
insertLiveCareScheduledAppointment(context, DoctorList docObject) {
AppoitmentAllHistoryResultList appo;
widget.service
.insertLiveCareScheduleAppointment(
docObject.doctorID,
docObject.clinicID,
docObject.projectID,
docObject.serviceID,
widget.selectedTime,
widget.selectedDate,
context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 1800), () {
getLiveCareAppointmentPatientShare(context, res['AppointmentNo'],
docObject.clinicID, docObject.projectID, docObject);
});
} else {
appo = new AppoitmentAllHistoryResultList();
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
appo.projectID = res['SameClinicApptList'][0]['ProjectID'];
appo.endTime = res['SameClinicApptList'][0]['EndTime'];
appo.startTime = res['SameClinicApptList'][0]['StartTime'];
appo.doctorID = res['SameClinicApptList'][0]['DoctorID'];
appo.isLiveCareAppointment = true;
appo.originalClinicID = 0;
appo.originalProjectID = 0;
appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate'];
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: res['ErrorEndUserMessage'],
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {cancelAppointment(docObject, appo, context)},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
}).catchError((err) {
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
getPatientShare(context, String appointmentNo, int clinicID, int projectID,
DoctorList docObject) {
widget.service
@ -448,6 +507,21 @@ class _BookConfirmState extends State<BookConfirm> {
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
getLiveCareAppointmentPatientShare(context, String appointmentNo,
int clinicID, int projectID, DoctorList docObject) {
widget.service
.getLiveCareAppointmentPatientShare(
appointmentNo, clinicID, projectID, context)
.then((res) {
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
String getTime(DateTime dateTime) {
final DateFormat formatter = DateFormat('HH:mm');
setState(() {
@ -502,7 +576,6 @@ class _BookConfirmState extends State<BookConfirm> {
Future navigateToBookSuccess(context, DoctorList docObject,
PatientShareResponse patientShareResponse) async {
Navigator.push(
context,
MaterialPageRoute(

@ -39,12 +39,6 @@ class _BookSuccessState extends State<BookSuccess> {
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -184,6 +178,9 @@ class _BookSuccessState extends State<BookSuccess> {
case 30:
return _getQRAppo();
break;
case 50:
return _getConfirmAppo();
break;
}
}
@ -204,6 +201,9 @@ class _BookSuccessState extends State<BookSuccess> {
case 30:
return 'QR Code';
break;
case 50:
return 'Confirm LiveCare';
break;
}
}
@ -286,8 +286,19 @@ class _BookSuccessState extends State<BookSuccess> {
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {},
child: Text(TranslationBase.of(context).confirm.toUpperCase(),
onPressed: () {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.clinicID = widget.docObject.clinicID;
appo.projectID = widget.docObject.projectID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo;
confirmAppointment(appo);
},
child: Text(
widget.patientShareResponse.isLiveCareAppointment
? TranslationBase.of(context)
.confirmLiveCare
.toUpperCase()
: TranslationBase.of(context).confirm.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
@ -321,6 +332,23 @@ class _BookSuccessState extends State<BookSuccess> {
return Container();
}
confirmAppointment(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service
.confirmAppointment(
appo.appointmentNo, appo.clinicID, appo.projectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
navigateToHome(context);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Widget _getPayNowAppo() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -543,7 +571,8 @@ class _BookSuccessState extends State<BookSuccess> {
}
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
@ -560,22 +589,12 @@ class _BookSuccessState extends State<BookSuccess> {
appo.appointmentNo.toString());
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
//
// Future navigateToQR(
// context, String appoQR, PatientShareResponse patientShareResponse) async {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => QRCode(
// patientShareResponse: patientShareResponse,
// appoQR: appoQR,
// ))).then((value) {});
// }
addAdvancedNumberRequest(String advanceNumber, String paymentReference,
String appointmentID) {
addAdvancedNumberRequest(
String advanceNumber, String paymentReference, String appointmentID) {
DoctorsListService service = new DoctorsListService();
service
.addAdvancedNumberRequest(
@ -585,7 +604,8 @@ class _BookSuccessState extends State<BookSuccess> {
getAppoQR(context);
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Widget _getQRAppo() {
@ -742,7 +762,8 @@ class _BookSuccessState extends State<BookSuccess> {
navigateToQR(context, res['AppointmentQR']);
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Future navigateToQR(context, String appoQR) async {

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -10,7 +11,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'BookConfirm.dart';
import 'components/DocAvailableAppointments.dart';
import 'components/DocInfo.dart';
@ -19,9 +20,12 @@ class DoctorProfile extends StatefulWidget {
DoctorList doctor;
DoctorProfileList docProfileList;
final bool isOpenAppt;
bool isLiveCareAppointment;
DoctorProfile(
{@required this.doctor,
@required this.docProfileList,
@required this.isLiveCareAppointment,
this.isOpenAppt = false});
AuthenticatedUser authUser;
@ -35,6 +39,7 @@ class _DoctorProfileState extends State<DoctorProfile>
TabController _tabController;
bool showFooterButton = false;
var event = RobotProvider();
@override
void initState() {
_tabController = new TabController(
@ -54,6 +59,7 @@ class _DoctorProfileState extends State<DoctorProfile>
});
_tabController = new TabController(length: 2, vsync: this);
widget.authUser = new AuthenticatedUser();
widget.doctor.speciality = widget.docProfileList.specialty;
getPatientData();
super.initState();
}
@ -190,7 +196,9 @@ class _DoctorProfileState extends State<DoctorProfile>
physics: NeverScrollableScrollPhysics(),
children: [
DoctorInformation(docProfileList: widget.docProfileList),
DocAvailableAppointments(doctor: widget.doctor)
DocAvailableAppointments(
doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment)
],
controller: _tabController,
),
@ -245,6 +253,7 @@ class _DoctorProfileState extends State<DoctorProfile>
MaterialPageRoute(
builder: (context) => BookConfirm(
doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment,
selectedDate: DocAvailableAppointments.selectedDate,
selectedTime: DocAvailableAppointments.selectedTime)));
}

@ -9,9 +9,10 @@ import 'package:flutter/material.dart';
class SearchResults extends StatefulWidget {
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
bool isLiveCareAppointment;
SearchResults(
{@required this.doctorsList, this.patientDoctorAppointmentListHospital});
{@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
@override
_SearchResultsState createState() => _SearchResultsState();
@ -53,6 +54,7 @@ class _SearchResultsState extends State<SearchResults> {
.map((doctor) {
return DoctorView(
doctor: doctor,
isLiveCareAppointment: widget.isLiveCareAppointment,
);
}).toList(),
)),

@ -2,12 +2,13 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:table_calendar/table_calendar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:table_calendar/table_calendar.dart';
import '../../../uitl/date_uitl.dart';
@ -17,8 +18,10 @@ class DocAvailableAppointments extends StatefulWidget {
static DateTime selectedAppoDateTime;
static String selectedDate;
static String selectedTime;
bool isLiveCareAppointment;
DocAvailableAppointments({@required this.doctor});
DocAvailableAppointments(
{@required this.doctor, @required this.isLiveCareAppointment});
@override
_DocAvailableAppointmentsState createState() =>
@ -31,6 +34,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
AnimationController _animationController;
CalendarController _calendarController;
AppSharedPreferences sharedPref = new AppSharedPreferences();
var selectedDate = "";
dynamic selectedDateJSON;
dynamic jsonFreeSlots;
@ -56,8 +61,13 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
_selectedDay: ['Event A0']
};
WidgetsBinding.instance
.addPostFrameCallback((_) => getDoctorFreeSlots(context, widget.doctor));
WidgetsBinding.instance.addPostFrameCallback((_) async {
if (widget.isLiveCareAppointment)
getDoctorScheduledFreeSlots(context, widget.doctor);
else {
getDoctorFreeSlots(context, widget.doctor);
}
});
_calendarController = CalendarController();
_animationController = AnimationController(
@ -323,8 +333,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
getDoctorFreeSlots(context, DoctorList docObject) {
DoctorsListService service = new DoctorsListService();
service
.getDoctorFreeSlots(
docObject.doctorID, docObject.clinicID, docObject.projectID, context)
.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID,
docObject.projectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) {
@ -340,7 +350,32 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
}
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
getDoctorScheduledFreeSlots(context, DoctorList docObject) {
DoctorsListService service = new DoctorsListService();
service
.getDoctorScheduledFreeSlots(docObject.doctorID, docObject.clinicID,
docObject.projectID, docObject.serviceID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
if (res['PatientER_DoctorFreeSlots'].length != 0) {
freeSlotsResponse = res['PatientER_DoctorFreeSlots'];
print("res['PatientER_DoctorFreeSlots']");
print(res['PatientER_DoctorFreeSlots'].length);
_getJSONSlots().then((value) => {
setState(() => {_events.clear(), _events = value})
});
} else {}
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Widget _buildEventsMarker(DateTime date, List events) {

@ -162,6 +162,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
context,
MaterialPageRoute(
builder: (context) => SearchResults(
isLiveCareAppointment: false,
doctorsList: docList,
patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital)));

@ -128,8 +128,8 @@ class _ExpandableListViewState extends State<ExpandableListView> {
widget.doctorsList2[index].projectName.toString()
? DoctorView(
//AJ note
doctor: widget.doctorsList2[index]
doctor: widget.doctorsList2[index],
isLiveCareAppointment: false,
// widget.doctorsList2[index]
)
: Container();

@ -11,9 +11,10 @@ import '../DoctorProfile.dart';
class DoctorView extends StatelessWidget {
final DoctorList doctor;
bool isLiveCareAppointment;
DoctorView({@required this.doctor});
DoctorView({@required this.doctor, @required this.isLiveCareAppointment});
@override
Widget build(BuildContext context) {
@ -185,6 +186,7 @@ class DoctorView extends StatelessWidget {
MaterialPageRoute(
builder: (context) => DoctorProfile(
doctor: docObject,
isLiveCareAppointment: isLiveCareAppointment,
docProfileList: docProfile,
isOpenAppt: isAppo,
)));

@ -113,7 +113,7 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
IconButton(
icon: Icon(
Icons
.arrow_forward_rounded,
.arrow_forward_ios,
color:
tappedIndex == index
? Colors.white

@ -356,14 +356,15 @@ class _AppointmentActionsState extends State<AppointmentActions> {
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)).then((value) {
Navigator.of(context).pop();
});
}
openAppointmentRadiology() {

@ -284,7 +284,7 @@ class _ToDoState extends State<ToDo> {
break;
case 50:
return "assets/images/new-design/liveCare_logo_icon.png";
return "assets/images/new-design/confirm_button.png";
break;
default:
@ -297,14 +297,15 @@ class _ToDoState extends State<ToDo> {
case 10:
confirmAppointment(appo);
break;
case 20:
getPatientShare(context, appo);
break;
case 30:
getAppoQR(context, appo);
break;
case 50:
confirmAppointment(appo);
break;
}
}
@ -334,7 +335,7 @@ class _ToDoState extends State<ToDo> {
break;
case 50:
return TranslationBase.of(context).livecare;
return TranslationBase.of(context).confirmLiveCare;
break;
default:
@ -444,7 +445,8 @@ class _ToDoState extends State<ToDo> {
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
getPatientShare(context, AppoitmentAllHistoryResultList appo) {
@ -457,7 +459,8 @@ class _ToDoState extends State<ToDo> {
openPaymentDialog(appo, widget.patientShareResponse);
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
getAppoQR(context, AppoitmentAllHistoryResultList appo) {
@ -478,7 +481,8 @@ class _ToDoState extends State<ToDo> {
navigateToQR(context, res['AppointmentQR'], patientShareResponse);
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Future navigateToQR(
@ -592,7 +596,8 @@ class _ToDoState extends State<ToDo> {
}
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
@ -610,7 +615,8 @@ class _ToDoState extends State<ToDo> {
appo);
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
addAdvancedNumberRequest(String advanceNumber, String paymentReference,
@ -624,7 +630,8 @@ class _ToDoState extends State<ToDo> {
getAppoQR(context, appo);
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Future navigateToPaymentMethod(
@ -670,6 +677,7 @@ class _ToDoState extends State<ToDo> {
}
}).catchError((err) {
print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
}

@ -8,6 +8,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'livecare_type_select.dart';
class LiveCareHome extends StatefulWidget {
static bool showFooterButton = true;

@ -0,0 +1,51 @@
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart';
import 'package:flutter/material.dart';
class ScheduleClinicCard extends StatefulWidget {
bool isSelected;
final ClinicsHaveScheduleList clinicsHaveScheduleList;
var languageID;
ScheduleClinicCard(
{this.isSelected,
this.languageID,
@required this.clinicsHaveScheduleList});
@override
_ScheduleClinicCardState createState() => _ScheduleClinicCardState();
}
class _ScheduleClinicCardState extends State<ScheduleClinicCard> {
@override
Widget build(BuildContext context) {
return Container(
child: Card(
margin: EdgeInsets.fromLTRB(15.0, 10.0, 15.0, 8.0),
color: widget.isSelected ? Colors.blue : Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
child: Text(
widget.languageID == 'ar'
? widget.clinicsHaveScheduleList.clinicDescN
: widget.clinicsHaveScheduleList.clinicDesc,
style: TextStyle(
fontSize: 16.0,
color:
widget.isSelected ? Colors.white : Colors.black)),
),
],
),
),
),
);
}
}

@ -0,0 +1,224 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class LiveCareTypeSelect extends StatefulWidget {
@override
_LiveCareTypeSelectState createState() => _LiveCareTypeSelectState();
}
class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
var languageID;
AppSharedPreferences sharedPref = AppSharedPreferences();
@override
void initState() {
getLanguageID();
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: InkWell(
onTap: () {
Navigator.pop(context, null);
},
child: Icon(
Icons.close,
color: Colors.white,
),
),
title: Text(TranslationBase.of(context).bookAppo,
style: TextStyle(color: Colors.white)),
),
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0),
child: Column(
children: <Widget>[
Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 15.0, bottom: 10.0),
child: Image.asset(
languageID == 'ar'
? "assets/images/new-design/liveCare_ar_bg.png"
: "assets/images/new-design/liveCare_en_bg.png",
width: 120),
),
Container(
alignment: Alignment.center,
child: Text("LiveCare Service",
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20.0))),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text(
"is to obtain medical advice with a specialist doctor Via a video call",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18.0))),
Container(
margin: EdgeInsets.only(top: 15.0),
alignment: Alignment.centerLeft,
child: Text("WHY LIVECARE?",
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20.0))),
Container(
margin: EdgeInsets.only(top: 20.0, left: 20.0),
child: Row(
children: <Widget>[
SvgPicture.asset("assets/images/new-design/check_icon.svg",
width: 25),
Container(
width: MediaQuery.of(context).size.width * 0.75,
margin: EdgeInsets.all(10.0),
child: Text(
"No need to wait, you will get Medical consultation immediately via Video call.",
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 14.0)),
)
],
),
),
Container(
margin: EdgeInsets.only(top: 5.0, left: 20.0),
child: Row(
children: <Widget>[
SvgPicture.asset("assets/images/new-design/check_icon.svg",
width: 25),
Container(
width: MediaQuery.of(context).size.width * 0.75,
margin: EdgeInsets.all(10.0),
child: Text("The doctor will see your medical file.",
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 14.0)),
)
],
),
),
Container(
margin: EdgeInsets.only(top: 5.0, left: 20.0),
child: Row(
children: <Widget>[
SvgPicture.asset("assets/images/new-design/check_icon.svg",
width: 25),
Container(
width: MediaQuery.of(context).size.width * 0.75,
margin: EdgeInsets.all(10.0),
child: Text("Free Prescription delivery service.",
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 14.0)),
)
],
),
),
Container(
margin: EdgeInsets.only(top: 20.0),
child: Text(
"** The service is included with some insurance companies according to the terms and conditions With our best wishes for health and wellness",
style: TextStyle(fontSize: 16.0))),
InkWell(
onTap: (){
Navigator.pop(context, "immediate");
},
child: Container(
decoration: BoxDecoration(
color: Colors.red[900],
borderRadius: BorderRadius.all(Radius.circular(10.0))),
height: 120.0,
margin: EdgeInsets.only(top: 20.0),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 20.0),
child: SvgPicture.asset(
"assets/images/new-design/liveCare_logo_icon_white.svg",
width: 80),
),
Container(
width: MediaQuery.of(context).size.width * 0.6,
margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0),
child: Column(
children: <Widget>[
Text("Get Medical consultation immediately",
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
color: Colors.white)),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.centerLeft,
child: Text("Instant video call",
style: TextStyle(
fontSize: 18.0, color: Colors.white)),
)
],
),
),
],
)),
),
InkWell(
onTap: (){
Navigator.pop(context, "schedule");
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[700],
borderRadius: BorderRadius.all(Radius.circular(10.0))),
height: 120.0,
margin: EdgeInsets.only(top: 20.0),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 20.0),
child: Image.asset(
"assets/images/new-design/calendar.png",
width: 70),
),
Container(
width: MediaQuery.of(context).size.width * 0.6,
margin: EdgeInsets.fromLTRB(30.0, 30.0, 0.0, 0.0),
child: Column(
children: <Widget>[
Container(
alignment: Alignment.centerLeft,
child: Text("Book Appointment",
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
color: Colors.white)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.centerLeft,
child: Text("Schedule Video Call",
style: TextStyle(
fontSize: 18.0, color: Colors.white)),
)
],
),
),
],
)),
),
],
),
),
),
);
}
getLanguageID() async {
var languageID = await sharedPref.getString(APP_LANGUAGE);
setState(() {
this.languageID = languageID;
});
}
}

@ -1,9 +1,14 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart';
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart';
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_scheduling/schedule_clinic_card.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_type_select.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareInfoDialog.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePaymentDialog.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart';
@ -30,8 +35,11 @@ class _clinic_listState extends State<ClinicList> {
int currentSelectedIndex = 0;
LiveCareClinicsListResponse liveCareClinicsListResponse;
LiveCareScheduleClinicsListResponse liveCareScheduleClinicsListResponse;
bool isDataLoaded = false;
var languageID;
var currentSelectedLiveCareType;
int selectedClinicID = 1;
String selectedClinicName = "-";
@ -46,11 +54,13 @@ class _clinic_listState extends State<ClinicList> {
@override
void initState() {
liveCareClinicsListResponse = new LiveCareClinicsListResponse();
liveCareScheduleClinicsListResponse =
new LiveCareScheduleClinicsListResponse();
WidgetsBinding.instance.addPostFrameCallback((_) {
// Future.delayed(new Duration(milliseconds: 1200), () {
getLiveCareClinicsList();
// });
openLiveCareSelectionDialog();
});
getLanguageID();
super.initState();
}
@ -58,77 +68,9 @@ class _clinic_listState extends State<ClinicList> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: <Widget>[
isDataLoaded
? Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.all(15.0),
child: Text("Online Clinics: ",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: liveCareClinicsListResponse
.patientERGetClinicsList.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
updateSelectedIndex(liveCareClinicsListResponse
.patientERGetClinicsList[index]);
},
child: ClinicCard(
isSelected: selectedClinicID ==
liveCareClinicsListResponse
.patientERGetClinicsList[index]
.serviceID
? true
: false,
patientERGetClinicsList:
liveCareClinicsListResponse
.patientERGetClinicsList[index],
languageID: languageID,
),
);
},
),
Container(
height: 10.0,
),
],
),
)
: Container(),
isDataLoaded ? Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: startLiveCare,
child: Text("Start", style: TextStyle(fontSize: 18.0)),
),
),
) : Container(),
],
),
);
child: currentSelectedLiveCareType == "immediate"
? getLiveCareImmediateClinicList()
: getLiveCareScheduleClinicList());
}
void startLiveCare() {
@ -388,10 +330,298 @@ class _clinic_listState extends State<ClinicList> {
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
getLiveCareScheduleClinicsList() {
isDataLoaded = false;
LiveCareService service = new LiveCareService();
service.getLiveCareScheduledClinics(context).then((res) {
print(res['ClinicsHaveScheduleList'].length);
if (res['MessageStatus'] == 1) {
setState(() {
liveCareScheduleClinicsListResponse =
LiveCareScheduleClinicsListResponse.fromJson(res);
print(liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList.length);
selectedClinicID = liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList[0].serviceID;
selectedClinicName = liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList[0].clinicDesc;
isDataLoaded = true;
});
} else {
isDataLoaded = true;
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
openLiveCareSelectionDialog() {
Navigator.of(context)
.push(new MaterialPageRoute<String>(
builder: (BuildContext context) {
return LiveCareTypeSelect();
},
fullscreenDialog: true))
.then((value) {
if (value == null) {
Navigator.pop(context);
} else {
print(value);
if (value == "immediate") {
setState(() {
currentSelectedLiveCareType = "immediate";
});
getLiveCareClinicsList();
}
if (value == "schedule") {
setState(() {
currentSelectedLiveCareType = "schedule";
});
getLiveCareScheduleClinicsList();
}
}
});
}
Widget getLiveCareScheduleClinicList() {
return Column(
children: <Widget>[
isDataLoaded
? Container(
height: MediaQuery.of(context).size.height * 0.7,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// Container(
// margin: EdgeInsets.all(15.0),
// child: Text("Online Clinics: ",
// style: TextStyle(
// fontSize: 20.0, fontWeight: FontWeight.bold)),
// ),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
updateSelectedScheduleIndex(
liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList[index]);
},
child: ScheduleClinicCard(
isSelected: selectedClinicID ==
liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList[index]
.serviceID
? true
: false,
clinicsHaveScheduleList:
liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList[index],
languageID: languageID,
),
);
},
),
Container(
height: 10.0,
),
],
),
)
: Container(),
isDataLoaded
? Align(
alignment: FractionalOffset.bottomCenter,
child: Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: startScheduleLiveCare,
child: Text("Start", style: TextStyle(fontSize: 18.0)),
),
),
),
)
: Container(),
],
);
}
Widget getLiveCareImmediateClinicList() {
return Column(
children: <Widget>[
isDataLoaded
? Container(
height: MediaQuery.of(context).size.height * 0.7,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.all(15.0),
child: Text("Online Clinics: ",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: liveCareClinicsListResponse
.patientERGetClinicsList.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
updateSelectedIndex(liveCareClinicsListResponse
.patientERGetClinicsList[index]);
},
child: ClinicCard(
isSelected: selectedClinicID ==
liveCareClinicsListResponse
.patientERGetClinicsList[index]
.serviceID
? true
: false,
patientERGetClinicsList: liveCareClinicsListResponse
.patientERGetClinicsList[index],
languageID: languageID,
),
);
},
),
Container(
height: 10.0,
),
],
),
)
: Container(),
isDataLoaded
? Align(
alignment: FractionalOffset.bottomCenter,
child: Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: startLiveCare,
child: Text("Start", style: TextStyle(fontSize: 18.0)),
),
),
),
)
: Container(),
],
);
}
void startScheduleLiveCare() {
List<DoctorList> doctorsList = [];
LiveCareService service = new LiveCareService();
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
List();
service
.getLiveCareScheduledDoctorList(context, selectedClinicID)
.then((res) {
print(res['DoctorByClinicIDList']);
print(res['DoctorByClinicIDList'].length);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorByClinicIDList'].length != 0) {
res['DoctorByClinicIDList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital =
_patientDoctorAppointmentListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[
_patientDoctorAppointmentListHospital
.indexOf(doctorByHospital[0])]
.patientDoctorAppointmentList
.add(element);
} else {
_patientDoctorAppointmentListHospital.add(
PatientDoctorAppointmentList(
filterName: element.projectName,
distanceInKMs:
element.projectDistanceInKiloMeters.toString(),
patientDoctorAppointment: element));
}
});
} else {}
});
this.sharedPref.setBool(IS_LIVECARE_APPOINTMENT, true);
navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital);
} else {}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Future navigateToSearchResults(
context,
List<DoctorList> docList,
List<PatientDoctorAppointmentList>
patientDoctorAppointmentListHospital) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SearchResults(
doctorsList: docList,
isLiveCareAppointment: true,
patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital)));
}
updateSelectedIndex(PatientERGetClinicsList patientERGetClinicsList) {
setState(() {
selectedClinicID = patientERGetClinicsList.serviceID;
selectedClinicName = patientERGetClinicsList.serviceName;
});
}
updateSelectedScheduleIndex(ClinicsHaveScheduleList patientERGetClinicsList) {
setState(() {
selectedClinicID = patientERGetClinicsList.serviceID;
selectedClinicName = patientERGetClinicsList.clinicDesc;
});
}
}

@ -205,6 +205,42 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getDoctorScheduledFreeSlots(
int docID, int clinicID, int projectID, int serviceID, BuildContext context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"DoctorID": docID,
"IsBookingForLiveCare": 1,
"ClinicID": clinicID,
"ProjectID": projectID,
"OriginalClinicID": clinicID,
"ServiceID": serviceID,
"days": 50,
"isReschadual": false,
"VersionID": req.VersionID,
"Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958",
"PatientOutSA": 0,
"SessionID": null,
"isDentalAllowedBackend": false,
"DeviceTypeID": 1
};
dynamic localRes;
await baseAppClient.post(GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> insertAppointment(int docID, int clinicID, int projectID,
String selectedTime, String selectedDate, BuildContext context) async {
Map<String, dynamic> request;
@ -258,6 +294,60 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID,
String selectedTime, String selectedDate, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"IsForLiveCare": true,
"ProjectID": projectID,
"ClinicID": clinicID,
"DoctorID": docID,
"ServiceID": serviceID,
"StartTime": selectedTime,
"SelectedTime": selectedTime,
"EndTime": selectedTime,
"InitialSlotDuration": 0,
"StrAppointmentDate": selectedDate,
"IsVirtual": false,
"DeviceType": Platform.isIOS ? 'iOS' : 'Android',
"BookedBy": 102,
"VisitType": 1,
"VisitFor": 1,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(INSERT_LIVECARE_SCHEDULE_APPOINTMENT,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientShare(
String appoID, int clinicID, int projectID, BuildContext context) async {
Map<String, dynamic> request;
@ -302,6 +392,51 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getLiveCareAppointmentPatientShare(
String appoID, int clinicID, int projectID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"ProjectID": projectID,
"ClinicID": clinicID,
"AppointmentNo": appoID,
"IsActiveAppointment": true,
"IsForLiveCare": true,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_SHARE_LIVECARE,
onSuccess: (response, statusCode) async {
localRes = response['OnlineCheckInAppointments'][0];
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientAppointmentHistory(
bool isActiveAppointment, BuildContext context) async {
Map<String, dynamic> request;

@ -53,6 +53,81 @@ class LiveCareService extends BaseService {
return Future.value(localRes);
}
Future<Map> getLiveCareScheduledClinics(BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": "YckwoXhUmWBsnHKEKig",
"Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0
};
dynamic localRes;
await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINICS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getLiveCareScheduledDoctorList(BuildContext context, int serviceID) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"ServiceID": serviceID,
"SessionID": "YckwoXhUmWBsnHKEKig",
"Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0
};
dynamic localRes;
await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getLivecareHistory(BuildContext context) async {
Map<String, dynamic> request;

@ -95,6 +95,8 @@ class TranslationBase {
String get confirm => localizedValues['confirm'][locale.languageCode];
String get confirmLiveCare => localizedValues['confirmLiveCare'][locale.languageCode];
String get confirmLater =>
localizedValues['confirmLater'][locale.languageCode];

Loading…
Cancel
Save