Done allergies service

merge-update-with-lab-changes
Mohammad Aljammal 6 years ago
parent 82c2577d36
commit 3ffff9686d

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

@ -226,6 +226,8 @@ const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse';
const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus';
const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies';
const TIMER_MIN = 10; const TIMER_MIN = 10;

@ -417,7 +417,7 @@ const Map<String, Map<String, String>> localizedValues = {
"UpdateInsuranceSubtitle": {"en": "Card", "ar": "التأمين"}, "UpdateInsuranceSubtitle": {"en": "Card", "ar": "التأمين"},
"InsuranceApproval": {"en": "Insurance Approval", "ar": "موافقات"}, "InsuranceApproval": {"en": "Insurance Approval", "ar": "موافقات"},
"InsuranceApprovalSubtitle": {"en": "Approvals", "ar": "موافقات التأمين"}, "InsuranceApprovalSubtitle": {"en": "Approvals", "ar": "موافقات التأمين"},
"Allergies": {"en": "Approvals", "ar": "الحساسية"}, "Allergies": {"en": "Allergies", "ar": "الحساسية"},
"AllergiesSubtitle": {"en": "Diagnosed", "ar": "مسجلة"}, "AllergiesSubtitle": {"en": "Diagnosed", "ar": "مسجلة"},
"MyVaccines": {"en": "My Vaccines", "ar": "تطعيماتي"}, "MyVaccines": {"en": "My Vaccines", "ar": "تطعيماتي"},
"MyVaccinesSubtitle": {"en": "List", "ar": "قائمة"}, "MyVaccinesSubtitle": {"en": "List", "ar": "قائمة"},
@ -497,10 +497,29 @@ const Map<String, Map<String, String>> localizedValues = {
"Cylinder":{"en":"Cylinder","ar":"الدائرية"}, "Cylinder":{"en":"Cylinder","ar":"الدائرية"},
"Axis":{"en":"Axis","ar":"المحاور"}, "Axis":{"en":"Axis","ar":"المحاور"},
"Prism":{"en":"Prism","ar":"موشور"}, "Prism":{"en":"Prism","ar":"موشور"},
"VA":{"en":"Prism","VA":"المحاور"}, "VA":{"en":"Prism","ar":"المحاور"},
"LeftEye":{"en":"Left Eye","VA":"العين اليسرى"}, "LeftEye":{"en":"Left Eye","ar":"العين اليسرى"},
"Brand":{"en":"Brand","VA":"النوع"}, "Brand":{"en":"Brand","ar":"النوع"},
"Power":{"en":"Power","VA":"القوة"}, "Power":{"en":"Power","ar":"القوة"},
"Diameter":{"en":"Diameter","VA":"القطر"}, "Diameter":{"en":"Diameter","ar":"القطر"},
"Remarks":{"en":"Remarks","VA":"ملاحضات"}, "Remarks":{"en":"Remarks","ar":"ملاحضات"},
"ActiveMedications":{"en":"Active Medications","ar":"ادويتي النشطة"},
"ExpDate":{"en":"Active Exp Date :","VA":"تاريخ الإنتهاء"},
"Route":{"en":"Route :","ar":"الطريقة"},
"Frequency":{"en":"Frequency :","ar":"المعدل"},
"DailyQuantity":{"en":"Daily Quantity :","ar":"جرعات يومية"},
"AddReminder":{"en":"Add Reminder","ar":"إضافة تذكير"},
"reminderDes":{"en":"Please select treatment start day and time to be notified when it\'s time to take the medicine","ar":" يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء"},
"StartDay":{"en":"Start Day","ar":"يوم البداية"},
"EndDay":{"en":"End Day","ar":"يوم الانتهاء"},
"Days":{"en":"Days ","ar":"أيام"},
"ScheduleTime":{"en":"Schedule time","ar":"الجدول الزمني"},
"AskDoctor":{"en":"Ask Doctor","ar":"اسأل طبيبك"},
"DoctorResponses":{"en":"Doctor Responses","ar":"ردود الأطباء"},
"New":{"en":"New","ar":"جديد"},
"All":{"en":"All","ar":"الكل"},
"QuestionHere":{"en":"Enter the question here...","ar":"اضف الاستفسار هنا"},
"ViewDoctorResponses":{"en":"View Doctor Responses","ar":"الاطلاع على ردود الأطباء"},
}; };

