Appointment Details implementation continued

merge-requests/34/merge
haroon amjad 5 years ago
parent 0171664779
commit 06f95c5379

@ -1,29 +1,28 @@
import 'dart:io';
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'dart:io';
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 BASE_URL = 'https://uat.hmgweb.com/'; // UAT Environment
///Doctor
const GET_MY_DOCTOR = '/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = '/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_RATING = '/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions
const PRESCRIPTIONS = '/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS = '/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT = '/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL = '/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTIONS_ALL_ORDERS =
'/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT = '/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL = '/Notifications.svc/REST/SendPrescriptionEmail';
//const BASE_URL = 'https://hmgweb.com/'; // Production Environment
//const BASE_URL = 'https://uat.hmgweb.com/'; // UAT Environment
//const BASE_URL = 'https://hmgwebservices.com/Services'; // Production Environment
//const BASE_URL = 'https://uat.hmgwebservices.com/Services'; // UAT Environment
//URL to get clinic list
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";
//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
const GET_PATIENT_SHARE = "/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
const GET_PATIENT_SHARE =
"/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//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
const CONFIRM_APPOINTMENT = "/MobileNotifications.svc/REST/ConfirmAppointment";
@ -72,7 +74,6 @@ class AppGlobal {
request.generalid = 'Cs2020@2016\$2958';
request.VersionID = VERSION_ID; //5.3; //3.6;
request.Channel = CHANNEL; //3;
// request.LanguageID = await sharedPref.getString(APP_LANGUAGE);
request.IPAdress = IP_ADDRESS; //"10.20.10.20";
request.generalid = GENERAL_ID; //'Cs2020@2016\$2958';
request.PatientOutSA = 0;
@ -84,5 +85,3 @@ class AppGlobal {
return request;
}
}

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

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

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

@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class AppointmentActions extends StatefulWidget {
AppoitmentAllHistoryResultList appo;
@ -131,6 +132,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
case "confirmAppointment":
confirmAppointment();
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() {
loading(true);
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
void initState() {
print("initState!!!!!");
widget.service = new DoctorsListService();
getPatientAppointmentHistory();
super.initState();
@ -153,7 +154,10 @@ class _ToDoState extends State<ToDo> {
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: widget.appoList[index].actualDoctorRate.toDouble(),
initialRating: widget
.appoList[index]
.actualDoctorRate
.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
@ -406,12 +410,18 @@ class _ToDoState extends State<ToDo> {
Future navigateToAppointmentDetails(context, appo) async {
Navigator.push(
context, MaterialPageRoute(builder: (context) => AppointmentDetails(appo: appo)));
context,
MaterialPageRoute(
builder: (context) => AppointmentDetails(appo: appo)))
.then((value) {
getPatientAppointmentHistory();
});
}
getPatientAppointmentHistory() {
loading(true);
widget.service.getPatientAppointmentHistory(true).then((res) {
DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true).then((res) {
print(res['AppoimentAllHistoryResultList']);
if (res['MessageStatus'] == 1) {
setState(() {

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

Loading…
Cancel
Save