Merge branch 'fix_eye_balance' into 'development'

Fix eye balance

See merge request Cloud_Solution/diplomatic-quarter!293
merge-requests/294/merge
Mohammad Aljammal 4 years ago
commit 256ffd05ea

@ -17,12 +17,12 @@ const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// Pharmacy Production URLs // Pharmacy Production URLs
const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; // const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; // const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
@ -220,6 +220,10 @@ const GET_PATIENT_SHARE =
const GET_PATIENT_APPOINTMENT_HISTORY = const GET_PATIENT_APPOINTMENT_HISTORY =
"Services/Doctors.svc/REST/PateintHasAppoimentHistory"; "Services/Doctors.svc/REST/PateintHasAppoimentHistory";
const SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail";
const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail";
//URL to get patient appointment curfew history //URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
"Services/Doctors.svc/REST/AppoimentHistoryForCurfew"; "Services/Doctors.svc/REST/AppoimentHistoryForCurfew";

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import '../../../locator.dart';
import '../base_service.dart'; import '../base_service.dart';
class CustomerAddressesService extends BaseService { class CustomerAddressesService extends BaseService {
@ -9,6 +11,7 @@ class CustomerAddressesService extends BaseService {
List<AddressInfo> addressesList = List(); List<AddressInfo> addressesList = List();
CustomerInfo customerInfo; CustomerInfo customerInfo;
Future addAddressInfo({ AddNewAddressRequestModel Future addAddressInfo({ AddNewAddressRequestModel
addNewAddressRequestModel }) async { addNewAddressRequestModel }) async {
@ -25,7 +28,7 @@ class CustomerAddressesService extends BaseService {
var date = f.format(DateTime.now().toUtc()) + " GMT"; var date = f.format(DateTime.now().toUtc()) + " GMT";
addNewAddressRequestModel.customer.addresses[0].createdOnUtc = date; addNewAddressRequestModel.customer.addresses[0].createdOnUtc = date;
hasError = false; hasError = false;
await baseAppClient.post(BASE_PHARMACY_URL+ADD_ADDRESS_INFO, await baseAppClient.post(ADD_CUSTOMER_ADDRESS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
addressesList.clear(); addressesList.clear();
response["customers"][0]["addresses"].forEach((data) { response["customers"][0]["addresses"].forEach((data) {
@ -35,7 +38,7 @@ class CustomerAddressesService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: addNewAddressRequestModel.toJson(), isExternal: true, isAllowAny: true); }, body: addNewAddressRequestModel.toJson(), isAllowAny: true);
} }
Future getCustomerAddresses() async { Future getCustomerAddresses() async {

@ -115,7 +115,9 @@ class BaseAppClient {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': pharmacyToken, 'Authorization': pharmacyToken,
'Mobilenumber': user['MobileNumber'].toString(), 'Mobilenumber': user != null
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(), 'Username': user['PatientID'].toString(),
}; };
@ -237,7 +239,7 @@ class BaseAppClient {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',
'Mobilenumber': user != null 'Mobilenumber': user != null
? getPhoneNumberWithoutZero(user['MobileNumber'].toString()) ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "", : "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
@ -477,7 +479,7 @@ class BaseAppClient {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',
'Mobilenumber': user != null 'Mobilenumber': user != null
? getPhoneNumberWithoutZero(user['MobileNumber'].toString()) ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "", : "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
@ -772,7 +774,7 @@ class BaseAppClient {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',
'Mobilenumber': user != null 'Mobilenumber': user != null
? getPhoneNumberWithoutZero(user['MobileNumber'].toString()) ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "", : "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
@ -858,12 +860,3 @@ class BaseAppClient {
} }
} }
} }
getPhoneNumberWithoutZero(String number) {
String newNumber = number;
if (number.startsWith('0')) {
newNumber = number.substring(1);
}
return newNumber;
}

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class EyeService extends BaseService { class EyeService extends BaseService {
List<AppoimentAllHistoryResultList> appoimentAllHistoryResultList = List(); List<AppoimentAllHistoryResultList> appoimentAllHistoryResultList = List();
@ -23,4 +24,53 @@ class EyeService extends BaseService {
super.error = error; super.error = error;
}, body: body); }, body: body);
} }
sendGlassesPrescriptionEmail({int appointmentNo,String projectName,int projectID}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['PatientIditificationNum'] = user.patientIdentificationNo;
body['PatientName'] = user.firstName+" "+user.lastName;
body['To'] = user.emailAddress;
body['SetupID'] = user.setupID;
body['DateofBirth'] = user.dateofBirth;
body['ProjectID'] = projectID;
body['AppointmentNo'] = appointmentNo;
body['ProjectName'] = projectName;
body['PatientID'] = user.patientID;
body['PatientMobileNumber'] = Utils.getPhoneNumberWithoutZero(user.mobileNumber);
await baseAppClient.post(SEND_REPORT_EYE_EMAIL,
onSuccess: (response, statusCode) async {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
sendContactLensPrescriptionEmail({int appointmentNo,String projectName,int projectID}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['AppointmentNo'] = appointmentNo;
body['PatientIditificationNum'] = user.patientIdentificationNo;
body['PatientName'] = user.firstName+" "+user.lastName;
body['To'] = user.emailAddress;
body['SetupID'] = user.setupID;
body['DateofBirth'] = user.dateofBirth;
body['ProjectID'] = projectID;
body['AppointmentNo'] = appointmentNo;
body['ProjectName'] = projectName;
body['PatientID'] = user.patientID;
body['PatientMobileNumber'] = Utils.getPhoneNumberWithoutZero(user.mobileNumber);
await baseAppClient.post(SEND_CONTACT_LENS_PRESCRIPTION_EMAIL,
onSuccess: (response, statusCode) async {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
} }

@ -11,7 +11,7 @@ class RadiologyService extends BaseService {
hasError = false; hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = invoiceNo; body['InvoiceNo'] = invoiceNo;
body['LineItemNo'] = lineItem; body['LineIt emNo'] = lineItem;
body['ProjectID'] = projectId; body['ProjectID'] = projectId;
await baseAppClient.post(GET_RAD_IMAGE_URL, await baseAppClient.post(GET_RAD_IMAGE_URL,

@ -55,7 +55,7 @@ class Addresses {
String firstName; String firstName;
String lastName; String lastName;
String email; String email;
Null company; dynamic company;
int countryId; int countryId;
String country; String country;
Null stateProvinceId; Null stateProvinceId;
@ -64,7 +64,7 @@ class Addresses {
String address2; String address2;
String zipPostalCode; String zipPostalCode;
String phoneNumber; String phoneNumber;
Null faxNumber; dynamic faxNumber;
String customerAttributes; String customerAttributes;
String createdOnUtc; String createdOnUtc;
Null province; Null province;

@ -40,6 +40,8 @@ class HomeHealthCareViewModel extends BaseViewModel {
PharmacyModuleService _pharmacyModuleService = locator<PharmacyModuleService>(); PharmacyModuleService _pharmacyModuleService = locator<PharmacyModuleService>();
bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated; bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated;
GetHHCAllPresOrdersResponseModel pendingOrder; GetHHCAllPresOrdersResponseModel pendingOrder;
@ -136,9 +138,13 @@ class HomeHealthCareViewModel extends BaseViewModel {
{AddNewAddressRequestModel addNewAddressRequestModel}) async { {AddNewAddressRequestModel addNewAddressRequestModel}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _pharmacyModuleService.generatePharmacyToken().then((value) async{
await _customerAddressesService.addAddressInfo( await _customerAddressesService.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel addNewAddressRequestModel: addNewAddressRequestModel
); );
});
if (_customerAddressesService.hasError) { if (_customerAddressesService.hasError) {
error = _customerAddressesService.error; error = _customerAddressesService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -43,4 +43,34 @@ class EyeViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
sendGlassesPrescriptionEmail({int appointmentNo, String projectName, int projectID}) async {
setState(ViewState.Busy);
await _eyeService.sendGlassesPrescriptionEmail(
appointmentNo: appointmentNo,
projectID: projectID,
projectName: projectName);
if (_eyeService.hasError) {
error = _eyeService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
sendContactLensPrescriptionEmail({int appointmentNo, String projectName, int projectID}) async {
setState(ViewState.Busy);
await _eyeService.sendContactLensPrescriptionEmail(
appointmentNo: appointmentNo,
projectID: projectID,
projectName: projectName);
if (_eyeService.hasError) {
error = _eyeService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
} }

@ -122,6 +122,7 @@ class _LocationPageState
} }
}); });
await model.addAddressInfo( await model.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel); addNewAddressRequestModel: addNewAddressRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
@ -130,7 +131,7 @@ class _LocationPageState
AppToast.showSuccessToast( AppToast.showSuccessToast(
message: "Address Added Successfully"); message: "Address Added Successfully");
} }
Navigator.of(context).pop(); Navigator.of(context).pop(addNewAddressRequestModel);
}, },
label: TranslationBase.of(context).addNewAddress, label: TranslationBase.of(context).addNewAddress,
), ),

@ -237,7 +237,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10, height: 90,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(18), padding: EdgeInsets.all(18),
child: SecondaryButton( child: SecondaryButton(

@ -49,7 +49,7 @@ class MyBalancePage extends StatelessWidget {
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Colors.red[700],
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
), ),
@ -79,7 +79,7 @@ class MyBalancePage extends StatelessWidget {
height: 65, height: 65,
margin: EdgeInsets.only(top: 8), margin: EdgeInsets.only(top: 8),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Colors.white,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
), ),

@ -1,17 +1,28 @@
import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/dialogs/confirm_send_email_dialog.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';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ClassesPage extends StatelessWidget { class ClassesPage extends StatelessWidget {
final ListHISGetGlassPerscription glassPerscription; final ListHISGetGlassPerscription glassPerscription;
final int appointmentNo;
final String projectName;
final int projectID;
const ClassesPage({Key key, this.glassPerscription}) : super(key: key); const ClassesPage(
{Key key,
this.glassPerscription,
this.appointmentNo,
this.projectName,
this.projectID})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -38,11 +49,16 @@ class ClassesPage extends StatelessWidget {
bold: true, bold: true,
), ),
), ),
getRow(TranslationBase.of(context).sphere, '${glassPerscription.rightEyeSpherical}', '-'), getRow(TranslationBase.of(context).sphere,
getRow(TranslationBase.of(context).cylinder, '${glassPerscription.rightEyeCylinder}', '-'), '${glassPerscription.rightEyeSpherical}', '-'),
getRow(TranslationBase.of(context).axis, '${glassPerscription.rightEyeAxis}', '-'), getRow(TranslationBase.of(context).cylinder,
getRow(TranslationBase.of(context).prism, '${glassPerscription.rightEyePrism}', '-'), '${glassPerscription.rightEyeCylinder}', '-'),
getRow(TranslationBase.of(context).va, '${glassPerscription.rightEyeVA}', '-'), getRow(TranslationBase.of(context).axis,
'${glassPerscription.rightEyeAxis}', '-'),
getRow(TranslationBase.of(context).prism,
'${glassPerscription.rightEyePrism}', '-'),
getRow(TranslationBase.of(context).va,
'${glassPerscription.rightEyeVA}', '-'),
], ],
), ),
), ),
@ -65,11 +81,16 @@ class ClassesPage extends StatelessWidget {
bold: true, bold: true,
), ),
), ),
getRow(TranslationBase.of(context).sphere, '${glassPerscription.leftEyeSpherical}', '-'), getRow(TranslationBase.of(context).sphere,
getRow(TranslationBase.of(context).cylinder, '${glassPerscription.leftEyeCylinder}', '-'), '${glassPerscription.leftEyeSpherical}', '-'),
getRow(TranslationBase.of(context).axis, '${glassPerscription.leftEyeAxis}', '-'), getRow(TranslationBase.of(context).cylinder,
getRow(TranslationBase.of(context).prism, '${glassPerscription.leftEyePrism}', '-'), '${glassPerscription.leftEyeCylinder}', '-'),
getRow(TranslationBase.of(context).va, '${glassPerscription.leftEyeVA}', '-'), getRow(TranslationBase.of(context).axis,
'${glassPerscription.leftEyeAxis}', '-'),
getRow(TranslationBase.of(context).prism,
'${glassPerscription.leftEyePrism}', '-'),
getRow(TranslationBase.of(context).va,
'${glassPerscription.leftEyeVA}', '-'),
], ],
), ),
), ),
@ -80,6 +101,16 @@ class ClassesPage extends StatelessWidget {
width: double.infinity, width: double.infinity,
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).sendEmail, label: TranslationBase.of(context).sendEmail,
onTap: () {
showConfirmMessage(context, () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.sendGlassesPrescriptionEmail(
appointmentNo: appointmentNo,
projectName: projectName,
projectID: projectID);
GifLoaderDialogUtils.hideDialog(context);
}, model.user.emailAddress);
},
textColor: Colors.white, textColor: Colors.white,
color: Colors.red[700], color: Colors.red[700],
icon: Icon( icon: Icon(
@ -96,6 +127,19 @@ class ClassesPage extends StatelessWidget {
); );
} }
void showConfirmMessage(
BuildContext context, GestureTapCallback onTap, String email) {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: email,
onTapSendEmail: () {
onTap();
},
),
);
}
Widget getRow(String title, String val1, String val2) => Padding( Widget getRow(String title, String val1, String val2) => Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -113,7 +157,7 @@ class ClassesPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Texts(val1 == 'null' ? '-' : val1), Texts(val1 == 'null' ? '-' : val1),
Texts(val2 != 'null' ? '-' :val2), Texts(val2 != 'null' ? '-' : val2),
], ],
), ),
) )

