updates & fixes

merge-requests/34/merge
haroon amjad 5 years ago
parent c50530734d
commit 750746aabe

@ -17,6 +17,7 @@
<application
android:name="io.flutter.app.FlutterApplication"
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true"
android:label="diplomaticquarterapp">
<activity
android:name=".MainActivity"
@ -60,9 +61,6 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<<<<<<< HEAD
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
=======
>>>>>>> edd850490ef9ccdee72c9e8d3318f88be0677dce
</manifest>

@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://hmgwebservices.com/Services';
const BASE_URL = 'https://uat.hmgwebservices.com/Services';
const GET_PROJECT = '/Lists.svc/REST/GetProject';
@ -88,6 +88,8 @@ const CREATE_ADVANCE_PAYMENT = "/Doctors.svc/REST/CreateAdvancePayment";
const ADD_ADVANCE_NUMBER_REQUEST = '/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
const IS_ALLOW_ASK_DOCTOR = '/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_CALL_REQUEST_TYPE = '/Doctors.svc/REST/GetCallRequestType_LOV';
const SEND_CALL_REQUEST = '/Doctors.svc/REST/InsertCallInfo';
//URL to get medicine and pharmacies list
const CHANNEL = 3;

@ -233,5 +233,6 @@ const Map<String, Map<String, String>> localizedValues = {
"patientCard": {"en": "Patient Card ID: ", "ar": "رقم الاشتراك"},
"policyNumber": {"en": "Policy Number: ", "ar": "رقم بوليصة التاميت:"},
"seeDetails": {"en": "SEE DETAILS", "ar": "منافعك التامينية"},
"insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"}
"insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"},
"requestType": {"en": "Request Type", "ar": "نوع الاستفسار"}
};

@ -88,7 +88,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0),
alignment: Alignment.center,
child: Text(
widget.appo.doctorTitle +

@ -13,7 +13,7 @@ class ArrivedButtons {
"title": "Medicines",
"subtitle": "Prescriptions",
"icon": "assets/images/new-design/medicine_prescriptions_icon.png",
"caller": "onCancelAppointment"
"caller": "prescriptions"
},
{
"title": "Radiology",
@ -55,7 +55,7 @@ class ArrivedButtons {
"title": "Survey",
"subtitle": "Service",
"icon": "assets/images/new-design/survey.png",
"caller": "goToTodoList"
"caller": "Survey"
}
];
}

@ -13,13 +13,13 @@ class ArrivedButtons {
"title": "Medicines",
"subtitle": "Prescriptions",
"icon": "assets/images/new-design/medicine_prescriptions_icon.png",
"caller": "onCancelAppointment"
"caller": "prescriptions"
},
{
"title": "Radiology",
"subtitle": "Services",
"icon": "assets/images/new-design/radiology_service_icon.png",
"caller": "insertComplaint"
"caller": "radiology"
},
{
"title": "Lab",
@ -55,7 +55,7 @@ class ArrivedButtons {
"title": "Survey",
"subtitle": "Service",
"icon": "assets/images/new-design/survey.png",
"caller": "goToTodoList"
"caller": "Survey"
}
];
}