@ -0,0 +1,48 @@
class Allergy {
int patientID;
int allergyDiseaseType;
int allergyDiseaseID;
String description;
dynamic descriptionN;
dynamic remarks;
dynamic avgDoctorRatingList;
dynamic doctorRatingDetailsList;
dynamic notesDoctorRatingList;
Allergy(
{this.patientID,
this.allergyDiseaseType,
this.allergyDiseaseID,
this.description,
this.descriptionN,
this.remarks,
this.avgDoctorRatingList,
this.doctorRatingDetailsList,
this.notesDoctorRatingList});
Allergy.fromJson(Map<String, dynamic> json) {
patientID = json['PatientID'];
allergyDiseaseType = json['AllergyDiseaseType'];
allergyDiseaseID = json['AllergyDiseaseID'];
description = json['Description'];
descriptionN = json['DescriptionN'];
remarks = json['Remarks'];
avgDoctorRatingList = json['AvgDoctorRatingList'];
doctorRatingDetailsList = json['DoctorRatingDetailsList'];
notesDoctorRatingList = json['NotesDoctorRatingList'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientID'] = this.patientID;
data['AllergyDiseaseType'] = this.allergyDiseaseType;
data['AllergyDiseaseID'] = this.allergyDiseaseID;
data['Description'] = this.description;
data['DescriptionN'] = this.descriptionN;
data['Remarks'] = this.remarks;
data['AvgDoctorRatingList'] = this.avgDoctorRatingList;
data['DoctorRatingDetailsList'] = this.doctorRatingDetailsList;
data['NotesDoctorRatingList'] = this.notesDoctorRatingList;
return data;
}
}

@ -2,35 +2,35 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class PrescriptionsOrder { class PrescriptionsOrder {
int iD; int iD;
String patientID; dynamic patientID;
bool patientOutSA; bool patientOutSA;
bool isOutPatient; bool isOutPatient;
int projectID; int projectID;
int nearestProjectID; int nearestProjectID;
double longitude; double longitude;
double latitude; double latitude;
String appointmentNo; dynamic appointmentNo;
String dischargeID; dynamic dischargeID;
int lineItemNo; int lineItemNo;
int status; int status;
String description; dynamic description;
String descriptionN; dynamic descriptionN;
DateTime createdOn; DateTime createdOn;
int serviceID; int serviceID;
int createdBy; int createdBy;
DateTime editedOn; DateTime editedOn;
int editedBy; int editedBy;
int channel; int channel;
String clientRequestID; dynamic clientRequestID;
bool returnedToQueue; bool returnedToQueue;
Null pickupDateTime; dynamic pickupDateTime;
Null pickupLocationName; dynamic pickupLocationName;
Null dropoffLocationName; dynamic dropoffLocationName;
int realRRTHaveTransactions; int realRRTHaveTransactions;
String nearestProjectDescription; dynamic nearestProjectDescription;
String nearestProjectDescriptionN; dynamic nearestProjectDescriptionN;
String projectDescription; dynamic projectDescription;
String projectDescriptionN; dynamic projectDescriptionN;
PrescriptionsOrder( PrescriptionsOrder(
{this.iD, {this.iD,

@ -0,0 +1,25 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/Allergy/Allergy.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class AllergiesService extends BaseService {
List<Allergy> allergies = List();
getAllergies() async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['OutSA'] = 0;
await baseAppClient.post(GET_PATIENT_ALLERGIES,
onSuccess: (response, statusCode) async {
allergies.clear();
response['Patient_Allergies'].forEach((allergy) {
allergies.add(Allergy.fromJson(allergy));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -0,0 +1,22 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/Allergy/Allergy.dart';
import 'package:diplomaticquarterapp/core/service/medical/AllergiesService.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart';
class AllergiesViewModel extends BaseViewModel {
AllergiesService _allergiesService = locator<AllergiesService>();
List<Allergy> get allergies => _allergiesService.allergies;
getAllergies() async {
setState(ViewState.Busy);
await _allergiesService.getAllergies();
if (_allergiesService.hasError) {
error = _allergiesService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}

@ -10,6 +10,7 @@ import 'core/service/er/er_service.dart';
import 'core/service/feedback/feedback_service.dart'; import 'core/service/feedback/feedback_service.dart';
import 'core/service/hospital_service.dart'; import 'core/service/hospital_service.dart';
import 'core/service/medical/ActiveMedicationsService.dart'; import 'core/service/medical/ActiveMedicationsService.dart';
import 'core/service/medical/AllergiesService.dart';
import 'core/service/medical/BloodPressureService.dart'; import 'core/service/medical/BloodPressureService.dart';
import 'core/service/medical/BloodSugarService.dart'; import 'core/service/medical/BloodSugarService.dart';
import 'core/service/medical/EyeService.dart'; import 'core/service/medical/EyeService.dart';
@ -31,6 +32,7 @@ import 'core/viewModels/feedback/feedback_view_model.dart';
import 'core/service/medical/reports_service.dart'; import 'core/service/medical/reports_service.dart';
import 'core/viewModels/hospital_view_model.dart'; import 'core/viewModels/hospital_view_model.dart';
import 'core/viewModels/medical/ActiveMedicationsViewModel.dart'; import 'core/viewModels/medical/ActiveMedicationsViewModel.dart';
import 'core/viewModels/medical/AllergiesViewModel.dart';
import 'core/viewModels/medical/EyeViewModel.dart'; import 'core/viewModels/medical/EyeViewModel.dart';
import 'core/viewModels/medical/ask_doctor_view_model.dart'; import 'core/viewModels/medical/ask_doctor_view_model.dart';
import 'core/viewModels/medical/blood_pressure_view_model.dart'; import 'core/viewModels/medical/blood_pressure_view_model.dart';
@ -86,6 +88,7 @@ void setupLocator() {
locator.registerLazySingleton(() => EyeService()); locator.registerLazySingleton(() => EyeService());
locator.registerLazySingleton(() => ActiveMedicationsService()); locator.registerLazySingleton(() => ActiveMedicationsService());
locator.registerLazySingleton(() => AskDoctorService()); locator.registerLazySingleton(() => AskDoctorService());
locator.registerLazySingleton(() => AllergiesService());
/// View Model /// View Model
locator.registerFactory(() => HospitalViewModel()); locator.registerFactory(() => HospitalViewModel());
@ -114,4 +117,5 @@ void setupLocator() {
locator.registerFactory(() => EyeViewModel()); locator.registerFactory(() => EyeViewModel());
locator.registerFactory(() => ActiveMedicationsViewModel()); locator.registerFactory(() => ActiveMedicationsViewModel());
locator.registerFactory(() => AskDoctorViewModel()); locator.registerFactory(() => AskDoctorViewModel());
locator.registerFactory(() => AllergiesViewModel());
} }

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/ActiveMedicationsVi
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/active_medications/reminder_page.dart'; import 'package:diplomaticquarterapp/pages/medical/active_medications/reminder_page.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -17,7 +18,7 @@ class ActiveMedicationsPage extends StatelessWidget {
onModelReady: (model) => model.getActiveMedication(), onModelReady: (model) => model.getActiveMedication(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: 'Active Medications', appBarTitle: TranslationBase.of(context).activeMedications,
isShowAppBar: true, isShowAppBar: true,
body: Container( body: Container(
child: ListView.builder( child: ListView.builder(
@ -48,7 +49,7 @@ class ActiveMedicationsPage extends StatelessWidget {
height: 5, height: 5,
), ),
Texts( Texts(
'Exp Date :' + TranslationBase.of(context).expDate+' :' +
DateUtil.getDayMonthYearDateFormatted(model DateUtil.getDayMonthYearDateFormatted(model
.activePrescriptionReport[index].orderDate), .activePrescriptionReport[index].orderDate),
), ),
@ -56,52 +57,53 @@ class ActiveMedicationsPage extends StatelessWidget {
height: 5, height: 5,
), ),
Texts( Texts(
'Route :' + TranslationBase.of(context).route+ ' :' +
model.activePrescriptionReport[index].route, model.activePrescriptionReport[index].route,
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Texts( Texts(
'Frequency :' + TranslationBase.of(context).frequency+ ' :' +
model.activePrescriptionReport[index].frequency, model.activePrescriptionReport[index].frequency,
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Texts( Texts(
'Daily Quantity :${model.activePrescriptionReport[index].doseDailyQuantity}', TranslationBase.of(context).dailyQuantity + ' :${model.activePrescriptionReport[index].doseDailyQuantity}',
), ),
], ],
), ),
), ),
InkWell( Container(
onTap: () { child: Column(
Navigator.push( crossAxisAlignment: CrossAxisAlignment.center,
context, mainAxisAlignment: MainAxisAlignment.spaceBetween,
FadePage( children: [
page: ReminderPage( Icon(
frequency: model.activePrescriptionReport[index] Icons.notifications,
.frequencyNumber, color: Colors.red,
days: model.activePrescriptionReport[index].days, size: 28,
itemDescription: model
.activePrescriptionReport[index]
.itemDescription,
),
), ),
); SizedBox(height: 25,),
}, InkWell(
child: Container( onTap: (){
child: Column( Navigator.push(
crossAxisAlignment: CrossAxisAlignment.center, context,
mainAxisAlignment: MainAxisAlignment.spaceAround, FadePage(
children: [ page: ReminderPage(
Icon( frequency: model.activePrescriptionReport[index]
Icons.notifications, .frequencyNumber,
color: Colors.red, days: model.activePrescriptionReport[index].days,
size: 28, itemDescription: model
), .activePrescriptionReport[index]
Row( .itemDescription,
),
),
);
},
child: Row(
children: [ children: [
Icon( Icon(
Icons.notifications_active, Icons.notifications_active,
@ -109,13 +111,13 @@ class ActiveMedicationsPage extends StatelessWidget {
size: 28, size: 28,
), ),
Texts( Texts(
'Reminder', TranslationBase.of(context).addReminder,
color: Colors.red, color: Colors.red,
) )
], ],
) ),
], )
), ],
), ),
) )
], ],

@ -0,0 +1,161 @@
import 'package:device_calendar/device_calendar.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class DayCheckBoxDialog extends StatefulWidget {
final Function(List<DayOfWeek>) onValueSelected;
final String title;
final List<DayOfWeek> selectedDaysOfWeek;
final List<DayOfWeek> daysOfWeek = [
DayOfWeek.Monday,
DayOfWeek.Tuesday,
DayOfWeek.Wednesday,
DayOfWeek.Thursday,
DayOfWeek.Friday,
DayOfWeek.Saturday,
DayOfWeek.Sunday,
];
DayCheckBoxDialog(
{Key key, this.onValueSelected, this.selectedDaysOfWeek, this.title});
@override
_DayCheckBoxDialogState createState() => _DayCheckBoxDialogState();
}
class _DayCheckBoxDialogState extends State<DayCheckBoxDialog> {
@override
Widget build(BuildContext context) {
return SimpleDialog(
title: Container(
width: double.infinity,
child: Center(
child: Texts(
widget.title,
textAlign: TextAlign.center,
))),
children: [
Container(
height: widget.daysOfWeek.length > 3
? MediaQuery.of(context).size.height * 0.6
: null,
child: SingleChildScrollView(
child: Column(
children: [
Divider(),
...List.generate(
widget.daysOfWeek.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
if (widget.selectedDaysOfWeek
.contains(widget.daysOfWeek[index]))
widget.selectedDaysOfWeek
.remove(widget.daysOfWeek[index]);
else
widget.selectedDaysOfWeek
.add(widget.daysOfWeek[index]);
});
},
child: ListTile(
title: Text(DateUtil.getDay(widget.daysOfWeek[index])),
leading: Checkbox(
value: widget.selectedDaysOfWeek
.contains(widget.daysOfWeek[index]),
onChanged: (value) {
setState(() {
if (widget.selectedDaysOfWeek
.contains(widget.daysOfWeek[index]))
widget.selectedDaysOfWeek
.remove(widget.daysOfWeek[index]);
else
widget.selectedDaysOfWeek
.add(widget.daysOfWeek[index]);
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
SizedBox(
height: 5.0,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context)
.cancel
.toUpperCase(),
color: Colors.red,
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedDaysOfWeek);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
),
),
),
),
),
],
)
],
),
),
)
],
);
}
}

@ -1,10 +1,10 @@
import 'package:device_calendar/device_calendar.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/ActiveMedicationsViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ActiveMedicationsViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -13,6 +13,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'DayCheckBoxDialog.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class ReminderPage extends StatefulWidget { class ReminderPage extends StatefulWidget {
final int frequency; final int frequency;
@ -20,6 +22,15 @@ class ReminderPage extends StatefulWidget {
final String itemDescription; final String itemDescription;
List<DateTime> _scheduleList = List(); List<DateTime> _scheduleList = List();
List<DayOfWeek> daysOfWeek = [
DayOfWeek.Monday,
DayOfWeek.Tuesday,
DayOfWeek.Wednesday,
DayOfWeek.Thursday,
DayOfWeek.Friday,
DayOfWeek.Saturday,
DayOfWeek.Sunday
];
DateTime startDay; DateTime startDay;
DateTime endDay; DateTime endDay;
@ -48,7 +59,7 @@ class _ReminderPageState extends State<ReminderPage> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Reminder', appBarTitle: TranslationBase.of(context).reminder,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.all(8.0), margin: EdgeInsets.all(8.0),
@ -57,14 +68,16 @@ class _ReminderPageState extends State<ReminderPage> {
children: [ children: [
Container( Container(
width: double.maxFinite, width: double.maxFinite,
child: Texts( child: Texts(TranslationBase.of(context).reminderDes),
'Please select treatment start day and time to be notified when it\'s time to take the medicine'),
), ),
Divider(), Divider(),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts('Start day'), Texts(TranslationBase.of(context).startDay),
SizedBox(
height: 6,
),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showDatePicker(context, DatePicker.showDatePicker(context,
@ -72,7 +85,6 @@ class _ReminderPageState extends State<ReminderPage> {
minTime: DateTime( minTime: DateTime(
DateTime.now().year, DateTime.now().month - 1, 1), DateTime.now().year, DateTime.now().month - 1, 1),
maxTime: DateTime.now(), onConfirm: (date) { maxTime: DateTime.now(), onConfirm: (date) {
print('confirm $date');
setState(() { setState(() {
widget.startDay = date; widget.startDay = date;
}); });
@ -102,7 +114,10 @@ class _ReminderPageState extends State<ReminderPage> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts('End day'), Texts(TranslationBase.of(context).endDay),
SizedBox(
height: 6,
),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showDatePicker(context, DatePicker.showDatePicker(context,
@ -110,7 +125,6 @@ class _ReminderPageState extends State<ReminderPage> {
minTime: DateTime( minTime: DateTime(
DateTime.now().year, DateTime.now().month - 1, 1), DateTime.now().year, DateTime.now().month - 1, 1),
maxTime: DateTime.now(), onConfirm: (date) { maxTime: DateTime.now(), onConfirm: (date) {
print('confirm $date');
setState(() { setState(() {
widget.endDay = date; widget.endDay = date;
}); });
@ -137,6 +151,37 @@ class _ReminderPageState extends State<ReminderPage> {
), ),
), ),
), ),
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).days),
SizedBox(
height: 6,
),
InkWell(
onTap: () => confirmSelectDayDialog(),
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Texts(
getDays(),
)),
Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
],
),
),
),
...List.generate( ...List.generate(
widget._scheduleList.length, widget._scheduleList.length,
(index) => Column( (index) => Column(
@ -145,7 +190,7 @@ class _ReminderPageState extends State<ReminderPage> {
SizedBox( SizedBox(
height: 7, height: 7,
), ),
Texts('Schedule time'), Texts(TranslationBase.of(context).scheduleTime),
SizedBox( SizedBox(
height: 7, height: 7,
), ),
@ -153,7 +198,6 @@ class _ReminderPageState extends State<ReminderPage> {
onTap: () { onTap: () {
DatePicker.showTimePicker(context, DatePicker.showTimePicker(context,
showTitleActions: true, onConfirm: (date) { showTitleActions: true, onConfirm: (date) {
print('confirm $date');
setState(() { setState(() {
widget._scheduleList[index] = date; widget._scheduleList[index] = date;
}); });
@ -194,14 +238,31 @@ class _ReminderPageState extends State<ReminderPage> {
), ),
bottomSheet: Container( bottomSheet: Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height * 0.1, height: MediaQuery.of(context).size.height * 0.2,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: SecondaryButton( child: Column(
label: 'OK', crossAxisAlignment: CrossAxisAlignment.start,
color: Colors.grey[800], children: [
onTap: () { SecondaryButton(
schedule(); label: TranslationBase.of(context).ok,
}, color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
schedule();
},
),
SizedBox(
height: 15,
),
SecondaryButton(
label: TranslationBase.of(context).cancel,
color: Colors.red[800],
textColor: Colors.white,
onTap: () {
Navigator.pop(context);
},
),
],
), ),
), ),
), ),
@ -212,14 +273,6 @@ class _ReminderPageState extends State<ReminderPage> {
List<DateTime> scheduleDateTime = List<DateTime> scheduleDateTime =
calculateDaysInterval(widget.startDay, widget.endDay); calculateDaysInterval(widget.startDay, widget.endDay);
// scheduleDateTime.forEach((date) {
// LocalNotification.scheduleNotification(
// scheduledNotificationDateTime: date,
// title: 'Remainder',
// description: widget.itemDescription);
// return;
// });
CalendarUtils calendarUtils = await CalendarUtils.getInstance(); CalendarUtils calendarUtils = await CalendarUtils.getInstance();
calendarUtils.createOrUpdateEvents( calendarUtils.createOrUpdateEvents(
@ -228,9 +281,6 @@ class _ReminderPageState extends State<ReminderPage> {
title: widget.itemDescription, title: widget.itemDescription,
scheduleDateTime: scheduleDateTime); scheduleDateTime: scheduleDateTime);
var asd = calendarUtils.writableCalendars;
Navigator.pop(context); Navigator.pop(context);
} }
@ -258,6 +308,25 @@ class _ReminderPageState extends State<ReminderPage> {
} }
String getDays() { String getDays() {
return ''; String days = "";
widget.daysOfWeek.forEach((element) {
days += "${DateUtil.getDay(element)},";
});
return days;
}
void confirmSelectDayDialog() {
showDialog(
context: context,
child: DayCheckBoxDialog(
title: 'Select Day',
selectedDaysOfWeek: widget.daysOfWeek,
onValueSelected: (value) {
setState(() {
widget.daysOfWeek = value;
});
},
),
);
} }
} }

@ -0,0 +1,54 @@
import 'package:diplomaticquarterapp/core/viewModels/medical/AllergiesViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class AllergiesPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<AllergiesViewModel>(
onModelReady: (model) => model.getAllergies(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).allergies,
baseViewModel: model,
body: ListView.builder(
itemCount: model.allergies.length,
itemBuilder: (context, index) => Container(
margin: EdgeInsets.all(15),
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.white,
),
child: Row(
children: [
Image.asset(
'assets/images/new-design/allergiesDetails.png',
width: 50,
height: 50,
fit: BoxFit.cover,
),
SizedBox(
width: 15,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(TranslationBase.of(context).remarks+" :"),
Texts(TranslationBase.of(context).description + model.allergies[index].description ?? ''),
],
),
)
],
),
),
),
),
);
}
}

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart'; import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -16,7 +17,7 @@ class ViewDoctorResponsesPage extends StatelessWidget {
onModelReady: (model) => model.updateReadStatus(transactionNo: doctorResponse.transactionNo), onModelReady: (model) => model.updateReadStatus(transactionNo: doctorResponse.transactionNo),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: ' View Doctor Responses', appBarTitle: TranslationBase.of(context).viewDoctorResponses,
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(

@ -39,7 +39,7 @@ class _AskDoctorHomPageState extends State<AskDoctorHomPage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).prescriptions, appBarTitle: TranslationBase.of(context).askDoctor,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(
@ -87,14 +87,14 @@ class _AskDoctorHomPageState extends State<AskDoctorHomPage>
child: Container( child: Container(
width: MediaQuery.of(context).size.width * 0.36, width: MediaQuery.of(context).size.width * 0.36,
child: Center( child: Center(
child: Texts('ASK Doctor'), child: Texts(TranslationBase.of(context).askDoctor),
), ),
), ),
), ),
Tab(child: Container( Tab(child: Container(
width: MediaQuery.of(context).size.width * 0.36, width: MediaQuery.of(context).size.width * 0.36,
child: Center( child: Center(
child: Texts('Doctor Responses',textAlign: TextAlign.start,), child: Texts(TranslationBase.of(context).doctorResponses,textAlign: TextAlign.start,),
), ),
),) ),)
], ],

@ -238,6 +238,3 @@ class AskDoctorPage extends StatelessWidget {
} }
} }
/**
*
*/

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -34,7 +35,7 @@ class DoctorResponse extends StatelessWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts('New'), Texts(TranslationBase.of(context).newDes),
Container( Container(
width: 30, width: 30,
height: 30, height: 30,
@ -63,13 +64,15 @@ class DoctorResponse extends StatelessWidget {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ViewDoctorResponsesPage(doctorResponse: doctor,), page: ViewDoctorResponsesPage(
doctorResponse: doctor,
),
), ),
); );
}, },
child: Container( child: Container(
height: 70, height: 70,
margin: EdgeInsets.only(top: 8,bottom: 8), margin: EdgeInsets.only(top: 8, bottom: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
color: Colors.white, color: Colors.white,
@ -82,11 +85,15 @@ class DoctorResponse extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Texts('${doctor.doctorName}'), Texts('${doctor.doctorName}'),
SizedBox(height: 5,), SizedBox(
Texts('${doctor.requestTypeDescription}'), height: 5,
),
Texts(
'${doctor.requestTypeDescription}'),
], ],
), ),
), ),
@ -108,7 +115,7 @@ class DoctorResponse extends StatelessWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts('All'), Texts(TranslationBase.of(context).all),
Container( Container(
width: 30, width: 30,
height: 30, height: 30,
@ -130,12 +137,12 @@ class DoctorResponse extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: model.doctorResponseList.map( children: model.doctorResponseList.map(
(doctor) { (doctor) {
return InkWell( return InkWell(
onTap: () {}, onTap: () {},
child: Container( child: Container(
height: 70, height: 70,
margin: EdgeInsets.only(top: 8,bottom: 8), margin: EdgeInsets.only(top: 8, bottom: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
color: Colors.white, color: Colors.white,
@ -148,11 +155,15 @@ class DoctorResponse extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Texts('${doctor.doctorName}'), Texts('${doctor.doctorName}'),
SizedBox(height: 5,), SizedBox(
Texts('${doctor.requestTypeDescription}'), height: 5,
),
Texts(
'${doctor.requestTypeDescription}'),
], ],
), ),
), ),

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -29,7 +30,7 @@ class _RequestTypePageState extends State<RequestTypePage> {
onModelReady: (model) => model.getCallRequestTypeLOVs(), onModelReady: (model) => model.getCallRequestTypeLOVs(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Request Type', appBarTitle: TranslationBase.of(context).requestType,
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
@ -83,7 +84,7 @@ class _RequestTypePageState extends State<RequestTypePage> {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
child: NewTextFields( child: NewTextFields(
hintText: 'Enter the question here...', hintText: TranslationBase.of(context).questionHere,
minLines: 2, minLines: 2,
maxLines: 15, maxLines: 15,
onChanged: (value) { onChanged: (value) {
@ -107,19 +108,20 @@ class _RequestTypePageState extends State<RequestTypePage> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: SecondaryButton( child: SecondaryButton(
label: 'Send', label: TranslationBase.of(context).submit,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
textColor: Colors.white, textColor: Colors.white,
onTap: () { onTap: () {
model.sendRequestLOV( model
doctorList: widget.doctorList, .sendRequestLOV(
requestType: parameterCode.toString(), doctorList: widget.doctorList,
remark: question).then((value) { requestType: parameterCode.toString(),
if(model.state!=ViewState.ErrorLocal|| model.state!=ViewState.Error){ remark: question)
Navigator.pop(context); .then((value) {
} if (model.state != ViewState.ErrorLocal ||
AppToast.showErrorToast(message: "The question add fine "); model.state != ViewState.Error) {
Navigator.pop(context);
}
}); });
}, },
color: Colors.grey[800], color: Colors.grey[800],

@ -25,6 +25,7 @@ import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'active_medications/ActiveMedicationsPage.dart'; import 'active_medications/ActiveMedicationsPage.dart';
import 'allergies_page.dart';
import 'ask_doctor/ask_doctor_home_page.dart'; import 'ask_doctor/ask_doctor_home_page.dart';
import 'balance/my_balance_page.dart'; import 'balance/my_balance_page.dart';
import 'doctor/doctor_home_page.dart'; import 'doctor/doctor_home_page.dart';
@ -294,12 +295,14 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: MedicalProfileItem( child: InkWell(
title: onTap:()=> Navigator.push(context, FadePage(page: AllergiesPage())) ,
TranslationBase.of(context).allergies, child: MedicalProfileItem(
imagePath: 'medical_history_icon.png', title: TranslationBase.of(context).allergies,
subTitle: TranslationBase.of(context) imagePath: 'medical_history_icon.png',
.allergiesSubtitle, subTitle: TranslationBase.of(context)
.allergiesSubtitle,
),
), ),
), ),
]), ]),
@ -357,7 +360,6 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
//TODO
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,

@ -33,11 +33,13 @@ class CalendarUtils {
{List<DateTime> scheduleList, {List<DateTime> scheduleList,
String title, String title,
String description, String description,
List<DateTime> scheduleDateTime}) async { List<DateTime> scheduleDateTime,
List<DayOfWeek> daysOfWeek}) async {
List<Event> events = List(); List<Event> events = List();
scheduleDateTime.forEach((element) { scheduleDateTime.forEach((element) {
RecurrenceRule recurrenceRule = RecurrenceRule( RecurrenceRule recurrenceRule = RecurrenceRule(
RecurrenceFrequency.Daily, RecurrenceFrequency.Daily,
daysOfWeek: daysOfWeek,
endDate: element, endDate: element,
); );
Event event = Event(writableCalendars.id, Event event = Event(writableCalendars.id,

@ -1,3 +1,4 @@
import 'package:device_calendar/device_calendar.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
class DateUtil { class DateUtil {
@ -26,12 +27,12 @@ class DateUtil {
return start + "$milliseconds" + end; return start + "$milliseconds" + end;
} }
static String yearMonthDay(DateTime dateTime){ static String yearMonthDay(DateTime dateTime) {
String dateFormat = '${dateTime.year}-${dateTime.month}-${dateTime.day}'; String dateFormat = '${dateTime.year}-${dateTime.month}-${dateTime.day}';
return dateFormat; return dateFormat;
} }
static String time(DateTime dateTime){ static String time(DateTime dateTime) {
String dateFormat = '${dateTime.hour}:${dateTime.minute}:00'; String dateFormat = '${dateTime.hour}:${dateTime.minute}:00';
return dateFormat; return dateFormat;
} }
@ -233,4 +234,31 @@ class DateUtil {
.toString() + .toString() +
")/"; ")/";
} }
static String getDay(DayOfWeek dayOfWeek) {
switch (dayOfWeek) {
case DayOfWeek.Monday:
return "Monday";
break;
case DayOfWeek.Tuesday:
return "Tuesday";
break;
case DayOfWeek.Wednesday:
return "Wednesday";
break;
case DayOfWeek.Thursday:
return "Thursday";
break;
case DayOfWeek.Friday:
return "Friday";
break;
case DayOfWeek.Saturday:
return "Saturday";
break;
case DayOfWeek.Sunday:
return "Sunday";
break;
}
return "";
}
} }

@ -572,6 +572,23 @@ class TranslationBase {
String get power => localizedValues['Power'][locale.languageCode]; String get power => localizedValues['Power'][locale.languageCode];
String get diameter => localizedValues['Diameter'][locale.languageCode]; String get diameter => localizedValues['Diameter'][locale.languageCode];
String get remarks => localizedValues['Remarks'][locale.languageCode]; String get remarks => localizedValues['Remarks'][locale.languageCode];
String get activeMedications => localizedValues['ActiveMedications'][locale.languageCode];
String get expDate => localizedValues['ExpDate'][locale.languageCode];
String get route => localizedValues['Route'][locale.languageCode];
String get frequency => localizedValues['Frequency'][locale.languageCode];
String get dailyQuantity => localizedValues['DailyQuantity'][locale.languageCode];
String get addReminder => localizedValues['AddReminder'][locale.languageCode];
String get reminderDes => localizedValues['reminderDes'][locale.languageCode];
String get startDay => localizedValues['StartDay'][locale.languageCode];
String get endDay => localizedValues['EndDay'][locale.languageCode];
String get days => localizedValues['Days'][locale.languageCode];
String get scheduleTime => localizedValues['ScheduleTime'][locale.languageCode];
String get askDoctor => localizedValues['AskDoctor'][locale.languageCode];
String get doctorResponses => localizedValues['DoctorResponses'][locale.languageCode];
String get newDes => localizedValues['New'][locale.languageCode];
String get all => localizedValues['All'][locale.languageCode];
String get questionHere => localizedValues['QuestionHere'][locale.languageCode];
String get viewDoctorResponses => localizedValues['ViewDoctorResponses'][locale.languageCode];
} }

@ -110,11 +110,16 @@ dependencies:
#Popup_window #Popup_window
popup_box: ^0.1.0 popup_box: ^0.1.0
#datetime_picker
flutter_datetime_picker: ^1.4.0 flutter_datetime_picker: ^1.4.0
#local_notifications
flutter_local_notifications: ^1.4.4+4 flutter_local_notifications: ^1.4.4+4
#rxdart
rxdart: ^0.24.1 rxdart: ^0.24.1
#device_calendar
device_calendar: ^3.1.0 device_calendar: ^3.1.0
#Handle Geolocation #Handle Geolocation

Loading…
Cancel
Save