merge-requests/34/merge
Sultan Khan 4 years ago
commit 47c42808fd

@ -18,6 +18,7 @@
<application
android:name="io.flutter.app.FlutterApplication"
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true"
android:label="diplomaticquarterapp">
<activity
android:name=".MainActivity"
@ -61,8 +62,6 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
</manifest>

@ -104,6 +104,9 @@ const ADD_ADVANCE_NUMBER_REQUEST =
const IS_ALLOW_ASK_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_CALL_REQUEST_TYPE =
'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo';
//URL to get medicine and pharmacies list
const CHANNEL = 3;

@ -251,5 +251,6 @@ const Map<String, Map<String, String>> localizedValues = {
"patientCard": {"en": "Patient Card ID: ", "ar": "رقم الاشتراك"},
"policyNumber": {"en": "Policy Number: ", "ar": "رقم بوليصة التاميت:"},
"seeDetails": {"en": "SEE DETAILS", "ar": "منافعك التامينية"},
"insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"}
"insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"},
"requestType": {"en": "Request Type", "ar": "نوع الاستفسار"}
};

@ -43,9 +43,11 @@ class InsuranceApprovalModel {
int approvalNo;
String approvalStatusDescption;
int unUsedCount;
//String companyName;
String expiryDate;
String rceiptOn;
int appointmentNo;
InsuranceApprovalModel(
{this.versionID,
@ -72,8 +74,11 @@ class InsuranceApprovalModel {
//this.companyName,
this.expiryDate,
this.rceiptOn,
this.approvalDetails});
this.approvalDetails,
this.appointmentNo});
InsuranceApprovalDetails x = InsuranceApprovalDetails();
InsuranceApprovalModel.fromJson(Map<String, dynamic> json) {
try {
rceiptOn = json['ReceiptOn'];
@ -102,6 +107,7 @@ class InsuranceApprovalModel {
clinicName = json['ClinicName'];
approvalDetails =
InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]);
appointmentNo = json['AppointmentNo'];
} catch (e) {
print(e);
}
@ -122,8 +128,13 @@ class InsuranceApprovalModel {
data['TokenID'] = this.tokenID;
data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType;
if (appointmentNo == null) {
data['EXuldAPPNO'] = this.eXuldAPPNO;
data['ProjectID'] = this.projectID;
}
if (appointmentNo != null) {
data['AppointmentNo'] = this.appointmentNo;
}
return data;
}
}

@ -42,7 +42,7 @@ class InsuranceCardModel {
this.companyName,
this.patientCardID,
this.isActive,
this.cardValidTo,
this.cardValidTo
});
InsuranceCardModel.fromJson(Map<String, dynamic> json) {

@ -16,6 +16,7 @@ class InsuranceUpdateModel {
int deviceTypeID;
String createdOn;
String statusDescription;
int appointmentNo;
InsuranceUpdateModel(
{this.patientID,

@ -13,11 +13,11 @@ class BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences();
BaseService() {
getUser();
_getUser();
}
getUser() async {
user = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
_getUser() async {
var userData = await sharedPref.getObject(USER_PROFILE);
if (userData != null) user = AuthenticatedUser.fromJson(userData);
}
}

@ -24,21 +24,34 @@ class BaseAppClient {
try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE);
// body['SetupID'] = SETUP_ID;
// body['VersionID'] = VERSION_ID;
// body['Channel'] = CHANNEL;
// body['LanguageID'] = LANGUAGE;
// body['IPAdress'] = IP_ADDRESS;
// body['generalid'] = GENERAL_ID;
// body['PatientOutSA'] = PATIENT_OUT_SA;
// body['SessionID'] = SESSION_ID;
// body['isDentalAllowedBackend'] = IS_DENTAL_ALLOWED_BACKEND;
// body['DeviceTypeID'] = DeviceTypeID;
// body['PatientType'] = PATIENT_TYPE;
// body['PatientTypeID'] = PATIENT_TYPE_ID;
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] : SETUP_ID
: SETUP_ID;
body['VersionID'] = body.containsKey('VersionID')
? body['VersionID'] != null ? body['VersionID'] : VERSION_ID
: VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null ? body['PatientOutSA'] : PATIENT_OUT_SA
: PATIENT_OUT_SA;
body['isDentalAllowedBackend'] = IS_DENTAL_ALLOWED_BACKEND;
body['DeviceTypeID'] = DeviceTypeID;
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE
: PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
if (user != null) {
body['TokenID'] = token; //user['TokenID'];
body['TokenID'] = token;
body['PatientID'] = user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = getSessionId(token);
@ -59,29 +72,38 @@ class BaseAppClient {
onFailure('Error While Fetching data', statusCode);
} else {
var parsed = json.decode(response.body.toString());
if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode);
} else {
if (isAllowAny) {
onSuccess(parsed, statusCode);
} else if (parsed['IsAuthenticated'] == false ||
parsed['IsAuthenticated'] == null) {
} else if (!parsed['IsAuthenticated']) {
if (parsed['isSMSSent'] == true) {
onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode);
} else if (parsed['Result'] == 'OK') {
onSuccess(parsed, statusCode);
} else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logout();
}
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode);
} else if (parsed['Result'] == 'OK') {
onSuccess(parsed, statusCode);
} else {
if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode);
} else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
}
}
}
}
} else {
onFailure('Please Check The Internet Connection', -1);
}
@ -96,6 +118,6 @@ class BaseAppClient {
}
String getSessionId(String id) {
return id.replaceAll('/[^a-zA-Z ]', '');
return id.replaceAll(RegExp('/[^a-zA-Z ]'), '');
}
}