@ -0,0 +1,92 @@
class AskDocRequestType {
String setupID;
int parameterGroup;
int parameterType;
int parameterCode;
String description;
String descriptionN;
String alias;
String aliasN;
String prefix;
String suffix;
String isColorCodingRequired;
String backColor;
String foreColor;
bool isBuiltIn;
bool isActive;
int createdBy;
String createdOn;
String editedBy;
String editedOn;
String rowVer;
AskDocRequestType(
{this.setupID,
this.parameterGroup,
this.parameterType,
this.parameterCode,
this.description,
this.descriptionN,
this.alias,
this.aliasN,
this.prefix,
this.suffix,
this.isColorCodingRequired,
this.backColor,
this.foreColor,
this.isBuiltIn,
this.isActive,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn,
this.rowVer});
AskDocRequestType.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
parameterGroup = json['ParameterGroup'];
parameterType = json['ParameterType'];
parameterCode = json['ParameterCode'];
description = json['Description'];
descriptionN = json['DescriptionN'];
alias = json['Alias'];
aliasN = json['AliasN'];
prefix = json['Prefix'];
suffix = json['Suffix'];
isColorCodingRequired = json['IsColorCodingRequired'];
backColor = json['BackColor'];
foreColor = json['ForeColor'];
isBuiltIn = json['IsBuiltIn'];
isActive = json['IsActive'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedOn = json['EditedOn'];
rowVer = json['RowVer'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ParameterGroup'] = this.parameterGroup;
data['ParameterType'] = this.parameterType;
data['ParameterCode'] = this.parameterCode;
data['Description'] = this.description;
data['DescriptionN'] = this.descriptionN;
data['Alias'] = this.alias;
data['AliasN'] = this.aliasN;
data['Prefix'] = this.prefix;
data['Suffix'] = this.suffix;
data['IsColorCodingRequired'] = this.isColorCodingRequired;
data['BackColor'] = this.backColor;
data['ForeColor'] = this.foreColor;
data['IsBuiltIn'] = this.isBuiltIn;
data['IsActive'] = this.isActive;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedOn'] = this.editedOn;
data['RowVer'] = this.rowVer;
return data;
}
}

@ -1,18 +1,25 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/PrescriptionReport.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
@ -20,10 +27,12 @@ class AppointmentActions extends StatefulWidget {
AppoitmentAllHistoryResultList appo;
TabController tabController;
final Function enableFooterButton;
MyInAppBrowser browser;
AppointmentActions({@required this.appo,
@required this.tabController,
@required this.enableFooterButton});
AppointmentActions(
{@required this.appo,
@required this.tabController,
@required this.enableFooterButton});
@override
_AppointmentActionsState createState() => _AppointmentActionsState();
@ -40,9 +49,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
@override
Widget build(BuildContext context) {
var size = MediaQuery
.of(context)
.size;
var size = MediaQuery.of(context).size;
final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2;
final double itemWidth = size.width / 2;
@ -58,58 +65,57 @@ class _AppointmentActionsState extends State<AppointmentActions> {
crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight),
children: appoButtonsList
.map((e) =>
GestureDetector(
onTap: () {
_handleButtonClicks(e);
},
child: Container(
height: 100.0,
margin: EdgeInsets.all(9.0),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey[400],
blurRadius: 2.0,
spreadRadius: 0.0)
],
borderRadius: BorderRadius.circular(10),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
margin:
EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: Text(e.title,
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xFFc5272d),
letterSpacing: 1.0,
fontSize: 20.0)),
.map((e) => GestureDetector(
onTap: () {
_handleButtonClicks(e);
},
child: Container(
height: 100.0,
margin: EdgeInsets.all(9.0),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey[400],
blurRadius: 2.0,
spreadRadius: 0.0)
],
borderRadius: BorderRadius.circular(10),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
margin:
EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: Text(e.title,
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xFFc5272d),
letterSpacing: 1.0,
fontSize: 20.0)),
),
Container(
margin:
EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
child: Text(e.subtitle,
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.black,
letterSpacing: 1.0,
fontSize: 15.0)),
),
Container(
alignment: Alignment.bottomRight,
margin:
EdgeInsets.fromLTRB(0.0, 10.0, 10.0, 7.0),
child: Image.asset(e.icon,
width: 45.0, height: 45.0),
),
],
),
Container(
margin:
EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
child: Text(e.subtitle,
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.black,
letterSpacing: 1.0,
fontSize: 15.0)),
),
Container(
alignment: Alignment.bottomRight,
margin:
EdgeInsets.fromLTRB(0.0, 10.0, 10.0, 7.0),
child: Image.asset(e.icon,
width: 45.0, height: 45.0),
),
],
),
),
))
),
))
.toList(),
),
),
@ -133,15 +139,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
case "onCancelAppointment":
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase
.of(context)
.cancelAppoMsg,
okText: TranslationBase
.of(context)
.confirm,
cancelText: TranslationBase
.of(context)
.cancel_nocaps,
confirmMessage: TranslationBase.of(context).cancelAppoMsg,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {cancelAppointment()},
cancelFunction: () => {});
dialog.showAlertDialog(context);
@ -171,6 +171,14 @@ class _AppointmentActionsState extends State<AppointmentActions> {
case "radiology":
openAppointmentRadiology();
break;
case "prescriptions":
openPrescriptionReport();
break;
case "Survey":
rateAppointment();
break;
}
}
@ -345,18 +353,57 @@ class _AppointmentActionsState extends State<AppointmentActions> {
openAppointmentRadiology() {
DoctorsListService service = new DoctorsListService();
FinalRadiology finalRadiology = new FinalRadiology();
service.getPatientRadOrders(widget.appo.appointmentNo.toString(), context)
service
.getPatientRadOrders(widget.appo.appointmentNo.toString(), context)
.then((res) {
if (res['MessageStatus'] == 1) {
print(res['FinalRadiologyList']);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
print(res['FinalRadiologyList']);
finalRadiology =
new FinalRadiology.fromJson(res['FinalRadiologyList'][0]);
print(finalRadiology.reportData);
navigateToRadiologyDetails(finalRadiology);
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
});
}
openPrescriptionReport() {
List<PrescriptionReportEnh> prescriptionReportEnhList = List();
DoctorsListService service = new DoctorsListService();
service.getPatientPrescriptionReports(widget.appo, context).then((res) {
res['ListPRM'].forEach((report) {
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report));
});
print(prescriptionReportEnhList.length);
navigateToMedicinePrescriptionReport(
prescriptionReportEnhList, res['ListPRM']);
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
});
}
Future navigateToMedicinePrescriptionReport(
List<PrescriptionReportEnh> prescriptionReportEnhList,
dynamic listPres) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PrescriptionReportPage(
prescriptionReportEnhList: prescriptionReportEnhList,
listPres: listPres,
appo: widget.appo)));
}
Future navigateToRadiologyDetails(FinalRadiology finalRadiology) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
RadiologyDetailsPage(finalRadiology: finalRadiology)))
.then((value) {});
}
static Future<void> openMap(double latitude, double longitude) async {
String googleUrl =
'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude';
@ -389,19 +436,80 @@ class _AppointmentActionsState extends State<AppointmentActions> {
askYourDoc() {
DoctorsListService service = new DoctorsListService();
service
.isAllowedToAskDoctor(widget.appo.doctorID, context)
.then((res) {
service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) {
print(res['PatientDoctorAppointmentResultList']);
if (res['PatientDoctorAppointmentResultList'].length != 0) {
getCallRequestType();
} else {
AppToast.showErrorToast(
message: TranslationBase.of(context).askDocNotAllowed);
}
}).catchError((err) {
print(err);
});
}
getCallRequestType() {
DoctorsListService service = new DoctorsListService();
service.getCallRequestType(context).then((res) {
List<AskDocRequestType> requestData = new List<AskDocRequestType>();
res['ListReqTypes'].forEach((element) {
requestData.add(new AskDocRequestType.fromJson(element));
});
// print(requestData.length);
Utils.hideProgressDialog();
Future.delayed(const Duration(milliseconds: 400), () {
showAskDocRequestDialog(requestData);
});
}).catchError((err) {
print(err);
Utils.hideProgressDialog();
});
}
showAskDocRequestDialog(List<AskDocRequestType> requestData) {
Utils.hideProgressDialog();
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue =
Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform:
Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: AskDocDialog(requestData: requestData),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {})
.then((value) {
print("Dialog Closed");
print(value);
if (value != null) {
sendAskDocRequest(value);
}
});
}
sendAskDocRequest(int requestType) {
DoctorsListService service = new DoctorsListService();
service
.sendAskDocCallRequest(widget.appo, requestType.toString(), context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Request Sent Successfully");
} else {
AppToast.showErrorToast(message: TranslationBase
.of(context)
.askDocNotAllowed);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
});
}
@ -409,7 +517,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
DoctorsListService service = new DoctorsListService();
service
.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID,
widget.appo.projectID, context)
widget.appo.projectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
@ -422,6 +530,15 @@ class _AppointmentActionsState extends State<AppointmentActions> {
});
}
rateAppointment() {
widget.browser = new MyInAppBrowser();
widget.browser.openBrowser('http://hmg.com/SitePages/pso.aspx?p=' +
widget.appo.projectID.toString() +
'.' +
widget.appo.appointmentNo.toString() +
'&c=1');
}
loading(bool flag) {
setState(() {
AppointmentDetails.isLoading = flag;

@ -0,0 +1,153 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
class PrescriptionReportPage extends StatefulWidget {
List<PrescriptionReportEnh> prescriptionReportEnhList;
dynamic listPres;
AppoitmentAllHistoryResultList appo;
PrescriptionReportPage({@required this.prescriptionReportEnhList, @required this.listPres, @required this.appo});
@override
_PrescriptionReportState createState() => _PrescriptionReportState();
}
class _PrescriptionReportState extends State<PrescriptionReportPage> {
@override
void initState() {
print(widget.prescriptionReportEnhList.length);
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Items',
body: Container(
height: MediaQuery.of(context).size.height * 0.8,
child: ListView.builder(
itemBuilder: (context, index) => InkWell(
onTap: () {
navigateToPrescriptionDetails(
widget.prescriptionReportEnhList[index]);
},
child: Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200], width: 0.5),
),
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
widget.prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(widget
.prescriptionReportEnhList[index].itemDescription)),
)),
Icon(
Icons.arrow_forward_ios,
size: 18,
color: Colors.grey[500],
)
],
),
),
),
itemCount: widget.prescriptionReportEnhList.length,
),
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.2,
color: Colors.grey[100],
child: Column(
children: <Widget>[
Divider(),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
label: 'Send Copy',
onTap: () {
sendPrescriptionReportEmail();
},
),
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
label: 'Resend order & deliver',
backgroundColor: Colors.green[200],
))
],
),
),
);
}
sendPrescriptionReportEmail() {
DoctorsListService service = new DoctorsListService();
service.sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, widget.listPres, context).then((res) {
AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail');
Utils.hideProgressDialog();
}).catchError((err) {
print(err);
Utils.hideProgressDialog();
AppToast.showErrorToast(message: err);
});
}
navigateToPrescriptionDetails(PrescriptionReportEnh prescriptionReportEnh) {
final PrescriptionReport prescriptionReport = new PrescriptionReport();
prescriptionReport.imageSRCUrl = prescriptionReportEnh.imageSRCUrl;
prescriptionReport.itemDescription = prescriptionReportEnh.itemDescription;
prescriptionReport.itemID = prescriptionReportEnh.itemID;
prescriptionReport.routeN = prescriptionReportEnh.route;
prescriptionReport.route = prescriptionReportEnh.route;
prescriptionReport.frequency = prescriptionReportEnh.frequency;
prescriptionReport.frequencyN = prescriptionReportEnh.frequency;
prescriptionReport.doseDailyQuantity =
prescriptionReportEnh.doseDailyQuantity;
prescriptionReport.days = prescriptionReportEnh.days;
Navigator.push(
context,
FadePage(
page: PrescriptionDetailsPage(
prescriptionReport: prescriptionReport,
),
),
);
}
}

