|
|
|
@ -1,24 +1,24 @@
|
|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
import 'package:doctor_app_flutter/config/size_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/core/model/patient/patiant_info_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/date-utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/date-utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/utils/utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.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/card_with_bg_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'ShowTimer.dart';
|
|
|
|
import 'ShowTimer.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class PatientCard extends StatelessWidget {
|
|
|
|
class PatientCard extends StatelessWidget {
|
|
|
|
final PatiantInformtion? patientInfo;
|
|
|
|
final PatiantInformtion? patientInfo;
|
|
|
|
final Function? onTap;
|
|
|
|
final Function()? onTap;
|
|
|
|
final String patientType;
|
|
|
|
final String patientType;
|
|
|
|
final String arrivalType;
|
|
|
|
final String arrivalType;
|
|
|
|
final bool isInpatient;
|
|
|
|
final bool isInpatient;
|
|
|
|
@ -29,7 +29,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
PatientCard(
|
|
|
|
PatientCard(
|
|
|
|
{Key? key,
|
|
|
|
{Key? key,
|
|
|
|
this.patientInfo,
|
|
|
|
this.patientInfo,
|
|
|
|
this.onTap,
|
|
|
|
required this.onTap,
|
|
|
|
this.patientType = '',
|
|
|
|
this.patientType = '',
|
|
|
|
this.arrivalType = '',
|
|
|
|
this.arrivalType = '',
|
|
|
|
this.isInpatient = false,
|
|
|
|
this.isInpatient = false,
|
|
|
|
@ -52,11 +52,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
width: SizeConfig.screenWidth! * 0.9,
|
|
|
|
width: SizeConfig.screenWidth! * 0.9,
|
|
|
|
margin: EdgeInsets.all(6),
|
|
|
|
margin: EdgeInsets.all(6),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(left: projectViewModel.isArabic ? 5 : 0, right: projectViewModel.isArabic ? 0 : 5, bottom: 0, top: 0),
|
|
|
|
left: projectViewModel.isArabic ? 5 : 0,
|
|
|
|
|
|
|
|
right: projectViewModel.isArabic ? 0 : 5,
|
|
|
|
|
|
|
|
bottom: 0,
|
|
|
|
|
|
|
|
top: 0),
|
|
|
|
|
|
|
|
decoration: Utils.getCardBoxDecoration(),
|
|
|
|
decoration: Utils.getCardBoxDecoration(),
|
|
|
|
child: CardWithBgWidget(
|
|
|
|
child: CardWithBgWidget(
|
|
|
|
padding: 0,
|
|
|
|
padding: 0,
|
|
|
|
@ -99,8 +95,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
? Row(
|
|
|
|
? Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
PatientStatus(
|
|
|
|
PatientStatus(
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
label: TranslationBase.of(context).arrivedP,
|
|
|
|
.arrivedP,
|
|
|
|
|
|
|
|
color: AppGlobal.appGreenColor,
|
|
|
|
color: AppGlobal.appGreenColor,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
@ -117,12 +112,8 @@ class PatientCard extends StatelessWidget {
|
|
|
|
width: 8,
|
|
|
|
width: 8,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
PatientStatus(
|
|
|
|
PatientStatus(
|
|
|
|
label: patientInfo!.status == 2
|
|
|
|
label: patientInfo!.status == 2 ? 'Confirmed' : 'Booked',
|
|
|
|
? 'Confirmed'
|
|
|
|
color: patientInfo!.status == 2 ? AppGlobal.appGreenColor : Colors.grey,
|
|
|
|
: 'Booked',
|
|
|
|
|
|
|
|
color: patientInfo!.status == 2
|
|
|
|
|
|
|
|
? AppGlobal.appGreenColor
|
|
|
|
|
|
|
|
: Colors.grey,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -130,9 +121,7 @@ class PatientCard extends StatelessWidget {
|
|
|
|
? Row(
|
|
|
|
? Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
PatientStatus(
|
|
|
|
PatientStatus(
|
|
|
|
label:
|
|
|
|
label: TranslationBase.of(context).notArrived,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.notArrived,
|
|
|
|
|
|
|
|
color: Colors.red[800]!,
|
|
|
|
color: Colors.red[800]!,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
@ -149,26 +138,16 @@ class PatientCard extends StatelessWidget {
|
|
|
|
width: 8,
|
|
|
|
width: 8,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
PatientStatus(
|
|
|
|
PatientStatus(
|
|
|
|
label: patientInfo!.status == 2
|
|
|
|
label: patientInfo!.status == 2 ? 'Confirmed' : 'Booked',
|
|
|
|
? 'Confirmed'
|
|
|
|
color: patientInfo!.status == 2 ? AppGlobal.appGreenColor : Colors.grey,
|
|
|
|
: 'Booked',
|
|
|
|
|
|
|
|
color: patientInfo!.status == 2
|
|
|
|
|
|
|
|
? AppGlobal.appGreenColor
|
|
|
|
|
|
|
|
: Colors.grey,
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: !isFromSearch &&
|
|
|
|
: !isFromSearch && !isFromLiveCare && patientInfo!.patientStatusType == null
|
|
|
|
!isFromLiveCare &&
|
|
|
|
|
|
|
|
patientInfo!
|
|
|
|
|
|
|
|
.patientStatusType ==
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
? Row(
|
|
|
|
? Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
PatientStatus(
|
|
|
|
PatientStatus(
|
|
|
|
label: TranslationBase.of(
|
|
|
|
label: TranslationBase.of(context).notArrived,
|
|
|
|
context)
|
|
|
|
|
|
|
|
.notArrived,
|
|
|
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
color: Colors.red[800],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
@ -185,24 +164,15 @@ class PatientCard extends StatelessWidget {
|
|
|
|
width: 8,
|
|
|
|
width: 8,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
PatientStatus(
|
|
|
|
PatientStatus(
|
|
|
|
label:
|
|
|
|
label: patientInfo!.status == 2 ? 'Booked' : 'Confirmed',
|
|
|
|
patientInfo!.status == 2
|
|
|
|
color: patientInfo!.status == 2 ? Colors.grey : AppGlobal.appGreenColor,
|
|
|
|
? 'Booked'
|
|
|
|
|
|
|
|
: 'Confirmed',
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
patientInfo!.status == 2
|
|
|
|
|
|
|
|
? Colors.grey
|
|
|
|
|
|
|
|
: AppGlobal
|
|
|
|
|
|
|
|
.appGreenColor,
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
: SizedBox(),
|
|
|
|
this.arrivalType == '1'
|
|
|
|
this.arrivalType == '1'
|
|
|
|
? AppText(
|
|
|
|
? AppText(
|
|
|
|
patientInfo!.startTime != null
|
|
|
|
patientInfo!.startTime != null ? patientInfo!.startTime! : patientInfo!.startTimes!,
|
|
|
|
? patientInfo!.startTime!
|
|
|
|
|
|
|
|
: patientInfo!.startTimes!,
|
|
|
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -217,13 +187,9 @@ class PatientCard extends StatelessWidget {
|
|
|
|
letterSpacing: -0.64,
|
|
|
|
letterSpacing: -0.64,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: (patientInfo!.appointmentDate !=
|
|
|
|
: (patientInfo!.appointmentDate != null && patientInfo!.appointmentDate!.isNotEmpty)
|
|
|
|
null &&
|
|
|
|
|
|
|
|
patientInfo!.appointmentDate!
|
|
|
|
|
|
|
|
.isNotEmpty)
|
|
|
|
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.only(right: 9),
|
|
|
|
EdgeInsets.only(right: 9),
|
|
|
|
|
|
|
|
child: AppText(
|
|
|
|
child: AppText(
|
|
|
|
" ${AppDateUtils.getStartTime(patientInfo!.startTime!)}",
|
|
|
|
" ${AppDateUtils.getStartTime(patientInfo!.startTime!)}",
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
@ -255,45 +221,31 @@ class PatientCard extends StatelessWidget {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 2,
|
|
|
|
flex: 2,
|
|
|
|
child: Row(
|
|
|
|
child: Row(crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, children: [
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
AppText(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
isFromLiveCare ? Utils.capitalize(patientInfo!.fullName) : (Utils.capitalize(patientInfo!.firstName) + " " + Utils.capitalize(patientInfo!.lastName)),
|
|
|
|
children: [
|
|
|
|
fontSize: 16,
|
|
|
|
AppText(
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
isFromLiveCare
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
? Utils.capitalize(
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
patientInfo!.fullName)
|
|
|
|
letterSpacing: -0.64,
|
|
|
|
: (Utils.capitalize(
|
|
|
|
textOverflow: TextOverflow.ellipsis,
|
|
|
|
patientInfo!.firstName) +
|
|
|
|
),
|
|
|
|
" " +
|
|
|
|
if (patientInfo!.gender == 1)
|
|
|
|
Utils.capitalize(
|
|
|
|
Container(
|
|
|
|
patientInfo!.lastName)),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2),
|
|
|
|
fontSize: 16,
|
|
|
|
child: SvgPicture.asset("assets/images/svgs/male.svg"),
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
)
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
else
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
Container(
|
|
|
|
letterSpacing: -0.64,
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2),
|
|
|
|
textOverflow: TextOverflow.ellipsis,
|
|
|
|
child: SvgPicture.asset("assets/images/svgs/female.svg"),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (patientInfo!.gender == 1)
|
|
|
|
if (isFromLiveCare)
|
|
|
|
Container(
|
|
|
|
ShowTimer(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
patientInfo: patientInfo!,
|
|
|
|
horizontal: 4, vertical: 2),
|
|
|
|
),
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
]),
|
|
|
|
"assets/images/svgs/male.svg"),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
|
|
|
horizontal: 4, vertical: 2),
|
|
|
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
|
|
|
"assets/images/svgs/female.svg"),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (isFromLiveCare)
|
|
|
|
|
|
|
|
ShowTimer(
|
|
|
|
|
|
|
|
patientInfo: patientInfo!,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (nationalityName.isNotEmpty)
|
|
|
|
if (nationalityName.isNotEmpty)
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
@ -314,26 +266,16 @@ class PatientCard extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
patientInfo!.nationality != null ||
|
|
|
|
patientInfo!.nationality != null || patientInfo!.nationalityId != null
|
|
|
|
patientInfo!.nationalityId != null
|
|
|
|
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(right: 7, top: 5),
|
|
|
|
right: 7, top: 5),
|
|
|
|
|
|
|
|
child: ClipRRect(
|
|
|
|
child: ClipRRect(
|
|
|
|
borderRadius:
|
|
|
|
borderRadius: BorderRadius.circular(20.0),
|
|
|
|
BorderRadius.circular(20.0),
|
|
|
|
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
imageUrl: patientInfo!
|
|
|
|
imageUrl: patientInfo!.nationalityFlagURL != null ? patientInfo!.nationalityFlagURL! : '',
|
|
|
|
.nationalityFlagURL !=
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
? patientInfo!
|
|
|
|
|
|
|
|
.nationalityFlagURL!
|
|
|
|
|
|
|
|
: '',
|
|
|
|
|
|
|
|
height: 16,
|
|
|
|
height: 16,
|
|
|
|
width: 22,
|
|
|
|
width: 22,
|
|
|
|
errorWidget:
|
|
|
|
errorWidget: (context, url, error) => AppText(
|
|
|
|
(context, url, error) =>
|
|
|
|
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
'No Image',
|
|
|
|
'No Image',
|
|
|
|
fontSize: 10,
|
|
|
|
fontSize: 10,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -348,177 +290,132 @@ class PatientCard extends StatelessWidget {
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 10,
|
|
|
|
height: 10,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
Padding(
|
|
|
|
children: <Widget>[
|
|
|
|
padding: EdgeInsets.only(left: 12.0, top: 5),
|
|
|
|
Padding(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(left: 12.0, top: 5),
|
|
|
|
width: 60,
|
|
|
|
child: Container(
|
|
|
|
height: 60,
|
|
|
|
width: 60,
|
|
|
|
//TODO Elham* create widget for this to make it use every where
|
|
|
|
height: 60,
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
//TODO Elham* create widget for this to make it use every where
|
|
|
|
patientInfo!.gender == 1 ? 'assets/images/svgs/male avatar.svg' : 'assets/images/svgs/female avatar.svg',
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
patientInfo!.gender == 1
|
|
|
|
|
|
|
|
? 'assets/images/svgs/male avatar.svg'
|
|
|
|
|
|
|
|
: 'assets/images/svgs/female avatar.svg',
|
|
|
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
width: 10,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
width: 10,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Row(
|
|
|
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [
|
|
|
|
children: [
|
|
|
|
// SizedBox(height: 10,),
|
|
|
|
Expanded(
|
|
|
|
CustomRow(
|
|
|
|
child: Column(
|
|
|
|
label: TranslationBase.of(context).fileNumber,
|
|
|
|
crossAxisAlignment:
|
|
|
|
value: patientInfo!.patientId.toString(),
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
),
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
CustomRow(
|
|
|
|
children: [
|
|
|
|
label: TranslationBase.of(context).age + " : ",
|
|
|
|
// SizedBox(height: 10,),
|
|
|
|
value: "${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}",
|
|
|
|
CustomRow(
|
|
|
|
),
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
|
|
|
|
.fileNumber,
|
|
|
|
|
|
|
|
value:
|
|
|
|
|
|
|
|
patientInfo!.patientId.toString(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
CustomRow(
|
|
|
|
|
|
|
|
label: TranslationBase.of(context).age +
|
|
|
|
|
|
|
|
" : ",
|
|
|
|
|
|
|
|
value:
|
|
|
|
|
|
|
|
"${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}",
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
patientInfo!.arrivedOn != null
|
|
|
|
patientInfo!.arrivedOn != null
|
|
|
|
? Column(
|
|
|
|
? Column(
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
CrossAxisAlignment.end,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment:
|
|
|
|
children: [
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
// AppText(
|
|
|
|
children: [
|
|
|
|
// AppDateUtils
|
|
|
|
// AppText(
|
|
|
|
// .getDayMonthYearDateFormatted(
|
|
|
|
// AppDateUtils
|
|
|
|
// AppDateUtils
|
|
|
|
// .getDayMonthYearDateFormatted(
|
|
|
|
// .convertStringToDate(
|
|
|
|
// AppDateUtils
|
|
|
|
// patientInfo!.arrivedOn,
|
|
|
|
// .convertStringToDate(
|
|
|
|
// ),
|
|
|
|
// patientInfo!.arrivedOn,
|
|
|
|
// isMonthShort: true,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// isMonthShort: true,
|
|
|
|
// fontFamily: 'Poppins',
|
|
|
|
// ),
|
|
|
|
// fontWeight: FontWeight.w600,
|
|
|
|
// fontFamily: 'Poppins',
|
|
|
|
// fontSize: 11,
|
|
|
|
// fontWeight: FontWeight.w600,
|
|
|
|
// letterSpacing: -0.64,
|
|
|
|
// fontSize: 11,
|
|
|
|
// ),
|
|
|
|
// letterSpacing: -0.64,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CustomRow(
|
|
|
|
|
|
|
|
label: TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.arrivedP +
|
|
|
|
|
|
|
|
" : ",
|
|
|
|
|
|
|
|
value: AppDateUtils
|
|
|
|
|
|
|
|
.getDayMonthYearDateFormatted(
|
|
|
|
|
|
|
|
AppDateUtils
|
|
|
|
|
|
|
|
.convertStringToDate(
|
|
|
|
|
|
|
|
patientInfo!.arrivedOn!,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
isMonthShort: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: (patientInfo!.appointmentDate !=
|
|
|
|
|
|
|
|
null &&
|
|
|
|
|
|
|
|
patientInfo!.appointmentDate!
|
|
|
|
|
|
|
|
.isNotEmpty)
|
|
|
|
|
|
|
|
? Column(
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.end,
|
|
|
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
CustomRow(
|
|
|
|
|
|
|
|
label: TranslationBase.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.appointmentDate +
|
|
|
|
|
|
|
|
" : ",
|
|
|
|
|
|
|
|
value: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(
|
|
|
|
|
|
|
|
patientInfo!
|
|
|
|
|
|
|
|
.appointmentDate!,
|
|
|
|
|
|
|
|
), isMonthShort: true)}",
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isInpatient)
|
|
|
|
|
|
|
|
CustomRow(
|
|
|
|
|
|
|
|
label:
|
|
|
|
|
|
|
|
patientInfo!.admissionDate == null
|
|
|
|
|
|
|
|
? ""
|
|
|
|
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
|
|
|
|
.admissionDate +
|
|
|
|
|
|
|
|
" : ",
|
|
|
|
|
|
|
|
value: patientInfo!.admissionDate ==
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
? ""
|
|
|
|
|
|
|
|
: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate.toString()), isMonthShort: true)}",
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (patientInfo!.admissionDate != null)
|
|
|
|
|
|
|
|
CustomRow(
|
|
|
|
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
|
|
|
|
.numOfDays +
|
|
|
|
|
|
|
|
" : ",
|
|
|
|
|
|
|
|
value:
|
|
|
|
|
|
|
|
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate!)).inDays + 1}",
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (patientInfo!.admissionDate != null)
|
|
|
|
|
|
|
|
CustomRow(
|
|
|
|
CustomRow(
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
label: TranslationBase.of(context).arrivedP + " : ",
|
|
|
|
.clinicName +
|
|
|
|
value: AppDateUtils.getDayMonthYearDateFormatted(
|
|
|
|
" : ",
|
|
|
|
AppDateUtils.convertStringToDate(
|
|
|
|
value:
|
|
|
|
patientInfo!.arrivedOn!,
|
|
|
|
"${patientInfo!.clinicDescription}",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
isMonthShort: true,
|
|
|
|
if (patientInfo!.admissionDate != null)
|
|
|
|
),
|
|
|
|
CustomRow(
|
|
|
|
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
|
|
|
|
.roomNo +
|
|
|
|
|
|
|
|
" : ",
|
|
|
|
|
|
|
|
value: "${patientInfo!.roomId}",
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (isFromLiveCare)
|
|
|
|
],
|
|
|
|
Column(
|
|
|
|
)
|
|
|
|
|
|
|
|
: (patientInfo!.appointmentDate != null && patientInfo!.appointmentDate!.isNotEmpty)
|
|
|
|
|
|
|
|
? Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
CustomRow(
|
|
|
|
CustomRow(
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
label: TranslationBase.of(context).appointmentDate + " : ",
|
|
|
|
.clinic +
|
|
|
|
value: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(
|
|
|
|
" : ",
|
|
|
|
patientInfo!.appointmentDate!,
|
|
|
|
value: patientInfo!.clinicName!,
|
|
|
|
), isMonthShort: true)}",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
]),
|
|
|
|
: SizedBox(),
|
|
|
|
),
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
if (isInpatient)
|
|
|
|
padding: const EdgeInsets.only(right: 8),
|
|
|
|
CustomRow(
|
|
|
|
child: Icon(
|
|
|
|
label: patientInfo!.admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ",
|
|
|
|
Icons.arrow_forward,
|
|
|
|
value: patientInfo!.admissionDate == null
|
|
|
|
size: 24,
|
|
|
|
? ""
|
|
|
|
|
|
|
|
: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate.toString()), isMonthShort: true)}",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (patientInfo!.admissionDate != null)
|
|
|
|
],
|
|
|
|
CustomRow(
|
|
|
|
))
|
|
|
|
label: TranslationBase.of(context).numOfDays + " : ",
|
|
|
|
]),
|
|
|
|
value: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate!)).inDays + 1}",
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (patientInfo!.admissionDate != null)
|
|
|
|
|
|
|
|
CustomRow(
|
|
|
|
|
|
|
|
label: TranslationBase.of(context).clinicName + " : ",
|
|
|
|
|
|
|
|
value: "${patientInfo!.clinicDescription}",
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (patientInfo!.admissionDate != null)
|
|
|
|
|
|
|
|
CustomRow(
|
|
|
|
|
|
|
|
label: TranslationBase.of(context).roomNo + " : ",
|
|
|
|
|
|
|
|
value: "${patientInfo!.roomId}",
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (isFromLiveCare)
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
CustomRow(
|
|
|
|
|
|
|
|
label: TranslationBase.of(context).clinic + " : ",
|
|
|
|
|
|
|
|
value: patientInfo!.clinicName!,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.only(right: 8),
|
|
|
|
|
|
|
|
child: Icon(
|
|
|
|
|
|
|
|
Icons.arrow_forward,
|
|
|
|
|
|
|
|
size: 24,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
]),
|
|
|
|
isFromLiveCare
|
|
|
|
isFromLiveCare
|
|
|
|
? Row(
|
|
|
|
? Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(left: 9, right: 9, bottom: 9),
|
|
|
|
left: 9, right: 9, bottom: 9),
|
|
|
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
'assets/images/svgs/profile_screen/livecare.svg',
|
|
|
|
'assets/images/svgs/profile_screen/livecare.svg',
|
|
|
|
height: 20,
|
|
|
|
height: 20,
|
|
|
|
@ -528,42 +425,29 @@ class PatientCard extends StatelessWidget {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: !isInpatient && !isFromSearch
|
|
|
|
: !isInpatient && !isFromSearch
|
|
|
|
? Row(
|
|
|
|
? Row(mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
Container(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
padding: EdgeInsets.only(left: 9, right: 9, bottom: 9),
|
|
|
|
children: [
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
|
|
|
patientInfo!.appointmentType == 'Regular' && patientInfo!.visitTypeId == 100
|
|
|
|
|
|
|
|
? 'assets/images/svgs/profile_screen/livecare.svg'
|
|
|
|
|
|
|
|
: patientInfo!.appointmentType == 'Walkin'
|
|
|
|
|
|
|
|
? 'assets/images/svgs/profile_screen/walkin.svg'
|
|
|
|
|
|
|
|
: 'assets/images/svgs/profile_screen/booked.svg',
|
|
|
|
|
|
|
|
height: 25,
|
|
|
|
|
|
|
|
width: 35,
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
: (isInpatient == true)
|
|
|
|
|
|
|
|
? Row(mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(left: 9, right: 9, bottom: 9),
|
|
|
|
left: 9, right: 9, bottom: 9),
|
|
|
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
patientInfo!.appointmentType ==
|
|
|
|
'assets/images/svgs/inpatient.svg',
|
|
|
|
'Regular' &&
|
|
|
|
|
|
|
|
patientInfo!.visitTypeId ==
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
? 'assets/images/svgs/profile_screen/livecare.svg'
|
|
|
|
|
|
|
|
: patientInfo!.appointmentType ==
|
|
|
|
|
|
|
|
'Walkin'
|
|
|
|
|
|
|
|
? 'assets/images/svgs/profile_screen/walkin.svg'
|
|
|
|
|
|
|
|
: 'assets/images/svgs/profile_screen/booked.svg',
|
|
|
|
|
|
|
|
height: 25,
|
|
|
|
height: 25,
|
|
|
|
width: 35,
|
|
|
|
width: 35,
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
])
|
|
|
|
])
|
|
|
|
: (isInpatient == true)
|
|
|
|
|
|
|
|
? Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
left: 9, right: 9, bottom: 9),
|
|
|
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
|
|
|
'assets/images/svgs/inpatient.svg',
|
|
|
|
|
|
|
|
height: 25,
|
|
|
|
|
|
|
|
width: 35,
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
: SizedBox()
|
|
|
|
: SizedBox()
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|