|
|
|
|
@ -1,7 +1,10 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/insurance_aprovals_request.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import '../../../config/shared_pref_kay.dart';
|
|
|
|
|
@ -30,6 +33,9 @@ class InsuranceApprovalsScreen extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
|
|
|
|
|
PatientsProvider patientsProv;
|
|
|
|
|
var approvalsList;
|
|
|
|
|
var filteredApprovalsList;
|
|
|
|
|
final _controller = TextEditingController();
|
|
|
|
|
var _isInit = true;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
@ -46,13 +52,15 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
|
|
|
|
|
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
|
|
|
|
|
|
|
|
|
|
print(type);
|
|
|
|
|
InsuranceAprovalsRequest insuranceApprovalsRequest = InsuranceAprovalsRequest(
|
|
|
|
|
patientID: patient.patientId,
|
|
|
|
|
projectID: patient.projectId,
|
|
|
|
|
tokenID: token,
|
|
|
|
|
patientTypeID: patient.patientType,
|
|
|
|
|
languageID: 2);
|
|
|
|
|
patientsProv.getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson());
|
|
|
|
|
InsuranceAprovalsRequest insuranceApprovalsRequest =
|
|
|
|
|
InsuranceAprovalsRequest(
|
|
|
|
|
patientID: patient.patientId,
|
|
|
|
|
projectID: patient.projectId,
|
|
|
|
|
tokenID: token,
|
|
|
|
|
patientTypeID: patient.patientType,
|
|
|
|
|
languageID: 2);
|
|
|
|
|
patientsProv
|
|
|
|
|
.getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -61,8 +69,9 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
|
|
|
|
|
if (_isInit) {
|
|
|
|
|
patientsProv = Provider.of<PatientsProvider>(context);
|
|
|
|
|
getInsuranceApprovalsList(context);
|
|
|
|
|
approvalsList = patientsProv.insuranceApporvalsList;
|
|
|
|
|
_isInit = false;
|
|
|
|
|
}
|
|
|
|
|
_isInit = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -75,62 +84,320 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
|
|
|
|
|
? DrAppCircularProgressIndeicator()
|
|
|
|
|
: patientsProv.isError
|
|
|
|
|
? DrAppEmbeddedError(error: patientsProv.error)
|
|
|
|
|
: patientsProv.insuranceApporvalsList.length == 0
|
|
|
|
|
: patientsProv.insuranceApporvalsList == null
|
|
|
|
|
? DrAppEmbeddedError(
|
|
|
|
|
error: 'You don\'t have any Insurance Approvals')
|
|
|
|
|
: Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(
|
|
|
|
|
SizeConfig.realScreenWidth * 0.05,
|
|
|
|
|
0,
|
|
|
|
|
SizeConfig.realScreenWidth * 0.05,
|
|
|
|
|
0),
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
itemCount:
|
|
|
|
|
patientsProv.insuranceApporvalsList.length,
|
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
|
return RoundedContainer(
|
|
|
|
|
backgroundColor: Colors.yellow[200],
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
patientsProv
|
|
|
|
|
.insuranceApporvalsList[index]
|
|
|
|
|
["ClinicName"]+"-"+patientsProv
|
|
|
|
|
.insuranceApporvalsList[index]
|
|
|
|
|
["DoctorName"],
|
|
|
|
|
marginTop: 10,
|
|
|
|
|
marginLeft: 10,
|
|
|
|
|
marginBottom: 5,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
convertDateFormat(patientsProv
|
|
|
|
|
.insuranceApporvalsList[index]
|
|
|
|
|
["ApprovalDate"]),
|
|
|
|
|
marginLeft: 10,
|
|
|
|
|
color: Colors.grey[600],
|
|
|
|
|
),
|
|
|
|
|
Divider(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
patientsProv
|
|
|
|
|
.insuranceApporvalsList[index]
|
|
|
|
|
["CompanyName"],
|
|
|
|
|
margin: 10,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
}),
|
|
|
|
|
: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(10),
|
|
|
|
|
width: SizeConfig.screenWidth * 0.80,
|
|
|
|
|
child: TextField(
|
|
|
|
|
controller: _controller,
|
|
|
|
|
onChanged: (String str) {
|
|
|
|
|
this.searchData(str);
|
|
|
|
|
},
|
|
|
|
|
decoration: buildInputDecoration(
|
|
|
|
|
context, 'Search Insurance Approvals'),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(
|
|
|
|
|
SizeConfig.realScreenWidth * 0.05,
|
|
|
|
|
0,
|
|
|
|
|
SizeConfig.realScreenWidth * 0.05,
|
|
|
|
|
0),
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
itemCount: approvalsList.length,
|
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
|
return RoundedContainer(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
ExpansionTile(
|
|
|
|
|
title: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Icon(
|
|
|
|
|
approvalsList[index][
|
|
|
|
|
"ApprovalStatusDescption"]
|
|
|
|
|
.toString()
|
|
|
|
|
.contains("Approved")
|
|
|
|
|
? Icons.check_circle_outline
|
|
|
|
|
: approvalsList[index][
|
|
|
|
|
"ApprovalStatusDescption"]
|
|
|
|
|
.toString()
|
|
|
|
|
.contains("Cancelled")
|
|
|
|
|
? Icons.highlight_off
|
|
|
|
|
: Icons.history,
|
|
|
|
|
color: approvalsList[index][
|
|
|
|
|
"ApprovalStatusDescption"]
|
|
|
|
|
.toString()
|
|
|
|
|
.contains("Approved")
|
|
|
|
|
? Colors.green
|
|
|
|
|
: approvalsList[index][
|
|
|
|
|
"ApprovalStatusDescption"]
|
|
|
|
|
.toString()
|
|
|
|
|
.contains("Cancelled")
|
|
|
|
|
? Colors.red
|
|
|
|
|
: Colors.yellow,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
approvalsList[index]
|
|
|
|
|
["ClinicName"],
|
|
|
|
|
marginTop: 10,
|
|
|
|
|
marginLeft: 10,
|
|
|
|
|
marginBottom: 5,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
approvalsList[index]
|
|
|
|
|
["DoctorName"],
|
|
|
|
|
marginLeft: 10,
|
|
|
|
|
marginTop: 1,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
convertDateFormat(
|
|
|
|
|
approvalsList[index]
|
|
|
|
|
["ApprovalDate"]),
|
|
|
|
|
marginLeft: 10,
|
|
|
|
|
marginBottom: 5,
|
|
|
|
|
color: Colors.grey[600],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Divider(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
backgroundColor:
|
|
|
|
|
Color(PRIMARY_COLOR),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
"Approval No:",
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
margin: 10,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
approvalsList[index]
|
|
|
|
|
["ApprovalNo"]
|
|
|
|
|
.toString(),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 19,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
margin: 5,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
"PRODUCER NAME",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
marginLeft: SizeConfig
|
|
|
|
|
.widthMultiplier *
|
|
|
|
|
3,
|
|
|
|
|
),
|
|
|
|
|
AppText(checkList(approvalsList[index]["ApporvalDetails"])?
|
|
|
|
|
approvalsList[index]
|
|
|
|
|
[
|
|
|
|
|
"ApporvalDetails"][0]
|
|
|
|
|
[
|
|
|
|
|
"ProcedureName"] : "",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
marginLeft: SizeConfig
|
|
|
|
|
.widthMultiplier *
|
|
|
|
|
3,
|
|
|
|
|
marginTop: 3,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
"STATUS",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
marginLeft: SizeConfig
|
|
|
|
|
.widthMultiplier *
|
|
|
|
|
9,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
approvalsList[index]
|
|
|
|
|
[
|
|
|
|
|
"ApprovalStatusDescption"],
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
marginLeft: SizeConfig
|
|
|
|
|
.widthMultiplier *
|
|
|
|
|
9,
|
|
|
|
|
marginTop: 3,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
"RECEIPT ON",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
marginLeft: SizeConfig
|
|
|
|
|
.widthMultiplier *
|
|
|
|
|
3,
|
|
|
|
|
marginTop: SizeConfig
|
|
|
|
|
.heightMultiplier *
|
|
|
|
|
1.5,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
convertDateFormat( approvalsList[index]
|
|
|
|
|
["ReceiptOn"]),
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
marginLeft: SizeConfig
|
|
|
|
|
.widthMultiplier *
|
|
|
|
|
3,
|
|
|
|
|
marginTop: 3,
|
|
|
|
|
marginBottom: SizeConfig.heightMultiplier*2,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
"EXPIRY DATE",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
marginTop: SizeConfig
|
|
|
|
|
.heightMultiplier *
|
|
|
|
|
1.5,
|
|
|
|
|
marginLeft: SizeConfig
|
|
|
|
|
.widthMultiplier *
|
|
|
|
|
9,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
convertDateFormat(
|
|
|
|
|
approvalsList[
|
|
|
|
|
index][
|
|
|
|
|
"ExpiryDate"]),
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
marginLeft: SizeConfig
|
|
|
|
|
.widthMultiplier *
|
|
|
|
|
9,
|
|
|
|
|
marginTop: 3,
|
|
|
|
|
marginBottom: SizeConfig.heightMultiplier*2,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InputDecoration buildInputDecoration(BuildContext context, hint) {
|
|
|
|
|
return InputDecoration(
|
|
|
|
|
prefixIcon: Icon(Icons.search, color: Colors.black),
|
|
|
|
|
filled: true,
|
|
|
|
|
fillColor: Colors.white,
|
|
|
|
|
hintText: hint,
|
|
|
|
|
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
|
|
|
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
|
|
|
|
),
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
|
|
|
|
borderSide: BorderSide(color: Colors.grey), //),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
searchData(String str) {
|
|
|
|
|
var strExist = str.length > 0 ? true : false;
|
|
|
|
|
|
|
|
|
|
if (strExist) {
|
|
|
|
|
filteredApprovalsList = null;
|
|
|
|
|
filteredApprovalsList = approvalsList
|
|
|
|
|
.where((note) =>
|
|
|
|
|
note["ClinicName"].toString().contains(str.toUpperCase()))
|
|
|
|
|
.toList();
|
|
|
|
|
setState(() {
|
|
|
|
|
approvalsList = filteredApprovalsList;
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
setState(() {
|
|
|
|
|
approvalsList = patientsProv.insuranceApporvalsList;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
convertDateFormat(String str) {
|
|
|
|
|
const start = "/Date(";
|
|
|
|
|
const end = "+0300)";
|
|
|
|
|
@ -148,4 +415,7 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
|
|
|
|
|
|
|
|
|
|
return newDate.toString();
|
|
|
|
|
}
|
|
|
|
|
bool checkList(List list){
|
|
|
|
|
return list.length > 0 ? true : false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|