@ -1,8 +1,12 @@
import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.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/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/dialogs/confirm_send_email_dialog.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';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -10,14 +14,24 @@ import 'package:provider/provider.dart';
class ContactLensPage extends StatelessWidget { class ContactLensPage extends StatelessWidget {
final ListHISGetContactLensPerscription listHISGetContactLensPerscription; final ListHISGetContactLensPerscription listHISGetContactLensPerscription;
final int appointmentNo;
final String projectName;
final int projectID;
const ContactLensPage({Key key, this.listHISGetContactLensPerscription}) const ContactLensPage(
{Key key,
this.listHISGetContactLensPerscription,
this.appointmentNo,
this.projectName,
this.projectID})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return BaseView<EyeViewModel>(
builder: (_,model,w)=>
AppScaffold(
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15), margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15),
@ -39,16 +53,20 @@ class ContactLensPage extends StatelessWidget {
bold: true, bold: true,
), ),
), ),
getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'), getRow(TranslationBase.of(context).brand,
getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'), '${listHISGetContactLensPerscription.brand}'),
getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'), getRow('B.C',
getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'), '${listHISGetContactLensPerscription.baseCurve}'),
getRow(TranslationBase.of(context).power,
'${listHISGetContactLensPerscription.power}'),
getRow(TranslationBase.of(context).diameter,
'${listHISGetContactLensPerscription.diameter}'),
getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), getRow('OZ', '${listHISGetContactLensPerscription.oZ}'),
getRow('CT', '${listHISGetContactLensPerscription.cT}'), getRow('CT', '${listHISGetContactLensPerscription.cT}'),
getRow('Blend', '${listHISGetContactLensPerscription.blend}'), getRow(
getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}'), 'Blend', '${listHISGetContactLensPerscription.blend}'),
getRow(TranslationBase.of(context).reminder,
'${listHISGetContactLensPerscription.remarks}'),
], ],
), ),
), ),
@ -71,27 +89,43 @@ class ContactLensPage extends StatelessWidget {
bold: true, bold: true,
), ),
), ),
getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'), getRow(TranslationBase.of(context).brand,
getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'), '${listHISGetContactLensPerscription.brand}'),
getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'), getRow('B.C',
getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'), '${listHISGetContactLensPerscription.baseCurve}'),
getRow(TranslationBase.of(context).power,
'${listHISGetContactLensPerscription.power}'),
getRow(TranslationBase.of(context).diameter,
'${listHISGetContactLensPerscription.diameter}'),
getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), getRow('OZ', '${listHISGetContactLensPerscription.oZ}'),
getRow('CT', '${listHISGetContactLensPerscription.cT}'), getRow('CT', '${listHISGetContactLensPerscription.cT}'),
getRow('Blend', '${listHISGetContactLensPerscription.blend}'), getRow(
getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}'), 'Blend', '${listHISGetContactLensPerscription.blend}'),
getRow(TranslationBase.of(context).reminder,
'${listHISGetContactLensPerscription.remarks}'),
], ],
), ),
), ),
SizedBox( SizedBox(
height: 17, height: 17,
), ),
if(projectViewModel.havePrivilege(15)) if (projectViewModel.havePrivilege(15))
Container( Container(
width: double.infinity, width: double.infinity,
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).sendEmail, label: TranslationBase.of(context).sendEmail,
textColor: Colors.white, textColor: Colors.white,
color: Colors.red[700], color: Colors.red[700],
onTap: (){
showConfirmMessage(context, () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.sendContactLensPrescriptionEmail(
appointmentNo: appointmentNo,
projectName: projectName,
projectID: projectID);
GifLoaderDialogUtils.hideDialog(context);
}, model.user.emailAddress);
},
icon: Icon( icon: Icon(
Icons.email, Icons.email,
color: Colors.white, color: Colors.white,
@ -102,6 +136,7 @@ class ContactLensPage extends StatelessWidget {
), ),
), ),
), ),
),
); );
} }
@ -130,4 +165,18 @@ class ContactLensPage extends StatelessWidget {
], ],
), ),
); );
void showConfirmMessage(
BuildContext context, GestureTapCallback onTap, String email) {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: email,
onTapSendEmail: () {
onTap();
},
),
);
}
} }

