|
|
|
|
@ -1,19 +1,17 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
|
|
|
|
|
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
|
|
class DischargeSummaryWidget extends StatefulWidget {
|
|
|
|
|
final GetDischargeSummaryResModel dischargeSummary;
|
|
|
|
|
@ -26,27 +24,54 @@ class DischargeSummaryWidget extends StatefulWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
|
|
|
|
|
bool isCardExpanded = true;
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
child: CardWithBgWidget(
|
|
|
|
|
bgColor:Colors.transparent,
|
|
|
|
|
hasBorder: false,
|
|
|
|
|
widget: Container(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
|
|
|
|
|
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: Padding(
|
|
|
|
|
padding: EdgeInsets.all(15.0),
|
|
|
|
|
child: HeaderBodyExpandableNotifier(
|
|
|
|
|
headerWidget: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
AppDateUtils.getDateTimeFromServerFormat(
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context).doctorName + ": ",
|
|
|
|
|
value: widget.dischargeSummary.doctorID.toString() ??
|
|
|
|
|
"".toString(),
|
|
|
|
|
isCopyable: false,
|
|
|
|
|
),
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context).branch + ": ",
|
|
|
|
|
value: widget.dischargeSummary.projectID.toString() ??
|
|
|
|
|
"".toString(),
|
|
|
|
|
isCopyable: false,
|
|
|
|
|
),
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context).clinicName + ": ",
|
|
|
|
|
value: widget.dischargeSummary.clinicID.toString() ??
|
|
|
|
|
"".toString(),
|
|
|
|
|
isCopyable: false,
|
|
|
|
|
),
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context).dischargeDate + ": ",
|
|
|
|
|
value: AppDateUtils.getDateTimeFromServerFormat(
|
|
|
|
|
widget.dischargeSummary.createdOn)
|
|
|
|
|
.day
|
|
|
|
|
.toString() +
|
|
|
|
|
@ -62,61 +87,149 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
|
|
|
|
|
widget.dischargeSummary.createdOn)
|
|
|
|
|
.year
|
|
|
|
|
.toString(),
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
isCopyable: false,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
AppDateUtils.getDateTimeFromServerFormat(
|
|
|
|
|
widget.dischargeSummary.createdOn)
|
|
|
|
|
.hour
|
|
|
|
|
.toString() +
|
|
|
|
|
":" +
|
|
|
|
|
AppDateUtils.getDateTimeFromServerFormat(
|
|
|
|
|
widget.dischargeSummary.createdOn)
|
|
|
|
|
.minute
|
|
|
|
|
.toString(),
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isCardExpanded = !isCardExpanded;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Icon(isCardExpanded
|
|
|
|
|
? EvaIcons.arrowUp
|
|
|
|
|
: EvaIcons.arrowDown))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
bodyWidget: Row(
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 20,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// SizedBox(height: 10,),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
CustomRow(
|
|
|
|
|
label: TranslationBase.of(context).fileNumber,
|
|
|
|
|
value: widget.dischargeSummary.patientID.toString(),
|
|
|
|
|
isCopyable:false,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15.0,
|
|
|
|
|
),
|
|
|
|
|
AppText("More Details"),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15.0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.5,
|
|
|
|
|
child: RichText(
|
|
|
|
|
maxLines: 3,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
text: new TextSpan(
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 1.3 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Color(0xFF575757)),
|
|
|
|
|
children: <TextSpan>[
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text: "Past History" + ": ",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.getTextMultiplierBasedOnWidth() *
|
|
|
|
|
2.8,
|
|
|
|
|
color: Color(0xFF575757),
|
|
|
|
|
//TranslationBase.of(context).doctorResponse + " : ",
|
|
|
|
|
)),
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text: Helpers.parseHtmlString(
|
|
|
|
|
widget.dischargeSummary.pastHistory),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.getTextMultiplierBasedOnWidth() *
|
|
|
|
|
3,
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5.0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.5,
|
|
|
|
|
child: RichText(
|
|
|
|
|
maxLines: 3,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
text: new TextSpan(
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 1.3 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Color(0xFF575757)),
|
|
|
|
|
children: <TextSpan>[
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text: "Investigations" + ": ",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.getTextMultiplierBasedOnWidth() *
|
|
|
|
|
2.8,
|
|
|
|
|
color: Color(0xFF575757),
|
|
|
|
|
//TranslationBase.of(context).doctorResponse + " : ",
|
|
|
|
|
)),
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text: Helpers.parseHtmlString(
|
|
|
|
|
widget.dischargeSummary.investigations ??
|
|
|
|
|
""),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.getTextMultiplierBasedOnWidth() *
|
|
|
|
|
3,
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5.0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.5,
|
|
|
|
|
child: RichText(
|
|
|
|
|
maxLines: 3,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
text: new TextSpan(
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 1.3 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Color(0xFF575757)),
|
|
|
|
|
children: <TextSpan>[
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text: "Condition On Discharge" + ": ",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.getTextMultiplierBasedOnWidth() *
|
|
|
|
|
2.8,
|
|
|
|
|
color: Color(0xFF575757),
|
|
|
|
|
//TranslationBase.of(context).doctorResponse + " : ",
|
|
|
|
|
)),
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text: Helpers.parseHtmlString(widget
|
|
|
|
|
.dischargeSummary.conditionOnDischarge),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.getTextMultiplierBasedOnWidth() *
|
|
|
|
|
3,
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5.0,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.5,
|
|
|
|
|
child: RichText(
|
|
|
|
|
@ -128,9 +241,7 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
|
|
|
|
|
color: Color(0xFF575757)),
|
|
|
|
|
children: <TextSpan>[
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text:
|
|
|
|
|
TranslationBase.of(context).requestType +
|
|
|
|
|
": ",
|
|
|
|
|
text: "Planed Procedure" + ": ",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.getTextMultiplierBasedOnWidth() *
|
|
|
|
|
@ -139,8 +250,8 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
|
|
|
|
|
//TranslationBase.of(context).doctorResponse + " : ",
|
|
|
|
|
)),
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text:
|
|
|
|
|
"${widget.dischargeSummary.dischargeInstructions}",
|
|
|
|
|
text: Helpers.parseHtmlString(
|
|
|
|
|
widget.dischargeSummary.planedProcedure),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
@ -157,15 +268,130 @@ class _DischargeSummaryWidgetState extends State<DischargeSummaryWidget> {
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// Container(
|
|
|
|
|
// alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight,
|
|
|
|
|
// child: Icon(FontAwesomeIcons.arrowRight,
|
|
|
|
|
// size: 20, color: Colors.black),)
|
|
|
|
|
],
|
|
|
|
|
isExpand: isCardExpanded,
|
|
|
|
|
// widget: Container(
|
|
|
|
|
// child: InkWell(
|
|
|
|
|
// child: Row(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: [],
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(
|
|
|
|
|
// height: 20,
|
|
|
|
|
// ),
|
|
|
|
|
//
|
|
|
|
|
// Row(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// SizedBox(
|
|
|
|
|
// width: 20,
|
|
|
|
|
// ),
|
|
|
|
|
// Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// // SizedBox(height: 10,),
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// CustomRow(
|
|
|
|
|
// label: TranslationBase.of(context)
|
|
|
|
|
// .fileNumber,
|
|
|
|
|
// value: widget.dischargeSummary.patientID
|
|
|
|
|
// .toString(),
|
|
|
|
|
// isCopyable: false,
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(
|
|
|
|
|
// height: 8,
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
//
|
|
|
|
|
// Container(
|
|
|
|
|
// width: MediaQuery.of(context).size.width * 0.5,
|
|
|
|
|
// child: RichText(
|
|
|
|
|
// maxLines: 3,
|
|
|
|
|
// overflow: TextOverflow.ellipsis,
|
|
|
|
|
// text: new TextSpan(
|
|
|
|
|
// style: new TextStyle(
|
|
|
|
|
// fontSize: 1.3 * SizeConfig.textMultiplier,
|
|
|
|
|
// color: Color(0xFF575757)),
|
|
|
|
|
// children: <TextSpan>[
|
|
|
|
|
// new TextSpan(
|
|
|
|
|
// text: TranslationBase.of(context)
|
|
|
|
|
// .requestType +
|
|
|
|
|
// ": ",
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
// fontSize: SizeConfig
|
|
|
|
|
// .getTextMultiplierBasedOnWidth() *
|
|
|
|
|
// 2.8,
|
|
|
|
|
// color: Color(0xFF575757),
|
|
|
|
|
// //TranslationBase.of(context).doctorResponse + " : ",
|
|
|
|
|
// )),
|
|
|
|
|
// new TextSpan(
|
|
|
|
|
// text: Helpers.parseHtmlString(widget
|
|
|
|
|
// .dischargeSummary.pastHistory),
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
// fontFamily: 'Poppins',
|
|
|
|
|
// fontSize: SizeConfig
|
|
|
|
|
// .getTextMultiplierBasedOnWidth() *
|
|
|
|
|
// 3,
|
|
|
|
|
// color: Color(0xFF2E303A),
|
|
|
|
|
// fontWeight: FontWeight.w700,
|
|
|
|
|
// )),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
// children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// AppDateUtils.getDateTimeFromServerFormat(
|
|
|
|
|
// widget.dischargeSummary.createdOn)
|
|
|
|
|
// .day
|
|
|
|
|
// .toString() +
|
|
|
|
|
// " " +
|
|
|
|
|
// AppDateUtils.getMonth(
|
|
|
|
|
// AppDateUtils.getDateTimeFromServerFormat(
|
|
|
|
|
// widget.dischargeSummary.createdOn)
|
|
|
|
|
// .month)
|
|
|
|
|
// .toString()
|
|
|
|
|
// .substring(0, 3) +
|
|
|
|
|
// ' ' +
|
|
|
|
|
// AppDateUtils.getDateTimeFromServerFormat(
|
|
|
|
|
// widget.dischargeSummary.createdOn)
|
|
|
|
|
// .year
|
|
|
|
|
// .toString(),
|
|
|
|
|
// fontFamily: 'Poppins',
|
|
|
|
|
// fontWeight: FontWeight.w600,
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// // Container(
|
|
|
|
|
// // alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight,
|
|
|
|
|
// // child: Icon(FontAwesomeIcons.arrowRight,
|
|
|
|
|
// // size: 20, color: Colors.black),)
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// // onTap: onTap,
|
|
|
|
|
// )),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// onTap: onTap,
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|