@ -1,6 +1,7 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart';
import 'package:diplomaticquarterapp/core/model/feedback/request_insert_coc_item.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
@ -19,6 +20,7 @@ class FeedbackService extends BaseService {
String attachment,
AppointmentHistory appointHistory}) async {
hasError = false;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
_requestInsertCOCItem.attachment = attachment;
_requestInsertCOCItem.title = title;
@ -31,7 +33,7 @@ class FeedbackService extends BaseService {
_requestInsertCOCItem.patientName = user.firstName + " " + user.lastName;
_requestInsertCOCItem.fileName = "";
_requestInsertCOCItem.appVersion = VERSION_ID;
_requestInsertCOCItem.uILanguage = "ar"; //TODO Change it to be dynamic
_requestInsertCOCItem.uILanguage = languageID; //TODO Change it to be dynamic
_requestInsertCOCItem.browserInfo = Platform.localHostname;
_requestInsertCOCItem.deviceInfo = Platform.localHostname;
_requestInsertCOCItem.resolution = "400x847";

@ -1,8 +1,8 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class InsuranceCardService extends BaseService {
List<InsuranceCardModel> _cardList = List();
@ -10,7 +10,9 @@ class InsuranceCardService extends BaseService {
List<InsuranceApprovalModel> _insuranceApproval = List();
List<InsuranceCardModel> get cardList => _cardList;
List<InsuranceUpdateModel> get updatedCard => _cardUpdated;
List<InsuranceApprovalModel> get insuranceApproval => _insuranceApproval;
clearInsuranceCard() {
@ -96,11 +98,24 @@ class InsuranceCardService extends BaseService {
}, body: _insuranceUpdateModel.toJson());
}
Future getInsuranceApproval() async {
Future getInsuranceApproval({int appointmentNo}) async {
hasError = false;
// _cardList.clear();
if(appointmentNo != null) {
_insuranceApprovalModel.appointmentNo = appointmentNo;
_insuranceApprovalModel.eXuldAPPNO = null;
_insuranceApprovalModel.projectID = null;
} else {
_insuranceApprovalModel.appointmentNo = null;
_insuranceApprovalModel.eXuldAPPNO = 0;
_insuranceApprovalModel.projectID = 0;
}
await baseAppClient.post(GET_PAtIENTS_INSURANCE_APPROVALS,
onSuccess: (dynamic response, int statusCode) {
print(response['HIS_Approval_List'].length);
_insuranceApproval.clear();
_insuranceApproval.length = 0;
response['HIS_Approval_List'].forEach((item) {
_insuranceApproval.add(InsuranceApprovalModel.fromJson(item));
});

@ -0,0 +1,21 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
class MedicalService extends BaseService {
List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList = List();
getAppointmentHistory() async {
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY,
onSuccess: (response, statusCode) async {
appoitmentAllHistoryResultList.clear();
response['AppoimentAllHistoryResultList'].forEach((appoitment) {
appoitmentAllHistoryResultList
.add(AppoitmentAllHistoryResultList.fromJson(appoitment));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: Map());
}
}

@ -4,10 +4,10 @@ import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.
import '../base_service.dart';
class VitalSignService extends BaseService {
List<VitalSignResModel> vitalSignResModelList = List();
Map<String, dynamic> body = Map();
Future getPatientRadOrders () async {
Future getPatientRadOrders() async {
hasError = false;
await baseAppClient.post(GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) {
@ -20,7 +20,4 @@ class VitalSignService extends BaseService {
super.error = error;
}, body: Map());
}
}

@ -1,4 +1,7 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
class BaseViewModel extends ChangeNotifier {
@ -9,8 +12,21 @@ class BaseViewModel extends ChangeNotifier {
String error = "";
AuthenticatedUser user;
AppSharedPreferences sharedPref = AppSharedPreferences();
void setState(ViewState viewState) {
_state = viewState;
notifyListeners();
}
BaseViewModel() {
_getUser();
}
_getUser() async {
var userData = await sharedPref.getObject(USER_PROFILE);
if (userData != null) user = AuthenticatedUser.fromJson(userData);
notifyListeners();
}
}

@ -1,12 +1,11 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
import 'base_view_model.dart';
import '../../locator.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart';
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
import 'base_view_model.dart';
class InsuranceViewModel extends BaseViewModel {
bool hasError = false;
@ -14,8 +13,10 @@ class InsuranceViewModel extends BaseViewModel {
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
List<InsuranceCardModel> get insurance => _insuranceCardService.cardList;
List<InsuranceUpdateModel> get insuranceUpdate =>
_insuranceCardService.updatedCard;
List<InsuranceApprovalModel> get insuranceApproval =>
_insuranceCardService.insuranceApproval;
@ -43,10 +44,14 @@ class InsuranceViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getInsuranceApproval() async {
Future getInsuranceApproval({int appointmentNo}) async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
if (appointmentNo != null)
await _insuranceCardService.getInsuranceApproval(
appointmentNo: appointmentNo);
else
await _insuranceCardService.getInsuranceApproval();
if (_insuranceCardService.hasError) {
error = _insuranceCardService.error;

@ -0,0 +1,22 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
class MedicalViewModel extends BaseViewModel {
List<AppoitmentAllHistoryResultList> get appoitmentAllHistoryResultList =>
List();
MedicalService _medicalService = locator<MedicalService>();
getAppointmentHistory() {
setState(ViewState.Busy);
_medicalService.getAppointmentHistory();
if (_medicalService.hasError) {
error = _medicalService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -4,6 +4,7 @@ import 'package:get_it/get_it.dart';
import 'core/service/feedback/feedback_service.dart';
import 'core/service/hospital_service.dart';
import 'core/service/medical/labs_service.dart';
import 'core/service/medical/medical_service.dart';
import 'core/service/medical/my_doctor_service.dart';
import 'core/service/medical/prescriptions_service.dart';
import 'core/service/medical/radiology_service.dart';
@ -11,6 +12,7 @@ import 'core/service/medical/vital_sign_service.dart';
import 'core/viewModels/feedback/feedback_view_model.dart';
import 'core/viewModels/hospital_view_model.dart';
import 'core/viewModels/medical/labs_view_model.dart';
import 'core/viewModels/medical/medical_view_model.dart';
import 'core/viewModels/medical/my_doctor_view_model.dart';
import 'core/viewModels/medical/prescriptions_view_model.dart';
import 'core/viewModels/medical/radiology_view_model.dart';
@ -34,7 +36,7 @@ void setupLocator() {
locator.registerLazySingleton(() => FeedbackService());
locator.registerLazySingleton(() => InsuranceCardService());
locator.registerLazySingleton(() => VitalSignService());
locator.registerLazySingleton(() => MedicalService());
/// View Model
locator.registerFactory(() => HospitalViewModel());
@ -46,4 +48,5 @@ void setupLocator() {
locator.registerFactory(() => FeedbackViewModel());
locator.registerFactory(() => VitalSignViewModel());
locator.registerFactory(() => InsuranceViewModel());
locator.registerFactory(() => MedicalViewModel());
}

@ -109,11 +109,13 @@ class _BookSuccessState extends State<BookSuccess> {
style: _getTextStyling()),
),
Container(
width: MediaQuery.of(context).size.width * 0.65,
margin: EdgeInsets.only(top: 5.0, bottom: 3.0),
child: Text(
widget.docObject.doctorTitle +
" " +
widget.docObject.name,
overflow: TextOverflow.ellipsis,
style: _getTextStyling()),
),
],

@ -88,7 +88,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0),
alignment: Alignment.center,
child: Text(
widget.appo.doctorTitle +

@ -13,7 +13,7 @@ class ArrivedButtons {
"title": "Medicines",
"subtitle": "Prescriptions",
"icon": "assets/images/new-design/medicine_prescriptions_icon.png",
"caller": "onCancelAppointment"
"caller": "prescriptions"
},
{
"title": "Radiology",
@ -43,7 +43,7 @@ class ArrivedButtons {
"title": "Insurance",
"subtitle": "Approvals",
"icon": "assets/images/new-design/insurance_approvals_icon.png",
"caller": "goToTodoList"
"caller": "Insurance"
},
{
"title": "Ask Your",
@ -55,7 +55,7 @@ class ArrivedButtons {
"title": "Survey",
"subtitle": "Service",
"icon": "assets/images/new-design/survey.png",
"caller": "goToTodoList"
"caller": "Survey"
}
];
}

@ -13,13 +13,13 @@ class ArrivedButtons {
"title": "Medicines",
"subtitle": "Prescriptions",
"icon": "assets/images/new-design/medicine_prescriptions_icon.png",
"caller": "onCancelAppointment"
"caller": "prescriptions"
},
{
"title": "Radiology",
"subtitle": "Services",
"icon": "assets/images/new-design/radiology_service_icon.png",
"caller": "insertComplaint"
"caller": "radiology"
},
{
"title": "Lab",
@ -43,7 +43,7 @@ class ArrivedButtons {
"title": "Insurance",
"subtitle": "Approvals",
"icon": "assets/images/new-design/insurance_approvals_icon.png",
"caller": "goToTodoList"
"caller": "Insurance"
},
{
"title": "Ask Your",
@ -55,7 +55,7 @@ class ArrivedButtons {
"title": "Survey",
"subtitle": "Service",
"icon": "assets/images/new-design/survey.png",
"caller": "goToTodoList"
"caller": "Survey"
}
];
}

@ -0,0 +1,92 @@
class AskDocRequestType {
String setupID;
int parameterGroup;
int parameterType;
int parameterCode;
String description;
String descriptionN;
String alias;
String aliasN;
String prefix;
String suffix;
String isColorCodingRequired;
String backColor;
String foreColor;
bool isBuiltIn;
bool isActive;
int createdBy;
String createdOn;
String editedBy;
String editedOn;
String rowVer;
AskDocRequestType(
{this.setupID,
this.parameterGroup,
this.parameterType,
this.parameterCode,
this.description,
this.descriptionN,
this.alias,
this.aliasN,
this.prefix,
this.suffix,
this.isColorCodingRequired,
this.backColor,
this.foreColor,
this.isBuiltIn,
this.isActive,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn,
this.rowVer});
AskDocRequestType.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
parameterGroup = json['ParameterGroup'];
parameterType = json['ParameterType'];
parameterCode = json['ParameterCode'];
description = json['Description'];
descriptionN = json['DescriptionN'];
alias = json['Alias'];
aliasN = json['AliasN'];
prefix = json['Prefix'];
suffix = json['Suffix'];
isColorCodingRequired = json['IsColorCodingRequired'];
backColor = json['BackColor'];
foreColor = json['ForeColor'];
isBuiltIn = json['IsBuiltIn'];
isActive = json['IsActive'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedOn = json['EditedOn'];
rowVer = json['RowVer'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ParameterGroup'] = this.parameterGroup;
data['ParameterType'] = this.parameterType;
data['ParameterCode'] = this.parameterCode;
data['Description'] = this.description;
data['DescriptionN'] = this.descriptionN;
data['Alias'] = this.alias;
data['AliasN'] = this.aliasN;
data['Prefix'] = this.prefix;
data['Suffix'] = this.suffix;
data['IsColorCodingRequired'] = this.isColorCodingRequired;
data['BackColor'] = this.backColor;
data['ForeColor'] = this.foreColor;
data['IsBuiltIn'] = this.isBuiltIn;
data['IsActive'] = this.isActive;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedOn'] = this.editedOn;
data['RowVer'] = this.rowVer;
return data;
}
}

@ -1,18 +1,26 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/PrescriptionReport.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
@ -20,8 +28,10 @@ class AppointmentActions extends StatefulWidget {
AppoitmentAllHistoryResultList appo;
TabController tabController;
final Function enableFooterButton;
MyInAppBrowser browser;
AppointmentActions({@required this.appo,
AppointmentActions(
{@required this.appo,
@required this.tabController,
@required this.enableFooterButton});
@ -40,9 +50,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
@override
Widget build(BuildContext context) {
var size = MediaQuery
.of(context)
.size;
var size = MediaQuery.of(context).size;
final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2;
final double itemWidth = size.width / 2;
@ -58,8 +66,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight),
children: appoButtonsList
.map((e) =>
GestureDetector(
.map((e) => GestureDetector(
onTap: () {
_handleButtonClicks(e);
},
@ -133,15 +140,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
case "onCancelAppointment":
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase
.of(context)
.cancelAppoMsg,
okText: TranslationBase
.of(context)
.confirm,
cancelText: TranslationBase
.of(context)
.cancel_nocaps,
confirmMessage: TranslationBase.of(context).cancelAppoMsg,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {cancelAppointment()},
cancelFunction: () => {});
dialog.showAlertDialog(context);
@ -171,6 +172,18 @@ class _AppointmentActionsState extends State<AppointmentActions> {
case "radiology":
openAppointmentRadiology();
break;
case "prescriptions":
openPrescriptionReport();
break;
case "Survey":
rateAppointment();
break;
case "Insurance":
navigateToInsuranceApprovals(widget.appo.appointmentNo);
break;
}
}
@ -345,18 +358,61 @@ class _AppointmentActionsState extends State<AppointmentActions> {
openAppointmentRadiology() {
DoctorsListService service = new DoctorsListService();
FinalRadiology finalRadiology = new FinalRadiology();
service.getPatientRadOrders(widget.appo.appointmentNo.toString(), context)
service
.getPatientRadOrders(widget.appo.appointmentNo.toString(), context)
.then((res) {
if (res['MessageStatus'] == 1) {
print(res['FinalRadiologyList']);
finalRadiology =
new FinalRadiology.fromJson(res['FinalRadiologyList'][0]);
print(finalRadiology.reportData);
navigateToRadiologyDetails(finalRadiology);
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
});
}
openPrescriptionReport() {
List<PrescriptionReportEnh> prescriptionReportEnhList = List();
DoctorsListService service = new DoctorsListService();
service.getPatientPrescriptionReports(widget.appo, context).then((res) {
res['ListPRM'].forEach((report) {
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report));
});
print(prescriptionReportEnhList.length);
if (prescriptionReportEnhList.length != 0) {
navigateToMedicinePrescriptionReport(
prescriptionReportEnhList, res['ListPRM']);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
AppToast.showErrorToast(message: "Sorry there is no data");
}
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
});
}
Future navigateToMedicinePrescriptionReport(
List<PrescriptionReportEnh> prescriptionReportEnhList,
dynamic listPres) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PrescriptionReportPage(
prescriptionReportEnhList: prescriptionReportEnhList,
listPres: listPres,
appo: widget.appo)));
}
Future navigateToRadiologyDetails(FinalRadiology finalRadiology) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
RadiologyDetailsPage(finalRadiology: finalRadiology)))
.then((value) {});
}
static Future<void> openMap(double latitude, double longitude) async {
String googleUrl =
'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude';
@ -389,19 +445,80 @@ class _AppointmentActionsState extends State<AppointmentActions> {
askYourDoc() {
DoctorsListService service = new DoctorsListService();
service
.isAllowedToAskDoctor(widget.appo.doctorID, context)
.then((res) {
service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) {
print(res['PatientDoctorAppointmentResultList']);
if (res['PatientDoctorAppointmentResultList'].length != 0) {
getCallRequestType();
} else {
AppToast.showErrorToast(
message: TranslationBase.of(context).askDocNotAllowed);
}
}).catchError((err) {
print(err);
});
}
getCallRequestType() {
DoctorsListService service = new DoctorsListService();
service.getCallRequestType(context).then((res) {
List<AskDocRequestType> requestData = new List<AskDocRequestType>();
res['ListReqTypes'].forEach((element) {
requestData.add(new AskDocRequestType.fromJson(element));
});
// print(requestData.length);
Utils.hideProgressDialog();
Future.delayed(const Duration(milliseconds: 400), () {
showAskDocRequestDialog(requestData);
});
}).catchError((err) {
print(err);
Utils.hideProgressDialog();
});
}
showAskDocRequestDialog(List<AskDocRequestType> requestData) {
Utils.hideProgressDialog();
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue =
Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform:
Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: AskDocDialog(requestData: requestData),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {})
.then((value) {
print("Dialog Closed");
print(value);
if (value != null) {
sendAskDocRequest(value);
}
});
}
sendAskDocRequest(int requestType) {
DoctorsListService service = new DoctorsListService();
service
.sendAskDocCallRequest(widget.appo, requestType.toString(), context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Request Sent Successfully");
} else {
AppToast.showErrorToast(message: TranslationBase
.of(context)
.askDocNotAllowed);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
});
}
@ -422,9 +539,17 @@ class _AppointmentActionsState extends State<AppointmentActions> {
});
}
loading(bool flag) {
setState(() {
AppointmentDetails.isLoading = flag;
});
navigateToInsuranceApprovals(int appoNo) {
Navigator.push(
context, FadePage(page: InsuranceApproval(appointmentNo: appoNo)));
}
rateAppointment() {
widget.browser = new MyInAppBrowser();
widget.browser.openBrowser('http://hmg.com/SitePages/pso.aspx?p=' +
widget.appo.projectID.toString() +
'.' +
widget.appo.appointmentNo.toString() +
'&c=1');
}
}

@ -0,0 +1,153 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
class PrescriptionReportPage extends StatefulWidget {
List<PrescriptionReportEnh> prescriptionReportEnhList;
dynamic listPres;
AppoitmentAllHistoryResultList appo;
PrescriptionReportPage({@required this.prescriptionReportEnhList, @required this.listPres, @required this.appo});
@override
_PrescriptionReportState createState() => _PrescriptionReportState();
}
class _PrescriptionReportState extends State<PrescriptionReportPage> {
@override
void initState() {
print(widget.prescriptionReportEnhList.length);
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Items',
body: Container(
height: MediaQuery.of(context).size.height * 0.8,
child: ListView.builder(
itemBuilder: (context, index) => InkWell(
onTap: () {
navigateToPrescriptionDetails(
widget.prescriptionReportEnhList[index]);
},
child: Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200], width: 0.5),
),
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
widget.prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(widget
.prescriptionReportEnhList[index].itemDescription)),
)),
Icon(
Icons.arrow_forward_ios,
size: 18,
color: Colors.grey[500],
)
],
),
),
),
itemCount: widget.prescriptionReportEnhList.length,
),
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.2,
color: Colors.grey[100],
child: Column(
children: <Widget>[
Divider(),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
label: 'Send Copy',
onTap: () {
sendPrescriptionReportEmail();
},
),
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
label: 'Resend order & deliver',
backgroundColor: Colors.green[200],
))
],
),
),
);
}
sendPrescriptionReportEmail() {
DoctorsListService service = new DoctorsListService();
service.sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, widget.listPres, context).then((res) {
AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail');
Utils.hideProgressDialog();
}).catchError((err) {
print(err);
Utils.hideProgressDialog();
AppToast.showErrorToast(message: err);
});
}
navigateToPrescriptionDetails(PrescriptionReportEnh prescriptionReportEnh) {
final PrescriptionReport prescriptionReport = new PrescriptionReport();
prescriptionReport.imageSRCUrl = prescriptionReportEnh.imageSRCUrl;
prescriptionReport.itemDescription = prescriptionReportEnh.itemDescription;
prescriptionReport.itemID = prescriptionReportEnh.itemID;
prescriptionReport.routeN = prescriptionReportEnh.route;
prescriptionReport.route = prescriptionReportEnh.route;
prescriptionReport.frequency = prescriptionReportEnh.frequency;
prescriptionReport.frequencyN = prescriptionReportEnh.frequency;
prescriptionReport.doseDailyQuantity =
prescriptionReportEnh.doseDailyQuantity;
prescriptionReport.days = prescriptionReportEnh.days;
Navigator.push(
context,
FadePage(
page: PrescriptionDetailsPage(
prescriptionReport: prescriptionReport,
),
),
);
}
}

@ -0,0 +1,93 @@
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'custom_radio.dart';
class AskDocDialog extends StatefulWidget {
List<AskDocRequestType> requestData;
static int selectedParameterCode = 0;
AskDocDialog({@required this.requestData});
@override
_AskDocDialogState createState() => _AskDocDialogState();
}
class _AskDocDialogState extends State<AskDocDialog> {
@override
Widget build(BuildContext context) {
return Container(
child: Dialog(
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container(
height: MediaQuery.of(context).size.height * 0.77,
width: 450.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.all(20.0),
child: Text(TranslationBase.of(context).requestType,
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
fontFamily: "Open-Sans-Bold")),
),
Container(
transform: Matrix4.translationValues(0.0, -30.0, 0.0),
child: CustomRadio(requestData: widget.requestData),
),
Container(
width: MediaQuery.of(context).size.width,
height: 40.0,
margin: EdgeInsets.only(left: 30.0, top: 0.0, right: 30.0),
child: RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
side: BorderSide(color: Colors.blue)),
color: Colors.blue,
onPressed: () {
if(AskDocDialog.selectedParameterCode != 0)
Navigator.pop(context, AskDocDialog.selectedParameterCode);
else
AppToast.showErrorToast(message: "Please select request type to continue");
},
child: Text(TranslationBase.of(context).confirm,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontFamily: 'Open-Sans-Bold')),
),
),
Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(left: 100.0, top: 20.0, right: 100.0),
child: OutlineButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0)),
color: Colors.red,
borderSide: BorderSide(color: Colors.red),
highlightColor: Colors.red,
highlightedBorderColor: Colors.red,
onPressed: () {
Navigator.pop(context, null);
},
child: Text(TranslationBase.of(context).cancel_nocaps,
style: TextStyle(
color: Colors.red,
fontWeight: FontWeight.bold,
fontFamily: 'Open-Sans-Bold')),
),
),
]),
),
),
);
}
}

