Covid Test changes

merge-update-with-lab-changes
haroon amjad 5 years ago
parent e8bb4e962c
commit e5a636b704

@ -1483,4 +1483,5 @@ const Map localizedValues = {
"thirdTri": { "en": "Third Trimester, Estimated Due Date (40 weeks):", "ar": "تاريخ احتمال الولادة 40 اسبوع:" }, "thirdTri": { "en": "Third Trimester, Estimated Due Date (40 weeks):", "ar": "تاريخ احتمال الولادة 40 اسبوع:" },
"seeDoctorsList": { "en": "See List Of Doctors", "ar": "اعرض قائمة الأطباء" }, "seeDoctorsList": { "en": "See List Of Doctors", "ar": "اعرض قائمة الأطباء" },
"covidQuestionnaire": { "en": "Please answer below questionnaire:", "ar": "الرجاء الإجابة على الاستبيان أدناه:" }, "covidQuestionnaire": { "en": "Please answer below questionnaire:", "ar": "الرجاء الإجابة على الاستبيان أدناه:" },
"covidBookAppo": { "en": "Booking Appointment For: ", "ar": "موعد الحجز لـ: " },
}; };

@ -418,12 +418,30 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
} }
bookCovidTestAppointment() { bookCovidTestAppointment() {
var messageEn = "This Appointment is being booked for patient " +
projectViewModel.user.firstName +
" " +
projectViewModel.user.lastName +
", Having file number " +
projectViewModel.user.patientID.toString() +
". Please confirm!";
var messageAr =
"يتم حجز هذا الموعد المراجع " + projectViewModel.user.firstName + " " + projectViewModel.user.lastName + ", وجود رقم الملف " + projectViewModel.user.patientID.toString() + ". يرجى تأكيد!";
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: projectViewModel.isArabic ? messageAr : messageEn,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorList docObject = new DoctorList(); DoctorList docObject = new DoctorList();
docObject.doctorID = widget.selectedDoctorID; docObject.doctorID = widget.selectedDoctorID;
docObject.clinicID = widget.selectedClinicID; docObject.clinicID = widget.selectedClinicID;
docObject.projectID = widget.projectID; docObject.projectID = widget.projectID;
insertAppointmentCovidTest(context, docObject); insertAppointmentCovidTest(context, docObject);
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
} }
insertAppointmentCovidTest(context, DoctorList docObject) { insertAppointmentCovidTest(context, DoctorList docObject) {

@ -1,5 +1,6 @@
import 'dart:convert'; import 'dart:convert';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart';
@ -12,6 +13,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'covid-payment-details.dart'; import 'covid-payment-details.dart';
@ -27,6 +29,7 @@ class CovidDirveThruQuestions extends StatefulWidget {
class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> { class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
List qa; List qa;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -34,12 +37,10 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
qa = getQuestionsFromJson(); qa = getQuestionsFromJson();
} }
TranslationBase localize;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
localize = TranslationBase.of(context); projectViewModel = Provider.of(context);
var isArabic = localize.isArabic(); var isArabic = projectViewModel.isArabic;
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
@ -48,9 +49,26 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container(
width: MediaQuery.of(context).size.width * 0.9,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15.0),
),
margin: EdgeInsets.fromLTRB(18.0, 10.0, 18.0, 10.0),
padding: EdgeInsets.fromLTRB(8.0, 10.0, 8.0, 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(TranslationBase.of(context).covidBookAppo, style: TextStyle(fontSize: 18, letterSpacing: 1, fontWeight: FontWeight.bold)),
Text(TranslationBase.of(context).patientName.toString() + ": " + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, style: TextStyle(fontSize: 14, letterSpacing: 1)),
Text(TranslationBase.of(context).fileNo.toString() + ": " + projectViewModel.user.patientID.toString(), style: TextStyle(fontSize: 14, letterSpacing: 1)),
],
),
),
Padding( Padding(
padding: const EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), padding: const EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: Text(localize.covidQuestionnaire, style: TextStyle(fontSize: 17, letterSpacing: 1, fontWeight: FontWeight.bold)), child: Text(TranslationBase.of(context).covidQuestionnaire, style: TextStyle(fontSize: 17, letterSpacing: 1, fontWeight: FontWeight.bold)),
), ),
Expanded( Expanded(
child: ListView.separated( child: ListView.separated(
@ -75,7 +93,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
obj["ans"] = newValue; obj["ans"] = newValue;
}); });
}), }),
Text(localize.yes), Text(TranslationBase.of(context).yes),
], ],
), ),
Row( Row(
@ -88,7 +106,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
obj["ans"] = newValue; obj["ans"] = newValue;
}); });
}), }),
Text(localize.no), Text(TranslationBase.of(context).no),
], ],
) )
], ],
@ -101,7 +119,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 1, widthFactor: 1,
child: DefaultButton(localize.next, () { child: DefaultButton(TranslationBase.of(context).next, () {
next(); next();
}), }),
), ),
@ -121,7 +139,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
getPaymentInfo(context, widget.projectId); getPaymentInfo(context, widget.projectId);
} }
else else
AppToast.showErrorToast(message: localize.pleaseSelectAllQuestionToContinue); AppToast.showErrorToast(message: TranslationBase.of(context).pleaseSelectAllQuestionToContinue);
} }
openPassportUpdatePage() { openPassportUpdatePage() {

@ -2246,6 +2246,9 @@ class TranslationBase {
String get covidQuestionnaire => localizedValues["covidQuestionnaire"][locale.languageCode]; String get covidQuestionnaire => localizedValues["covidQuestionnaire"][locale.languageCode];
String get covidBookAppo => localizedValues["covidBookAppo"][locale.languageCode];
} }

Loading…
Cancel
Save