@ -43,6 +43,7 @@ class _EyeHomePageState extends State<EyeHomePage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).measurements, appBarTitle: TranslationBase.of(context).measurements,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
@ -81,13 +82,13 @@ class _EyeHomePageState extends State<EyeHomePage>
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.27, width: MediaQuery.of(context).size.width * 0.40,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).classes), child: Texts(TranslationBase.of(context).classes),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.27, width: MediaQuery.of(context).size.width * 0.40,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).contactLens), child: Texts(TranslationBase.of(context).contactLens),
), ),
@ -110,11 +111,15 @@ class _EyeHomePageState extends State<EyeHomePage>
ClassesPage( ClassesPage(
glassPerscription: widget.appointmentAllHistoryResultList glassPerscription: widget.appointmentAllHistoryResultList
.listHISGetGlassPerscription[0], .listHISGetGlassPerscription[0],
appointmentNo: widget.appointmentAllHistoryResultList.appointmentNo,
projectName: widget.appointmentAllHistoryResultList.projectName,
projectID: widget.appointmentAllHistoryResultList.projectID,
), ),
ContactLensPage( ContactLensPage(
listHISGetContactLensPerscription: widget listHISGetContactLensPerscription: widget.appointmentAllHistoryResultList.listHISGetContactLensPerscription[0],
.appointmentAllHistoryResultList appointmentNo: widget.appointmentAllHistoryResultList.appointmentNo,
.listHISGetContactLensPerscription[0], projectName: widget.appointmentAllHistoryResultList.projectName,
projectID: widget.appointmentAllHistoryResultList.projectID,
) )
], ],
), ),

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/PrescriptionDeliveryViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/PrescriptionDeliveryViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
@ -212,7 +213,51 @@ class _PrescriptionDeliveryAddressPageState
latitude: latitude, latitude: latitude,
longitude: longitude, longitude: longitude,
)), )),
).then((value) {
if (value != null &&
value is AddNewAddressRequestModel) {
setState(() {
_selectedAddress = AddressInfo(
id: value.customer.id.toString(),
email: value.customer.email,
firstName: value.customer.addresses[0].firstName,
lastName: value.customer.addresses[0].lastName,
address1: value.customer.addresses[0].address1,
address2: value.customer.addresses[0].address2,
city: value.customer.addresses[0].city,
country: value.customer.addresses[0].country,
phoneNumber: value.customer.addresses[0].phoneNumber,
latLong: value.customer.addresses[0].latLong,
company: value.customer.addresses[0].company,
countryId: value.customer.addresses[0].countryId,
createdOnUtc: value.customer.addresses[0].createdOnUtc,
customerAttributes: value.customer.addresses[0].customerAttributes,
faxNumber: value.customer.addresses[0].faxNumber,
province: value.customer.addresses[0].province,
stateProvinceId: value.customer.addresses[0].stateProvinceId,
zipPostalCode: value.customer.addresses[0].zipPostalCode,
); );
List latLongArr = _selectedAddress.latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
markers = Set();
markers.add(
Marker(
markerId: MarkerId(
_selectedAddress.latLong.hashCode.toString(),
),
position: LatLng(latitude, longitude),
),
);
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
});
}
});
}, },
), ),
), ),

