Appointment Details implementation continued

merge-update-with-lab-changes
haroon amjad 6 years ago
parent 0171664779
commit 06f95c5379

@ -1,29 +1,28 @@
import 'dart:io';
import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'dart:io';
const MAX_SMALL_SCREEN = 660; const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://hmgweb.com/'; const BASE_URL = 'https://hmgwebservices.com/Services';
const GET_PROJECT = '/Lists.svc/REST/GetProject'; const GET_PROJECT = '/Lists.svc/REST/GetProject';
//const BASE_URL = 'https://uat.hmgweb.com/'; // UAT Environment
///Doctor ///Doctor
const GET_MY_DOCTOR = '/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_MY_DOCTOR = '/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = '/Doctors.svc/REST/GetDocProfiles'; const GET_DOCTOR_PROFILE = '/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_RATING = '/Doctors.svc/REST/dr_GetAvgDoctorRating'; const GET_DOCTOR_RATING = '/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions ///Prescriptions
const PRESCRIPTIONS = '/Patients.svc/REST/GetPrescriptionApptList'; const PRESCRIPTIONS = '/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS = '/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const GET_PRESCRIPTIONS_ALL_ORDERS =
'/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT = '/Patients.svc/REST/INP_GetPrescriptionReport'; const GET_PRESCRIPTION_REPORT = '/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL = '/Notifications.svc/REST/SendPrescriptionEmail'; const SEND_PRESCRIPTION_EMAIL = '/Notifications.svc/REST/SendPrescriptionEmail';
//const BASE_URL = 'https://hmgweb.com/'; // Production Environment //const BASE_URL = 'https://hmgwebservices.com/Services'; // Production Environment
//const BASE_URL = 'https://uat.hmgweb.com/'; // UAT Environment //const BASE_URL = 'https://uat.hmgwebservices.com/Services'; // UAT Environment
//URL to get clinic list //URL to get clinic list
const GET_CLINICS_LIST_URL = "/lists.svc/REST/GetClinicCentralized"; const GET_CLINICS_LIST_URL = "/lists.svc/REST/GetClinicCentralized";
@ -35,13 +34,16 @@ const GET_DOCTORS_LIST_URL = "/Doctors.svc/REST/SearchDoctorsByTime";
const GET_DOCTOR_FREE_SLOTS = "/Doctors.svc/REST/GetDoctorFreeSlots"; const GET_DOCTOR_FREE_SLOTS = "/Doctors.svc/REST/GetDoctorFreeSlots";
//URL to insert appointment //URL to insert appointment
const INSERT_SPECIFIC_APPOINTMENT = "/Doctors.svc/REST/InsertSpecificAppointment"; const INSERT_SPECIFIC_APPOINTMENT =
"/Doctors.svc/REST/InsertSpecificAppointment";
//URL to get patient share //URL to get patient share
const GET_PATIENT_SHARE = "/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; const GET_PATIENT_SHARE =
"/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history //URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY = "/Doctors.svc/REST/PateintHasAppoimentHistory"; const GET_PATIENT_APPOINTMENT_HISTORY =
"/Doctors.svc/REST/PateintHasAppoimentHistory";
//URL to confirm appointment //URL to confirm appointment
const CONFIRM_APPOINTMENT = "/MobileNotifications.svc/REST/ConfirmAppointment"; const CONFIRM_APPOINTMENT = "/MobileNotifications.svc/REST/ConfirmAppointment";
@ -72,7 +74,6 @@ class AppGlobal {
request.generalid = 'Cs2020@2016\$2958'; request.generalid = 'Cs2020@2016\$2958';
request.VersionID = VERSION_ID; //5.3; //3.6; request.VersionID = VERSION_ID; //5.3; //3.6;
request.Channel = CHANNEL; //3; request.Channel = CHANNEL; //3;
// request.LanguageID = await sharedPref.getString(APP_LANGUAGE);
request.IPAdress = IP_ADDRESS; //"10.20.10.20"; request.IPAdress = IP_ADDRESS; //"10.20.10.20";
request.generalid = GENERAL_ID; //'Cs2020@2016\$2958'; request.generalid = GENERAL_ID; //'Cs2020@2016\$2958';
request.PatientOutSA = 0; request.PatientOutSA = 0;
@ -84,5 +85,3 @@ class AppGlobal {
return request; return request;
} }
} }

