|
|
|
|
@ -43,15 +43,25 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
child: CardWithBgWidget(
|
|
|
|
|
padding: 0,
|
|
|
|
|
marginLeft: (!isMyPatient && isInpatient)?0:10,
|
|
|
|
|
marginSymmetric:isFromSearch ? 10 : 0.0,
|
|
|
|
|
marginLeft: (!isMyPatient && isInpatient) ? 0 : 10,
|
|
|
|
|
marginSymmetric: isFromSearch ? 10 : 0.0,
|
|
|
|
|
hasBorder: false,
|
|
|
|
|
bgColor:isFromLiveCare?Colors.white:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo.patientStatusType == 43
|
|
|
|
|
? Colors.green[500]
|
|
|
|
|
:isMyPatient? Colors.green[500]:isInpatient?Colors.white:!isFromSearch?Colors.red[800]:Colors.white,
|
|
|
|
|
bgColor: isFromLiveCare
|
|
|
|
|
? Colors.white
|
|
|
|
|
: (isMyPatient && !isFromSearch)
|
|
|
|
|
? Colors.green[500]
|
|
|
|
|
: patientInfo.patientStatusType == 43
|
|
|
|
|
? Colors.green[500]
|
|
|
|
|
: isMyPatient
|
|
|
|
|
? Colors.green[500]
|
|
|
|
|
: isInpatient
|
|
|
|
|
? Colors.white
|
|
|
|
|
: !isFromSearch
|
|
|
|
|
? Colors.red[800]
|
|
|
|
|
: Colors.white,
|
|
|
|
|
widget: Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
// padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
// padding: EdgeInsets.only(left: 10, right: 0, bottom: 0),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
@ -66,67 +76,120 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
children: [
|
|
|
|
|
patientInfo.patientStatusType == 43
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).arrivedP,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.arrivedP,
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
AppText(
|
|
|
|
|
patientInfo.status==2? 'Confirmed':'Booked',
|
|
|
|
|
color: patientInfo.status==2? Colors.green:Colors.grey ,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: patientInfo.patientStatusType == 42?Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).notArrived,
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
width: 1.5,
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
patientInfo.status == 2
|
|
|
|
|
? 'Confirmed'
|
|
|
|
|
: 'Booked',
|
|
|
|
|
color: patientInfo.status == 2
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.grey,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
AppText(
|
|
|
|
|
patientInfo.status==2? 'Confirmed':'Booked',
|
|
|
|
|
color: patientInfo.status==2? Colors.green:Colors.grey ,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
): !isFromSearch&&!isFromLiveCare && patientInfo.patientStatusType==null ? Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).notArrived,
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),),
|
|
|
|
|
SizedBox(width: 8,),
|
|
|
|
|
AppText(
|
|
|
|
|
patientInfo.status==2? 'Booked':'Confirmed',
|
|
|
|
|
color: patientInfo.status==2? Colors.grey:Colors.green ,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
):SizedBox(),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: patientInfo.patientStatusType == 42
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.notArrived,
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
width: 1.5,
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
patientInfo.status == 2
|
|
|
|
|
? 'Confirmed'
|
|
|
|
|
: 'Booked',
|
|
|
|
|
color: patientInfo.status == 2
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Colors.grey,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: !isFromSearch &&
|
|
|
|
|
!isFromLiveCare &&
|
|
|
|
|
patientInfo.patientStatusType ==
|
|
|
|
|
null
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.notArrived,
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
width: 1.5,
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 8,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
patientInfo.status == 2
|
|
|
|
|
? 'Booked'
|
|
|
|
|
: 'Confirmed',
|
|
|
|
|
color:
|
|
|
|
|
patientInfo.status == 2
|
|
|
|
|
? Colors.grey
|
|
|
|
|
: Colors.green,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
this.arrivalType == '1'
|
|
|
|
|
? AppText(
|
|
|
|
|
patientInfo.startTime != null
|
|
|
|
|
@ -137,27 +200,39 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
)
|
|
|
|
|
: patientInfo.arrivedOn != null
|
|
|
|
|
? AppText(
|
|
|
|
|
AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo.arrivedOn,)
|
|
|
|
|
)+" "+ "${AppDateUtils.getStartTime(patientInfo.startTime)}",
|
|
|
|
|
AppDateUtils.getDayMonthYearDate(
|
|
|
|
|
AppDateUtils
|
|
|
|
|
.convertStringToDate(
|
|
|
|
|
patientInfo.arrivedOn,
|
|
|
|
|
)) +
|
|
|
|
|
" " +
|
|
|
|
|
"${AppDateUtils.getStartTime(patientInfo.startTime)}",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
)
|
|
|
|
|
: (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)?
|
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
|
|
"${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${AppDateUtils.getStartTime(patientInfo.startTime)}",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
):SizedBox()
|
|
|
|
|
: (patientInfo.appointmentDate !=
|
|
|
|
|
null &&
|
|
|
|
|
patientInfo
|
|
|
|
|
.appointmentDate.isNotEmpty)
|
|
|
|
|
? AppText(
|
|
|
|
|
"${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(
|
|
|
|
|
patientInfo.appointmentDate,
|
|
|
|
|
))} ${AppDateUtils.getStartTime(patientInfo.startTime)}",
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
)
|
|
|
|
|
: SizedBox()
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
if(isInpatient && isMyPatient && !isFromSearch)
|
|
|
|
|
if (isInpatient && isMyPatient && !isFromSearch)
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(width: 12,),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 12,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
'My Patient',
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
@ -177,9 +252,14 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
Expanded(
|
|
|
|
|
// width: MediaQuery.of(context).size.width*0.51,
|
|
|
|
|
child: AppText(
|
|
|
|
|
isFromLiveCare? Helpers.capitalize(patientInfo.fullName): (Helpers.capitalize(patientInfo.firstName) +
|
|
|
|
|
" " +
|
|
|
|
|
Helpers.capitalize(patientInfo.lastName)),
|
|
|
|
|
isFromLiveCare
|
|
|
|
|
? Helpers.capitalize(
|
|
|
|
|
patientInfo.fullName)
|
|
|
|
|
: (Helpers.capitalize(
|
|
|
|
|
patientInfo.firstName) +
|
|
|
|
|
" " +
|
|
|
|
|
Helpers.capitalize(
|
|
|
|
|
patientInfo.lastName)),
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
color: Color(0xff2e303a),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
@ -189,12 +269,14 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
if (patientInfo.gender == 1)
|
|
|
|
|
Icon(
|
|
|
|
|
DoctorApp.male_2,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
) else Icon(
|
|
|
|
|
DoctorApp.female_1,
|
|
|
|
|
color: Colors.pink,
|
|
|
|
|
),
|
|
|
|
|
DoctorApp.male_2,
|
|
|
|
|
color: Colors.blue,
|
|
|
|
|
)
|
|
|
|
|
else
|
|
|
|
|
Icon(
|
|
|
|
|
DoctorApp.female_1,
|
|
|
|
|
color: Colors.pink,
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
@ -286,31 +368,30 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
//if (isInpatient)
|
|
|
|
|
Container(
|
|
|
|
|
child: RichText(
|
|
|
|
|
text: new TextSpan(
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 2.0 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
),
|
|
|
|
|
children: <TextSpan>[
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text:
|
|
|
|
|
TranslationBase.of(context).age +
|
|
|
|
|
" : ",
|
|
|
|
|
style: TextStyle(fontSize: 12)),
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text:
|
|
|
|
|
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 13)),
|
|
|
|
|
],
|
|
|
|
|
Container(
|
|
|
|
|
child: RichText(
|
|
|
|
|
text: new TextSpan(
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize: 2.0 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
),
|
|
|
|
|
children: <TextSpan>[
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text: TranslationBase.of(context).age +
|
|
|
|
|
" : ",
|
|
|
|
|
style: TextStyle(fontSize: 12)),
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text:
|
|
|
|
|
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 13)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (isInpatient )
|
|
|
|
|
),
|
|
|
|
|
if (isInpatient)
|
|
|
|
|
Container(
|
|
|
|
|
child: RichText(
|
|
|
|
|
text: new TextSpan(
|
|
|
|
|
@ -342,61 +423,75 @@ class PatientCard extends StatelessWidget {
|
|
|
|
|
text: new TextSpan(
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
fontSize:
|
|
|
|
|
2.0 * SizeConfig.textMultiplier,
|
|
|
|
|
2.0 * SizeConfig.textMultiplier,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
),
|
|
|
|
|
children: <TextSpan>[
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text: TranslationBase.of(context).numOfDays + " : ",
|
|
|
|
|
style: TextStyle(fontSize: 12)),
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 13)),
|
|
|
|
|
]))),
|
|
|
|
|
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text: TranslationBase.of(context)
|
|
|
|
|
.numOfDays +
|
|
|
|
|
" : ",
|
|
|
|
|
style: TextStyle(fontSize: 12)),
|
|
|
|
|
new TextSpan(
|
|
|
|
|
text:
|
|
|
|
|
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: 13)),
|
|
|
|
|
]))),
|
|
|
|
|
]))
|
|
|
|
|
]),
|
|
|
|
|
!isInpatient && !isFromSearch
|
|
|
|
|
isFromLiveCare
|
|
|
|
|
? Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
patientInfo.appointmentType ==
|
|
|
|
|
'Regular' &&
|
|
|
|
|
patientInfo.visitTypeId == 100
|
|
|
|
|
? 'assets/images/livecare.png'
|
|
|
|
|
: patientInfo.appointmentType ==
|
|
|
|
|
'Walkin'
|
|
|
|
|
? 'assets/images/walkin.png'
|
|
|
|
|
: 'assets/images/booked.png',
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 35,
|
|
|
|
|
)),
|
|
|
|
|
])
|
|
|
|
|
: (isInpatient == true)
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
'assets/images/livecare.png',
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 35,
|
|
|
|
|
color: Colors.grey.shade700,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: !isInpatient && !isFromSearch
|
|
|
|
|
? Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
'assets/images/inpatient.png',
|
|
|
|
|
patientInfo.appointmentType ==
|
|
|
|
|
'Regular' &&
|
|
|
|
|
patientInfo.visitTypeId == 100
|
|
|
|
|
? 'assets/images/livecare.png'
|
|
|
|
|
: patientInfo.appointmentType ==
|
|
|
|
|
'Walkin'
|
|
|
|
|
? 'assets/images/walkin.png'
|
|
|
|
|
: 'assets/images/booked.png',
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 35,
|
|
|
|
|
)),
|
|
|
|
|
])
|
|
|
|
|
: SizedBox()
|
|
|
|
|
: (isInpatient == true)
|
|
|
|
|
? Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
'assets/images/inpatient.png',
|
|
|
|
|
height: 25,
|
|
|
|
|
width: 35,
|
|
|
|
|
)),
|
|
|
|
|
])
|
|
|
|
|
: SizedBox()
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
onTap: onTap,
|
|
|
|
|
)),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|