Merge branch 'diplomatic-quarter-live' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into diplomatic-quarter-haroon

dq_and_master
haroon amjad 4 years ago
commit 051bd1e23f

@ -117,6 +117,8 @@ const GET_BLOOD_REQUEST =
const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
const INSERT_REQUEST_FOR_MEDICAL_REPORT =
'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
const SEND_MEDICAL_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendMedicalReportEmail';
///Rate
const IS_LAST_APPOITMENT_RATED =

@ -1154,4 +1154,12 @@ const Map localizedValues = {
"en": "This service allows you to chat with customer service directly without the need to call.",
"ar": "المحادثة المباشرة: هذه الخدمة تمكنك التحدث كتابياً مع خدمة العملاء مباشرة دون الحاجة الى الاتصال هاتفياً."
},
"last-appointment": {
"en": "How was your appointment?",
"ar": "كيف كان موعدك الطبي ؟"
},
"rate-clinic": {
"en": "Please rate the clinic",
"ar": "يرجى تقييم العيادة"
},
};

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
@ -165,8 +166,10 @@ class BaseAppClient {
await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin =
false;
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context);
_vitalSignService.weightKg = "";
_vitalSignService.heightCm = "";
model.setState(0, false);
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
}

@ -21,7 +21,11 @@ class PatientSickLeaveService extends BaseService {
}
sendSickLeaveEmail(
{int requestNo, String projectName, String doctorName, int projectID,String setupID}) async {
{int requestNo,
String projectName,
String doctorName,
int projectID,
String setupID}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
@ -33,8 +37,8 @@ class PatientSickLeaveService extends BaseService {
body['PatientName'] = user.firstName + " " + user.firstName;
body['ProjectName'] = projectName;
body['DoctorName'] = doctorName;
body['ProjectID'] = 12;
body['SetupID'] = 12;
body['ProjectID'] = projectID;
body['SetupID'] = setupID;
await baseAppClient
.post(SendSickLeaveEmail, onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {

@ -9,11 +9,11 @@ class ReportsService extends BaseService {
List<AppointmentHistory> appointHistoryList = List();
String userAgreementContent = "";
RequestReports _requestReports = RequestReports(
isReport: true,
encounterType: 1,
requestType: 1,
patientOutSA: 0,
);
isReport: true,
encounterType: 1,
requestType: 1,
patientOutSA: 0,
);
Future getReports() async {
hasError = false;
@ -56,22 +56,18 @@ class ReportsService extends BaseService {
}, body: Map<String, dynamic>());
}
Future updatePatientHealthSummaryReport({bool isSummary}) async {
Map<String, dynamic> body = Map<String, dynamic>();
body['RSummaryReport'] = isSummary;
hasError = false;
await baseAppClient.post(UPDATE_HEALTH_TERMS,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future insertRequestForMedicalReport(
AppointmentHistory appointmentHistory) async {
Map<String, dynamic> body = new Map<String, dynamic>();
@ -96,4 +92,41 @@ class ReportsService extends BaseService {
super.error = error;
}, body: body);
}
Future sendEmailForMedicalReport(
String projectName,
String clinicName,
String doctorName,
String requestDate,
String invoiceNo,
int projectID,
String printID,
String procedureID,
String stamp,
String setupID) async {
Map<String, dynamic> body = new Map<String, dynamic>();
body['SetupID'] = setupID;
body['PrintDate'] = requestDate;
body['ProcedureID'] = "05005009";
body['Reporttype'] = "MEDICAL REPORT";
body['stamp'] = stamp;
body['To'] = user.emailAddress;
body['DateofBirth'] = user.dateofBirth;
body['PatientIditificationNum'] = user.patientIdentificationNo;
body['PatientMobileNumber'] = user.mobileNumber;
body['PatientName'] = user.firstName + " " + user.firstName;
body['ProjectName'] = projectName;
body['ClinicName'] = clinicName;
body['ProjectID'] = projectID;
body['InvoiceNo'] = invoiceNo;
body['PrintedByName'] = user.firstName + " " + user.firstName;
hasError = false;
await baseAppClient.post(SEND_MEDICAL_REPORT_EMAIL,
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -2,11 +2,15 @@ import 'package:flutter/cupertino.dart';
class ToDoCountProviderModel with ChangeNotifier {
int _count;
bool _isShowBadge = false;
int get count => _count == null ? 0 : _count;
void setState(int count) {
bool get isShowBadge => _isShowBadge;
void setState(int count, bool isShowBadge) {
_count = count;
_isShowBadge = isShowBadge;
notifyListeners();
}
}

@ -513,12 +513,12 @@ class _BookConfirmState extends State<BookConfirm> {
}
getToDoCount() {
toDoProvider.setState(0);
toDoProvider.setState(0, true);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber']);
toDoProvider.setState(res['AppointmentActiveNumber'], true);
} else {}
}).catchError((err) {
print(err);

@ -397,12 +397,12 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}
getToDoCount() {
toDoProvider.setState(0);
toDoProvider.setState(0, true);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber']);
toDoProvider.setState(res['AppointmentActiveNumber'], true);
} else {}
}).catchError((err) {
print(err);

@ -4,12 +4,14 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -22,6 +24,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/current_remaining_time.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
class ToDo extends StatefulWidget {
@ -47,8 +50,11 @@ class _ToDoState extends State<ToDo> {
List<ImagesInfo> imagesInfo = List();
ToDoCountProviderModel toDoProvider;
@override
void initState() {
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
widget.patientShareResponse = new PatientShareResponse();
WidgetsBinding.instance.addPostFrameCallback((_) {
if (authenticatedUserObject.isLogin) getPatientData();
@ -514,6 +520,19 @@ class _ToDoState extends State<ToDo> {
});
}
getToDoCount() {
toDoProvider.setState(0, true);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
} else {}
}).catchError((err) {
print(err);
});
}
getPatientAppointmentHistory() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
@ -529,11 +548,7 @@ class _ToDoState extends State<ToDo> {
});
} else {}
});
widget.appoList.forEach((element) {
print(element.isLiveCareAppointment);
print(element.nextAction);
print(element.remaniningHoursTocanPay);
});
getToDoCount();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}

@ -751,23 +751,6 @@ class _HomePageState extends State<HomePage> {
Navigator.push(context,
MaterialPageRoute(builder: (context) => CovidDrivethruLocation()));
}
getToDoCount() {
toDoProvider.setState(0);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
setState(() {
toDoProvider.setState(res['AppointmentActiveNumber']);
});
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
});
}
}
class DashboardItem extends StatelessWidget {

@ -4,12 +4,14 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -74,6 +76,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
locator<AppointmentRateViewModel>();
ProjectViewModel projectViewModel;
ToDoCountProviderModel toDoProvider;
@override
void initState() {
_getAvailableBiometrics();
@ -84,6 +88,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).confirm,
isShowAppBar: true,
@ -568,10 +573,24 @@ class _ConfirmLogin extends State<ConfirmLogin> {
});
}
getToDoCount() {
toDoProvider.setState(0, true);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
} else {}
}).catchError((err) {
print(err);
});
}
goToHome() {
authenticatedUserObject.isLogin = true;
appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true;
getToDoCount();
Navigator.of(context).pushNamed(HOME);
}

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
@ -11,6 +12,7 @@ import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -48,6 +50,7 @@ class _Login extends State<Login> {
locator<AuthenticatedUserObject>();
ProjectViewModel projectViewModel;
ToDoCountProviderModel toDoProvider;
@override
void initState() {
@ -64,6 +67,7 @@ class _Login extends State<Login> {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).login,
isShowAppBar: true,
@ -264,6 +268,7 @@ class _Login extends State<Login> {
}
else
{
getToDoCount(),
Navigator.pushAndRemoveUntil(
context,
FadePage(
@ -280,6 +285,19 @@ class _Login extends State<Login> {
});
}
getToDoCount() {
toDoProvider.setState(0, true);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
} else {}
}).catchError((err) {
print(err);
});
}
// showLoader(bool isTrue) {
// setState(() {
// isLoading = isTrue;

