Sick leave CR, LiveCare support call, Appo calendar changes

sultan_v3.3
haroon amjad 3 years ago
parent c289afb186
commit 25af2c23ef

@ -102,6 +102,9 @@ var COVID_PASSPORT_UPDATE =
var GET_PATIENT_PASSPORT_NUMBER =
'Services/Patients.svc/REST/Covid19_Certificate_GetPassport';
var UPDATE_WORKPLACE_NAME =
'Services/Patients.svc/REST/ActivateSickLeave_FromVida';
///
var GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
var GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT =
@ -450,6 +453,8 @@ var GET_VACCINATION_ONHAND = "/Services/ERP.svc/REST/GET_VACCINATION_ONHAND";
var GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave';
var GET_PATIENT_SICK_LEAVE_STATUS = 'Services/Patients.svc/REST/GetPatientSickLeave_Status';
var SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail';
var GET_PATIENT_AdVANCE_BALANCE_AMOUNT =

@ -1862,4 +1862,8 @@ const Map localizedValues = {
"insuranceClassName": { "en": "Insurance Class", "ar": "فئة التأمين" },
"insuranceRequestSubmit": { "en": "Your insurance update request has been submitted successfully.", "ar": "تم تقديم طلب تحديث التأمين الخاص بك بنجاح." },
"NFCNotSupported": { "en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول" },
"enter-workplace-name": {"en": "Please enter your workplace name:", "ar": "رجاء إدخال مكان العمل:"},
"workplaceName": {"en": "Workplace name:", "ar": "مكان العمل:"},
"callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم لايف كير"},
"needApproval": {"en": "Your sick leave needs approval, please contact a medical report department.", "ar": "جازتك المرضيه تحتاج الى الموافقة, يرجى التواصل مع قسم التقارير الطبية.:"},
};

