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

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

@ -104,6 +104,9 @@ const ADD_ADVANCE_NUMBER_REQUEST =
const IS_ALLOW_ASK_DOCTOR = const IS_ALLOW_ASK_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; '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 //URL to get medicine and pharmacies list
const CHANNEL = 3; const CHANNEL = 3;

@ -251,5 +251,6 @@ const Map<String, Map<String, String>> localizedValues = {
"patientCard": {"en": "Patient Card ID: ", "ar": "رقم الاشتراك"}, "patientCard": {"en": "Patient Card ID: ", "ar": "رقم الاشتراك"},
"policyNumber": {"en": "Policy Number: ", "ar": "رقم بوليصة التاميت:"}, "policyNumber": {"en": "Policy Number: ", "ar": "رقم بوليصة التاميت:"},
"seeDetails": {"en": "SEE DETAILS", "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; int approvalNo;
String approvalStatusDescption; String approvalStatusDescption;
int unUsedCount; int unUsedCount;
//String companyName; //String companyName;
String expiryDate; String expiryDate;
String rceiptOn; String rceiptOn;
int appointmentNo;
InsuranceApprovalModel( InsuranceApprovalModel(
{this.versionID, {this.versionID,
@ -72,8 +74,11 @@ class InsuranceApprovalModel {
//this.companyName, //this.companyName,
this.expiryDate, this.expiryDate,
this.rceiptOn, this.rceiptOn,
this.approvalDetails}); this.approvalDetails,
this.appointmentNo});
InsuranceApprovalDetails x = InsuranceApprovalDetails(); InsuranceApprovalDetails x = InsuranceApprovalDetails();
InsuranceApprovalModel.fromJson(Map<String, dynamic> json) { InsuranceApprovalModel.fromJson(Map<String, dynamic> json) {
try { try {
rceiptOn = json['ReceiptOn']; rceiptOn = json['ReceiptOn'];
@ -102,6 +107,7 @@ class InsuranceApprovalModel {
clinicName = json['ClinicName']; clinicName = json['ClinicName'];
approvalDetails = approvalDetails =
InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]); InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]);
appointmentNo = json['AppointmentNo'];
} catch (e) { } catch (e) {
print(e); print(e);
} }
@ -122,8 +128,13 @@ class InsuranceApprovalModel {
data['TokenID'] = this.tokenID; data['TokenID'] = this.tokenID;
data['PatientTypeID'] = this.patientTypeID; data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType; data['PatientType'] = this.patientType;
data['EXuldAPPNO'] = this.eXuldAPPNO; if (appointmentNo == null) {
data['ProjectID'] = this.projectID; data['EXuldAPPNO'] = this.eXuldAPPNO;
data['ProjectID'] = this.projectID;
}
if (appointmentNo != null) {
data['AppointmentNo'] = this.appointmentNo;
}
return data; return data;
} }
} }

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

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

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

