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

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

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

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