@ -1,7 +1,13 @@
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
import 'package:flutter/material.dart';
class CustomRadio extends StatefulWidget {
List<AskDocRequestType> requestData;
CustomRadio({this.requestData});
@override
createState() {
return new CustomRadioState();
@ -14,11 +20,19 @@ class CustomRadioState extends State<CustomRadio> {
@override
void initState() {
super.initState();
if (widget.requestData != null) {
widget.requestData.forEach((element) {
sampleData.add(
new RadioModel(false, element.description, element.parameterCode));
});
} else {
sampleData.add(new RadioModel(false, "Before 30 Mins", 30));
sampleData.add(new RadioModel(false, 'Before 1 Hour', 60));
sampleData.add(new RadioModel(false, 'Before 2 Hours', 120));
sampleData.add(new RadioModel(false, 'Before 4 Hours', 240));
}
}
@override
Widget build(BuildContext context) {
@ -35,8 +49,14 @@ class CustomRadioState extends State<CustomRadio> {
setState(() {
sampleData.forEach((element) => element.isSelected = false);
sampleData[index].isSelected = true;
if (widget.requestData != null) {
AskDocDialog.selectedParameterCode =
sampleData[index].duration;
print(AskDocDialog.selectedParameterCode);
} else {
ReminderDialog.selectedDuration =
sampleData[index].duration * 60000;
}
});
},
child: new RadioItem(sampleData[index]),

@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.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/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';

@ -1,14 +1,18 @@
import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:flutter/cupertino.dart';
import '../base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../base/base_view.dart';
class InsuranceApproval extends StatefulWidget {
int appointmentNo;
InsuranceApproval({this.appointmentNo});
@override
_InsuranceApprovalState createState() => _InsuranceApprovalState();
}
@ -17,7 +21,10 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
@override
Widget build(BuildContext context) {
return BaseView<InsuranceViewModel>(
onModelReady: (model) => model.getInsuranceApproval(),
onModelReady: widget.appointmentNo != null
? (model) =>
model.getInsuranceApproval(appointmentNo: widget.appointmentNo)
: (model) => model.getInsuranceApproval(),
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true,

@ -1,17 +1,20 @@
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:flutter/cupertino.dart';
import '../base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart';
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../base/base_view.dart';
class InsuranceCard extends StatefulWidget {
int appointmentNo;
InsuranceCard({this.appointmentNo});
@override
_InsuranceCardState createState() => _InsuranceCardState();
}

@ -299,7 +299,6 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
);
}),
),
////////////////
],
))
],