@ -24,21 +24,34 @@ class BaseAppClient {
try { try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE); //Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
// body['SetupID'] = SETUP_ID; body['SetupID'] = body.containsKey('SetupID')
// body['VersionID'] = VERSION_ID; ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID
// body['Channel'] = CHANNEL; : SETUP_ID;
// body['LanguageID'] = LANGUAGE; body['VersionID'] = body.containsKey('VersionID')
// body['IPAdress'] = IP_ADDRESS; ? body['VersionID'] != null ? body['VersionID'] : VERSION_ID
// body['generalid'] = GENERAL_ID; : VERSION_ID;
// body['PatientOutSA'] = PATIENT_OUT_SA; body['Channel'] = CHANNEL;
// body['SessionID'] = SESSION_ID; body['LanguageID'] = languageID == 'ar' ? 1 : 2;
// body['isDentalAllowedBackend'] = IS_DENTAL_ALLOWED_BACKEND; body['IPAdress'] = IP_ADDRESS;
// body['DeviceTypeID'] = DeviceTypeID; body['generalid'] = GENERAL_ID;
// body['PatientType'] = PATIENT_TYPE; body['PatientOutSA'] = body.containsKey('PatientOutSA')
// body['PatientTypeID'] = PATIENT_TYPE_ID; ? 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) { if (user != null) {
body['TokenID'] = token; //user['TokenID']; body['TokenID'] = token;
body['PatientID'] = user['PatientID']; body['PatientID'] = user['PatientID'];
body['PatientOutSA'] = user['OutSA']; body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = getSessionId(token); body['SessionID'] = getSessionId(token);
@ -59,27 +72,36 @@ class BaseAppClient {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
if (isAllowAny) { if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else if (parsed['IsAuthenticated'] == false || } else {
parsed['IsAuthenticated'] == null) { if (isAllowAny) {
if (parsed['isSMSSent'] == true) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 1) { } else if (!parsed['IsAuthenticated']) {
if (parsed['isSMSSent'] == true) {
onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode);
} else {
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logout();
}
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else if (parsed['Result'] == 'OK') { } else if (parsed['Result'] == 'OK') {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], if (parsed['SameClinicApptList'] != null) {
statusCode); onSuccess(parsed, statusCode);
logout(); } else {
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
}
} }
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode);
} else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
} }
} }
} else { } else {
@ -96,6 +118,6 @@ class BaseAppClient {
} }
String getSessionId(String id) { 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 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart'; 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/COC_items.dart';
import 'package:diplomaticquarterapp/core/model/feedback/request_insert_coc_item.dart'; import 'package:diplomaticquarterapp/core/model/feedback/request_insert_coc_item.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
@ -19,6 +20,7 @@ class FeedbackService extends BaseService {
String attachment, String attachment,
AppointmentHistory appointHistory}) async { AppointmentHistory appointHistory}) async {
hasError = false; hasError = false;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
_requestInsertCOCItem.attachment = attachment; _requestInsertCOCItem.attachment = attachment;
_requestInsertCOCItem.title = title; _requestInsertCOCItem.title = title;
@ -31,7 +33,7 @@ class FeedbackService extends BaseService {
_requestInsertCOCItem.patientName = user.firstName + " " + user.lastName; _requestInsertCOCItem.patientName = user.firstName + " " + user.lastName;
_requestInsertCOCItem.fileName = ""; _requestInsertCOCItem.fileName = "";
_requestInsertCOCItem.appVersion = VERSION_ID; _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.browserInfo = Platform.localHostname;
_requestInsertCOCItem.deviceInfo = Platform.localHostname; _requestInsertCOCItem.deviceInfo = Platform.localHostname;
_requestInsertCOCItem.resolution = "400x847"; _requestInsertCOCItem.resolution = "400x847";

@ -1,8 +1,8 @@
import 'package:diplomaticquarterapp/config/config.dart'; 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/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_card_update.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
class InsuranceCardService extends BaseService { class InsuranceCardService extends BaseService {
List<InsuranceCardModel> _cardList = List(); List<InsuranceCardModel> _cardList = List();
@ -10,7 +10,9 @@ class InsuranceCardService extends BaseService {
List<InsuranceApprovalModel> _insuranceApproval = List(); List<InsuranceApprovalModel> _insuranceApproval = List();
List<InsuranceCardModel> get cardList => _cardList; List<InsuranceCardModel> get cardList => _cardList;
List<InsuranceUpdateModel> get updatedCard => _cardUpdated; List<InsuranceUpdateModel> get updatedCard => _cardUpdated;
List<InsuranceApprovalModel> get insuranceApproval => _insuranceApproval; List<InsuranceApprovalModel> get insuranceApproval => _insuranceApproval;
clearInsuranceCard() { clearInsuranceCard() {
@ -96,11 +98,24 @@ class InsuranceCardService extends BaseService {
}, body: _insuranceUpdateModel.toJson()); }, body: _insuranceUpdateModel.toJson());
} }
Future getInsuranceApproval() async { Future getInsuranceApproval({int appointmentNo}) async {
hasError = false; hasError = false;
// _cardList.clear(); // _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, await baseAppClient.post(GET_PAtIENTS_INSURANCE_APPROVALS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print(response['HIS_Approval_List'].length);
_insuranceApproval.clear();
_insuranceApproval.length = 0;
response['HIS_Approval_List'].forEach((item) { response['HIS_Approval_List'].forEach((item) {
_insuranceApproval.add(InsuranceApprovalModel.fromJson(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,23 +4,20 @@ import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.
import '../base_service.dart'; import '../base_service.dart';
class VitalSignService extends BaseService { class VitalSignService extends BaseService {
List<VitalSignResModel> vitalSignResModelList = List(); List<VitalSignResModel> vitalSignResModelList = List();
Map<String, dynamic> body = Map();
Future getPatientRadOrders () async { Future getPatientRadOrders() async {
hasError = false; hasError = false;
await baseAppClient.post(GET_PATIENT_VITAL_SIGN, await baseAppClient.post(GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
vitalSignResModelList.clear(); vitalSignResModelList.clear();
response['List_DoctorPatientVitalSign'].forEach((vital) { response['List_DoctorPatientVitalSign'].forEach((vital) {
vitalSignResModelList.add(VitalSignResModel.fromJson(vital)); vitalSignResModelList.add(VitalSignResModel.fromJson(vital));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: Map()); }, body: Map());
} }
} }

@ -1,4 +1,7 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.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'; import 'package:flutter/material.dart';
class BaseViewModel extends ChangeNotifier { class BaseViewModel extends ChangeNotifier {
@ -9,8 +12,21 @@ class BaseViewModel extends ChangeNotifier {
String error = ""; String error = "";
AuthenticatedUser user;
AppSharedPreferences sharedPref = AppSharedPreferences();
void setState(ViewState viewState) { void setState(ViewState viewState) {
_state = viewState; _state = viewState;
notifyListeners(); 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_approval.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.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 '../../locator.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'base_view_model.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart';
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
class InsuranceViewModel extends BaseViewModel { class InsuranceViewModel extends BaseViewModel {
bool hasError = false; bool hasError = false;
@ -14,8 +13,10 @@ class InsuranceViewModel extends BaseViewModel {
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>(); InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
List<InsuranceCardModel> get insurance => _insuranceCardService.cardList; List<InsuranceCardModel> get insurance => _insuranceCardService.cardList;
List<InsuranceUpdateModel> get insuranceUpdate => List<InsuranceUpdateModel> get insuranceUpdate =>
_insuranceCardService.updatedCard; _insuranceCardService.updatedCard;
List<InsuranceApprovalModel> get insuranceApproval => List<InsuranceApprovalModel> get insuranceApproval =>
_insuranceCardService.insuranceApproval; _insuranceCardService.insuranceApproval;
@ -43,11 +44,15 @@ class InsuranceViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getInsuranceApproval() async { Future getInsuranceApproval({int appointmentNo}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _insuranceCardService.getInsuranceApproval(); if (appointmentNo != null)
await _insuranceCardService.getInsuranceApproval(
appointmentNo: appointmentNo);
else
await _insuranceCardService.getInsuranceApproval();
if (_insuranceCardService.hasError) { if (_insuranceCardService.hasError) {
error = _insuranceCardService.error; error = _insuranceCardService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -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/feedback/feedback_service.dart';
import 'core/service/hospital_service.dart'; import 'core/service/hospital_service.dart';
import 'core/service/medical/labs_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/my_doctor_service.dart';
import 'core/service/medical/prescriptions_service.dart'; import 'core/service/medical/prescriptions_service.dart';
import 'core/service/medical/radiology_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/feedback/feedback_view_model.dart';
import 'core/viewModels/hospital_view_model.dart'; import 'core/viewModels/hospital_view_model.dart';
import 'core/viewModels/medical/labs_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/my_doctor_view_model.dart';
import 'core/viewModels/medical/prescriptions_view_model.dart'; import 'core/viewModels/medical/prescriptions_view_model.dart';
import 'core/viewModels/medical/radiology_view_model.dart'; import 'core/viewModels/medical/radiology_view_model.dart';
@ -34,7 +36,7 @@ void setupLocator() {
locator.registerLazySingleton(() => FeedbackService()); locator.registerLazySingleton(() => FeedbackService());
locator.registerLazySingleton(() => InsuranceCardService()); locator.registerLazySingleton(() => InsuranceCardService());
locator.registerLazySingleton(() => VitalSignService()); locator.registerLazySingleton(() => VitalSignService());
locator.registerLazySingleton(() => MedicalService());
/// View Model /// View Model
locator.registerFactory(() => HospitalViewModel()); locator.registerFactory(() => HospitalViewModel());
@ -46,4 +48,5 @@ void setupLocator() {
locator.registerFactory(() => FeedbackViewModel()); locator.registerFactory(() => FeedbackViewModel());
locator.registerFactory(() => VitalSignViewModel()); locator.registerFactory(() => VitalSignViewModel());
locator.registerFactory(() => InsuranceViewModel()); locator.registerFactory(() => InsuranceViewModel());
locator.registerFactory(() => MedicalViewModel());
} }

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

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

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

@ -13,13 +13,13 @@ class ArrivedButtons {
"title": "Medicines", "title": "Medicines",
"subtitle": "Prescriptions", "subtitle": "Prescriptions",
"icon": "assets/images/new-design/medicine_prescriptions_icon.png", "icon": "assets/images/new-design/medicine_prescriptions_icon.png",
"caller": "onCancelAppointment" "caller": "prescriptions"
}, },
{ {
"title": "Radiology", "title": "Radiology",
"subtitle": "Services", "subtitle": "Services",
"icon": "assets/images/new-design/radiology_service_icon.png", "icon": "assets/images/new-design/radiology_service_icon.png",
"caller": "insertComplaint" "caller": "radiology"
}, },
{ {
"title": "Lab", "title": "Lab",
@ -43,7 +43,7 @@ class ArrivedButtons {
"title": "Insurance", "title": "Insurance",
"subtitle": "Approvals", "subtitle": "Approvals",
"icon": "assets/images/new-design/insurance_approvals_icon.png", "icon": "assets/images/new-design/insurance_approvals_icon.png",
"caller": "goToTodoList" "caller": "Insurance"
}, },
{ {
"title": "Ask Your", "title": "Ask Your",
@ -55,7 +55,7 @@ class ArrivedButtons {
"title": "Survey", "title": "Survey",
"subtitle": "Service", "subtitle": "Service",
"icon": "assets/images/new-design/survey.png", "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/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.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/AppointmentType.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.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/BookedButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.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/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/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.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:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
@ -20,10 +28,12 @@ class AppointmentActions extends StatefulWidget {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
TabController tabController; TabController tabController;
final Function enableFooterButton; final Function enableFooterButton;
MyInAppBrowser browser;
AppointmentActions({@required this.appo, AppointmentActions(
@required this.tabController, {@required this.appo,
@required this.enableFooterButton}); @required this.tabController,
@required this.enableFooterButton});
@override @override
_AppointmentActionsState createState() => _AppointmentActionsState(); _AppointmentActionsState createState() => _AppointmentActionsState();
@ -40,9 +50,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var size = MediaQuery var size = MediaQuery.of(context).size;
.of(context)
.size;
final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2; final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2;
final double itemWidth = size.width / 2; final double itemWidth = size.width / 2;
@ -58,58 +66,57 @@ class _AppointmentActionsState extends State<AppointmentActions> {
crossAxisCount: 2, crossAxisCount: 2,
childAspectRatio: (itemWidth / itemHeight), childAspectRatio: (itemWidth / itemHeight),
children: appoButtonsList children: appoButtonsList
.map((e) => .map((e) => GestureDetector(
GestureDetector( onTap: () {
onTap: () { _handleButtonClicks(e);
_handleButtonClicks(e); },
}, child: Container(
child: Container( height: 100.0,
height: 100.0, margin: EdgeInsets.all(9.0),
margin: EdgeInsets.all(9.0), decoration: BoxDecoration(
decoration: BoxDecoration( boxShadow: [
boxShadow: [ BoxShadow(
BoxShadow( color: Colors.grey[400],
color: Colors.grey[400], blurRadius: 2.0,
blurRadius: 2.0, spreadRadius: 0.0)
spreadRadius: 0.0) ],
], borderRadius: BorderRadius.circular(10),
borderRadius: BorderRadius.circular(10), color: Colors.white),
color: Colors.white), child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min, children: <Widget>[
children: <Widget>[ Container(
Container( margin:
margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), child: Text(e.title,
child: Text(e.title, overflow: TextOverflow.clip,
overflow: TextOverflow.clip, style: TextStyle(
style: TextStyle( color: new Color(0xFFc5272d),
color: new Color(0xFFc5272d), letterSpacing: 1.0,
letterSpacing: 1.0, fontSize: 20.0)),
fontSize: 20.0)), ),
Container(
margin:
EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
child: Text(e.subtitle,
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.black,
letterSpacing: 1.0,
fontSize: 15.0)),
),
Container(
alignment: Alignment.bottomRight,
margin:
EdgeInsets.fromLTRB(0.0, 10.0, 10.0, 7.0),
child: Image.asset(e.icon,
width: 45.0, height: 45.0),
),
],
), ),
Container( ),
margin: ))
EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
child: Text(e.subtitle,
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.black,
letterSpacing: 1.0,
fontSize: 15.0)),
),
Container(
alignment: Alignment.bottomRight,
margin:
EdgeInsets.fromLTRB(0.0, 10.0, 10.0, 7.0),
child: Image.asset(e.icon,
width: 45.0, height: 45.0),
),
],
),
),
))
.toList(), .toList(),
), ),
), ),
@ -133,15 +140,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
case "onCancelAppointment": case "onCancelAppointment":
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: TranslationBase confirmMessage: TranslationBase.of(context).cancelAppoMsg,
.of(context) okText: TranslationBase.of(context).confirm,
.cancelAppoMsg, cancelText: TranslationBase.of(context).cancel_nocaps,
okText: TranslationBase
.of(context)
.confirm,
cancelText: TranslationBase
.of(context)
.cancel_nocaps,
okFunction: () => {cancelAppointment()}, okFunction: () => {cancelAppointment()},
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
@ -171,6 +172,18 @@ class _AppointmentActionsState extends State<AppointmentActions> {
case "radiology": case "radiology":
openAppointmentRadiology(); openAppointmentRadiology();
break; 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() { openAppointmentRadiology() {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
FinalRadiology finalRadiology = new FinalRadiology(); FinalRadiology finalRadiology = new FinalRadiology();
service.getPatientRadOrders(widget.appo.appointmentNo.toString(), context) service
.getPatientRadOrders(widget.appo.appointmentNo.toString(), context)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { print(res['FinalRadiologyList']);
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 { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: "Sorry there is no data");
} }
}).catchError((err) { }).catchError((err) {
print(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 { static Future<void> openMap(double latitude, double longitude) async {
String googleUrl = String googleUrl =
'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude'; 'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude';
@ -389,19 +445,80 @@ class _AppointmentActionsState extends State<AppointmentActions> {
askYourDoc() { askYourDoc() {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) {
.isAllowedToAskDoctor(widget.appo.doctorID, context)
.then((res) {
print(res['PatientDoctorAppointmentResultList']); print(res['PatientDoctorAppointmentResultList']);
if (res['PatientDoctorAppointmentResultList'].length != 0) { 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 { } else {
AppToast.showErrorToast(message: TranslationBase AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
.of(context)
.askDocNotAllowed);
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
AppToast.showErrorToast(message: err);
}); });
} }
@ -409,7 +526,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, .confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID,
widget.appo.projectID, context) widget.appo.projectID, context)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
@ -422,9 +539,17 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}); });
} }
loading(bool flag) { navigateToInsuranceApprovals(int appoNo) {
setState(() { Navigator.push(
AppointmentDetails.isLoading = flag; 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:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class CustomRadio extends StatefulWidget { class CustomRadio extends StatefulWidget {
List<AskDocRequestType> requestData;
CustomRadio({this.requestData});
@override @override
createState() { createState() {
return new CustomRadioState(); return new CustomRadioState();
@ -14,10 +20,18 @@ class CustomRadioState extends State<CustomRadio> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
sampleData.add(new RadioModel(false, "Before 30 Mins", 30));
sampleData.add(new RadioModel(false, 'Before 1 Hour', 60)); if (widget.requestData != null) {
sampleData.add(new RadioModel(false, 'Before 2 Hours', 120)); widget.requestData.forEach((element) {
sampleData.add(new RadioModel(false, 'Before 4 Hours', 240)); 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 @override
@ -35,8 +49,14 @@ class CustomRadioState extends State<CustomRadio> {
setState(() { setState(() {
sampleData.forEach((element) => element.isSelected = false); sampleData.forEach((element) => element.isSelected = false);
sampleData[index].isSelected = true; sampleData[index].isSelected = true;
ReminderDialog.selectedDuration = if (widget.requestData != null) {
sampleData[index].duration * 60000; AskDocDialog.selectedParameterCode =
sampleData[index].duration;
print(AskDocDialog.selectedParameterCode);
} else {
ReminderDialog.selectedDuration =
sampleData[index].duration * 60000;
}
}); });
}, },
child: new RadioItem(sampleData[index]), 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/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.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: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/core/viewModels/insurance_card_View_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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 { class InsuranceApproval extends StatefulWidget {
int appointmentNo;
InsuranceApproval({this.appointmentNo});
@override @override
_InsuranceApprovalState createState() => _InsuranceApprovalState(); _InsuranceApprovalState createState() => _InsuranceApprovalState();
} }
@ -17,7 +21,10 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<InsuranceViewModel>( 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) => builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,

@ -1,17 +1,20 @@
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/config/size_config.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/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/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 { class InsuranceCard extends StatefulWidget {
int appointmentNo;
InsuranceCard({this.appointmentNo});
@override @override
_InsuranceCardState createState() => _InsuranceCardState(); _InsuranceCardState createState() => _InsuranceCardState();
} }

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

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

@ -1,16 +1,21 @@
import 'dart:math'; 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/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/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_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/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/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/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/sliver_app_bar_delegate.dart'; import 'package:diplomaticquarterapp/widgets/others/sliver_app_bar_delegate.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:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
import '../../locator.dart';
import 'doctor/doctor_home_page.dart'; import 'doctor/doctor_home_page.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
@ -22,202 +27,414 @@ class MedicalProfilePage extends StatefulWidget {
} }
class _MedicalProfilePageState extends State<MedicalProfilePage> { class _MedicalProfilePageState extends State<MedicalProfilePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return BaseView<MedicalViewModel>(
body: CustomScrollView( onModelReady: (model) => model.getAppointmentHistory(),
physics: BouncingScrollPhysics(), builder: (_, model, widget) => AppScaffold(
key: PageStorageKey("medical"), baseViewModel: model,
slivers: <Widget>[ body: SafeArea(
SliverPersistentHeader( child: SingleChildScrollView(
delegate: SliverAppBarDelegate( child: Column(
maxHeight: 200.0, children: <Widget>[
minHeight: 200.0, Stack(
child: Container( children: <Widget>[
width: double.infinity, Column(
height: 200, children: <Widget>[
color: Colors.grey, Container(
), width: double.infinity,
), color: Colors.grey,
), height: 150,
SliverPersistentHeader( ),
delegate: SliverAppBarDelegate( Padding(
maxHeight: double.maxFinite, padding: EdgeInsets.symmetric(vertical: 12.0),
minHeight: double.maxFinite, child: Column(
child: Padding( children: <Widget>[
padding: EdgeInsets.symmetric(vertical: 12.0), Container(
child: Column( width: double.infinity,
children: <Widget>[ height: 30,
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context, FadePage(page: DoctorHomePage()));
},
child: MedicalProfileItem(
title: 'My Doctor',
imagePath: 'doctor_icon.png',
subTitle: 'List',
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {},
child: MedicalProfileItem(
title: 'Lab',
imagePath: 'lab_result_icon.png',
subTitle: 'Result',
), ),
), Row(
) children: <Widget>[
], Expanded(
), flex: 1,
Row( child: InkWell(
children: <Widget>[ onTap: () {
Expanded( Navigator.push(context,
flex: 1, FadePage(page: MyAppointments()));
child: InkWell( },
onTap: () => Navigator.push( child: MedicalProfileItem(
context, FadePage(page: RadiologyHomePage())), title: 'My Appointments',
child: MedicalProfileItem( imagePath: 'my_appointment_icon.png',
title: 'Radiology', subTitle: 'List',
imagePath: 'radiology_icon.png', ),
subTitle: 'Service', ),
),
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(
onTap: () {},
child: MedicalProfileItem(
title: 'Lab',
imagePath: 'lab_result_icon.png',
subTitle: 'Result',
),
),
),
],
), ),
), Row(
), children: <Widget>[
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(
FadePage(page: HomePrescriptionsPage())); context,
}, FadePage(
child: MedicalProfileItem( page: HomePrescriptionsPage()));
title: 'Medicines', },
imagePath: 'prescription_icon.png', child: MedicalProfileItem(
subTitle: 'Prescriptions', title: 'Medicines',
imagePath: 'prescription_icon.png',
subTitle: 'Prescriptions',
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: VitalSignDetailsScreen())),
child: MedicalProfileItem(
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,
Row( child: InkWell(
children: <Widget>[ onTap: () {
Expanded( Navigator.push(context,
flex: 1, FadePage(page: DoctorHomePage()));
child: InkWell( },
onTap: () { child: MedicalProfileItem(
Navigator.push( title: 'My Doctor',
context, FadePage(page: InsuranceCard())); imagePath: 'doctor_icon.png',
}, subTitle: 'List',
child: MedicalProfileItem( ),
title: 'Insurance', ),
imagePath: 'insurance_card_icon.png', ),
subTitle: 'Card', Expanded(
flex: 1,
child: InkWell(
//TODO
// onTap: () {
// Navigator.push(context,
// FadePage(page: InsuranceApproval()));
// },
child: MedicalProfileItem(
title: 'Eye',
imagePath:
'insurance_approvals_icon.png',
subTitle: 'Measurement',
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context,
FadePage(page: InsuranceCard()));
},
child: MedicalProfileItem(
title: 'Insurance',
imagePath: 'insurance_card_icon.png',
subTitle: 'Card',
),
),
),
],
), ),
), Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
//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: '',
),
),
),
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: 'insurance_approvals_icon.png',
subTitle: 'Reports',
),
),
),
Expanded(
flex: 1,
child: MedicalProfileItem(
title: 'Monthly',
imagePath: 'medical_history_icon.png',
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>[
Expanded(
flex: 1,
child: InkWell(
//TODO
// onTap: () {
// Navigator.push(
// context, FadePage(page: DoctorHomePage()));
// },
child: MedicalProfileItem(
title: 'Smart Watches',
imagePath: 'insurance_card_icon.png',
subTitle: 'Pairing',
),
),
),
Expanded(
flex: 1,
child: InkWell(
// 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: '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: 'Pairing',
),
),
),
Expanded(
flex: 1,
child: InkWell(
// 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: 'Ask Your',
imagePath: 'medical_history_icon.png',
subTitle: 'Doctor',
),
),
]),
],
), ),
Expanded( )
flex: 1, ],
child: InkWell( ),
onTap: () { if (model.user != null)
Navigator.push(context, Positioned(
FadePage(page: InsuranceApproval())); top: 110,
}, left: 20,
child: MedicalProfileItem( right: 20,
title: 'Insurance Approval', child: Container(
imagePath: 'insurance_approvals_icon.png', width: double.infinity,
subTitle: 'Card', height: 70,
), decoration: BoxDecoration(
), color: Colors.grey[600],
) shape: BoxShape.rectangle,
], border: Border.all(
), color: Colors.transparent, width: 0.5),
Row(children: <Widget>[ borderRadius: BorderRadius.all(Radius.circular(5)),
Expanded(
flex: 1,
child: MedicalProfileItem(
title: 'Medical',
imagePath: 'medical_history_icon.png',
subTitle: 'Reports',
), ),
), child: Column(
Expanded( crossAxisAlignment: CrossAxisAlignment.center,
flex: 1, children: <Widget>[
child: InkWell( SizedBox(
onTap: () => Navigator.push(context, height: 8,
FadePage(page: VitalSignDetailsScreen())),
child: MedicalProfileItem(
title: 'Vital Signs',
imagePath: 'medical_history_icon.png',
subTitle: 'Reports',
),
),
),
]),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context, FadePage(page: InsuranceUpdate()));
},
child: MedicalProfileItem(
title: 'Insurance Update',
imagePath: 'insurance_card_icon.png',
subTitle: 'Card',
), ),
), Texts(
), model.user.firstName +
Expanded( " " +
flex: 1, model.user.lastName,
child: InkWell( color: Colors.white,
onTap: () {},
child: MedicalProfileItem(
title: 'new',
imagePath: 'insurance_card_icon.png',
subTitle: 'Card',
), ),
), SizedBox(
) height: 8,
],
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context, FadePage(page: MyAppointments()));
},
child: MedicalProfileItem(
title: 'My Appointments',
imagePath: 'my_appointment_icon.png',
subTitle: 'List',
), ),
), Texts(
), '${model.user.patientID}',
Expanded( color: Colors.white,
flex: 1, ),
child: Container(), ],
), ),
], ),
), )
], ],
),
), ),
), ],
), ),
]), ),
),
),
); );
} }
} }

