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.
197 lines
5.6 KiB
Dart
197 lines
5.6 KiB
Dart
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
import "package:collection/collection.dart";
|
|
|
|
class AnicllaryOrdersDetails extends StatefulWidget {
|
|
final dynamic appoNo;
|
|
final dynamic orderNo;
|
|
AnicllaryOrdersDetails(this.appoNo, this.orderNo);
|
|
@override
|
|
_AnicllaryOrdersState createState() => _AnicllaryOrdersState();
|
|
}
|
|
|
|
class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
|
|
with SingleTickerProviderStateMixin {
|
|
void initState() {
|
|
super.initState();
|
|
}
|
|
|
|
void dispose() {
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BaseView<AnciallryOrdersViewModel>(
|
|
onModelReady: (model) =>
|
|
model.getOrdersDetails(widget.appoNo, widget.orderNo),
|
|
builder: (_, model, widget) => AppScaffold(
|
|
isShowAppBar: true,
|
|
baseViewModel: model,
|
|
appBarTitle: TranslationBase.of(context).anicllaryOrders,
|
|
body: SingleChildScrollView(
|
|
padding: EdgeInsets.all(12),
|
|
child: model.ancillaryListsDetails.length > 0
|
|
? Column(children: [
|
|
getPatientInfo(model),
|
|
getInvoiceDetails(model),
|
|
getInsuranceDetails(model),
|
|
getAncillaryDetails(model)
|
|
])
|
|
: SizedBox())));
|
|
}
|
|
|
|
Widget getPatientInfo(AnciallryOrdersViewModel model) {
|
|
print(model.ancillaryListsDetails);
|
|
return Padding(
|
|
child: Column(
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Texts(
|
|
TranslationBase.of(context).mrn,
|
|
fontWeight: FontWeight.bold,
|
|
fontSize: 22,
|
|
),
|
|
Texts(
|
|
" : ",
|
|
fontSize: 20,
|
|
),
|
|
Texts(
|
|
model.ancillaryListsDetails[0].patientID.toString(),
|
|
)
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Texts(
|
|
TranslationBase.of(context).patientName,
|
|
fontWeight: FontWeight.bold,
|
|
fontSize: 20,
|
|
),
|
|
Texts(
|
|
" : ",
|
|
fontSize: 20,
|
|
),
|
|
Texts(
|
|
model.ancillaryLists[0].patientName,
|
|
)
|
|
],
|
|
),
|
|
Divider(
|
|
color: Colors.black26,
|
|
)
|
|
],
|
|
),
|
|
padding: EdgeInsets.only(top: 5.0, bottom: 5.0),
|
|
);
|
|
}
|
|
|
|
Widget getInvoiceDetails(model) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Texts(
|
|
TranslationBase.of(context).invoiceNo,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
Texts(" : "),
|
|
Texts(
|
|
model.ancillaryListsDetails[0].appointmentNo.toString(),
|
|
)
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Texts(
|
|
TranslationBase.of(context).date,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
Texts(" : "),
|
|
Texts(
|
|
DateUtil.getFormattedDate(
|
|
DateUtil.convertStringToDate(
|
|
model.ancillaryListsDetails[0].appointmentDate),
|
|
"MMM dd,yyyy"),
|
|
)
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Texts(
|
|
TranslationBase.of(context).date,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
Texts(" : "),
|
|
Texts(
|
|
model.ancillaryListsDetails[0].doctorName,
|
|
),
|
|
],
|
|
),
|
|
SizedBox(
|
|
height: 10,
|
|
),
|
|
Divider(
|
|
color: Colors.black26,
|
|
)
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget getInsuranceDetails(model) {
|
|
return Padding(
|
|
padding: EdgeInsets.only(top: 10, bottom: 10),
|
|
child: Column(
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
children: [
|
|
Texts(
|
|
TranslationBase.of(context).insurance,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
Texts(
|
|
TranslationBase.of(context).insuranceID,
|
|
fontWeight: FontWeight.bold,
|
|
)
|
|
],
|
|
),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
children: [
|
|
Texts(
|
|
model.ancillaryListsDetails[0].policyName,
|
|
),
|
|
Texts(
|
|
model.ancillaryListsDetails[0].insurancePolicyNo,
|
|
)
|
|
],
|
|
),
|
|
SizedBox(
|
|
height: 15,
|
|
),
|
|
Divider(
|
|
color: Colors.red[800],
|
|
thickness: 3,
|
|
)
|
|
],
|
|
));
|
|
}
|
|
|
|
Widget getAncillaryDetails(model) {
|
|
var newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcList,
|
|
(obj) => obj.procedureCategoryName);
|
|
print(newMap);
|
|
return Padding(
|
|
padding: EdgeInsets.only(top: 10, bottom: 10),
|
|
child: Column(children: []));
|
|
}
|
|
}
|