Merge branch 'Haroon' into 'development'

Haroon

See merge request Cloud_Solution/diplomatic-quarter!372
merge-update-with-lab-changes
haroon amjad 5 years ago
commit 1db2f9ab03

@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // 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/';
@ -79,6 +79,12 @@ const GET_Patient_LAB_RESULT =
'Services/Patients.svc/REST/GetPatientLabResults'; 'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT = const GET_Patient_LAB_ORDERS_RESULT =
'Services/Patients.svc/REST/GetPatientLabOrdersResults'; 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const SEND_COVID_LAB_RESULT_EMAIL =
'Services/Notifications.svc/REST/GenerateCOVIDReport';
const COVID_PASSPORT_UPDATE =
'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate';
const GET_PATIENT_PASSPORT_NUMBER =
'Services/Patients.svc/REST/Covid19_Certificate_GetPassport';
/// ///
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';

@ -1349,4 +1349,9 @@ const Map localizedValues = {
"book-video-livecare-2": {"en": "I don't need to visit the clinic", "ar": "اتصال فيديو لا احتاج الحضور الى العيادة"}, "book-video-livecare-2": {"en": "I don't need to visit the clinic", "ar": "اتصال فيديو لا احتاج الحضور الى العيادة"},
"no-thankyou": {"en": "No Thanks", "ar": "لا شكرا"}, "no-thankyou": {"en": "No Thanks", "ar": "لا شكرا"},
"visit-clinic": {"en": "Schedule appointment with the doctor", "ar": "ارغب في حجز موعد مجدول مع الطبيب"}, "visit-clinic": {"en": "Schedule appointment with the doctor", "ar": "ارغب في حجز موعد مجدول مع الطبيب"},
"generate-covid-certificate": {"en": "Generate Covid-19 Certificate", "ar": "إنشاء شهادة كورونا"},
"is-report-outside-ksa": {"en": "Is the certificate needed for outside KSA?", "ar": "هل الشهادة مطلوبة من خارج المملكة؟"},
"passport-number": {"en": "Passport Number", "ar": "رقم جواز السفر"},
"enter-passport-number": {"en": "Please confirm or update your passport number:", "ar": "الرجاء تأكيد أو تحديث رقم جواز السفر الخاص بك:"},
"valid-passport-number": {"en": "Please enter valid passport number", "ar": "الرجاء إدخال رقم جواز سفر صالح"},
}; };