@ -96,7 +96,7 @@ class _LandingPageState extends State<LandingPage> {
MyAdmissionsPage(),
ToDo(),
BookingOptions()
],
], // Please do not remove the BookingOptions from this array
),
bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab),
);

@ -1,16 +1,21 @@
import 'dart:math';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/sliver_app_bar_delegate.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
import '../../locator.dart';
import 'doctor/doctor_home_page.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
@ -22,48 +27,62 @@ class MedicalProfilePage extends StatefulWidget {
}
class _MedicalProfilePageState extends State<MedicalProfilePage> {
@override
Widget build(BuildContext context) {
return AppScaffold(
body: CustomScrollView(
physics: BouncingScrollPhysics(),
key: PageStorageKey("medical"),
slivers: <Widget>[
SliverPersistentHeader(
delegate: SliverAppBarDelegate(
maxHeight: 200.0,
minHeight: 200.0,
child: Container(
return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget) => AppScaffold(
baseViewModel: model,
body: SafeArea(
child: SingleChildScrollView(
child: Column(
children: <Widget>[
Stack(
children: <Widget>[
Column(
children: <Widget>[
Container(
width: double.infinity,
height: 200,
color: Colors.grey,
height: 150,
),
),
),
SliverPersistentHeader(
delegate: SliverAppBarDelegate(
maxHeight: double.maxFinite,
minHeight: double.maxFinite,
child: Padding(
Padding(
padding: EdgeInsets.symmetric(vertical: 12.0),
child: Column(
children: <Widget>[
Container(
width: double.infinity,
height: 30,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context, FadePage(page: DoctorHomePage()));
Navigator.push(context,
FadePage(page: MyAppointments()));
},
child: MedicalProfileItem(
title: 'My Doctor',
imagePath: 'doctor_icon.png',
title: 'My Appointments',
imagePath: 'my_appointment_icon.png',
subTitle: 'List',
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => Navigator.push(context,
FadePage(page: RadiologyHomePage())),
child: MedicalProfileItem(
title: 'Radiology',
imagePath: 'radiology_icon.png',
subTitle: 'Service',
),
),
),
Expanded(
flex: 1,
child: InkWell(
@ -74,47 +93,93 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
subTitle: 'Result',
),
),
)
),
],
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: HomePrescriptionsPage()));
},
child: MedicalProfileItem(
title: 'Medicines',
imagePath: 'prescription_icon.png',
subTitle: 'Prescriptions',
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => Navigator.push(
context, FadePage(page: RadiologyHomePage())),
context,
FadePage(
page: VitalSignDetailsScreen())),
child: MedicalProfileItem(
title: 'Radiology',
title: 'Vital Signs',
imagePath: 'medical_history_icon.png',
subTitle: 'Reports',
),
),
),
Expanded(
flex: 1,
child: InkWell(
// onTap: () => Navigator.push(
// context, FadePage(page: RadiologyHomePage())),
child: MedicalProfileItem(
title: 'My Medicines ',
imagePath: 'radiology_icon.png',
subTitle: 'Service',
),
),
),
],
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: HomePrescriptionsPage()));
FadePage(page: DoctorHomePage()));
},
child: MedicalProfileItem(
title: 'Medicines',
imagePath: 'prescription_icon.png',
subTitle: 'Prescriptions',
title: 'My Doctor',
imagePath: 'doctor_icon.png',
subTitle: 'List',
),
),
),
Expanded(
flex: 1,
child: InkWell(
//TODO
// onTap: () {
// Navigator.push(context,
// FadePage(page: InsuranceApproval()));
// },
child: MedicalProfileItem(
title: 'Eye',
imagePath:
'insurance_approvals_icon.png',
subTitle: 'Measurement',
),
),
)
],
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context, FadePage(page: InsuranceCard()));
Navigator.push(context,
FadePage(page: InsuranceCard()));
},
child: MedicalProfileItem(
title: 'Insurance',
@ -123,93 +188,246 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
),
),
),
],
),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: InsuranceApproval()));
},
//TODO
// onTap: () {
// Navigator.push(
// context, FadePage(page: DoctorHomePage()));
// },
child: MedicalProfileItem(
title: 'Update Insurance',
imagePath: 'insurance_card_icon.png',
subTitle: 'card',
),
),
),
Expanded(
flex: 1,
child: InkWell(
// onTap: () {
// Navigator.push(
// context, FadePage(page: InsuranceApproval()));
// },
child: MedicalProfileItem(
title: 'Insurance Approval',
imagePath: 'insurance_approvals_icon.png',
subTitle: 'Card',
subTitle: '',
),
),
)
],
),
Expanded(
flex: 1,
child: MedicalProfileItem(
title: 'Allergies',
imagePath: 'medical_history_icon.png',
subTitle: 'Diagnosed',
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
//TODO
// onTap: () {
// Navigator.push(
// context, FadePage(page: DoctorHomePage()));
// },
child: MedicalProfileItem(
title: 'My Vaccines',
imagePath: 'insurance_card_icon.png',
subTitle: 'card',
),
),
),
Expanded(
flex: 1,
child: InkWell(
// onTap: () {
// Navigator.push(
// context, FadePage(page: InsuranceApproval()));
// },
child: MedicalProfileItem(
title: 'Medical',
imagePath: 'medical_history_icon.png',
imagePath: 'insurance_approvals_icon.png',
subTitle: 'Reports',
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => Navigator.push(context,
FadePage(page: VitalSignDetailsScreen())),
child: MedicalProfileItem(
title: 'Vital Signs',
title: 'Monthly',
imagePath: 'medical_history_icon.png',
subTitle: 'Reports',
subTitle: 'Report',
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
//TODO
// onTap: () {
// Navigator.push(
// context, FadePage(page: DoctorHomePage()));
// },
child: MedicalProfileItem(
title: 'Sick',
imagePath: 'insurance_card_icon.png',
subTitle: 'Leaves',
),
),
),
Expanded(
flex: 1,
child: InkWell(
// onTap: () {
// Navigator.push(
// context, FadePage(page: InsuranceApproval()));
// },
child: MedicalProfileItem(
title: 'My Balance',
imagePath: 'insurance_approvals_icon.png',
subTitle: 'Credit',
),
),
),
Expanded(
flex: 1,
child: MedicalProfileItem(
title: 'Patient Call',
imagePath: 'medical_history_icon.png',
subTitle: 'Service',
),
),
]),
Row(
children: <Widget>[
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context, FadePage(page: InsuranceUpdate()));
},
//TODO
// onTap: () {
// Navigator.push(
// context, FadePage(page: DoctorHomePage()));
// },
child: MedicalProfileItem(
title: 'Insurance Update',
title: 'Smart Watches',
imagePath: 'insurance_card_icon.png',
subTitle: 'Card',
subTitle: 'Pairing',
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {},
// onTap: () {
// Navigator.push(
// context, FadePage(page: InsuranceApproval()));
// },
child: MedicalProfileItem(
title: 'My Trackers',
imagePath: 'insurance_approvals_icon.png',
subTitle: 'Service',
),
),
),
Expanded(
flex: 1,
child: MedicalProfileItem(
title: 'new',
title: 'Ask Your',
imagePath: 'medical_history_icon.png',
subTitle: 'Doctor',
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
//TODO
// onTap: () {
// Navigator.push(
// context, FadePage(page: DoctorHomePage()));
// },
child: MedicalProfileItem(
title: 'Internet',
imagePath: 'insurance_card_icon.png',
subTitle: 'Card',
subTitle: 'Pairing',
),
),
)
],
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context, FadePage(page: MyAppointments()));
},
// onTap: () {
// Navigator.push(
// context, FadePage(page: InsuranceApproval()));
// },
child: MedicalProfileItem(
title: 'My Appointments',
imagePath: 'my_appointment_icon.png',
subTitle: 'List',
title: 'My Trackers',
imagePath: 'insurance_approvals_icon.png',
subTitle: 'Service',
),
),
),
Expanded(
flex: 1,
child: Container(),
child: MedicalProfileItem(
title: 'Ask Your',
imagePath: 'medical_history_icon.png',
subTitle: 'Doctor',
),
),
]),
],
),
)
],
),
if (model.user != null)
Positioned(
top: 110,
left: 20,
right: 20,
child: Container(
width: double.infinity,
height: 70,
decoration: BoxDecoration(
color: Colors.grey[600],
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(5)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SizedBox(
height: 8,
),
Texts(
model.user.firstName +
" " +
model.user.lastName,
color: Colors.white,
),
SizedBox(
height: 8,
),
Texts(
'${model.user.patientID}',
color: Colors.white,
),
],
),
),
)
],
),
],
@ -217,7 +435,6 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
),
),
),
]),
);
}
}