@ -1,4 +1,8 @@
import 'package:diplomaticquarterapp/core/model/reports/Reports.dart';
import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
@ -16,7 +20,8 @@ class ReportListWidget extends StatelessWidget {
itemBuilder: (context, index) => Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
width: double.infinity,margin: EdgeInsets.only(left: 8,right: 8,top: 3),
width: double.infinity,
margin: EdgeInsets.only(left: 8, right: 8, top: 3),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 2),
@ -40,15 +45,33 @@ class ReportListWidget extends StatelessWidget {
flex: 4,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(height: 12,),
Texts(reportList[index].projectName),
Texts(reportList[index].clinicDescription),
Texts('invoice No: ${reportList[index].invoiceNo}'),
SizedBox(height: 12,),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
reportList[index].status == 2
? Container(
child: InkWell(
onTap: sendReportEmail(),
child: Icon(
Icons.email,
color: Colors.red,
),
),
)
: Container(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 12,
),
Texts(reportList[index].projectName),
Texts(reportList[index].clinicDescription),
Texts(TranslationBase.of(context).invoiceNo +
': ${reportList[index].invoiceNo}'),
SizedBox(height: 12),
],
),
],
),
),
@ -61,4 +84,23 @@ class ReportListWidget extends StatelessWidget {
),
);
}
sendReportEmail(Reports report) {
ReportsService _reportsService = locator<ReportsService>();
_reportsService
.sendEmailForMedicalReport(
report.projectName,
report.clinicDescription,
report.doctorName,
DateUtil.convertDateToString(report.requestDate),
report.invoiceNo.toString(),
report.projectID,
report.printID,
procedureID,
stamp,
setupID)
.then((value) {})
.catchError(() {});
}
}

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -72,7 +73,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
height: 25,
),
Texts(
'How would you rate your last visit to the Clinic',
TranslationBase.of(context).lastAppointment,
bold: true,
color: Colors.black,
),
@ -122,7 +123,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
),
Center(
child: Texts(
'Please rate the Clinic',
TranslationBase.of(context).rateClinic,
textAlign: TextAlign.center,
)),
SizedBox(
@ -206,7 +207,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
message: 'please rate the clinic');
}
},
label: "Rate",
label: TranslationBase.of(context).submit,
disabled: model.state == ViewState.BusyLocal,
loading: model.state == ViewState.BusyLocal,
textColor: Theme.of(context).backgroundColor),
@ -224,7 +225,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
);
},
child: Texts(
'Later',
TranslationBase.of(context).later,
decoration: TextDecoration.underline,
color: HexColor('#151DFE'),
fontSize: 18,

@ -1015,6 +1015,11 @@ class TranslationBase {
String get lastVisit => localizedValues['last-visit'][locale.languageCode];
String get tapTitle => localizedValues['tap-title'][locale.languageCode];
String get later => localizedValues['later'][locale.languageCode];
String get lastAppointment => localizedValues['last-appointment'][locale.languageCode];
String get rateClinic => localizedValues['rate-clinic'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -69,7 +69,7 @@ class BottomNavigationItem extends StatelessWidget {
),
],
)
: authenticatedUserObject.isLogin
: (authenticatedUserObject.isLogin && model.isShowBadge)
? Stack(
alignment: AlignmentDirectional.center,
children: [

@ -142,7 +142,7 @@ class DoctorCard extends StatelessWidget {
Icons.email,
color: Colors.red,
),
)
),
],
),
),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
@ -44,8 +45,11 @@ class _AppDrawerState extends State<AppDrawer> {
locator<AuthenticatedUserObject>();
VitalSignService _vitalSignService = locator<VitalSignService>();
ToDoCountProviderModel toDoProvider;
@override
Widget build(BuildContext context) {
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
projectProvider = Provider.of(context);
return SizedBox(
width: MediaQuery.of(context).size.width * 0.75,
@ -458,9 +462,12 @@ class _AppDrawerState extends State<AppDrawer> {
_vitalSignService.weightKg = "";
await sharedPref.clear();
this.user = null;
toDoProvider.setState(0, false);
Navigator.of(context).pushNamed(HOME);
}
login() async {
var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);

Loading…
Cancel
Save