diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index cc71dd6d..e0bea0b7 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -108,7 +108,7 @@ class _PatientProfileScreenState extends State isFromLiveCare: isFromLiveCare, height: (patient.patientStatusType != null && patient.patientStatusType == 43) - ? 210 + ? 220 : isDischargedPatient ? 240 : 0, diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 511b99e9..9b00ba2b 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -16,7 +16,11 @@ class AppDateUtils { } 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); } diff --git a/lib/widgets/patients/profile/patient-profile-app-bar.dart b/lib/widgets/patients/profile/patient-profile-app-bar.dart index 770137a2..5d676061 100644 --- a/lib/widgets/patients/profile/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-app-bar.dart @@ -60,6 +60,7 @@ class PatientProfileAppBar extends StatelessWidget this.isFromSOAP = false, this.isFromLabResult = false}); + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -84,8 +85,8 @@ class PatientProfileAppBar extends StatelessWidget ? isInpatient ? 215 : isAppointmentHeader - ? 310 - : 200 + ? 325 + : 215 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), @@ -157,8 +158,7 @@ class PatientProfileAppBar extends StatelessWidget child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + patient.patientStatusType != null ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -182,81 +182,18 @@ class PatientProfileAppBar extends StatelessWidget fontFamily: 'Poppins', fontSize: 12, ), - arrivalType == '1' || patient.arrivedOn == null + patient.startTime != null ? AppText( patient.startTime != null ? patient.startTime : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, - ) - : 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: [ - 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( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -342,6 +279,40 @@ class PatientProfileAppBar extends StatelessWidget ), ), ), + + if ( patient.appointmentDate != null && patient.appointmentDate.isNotEmpty) + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + 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( child: RichText( text: new TextSpan( @@ -581,6 +552,6 @@ class PatientProfileAppBar extends StatelessWidget @override Size get preferredSize => Size(double.maxFinite, height == 0 - ? isInpatient ? 215 : isAppointmentHeader ? 310 : 200 + ? isInpatient ? 215 : isAppointmentHeader ? 325 : 215 : height); }