added my appointments in medical file page

merge-update-with-lab-changes
haroon amjad 6 years ago
parent 7d0efda1c4
commit c50530734d

@ -19,7 +19,7 @@ class ArrivedButtons {
"title": "Radiology", "title": "Radiology",
"subtitle": "Services", "subtitle": "Services",
"icon": "assets/images/new-design/radiology_service_icon.png", "icon": "assets/images/new-design/radiology_service_icon.png",
"caller": "insertComplaint" "caller": "radiology"
}, },
{ {
"title": "Lab", "title": "Lab",

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart'; import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
@ -20,10 +21,9 @@ class AppointmentActions extends StatefulWidget {
TabController tabController; TabController tabController;
final Function enableFooterButton; final Function enableFooterButton;
AppointmentActions( AppointmentActions({@required this.appo,
{@required this.appo, @required this.tabController,
@required this.tabController, @required this.enableFooterButton});
@required this.enableFooterButton});
@override @override
_AppointmentActionsState createState() => _AppointmentActionsState(); _AppointmentActionsState createState() => _AppointmentActionsState();
@ -40,7 +40,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
@override @override
Widget build(BuildContext context) { 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 itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2;
final double itemWidth = size.width / 2; final double itemWidth = size.width / 2;
@ -56,57 +58,58 @@ class _AppointmentActionsState extends State<AppointmentActions> {
crossAxisCount: 2, crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight), childAspectRatio: (itemWidth / itemHeight),
children: appoButtonsList children: appoButtonsList
.map((e) => GestureDetector( .map((e) =>
onTap: () { GestureDetector(
_handleButtonClicks(e); onTap: () {
}, _handleButtonClicks(e);
child: Container( },
height: 100.0, child: Container(
margin: EdgeInsets.all(9.0), height: 100.0,
decoration: BoxDecoration( margin: EdgeInsets.all(9.0),
boxShadow: [ decoration: BoxDecoration(
BoxShadow( boxShadow: [
color: Colors.grey[400], BoxShadow(
blurRadius: 2.0, color: Colors.grey[400],
spreadRadius: 0.0) blurRadius: 2.0,
], spreadRadius: 0.0)
borderRadius: BorderRadius.circular(10), ],
color: Colors.white), borderRadius: BorderRadius.circular(10),
child: Column( color: Colors.white),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ mainAxisSize: MainAxisSize.min,
Container( children: <Widget>[
margin: Container(
EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), margin:
child: Text(e.title, EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
overflow: TextOverflow.clip, child: Text(e.title,
style: TextStyle( overflow: TextOverflow.clip,
color: new Color(0xFFc5272d), style: TextStyle(
letterSpacing: 1.0, color: new Color(0xFFc5272d),
fontSize: 20.0)), 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(), .toList(),
), ),
), ),
@ -130,9 +133,15 @@ class _AppointmentActionsState extends State<AppointmentActions> {
case "onCancelAppointment": case "onCancelAppointment":
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: TranslationBase.of(context).cancelAppoMsg, confirmMessage: TranslationBase
okText: TranslationBase.of(context).confirm, .of(context)
cancelText: TranslationBase.of(context).cancel_nocaps, .cancelAppoMsg,
okText: TranslationBase
.of(context)
.confirm,
cancelText: TranslationBase
.of(context)
.cancel_nocaps,
okFunction: () => {cancelAppointment()}, okFunction: () => {cancelAppointment()},
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
@ -158,6 +167,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
case "askDoc": case "askDoc":
askYourDoc(); askYourDoc();
break; break;
case "radiology":
openAppointmentRadiology();
break;
} }
} }
@ -329,6 +342,21 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}); });
} }
openAppointmentRadiology() {
DoctorsListService service = new DoctorsListService();
FinalRadiology finalRadiology = new FinalRadiology();
service.getPatientRadOrders(widget.appo.appointmentNo.toString(), context)
.then((res) {
if (res['MessageStatus'] == 1) {
print(res['FinalRadiologyList']);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
});
}
static Future<void> openMap(double latitude, double longitude) async { static Future<void> openMap(double latitude, double longitude) async {
String googleUrl = String googleUrl =
'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude'; 'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude';
@ -364,11 +392,13 @@ class _AppointmentActionsState extends State<AppointmentActions> {
service service
.isAllowedToAskDoctor(widget.appo.doctorID, context) .isAllowedToAskDoctor(widget.appo.doctorID, context)
.then((res) { .then((res) {
print(res['PatientDoctorAppointmentResultList']); print(res['PatientDoctorAppointmentResultList']);
if (res['PatientDoctorAppointmentResultList'].length != 0) { if (res['PatientDoctorAppointmentResultList'].length != 0) {
} else { } else {
AppToast.showErrorToast(message: TranslationBase.of(context).askDocNotAllowed); AppToast.showErrorToast(message: TranslationBase
.of(context)
.askDocNotAllowed);
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -379,7 +409,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, .confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID,
widget.appo.projectID, context) widget.appo.projectID, context)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);

@ -1,5 +1,6 @@
import 'dart:math'; import 'dart:math';
import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
@ -184,7 +185,29 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
), ),
) )
], ],
) ),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context, FadePage(page: MyAppointments()));
},
child: MedicalProfileItem(
title: 'My Appointments',
imagePath: 'my_appointment_icon.png',
subTitle: 'List',
),
),
),
Expanded(
flex: 1,
child: Container(),
),
],
),
], ],
), ),
), ),

@ -697,6 +697,46 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getPatientRadOrders(String appoNo, 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": appoNo,
"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_PATIENT_ORDERS,
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( Future<Map> createAdvancePayment(
AppoitmentAllHistoryResultList appo, AppoitmentAllHistoryResultList appo,
double payedAmount, double payedAmount,

Loading…
Cancel
Save