Merge branch 'development_new_design_2.0' into haroon-new-design

merge-update-with-lab-changes
haroon amjad 4 years ago
commit af7b27258c

@ -19,8 +19,7 @@ class BloodSugarService extends BaseService {
hasError = false;
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_DIABETIC_RESULT_AVERAGE,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_DIABETIC_RESULT_AVERAGE, onSuccess: (dynamic response, int statusCode) {
monthDiabtectResultAverageList.clear();
weekDiabtectResultAverageList.clear();
yearDiabtecResultAverageList.clear();
@ -30,18 +29,15 @@ class BloodSugarService extends BaseService {
yearDiabtecPatientResult.clear();
response['List_MonthDiabtectResultAverage'].forEach((item) {
monthDiabtectResultAverageList
.add(MonthDiabtectResultAverage.fromJson(item));
monthDiabtectResultAverageList.add(MonthDiabtectResultAverage.fromJson(item));
});
response['List_WeekDiabtectResultAverage'].forEach((item) {
weekDiabtectResultAverageList
.add(WeekDiabtectResultAverage.fromJson(item));
weekDiabtectResultAverageList.add(WeekDiabtectResultAverage.fromJson(item));
});
response['List_YearDiabtecResultAverage'].forEach((item) {
yearDiabtecResultAverageList
.add(YearDiabtecResultAverage.fromJson(item));
yearDiabtecResultAverageList.add(YearDiabtecResultAverage.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -51,8 +47,7 @@ class BloodSugarService extends BaseService {
Future getDiabtecResults() async {
hasError = false;
await baseAppClient.post(GET_DIABTEC_RESULT,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_DIABTEC_RESULT, onSuccess: (dynamic response, int statusCode) {
monthDiabtecPatientResult.clear();
weekDiabtecPatientResult.clear();
yearDiabtecPatientResult.clear();
@ -69,7 +64,6 @@ class BloodSugarService extends BaseService {
yearDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: Map());
}
@ -81,17 +75,15 @@ class BloodSugarService extends BaseService {
body['BloodSugerDateChart'] = bloodSugerDateChart;
body['BloodSugerResult'] = bloodSugerResult;
body['DiabtecUnit'] = diabtecUnit;
body['MeasuredTime'] = measuredTime+1;
body['MeasuredTime'] = measuredTime + 1;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(ADD_DIABTEC_RESULT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
await baseAppClient.post(ADD_DIABTEC_RESULT, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
updateDiabtecResult({DateTime month,DateTime hour,String bloodSugerResult,String diabtecUnit, int measuredTime,int lineItemNo}) async {
updateDiabtecResult({DateTime month, DateTime hour, String bloodSugerResult, String diabtecUnit, int measuredTime, int lineItemNo}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
@ -99,11 +91,9 @@ class BloodSugarService extends BaseService {
body['DiabtecUnit'] = diabtecUnit;
body['BloodSugerDateChart'] = '${month.year}-${month.month}-${month.day} ${hour.hour}:${hour.minute}:00';
body['isDentalAllowedBackend'] = false;
body['MeasuredTime'] = measuredTime+1;
body['MeasuredTime'] = measuredTime + 1;
body['LineItemNo'] = lineItemNo;
await baseAppClient.post(UPDATE_DIABETIC_RESULT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
await baseAppClient.post(UPDATE_DIABETIC_RESULT, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
@ -115,25 +105,21 @@ class BloodSugarService extends BaseService {
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['To'] = user.emailAddress;
await baseAppClient.post(SEND_AVERAGE_BLOOD_SUGAR_REPORT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
await baseAppClient.post(SEND_AVERAGE_BLOOD_SUGAR_REPORT, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future deactivateDiabeticStatus({int lineItemNo }) async {
hasError = false;
Future deactivateDiabeticStatus({int lineItemNo}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['LineItemNo'] =lineItemNo;
await baseAppClient.post(DEACTIVATE_DIABETIC_STATUS,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
body['LineItemNo'] = lineItemNo;
await baseAppClient.post(DEACTIVATE_DIABETIC_STATUS, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -16,7 +16,7 @@ class PrescriptionsService extends BaseService {
List<Prescriptions> prescriptionsList = List();
List<PrescriptionReportINP> prescriptionReportListINP = List();
List<PrescriptionsOrder> prescriptionsOrderList = List();
var isMedDeliveryAllowed;
Future getPrescriptions() async {
hasError = false;
Map<String, dynamic> body = Map();
@ -46,8 +46,7 @@ class PrescriptionsService extends BaseService {
}, body: body);
}
RequestPrescriptionReport _requestPrescriptionReport =
RequestPrescriptionReport(appointmentNo: 0, isDentalAllowedBackend: false);
RequestPrescriptionReport _requestPrescriptionReport = RequestPrescriptionReport(appointmentNo: 0, isDentalAllowedBackend: false);
List<PrescriptionReport> prescriptionReportList = List();
Future getPrescriptionReport({Prescriptions prescriptions}) async {
@ -63,10 +62,10 @@ class PrescriptionsService extends BaseService {
_requestPrescriptionReport.episodeID = prescriptions.episodeID;
_requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo;
await baseAppClient.post(prescriptions.isInOutPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(prescriptions.isInOutPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT, onSuccess: (dynamic response, int statusCode) {
prescriptionReportList.clear();
prescriptionReportEnhList.clear();
isMedDeliveryAllowed = response['IsHomeMedicineDeliverySupported'];
if (prescriptions.isInOutPatient) {
response['ListPRM'].forEach((prescriptions) {
prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions));
@ -88,8 +87,7 @@ class PrescriptionsService extends BaseService {
isDentalAllowedBackend: false,
);
Future sendPrescriptionEmail(
String appointmentDate, int patientID, String clinicName, String doctorName, int doctorID, int projectID) async {
Future sendPrescriptionEmail(String appointmentDate, int patientID, String clinicName, String doctorName, int doctorID, int projectID) async {
_requestSendPrescriptionEmail.listPrescriptions = prescriptionReportList;
_requestSendPrescriptionEmail.appointmentDate = appointmentDate;
_requestSendPrescriptionEmail.patientID = patientID;
@ -105,15 +103,13 @@ class PrescriptionsService extends BaseService {
_requestSendPrescriptionEmail.setupID = user.setupID;
_requestSendPrescriptionEmail.to = user.emailAddress;
hasError = false;
await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) {},
onFailure: (String error, int statusCode) {
await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestSendPrescriptionEmail.toJson());
}
RequestGetListPharmacyForPrescriptions requestGetListPharmacyForPrescriptions =
RequestGetListPharmacyForPrescriptions(
RequestGetListPharmacyForPrescriptions requestGetListPharmacyForPrescriptions = RequestGetListPharmacyForPrescriptions(
latitude: 0,
longitude: 0,
isDentalAllowedBackend: false,
@ -172,8 +168,7 @@ class PrescriptionsService extends BaseService {
hasError = false;
await baseAppClient.post(isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT, onSuccess: (dynamic response, int statusCode) {
prescriptionReportEnhList.clear();
if (isInPatient) {
@ -201,8 +196,7 @@ class PrescriptionsService extends BaseService {
body['RejectionReason'] = '';
body['PresOrderStatus'] = 4;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_PRESS_ORDER, onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
await baseAppClient.post(UPDATE_PRESS_ORDER, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);

@ -30,9 +30,8 @@ class PrescriptionsViewModel extends BaseViewModel {
List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionsList> get prescriptionsOrderList =>
filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital;
List<PrescriptionsList> get prescriptionsOrderList => filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital;
get isMedDeliveryAllowed => _prescriptionsService.isMedDeliveryAllowed;
getPrescriptions() async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptions();
@ -49,17 +48,12 @@ class PrescriptionsViewModel extends BaseViewModel {
void _filterList() {
_prescriptionsService.prescriptionsList.forEach((element) {
/// PrescriptionsList list sort clinic
List<PrescriptionsList> prescriptionsByClinic = _prescriptionsOrderListClinic
.where((elementClinic) => elementClinic.filterName == element.clinicDescription)
.toList();
List<PrescriptionsList> prescriptionsByClinic = _prescriptionsOrderListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList();
if (prescriptionsByClinic.length != 0) {
_prescriptionsOrderListClinic[_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])]
.prescriptionsList
.add(element);
_prescriptionsOrderListClinic[_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])].prescriptionsList.add(element);
} else {
_prescriptionsOrderListClinic
.add(PrescriptionsList(filterName: element.clinicDescription, prescriptions: element));
_prescriptionsOrderListClinic.add(PrescriptionsList(filterName: element.clinicDescription, prescriptions: element));
}
/// PrescriptionsList list sort via hospital
@ -70,9 +64,7 @@ class PrescriptionsViewModel extends BaseViewModel {
.toList();
if (prescriptionsByHospital.length != 0) {
_prescriptionsOrderListHospital[_prescriptionsOrderListHospital.indexOf(prescriptionsByHospital[0])]
.prescriptionsList
.add(element);
_prescriptionsOrderListHospital[_prescriptionsOrderListHospital.indexOf(prescriptionsByHospital[0])].prescriptionsList.add(element);
} else {
_prescriptionsOrderListHospital.add(PrescriptionsList(filterName: element.name, prescriptions: element));
}
@ -105,17 +97,9 @@ class PrescriptionsViewModel extends BaseViewModel {
}
}
sendPrescriptionEmail(
{String appointmentDate,
int patientID,
String clinicName,
String doctorName,
int doctorID,
String mes,
int projectID}) async {
sendPrescriptionEmail({String appointmentDate, int patientID, String clinicName, String doctorName, int doctorID, String mes, int projectID}) async {
setState(ViewState.BusyLocal);
await _prescriptionsService.sendPrescriptionEmail(
appointmentDate, patientID, clinicName, doctorName, doctorID, projectID);
await _prescriptionsService.sendPrescriptionEmail(appointmentDate, patientID, clinicName, doctorName, doctorID, projectID);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);

@ -18,7 +18,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import '../../../widgets/dialogs/confirm_send_email_dialog.dart';
import 'PrescriptionIDeliveryAddressPage.dart';
@ -303,25 +303,29 @@ class PrescriptionItemsPage extends StatelessWidget {
),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).resendOrder,
() {
Navigator.push(
context,
FadePage(
page: PrescriptionDeliveryAddressPage(
prescriptions: prescriptions,
prescriptionReportList: model.prescriptionReportList,
prescriptionReportEnhList: model.prescriptionReportEnhList,
width: double.infinity,
padding: EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 20),
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
child: SecondaryButton(
label: TranslationBase.of(context).resendOrder,
disabled: (!projectViewModel.havePrivilege(62)) || projectViewModel.user.outSA == 1 || model.isMedDeliveryAllowed == false,
onTap: () {
Navigator.push(
context,
FadePage(
page: PrescriptionDeliveryAddressPage(
prescriptions: prescriptions,
prescriptionReportList: model.prescriptionReportList,
prescriptionReportEnhList: model.prescriptionReportEnhList,
),
),
),
);
},
color: Color(0xff359846),
);
},
color: Color(0xff359846),
),
),
),
)
],
),
),

@ -48,6 +48,7 @@ class _AppDrawerState extends State<AppDrawer> {
@override
void initState() {
super.initState();
checkUserData();
}
@ -467,6 +468,7 @@ class _AppDrawerState extends State<AppDrawer> {
this.mainUser = data2;
});
}
notificationCount = await sharedPref.getString(NOTIFICATION_COUNT);
}
logout() async {

Loading…
Cancel
Save