|
|
|
|
@ -12,50 +12,14 @@ import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
|
|
import 'large_avatar.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:flutter_svg/svg.dart';
|
|
|
|
|
class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
|
final PatiantInformtion? patient;
|
|
|
|
|
final PatientProfileAppBarModel? patientProfileAppBarModel;
|
|
|
|
|
final double? height;
|
|
|
|
|
final bool isInpatient;
|
|
|
|
|
final bool isDischargedPatient;
|
|
|
|
|
final bool isFromLiveCare;
|
|
|
|
|
|
|
|
|
|
final String? doctorName;
|
|
|
|
|
final String? branch;
|
|
|
|
|
final DateTime? appointmentDate;
|
|
|
|
|
final String? profileUrl;
|
|
|
|
|
final String? invoiceNO;
|
|
|
|
|
final String? orderNo;
|
|
|
|
|
final bool? isPrescriptions;
|
|
|
|
|
final bool? isMedicalFile;
|
|
|
|
|
final String? episode;
|
|
|
|
|
final String? visitDate;
|
|
|
|
|
final String? clinic;
|
|
|
|
|
final bool? isAppointmentHeader;
|
|
|
|
|
final bool? isFromLabResult;
|
|
|
|
|
final VoidCallback? onPressed;
|
|
|
|
|
|
|
|
|
|
PatientProfileAppBar(this.patient,
|
|
|
|
|
{ this.patientProfileAppBarModel,
|
|
|
|
|
this.isFromLabResult = false,
|
|
|
|
|
this.onPressed,
|
|
|
|
|
this.height=0,
|
|
|
|
|
this.isInpatient = false,
|
|
|
|
|
this.isDischargedPatient = false,
|
|
|
|
|
this.isFromLiveCare = false,
|
|
|
|
|
this.doctorName,
|
|
|
|
|
this.branch,
|
|
|
|
|
this.appointmentDate,
|
|
|
|
|
this.profileUrl,
|
|
|
|
|
this.invoiceNO,
|
|
|
|
|
this.orderNo,
|
|
|
|
|
this.isPrescriptions=false,
|
|
|
|
|
this.isMedicalFile =false,
|
|
|
|
|
this.episode,
|
|
|
|
|
this.visitDate,
|
|
|
|
|
this.clinic,
|
|
|
|
|
this.isAppointmentHeader= false});
|
|
|
|
|
});
|
|
|
|
|
PatiantInformtion? localPatient;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -96,7 +60,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
|
icon: Icon(Icons.arrow_back_ios),
|
|
|
|
|
color: Color(0xFF2B353E), //Colors.black,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
if (onPressed != null) onPressed!();
|
|
|
|
|
if (patientProfileAppBarModel!.onPressed != null) patientProfileAppBarModel!.onPressed!();
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
@ -169,11 +133,10 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
|
child: Container(
|
|
|
|
|
width: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
|
|
|
|
|
height: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
gender == 1
|
|
|
|
|
? 'assets/images/male_avatar.png'
|
|
|
|
|
: 'assets/images/female_avatar.png',
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
gender == 1?"assets/images/svgs/male avatar.svg":"assets/images/svgs/female avatar.svg",
|
|
|
|
|
width: 30,
|
|
|
|
|
height: 30,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -284,11 +247,11 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
|
HeaderRow(
|
|
|
|
|
label: TranslationBase.of(context).age! + " : ",
|
|
|
|
|
value:
|
|
|
|
|
"${AppDateUtils.getAgeByBirthday(localPatient!.patientDetails != null ? localPatient!.patientDetails!.dateofBirth ?? "" : localPatient!.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
|
|
|
|
|
"${AppDateUtils.getAgeByBirthday(localPatient!.patientDetails != null ? localPatient!.patientDetails!.dateofBirth ?? "" : localPatient!.dateofBirth ?? "", context, isServerFormat: !patientProfileAppBarModel!.isFromLiveCare!)}",
|
|
|
|
|
),
|
|
|
|
|
if (localPatient!.appointmentDate != null &&
|
|
|
|
|
localPatient!.appointmentDate!.isNotEmpty &&
|
|
|
|
|
!isFromLabResult!)
|
|
|
|
|
!patientProfileAppBarModel!.isFromLabResult!)
|
|
|
|
|
HeaderRow(
|
|
|
|
|
label: TranslationBase.of(context).appointmentDate! +
|
|
|
|
|
" : ",
|
|
|
|
|
@ -320,7 +283,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
|
if (localPatient!.admissionDate != null)
|
|
|
|
|
HeaderRow(
|
|
|
|
|
label: "${TranslationBase.of(context).numOfDays}: ",
|
|
|
|
|
value: isDischargedPatient &&
|
|
|
|
|
value: patientProfileAppBarModel!.isDischargedPatient! &&
|
|
|
|
|
localPatient!.dischargeDate != null
|
|
|
|
|
? "${AppDateUtils.getDateTimeFromServerFormat(localPatient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}"
|
|
|
|
|
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(localPatient!.admissionDate!)).inDays + 1}",
|
|
|
|
|
@ -374,7 +337,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
'${TranslationBase.of(context).dr}$doctorName',
|
|
|
|
|
'${TranslationBase.of(context).dr}${patientProfileAppBarModel!.doctorName}',
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
@ -382,43 +345,45 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
|
3.5,
|
|
|
|
|
isCopyable: true,
|
|
|
|
|
),
|
|
|
|
|
if (orderNo != null && !isPrescriptions!)
|
|
|
|
|
if (patientProfileAppBarModel!.orderNo != null && !(patientProfileAppBarModel!.isPrescriptions!))
|
|
|
|
|
HeaderRow(
|
|
|
|
|
label: 'Order No: ',
|
|
|
|
|
value: orderNo ?? '',
|
|
|
|
|
value: patientProfileAppBarModel!.orderNo ?? '',
|
|
|
|
|
),
|
|
|
|
|
if (invoiceNO != null && !isPrescriptions!)
|
|
|
|
|
if (patientProfileAppBarModel!.invoiceNO != null && !(patientProfileAppBarModel!.isPrescriptions!))
|
|
|
|
|
HeaderRow(
|
|
|
|
|
label: 'Invoice: ',
|
|
|
|
|
value: invoiceNO ?? "",
|
|
|
|
|
value: patientProfileAppBarModel!.invoiceNO ?? "",
|
|
|
|
|
),
|
|
|
|
|
if (branch != null)
|
|
|
|
|
if (patientProfileAppBarModel!.branch != null)
|
|
|
|
|
HeaderRow(
|
|
|
|
|
label: 'Branch: ',
|
|
|
|
|
value: branch ?? '',
|
|
|
|
|
value: patientProfileAppBarModel!.branch ?? '',
|
|
|
|
|
),
|
|
|
|
|
if (clinic != null)
|
|
|
|
|
HeaderRow(
|
|
|
|
|
label: 'Clinic: ',
|
|
|
|
|
value: clinic ?? '',
|
|
|
|
|
if (patientProfileAppBarModel!.clinic != null)
|
|
|
|
|
Container(
|
|
|
|
|
child: HeaderRow(
|
|
|
|
|
label: 'Clinic: ',
|
|
|
|
|
value: patientProfileAppBarModel!.clinic ?? '',
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (isMedicalFile! && episode != null)
|
|
|
|
|
if (patientProfileAppBarModel!.isMedicalFile! && patientProfileAppBarModel!.episode != null)
|
|
|
|
|
HeaderRow(
|
|
|
|
|
label: 'Episode: ',
|
|
|
|
|
value: episode ?? '',
|
|
|
|
|
value: patientProfileAppBarModel!.episode ?? '',
|
|
|
|
|
),
|
|
|
|
|
if (isMedicalFile! && visitDate != null)
|
|
|
|
|
if (patientProfileAppBarModel!.isMedicalFile! && patientProfileAppBarModel!.visitDate != null)
|
|
|
|
|
HeaderRow(
|
|
|
|
|
label: 'Visit Date: ',
|
|
|
|
|
value: visitDate ?? '',
|
|
|
|
|
value: patientProfileAppBarModel!.visitDate ?? '',
|
|
|
|
|
),
|
|
|
|
|
if (!isMedicalFile!)
|
|
|
|
|
if (!(patientProfileAppBarModel!.isMedicalFile!))
|
|
|
|
|
HeaderRow(
|
|
|
|
|
label: !isPrescriptions!
|
|
|
|
|
label: !(patientProfileAppBarModel!.isPrescriptions!)
|
|
|
|
|
? 'Result Date:'
|
|
|
|
|
: 'Prescriptions Date ',
|
|
|
|
|
value:
|
|
|
|
|
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
|
|
|
|
|
value: AppDateUtils.getDayMonthYearDateFormatted(
|
|
|
|
|
patientProfileAppBarModel!.appointmentDate! )
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
@ -438,34 +403,21 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
|
@override
|
|
|
|
|
Size get preferredSize => Size(
|
|
|
|
|
double.maxFinite,
|
|
|
|
|
height! == 0
|
|
|
|
|
? isInpatient
|
|
|
|
|
? (isFromLabResult! ? 210 : 200)
|
|
|
|
|
: isAppointmentHeader!
|
|
|
|
|
? 290
|
|
|
|
|
: SizeConfig.isHeightVeryShort
|
|
|
|
|
? 137
|
|
|
|
|
: SizeConfig.isHeightShort
|
|
|
|
|
? 190
|
|
|
|
|
: SizeConfig.heightMultiplier *
|
|
|
|
|
(SizeConfig.isWidthLarge ? 25 : 20)
|
|
|
|
|
: height!
|
|
|
|
|
// TODO Elham*2
|
|
|
|
|
// patientProfileAppBarModel!.height == 0
|
|
|
|
|
// ? patientProfileAppBarModel!.isAppointmentHeader!
|
|
|
|
|
// ? 270
|
|
|
|
|
// : ((localPatient!.appointmentDate!.isNotEmpty)
|
|
|
|
|
// ? patientProfileAppBarModel!.isFromLabResult!
|
|
|
|
|
// ? 190
|
|
|
|
|
// : 170
|
|
|
|
|
// : localPatient!.admissionDate != null
|
|
|
|
|
// ? patientProfileAppBarModel!.isFromLabResult!
|
|
|
|
|
// ? 190
|
|
|
|
|
// : 170
|
|
|
|
|
// : patientProfileAppBarModel!.isDischargedPatient!
|
|
|
|
|
// ? 240
|
|
|
|
|
// : 130)
|
|
|
|
|
// : patientProfileAppBarModel!.height!
|
|
|
|
|
patientProfileAppBarModel!.height == 0
|
|
|
|
|
? patientProfileAppBarModel!.isAppointmentHeader!
|
|
|
|
|
? 270
|
|
|
|
|
: ((patientProfileAppBarModel!.patient!.appointmentDate!.isNotEmpty)
|
|
|
|
|
? patientProfileAppBarModel!.isFromLabResult!
|
|
|
|
|
? 190
|
|
|
|
|
: 200
|
|
|
|
|
: patientProfileAppBarModel!.patient!.admissionDate != null
|
|
|
|
|
? patientProfileAppBarModel!.isFromLabResult!
|
|
|
|
|
? 210
|
|
|
|
|
: patientProfileAppBarModel!.isMedicalFile!?650:200
|
|
|
|
|
: patientProfileAppBarModel!.isDischargedPatient!
|
|
|
|
|
? 240
|
|
|
|
|
: 190)
|
|
|
|
|
: patientProfileAppBarModel!.height!
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|