@ -106,26 +106,26 @@ class _HomeReportPageState extends State<HomeReportPage>
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.15, width: MediaQuery.of(context).size.width * 0.20,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).requested,fontSize: 11,), child: Texts(TranslationBase.of(context).requested,fontSize: 11,),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.15, width: MediaQuery.of(context).size.width * 0.20,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).ready,fontSize: 11,), child: Texts(TranslationBase.of(context).ready,fontSize: 11,),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.15, width: MediaQuery.of(context).size.width * 0.20,
child: Center( child: Center(
child: child:
Texts(TranslationBase.of(context).completed,fontSize: 11,), Texts(TranslationBase.of(context).completed,fontSize: 11,),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.15, width: MediaQuery.of(context).size.width * 0.20,
child: Center( child: Center(
child: child:
Texts(TranslationBase.of(context).cancelled,fontSize: 11,), Texts(TranslationBase.of(context).cancelled,fontSize: 11,),

@ -48,9 +48,7 @@ class MedicalReports extends StatelessWidget {
)), )),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Container(
flex: 1,
child: Container(
margin: EdgeInsets.only(left: 5, right: 5), margin: EdgeInsets.only(left: 5, right: 5),
child: LargeAvatar( child: LargeAvatar(
width: 50, width: 50,
@ -59,7 +57,6 @@ class MedicalReports extends StatelessWidget {
url: model.appointHistoryList[index].doctorImageURL, url: model.appointHistoryList[index].doctorImageURL,
), ),
), ),
),
Expanded( Expanded(
flex: 4, flex: 4,
child: Padding( child: Padding(
@ -85,13 +82,11 @@ class MedicalReports extends StatelessWidget {
), ),
), ),
), ),
Expanded( InkWell(
flex: 1,
child: InkWell(
onTap: () => onTap: () =>
confirmBox(model.appointHistoryList[index], model), confirmBox(model.appointHistoryList[index], model),
child: Container( child: Container(
width: 85, width: 120,
height: 50, height: 50,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.black54, color: Colors.black54,
@ -111,7 +106,6 @@ class MedicalReports extends StatelessWidget {
), ),
), ),
), ),
),
SizedBox( SizedBox(
width: 12, width: 12,
), ),

@ -81,7 +81,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
height: 20, height: 20,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
color: Colors.grey), color: Colors.red),
), ),
SizedBox(width: 5,), SizedBox(width: 5,),
Texts(TranslationBase.of(context).diastolicLng) Texts(TranslationBase.of(context).diastolicLng)
@ -125,7 +125,6 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
fontSize: 10, fontSize: 10,
), ),
rotateAngle: -65, rotateAngle: -65,
//rotateAngle:-65,
margin: 22, margin: 22,
getTitles: (value) { getTitles: (value) {
if (timeSeries1.length < 15) { if (timeSeries1.length < 15) {

@ -117,7 +117,7 @@ class PaymentService extends StatelessWidget {
) )
], ],
), ),
// if(!projectViewModel.havePrivilege(33)) //if(!projectViewModel.havePrivilege(33))
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

Loading…
Cancel
Save