@ -42,14 +42,14 @@ class DoctorsListService extends BaseService {
"PatientOutSA": 0,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null,
"SessionID": "YckwoXhUmWBsnHKEKig",
"ClinicID": clinicID,
"ProjectID": projectID,
"ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": true,
"PatientID": authUser.patientID,
"gender": authUser.gender,
"age": authUser.age,
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"gender": authUser.gender != null ? authUser.gender : 0,
"age": authUser.age != null ? authUser.age : 0,
"IsGetNearAppointment": false,
"Latitude": 0,
"Longitude": 0,
@ -95,9 +95,9 @@ class DoctorsListService extends BaseService {
"ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": false,
"DoctorName": docName,
"PatientID": authUser.patientID,
"gender": authUser.gender,
"age": authUser.age,
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"gender": authUser.gender != null ? authUser.gender : 0,
"age": authUser.age != null ? authUser.age : 0,
"IsGetNearAppointment": false,
"Latitude": 0,
"Longitude": 0,
@ -697,6 +697,107 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getCallRequestType(BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(GET_CALL_REQUEST_TYPE,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> sendAskDocCallRequest(AppoitmentAllHistoryResultList appo,
String requestType, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"ProjectID": appo.projectID,
"SetupID": appo.setupID,
"DoctorID": appo.doctorID,
"RequestType": requestType,
"RequestTypeID": requestType,
"PatientMobileNumber": authUser.mobileNumber,
"IsMessageSent": false,
"RequestDate":
DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now())
.split(" ")[0],
"RequestTime":
DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now())
.split(" ")[1],
"Remarks": "",
"Status": 1,
"CreatedBy": 102,
"CreatedOn":
DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now())
.split(" ")[0],
"EditedBy": 102,
"EditedOn":
DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now())
.split(" ")[0],
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(SEND_CALL_REQUEST,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientRadOrders(String appoNo, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
@ -736,6 +837,96 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getPatientPrescriptionReports(
AppoitmentAllHistoryResultList appo, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentNo": appo.appointmentNo,
"ClinicID": appo.clinicID,
"ProjectID": appo.projectID,
"EpisodeID": appo.episodeID,
"VersionID": req.VersionID,
"SetupID": appo.setupID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(GET_PRESCRIPTION_REPORT_ENH,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> sendPrescriptionEmail(String appoDate, String setupId,
dynamic prescriptionReportEnhList, BuildContext context) async {
Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentDate": appoDate,
"DateofBirth": authUser.dateofBirth,
"ListPrescriptions": prescriptionReportEnhList,
"PatientIditificationNum": authUser.patientIdentificationNo,
"PatientMobileNumber": authUser.mobileNumber,
"PatientName": authUser.firstName + " " + authUser.lastName,
"To": authUser.emailAddress,
"SetupID": setupId,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(SEND_PRESCRIPTION_EMAIL,
onSuccess: (response, statusCode) async {
localRes = response;
Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog();
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> createAdvancePayment(
AppoitmentAllHistoryResultList appo,

@ -47,6 +47,13 @@ class AppSharedPreferences {
return prefs.getString(key);
}
/// Get String [key] the key was saved
getStringWithDefaultValue(String key, String defaultVal) async {
final SharedPreferences prefs = await _prefs;
String value = prefs.getString(key);
return value == null ? defaultVal : value;
}
/// Get List of String [key] the key was saved
getStringList(String key) async {
final SharedPreferences prefs = await _prefs;

@ -157,6 +157,25 @@ class DateUtil {
return "";
}
/// get data formatted like 2020-8-13 09:43:00
/// [dateTime] convert DateTime to data formatted
static String getYearMonthDayHourMinSecDateFormatted(DateTime dateTime) {
if (dateTime != null)
return dateTime.year.toString() +
"-" +
dateTime.month.toString() +
"-" +
dateTime.day.toString() +
" " +
dateTime.hour.toString() +
":" +
dateTime.minute.toString() +
":" +
dateTime.second.toString();
else
return "";
}
static convertISODateToJsonDate(String isoDate) {
return "/Date(" +
DateFormat('mm-dd-yyy')

@ -402,6 +402,8 @@ class TranslationBase {
String get seeDetails => localizedValues['seeDetails'][locale.languageCode];
String get insuranceCards =>
localizedValues['insuranceCards'][locale.languageCode];
String get requestType =>
localizedValues['requestType'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -26,7 +26,7 @@ class MedicalProfileItem extends StatelessWidget {
Text(
title,
style: TextStyle(
fontSize: 1.7 * SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier,
color: Hexcolor('#B8382C'),
fontWeight: FontWeight.bold),
),

@ -5,23 +5,20 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/services.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
class MyInAppBrowser extends InAppBrowser {
// static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
// ignore: non_constant_identifier_names
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 =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
// static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
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 PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
static List<String> successURLS = [
'success',
@ -52,41 +49,6 @@ class MyInAppBrowser extends InAppBrowser {
@override
Future onLoadStart(String url) async {
onLoadStartCallback(url);
// print("\n\nStarted $url\n\n");
// if (successURLS.length != 0) {
// successURLS.forEach((element) {
// if (url.contains(element)) {
// try {
// if (browser.isOpened()) browser.close();
// isPaymentDone = true;
// Utils.hideProgressDialog();
// return;
// } on MissingPluginException catch (exception) {
// Utils.hideProgressDialog();
// } catch (error) {
// Utils.hideProgressDialog();
// }
// }
// });
// }
//
// if (errorURLS.length != 0) {
// errorURLS.forEach((element) {
// if (url.contains(element)) {
// try {
// if (browser.isOpened()) browser.close();
// isPaymentDone = false;
// Utils.hideProgressDialog();
// return;
// } on MissingPluginException catch (exception) {
// Utils.hideProgressDialog();
// } catch (error) {
// Utils.hideProgressDialog();
// }
// }
// });
// }
}
@override
@ -148,12 +110,11 @@ class MyInAppBrowser extends InAppBrowser {
this.browser.openUrl(
url: generateURL(amount, orderDesc, transactionID, projId, emailId,
paymentMethod, authenticatedUser));
}
// this.browser.openData(
// data: generateURL(amount, orderDesc, transactionID, projId, emailId,
// paymentMethod, authenticatedUser),
// baseUrl:
// "https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx");
openBrowser(String url) {
this.browser = browser;
this.browser.openUrl(url: url);
}
String generateURL(

Loading…
Cancel
Save