Patient card

merge-requests/916/head
Elham Rababh 4 years ago
parent 98f6d63fcd
commit 9e1aeb857f

@ -40,7 +40,6 @@ class ClinicByProjectIdRequest {
this.languageID = 2,
this.stamp = "2020-06-03T11:18:19.979Z",
this.iPAdress = "11.11.11.11",
this.versionID = 5.5,
this.channel = 9,
this.tokenID,
this.sessionID = "JBXRsDl37L",
@ -53,7 +52,6 @@ class ClinicByProjectIdRequest {
languageID = json['LanguageID'];
stamp = json['stamp'];
iPAdress = json['IPAdress'];
versionID = json['VersionID'];
channel = json['Channel'];
tokenID = json['TokenID'];
sessionID = json['SessionID'];
@ -68,7 +66,6 @@ class ClinicByProjectIdRequest {
data['LanguageID'] = this.languageID;
data['stamp'] = this.stamp;
data['IPAdress'] = this.iPAdress;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['TokenID'] = this.tokenID;
data['SessionID'] = this.sessionID;

@ -245,9 +245,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
},
),
),
SizedBox(
height: 10.0,
),
Expanded(
child: Container(
child: model.filterData.isEmpty
@ -269,7 +267,7 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
.patientStatusType ==
43))
return Padding(
padding: EdgeInsets.all(8.0),
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0),
child: PatientCard(
patientInfo: model.filterData[index],
patientType: patientType,

@ -12,7 +12,6 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../util/extenstions.dart';
@ -46,17 +45,20 @@ class PatientCard extends StatelessWidget {
String nationalityName = patientInfo.nationalityName != null
? patientInfo.nationalityName.trim()
: patientInfo.nationality != null
? patientInfo.nationality.trim()
: patientInfo.nationalityId !=
null
? patientInfo.nationalityId
: "";
? patientInfo.nationality.trim()
: patientInfo.nationalityId != null
? patientInfo.nationalityId
: "";
return Container(
width: SizeConfig.screenWidth * 0.9,
margin: EdgeInsets.all(6),
padding: EdgeInsets.only(left: projectViewModel.isArabic?5:0, right: projectViewModel.isArabic?0:5, bottom: 0, top: 0),
decoration:Helpers.getCardBoxDecoration(),
padding: EdgeInsets.only(
left: projectViewModel.isArabic ? 5 : 0,
right: projectViewModel.isArabic ? 0 : 5,
bottom: 0,
top: 0),
decoration: Helpers.getCardBoxDecoration(),
child: CardWithBgWidget(
padding: 0,
marginLeft: (!isMyPatient && isInpatient) ? 0 : 10,
@ -96,8 +98,11 @@ class PatientCard extends StatelessWidget {
patientInfo.patientStatusType == 43
? Row(
children: [
PatientStatus(label:TranslationBase.of(context)
.arrivedP,color:AppGlobal.appGreenColor,),
PatientStatus(
label: TranslationBase.of(context)
.arrivedP,
color: AppGlobal.appGreenColor,
),
SizedBox(
width: 8,
),
@ -111,18 +116,25 @@ class PatientCard extends StatelessWidget {
SizedBox(
width: 8,
),
PatientStatus(label:patientInfo.status == 2
? 'Confirmed'
: 'Booked',color: patientInfo.status == 2
? AppGlobal.appGreenColor
: Colors.grey,),
PatientStatus(
label: patientInfo.status == 2
? 'Confirmed'
: 'Booked',
color: patientInfo.status == 2
? AppGlobal.appGreenColor
: Colors.grey,
),
],
)
: patientInfo.patientStatusType == 42
? Row(
children: [
PatientStatus(label:TranslationBase.of(context)
.notArrived,color:Colors.red[800],),
PatientStatus(
label:
TranslationBase.of(context)
.notArrived,
color: Colors.red[800],
),
SizedBox(
width: 8,
),
@ -136,10 +148,14 @@ class PatientCard extends StatelessWidget {
SizedBox(
width: 8,
),
PatientStatus(label:patientInfo.status == 2 ? 'Confirmed'
: 'Booked',color:patientInfo.status == 2
? AppGlobal.appGreenColor
: Colors.grey,)
PatientStatus(
label: patientInfo.status == 2
? 'Confirmed'
: 'Booked',
color: patientInfo.status == 2
? AppGlobal.appGreenColor
: Colors.grey,
)
],
)
: !isFromSearch &&
@ -148,8 +164,12 @@ class PatientCard extends StatelessWidget {
null
? Row(
children: [
PatientStatus(label:TranslationBase.of(context)
.notArrived,color:Colors.red[800],),
PatientStatus(
label: TranslationBase.of(
context)
.notArrived,
color: Colors.red[800],
),
SizedBox(
width: 8,
),
@ -163,13 +183,17 @@ class PatientCard extends StatelessWidget {
SizedBox(
width: 8,
),
PatientStatus(label:patientInfo.status == 2
? 'Booked'
: 'Confirmed',color:
patientInfo.status == 2
? Colors.grey
: AppGlobal.appGreenColor,)
PatientStatus(
label:
patientInfo.status == 2
? 'Booked'
: 'Confirmed',
color:
patientInfo.status == 2
? Colors.grey
: AppGlobal
.appGreenColor,
)
],
)
: SizedBox(),
@ -182,29 +206,55 @@ class PatientCard extends StatelessWidget {
fontWeight: FontWeight.w400,
)
: patientInfo.arrivedOn != null
? AppText(
AppDateUtils.getDayMonthYearDate(
AppDateUtils
.convertStringToDate(
patientInfo.arrivedOn,
)) +
" " +
? Column(
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
AppText(
AppDateUtils
.getDayMonthYearDateFormatted(
AppDateUtils
.convertStringToDate(
patientInfo.arrivedOn,
),
isMonthShort: true,
),
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontSize: 15,
),
AppText(
"${AppDateUtils.getStartTime(patientInfo.startTime)}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontSize: 15,
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
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,
? Column(
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
AppText(
"${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(
patientInfo
.appointmentDate,
), isMonthShort: true)}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontSize: 15,
),
AppText(
" ${AppDateUtils.getStartTime(patientInfo.startTime)}",
fontFamily: 'Poppins',
fontWeight: FontWeight.w400,
fontSize: 15,
),
],
)
: SizedBox()
],
@ -216,7 +266,9 @@ class PatientCard extends StatelessWidget {
SizedBox(
width: 12,
),
PatientStatus(label:'My Patient',),
PatientStatus(
label: 'My Patient',
),
],
),
Padding(
@ -229,8 +281,7 @@ class PatientCard extends StatelessWidget {
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText(
isFromLiveCare
@ -259,7 +310,6 @@ class PatientCard extends StatelessWidget {
DoctorApp.female_1,
color: Colors.pink,
size: 18,
),
if (isFromLiveCare)
ShowTimer(
@ -311,99 +361,105 @@ class PatientCard extends StatelessWidget {
)
],
)),
SizedBox(height: 10,),
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 12.0,top: 5),
child: Container(
width: 60,
height: 60,
child: Image.asset(
patientInfo.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
Padding(
padding: EdgeInsets.only(left: 12.0, top: 5),
child: Container(
width: 60,
height: 60,
child: Image.asset(
patientInfo.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
SizedBox(
width: 10,
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
// SizedBox(height: 10,),
CustomRow(
label:
TranslationBase.of(context).fileNumber,
value: patientInfo.patientId.toString(),
),
CustomRow(
label:
TranslationBase.of(context).age + " : ",
value:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
),
if (isInpatient)
CustomRow(
label: patientInfo.admissionDate == null
? ""
: TranslationBase.of(context)
.admissionDate +
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
// SizedBox(height: 10,),
CustomRow(
label: TranslationBase.of(context)
.fileNumber,
value: patientInfo.patientId.toString(),
),
CustomRow(
label: TranslationBase.of(context).age +
" : ",
value:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
),
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: patientInfo.admissionDate == null
? ""
: "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
),
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:
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label: TranslationBase.of(context)
.clinicName +
" : ",
value: "${patientInfo.roomId}",
),
if (isFromLiveCare)
Column(
children: [
value:
"${patientInfo.clinicDescription}",
),
if (patientInfo.admissionDate != null)
CustomRow(
label: TranslationBase.of(context)
.clinic +
.roomNo +
" : ",
value: patientInfo.clinicName,
value: "${patientInfo.roomId}",
),
],
),
]),
),
Icon(
Icons.arrow_forward,
size: 24,
),
],
))
]),
if (isFromLiveCare)
Column(
children: [
CustomRow(
label: TranslationBase.of(context)
.clinic +
" : ",
value: patientInfo.clinicName,
),
],
),
]),
),
Icon(
Icons.arrow_forward,
size: 24,
),
],
))
]),
isFromLiveCare
? Row(
mainAxisAlignment: MainAxisAlignment.end,
@ -459,16 +515,19 @@ class PatientCard extends StatelessWidget {
}
class PatientStatus extends StatelessWidget {
PatientStatus({
Key key, this.label, this.color,
PatientStatus({
Key key,
this.label,
this.color,
}) : super(key: key);
final String label;final Color color;
final String label;
final Color color;
@override
Widget build(BuildContext context) {
return AppText(
label,
color: color??AppGlobal.appGreenColor,
color: color ?? AppGlobal.appGreenColor,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
fontSize: 10,

@ -37,6 +37,7 @@ class CustomRow extends StatelessWidget {
fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.9,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
isCopyable: isCopyable,
),
],

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save