Insurance Approval implemented

merge-update-with-lab-changes
haroon amjad 6 years ago
parent fde47a5c2c
commit 7972d01dff

@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://uat.hmgwebservices.com/Services';
const BASE_URL = 'https://hmgwebservices.com/Services';
const GET_PROJECT = '/Lists.svc/REST/GetProject';

@ -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;
data['EXuldAPPNO'] = this.eXuldAPPNO;
data['ProjectID'] = this.projectID;
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,

@ -25,18 +25,18 @@ class BaseAppClient {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
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'] = null; //SESSION_ID;
body['isDentalAllowedBackend'] = IS_DENTAL_ALLOWED_BACKEND;
body['DeviceTypeID'] = DeviceTypeID;
body['PatientType'] = PATIENT_TYPE;
body['PatientTypeID'] = PATIENT_TYPE_ID;
// 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'] = null; //SESSION_ID;
// body['isDentalAllowedBackend'] = IS_DENTAL_ALLOWED_BACKEND;
// body['DeviceTypeID'] = DeviceTypeID;
// body['PatientType'] = PATIENT_TYPE;
// body['PatientTypeID'] = PATIENT_TYPE_ID;
if (user != null) {
body['TokenID'] = token; //user['TokenID'];
body['PatientID'] = user['PatientID'];
@ -93,6 +93,6 @@ class BaseAppClient {
}
String getSessionId(String id) {
return id.replaceAll('/[^a-zA-Z ]', '');
return id.replaceAll(RegExp('/[^a-zA-Z ]'), '');
}
}

@ -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));
});

@ -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,11 +44,15 @@ class InsuranceViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getInsuranceApproval() async {
Future getInsuranceApproval({int appointmentNo}) async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _insuranceCardService.getInsuranceApproval();
if (appointmentNo != null)
await _insuranceCardService.getInsuranceApproval(
appointmentNo: appointmentNo);
else
await _insuranceCardService.getInsuranceApproval();
if (_insuranceCardService.hasError) {
error = _insuranceCardService.error;
setState(ViewState.ErrorLocal);

@ -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",

@ -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",

@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_repor
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';
@ -13,6 +12,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButton
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';
@ -20,6 +20,7 @@ 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';
@ -179,6 +180,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
case "Survey":
rateAppointment();
break;
case "Insurance":
navigateToInsuranceApprovals(widget.appo.appointmentNo);
break;
}
}
@ -530,6 +535,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
});
}
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=' +
@ -538,10 +548,4 @@ class _AppointmentActionsState extends State<AppointmentActions> {
widget.appo.appointmentNo.toString() +
'&c=1');
}
loading(bool flag) {
setState(() {
AppointmentDetails.isLoading = flag;
});
}
}

@ -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();
}

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
@ -81,7 +82,7 @@ class _LandingPageState extends State<LandingPage> {
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: [
HomePage(), MedicalProfilePage(), MyAdmissionsPage(), ToDo()],
HomePage(), MedicalProfilePage(), MyAdmissionsPage(), ToDo(), BookingOptions()], // Please do not remove the BookingOptions from this array
),
bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab),
);

Loading…
Cancel
Save