Covid Test changes

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

@ -1483,4 +1483,5 @@ const Map localizedValues = {
"thirdTri": { "en": "Third Trimester, Estimated Due Date (40 weeks):", "ar": "تاريخ احتمال الولادة 40 اسبوع:" },
"seeDoctorsList": { "en": "See List Of Doctors", "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() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorList docObject = new DoctorList();
docObject.doctorID = widget.selectedDoctorID;
docObject.clinicID = widget.selectedClinicID;
docObject.projectID = widget.projectID;
insertAppointmentCovidTest(context, docObject);
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);
DoctorList docObject = new DoctorList();
docObject.doctorID = widget.selectedDoctorID;
docObject.clinicID = widget.selectedClinicID;
docObject.projectID = widget.projectID;
insertAppointmentCovidTest(context, docObject);
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
insertAppointmentCovidTest(context, DoctorList docObject) {

@ -1,5 +1,6 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'covid-payment-details.dart';
@ -27,6 +29,7 @@ class CovidDirveThruQuestions extends StatefulWidget {
class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
List qa;
ProjectViewModel projectViewModel;
@override
void initState() {
@ -34,12 +37,10 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
qa = getQuestionsFromJson();
}
TranslationBase localize;
@override
Widget build(BuildContext context) {
localize = TranslationBase.of(context);
var isArabic = localize.isArabic();
projectViewModel = Provider.of(context);
var isArabic = projectViewModel.isArabic;
return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
@ -48,9 +49,26 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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: 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(
child: ListView.separated(
@ -75,7 +93,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
obj["ans"] = newValue;
});
}),
Text(localize.yes),
Text(TranslationBase.of(context).yes),
],
),
Row(
@ -88,7 +106,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
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),
child: FractionallySizedBox(
widthFactor: 1,
child: DefaultButton(localize.next, () {
child: DefaultButton(TranslationBase.of(context).next, () {
next();
}),
),
@ -121,7 +139,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
getPaymentInfo(context, widget.projectId);
}
else
AppToast.showErrorToast(message: localize.pleaseSelectAllQuestionToContinue);
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseSelectAllQuestionToContinue);
}
openPassportUpdatePage() {

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

Loading…
Cancel
Save