fix appointment date in header

merge-requests/737/head
Elham Rababah 5 years ago
parent 3fefcf60d7
commit bc53ca7b8a

@ -108,7 +108,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
isFromLiveCare: isFromLiveCare, isFromLiveCare: isFromLiveCare,
height: (patient.patientStatusType != null && height: (patient.patientStatusType != null &&
patient.patientStatusType == 43) patient.patientStatusType == 43)
? 210 ? 220
: isDischargedPatient : isDischargedPatient
? 240 ? 240
: 0, : 0,

@ -16,7 +16,11 @@ class AppDateUtils {
} }
static String convertStringToDateFormat(String date, String dateFormat) { static String convertStringToDateFormat(String date, String dateFormat) {
DateTime dateTime = DateTime.parse(date); DateTime dateTime ;
if(date.contains("/Date"))
dateTime= getDateTimeFromServerFormat(date);
else
dateTime = DateTime.parse(date);
return convertDateToFormat(dateTime, dateFormat); return convertDateToFormat(dateTime, dateFormat);
} }

@ -60,6 +60,7 @@ class PatientProfileAppBar extends StatelessWidget
this.isFromSOAP = false, this.isFromSOAP = false,
this.isFromLabResult = false}); this.isFromLabResult = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -84,8 +85,8 @@ class PatientProfileAppBar extends StatelessWidget
? isInpatient ? isInpatient
? 215 ? 215
: isAppointmentHeader : isAppointmentHeader
? 310 ? 325
: 200 : 215
: height, : height,
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
@ -157,8 +158,7 @@ class PatientProfileAppBar extends StatelessWidget
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SERVICES_PATIANT2[int.parse(patientType)] == patient.patientStatusType != null
"patientArrivalList"
? Container( ? Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -182,81 +182,18 @@ class PatientProfileAppBar extends StatelessWidget
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
), ),
arrivalType == '1' || patient.arrivedOn == null patient.startTime != null
? AppText( ? AppText(
patient.startTime != null patient.startTime != null
? patient.startTime ? patient.startTime
: '', : '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
) ):SizedBox()
: AppText(
patient.arrivedOn != null
? (isFromSOAP ? AppDateUtils
.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(
patient.arrivedOn)) : AppDateUtils
.convertStringToDateFormat(
patient.arrivedOn,
'MM-dd-yyyy HH:mm'))
: '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
)
], ],
)) ))
: SizedBox(), : SizedBox(),
if (SERVICES_PATIANT2[int.parse(patientType)] ==
"List_MyOutPatient" && !isFromLiveCare)
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).appointmentDate +
" : ",
fontSize: 10,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
patient.startTime != null
? Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
patient.startTime ?? "",
color: Colors.white,
fontSize: 12,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
)
: SizedBox(),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
AppDateUtils.convertDateFormatImproved(
patient.appointmentDate ?? ''),
fontSize: 12,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 0.5,
)
],
),
margin: EdgeInsets.only(
top: 8,
),
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -342,6 +279,40 @@ class PatientProfileAppBar extends StatelessWidget
), ),
), ),
), ),
if ( patient.appointmentDate != null && patient.appointmentDate.isNotEmpty)
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).appointmentDate +
" : ",
fontSize: 10,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
SizedBox(
width: 3.5,
),
AppText(
(isFromSOAP ? AppDateUtils
.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(
patient.appointmentDate)) : AppDateUtils
.convertStringToDateFormat(
patient.appointmentDate,
'MM-dd-yyyy'))
,
fontWeight: FontWeight.w700,
fontSize: 12,
color: Color(0xFF2E303A),
),
SizedBox(
height: 0.5,
)
],
),
if(isFromLabResult)Container( if(isFromLabResult)Container(
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
@ -581,6 +552,6 @@ class PatientProfileAppBar extends StatelessWidget
@override @override
Size get preferredSize => Size get preferredSize =>
Size(double.maxFinite, height == 0 Size(double.maxFinite, height == 0
? isInpatient ? 215 : isAppointmentHeader ? 310 : 200 ? isInpatient ? 215 : isAppointmentHeader ? 325 : 215
: height); : height);
} }

Loading…
Cancel
Save