@ -42,14 +42,14 @@ class DoctorsListService extends BaseService {
"PatientOutSA": 0, "PatientOutSA": 0,
"TokenID": "", "TokenID": "",
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"SessionID": null, "SessionID": "YckwoXhUmWBsnHKEKig",
"ClinicID": clinicID, "ClinicID": clinicID,
"ProjectID": projectID, "ProjectID": projectID,
"ContinueDentalPlan": false, "ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": true, "IsSearchAppointmnetByClinicID": true,
"PatientID": authUser.patientID, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"gender": authUser.gender, "gender": authUser.gender != null ? authUser.gender : 0,
"age": authUser.age, "age": authUser.age != null ? authUser.age : 0,
"IsGetNearAppointment": false, "IsGetNearAppointment": false,
"Latitude": 0, "Latitude": 0,
"Longitude": 0, "Longitude": 0,
@ -95,9 +95,9 @@ class DoctorsListService extends BaseService {
"ContinueDentalPlan": false, "ContinueDentalPlan": false,
"IsSearchAppointmnetByClinicID": false, "IsSearchAppointmnetByClinicID": false,
"DoctorName": docName, "DoctorName": docName,
"PatientID": authUser.patientID, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"gender": authUser.gender, "gender": authUser.gender != null ? authUser.gender : 0,
"age": authUser.age, "age": authUser.age != null ? authUser.age : 0,
"IsGetNearAppointment": false, "IsGetNearAppointment": false,
"Latitude": 0, "Latitude": 0,
"Longitude": 0, "Longitude": 0,
@ -697,6 +697,107 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); 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 { Future<Map> getPatientRadOrders(String appoNo, BuildContext context) async {
Utils.showProgressDialog(context); Utils.showProgressDialog(context);
Map<String, dynamic> request; Map<String, dynamic> request;
@ -727,15 +828,105 @@ class DoctorsListService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_PATIENT_ORDERS, await baseAppClient.post(GET_PATIENT_ORDERS,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
Utils.hideProgressDialog(); Utils.hideProgressDialog();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
Utils.hideProgressDialog(); Utils.hideProgressDialog();
throw error; throw error;
}, body: request); }, body: request);
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); 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( Future<Map> createAdvancePayment(
AppoitmentAllHistoryResultList appo, AppoitmentAllHistoryResultList appo,

@ -47,6 +47,13 @@ class AppSharedPreferences {
return prefs.getString(key); 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 /// Get List of String [key] the key was saved
getStringList(String key) async { getStringList(String key) async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;

@ -157,6 +157,25 @@ class DateUtil {
return ""; 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) { static convertISODateToJsonDate(String isoDate) {
return "/Date(" + return "/Date(" +
DateFormat('mm-dd-yyy') DateFormat('mm-dd-yyy')

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

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

@ -5,23 +5,20 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
class MyInAppBrowser extends InAppBrowser { 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 = 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 PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
static List<String> successURLS = [ static List<String> successURLS = [
'success', 'success',
@ -52,41 +49,6 @@ class MyInAppBrowser extends InAppBrowser {
@override @override
Future onLoadStart(String url) async { Future onLoadStart(String url) async {
onLoadStartCallback(url); 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 @override
@ -148,12 +110,11 @@ class MyInAppBrowser extends InAppBrowser {
this.browser.openUrl( this.browser.openUrl(
url: generateURL(amount, orderDesc, transactionID, projId, emailId, url: generateURL(amount, orderDesc, transactionID, projId, emailId,
paymentMethod, authenticatedUser)); paymentMethod, authenticatedUser));
}
// this.browser.openData( openBrowser(String url) {
// data: generateURL(amount, orderDesc, transactionID, projId, emailId, this.browser = browser;
// paymentMethod, authenticatedUser), this.browser.openUrl(url: url);
// baseUrl:
// "https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx");
} }
String generateURL( String generateURL(

Loading…
Cancel
Save