@ -0,0 +1,93 @@
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'custom_radio.dart';
class AskDocDialog extends StatefulWidget {
List<AskDocRequestType> requestData;
static int selectedParameterCode = 0;
AskDocDialog({@required this.requestData});
@override
_AskDocDialogState createState() => _AskDocDialogState();
}
class _AskDocDialogState extends State<AskDocDialog> {
@override
Widget build(BuildContext context) {
return Container(
child: Dialog(
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container(
height: MediaQuery.of(context).size.height * 0.77,
width: 450.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.all(20.0),
child: Text(TranslationBase.of(context).requestType,
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
fontFamily: "Open-Sans-Bold")),
),
Container(
transform: Matrix4.translationValues(0.0, -30.0, 0.0),
child: CustomRadio(requestData: widget.requestData),
),
Container(
width: MediaQuery.of(context).size.width,
height: 40.0,
margin: EdgeInsets.only(left: 30.0, top: 0.0, right: 30.0),
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
side: BorderSide(color: Colors.blue)),
color: Colors.blue,
onPressed: () {
if(AskDocDialog.selectedParameterCode != 0)
Navigator.pop(context, AskDocDialog.selectedParameterCode);
else
AppToast.showErrorToast(message: "Please select request type to continue");
},
child: Text(TranslationBase.of(context).confirm,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontFamily: 'Open-Sans-Bold')),
),
),
Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0),
child: OutlineButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0)),
color: Colors.red,
borderSide: BorderSide(color: Colors.red),
highlightColor: Colors.red,
highlightedBorderColor: Colors.red,
onPressed: () {
Navigator.pop(context, null);
},
child: Text(TranslationBase.of(context).cancel_nocaps,
style: TextStyle(
color: Colors.red,
fontWeight: FontWeight.bold,
fontFamily: 'Open-Sans-Bold')),
),
),
]),
),
),
);
}
}