@ -1,36 +1,55 @@
class LabResultList {
String filterName = "";
List<LabResult> patientLabResultList = List();
LabResultList({this.filterName, LabResult lab}) {
patientLabResultList.add(lab);
}
}
class LabResult { class LabResult {
String description; String description;
dynamic femaleInterpretativeData; Null femaleInterpretativeData;
int gender; int gender;
bool isCertificateAllowed;
int lineItemNo; int lineItemNo;
dynamic maleInterpretativeData; Null maleInterpretativeData;
String notes; Null notes;
int orderLineItemNo;
int orderNo;
String packageID; String packageID;
int patientID; int patientID;
String projectID; String projectID;
String referanceRange; String referanceRange;
String resultValue; String resultValue;
int resultValueBasedLineItemNo;
String resultValueFlag;
String sampleCollectedOn; String sampleCollectedOn;
String sampleReceivedOn; String sampleReceivedOn;
String setupID; String setupID;
dynamic superVerifiedOn; Null superVerifiedOn;
String testCode; String testCode;
String uOM; String uOM;
String verifiedOn; String verifiedOn;
dynamic verifiedOnDateTime; Null verifiedOnDateTime;
LabResult( LabResult(
{this.description, {this.description,
this.femaleInterpretativeData, this.femaleInterpretativeData,
this.gender, this.gender,
this.isCertificateAllowed,
this.lineItemNo, this.lineItemNo,
this.maleInterpretativeData, this.maleInterpretativeData,
this.notes, this.notes,
this.orderLineItemNo,
this.orderNo,
this.packageID, this.packageID,
this.patientID, this.patientID,
this.projectID, this.projectID,
this.referanceRange, this.referanceRange,
this.resultValue, this.resultValue,
this.resultValueBasedLineItemNo,
this.resultValueFlag,
this.sampleCollectedOn, this.sampleCollectedOn,
this.sampleReceivedOn, this.sampleReceivedOn,
this.setupID, this.setupID,
@ -44,14 +63,19 @@ class LabResult {
description = json['Description']; description = json['Description'];
femaleInterpretativeData = json['FemaleInterpretativeData']; femaleInterpretativeData = json['FemaleInterpretativeData'];
gender = json['Gender']; gender = json['Gender'];
isCertificateAllowed = json['IsCertificateAllowed'];
lineItemNo = json['LineItemNo']; lineItemNo = json['LineItemNo'];
maleInterpretativeData = json['MaleInterpretativeData']; maleInterpretativeData = json['MaleInterpretativeData'];
notes = json['Notes']; notes = json['Notes'];
orderLineItemNo = json['OrderLineItemNo'];
orderNo = json['OrderNo'];
packageID = json['PackageID']; packageID = json['PackageID'];
patientID = json['PatientID']; patientID = json['PatientID'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
referanceRange = json['ReferanceRange']; referanceRange = json['ReferanceRange'];
resultValue = json['ResultValue']; resultValue = json['ResultValue'];
resultValueBasedLineItemNo = json['ResultValueBasedLineItemNo'];
resultValueFlag = json['ResultValueFlag'];
sampleCollectedOn = json['SampleCollectedOn']; sampleCollectedOn = json['SampleCollectedOn'];
sampleReceivedOn = json['SampleReceivedOn']; sampleReceivedOn = json['SampleReceivedOn'];
setupID = json['SetupID']; setupID = json['SetupID'];
@ -67,14 +91,19 @@ class LabResult {
data['Description'] = this.description; data['Description'] = this.description;
data['FemaleInterpretativeData'] = this.femaleInterpretativeData; data['FemaleInterpretativeData'] = this.femaleInterpretativeData;
data['Gender'] = this.gender; data['Gender'] = this.gender;
data['IsCertificateAllowed'] = this.isCertificateAllowed;
data['LineItemNo'] = this.lineItemNo; data['LineItemNo'] = this.lineItemNo;
data['MaleInterpretativeData'] = this.maleInterpretativeData; data['MaleInterpretativeData'] = this.maleInterpretativeData;
data['Notes'] = this.notes; data['Notes'] = this.notes;
data['OrderLineItemNo'] = this.orderLineItemNo;
data['OrderNo'] = this.orderNo;
data['PackageID'] = this.packageID; data['PackageID'] = this.packageID;
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['ReferanceRange'] = this.referanceRange; data['ReferanceRange'] = this.referanceRange;
data['ResultValue'] = this.resultValue; data['ResultValue'] = this.resultValue;
data['ResultValueBasedLineItemNo'] = this.resultValueBasedLineItemNo;
data['ResultValueFlag'] = this.resultValueFlag;
data['SampleCollectedOn'] = this.sampleCollectedOn; data['SampleCollectedOn'] = this.sampleCollectedOn;
data['SampleReceivedOn'] = this.sampleReceivedOn; data['SampleReceivedOn'] = this.sampleReceivedOn;
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
@ -86,13 +115,3 @@ class LabResult {
return data; return data;
} }
} }
class LabResultList {
String filterName = "";
List<LabResult> patientLabResultList = List();
LabResultList({this.filterName, LabResult lab}) {
patientLabResultList.add(lab);
}
}

@ -3,11 +3,9 @@ import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart';
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_special_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/request_send_lab_report_email.dart'; import 'package:diplomaticquarterapp/core/model/labs/request_send_lab_report_email.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class LabsService extends BaseService { class LabsService extends BaseService {
List<PatientLabOrders> patientLabOrdersList = List(); List<PatientLabOrders> patientLabOrdersList = List();
@ -16,8 +14,7 @@ class LabsService extends BaseService {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_Patient_LAB_ORDERS, await baseAppClient.post(GET_Patient_LAB_ORDERS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
patientLabOrdersList.clear(); patientLabOrdersList.clear();
response['ListPLO'].forEach((hospital) { response['ListPLO'].forEach((hospital) {
patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); patientLabOrdersList.add(PatientLabOrders.fromJson(hospital));
@ -28,26 +25,20 @@ class LabsService extends BaseService {
}, body: body); }, body: body);
} }
RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult();
RequestPatientLabSpecialResult();
List<PatientLabSpecialResult> patientLabSpecialResult = List(); List<PatientLabSpecialResult> patientLabSpecialResult = List();
List<LabResult> labResultList = List(); List<LabResult> labResultList = List();
List<LabOrderResult> labOrdersResultsList = List(); List<LabOrderResult> labOrdersResultsList = List();
Future getLaboratoryResult( Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo}) async {
{String projectID,
int clinicID,
String invoiceNo,
String orderNo}) async {
hasError = false; hasError = false;
_requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.projectID = projectID;
_requestPatientLabSpecialResult.clinicID = clinicID; _requestPatientLabSpecialResult.clinicID = clinicID;
_requestPatientLabSpecialResult.invoiceNo = invoiceNo; _requestPatientLabSpecialResult.invoiceNo = invoiceNo;
_requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.orderNo = orderNo;
await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT, await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear(); patientLabSpecialResult.clear();
response['ListPLSR'].forEach((hospital) { response['ListPLSR'].forEach((hospital) {
patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital));
@ -67,8 +58,7 @@ class LabsService extends BaseService {
body['SetupID'] = patientLabOrder.setupID; body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = patientLabOrder.projectID; body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID; body['ClinicID'] = patientLabOrder.clinicID;
await baseAppClient.post(GET_Patient_LAB_RESULT, await baseAppClient.post(GET_Patient_LAB_RESULT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear(); patientLabSpecialResult.clear();
labResultList.clear(); labResultList.clear();
response['ListPLR'].forEach((lab) { response['ListPLR'].forEach((lab) {
@ -80,6 +70,64 @@ class LabsService extends BaseService {
}, body: body); }, body: body);
} }
Future generateCovidLabReport(LabResult covidLabResult, String isOutsideKSA) async {
hasError = false;
Map<String, dynamic> body = Map();
body['To'] = user.emailAddress;
body['OrderNo'] = covidLabResult.orderNo;
body['OrderLineItemNo'] = covidLabResult.orderLineItemNo;
body['LineItemNo'] = covidLabResult.resultValueBasedLineItemNo;
body['CertificateFormat'] = 5;
body['GeneratedBy'] = 102;
body['ShowPassportNumber'] = isOutsideKSA;
body['isDentalAllowedBackend'] = false;
body['SetupID'] = covidLabResult.setupID;
body['ProjectID'] = covidLabResult.projectID;
dynamic localRes;
await baseAppClient.post(SEND_COVID_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
return Future.value(localRes);
}
Future updateCovidPassportNumber(String passportNumber) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PassportNo'] = passportNumber;
dynamic localRes;
await baseAppClient.post(COVID_PASSPORT_UPDATE, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
return Future.value(localRes);
}
Future getCovidPassportNumber() async {
hasError = false;
Map<String, dynamic> body = Map();
dynamic localRes;
await baseAppClient.post(GET_PATIENT_PASSPORT_NUMBER, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
return Future.value(localRes);
}
Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -90,8 +138,7 @@ class LabsService extends BaseService {
body['ProjectID'] = patientLabOrder.projectID; body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID; body['ClinicID'] = patientLabOrder.clinicID;
body['Procedure'] = procedure; body['Procedure'] = procedure;
await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
labOrdersResultsList.clear(); labOrdersResultsList.clear();
response['ListPLR'].forEach((lab) { response['ListPLR'].forEach((lab) {
labOrdersResultsList.add(LabOrderResult.fromJson(lab)); labOrdersResultsList.add(LabOrderResult.fromJson(lab));
@ -102,8 +149,7 @@ class LabsService extends BaseService {
}, body: body); }, body: body);
} }
RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail();
RequestSendLabReportEmail();
Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async {
_requestSendLabReportEmail.projectID = patientLabOrder.projectID; _requestSendLabReportEmail.projectID = patientLabOrder.projectID;
@ -111,8 +157,7 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
_requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription;
_requestSendLabReportEmail.patientName = user.firstName + " " + user.lastName; _requestSendLabReportEmail.patientName = user.firstName + " " + user.lastName;
_requestSendLabReportEmail.patientIditificationNum = _requestSendLabReportEmail.patientIditificationNum = user.patientIdentificationNo;
user.patientIdentificationNo;
_requestSendLabReportEmail.dateofBirth = user.dateofBirth; _requestSendLabReportEmail.dateofBirth = user.dateofBirth;
_requestSendLabReportEmail.to = user.emailAddress; _requestSendLabReportEmail.to = user.emailAddress;
_requestSendLabReportEmail.orderDate = '${patientLabOrder.orderDate.year}-${patientLabOrder.orderDate.month}-${patientLabOrder.orderDate.day}'; _requestSendLabReportEmail.orderDate = '${patientLabOrder.orderDate.year}-${patientLabOrder.orderDate.month}-${patientLabOrder.orderDate.day}';
@ -120,10 +165,7 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.projectName = patientLabOrder.projectName; _requestSendLabReportEmail.projectName = patientLabOrder.projectName;
_requestSendLabReportEmail.setupID = user.setupID; _requestSendLabReportEmail.setupID = user.setupID;
await baseAppClient.post(SEND_LAB_RESULT_EMAIL, await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _requestSendLabReportEmail.toJson()); }, body: _requestSendLabReportEmail.toJson());

@ -1,8 +1,8 @@
import 'dart:collection';
import 'dart:convert'; import 'dart:convert';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -11,18 +11,19 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'covid-payment-details.dart'; import 'covid-payment-details.dart';
class CovidDirveThruQuestions extends StatefulWidget { class CovidDirveThruQuestions extends StatefulWidget {
final String projectId; final String projectId;
final List<CovidTestProceduresResponse> proceduresList; final List<CovidTestProceduresResponse> proceduresList;
CovidDirveThruQuestions({@required this.projectId, @required this.proceduresList}); CovidDirveThruQuestions({@required this.projectId, @required this.proceduresList});
@override @override
CovidDirveThruQuestionsState createState() => CovidDirveThruQuestionsState(); CovidDirveThruQuestionsState createState() => CovidDirveThruQuestionsState();
} }
class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> { class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
List qa; List qa;
@ -33,6 +34,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
} }
TranslationBase localize; TranslationBase localize;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
localize = TranslationBase.of(context); localize = TranslationBase.of(context);
@ -70,12 +72,10 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
setState(() { setState(() {
obj["ans"] = newValue; obj["ans"] = newValue;
}); });
} }),
),
Text(localize.yes), Text(localize.yes),
], ],
), ),
Row( Row(
children: [ children: [
Radio<int>( Radio<int>(
@ -85,8 +85,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
setState(() { setState(() {
obj["ans"] = newValue; obj["ans"] = newValue;
}); });
} }),
),
Text(localize.no), Text(localize.no),
], ],
) )
@ -95,8 +94,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
); );
}, },
separatorBuilder: (ctx, idx) => Divider(height: 0.25, color: Colors.grey.withOpacity(0.5)), separatorBuilder: (ctx, idx) => Divider(height: 0.25, color: Colors.grey.withOpacity(0.5)),
) )),
),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
child: FractionallySizedBox( child: FractionallySizedBox(
@ -106,14 +104,15 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
color: Theme.of(context).appBarTheme.color, color: Theme.of(context).appBarTheme.color,
disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25), disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Text(localize.next, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), child: Text(
onPressed: next localize.next,
style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),
), ),
onPressed: next),
), ),
), ),
], ],
) ));
);
} }
next() async { next() async {
@ -121,15 +120,26 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
qa.forEach((element) { qa.forEach((element) {
all = all && (element["ans"] == 1 || element["ans"] == 0); all = all && (element["ans"] == 1 || element["ans"] == 0);
}); });
if(all) if (all) if (qa[0]["ans"] == 1) {
openPassportUpdatePage();
} else {
getPaymentInfo(context, widget.projectId); getPaymentInfo(context, widget.projectId);
}
else else
AppToast.showErrorToast(message: localize.pleaseSelectAllQuestionToContinue); AppToast.showErrorToast(message: localize.pleaseSelectAllQuestionToContinue);
} }
openPassportUpdatePage() {
Navigator.push(context, FadePage(page: PassportUpdatePage())).then((value) {
print(value);
if(value != null && value == true) {
getPaymentInfo(context, widget.projectId);
}
});
}
List getQuestionsFromJson() { List getQuestionsFromJson() {
var questionsJson = var questionsJson = """
"""
[{"id":1,"questionEN":"Is the test intended for travel?","questionAR":"هل تجري التحليل بغرض السفر؟","ans":2},{"id":2,"questionEN":"Coming from outside KSA within last 2 weeks?","questionAR":"هل قدمت من خارج المملكة خلال الأسبوعين الماضيين؟","ans":2},{"id":3,"questionEN":"Do you currently have fever?","questionAR":"هل تعاني حاليا من حرارة؟","ans":2},{"id":4,"questionEN":"Did you have fever in last 2 weeks?","questionAR":"هل عانيت من حرارة في الأسبوعين الماضيين؟","ans":2},{"id":5,"questionEN":"Do you have a sore throat?","questionAR":"هل لديك التهاب في الحلق؟","ans":2},{"id":6,"questionEN":"Do you have a runny nose?","questionAR":"هل لديك سيلان بالأنف؟"},{"id":7,"questionEN":"Do you have a cough?","questionAR":"هل لديك سعال؟","ans":2},{"id":8,"questionEN":"Do you have shortness of breath?","questionAR":"هل تعانين من ضيق في التنفس؟","ans":2},{"id":9,"questionEN":"Do you have nausea?","questionAR":"هل تعانين من غثيان؟","ans":2},{"id":10,"questionEN":"Do you have vomiting?","questionAR":"هل تعاني من القيء؟","ans":2},{"id":11,"questionEN":"Do you have a headache?","questionAR":"هل تعاني من صداع في الرأس؟","ans":2},{"id":12,"questionEN":"Do you have muscle pain?","questionAR":"هل تعانين من آلام عضلية؟","ans":2},{"id":13,"questionEN":"Do you have joint pain?","questionAR":"هل تعانين من آلام المفاصل؟","ans":2},{"id":14,"questionEN":"Do you have diarrhea?","questionAR":"هل لديك اسهال؟","ans":2}]"""; [{"id":1,"questionEN":"Is the test intended for travel?","questionAR":"هل تجري التحليل بغرض السفر؟","ans":2},{"id":2,"questionEN":"Coming from outside KSA within last 2 weeks?","questionAR":"هل قدمت من خارج المملكة خلال الأسبوعين الماضيين؟","ans":2},{"id":3,"questionEN":"Do you currently have fever?","questionAR":"هل تعاني حاليا من حرارة؟","ans":2},{"id":4,"questionEN":"Did you have fever in last 2 weeks?","questionAR":"هل عانيت من حرارة في الأسبوعين الماضيين؟","ans":2},{"id":5,"questionEN":"Do you have a sore throat?","questionAR":"هل لديك التهاب في الحلق؟","ans":2},{"id":6,"questionEN":"Do you have a runny nose?","questionAR":"هل لديك سيلان بالأنف؟"},{"id":7,"questionEN":"Do you have a cough?","questionAR":"هل لديك سعال؟","ans":2},{"id":8,"questionEN":"Do you have shortness of breath?","questionAR":"هل تعانين من ضيق في التنفس؟","ans":2},{"id":9,"questionEN":"Do you have nausea?","questionAR":"هل تعانين من غثيان؟","ans":2},{"id":10,"questionEN":"Do you have vomiting?","questionAR":"هل تعاني من القيء؟","ans":2},{"id":11,"questionEN":"Do you have a headache?","questionAR":"هل تعاني من صداع في الرأس؟","ans":2},{"id":12,"questionEN":"Do you have muscle pain?","questionAR":"هل تعانين من آلام عضلية؟","ans":2},{"id":13,"questionEN":"Do you have joint pain?","questionAR":"هل تعانين من آلام المفاصل؟","ans":2},{"id":14,"questionEN":"Do you have diarrhea?","questionAR":"هل لديك اسهال؟","ans":2}]""";
var map = json.decode(questionsJson) as List; var map = json.decode(questionsJson) as List;
return map; return map;
@ -137,17 +147,11 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
getPaymentInfo(BuildContext context, String projectID) { getPaymentInfo(BuildContext context, String projectID) {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
CovidPaymentInfoResponse covidPaymentInfoResponse = CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse();
new CovidPaymentInfoResponse();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID) service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID).then((res) {
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
// setState(() {
// covidPaymentInfoResponse =
// CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
// });
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -161,5 +165,4 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
print(err); print(err);
}); });
} }
} }

