You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
doctor_app_flutter/lib/screens/patients/insurance_approvals_details...

791 lines
49 KiB
Dart

import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
5 years ago
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class InsuranceApprovalsDetails extends StatefulWidget {
PatiantInformtion patient;
int indexInsurance;
String patientType;
InsuranceApprovalsDetails({required this.patient, required this.indexInsurance, required this.patientType});
@override
_InsuranceApprovalsDetailsState createState() =>
_InsuranceApprovalsDetailsState(patient: patient, indexInsurance: indexInsurance, patientType: patientType);
}
class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
PatiantInformtion patient;
int indexInsurance;
String patientType;
_InsuranceApprovalsDetailsState({required this.patient, required this.indexInsurance, required this.patientType});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context!);
final routeArgs = ModalRoute.of(context!)!.settings.arguments as Map;
return BaseView<InsuranceViewModel>(
onModelReady: (model) => model.insuranceApprovalInPatient.length == 0
5 years ago
? patient.admissionNo != null
? (model) => model.getInsuranceInPatient(mrn: patient.patientId)
: patient.appointmentNo != null
? (model) => model.getInsuranceApproval(patient,
appointmentNo: patient.appointmentNo, projectId: patient.projectId)
: (model) => model.getInsuranceApproval(patient)
: null,
builder: (BuildContext? context, InsuranceViewModel? model, Widget? child) =>
AppScaffold(
isShowAppBar: true,
baseViewModel: model,
patientProfileAppBarModel:
PatientProfileAppBarModel(patient: patient),
5 years ago
body: patient.admissionNo != null
? SingleChildScrollView(
child: Container(
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
AppText(
TranslationBase.of(context!).insurance22,
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context!).approvals22,
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
],
),
],
),
),
Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 0.5,
color: Colors.white,
),
borderRadius: BorderRadius.all(
Radius.circular(15.0),
),
color: Colors.white),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
AppText(
model!.insuranceApprovalInPatient[
indexInsurance]
.approvalStatusDescption !=
null
? model!.insuranceApprovalInPatient[
indexInsurance]
.approvalStatusDescption ??
""
: "",
color: model!.insuranceApprovalInPatient[
indexInsurance]
.approvalStatusDescption !=
null
? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" ==
5 years ago
"Approved" ||
"${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" ==
"تمت الموافقة"
? Color(0xff359846)
: Color(0xffD02127)
: Color(0xffD02127),
),
],
),
Row(
children: [
AppText(
model!.insuranceApprovalInPatient[
indexInsurance]
.doctorName!
.toUpperCase(),
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.bold,
)
],
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8.0),
child: Row(
children: [
Column(
children: [
Container(
height: 85.0,
width: 85.0,
child: CircleAvatar(
radius: SizeConfig
.imageSizeMultiplier *
12,
// radius: (52)
child: ClipRRect(
borderRadius:
BorderRadius.circular(
50),
child: Image.network(
model!.insuranceApprovalInPatient[
indexInsurance]
.doctorImage!,
fit: BoxFit.fill,
width: 700,
),
),
backgroundColor:
Colors.transparent,
),
),
],
),
Expanded(
child: Padding(
padding:
const EdgeInsets.symmetric(
horizontal: 8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 25.0,
),
Row(
children: [
AppText(
5 years ago
TranslationBase.of(
context)
.clinic! +
5 years ago
": ",
color: Colors.grey[500],
fontSize: 14,
),
Expanded(
child: AppText(
model!.insuranceApprovalInPatient[
indexInsurance]
.clinicName,
fontSize: 14,
),
)
],
),
Row(
children: <Widget>[
AppText(
5 years ago
TranslationBase.of(
context)
.approvalNo! +
5 years ago
": ",
color: Colors.grey[500],
fontSize: 14,
),
AppText(
model!.insuranceApprovalInPatient[
indexInsurance]
.approvalNo
.toString(),
fontSize: 14,
)
],
),
Row(
children: <Widget>[
AppText(
'Unused Count:',
color: Colors.grey[500],
fontSize: 14,
),
AppText(
model!.insuranceApprovalInPatient[
indexInsurance]
.unUsedCount
.toString(),
fontSize: 14,
)
],
),
Row(
children: <Widget>[
AppText(
5 years ago
TranslationBase.of(
context)
.companyName! +
5 years ago
": ",
color: Colors.grey[500],
),
AppText('Sample')
],
),
Row(
children: [
AppText(
5 years ago
TranslationBase.of(
context)
.receiptOn! +
5 years ago
": ",
color: Colors.grey[500],
),
Expanded(
child: AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn!), isArabic: projectViewModel.isArabic)}',
color: Colors.black,
fontWeight:
FontWeight.w600,
),
),
],
),
Row(
children: [
AppText(
5 years ago
TranslationBase.of(
context)
.expiryDate! +
5 years ago
": ",
color: Colors.grey[500],
),
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}',
color: Colors.black,
fontWeight:
FontWeight.w600,
),
],
),
],
),
),
),
],
),
),
SizedBox(
height: 20.0,
),
Container(
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8.0),
child: Row(
children: [
Expanded(
child: AppText(
TranslationBase.of(context!)
5 years ago
.procedure,
fontWeight: FontWeight.w700,
),
),
Expanded(
child: AppText(
TranslationBase.of(context!)
5 years ago
.status,
fontWeight: FontWeight.w700,
),
),
Expanded(
child: AppText(
TranslationBase.of(context!)
5 years ago
.usageStatus,
fontWeight: FontWeight.w700,
),
)
],
),
),
Divider(
color: Colors.black,
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8.0),
child: ListView.builder(
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: model!.insuranceApprovalInPatient[
indexInsurance]
.apporvalDetails!
.length,
itemBuilder:
(BuildContext context,
int index) {
return Container(
child: Column(
children: [
Row(
children: [
Expanded(
child: Container(
child: AppText(
model!.insuranceApprovalInPatient[
indexInsurance]
?.apporvalDetails![
index]
?.procedureName ??
"",
textAlign:
TextAlign
.start,
),
),
),
Expanded(
child: Container(
child: AppText(
model!.insuranceApprovalInPatient[
indexInsurance]
?.apporvalDetails![
index]
?.status ??
"",
textAlign:
TextAlign
.center,
),
),
),
Expanded(
child: Container(
child: AppText(
model!.insuranceApprovalInPatient[
indexInsurance]
?.apporvalDetails![
index]
?.isInvoicedDesc ??
"",
textAlign:
TextAlign
.center,
),
),
),
],
),
SizedBox(
width: 5,
),
Divider(
color: Colors.black38,
),
],
),
);
}),
),
],
),
),
],
),
),
),
],
),
),
)
: SingleChildScrollView(
child: Container(
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
AppText(
TranslationBase.of(context!).insurance22,
fontSize: 15.0,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context!).approvals22,
fontSize: 30.0,
fontWeight: FontWeight.w700,
),
],
),
],
),
),
Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 0.5,
color: Colors.white,
),
borderRadius: BorderRadius.all(
Radius.circular(15.0),
),
color: Colors.white),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
AppText(
model!.insuranceApproval[
indexInsurance]
.approvalStatusDescption !=
null
? model!.insuranceApproval[
indexInsurance]
.approvalStatusDescption ??
""
: "",
color: model!.insuranceApproval[
indexInsurance]
.approvalStatusDescption !=
null
? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" ==
"Approved"
? Color(0xff359846)
: Color(0xffD02127)
: Color(0xffD02127),
),
],
),
Row(
children: [
AppText(
model!.insuranceApproval[indexInsurance]
.doctorName!
.toUpperCase(),
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.bold,
)
],
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8.0),
child: Row(
children: [
Column(
children: [
Container(
height: 85.0,
width: 85.0,
child: CircleAvatar(
radius: SizeConfig
.imageSizeMultiplier *
12,
// radius: (52)
child: ClipRRect(
borderRadius:
BorderRadius.circular(
50),
child: Image.network(
model!.insuranceApproval[
indexInsurance]
.doctorImage!,
fit: BoxFit.fill,
width: 700,
),
),
backgroundColor:
Colors.transparent,
),
),
],
),
Expanded(
child: Padding(
padding:
const EdgeInsets.symmetric(
horizontal: 8.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 25.0,
),
Row(
children: [
AppText(
5 years ago
TranslationBase.of(
context)
.clinic! +
5 years ago
": ",
color: Colors.grey[500],
fontSize: 14,
),
Expanded(
child: AppText(
model!.insuranceApproval[
indexInsurance]
.clinicName,
fontSize: 14,
),
)
],
),
Row(
children: <Widget>[
AppText(
5 years ago
TranslationBase.of(
context)
.approvalNo! +
5 years ago
": ",
color: Colors.grey[500],
fontSize: 14,
),
AppText(
model!.insuranceApproval[
indexInsurance]
.approvalNo
.toString(),
fontSize: 14,
)
],
),
Row(
children: <Widget>[
AppText(
5 years ago
TranslationBase.of(
context)
.unusedCount! +
5 years ago
": ",
color: Colors.grey[500],
fontSize: 14,
),
AppText(
model!.insuranceApproval[
indexInsurance]
.unUsedCount
.toString(),
fontSize: 14,
)
],
),
Row(
children: <Widget>[
AppText(
5 years ago
TranslationBase.of(
context)
.companyName! +
5 years ago
": ",
color: Colors.grey[500],
),
AppText('Sample')
],
),
Row(
children: [
AppText(
5 years ago
TranslationBase.of(
context)
.receiptOn! +
5 years ago
": ",
color: Colors.grey[500],
),
Expanded(
child: AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn!), isArabic: projectViewModel.isArabic)}',
color: Colors.black,
fontWeight:
FontWeight.w600,
),
),
],
),
Row(
children: [
AppText(
5 years ago
TranslationBase.of(
context)
.expiryDate! +
5 years ago
": ",
color: Colors.grey[500],
),
if (model!.insuranceApproval[
5 years ago
indexInsurance]
.expiryDate !=
null)
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model!.insuranceApproval[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}',
5 years ago
color: Colors.black,
fontWeight:
FontWeight.w600,
),
],
),
],
),
),
),
],
),
),
SizedBox(
height: 20.0,
),
Container(
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8.0),
child: Row(
children: [
Expanded(
child: AppText(
TranslationBase.of(context!)
5 years ago
.procedure,
fontWeight: FontWeight.w700,
),
),
Expanded(
child: AppText(
TranslationBase.of(context!)
5 years ago
.status,
fontWeight: FontWeight.w700,
),
),
Expanded(
child: AppText(
TranslationBase.of(context!)
5 years ago
.usageStatus,
fontWeight: FontWeight.w700,
),
)
],
),
),
Divider(
color: Colors.black,
),
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8.0),
child: ListView.builder(
shrinkWrap: true,
physics: ScrollPhysics(),
itemCount: model!.insuranceApproval[
indexInsurance]
.apporvalDetails!
.length,
itemBuilder:
(BuildContext context,
int index) {
return Container(
child: Column(
children: [
Row(
children: [
Expanded(
child: Container(
child: AppText(
model!.insuranceApproval[
indexInsurance]
?.apporvalDetails![
index]
?.procedureName ??
"",
textAlign:
TextAlign
.start,
),
),
),
Expanded(
child: Container(
child: AppText(
model!.insuranceApproval[
indexInsurance]
?.apporvalDetails![
index]
?.status ??
"",
textAlign:
TextAlign
.center,
),
),
),
Expanded(
child: Container(
child: AppText(
model!.insuranceApproval[
indexInsurance]
?.apporvalDetails![
index]
?.isInvoicedDesc ??
"",
textAlign:
TextAlign
.center,
),
),
),
],
),
SizedBox(
width: 5,
),
Divider(
color: Colors.black38,
),
],
),
);
}),
),
],
),
),
],
),
),
),
],
),
),
)),
);
}
}