@ -1,7 +1,13 @@
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
import 'package:flutter/material.dart';
class CustomRadio extends StatefulWidget {
List<AskDocRequestType> requestData;
CustomRadio({this.requestData});
@override
createState() {
return new CustomRadioState();
@ -14,10 +20,18 @@ class CustomRadioState extends State<CustomRadio> {
@override
void initState() {
super.initState();
sampleData.add(new RadioModel(false, "Before 30 Mins", 30));
sampleData.add(new RadioModel(false, 'Before 1 Hour', 60));
sampleData.add(new RadioModel(false, 'Before 2 Hours', 120));
sampleData.add(new RadioModel(false, 'Before 4 Hours', 240));
if (widget.requestData != null) {
widget.requestData.forEach((element) {
sampleData.add(
new RadioModel(false, element.description, element.parameterCode));
});
} else {
sampleData.add(new RadioModel(false, "Before 30 Mins", 30));
sampleData.add(new RadioModel(false, 'Before 1 Hour', 60));
sampleData.add(new RadioModel(false, 'Before 2 Hours', 120));
sampleData.add(new RadioModel(false, 'Before 4 Hours', 240));
}
}
@override
@ -35,8 +49,14 @@ class CustomRadioState extends State<CustomRadio> {
setState(() {
sampleData.forEach((element) => element.isSelected = false);
sampleData[index].isSelected = true;
ReminderDialog.selectedDuration =
sampleData[index].duration * 60000;
if (widget.requestData != null) {
AskDocDialog.selectedParameterCode =
sampleData[index].duration;
print(AskDocDialog.selectedParameterCode);
} else {
ReminderDialog.selectedDuration =
sampleData[index].duration * 60000;
}
});
},
child: new RadioItem(sampleData[index]),

@ -697,6 +697,107 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getCallRequestType(BuildContext context) async {
Utils.showProgressDialog(context);
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 = {
"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_CALL_REQUEST_TYPE,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> sendAskDocCallRequest(AppoitmentAllHistoryResultList appo,
String requestType, BuildContext context) async {
Utils.showProgressDialog(context);
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": appo.projectID,
"SetupID": appo.setupID,
"DoctorID": appo.doctorID,
"RequestType": requestType,
"RequestTypeID": requestType,
"PatientMobileNumber": authUser.mobileNumber,
"IsMessageSent": false,
"RequestDate":
DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now())
.split(" ")[0],
"RequestTime":
DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now())
.split(" ")[1],
"Remarks": "",
"Status": 1,
"CreatedBy": 102,
"CreatedOn":
DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now())
.split(" ")[0],
"EditedBy": 102,
"EditedOn":
DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now())
.split(" ")[0],
"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(SEND_CALL_REQUEST,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientRadOrders(String appoNo, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
@ -727,15 +828,105 @@ class DoctorsListService extends BaseService {
dynamic localRes;
await baseAppClient.post(GET_PATIENT_ORDERS,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientPrescriptionReports(
AppoitmentAllHistoryResultList appo, BuildContext context) async {
Utils.showProgressDialog(context);
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 = {
"AppointmentNo": appo.appointmentNo,
"ClinicID": appo.clinicID,
"ProjectID": appo.projectID,
"EpisodeID": appo.episodeID,
"VersionID": req.VersionID,
"SetupID": appo.setupID,
"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_PRESCRIPTION_REPORT_ENH,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> sendPrescriptionEmail(String appoDate, String setupId,
dynamic prescriptionReportEnhList, BuildContext context) async {
Utils.showProgressDialog(context);
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 = {
"AppointmentDate": appoDate,
"DateofBirth": authUser.dateofBirth,
"ListPrescriptions": prescriptionReportEnhList,
"PatientIditificationNum": authUser.patientIdentificationNo,
"PatientMobileNumber": authUser.mobileNumber,
"PatientName": authUser.firstName + " " + authUser.lastName,
"To": authUser.emailAddress,
"SetupID": setupId,
"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(SEND_PRESCRIPTION_EMAIL,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> createAdvancePayment(
AppoitmentAllHistoryResultList appo,

@ -1,4 +1,5 @@
import 'package:intl/intl.dart';
class DateUtil {
/// convert String To Date function
/// [date] String we want to convert
@ -145,6 +146,25 @@ class DateUtil {
return "";
}
/// get data formatted like 2020-8-13 09:43:00
/// [dateTime] convert DateTime to data formatted
static String getYearMonthDayHourMinSecDateFormatted(DateTime dateTime) {
if (dateTime != null)
return dateTime.year.toString() +
"-" +
dateTime.month.toString() +
"-" +
dateTime.day.toString() +
" " +
dateTime.hour.toString() +
":" +
dateTime.minute.toString() +
":" +
dateTime.second.toString();
else
return "";
}
static convertISODateToJsonDate(String isoDate) {
return "/Date(" +
DateFormat('mm-dd-yyy')

@ -332,6 +332,8 @@ class TranslationBase {
String get seeDetails => localizedValues['seeDetails'][locale.languageCode];
String get insuranceCards =>
localizedValues['insuranceCards'][locale.languageCode];
String get requestType =>
localizedValues['requestType'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -5,8 +5,6 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/services.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
class MyInAppBrowser extends InAppBrowser {
@ -148,12 +146,11 @@ class MyInAppBrowser extends InAppBrowser {
this.browser.openUrl(
url: generateURL(amount, orderDesc, transactionID, projId, emailId,
paymentMethod, authenticatedUser));
}
// this.browser.openData(
// data: generateURL(amount, orderDesc, transactionID, projId, emailId,
// paymentMethod, authenticatedUser),
// baseUrl:
// "https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx");
openBrowser(String url) {
this.browser = browser;
this.browser.openUrl(url: url);
}
String generateURL(

Loading…
Cancel
Save