@ -279,10 +279,10 @@ class _Login extends State<Login> {
// result['CRSVerificationStatus']; // result['CRSVerificationStatus'];
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { // await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
if (pharmacyModuleViewModel.error.isNotEmpty) // if (pharmacyModuleViewModel.error.isNotEmpty)
await pharmacyModuleViewModel.createUser(); // await pharmacyModuleViewModel.createUser();
}); // });
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()

@ -0,0 +1,125 @@
import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class PassportUpdatePage extends StatefulWidget {
@override
_PassportUpdatePageState createState() => _PassportUpdatePageState();
}
class _PassportUpdatePageState extends State<PassportUpdatePage> {
TextEditingController passportNumber = new TextEditingController();
bool _isButtonDisabled;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getPassportNumber());
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).passportNumber,
isShowAppBar: true,
isBottomBar: true,
body: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.all(45.0),
child: Text(TranslationBase.of(context).enterPassportNumber, textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, color: Colors.black)),
),
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: SvgPicture.asset("assets/images/new-design/passport.svg", width: 250.0, fit: BoxFit.fill),
),
Container(
margin: EdgeInsets.only(left: 50.0, right: 50.0, top: 25.0),
child: TextFields(
keyboardType: TextInputType.text,
fontWeight: FontWeight.normal,
controller: passportNumber,
onChanged: (value) => {_onPassportTextChanged(value)},
padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10),
hintText: TranslationBase.of(context).passportNumber,
))
],
),
),
),
bottomSheet: Container(
margin: EdgeInsets.only(top: 10.0, left: 30.0, right: 30.0, bottom: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.red[300],
onPressed: () {
if (_isButtonDisabled == false)
updatePassportNumber();
else
AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber);
},
child: Text(TranslationBase.of(context).submit, style: TextStyle(fontSize: 18.0)),
),
),
),
);
}
_onPassportTextChanged(content) {
if (content.length >= 1) {
setState(() {
_isButtonDisabled = false;
});
} else {
setState(() {
_isButtonDisabled = true;
});
}
}
void updatePassportNumber() {
LabsService service = new LabsService();
GifLoaderDialogUtils.showMyDialog(context);
service.updateCovidPassportNumber(passportNumber.text).then((res) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop(true);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
void getPassportNumber() {
LabsService service = new LabsService();
GifLoaderDialogUtils.showMyDialog(context);
service.getCovidPassportNumber().then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['Covid19_Certificate_GetPassportList'][0]['PassportNo']);
passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo'];
if(res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") {
_isButtonDisabled = false;
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -1218,6 +1218,12 @@ class TranslationBase {
String get bookVideoLivecare2 => localizedValues["book-video-livecare-2"][locale.languageCode]; String get bookVideoLivecare2 => localizedValues["book-video-livecare-2"][locale.languageCode];
String get noThankyou => localizedValues["no-thankyou"][locale.languageCode]; String get noThankyou => localizedValues["no-thankyou"][locale.languageCode];
String get visitClinic => localizedValues["visit-clinic"][locale.languageCode]; String get visitClinic => localizedValues["visit-clinic"][locale.languageCode];
String get generateCovidCertificate => localizedValues["generate-covid-certificate"][locale.languageCode];
String get isReportOutsideKsa => localizedValues["is-report-outside-ksa"][locale.languageCode];
String get passportNumber => localizedValues["passport-number"][locale.languageCode];
String get enterPassportNumber => localizedValues["enter-passport-number"][locale.languageCode];
String get validPassportNumber => localizedValues["valid-passport-number"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,7 +1,13 @@
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -10,15 +16,17 @@ import 'package:provider/provider.dart';
import '../../text.dart'; import '../../text.dart';
import 'FlowChartPage.dart'; import 'FlowChartPage.dart';
class LabResultWidget extends StatelessWidget { class LabResultWidget extends StatelessWidget {
final String filterName; final String filterName;
final List<LabResult> patientLabResultList; final List<LabResult> patientLabResultList;
final PatientLabOrders patientLabOrder; final PatientLabOrders patientLabOrder;
LabResult covidLabResult;
LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder}) : super(key: key); LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder}) : super(key: key);
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
@ -29,8 +37,7 @@ class LabResultWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(filterName), Texts(filterName),
InkWell( InkWell(
@ -55,15 +62,99 @@ class LabResultWidget extends StatelessWidget {
), ),
Table( Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide( inside: BorderSide(width: 2.0, color: Colors.grey[300]),
width: 2.0, color: Colors.grey[300]),
), ),
children: fullData(patientLabResultList, context), children: fullData(patientLabResultList, context),
), ),
checkIfCovidLab(patientLabResultList)
? Container(
margin: EdgeInsets.only(top: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.91,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.red[300],
onPressed: () {
showKSADialog(context);
},
child: Text(TranslationBase.of(context).generateCovidCertificate, style: TextStyle(fontSize: 18.0)),
),
),
)
: Container(),
], ],
), ),
); );
} }
generateCovidCertificate(BuildContext context, String isOutsideKSA) {
LabsService service = new LabsService();
GifLoaderDialogUtils.showMyDialog(context);
service.generateCovidLabReport(covidLabResult, isOutsideKSA).then((res) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: TranslationBase.of(context).emailSentSuccessfully);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
openPassportUpdatePage(BuildContext context) {
Navigator.push(context, FadePage(page: PassportUpdatePage())).then((value) {
print(value);
if(value != null && value == true) {
showConfirmMessage(context, projectViewModel.user.emailAddress, "yes");
}
});
}
void showKSADialog(BuildContext context) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).isReportOutsideKsa,
okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no,
okFunction: () => {
Navigator.of(context).pop(),
openPassportUpdatePage(context)
// showConfirmMessage(context, projectViewModel.user.emailAddress, "yes")
},
cancelFunction: () => {showConfirmMessage(context, projectViewModel.user.emailAddress, "no")});
dialog.showAlertDialog(context);
}
void showConfirmMessage(BuildContext context, String email, String isOutsideKSA) {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: email,
onTapSendEmail: () {
generateCovidCertificate(context, isOutsideKSA);
},
),
);
}
bool checkIfCovidLab(List<LabResult> labResultList) {
bool isCovidResult = false;
labResultList.forEach((order) {
if (order.testCode.toUpperCase().contains("COVID") && order.isCertificateAllowed.toString() == "true") {
isCovidResult = true;
covidLabResult = order;
}
print(covidLabResult.testCode);
});
return isCovidResult;
}
List<TableRow> fullData(List<LabResult> labResultList, context) { List<TableRow> fullData(List<LabResult> labResultList, context) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
@ -74,12 +165,8 @@ class LabResultWidget extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
? Radius.circular(0.0) topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -106,12 +193,8 @@ class LabResultWidget extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
? Radius.circular(10.0) topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(
@ -168,7 +251,4 @@ class LabResultWidget extends StatelessWidget {
}); });
return tableRow; return tableRow;
} }
} }