@ -33,6 +33,7 @@ class SickLeave {
String qR;
List<String> speciality;
bool isLiveCareAppointment;
int status;
SickLeave(
{this.setupID,
@ -65,7 +66,7 @@ class SickLeave {
this.patientName,
this.projectName,
this.qR,
this.speciality,this.isLiveCareAppointment});
this.speciality,this.isLiveCareAppointment, this.status});
SickLeave.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
@ -98,6 +99,7 @@ class SickLeave {
patientName = json['PatientName'];
projectName = json['ProjectName'];
qR = json['QR'];
status = json['Status'];
isLiveCareAppointment = json['IsLiveCareAppointment'];
if(json['Speciality']!=null)
speciality = json['Speciality'].cast<String>();
@ -135,6 +137,7 @@ class SickLeave {
data['PatientName'] = this.patientName;
data['ProjectName'] = this.projectName;
data['QR'] = this.qR;
data['Status'] = this.status;
data['Speciality'] = this.speciality;
return data;
}

@ -5,16 +5,16 @@ class VaccineModel {
int invoiceNo;
String procedureID;
String vaccineName;
Null vaccineNameN;
dynamic vaccineNameN;
String invoiceDate;
int doctorID;
int clinicID;
String firstName;
String middleName;
String lastName;
Null firstNameN;
Null middleNameN;
Null lastNameN;
dynamic firstNameN;
dynamic middleNameN;
dynamic lastNameN;
String dateofBirth;
int actualDoctorRate;
String age;
@ -106,7 +106,7 @@ class VaccineModel {
patientName = json['PatientName'];
projectName = json['ProjectName'];
qR = json['QR'];
speciality = json['Speciality'].cast<String>();
speciality = json['Speciality'] != null ? json['Speciality'].cast<String>() : [];
vaccinationDate = json['VaccinationDate'];
}

@ -149,7 +149,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021";
// body['PatientID'] = 3126070; //3844083
// body['PatientID'] = 870215; //3844083
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574

@ -8,7 +8,7 @@ class PatientSickLeaveService extends BaseService {
getSickLeave() async {
hasError = false;
super.error = "";
await baseAppClient.post(GET_PATIENT_SICK_LEAVE,
await baseAppClient.post(GET_PATIENT_SICK_LEAVE_STATUS,
onSuccess: (response, statusCode) async {
sickLeaveList.clear();
response['List_SickLeave'].forEach((sickLeave) {

@ -115,6 +115,26 @@ class LabsService extends BaseService {
return Future.value(localRes);
}
Future updateWorkplaceName(String workplaceName, int requestNumber, String setupID) async {
hasError = false;
Map<String, dynamic> body = Map();
body['Placeofwork'] = workplaceName;
body['Placeofworkar'] = workplaceName;
body['Req_ID'] = requestNumber;
body['TargetSetupID'] = setupID;
dynamic localRes;
await baseAppClient.post(UPDATE_WORKPLACE_NAME, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
return Future.value(localRes);
}
Future getCovidPassportNumber() async {
hasError = false;
Map<String, dynamic> body = Map();

@ -174,7 +174,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
headerStyle: CalendarHeaderStyle(textAlign: TextAlign.center, textStyle: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
viewHeaderStyle: ViewHeaderStyle(dayTextStyle: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.black)),
view: CalendarView.month,
todayHighlightColor: CustomColors.green,
todayHighlightColor: Colors.transparent,
todayTextStyle: TextStyle(color: Colors.black),
selectionDecoration: containerColorRadiusBorderWidthCircular(Colors.transparent, 4, CustomColors.green, 2.5),
cellBorderColor: Colors.white,
dataSource: MeetingDataSource(_getDataSource()),

@ -8,9 +8,11 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class LiveCarePendingRequest extends StatefulWidget {
ErRequestHistoryList pendingERRequestHistoryList;
@ -94,11 +96,13 @@ class _LiveCarePendingRequestState extends State<LiveCarePendingRequest> {
child: Text(TranslationBase.of(context).yourTurn + " " + widget.pendingERRequestHistoryList.patCount.toString() + " " + TranslationBase.of(context).patients,
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48)),
),
// Container(
// child: DefaultButton(TranslationBase.of(context).cancel, () {
// cancelLiveCareRequest();
// }),
// ),
mHeight(12.0),
Container(
child: DefaultButton(TranslationBase.of(context).callLiveCareSupport, () {
launchUrl(Uri.parse("tel://" + "011 525 9553"));
// cancelLiveCareRequest();
}),
),
],
),
),
@ -216,6 +220,10 @@ class _LiveCarePendingRequestState extends State<LiveCarePendingRequest> {
);
}
callLiveCareSupport() {
}
cancelLiveCareRequest() {
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);

@ -33,7 +33,6 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
return AppScaffold(
appBarTitle: TranslationBase.of(context).passportNumber,
isShowAppBar: true,
isBottomBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,

@ -2,10 +2,13 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/sickleave_workplace_update_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -64,6 +67,29 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
}
void showConfirmMessage(PatientSickLeaveViewMode model, int index) {
// if (model.sickLeaveList[index].status == 1) {
// openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index);
// } else if (model.sickLeaveList[index].status == 2) {
showEmailDialog(model, index);
// } else {
// showApprovalDialog();
// }
}
void showApprovalDialog() {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).needApproval,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () {
Navigator.of(context).pop();
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
void showEmailDialog(PatientSickLeaveViewMode model, int index) {
showDialog(
context: context,
builder: (cxt) => ConfirmSendEmailDialog(
@ -80,4 +106,13 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
),
);
}
void openWorkPlaceUpdatePage(int requestNumber, String setupID, PatientSickLeaveViewMode model, int index) {
Navigator.push(context, FadePage(page: WorkplaceUpdatePage(requestNumber: requestNumber, setupID: setupID))).then((value) {
print(value);
if (value != null && value == true) {
showEmailDialog(model, index);
}
});
}
}

@ -0,0 +1,232 @@
import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class WorkplaceUpdatePage extends StatefulWidget {
final int requestNumber;
final String setupID;
WorkplaceUpdatePage({@required this.requestNumber, @required this.setupID});
@override
_WorkplaceUpdatePageState createState() => _WorkplaceUpdatePageState();
}
class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
TextEditingController workplaceName = new TextEditingController();
bool _isButtonDisabled;
ProjectViewModel projectViewModel;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).sickLeaves,
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Container(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
mHeight(12),
SvgPicture.asset("assets/images/new/workplace-icon.svg", width: 40.0, fit: BoxFit.fill),
mHeight(12),
Text(
TranslationBase.of(context).enterWorkplaceName,
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
color: Colors.black,
letterSpacing: -0.64,
),
),
mHeight(8),
inputWidget(TranslationBase.of(context).workplaceName, "", workplaceName),
],
),
),
),
),
Card(
margin: EdgeInsets.zero,
elevation: 0,
child: Container(
padding: EdgeInsets.all(12),
child: FractionallySizedBox(
widthFactor: 1,
child: MaterialButton(
height: 50,
elevation: 0,
color: CustomColors.accentColor,
disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Text(
TranslationBase.of(context).submit,
style: TextStyle(
fontSize: 16.0,
letterSpacing: -0.64,
color: Colors.white,
),
),
onPressed: () {
if (_isButtonDisabled == false)
updateWorkplaceNameDialog();
else
AppToast.showErrorToast(message: TranslationBase.of(context).enterWorkplaceName);
},
),
),
),
),
],
),
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.name,
controller: _controller,
onChanged: (value) => {_onPassportTextChanged(value)},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
prefixIconConstraints: BoxConstraints(minWidth: 50),
prefixIcon: prefix == null
? null
: Text(
"+" + prefix,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
),
);
}
_onPassportTextChanged(content) {
if (content.length >= 1) {
setState(() {
_isButtonDisabled = false;
});
} else {
setState(() {
_isButtonDisabled = true;
});
}
}
updateWorkplaceNameDialog() {
var messageEn = "The workplace name you entered is: " + workplaceName.text + ". Please confirm!";
var messageAr = "اسم مكان العمل الذي أدخلته هو: " + workplaceName.text + ". يرجى تأكيد!";
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: projectViewModel.isArabic ? messageAr : messageEn,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () {
Navigator.of(context).pop();
updateWorkplaceName();
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
void updateWorkplaceName() {
LabsService service = new LabsService();
GifLoaderDialogUtils.showMyDialog(context);
service.updateWorkplaceName(workplaceName.text, widget.requestNumber, widget.setupID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop(true);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -37,8 +37,7 @@ class _MyVaccinesState extends State<MyVaccines> {
imagesInfo: [
ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vacceines/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vacceines/ar/0.png'),
],
body: Container(
margin: EdgeInsets.only(top: 20.0),
body: SingleChildScrollView(
child: Column(
children: <Widget>[
AppExpandableNotifier(
@ -46,6 +45,7 @@ class _MyVaccinesState extends State<MyVaccines> {
title: model.state == ViewState.Idle ? DateUtil.convertStringToDate(model.vaccineList[0].vaccinationDate).year.toString() : "",
bodyWidget: Container(
child: ListView.separated(
physics: ScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.vaccineList == null ? 0 : model.vaccineList.length,
@ -69,6 +69,7 @@ class _MyVaccinesState extends State<MyVaccines> {
),
),
),
SizedBox(height: 40.0,)
// SpaceBetweenTexts(space: 165.0),
],
),

@ -2870,6 +2870,10 @@ class TranslationBase {
String get paymentOnly => localizedValues["paymentOnly"][locale.languageCode];
String get pendingOnly => localizedValues["pendingOnly"][locale.languageCode];
String get insuranceRequestSubmit => localizedValues["insuranceRequestSubmit"][locale.languageCode];
String get enterWorkplaceName => localizedValues["enter-workplace-name"][locale.languageCode];
String get workplaceName => localizedValues["workplaceName"][locale.languageCode];
String get needApproval => localizedValues["needApproval"][locale.languageCode];
String get callLiveCareSupport => localizedValues["callLiveCareSupport"][locale.languageCode];
}

@ -41,10 +41,6 @@ class MyInAppBrowser extends InAppBrowser {
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';
@ -300,9 +296,9 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('LATITUDE_VALUE', this.lat.toString());
form = form.replaceFirst('LONGITUDE_VALUE', this.long.toString());
if (servID == "4")
form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.PREAUTH_SERVICE_URL);
else
// if (servID == "4")
// form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.PREAUTH_SERVICE_URL);
// else
form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.SERVICE_URL);
if (servID != null) {

Loading…
Cancel
Save