@ -46,16 +46,20 @@ class BaseAppClient {
} }
// await helpers.logout(); // await helpers.logout();
//helpers.showErrorToast('Your session expired Please login agian'); //helpers.showErrorToast('Your session expired Please login agian');
var asd =""; var asd = "";
// TODO create logout fun // TODO create logout fun
} else if (parsed['MessageStatus'] == 1 || } else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) { parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else {
if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode);
} else { } else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode); statusCode);
} }
} }
}
} else { } else {
onFailure('Please Check The Internet Connection', -1); onFailure('Please Check The Internet Connection', -1);
} }

@ -371,6 +371,7 @@ class _BookConfirmState extends State<BookConfirm> {
} }
insertAppointment(context, DoctorList docObject) { insertAppointment(context, DoctorList docObject) {
AppoitmentAllHistoryResultList appo;
widget.service widget.service
.insertAppointment(docObject.doctorID, docObject.clinicID, .insertAppointment(docObject.doctorID, docObject.clinicID,
docObject.projectID, widget.selectedTime, widget.selectedDate) docObject.projectID, widget.selectedTime, widget.selectedDate)
@ -381,17 +382,29 @@ class _BookConfirmState extends State<BookConfirm> {
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, getPatientShare(context, res['AppointmentNo'], docObject.clinicID,
docObject.projectID, docObject); docObject.projectID, docObject);
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); appo = new AppoitmentAllHistoryResultList();
} appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
}).catchError((err) { 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 = false;
appo.originalClinicID = 0;
appo.originalProjectID = 0;
appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate'];
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: err, confirmMessage: res['ErrorEndUserMessage'],
okText: TranslationBase.of(context).confirm, okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {cancelAppointment(docObject, err)}, okFunction: () => {cancelAppointment(docObject, appo)},
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
}
}).catchError((err) {
print(err);
}); });
} }

@ -8,7 +8,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'Components/AppointmentActions.dart'; import 'widgets/AppointmentActions.dart';
class AppointmentDetails extends StatefulWidget { class AppointmentDetails extends StatefulWidget {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;

@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class AppointmentActions extends StatefulWidget { class AppointmentActions extends StatefulWidget {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
@ -131,6 +132,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
case "confirmAppointment": case "confirmAppointment":
confirmAppointment(); confirmAppointment();
break; break;
case "navigateToProject":
openMap(double.parse(widget.appo.latitude),
double.parse(widget.appo.longitude));
break;
} }
} }
@ -305,6 +311,20 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}); });
} }
static Future<void> openMap(double latitude, double longitude) async {
String googleUrl =
'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude';
if (await canLaunch(googleUrl)) {
await launch(googleUrl);
} else {
throw 'Could not open the map.';
}
}
showReminderDialog() {
}
confirmAppointment() { confirmAppointment() {
loading(true); loading(true);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();

@ -0,0 +1,8 @@
import 'package:flutter/material.dart';
class ReminderDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container();
}
}

@ -27,6 +27,7 @@ class _ToDoState extends State<ToDo> {
@override @override
void initState() { void initState() {
print("initState!!!!!");
widget.service = new DoctorsListService(); widget.service = new DoctorsListService();
getPatientAppointmentHistory(); getPatientAppointmentHistory();
super.initState(); super.initState();
@ -153,7 +154,10 @@ class _ToDoState extends State<ToDo> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
RatingBar.readOnly( RatingBar.readOnly(
initialRating: widget.appoList[index].actualDoctorRate.toDouble(), initialRating: widget
.appoList[index]
.actualDoctorRate
.toDouble(),
size: 20.0, size: 20.0,
filledColor: Colors.yellow[700], filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500], emptyColor: Colors.grey[500],
@ -406,12 +410,18 @@ class _ToDoState extends State<ToDo> {
Future navigateToAppointmentDetails(context, appo) async { Future navigateToAppointmentDetails(context, appo) async {
Navigator.push( Navigator.push(
context, MaterialPageRoute(builder: (context) => AppointmentDetails(appo: appo))); context,
MaterialPageRoute(
builder: (context) => AppointmentDetails(appo: appo)))
.then((value) {
getPatientAppointmentHistory();
});
} }
getPatientAppointmentHistory() { getPatientAppointmentHistory() {
loading(true); loading(true);
widget.service.getPatientAppointmentHistory(true).then((res) { DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true).then((res) {
print(res['AppoimentAllHistoryResultList']); print(res['AppoimentAllHistoryResultList']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
@ -69,7 +70,7 @@ class _LandingPageState extends State<LandingPage> {
body: PageView( body: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: pageController, controller: pageController,
children: [Container(), MedicalProfilePage(), MyAdmissionsPage(), ToDo()], children: [Container(), MedicalProfilePage(), MyAdmissionsPage(), ToDo(), BookingOptions()],
), ),
bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab),
); );

Loading…
Cancel
Save