@ -188,7 +188,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
.labResultLists[index] .labResultLists[index]
.patientLabResultList, .patientLabResultList,
), ),
) ),
], ],
), ),
), ),
@ -252,7 +252,6 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
data: widget.details ?? TranslationBase.of(context).noDataAvailable, data: widget.details ?? TranslationBase.of(context).noDataAvailable,
)), )),
), ),
], ],
), ),
], ],

@ -28,6 +28,7 @@ class ConfirmDialog {
child: Texts(this.cancelText), child: Texts(this.cancelText),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
cancelFunction();
}); });
Widget continueButton = FlatButton(child: Texts(okText), onPressed: okFunction); Widget continueButton = FlatButton(child: Texts(okText), onPressed: okFunction);

@ -23,23 +23,23 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType; _PAYMENT_TYPE paymentType;
// static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = static String SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
// static String PREAUTH_SERVICE_URL = // static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
static String PREAUTH_SERVICE_URL = static String PREAUTH_SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // static String PREAUTH_SERVICE_URL =
// 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
static String PRESCRIPTION_PAYMENT_WITH_ORDERID = static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live
// Packages // Packages
static String PACKAGES_REQUEST_PAYMENT_URL = static String PACKAGES_REQUEST_PAYMENT_URL =

Loading…
Cancel
Save