From 4f558dc41dfee8f6661be96022d2c900a8a4cc9e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 25 Mar 2021 12:50:31 +0200 Subject: [PATCH 01/15] fix referral card --- lib/config/localized_values.dart | 2 +- .../referral/my-referral-patient-screen.dart | 50 +- .../referral/patient_referral_screen.dart | 1 + .../patient-referral-item-widget.dart | 576 ++++++++++++------ lib/widgets/shared/card_with_bg_widget.dart | 37 +- 5 files changed, 430 insertions(+), 236 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a1f63710..f30a86e5 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -328,7 +328,7 @@ const Map> localizedValues = { 'ar': 'لا وصفة طبية مدرجة' }, 'referTo': {'en': "Refer To", 'ar': 'محال إلى'}, - 'referredFrom': {'en': "Referred From", 'ar': 'محال من'}, + 'referredFrom': {'en': "From : ", 'ar': ' : من'}, 'branch': {'en': "Branch", 'ar': 'الفرع'}, 'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'}, 'appointmentNo': {'en': "Appointment # : ", 'ar': '# الموعد:'}, diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index a888ad3e..f54ac5e6 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -23,6 +23,7 @@ class MyReferralPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, + appBarTitle: TranslationBase.of(context).referPatient, body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( @@ -33,33 +34,35 @@ class MyReferralPatientScreen extends StatelessWidget { ) : SingleChildScrollView( child: Container( + // color: Colors.white, + height: MediaQuery.of(context).size.height, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox(height: 100), - ProfileWelcomeWidget( - AppText( - authProvider.selectedClinicName != null - ? authProvider.selectedClinicName - : authProvider.doctorProfile.clinicDescription, - fontSize: SizeConfig.textMultiplier * 1.7, - color: Colors.white, - textAlign: TextAlign.center, - ), - height: 100, - ), - SizedBox( - height: 16, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: AppText( - TranslationBase.of(context).myReferralPatient, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ), + // ProfileWelcomeWidget( + // AppText( + // authProvider.selectedClinicName != null + // ? authProvider.selectedClinicName + // : authProvider.doctorProfile.clinicDescription, + // fontSize: SizeConfig.textMultiplier * 1.7, + // color: Colors.white, + // textAlign: TextAlign.center, + // ), + // height: 100, + // ), + // SizedBox( + // height: 16, + // ), + // Padding( + // padding: const EdgeInsets.symmetric(horizontal: 16.0), + // child: AppText( + // TranslationBase.of(context).myReferralPatient, + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 16, + // ), + // ), ...List.generate( model.pendingReferral.length, (index) => InkWell( @@ -71,6 +74,7 @@ class MyReferralPatientScreen extends StatelessWidget { }, child: PatientReferralItemWidget( "${model.pendingReferral[index].patientID}", + patientInfo:model.pendingReferral[index] , patientName: model.pendingReferral[index].patientName, referralStatus: null, diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 80f30aad..2906e196 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -37,6 +37,7 @@ class _PatientReferralScreen extends State appBarTitle: TranslationBase.of(context).patientsreferral, body: Scaffold( extendBodyBehindAppBar: true, + // backgroundColor: Colors.white, appBar: PreferredSize( preferredSize: Size.fromHeight(65.0), child: Center( diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index ee54917b..1f45485f 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -1,6 +1,11 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class PatientReferralItemWidget extends StatelessWidget { final String patientName; @@ -14,6 +19,7 @@ class PatientReferralItemWidget extends StatelessWidget { final String referredOn; final String answerFromTarget; final Widget infoIcon; + final PendingReferral patientInfo; PatientReferralItemWidget( this.patientID, { @@ -27,6 +33,7 @@ class PatientReferralItemWidget extends StatelessWidget { this.referredOn, this.answerFromTarget, this.infoIcon, + this.patientInfo, }); @override @@ -35,222 +42,389 @@ class PatientReferralItemWidget extends StatelessWidget { margin: EdgeInsets.all(16.0), child: Column( children: [ - Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (referralStatus != null) + //TODO should be removed by mousa + // Row( + // children: [ + // Expanded( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // if (referralStatus != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).referralStatus, + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // Container( + // color: Color(0xFF4BA821), + // padding: EdgeInsets.all(4), + // child: AppText( + // referralStatus + // /*referralStatus == "46" + // ? TranslationBase.of(context).approved + // : TranslationBase.of(context).rejected*/ + // , + // color: Colors.white, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // Row( + // children: [ + // AppText( + // isReferredTo + // ? "${TranslationBase.of(context).referTo}: " + // : "${TranslationBase.of(context).referredFrom}: ", + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // AppText( + // isSameBranch + // ? TranslationBase.of(context).sameBranch + // : TranslationBase.of(context).otherBranch, + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // "${TranslationBase.of(context).referralDoctor} : ", + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // Expanded( + // child: AppText( + // referralDoctorName != null + // ? "${TranslationBase.of(context).dr} $referralDoctorName" + // : "-", + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // if (clinicDescription != null) + // Row( + // children: [ + // AppText( + // "${TranslationBase.of(context).clinic}: ", + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // AppText( + // clinicDescription, + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // Row( + // children: [ + // AppText( + // "${TranslationBase.of(context).patientID}: ", + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // AppText( + // patientID ?? '-', + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // Row( + // children: [ + // AppText( + // "${TranslationBase.of(context).patientName}: ", + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // AppText( + // patientName ?? '-', + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).referralRemark, + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // Expanded( + // child: AppText( + // remark, + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).referredOn, + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // AppText( + // referredOn ?? '-', + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ], + // ), + // if (answerFromTarget != null) + // SizedBox( + // height: 8, + // ), + // if (answerFromTarget != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).referralResponse, + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // AppText( + // answerFromTarget != "" ? answerFromTarget : '-', + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ], + // ), + // SizedBox( + // height: 16, + // ), + // ], + // ), + // ), + // if (infoIcon != null) infoIcon, + // ], + // ), + // const Divider( + // color: Color(0xffCCCCCC), + // height: 1, + // thickness: 1, + // indent: 0, + // endIndent: 0, + // ), + SizedBox( + height: 8, + ), + Container( + child: CardWithBgWidget( + bgColor: patientInfo.referralStatus =='Pending' + ? Colors.orange[400] + : Colors.red[800], + hasBorder: false, + widget:Container( + // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - AppText( - TranslationBase.of(context).referralStatus, - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - Container( - color: Color(0xFF4BA821), - padding: EdgeInsets.all(4), - child: AppText( - referralStatus - /*referralStatus == "46" - ? TranslationBase.of(context).approved - : TranslationBase.of(context).rejected*/ - , - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 12, + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: patientInfo.referralStatus, + style: TextStyle( + color: patientInfo.referralStatus =='Pending' + ? Colors.orange[400] + : Colors.red[800], + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 18)), + ], ), ), + //TODO :ask backend to return in the standerformate + AppText( + referredOn, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) ], ), - SizedBox( - height: 8, - ), - Row( - children: [ - AppText( - isReferredTo - ? "${TranslationBase.of(context).referTo}: " - : "${TranslationBase.of(context).referredFrom}: ", - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - AppText( - isSameBranch - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context).otherBranch, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - ], - ), - SizedBox( - height: 8, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "${TranslationBase.of(context).referralDoctor} : ", - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, + AppText( + patientInfo.patientName, + fontSize: SizeConfig.textMultiplier * 2, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + SizedBox( + width: 10, + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase + .of(context) + .fileNumber, + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.patientID.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], ), - Expanded( - child: AppText( - referralDoctorName != null - ? "${TranslationBase.of(context).dr} $referralDoctorName" - : "-", - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase + .of(context) + .referredFrom, + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins')), + new TextSpan( + text: isSameBranch + ? TranslationBase + .of(context) + .sameBranch + : TranslationBase + .of(context) + .otherBranch, + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], ), ), - ], - ), - SizedBox( - height: 8, - ), - if (clinicDescription != null) - Row( - children: [ - AppText( - "${TranslationBase.of(context).clinic}: ", - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - AppText( - clinicDescription, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - ], ), - SizedBox( - height: 8, - ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).patientID}: ", - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - AppText( - patientID ?? '-', - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - ], - ), - SizedBox( - height: 8, - ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).patientName}: ", - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - AppText( - patientName ?? '-', - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - ], - ), - SizedBox( - height: 8, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).referralRemark, - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - Expanded( - child: AppText( - remark, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase + .of(context) + .remarks + " : ", + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.remarksFromSource, + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], ), ), - ], - ), - SizedBox( - height: 8, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).referredOn, - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - AppText( - referredOn ?? '-', - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - ], - ), - if (answerFromTarget != null) - SizedBox( - height: 8, ), - if (answerFromTarget != null) + SizedBox(height: 20,), Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - AppText( - TranslationBase.of(context).referralResponse, - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - AppText( - answerFromTarget != "" ? answerFromTarget : '-', - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - ], - ), - SizedBox( - height: 16, - ), - ], - ), - ), - if (infoIcon != null) infoIcon, - ], - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 1, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 8, + + Column(children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase + .of(context) + .referralDoctor + " : ", + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins')), + new TextSpan( + text: referralDoctorName, + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], + ), + ) + ],), + Icon(FontAwesomeIcons.arrowRight, size: 25,color:Colors.black) + ],) + ], + ), + // onTap: onTap, + )) ,), ), ], ), diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index f7fd3637..4a274529 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -13,8 +13,11 @@ import 'package:provider/provider.dart'; class CardWithBgWidget extends StatelessWidget { final Widget widget; + final Color bgColor; + final bool hasBorder; - CardWithBgWidget({@required this.widget}); + CardWithBgWidget( + {@required this.widget, this.bgColor, this.hasBorder = true}); @override Widget build(BuildContext context) { @@ -26,7 +29,9 @@ class CardWithBgWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: HexColor('#707070'), width: 2.0), + border: Border.all( + color: hasBorder ? HexColor('#707070') : Colors.transparent, + width: hasBorder ? 2.0 : 0), ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -34,23 +39,33 @@ class CardWithBgWidget extends StatelessWidget { children: [ if (projectProvider.isArabic) Positioned( - child: Container( + child: Container( + decoration: BoxDecoration( + color: bgColor ?? HexColor('#58434F'), + + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10),),), width: 10, - color: HexColor('#58434F'), ), - bottom: 0, - top: 0, - right: 0, + bottom: 1, + top: 1, + right: 1, ) else Positioned( child: Container( + decoration: BoxDecoration( + color: bgColor ?? HexColor('#58434F'), + + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10),),), width: 10, - color: HexColor('#58434F'), ), - bottom: 0, - top: 0, - left: 0, + bottom: 1, + top: 1, + left: 1, ), Container( padding: EdgeInsets.all(15.0), From ffd77528a2e00f91c93c921b5421ba973ada9b77 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 25 Mar 2021 13:14:58 +0200 Subject: [PATCH 02/15] patient profile new design --- lib/models/patient/patiant_info_model.dart | 15 ++- .../profile/patient_profile_screen.dart | 42 +++++---- .../referral/my-referral-detail-screen.dart | 94 +++++++++++-------- .../profile/PatientProfileButton.dart | 4 +- .../profile/patient-page-header-widget.dart | 2 +- 5 files changed, 91 insertions(+), 66 deletions(-) diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 8c279f7c..8903791c 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,12 +1,13 @@ // TODO : it have to be changed. class PatiantInformtion { - final List list; + final PatiantInformtion patientDetails; int genderInt; dynamic age; String appointmentDate; int appointmentNo; String appointmentType; + int appointmentTypeId; String arrivedOn; int clinicGroupId; String companyName; @@ -31,6 +32,8 @@ class PatiantInformtion { String firstNameN; String middleNameN; String lastNameN; + String fullName; + String fullNameN; int gender; String dateofBirth; String nationalityId; @@ -58,7 +61,7 @@ class PatiantInformtion { int visitTypeId; String startTimes; PatiantInformtion( - {this.list, + {this.patientDetails, this.projectId, this.clinicId, this.doctorId, @@ -96,6 +99,7 @@ class PatiantInformtion { this.startTime, this.appointmentNo, this.appointmentType, + this.appointmentTypeId, this.arrivedOn, this.clinicGroupId, this.companyName, @@ -110,6 +114,8 @@ class PatiantInformtion { this.nationality, this.patientMRN, this.visitType, + this.fullName, + this.fullNameN, this.nationalityFlagURL, this.patientStatusType, this.visitTypeId, @@ -117,6 +123,8 @@ class PatiantInformtion { factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( + patientDetails: json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) + : null, projectId: json["ProjectID"] ?? json["projectID"], clinicId: json["ClinicID"] ?? json["clinicID"], doctorId: json["DoctorID"] ?? json["doctorID"], @@ -133,6 +141,8 @@ class PatiantInformtion { middleNameN: json["MiddleNameN"] ?? json["middleNameN"], lastNameN: json["LastNameN"] ?? json["lastNameN"], gender: json["Gender"] ?? json["gender"], + fullName: json["fullName"] ?? json["fullName"], + fullNameN: json["fullNameN"] ?? json["fullNameN"], dateofBirth: json["DateofBirth"] ?? json["dob"], nationalityId: json["NationalityID"] ?? json["nationalityID"], mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], @@ -165,6 +175,7 @@ class PatiantInformtion { startTime: json["startTime"], appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], appointmentType: json['appointmentType'], + appointmentTypeId: json['appointmentTypeId'], arrivedOn: json['arrivedOn'], clinicGroupId: json['clinicGroupId'], companyName: json['companyName'], diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index a2282f49..67626545 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -73,7 +73,7 @@ class PatientProfileScreen extends StatelessWidget { color: Color(0XFFF2F2F2), child: Stack( children: [ - SingleChildScrollView( + Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -368,25 +368,27 @@ class PatientProfileScreen extends StatelessWidget { ), ), ), - Padding( - padding: const EdgeInsets.all(16.0), - child: Container( - child: Column( - children: [ - isFromSearch - ? ProfileMedicalInfoWidgetSearch( - patient: patient, - patientType: patientType, - from: from, - to: to, - ) - : ProfileMedicalInfoWidget( - patient: patient, - patientType: patientType, - from: from, - to: to, - ), - ], + Expanded( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + children: [ + isFromSearch + ? ProfileMedicalInfoWidgetSearch( + patient: patient, + patientType: patientType, + from: from, + to: to, + ) + : ProfileMedicalInfoWidget( + patient: patient, + patientType: patientType, + from: from, + to: to, + ), + ], + ), ), ), ) diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 7449d970..134f3c2a 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -2,14 +2,17 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; @@ -42,17 +45,60 @@ class MyReferralDetailScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, + isShowAppBar: false, body: model.patientArrivalList != null && model.patientArrivalList.length > 0 ? Column( children: [ + Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + AppText( + (Helpers.capitalize(model.patientArrivalList[0].patientDetails.fullName)), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + model.patientArrivalList[0].patientDetails.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), + ], + ), + ), + ), Expanded( child: SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ProfileWelcomeWidget( + /*ProfileWelcomeWidget( AppText( authProvider.selectedClinicName != null ? authProvider.selectedClinicName @@ -63,7 +109,7 @@ class MyReferralDetailScreen extends StatelessWidget { textAlign: TextAlign.center, ), height: 100, - ), + ),*/ SizedBox( height: 16, ), @@ -91,45 +137,11 @@ class MyReferralDetailScreen extends StatelessWidget { referredOn: pendingReferral.referredOn, ), SizedBox( - child: GridView.count( - childAspectRatio: 1.8, - crossAxisSpacing: 8, - mainAxisSpacing: 10, - controller: new ScrollController( - keepScrollOffset: false), - shrinkWrap: true, - padding: const EdgeInsets.all(4.0), - crossAxisCount: 2, - children: [ - PatientProfileButton( - key: key, - patient: model.patientArrivalList[0], - route: MEDICAL_FILE, - nameLine1: TranslationBase.of(context) - .previewHealth, - nameLine2: TranslationBase.of(context) - .summaryReport, - icon: 'radiology-1.png'), - PatientProfileButton( - key: key, - patient: model.patientArrivalList[0], - route: LAB_ORDERS, - nameLine1: - TranslationBase.of(context).lab, - nameLine2: - TranslationBase.of(context).result, - icon: 'lab.png'), - PatientProfileButton( - key: key, - patient: model.patientArrivalList[0], - route: - VITAL_SIGN_DETAILS /*PATIENT_VITAL_SIGN*/, - nameLine1: - TranslationBase.of(context).vital, - nameLine2: - TranslationBase.of(context).signs, - icon: 'heartbeat.png'), - ], + child: ProfileMedicalInfoWidgetSearch( + patient: model.patientArrivalList[0], + patientType: "7", + from: null, + to: null, ), ), ], diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 28d3b700..ad0a7bd7 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -88,14 +88,14 @@ class PatientProfileButton extends StatelessWidget { color: Color(0xffBBBBBB), width: 1, )), - boxShadow: [ + /*boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.2), spreadRadius: 5, blurRadius: 7, offset: Offset(0, 3), // changes position of shadow ), - ], + ],*/ ), ); } diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index 71515b1d..ffb297b1 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -67,7 +67,7 @@ class PatientPageHeaderWidget extends StatelessWidget { height: 5, ), AppText( - patient.firstName + ' ' + patient.lastName, + patient.patientDetails.fullName != null ? patient.patientDetails.fullName : patient.firstName, color: Colors.black, fontWeight: FontWeight.bold, ), From ed104a4562ac8f97437674f644fe958c2b537809 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 28 Mar 2021 10:29:07 +0300 Subject: [PATCH 03/15] working on referral card --- .../patient-referral-item-widget.dart | 252 +++++++++--------- 1 file changed, 121 insertions(+), 131 deletions(-) diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 1f45485f..a218e864 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -42,7 +42,7 @@ class PatientReferralItemWidget extends StatelessWidget { margin: EdgeInsets.all(16.0), child: Column( children: [ - //TODO should be removed by mousa + // TODO should be removed by mousa // Row( // children: [ // Expanded( @@ -262,73 +262,91 @@ class PatientReferralItemWidget extends StatelessWidget { ), Container( child: CardWithBgWidget( - bgColor: patientInfo.referralStatus =='Pending' + bgColor: patientInfo.referralStatus == 'Pending' ? Colors.orange[400] : Colors.red[800], hasBorder: false, - widget:Container( - // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), - child: InkWell( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: patientInfo.referralStatus, - style: TextStyle( - color: patientInfo.referralStatus =='Pending' - ? Colors.orange[400] - : Colors.red[800], - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 18)), - ], - ), + widget: Container( + // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: patientInfo.referralStatus, + style: TextStyle( + color: patientInfo.referralStatus == + 'Pending' + ? Colors.orange[400] + : Colors.red[800], + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 18)), + ], ), - //TODO :ask backend to return in the standerformate - AppText( - referredOn, - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) + ), + //TODO :ask backend to return in the standerformate + AppText( + referredOn, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + ], + ), + AppText( + patientInfo.patientName, + fontSize: SizeConfig.textMultiplier * 2, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + SizedBox( + width: 10, + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 14, fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.patientID.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), ], ), - AppText( - patientInfo.patientName, - fontSize: SizeConfig.textMultiplier * 2, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', - ), - SizedBox( - width: 10, - ), - RichText( + ), + Container( + child: RichText( text: new TextSpan( style: new TextStyle( fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( - text: TranslationBase - .of(context) - .fileNumber, + text: TranslationBase.of(context).referredFrom, style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), + fontSize: 14, fontFamily: 'Poppins')), new TextSpan( - text: patientInfo.patientID.toString(), + text: isSameBranch + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context).otherBranch, style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -336,95 +354,67 @@ class PatientReferralItemWidget extends StatelessWidget { ], ), ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase - .of(context) - .referredFrom, - style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), - new TextSpan( - text: isSameBranch - ? TranslationBase - .of(context) - .sameBranch - : TranslationBase - .of(context) - .otherBranch, - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], - ), + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of(context).remarks + " : ", + style: TextStyle( + fontSize: 14, fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.remarksFromSource, + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], ), ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( + ), + SizedBox( + height: 20, + ), + Column( + children: [ + RichText( + text: TextSpan( + style: TextStyle( fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ - new TextSpan( - text: TranslationBase - .of(context) - .remarks + " : ", + TextSpan( + text: TranslationBase.of(context) + .referralDoctor + + " : ", style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), - new TextSpan( - text: patientInfo.remarksFromSource, + fontSize: 14, fontFamily: 'Poppins')), + TextSpan( + text: referralDoctorName, style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 15)), ], ), - ), - ), - SizedBox(height: 20,), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - - Column(children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase - .of(context) - .referralDoctor + " : ", - style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), - new TextSpan( - text: referralDoctorName, - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], - ), - ) - ],), - Icon(FontAwesomeIcons.arrowRight, size: 25,color:Colors.black) - ],) - ], - ), - // onTap: onTap, - )) ,), + ) + ], + ), + Container( + width: double.infinity, + alignment: Alignment.centerRight, + child: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black)) + ], + ), + // onTap: onTap, + )), + ), ), ], ), From 08b7b6263c3b9736cacc3ac64ef552716271140c Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 28 Mar 2021 10:46:55 +0300 Subject: [PATCH 04/15] Add new services to arrival patient --- .../profile/profile_medical_info_widget.dart | 15 +++++++++++---- .../profile_medical_info_widget_search.dart | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index d6073657..d5a87f60 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -79,7 +79,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: LAB_ORDERS, + route: LAB_RESULT, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), @@ -104,7 +104,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: PATIENT_ADMISSION_REQUEST, + route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'patient/admission_req.png'), @@ -123,6 +123,13 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'patient/order_prescription.png'), + PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -159,7 +166,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: RADIOLOGY, + route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, icon: 'patient/health_summary.png'), @@ -167,7 +174,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: PATIENT_INSURANCE_APPROVALS, + route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, icon: 'patient/vital_signs.png'), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index 150ac872..704ced0d 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -45,7 +45,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: LAB_ORDERS, + route: LAB_RESULT, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), @@ -69,14 +69,14 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { ? PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION, + route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'patient/order_prescription.png') : PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION_HISTORY, + route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'patient/order_prescription.png'), From 27ff179750756448c80a24d7d25d7dd9a5a1db65 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 28 Mar 2021 11:12:42 +0300 Subject: [PATCH 05/15] working on referral screen bugs --- .../referral/my-referral-detail-screen.dart | 3 +- .../referral/my-referral-patient-screen.dart | 34 ++++--------------- .../referral/patient_referral_screen.dart | 3 +- .../referral/referred-patient-screen.dart | 1 + .../patient-referral-item-widget.dart | 19 +++++------ 5 files changed, 20 insertions(+), 40 deletions(-) diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 134f3c2a..d6d9e8b6 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -126,7 +126,7 @@ class MyReferralDetailScreen extends StatelessWidget { PatientReferralItemWidget( "${pendingReferral.patientID}", patientName: pendingReferral.patientName, - referralStatus: null, + referralStatus: pendingReferral.referralStatus, isReferredTo: false, isSameBranch: pendingReferral.isReferralDoctorSameBranch, @@ -135,6 +135,7 @@ class MyReferralDetailScreen extends StatelessWidget { clinicDescription: null, remark: pendingReferral.remarksFromSource, referredOn: pendingReferral.referredOn, + patientInfo: pendingReferral, ), SizedBox( child: ProfileMedicalInfoWidgetSearch( diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index f54ac5e6..3cab440c 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -23,7 +23,6 @@ class MyReferralPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referPatient, body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( @@ -34,35 +33,13 @@ class MyReferralPatientScreen extends StatelessWidget { ) : SingleChildScrollView( child: Container( + margin: EdgeInsets.only(top: 50), // color: Colors.white, - height: MediaQuery.of(context).size.height, + // height: MediaQuery.of(context).size.height, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox(height: 100), - // ProfileWelcomeWidget( - // AppText( - // authProvider.selectedClinicName != null - // ? authProvider.selectedClinicName - // : authProvider.doctorProfile.clinicDescription, - // fontSize: SizeConfig.textMultiplier * 1.7, - // color: Colors.white, - // textAlign: TextAlign.center, - // ), - // height: 100, - // ), - // SizedBox( - // height: 16, - // ), - // Padding( - // padding: const EdgeInsets.symmetric(horizontal: 16.0), - // child: AppText( - // TranslationBase.of(context).myReferralPatient, - // color: Colors.black, - // fontWeight: FontWeight.bold, - // fontSize: 16, - // ), - // ), + // SizedBox(height: 50), ...List.generate( model.pendingReferral.length, (index) => InkWell( @@ -74,10 +51,11 @@ class MyReferralPatientScreen extends StatelessWidget { }, child: PatientReferralItemWidget( "${model.pendingReferral[index].patientID}", - patientInfo:model.pendingReferral[index] , + patientInfo: model.pendingReferral[index], patientName: model.pendingReferral[index].patientName, - referralStatus: null, + referralStatus: + model.pendingReferral[index].referralStatus, isReferredTo: false, isSameBranch: model.pendingReferral[index] .isReferralDoctorSameBranch, diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 2906e196..adea0247 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -92,7 +92,8 @@ class _PatientReferralScreen extends State controller: _tabController, children: [ MyReferralPatientScreen(), - MyReferredPatient(), + ReferredPatientScreen(), + // MyReferredPatient(), ], ), ) diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 323a9a9b..d6a81603 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -15,6 +15,7 @@ class ReferredPatientScreen extends StatelessWidget { onModelReady: (model) => model.getMyReferredPatient(), builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).referredPatient, body: model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0 diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index a218e864..d5c1d035 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -39,7 +39,7 @@ class PatientReferralItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.all(16.0), + margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0), child: Column( children: [ // TODO should be removed by mousa @@ -257,14 +257,14 @@ class PatientReferralItemWidget extends StatelessWidget { // indent: 0, // endIndent: 0, // ), - SizedBox( - height: 8, - ), + // SizedBox( + // height: 8, + // ), Container( child: CardWithBgWidget( - bgColor: patientInfo.referralStatus == 'Pending' + bgColor: referralStatus != null ? referralStatus == 'Pending' ? Colors.orange[400] - : Colors.red[800], + : Colors.red[800] : Colors.grey[500], hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -283,12 +283,11 @@ class PatientReferralItemWidget extends StatelessWidget { color: Colors.black), children: [ new TextSpan( - text: patientInfo.referralStatus, + text: referralStatus != null ? referralStatus : "", style: TextStyle( - color: patientInfo.referralStatus == - 'Pending' + color: referralStatus != null ? referralStatus == 'Pending' ? Colors.orange[400] - : Colors.red[800], + : Colors.red[800] : Colors.grey[500], fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 18)), From 6267d805f018f233f98a5e3e09012070e624fec4 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 28 Mar 2021 12:08:36 +0300 Subject: [PATCH 06/15] hot fixes --- lib/config/config.dart | 4 ++-- .../service/patient-vital-signs-service.dart | 2 +- .../insurance_approval_screen_patient.dart | 5 +++-- .../radiology/radiology_details_page.dart | 5 +++-- lib/util/date-utils.dart | 17 +++++++++++------ 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3a72faba..0f615af5 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index bac13c7f..75bc955f 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -42,7 +42,7 @@ class VitalSignsService extends BaseService { hasError = false; Map body = Map(); body['PatientMRN'] = patient.patientId; // patient.patientMRN - body['AppointmentNo'] = patient.appointmentNo; + // body['AppointmentNo'] = patient.appointmentNo; // body['EpisodeID'] = patient.episodeNo; body['PatientTypeID'] = 1; body['PatientType'] = 1; diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 91ed13b2..95f55e27 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -236,7 +237,7 @@ class _InsuranceApprovalScreenNewState extends State ), Texts( - convertDateFormat(model.insuranceApproval[index].rceiptOn), + DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[index].rceiptOn).toString(), fontSize: 17.5, fontWeight: FontWeight.w600, @@ -257,7 +258,7 @@ class _InsuranceApprovalScreenNewState extends State ), Texts( - convertDateFormat(model.insuranceApproval[index].expiryDate), + DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[index].expiryDate).toString(), fontSize: 17.5, fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index fc9f207a..dedb5bd5 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -56,15 +56,16 @@ class RadiologyDetailsPage extends StatelessWidget { bottomSheet: Container( width: double.infinity, height: MediaQuery.of(context).size.height * 0.14, - color: Colors.grey[100], + // color: Colors.grey[100], child: Column( mainAxisSize: MainAxisSize.min, children: [ Divider(), - if (finalRadiology.dIAPACSURL != "") + if (model.radImageURL.isNotEmpty) Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( + onTap: () { launch(model.radImageURL); }, diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 4ef21844..51089567 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -19,16 +19,21 @@ class DateUtils { } static DateTime getDateTimeFromServerFormat(String str) { - const start = "/Date("; + DateTime date= DateTime.now(); + if (str!=null) { + const start = "/Date("; - const end = "+0300)"; + const end = "+0300)"; - final startIndex = str.indexOf(start); + final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); + final endIndex = str.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); + date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + } else { + date = DateTime.now(); + } return date; } From f8c14a88eedb7cde1cd1dc8dc948415c847b5533 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 28 Mar 2021 17:59:37 +0300 Subject: [PATCH 07/15] fix schedule --- lib/util/date-utils.dart | 10 ++ lib/widgets/doctor/my_schedule_widget.dart | 115 ++++++++++++-------- lib/widgets/shared/card_with_bg_widget.dart | 2 +- 3 files changed, 81 insertions(+), 46 deletions(-) diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 51089567..9396c2f0 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -284,4 +284,14 @@ class DateUtils { } return "$years ${TranslationBase.of(context).years} $months ${TranslationBase.of(context).months} $days ${TranslationBase.of(context).days}"; } + + static bool isToday(DateTime dateTime){ + + DateTime todayDate = DateTime.now().toUtc(); + if(dateTime.day == todayDate.day && dateTime.month == todayDate.month && dateTime.year == todayDate.year) { + return true; + } + return false; + + } } diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 34ec97db..bc681a94 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -1,8 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -16,58 +17,82 @@ class MyScheduleWidget extends StatelessWidget { List workingHours = Helpers.getWorkingHours( workingHoursTable.workingHours, ); - return CardWithBgWidgetNew( - widget: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - children: [ - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - ], + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + AppText( + workingHoursTable.dayName, + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + // fontSize: 18 ), SizedBox( height: 10, ), - Row( - children: [ - AppText( - workingHoursTable.dayName, - fontSize: 2.5 * SizeConfig.textMultiplier, - ), - AppText( - ' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}', - fontSize: 2.2 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ), - ], + AppText( + ' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', + fontSize: 2.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700, + + fontFamily: 'Poppins', + // fontSize: 18 ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: workingHours.map((work) { - return Container( - child: Column( - children: [ - SizedBox( - height: 5, - ), - AppText( - work.from + ' - ' + work.to, - fontSize: 2.0 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], + ], + ), + Container( + width: MediaQuery.of(context).size.width * 0.55, + child: CardWithBgWidget( + bgColor: DateUtils.isToday(workingHoursTable.date) + ? Colors.green[500] + : Colors.transparent, + hasBorder: false, + widget: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (DateUtils.isToday(workingHoursTable.date)) + AppText( + "Today", + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + color: Colors.green[500], + // fontSize: 18 + ), + SizedBox( + height: 10, ), - ); - }).toList(), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: workingHours.map((work) { + return Container( + child: Column( + children: [ + SizedBox( + height: 5, + ), + AppText( + work.from + ' - ' + work.to, + fontSize: 2.0 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ); + }).toList(), + ), + ], + ), ), - ], + ), ), - ), + ], ); } } diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index 4a274529..b4da8d28 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -24,7 +24,7 @@ class CardWithBgWidget extends StatelessWidget { ProjectViewModel projectProvider = Provider.of(context); return Container( margin: EdgeInsets.symmetric(vertical: 10.0), - width: double.infinity, + // width: double.infinity, decoration: BoxDecoration( borderRadius: BorderRadius.all( Radius.circular(10.0), From c1868d98a46611c9f6f8c4caf3ef8e9ed3ab0539 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 28 Mar 2021 18:04:08 +0300 Subject: [PATCH 08/15] small fix --- lib/widgets/doctor/my_schedule_widget.dart | 2 +- lib/widgets/shared/card_with_bg_widget.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index bc681a94..25e794cf 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -52,7 +52,7 @@ class MyScheduleWidget extends StatelessWidget { bgColor: DateUtils.isToday(workingHoursTable.date) ? Colors.green[500] : Colors.transparent, - hasBorder: false, + // hasBorder: false, widget: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index b4da8d28..3b65bba5 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -31,7 +31,7 @@ class CardWithBgWidget extends StatelessWidget { ), border: Border.all( color: hasBorder ? HexColor('#707070') : Colors.transparent, - width: hasBorder ? 2.0 : 0), + width: hasBorder ? 0.30 : 0), ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), From db2c086ffd1f3fca903338da1529f4fa7cc715b7 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 28 Mar 2021 19:18:29 +0300 Subject: [PATCH 09/15] Medical Report New Design --- .../medical-file/medical_file_details.dart | 1134 +++++++++-------- .../medical-file/medical_file_page.dart | 314 ++++- pubspec.lock | 8 +- 3 files changed, 907 insertions(+), 549 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index e93bab49..64e4405b 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -72,7 +73,6 @@ class _MedicalFileDetailsState extends State { child: SingleChildScrollView( child: Center( child: Container( - color: Colors.white, child: Column( children: [ Padding( @@ -278,96 +278,115 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], + width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .historyOfPresentIllness - .toUpperCase(), - variant: isHistoryExpand - ? "bodyText" - : '', - bold: isHistoryExpand - ? true - : false, - color: Colors.black), + Row( + children: [ + Texts( + TranslationBase.of( + context) + .historyOfPresentIllness + .toUpperCase(), + variant: isHistoryExpand + ? "bodyText" + : '', + bold: isHistoryExpand + ? true + : true, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isHistoryExpand = + !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = - !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - //physics: , - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstCheifComplaint - .length, - itemBuilder: - (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Row( + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstCheifComplaint + .length, + itemBuilder: (BuildContext ctxt, + int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, children: [ - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[0] - .lstCheifComplaint[ - index] - .hOPI - .trim(), - ), + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstCheifComplaint[ + index] + .hOPI + .trim(), + ), + ), + SizedBox( + width: 35.0), + ], ), - SizedBox(width: 35.0), ], ), - ], - ), - ), - ); - }), - isExpand: isHistoryExpand, + ), + ); + }), + isExpand: isHistoryExpand, + ), + ), ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + // SizedBox( + // height: 30, + // ), + SizedBox( height: 30, ), @@ -380,85 +399,174 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], + width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .assessment - .toUpperCase(), - variant: isAssessmentExpand - ? "bodyText" - : '', - bold: isAssessmentExpand - ? true - : false, - color: Colors.black), + Row( + children: [ + Texts( + TranslationBase.of( + context) + .assessment + .toUpperCase(), + variant: + isAssessmentExpand + ? "bodyText" + : '', + bold: isAssessmentExpand + ? true + : true, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = + !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = - !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - //physics: , - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments - .length, - itemBuilder: - (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Row( + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments + .length, + itemBuilder: (BuildContext ctxt, + int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, children: [ - AppText( - 'ICD', - fontWeight: - FontWeight.w700, + Row( + children: [ + AppText( + 'ICD', + fontWeight: + FontWeight + .w700, + ), + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] + .iCD10 + .trim(), + ), + SizedBox( + width: 35.0), + AppText( + 'Condition: ', + fontWeight: + FontWeight + .w700, + ), + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] + .condition + .trim(), + ), + ], ), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .iCD10 - .trim(), + Row( + children: [ + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] + .description, + fontWeight: + FontWeight + .w700, + ) + ], ), - SizedBox(width: 35.0), - AppText( - 'Condition: ', - fontWeight: - FontWeight.w700, + Row( + children: [ + AppText( + 'Type: ', + fontWeight: + FontWeight + .w700, + ), + AppText(model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[0] + .lstAssessments[ + index] + .type), + ], + ), + SizedBox( + height: 15.0, ), AppText( model @@ -471,87 +579,34 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstAssessments[ index] - .condition + .remarks .trim(), ), - ], - ), - Row( - children: [ - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .description, - fontWeight: - FontWeight.w700, - ) - ], - ), - Row( - children: [ - AppText( - 'Type: ', - fontWeight: - FontWeight.w700, + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .type), ], ), - SizedBox( - height: 15.0, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[index] - .remarks - .trim(), - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], - ), - ), - ); - }), - isExpand: isAssessmentExpand, + ), + ); + }), + isExpand: isAssessmentExpand, + ), + ), ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + // SizedBox( + // height: 30, + // ), + // Container( + // width: double.infinity, + // height: 1, + // color: Color(0xffCCCCCC), + // ), SizedBox( height: 30, ), @@ -564,90 +619,181 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], + width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .test - .toUpperCase(), - variant: isProcedureExpand - ? "bodyText" - : '', - bold: isProcedureExpand - ? true - : false, - color: Colors.black), + Row( + children: [ + Texts( + TranslationBase.of( + context) + .test + .toUpperCase(), + variant: isProcedureExpand + ? "bodyText" + : '', + bold: isProcedureExpand + ? true + : true, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isProcedureExpand = + !isProcedureExpand; + }); + }, + child: Icon(isProcedureExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), - InkWell( - onTap: () { - setState(() { - isProcedureExpand = - !isProcedureExpand; - }); - }, - child: Icon(isProcedureExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure - .length, - itemBuilder: - (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Row( + bodyWidget: ListView.builder( + physics: + NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure + .length, + itemBuilder: (BuildContext ctxt, + int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, children: [ - AppText( - 'Procedure ID: ', - fontWeight: - FontWeight.w700, + Row( + children: [ + Column( + children: [ + AppText( + 'Procedure ID: ', + fontWeight: + FontWeight + .w700, + ), + AppText( + model + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .procedureId + .trim(), + ), + ], + ), + SizedBox( + width: 35.0), + Column( + children: [ + AppText( + 'Order Date: ', + fontWeight: + FontWeight + .w700, + ), + AppText( + Helpers.getDateFormatted( + DateTime + .parse( + model + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .orderDate + .trim(), + )), + fontSize: + 13.5, + ), + ], + ), + ], ), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure[ - index] - .procedureId - .trim(), + SizedBox( + height: 20.0, ), - SizedBox(width: 35.0), - AppText( - 'Order Date: ', - fontWeight: - FontWeight.w700, + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .procName, + fontWeight: + FontWeight + .w700, + ), + ) + ], ), - Expanded( - child: AppText( - model + Row( + children: [ + AppText( + 'CPT Code : ', + fontWeight: + FontWeight + .w700, + ), + AppText(model .medicalFileList[ 0] .entityList[0] @@ -658,79 +804,38 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstProcedure[ index] - .orderDate - .trim(), - ), + .patientID + .toString()), + ], ), - ], - ), - Row( - children: [ - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[0] - .lstProcedure[ - index] - .procName, - fontWeight: - FontWeight.w700, - ), - ) - ], - ), - Row( - children: [ - AppText( - 'CPT Code : ', - fontWeight: - FontWeight.w700, + SizedBox( + height: 15.0, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure[index] - .patientID - .toString()), ], ), - SizedBox( - height: 15.0, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], - ), - ), - ); - }), - isExpand: isProcedureExpand, + ), + ); + }), + isExpand: isProcedureExpand, + ), + ), ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + // SizedBox( + // height: 30, + // ), + // Container( + // width: double.infinity, + // height: 1, + // color: Color(0xffCCCCCC), + // ), SizedBox( height: 30, ), @@ -743,79 +848,144 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], + width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .physicalSystemExamination - .toUpperCase(), - variant: isPhysicalExam - ? "bodyText" - : '', - bold: isPhysicalExam - ? true - : false, - color: Colors.black), + Row( + children: [ + Texts( + TranslationBase.of( + context) + .physicalSystemExamination + .toUpperCase(), + variant: isPhysicalExam + ? "bodyText" + : '', + bold: isPhysicalExam + ? true + : true, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isPhysicalExam = + !isPhysicalExam; + }); + }, + child: Icon(isPhysicalExam + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), - InkWell( - onTap: () { - setState(() { - isPhysicalExam = - !isPhysicalExam; - }); - }, - child: Icon(isPhysicalExam - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) - ], - ), - bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam - .length, - itemBuilder: - (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - children: [ - Row( + bodyWidget: ListView.builder( + physics: + NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam + .length, + itemBuilder: (BuildContext ctxt, + int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( children: [ - AppText( - 'Exam Type: ', - fontWeight: - FontWeight.w700, + Row( + children: [ + AppText( + 'Exam Type: ', + fontWeight: + FontWeight + .w700, + ), + AppText(model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[0] + .lstPhysicalExam[ + index] + .examDesc), + ], + ), + Row( + children: [ + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstPhysicalExam[ + index] + .examDesc, + fontWeight: + FontWeight + .w700, + ) + ], + ), + Row( + children: [ + AppText( + 'Abnormal: ', + fontWeight: + FontWeight + .w700, + ), + AppText(model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[0] + .lstPhysicalExam[ + index] + .abnormal), + ], + ), + SizedBox( + height: 15.0, ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] - .examDesc), - ], - ), - Row( - children: [ AppText( model .medicalFileList[ @@ -827,69 +997,33 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstPhysicalExam[ index] - .examDesc, - fontWeight: - FontWeight.w700, - ) - ], - ), - Row( - children: [ - AppText( - 'Abnormal: ', - fontWeight: - FontWeight.w700, + .remarks, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] - .abnormal), ], ), - SizedBox( - height: 15.0, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] - .remarks, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], - ), - ), - ); - }), - isExpand: isPhysicalExam, + ), + ); + }), + isExpand: isPhysicalExam, + ), + ), ), SizedBox( height: 30, ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + // Container( + // width: double.infinity, + // height: 1, + // color: Color(0xffCCCCCC), + // ), ], ), ), diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 79f7416f..b0901e0a 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -1,14 +1,20 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; class MedicalFilePage extends StatefulWidget { @override @@ -20,6 +26,10 @@ class _MedicalFilePageState extends State { @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; + patient = routeArgs['patient']; return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), @@ -32,19 +42,91 @@ class _MedicalFilePageState extends State { baseViewModel: model, child: SingleChildScrollView( child: Container( - color: Colors.white, child: Column( // mainAxisAlignment: model.medicalFileList.length != 0 && // model.medicalFileList != null // ? MainAxisAlignment.start // : MainAxisAlignment.center, children: [ - PatientPageHeaderWidget(patient), + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + AppText( + (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize(patient.lastName)), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + patient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + patient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, + ), + ]), Divider( height: 1.0, thickness: 1.0, color: Colors.grey, ), + Padding( + padding: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), + child: Container( + child: Column( + children: [ + Row( + children: [ + AppText( + 'Medical', + fontSize: 15.0, + fontWeight: FontWeight.normal, + ), + ], + ), + Row( + children: [ + AppText( + 'Report', + fontSize: 35.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), + ), (model.medicalFileList != null && model.medicalFileList.length != 0) ? ListView.builder( @@ -60,66 +142,208 @@ class _MedicalFilePageState extends State { horizontal: 12.0, vertical: 8.0), child: InkWell( child: Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], width: 0.5), + ), child: Column( children: [ Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - AppText( - TranslationBase.of(context).branch + - ": ", - fontWeight: FontWeight.w700, + Row( + children: [ + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorName, + fontWeight: FontWeight.w700, + fontSize: 17.0, + fontFamily: 'Poppins', + ) + ], ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .projectName), + Row( + children: [ + AppText( + Helpers.convertStringToDate(model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .date) + .day + .toString() + + "/", + ), + AppText( + Helpers.convertStringToDate(model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .date) + .month + .toString() + + "/", + ), + AppText( + Helpers.convertStringToDate( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .date) + .year + .toString(), + ), + ], + ) ], ), Row( + mainAxisAlignment: + MainAxisAlignment.start, children: [ - AppText( - TranslationBase.of(context) - .doctorName - .toUpperCase() + - ": ", - fontWeight: FontWeight.w700, - ), - Expanded( - child: AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorName, - fontWeight: FontWeight.w700, + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + ClipRRect( + borderRadius: + BorderRadius.all( + Radius.circular(30)), + child: Image.network( + 'https://media.istockphoto.com/photos/portrait-senior-asian-doctor-over-radiography-background-asian-picture-id1019862020?k=6&m=1019862020&s=612x612&w=0&h=40frRnNnEGhNv5XRcDMRn55bIxCC3oXzbO6pOSQL_sQ=', + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + ], ), ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context) + .clinic + + ": ", + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .clinicName, + fontWeight: FontWeight.w600, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + AppText( + TranslationBase.of(context) + .branch + + ": ", + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .projectName, + fontWeight: FontWeight.w600, + ), + ], + ), + ], + ), ], ), Row( + mainAxisAlignment: + MainAxisAlignment.end, children: [ - AppText( - TranslationBase.of(context) - .clinicName + - ": ", - fontWeight: FontWeight.w700, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .clinicName, - ), + Column( + children: [ + Icon( + Icons.remove_red_eye, + size: 30.0, + ) + ], + ) ], ), - SizedBox(height: 10.0), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey.shade400, - ) + // Row( + // children: [ + // Expanded( + // child: AppText( + // model + // .medicalFileList[0] + // .entityList[0] + // .timelines[index] + // .doctorName, + // fontWeight: FontWeight.w700, + // fontSize: 18.0, + // fontFamily: 'Poppins', + // ), + // ), + // ], + // ), + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).branch + + // ": ", + // fontWeight: FontWeight.w700, + // ), + // AppText(model + // .medicalFileList[0] + // .entityList[0] + // .timelines[index] + // .projectName), + // ], + // ), + // Row( + // children: [ + // AppText( + // TranslationBase.of(context) + // .clinicName + + // ": ", + // fontWeight: FontWeight.w700, + // ), + // AppText( + // model + // .medicalFileList[0] + // .entityList[0] + // .timelines[index] + // .clinicName, + // ), + // ], + // ), + // SizedBox(height: 10.0), + // Divider( + // height: 1.0, + // thickness: 1.0, + // color: Colors.grey.shade400, + // ) ], ), ), diff --git a/pubspec.lock b/pubspec.lock index ca18664d..e15e02c9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -608,7 +608,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -900,7 +900,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -1084,5 +1084,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From 61a0e42afae899c6402620d59be97f480f73d9d8 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 29 Mar 2021 09:56:26 +0300 Subject: [PATCH 10/15] paient and referral screens new design --- .../profile/patient_profile_screen.dart | 345 +---------------- .../patient-referral-item-widget.dart | 179 ++++++--- .../patient-profile-header-new-design.dart | 351 ++++++++++++++++++ 3 files changed, 476 insertions(+), 399 deletions(-) create mode 100644 lib/widgets/patients/profile/patient-profile-header-new-design.dart diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index ef566b9f..68519d73 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -1,42 +1,27 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; import '../../../routes.dart'; -/* - *@author: Elham Rababah - *@Date:22/4/2020 - *@param: - *@return:PatientProfileWidget - *@desc: Patient Profile Widget - */ // ignore: must_be_immutable class PatientProfileScreen extends StatelessWidget { PatiantInformtion patient; bool isFromSearch = false; - //TODO change it @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -77,297 +62,7 @@ class PatientProfileScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - color: Colors.white, - ), - height: 220, - child: Container( - padding: EdgeInsets.only( - left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), - child: Column( - children: [ - Container( - padding: EdgeInsets.only(left: 12.0), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ), - AppText( - (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize( - patient.lastName)), - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', - ), - patient.gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - ]), - ), - Row(children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - patient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SERVICES_PATIANT2[ - int.parse(patientType)] == - "patientArrivalList" - ? Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - patient.patientStatusType == - 43 - ? AppText( - TranslationBase.of( - context) - .arrivedP, - color: Colors.green, - fontWeight: - FontWeight.bold, - fontFamily: - 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of( - context) - .notArrived, - color: - Colors.red[800], - fontWeight: - FontWeight.bold, - fontFamily: - 'Poppins', - fontSize: 12, - ), - arrivalType == '1' - ? AppText( - patient.startTime != - null - ? patient - .startTime - : '', - fontFamily: - 'Poppins', - fontWeight: - FontWeight.w600, - ) - : AppText( - DateUtils.convertStringToDateFormat( - patient - .arrivedOn, - 'MM-dd-yyyy HH:mm'), - fontFamily: - 'Poppins', - fontWeight: - FontWeight.w600, - ) - ], - )) - : SizedBox(), - if (SERVICES_PATIANT2[ - int.parse(patientType)] == - "List_MyOutPatient") - Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .appointmentDate + - " : ", - fontSize: 14, - ), - 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: 1.5 * - SizeConfig - .textMultiplier, - textAlign: TextAlign - .center, - fontWeight: - FontWeight.bold, - ), - ) - : SizedBox(), - SizedBox( - width: 3.5, - ), - Container( - child: AppText( - convertDateFormat2(patient - .appointmentDate - .toString()), - fontSize: 1.5 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight.bold, - ), - ), - SizedBox( - height: 0.5, - ) - ], - ), - margin: EdgeInsets.only( - top: 8, - ), - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 1.6 * - SizeConfig - .textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: - TranslationBase.of( - context) - .fileNumber, - style: TextStyle( - fontSize: 12, - fontFamily: - 'Poppins')), - new TextSpan( - text: patient.patientId - .toString(), - style: TextStyle( - fontWeight: - FontWeight.w700, - fontFamily: - 'Poppins', - fontSize: 14)), - ], - ), - ), - Row( - children: [ - AppText( - patient.nationalityName ?? - patient.nationality, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - patient.nationality != null - ? ClipRRect( - borderRadius: - BorderRadius - .circular( - 20.0), - child: Image.network( - patient - .nationalityFlagURL, - height: 25, - width: 30, - errorBuilder: - (BuildContext - context, - Object - exception, - StackTrace - stackTrace) { - return Text( - 'No Image'); - }, - )) - : SizedBox() - ], - ) - ], - ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 1.6 * - SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .age + - " : ", - style: TextStyle( - fontSize: 14)), - new TextSpan( - text: - "${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", - style: TextStyle( - fontWeight: - FontWeight.w700, - fontSize: 14)), - ], - ), - ), - ), - ], - ), - ), - ]), - ], - ), - ), - ), + PatientProfileHeaderNewDesign(patient, patientType, arrivalType), Expanded( child: Padding( padding: const EdgeInsets.all(16.0), @@ -495,42 +190,6 @@ class AvatarWidget extends StatelessWidget { } } -convertDateFormat2(String str) { - String timeConvert; - const start = "/Date("; - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); -} - -isToday(date) { - DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); -} - -myBoxDecoration() { - return BoxDecoration( - border: Border( - top: BorderSide( - color: Colors.green, - width: 5, - ), - ), - borderRadius: BorderRadius.circular(10)); -} - /* Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index d5c1d035..6e9008e7 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -262,9 +263,11 @@ class PatientReferralItemWidget extends StatelessWidget { // ), Container( child: CardWithBgWidget( - bgColor: referralStatus != null ? referralStatus == 'Pending' - ? Colors.orange[400] - : Colors.red[800] : Colors.grey[500], + bgColor: referralStatus != null + ? referralStatus == 'Pending' + ? Color(0xffc4aa54) + : Colors.red[800] + : Colors.grey[500], hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -272,7 +275,6 @@ class PatientReferralItemWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -283,76 +285,141 @@ class PatientReferralItemWidget extends StatelessWidget { color: Colors.black), children: [ new TextSpan( - text: referralStatus != null ? referralStatus : "", + text: referralStatus != null + ? referralStatus + : "", style: TextStyle( - color: referralStatus != null ? referralStatus == 'Pending' - ? Colors.orange[400] - : Colors.red[800] : Colors.grey[500], + color: referralStatus != null + ? referralStatus == 'Pending' + ? Color(0xffc4aa54) + : referralStatus == 'Accepted' + ? Colors.green[700] + : Colors.red[700] + : Colors.grey[500], fontWeight: FontWeight.w700, fontFamily: 'Poppins', - fontSize: 18)), + fontSize: 2.0 * SizeConfig.textMultiplier)), ], ), ), - //TODO :ask backend to return in the standerformate + //TODO :ask backend to return in the standard format AppText( referredOn, fontFamily: 'Poppins', fontWeight: FontWeight.w600, + fontSize: 2.1 * SizeConfig.textMultiplier, ) ], ), - AppText( - patientInfo.patientName, - fontSize: SizeConfig.textMultiplier * 2, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', + Row( + children: [ + AppText( + patientInfo.patientName, + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + SizedBox( + width: 4, + ), + /*patient.gender*/1 == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ], ), SizedBox( width: 10, ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).fileNumber, - style: TextStyle( - fontSize: 14, fontFamily: 'Poppins')), - new TextSpan( - text: patientInfo.patientID.toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], - ), - ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).referredFrom, - style: TextStyle( - fontSize: 14, fontFamily: 'Poppins')), - new TextSpan( - text: isSameBranch - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context).otherBranch, - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 14, fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.patientID.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], + ), + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).referredFrom, + style: TextStyle( + fontSize: 14, fontFamily: 'Poppins')), + new TextSpan( + text: isSameBranch + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context).otherBranch, + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], + ), + ), + ), ], ), - ), + Row( + children: [ + AppText( + /*patient.nationalityName ?? + patient.nationality*/ "Saudi", + fontWeight: FontWeight.bold, + fontSize: 12, + ), + /* patient.nationality != null + ? ClipRRect( + borderRadius: + BorderRadius + .circular( + 20.0), + child: Image.network( + patient + .nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace + stackTrace) { + return Text( + 'No Image'); + }, + ))*/ + /*:*/ SizedBox() + ], + ) + ], ), Container( child: RichText( @@ -405,7 +472,7 @@ class PatientReferralItemWidget extends StatelessWidget { ], ), Container( - width: double.infinity, + width: double.infinity, alignment: Alignment.centerRight, child: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black)) diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart new file mode 100644 index 00000000..5979b8e1 --- /dev/null +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -0,0 +1,351 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; + +class PatientProfileHeaderNewDesign extends StatelessWidget { + + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + + PatientProfileHeaderNewDesign(this.patient, this.patientType, this.arrivalType); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + height: 220, + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + AppText( + (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize( + patient.lastName)), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + patient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + patient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SERVICES_PATIANT2[ + int.parse(patientType)] == + "patientArrivalList" + ? Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + patient.patientStatusType == + 43 + ? AppText( + TranslationBase.of( + context) + .arrivedP, + color: Colors.green, + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of( + context) + .notArrived, + color: + Colors.red[800], + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ), + arrivalType == '1' + ? AppText( + patient.startTime != + null + ? patient + .startTime + : '', + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + : AppText( + DateUtils.convertStringToDateFormat( + patient + .arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + ], + )) + : SizedBox(), + if (SERVICES_PATIANT2[ + int.parse(patientType)] == + "List_MyOutPatient") + Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .appointmentDate + + " : ", + fontSize: 14, + ), + 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: 1.5 * + SizeConfig + .textMultiplier, + textAlign: TextAlign + .center, + fontWeight: + FontWeight.bold, + ), + ) + : SizedBox(), + SizedBox( + width: 3.5, + ), + Container( + child: AppText( + convertDateFormat2(patient + .appointmentDate + .toString()), + fontSize: 1.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold, + ), + ), + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only( + top: 8, + ), + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig + .textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of( + context) + .fileNumber, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: patient.patientId + .toString(), + style: TextStyle( + fontWeight: + FontWeight.w700, + fontFamily: + 'Poppins', + fontSize: 14)), + ], + ), + ), + Row( + children: [ + AppText( + patient.nationalityName ?? + patient.nationality, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + patient.nationality != null + ? ClipRRect( + borderRadius: + BorderRadius + .circular( + 20.0), + child: Image.network( + patient + .nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace + stackTrace) { + return Text( + 'No Image'); + }, + )) + : SizedBox() + ], + ) + ], + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .age + + " : ", + style: TextStyle( + fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", + style: TextStyle( + fontWeight: + FontWeight.w700, + fontSize: 14)), + ], + ), + ), + ), + ], + ), + ), + ]), + ], + ), + ), + ); + } + + convertDateFormat2(String str) { + String timeConvert; + const start = "/Date("; + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } + + isToday(date) { + DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); + return DateFormat("yyyy-MM-dd").format(tempDate) == + DateFormat("yyyy-MM-dd").format(DateTime.now()); + } + + myBoxDecoration() { + return BoxDecoration( + border: Border( + top: BorderSide( + color: Colors.green, + width: 5, + ), + ), + borderRadius: BorderRadius.circular(10)); + } +} From c97b395810377d3f161d65a2408ac4088bb10547 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 29 Mar 2021 10:05:39 +0300 Subject: [PATCH 11/15] send patient type to patient profile cards --- .../profile/patient_profile_screen.dart | 5 +- .../profile/PatientProfileButton.dart | 62 ++++++++++++------- .../profile/profile_medical_info_widget.dart | 46 ++++++++++++-- .../profile_medical_info_widget_search.dart | 28 ++++++++- 4 files changed, 110 insertions(+), 31 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 68519d73..85c93e2f 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -62,7 +62,8 @@ class PatientProfileScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileHeaderNewDesign(patient, patientType, arrivalType), + PatientProfileHeaderNewDesign( + patient, patientType, arrivalType), Expanded( child: Padding( padding: const EdgeInsets.all(16.0), @@ -73,12 +74,14 @@ class PatientProfileScreen extends StatelessWidget { ? ProfileMedicalInfoWidgetSearch( patient: patient, patientType: patientType, + arrivalType: arrivalType, from: from, to: to, ) : ProfileMedicalInfoWidget( patient: patient, patientType: patientType, + arrivalType: arrivalType, from: from, to: to, ), diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index ad0a7bd7..1622df90 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -11,6 +11,8 @@ class PatientProfileButton extends StatelessWidget { final String icon; final dynamic route; final PatiantInformtion patient; + final String patientType; + final String arrivalType; String from; String to; final String url = "assets/images/"; @@ -20,16 +22,18 @@ class PatientProfileButton extends StatelessWidget { PatientProfileButton( {Key key, - this.patient, - this.nameLine1, - this.nameLine2, - this.icon, - this.route, - this.isDisable = false, - this.onTap, - this.isLoading = false, - this.from, - this.to}) + this.patient, + this.patientType, + this.arrivalType, + this.nameLine1, + this.nameLine2, + this.icon, + this.route, + this.isDisable = false, + this.onTap, + this.isLoading = false, + this.from, + this.to}) : super(key: key); @override @@ -41,19 +45,23 @@ class PatientProfileButton extends StatelessWidget { onTap: isDisable ? null : onTap != null - ? onTap - : () { - navigator(context, this.route); - }, + ? onTap + : () { + navigator(context, this.route); + }, child: Column(children: [ Container( child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - child: new Image.asset(url + icon, width: 50, height: 50,)) - ], - )), + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: new Image.asset( + url + icon, + width: 50, + height: 50, + )) + ], + )), Container( alignment: Alignment.topLeft, padding: EdgeInsets.all(5), @@ -62,7 +70,8 @@ class PatientProfileButton extends StatelessWidget { children: [ AppText( this.nameLine1, - color: Colors.black, /*Color(0xFFB9382C),*/ + color: Colors.black, + /*Color(0xFFB9382C),*/ fontWeight: FontWeight.w600, textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 1.5, @@ -107,7 +116,12 @@ class PatientProfileButton extends StatelessWidget { if (to == null) { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - Navigator.of(context).pushNamed(route, - arguments: {'patient': patient, 'from': from, 'to': to}); + Navigator.of(context).pushNamed(route, arguments: { + 'patient': patient, + 'from': from, + 'to': to, + 'patient-type': patientType, + 'arrival-type': arrivalType + }); } -} \ No newline at end of file +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index d5a87f60..ade70b47 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -17,13 +17,19 @@ import '../../../config/size_config.dart'; import '../../shared/app_texts_widget.dart'; class ProfileMedicalInfoWidget extends StatelessWidget { - String from; - String to; - PatiantInformtion patient; - String patientType; + final String from; + final String to; + final PatiantInformtion patient; + final String patientType; + final String arrivalType; ProfileMedicalInfoWidget( - {Key key, this.patient, this.patientType, this.from, this.to}); + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.from, + this.to}); @override Widget build(BuildContext context) { @@ -69,6 +75,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, from: from, to: to, nameLine1: TranslationBase.of(context).vital, @@ -79,6 +87,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: LAB_RESULT, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, @@ -86,6 +96,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: MEDICAL_FILE, nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, @@ -96,6 +108,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PROGRESS_NOTE, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, @@ -104,6 +118,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, @@ -112,6 +128,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { ? PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ORDER_PRESCRIPTION, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, @@ -119,6 +137,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { : PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ORDER_PRESCRIPTION_HISTORY, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, @@ -126,6 +146,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, @@ -134,6 +156,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ORDER_PROCEDURE, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, @@ -142,6 +166,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: REFER_PATIENT_TO_DOCTOR, nameLine1: TranslationBase.of(context).myReferral, nameLine2: TranslationBase.of(context).patient, @@ -150,6 +176,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ADD_SICKLEAVE, nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, @@ -158,6 +186,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PATIENT_UCAF_REQUEST, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).ucaf, @@ -166,6 +196,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, @@ -174,6 +206,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, @@ -181,6 +215,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PATIENT_ECG, nameLine1: TranslationBase.of(context).patient, nameLine2: "ECG", diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index 704ced0d..c49c4576 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -12,9 +12,15 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { final String to; final PatiantInformtion patient; final String patientType; + final String arrivalType; ProfileMedicalInfoWidgetSearch( - {Key key, this.patient, this.patientType, this.from, this.to}); + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.from, + this.to}); @override Widget build(BuildContext context) { @@ -31,6 +37,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, @@ -38,6 +46,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, @@ -45,6 +55,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: LAB_RESULT, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, @@ -52,6 +64,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, from: from, to: to, nameLine1: TranslationBase.of(context).vital, @@ -69,6 +83,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { ? PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, @@ -76,6 +92,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { : PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, @@ -83,6 +101,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: MEDICAL_FILE, nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, @@ -90,6 +110,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PATIENT_ECG, nameLine1: TranslationBase.of(context).patient, nameLine2: "ECG", @@ -97,6 +119,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: SHOW_SICKLEAVE, nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, @@ -104,6 +128,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PROGRESS_NOTE, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, From ebb130af09af5ec419a4f938442d8f378eb8ac8a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 29 Mar 2021 10:42:46 +0300 Subject: [PATCH 12/15] Medical Report New Design --- .../medical-file/medical_file_details.dart | 251 ++++++++++-------- .../medical-file/medical_file_page.dart | 116 +++----- 2 files changed, 173 insertions(+), 194 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 64e4405b..63006f65 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -140,134 +140,155 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).visitDate + - ": ", - fontWeight: FontWeight.w700, + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .appointmentDate - .toString()), - SizedBox(width: 35.0), - // AppText( - // 'Appt Date : ', - // fontWeight: FontWeight.w700, - // ), - // AppText( - // '23/12/2020', - // ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).doctorName + - ": ".toUpperCase(), - fontWeight: FontWeight.w700, - ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - Expanded( - child: AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .doctorName - .toUpperCase(), - fontWeight: FontWeight.w700, - ), - ), - ], - ), - if (model.medicalFileList.length != 0) - Row( + border: Border.all( + color: Colors.grey[200], width: 0.5), + ), + child: Column( children: [ - AppText( - TranslationBase.of(context) - .clinicName + - ": ", - fontWeight: FontWeight.w700, + Row( + children: [ + if (model.medicalFileList.length != + 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .doctorName + .toUpperCase(), + fontWeight: FontWeight.w700, + ), + ), + ], ), - if (model.medicalFileList.length != 0 && - model + if (model.medicalFileList.length != 0) + Row( + children: [ + AppText( + TranslationBase.of(context) + .clinic + + ": ", + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList + .length != + 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .clinicName, + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .episode + + ": ", + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList.length != + 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + AppText( + model .medicalFileList[0] .entityList[0] .timelines[encounterNumber] .timeLineEvents[0] - .consulations - .length != - 0) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .clinicName, - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).episode + - ": ", - fontWeight: FontWeight.w700, - ), - if (model.medicalFileList.length != 0 && - model + .consulations[0] + .episodeID + .toString(), + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .visitDate + + ": ", + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList.length != + 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + AppText(model .medicalFileList[0] .entityList[0] .timelines[encounterNumber] .timeLineEvents[0] - .consulations - .length != - 0) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .episodeID - .toString(), + .consulations[0] + .appointmentDate + .toString()), + SizedBox(width: 35.0), + // AppText( + // 'Appt Date : ', + // fontWeight: FontWeight.w700, + // ), + // AppText( + // '23/12/2020', + // ), + ], ), - ], - ), - SizedBox(height: 15.0), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey.shade400, + ], + ), ), + SizedBox(height: 25.0), if (model.medicalFileList.length != 0 && model diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index b0901e0a..ae50e9a2 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -103,27 +103,31 @@ class _MedicalFilePageState extends State { padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), child: Container( - child: Column( - children: [ - Row( - children: [ - AppText( - 'Medical', - fontSize: 15.0, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - 'Report', - fontSize: 35.0, - fontWeight: FontWeight.w700, - ), - ], - ), - ], + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + 'Medical', + fontSize: 13.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + 'Report', + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), ), ), ), @@ -223,7 +227,7 @@ class _MedicalFilePageState extends State { BorderRadius.all( Radius.circular(30)), child: Image.network( - 'https://media.istockphoto.com/photos/portrait-senior-asian-doctor-over-radiography-background-asian-picture-id1019862020?k=6&m=1019862020&s=612x612&w=0&h=40frRnNnEGhNv5XRcDMRn55bIxCC3oXzbO6pOSQL_sQ=', + 'https://previews.123rf.com/images/yupiramos/yupiramos1705/yupiramos170524444/78443570-a-female-doctor-avatar-character-vector-illustration-design.jpg', fit: BoxFit.cover, width: 60, height: 70, @@ -291,59 +295,6 @@ class _MedicalFilePageState extends State { ) ], ), - // Row( - // children: [ - // Expanded( - // child: AppText( - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[index] - // .doctorName, - // fontWeight: FontWeight.w700, - // fontSize: 18.0, - // fontFamily: 'Poppins', - // ), - // ), - // ], - // ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).branch + - // ": ", - // fontWeight: FontWeight.w700, - // ), - // AppText(model - // .medicalFileList[0] - // .entityList[0] - // .timelines[index] - // .projectName), - // ], - // ), - // Row( - // children: [ - // AppText( - // TranslationBase.of(context) - // .clinicName + - // ": ", - // fontWeight: FontWeight.w700, - // ), - // AppText( - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[index] - // .clinicName, - // ), - // ], - // ), - // SizedBox(height: 10.0), - // Divider( - // height: 1.0, - // thickness: 1.0, - // color: Colors.grey.shade400, - // ) ], ), ), @@ -365,10 +316,17 @@ class _MedicalFilePageState extends State { ), ); }) - : Container( - child: AppText( - 'THERES NO MEDICAL FILE FOR THIS Patient', - ), + : Column( + children: [ + Container( + child: AppText( + 'THERES NO MEDICAL FILE FOR THIS Patient', + ), + ), + SizedBox( + height: 400, + ) + ], ) ], ), From 8237270e7345324fb2732be01b3d3db04ed2711e Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 29 Mar 2021 11:40:22 +0300 Subject: [PATCH 13/15] fix navigation problem to patient profile cards --- lib/config/config.dart | 4 ++-- .../profile/vital_sign/vital_sign_details_screen.dart | 2 ++ lib/widgets/patients/profile/PatientProfileButton.dart | 9 ++++++--- .../patients/profile/profile_medical_info_widget.dart | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0f615af5..3a72faba 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 45cd8d14..2b4877e8 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -24,6 +24,8 @@ class VitalSignDetailsScreen extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; String from = routeArgs['from']; String to = routeArgs['to']; String imageBasePath = 'assets/images/'; diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 1622df90..ebac98b5 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -12,7 +12,7 @@ class PatientProfileButton extends StatelessWidget { final dynamic route; final PatiantInformtion patient; final String patientType; - final String arrivalType; + String arrivalType; String from; String to; final String url = "assets/images/"; @@ -116,12 +116,15 @@ class PatientProfileButton extends StatelessWidget { if (to == null) { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } + if(arrivalType == null){ + arrivalType = "0"; + } Navigator.of(context).pushNamed(route, arguments: { 'patient': patient, 'from': from, 'to': to, - 'patient-type': patientType, - 'arrival-type': arrivalType + 'patientType': patientType, + 'arrivalType': arrivalType }); } } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index ade70b47..b5afa0af 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -120,7 +120,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, + route: PATIENT_ADMISSION_REQUEST, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'patient/admission_req.png'), From 79fe067fe201958a18ec778ce22885ddf172f3ec Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 29 Mar 2021 14:29:27 +0300 Subject: [PATCH 14/15] Medical Report New Design --- .../medical-file/medical_file_details.dart | 104 ++++++------------ .../medical-file/medical_file_page.dart | 58 +--------- 2 files changed, 39 insertions(+), 123 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 63006f65..77fddfe5 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -20,6 +21,7 @@ class MedicalFileDetails extends StatefulWidget { String gender; int encounterNumber; int pp; + PatiantInformtion patient; MedicalFileDetails( {this.age, @@ -27,16 +29,19 @@ class MedicalFileDetails extends StatefulWidget { this.lastName, this.gender, this.encounterNumber, - this.pp}); + this.pp, + this.patient}); @override _MedicalFileDetailsState createState() => _MedicalFileDetailsState( - firstName: firstName, - age: age, - lastName: lastName, - gender: gender, - encounterNumber: encounterNumber, - pp: pp); + firstName: firstName, + age: age, + lastName: lastName, + gender: gender, + encounterNumber: encounterNumber, + pp: pp, + patient: patient, + ); } class _MedicalFileDetailsState extends State { @@ -46,6 +51,7 @@ class _MedicalFileDetailsState extends State { String lastName; String gender; int pp; + PatiantInformtion patient; _MedicalFileDetailsState( {this.age, @@ -53,7 +59,8 @@ class _MedicalFileDetailsState extends State { this.lastName, this.gender, this.encounterNumber, - this.pp}); + this.pp, + this.patient}); bool isPhysicalExam = false; bool isProcedureExpand = false; bool isHistoryExpand = false; @@ -75,57 +82,8 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - AvatarWidget( - Icon( - gender == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - firstName + ' ' + lastName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).age2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 5.0, - ), - AppText( - age, - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ) - ], - ), - ), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), + PatientProfileHeaderNewDesign(patient, + patient.patientType.toString(), patient.arrivedOn), model.medicalFileList.length != 0 && model .medicalFileList[0] @@ -191,7 +149,6 @@ class _MedicalFileDetailsState extends State { TranslationBase.of(context) .clinic + ": ", - fontWeight: FontWeight.w700, ), if (model.medicalFileList .length != @@ -214,6 +171,7 @@ class _MedicalFileDetailsState extends State { .timeLineEvents[0] .consulations[0] .clinicName, + fontWeight: FontWeight.w700, ), ], ), @@ -245,6 +203,7 @@ class _MedicalFileDetailsState extends State { .consulations[0] .episodeID .toString(), + fontWeight: FontWeight.w700, ), ], ), @@ -267,14 +226,17 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .appointmentDate - .toString()), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .appointmentDate + .toString(), + fontWeight: FontWeight.w700, + ), SizedBox(width: 35.0), // AppText( // 'Appt Date : ', @@ -349,7 +311,8 @@ class _MedicalFileDetailsState extends State { ], ), bodyWidget: ListView.builder( - //physics: , + physics: + NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model @@ -471,7 +434,8 @@ class _MedicalFileDetailsState extends State { ], ), bodyWidget: ListView.builder( - //physics: , + physics: + NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index ae50e9a2..5f53c2b9 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; @@ -30,7 +31,6 @@ class _MedicalFilePageState extends State { String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - patient = routeArgs['patient']; return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), builder: @@ -48,57 +48,8 @@ class _MedicalFilePageState extends State { // ? MainAxisAlignment.start // : MainAxisAlignment.center, children: [ - Container( - padding: EdgeInsets.only(left: 12.0), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ), - AppText( - (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize(patient.lastName)), - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', - ), - patient.gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - ]), - ), - Row(children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - patient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), - ), - SizedBox( - width: 10, - ), - ]), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), + PatientProfileHeaderNewDesign( + patient, patient.patientType.toString(), arrivalType), Padding( padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), @@ -111,7 +62,7 @@ class _MedicalFilePageState extends State { children: [ AppText( 'Medical', - fontSize: 13.0, + fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', ), @@ -310,6 +261,7 @@ class _MedicalFilePageState extends State { gender: patient.genderDescription, encounterNumber: index, pp: patient.patientId, + patient: patient, )), ); }, From 8beab7d84f5411221ef76d3c32a4b97e3a186231 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 29 Mar 2021 15:23:30 +0300 Subject: [PATCH 15/15] finish drawer --- lib/widgets/doctor/my_schedule_widget.dart | 1 + lib/widgets/shared/app_drawer_widget.dart | 246 ++++++++++----------- lib/widgets/shared/drawer_item_widget.dart | 24 +- 3 files changed, 137 insertions(+), 134 deletions(-) diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 25e794cf..c28cc8d3 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -23,6 +23,7 @@ class MyScheduleWidget extends StatelessWidget { children: [ Column( mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 10, diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 84144f49..100e8c1d 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -31,14 +31,6 @@ class _AppDrawerState extends State { Helpers helpers = new Helpers(); ProjectViewModel projectsProvider; - // @override - // void didChangeDependencies() { - // super.didChangeDependencies(); - // // if (_isInit) { - // getDocProfile(); // TODO: Refactor this code to prevent errors in the cosole. - // // } - // _isInit = false; - // } @override Widget build(BuildContext context) { @@ -47,127 +39,112 @@ class _AppDrawerState extends State { return RoundedContainer( child: Container( color: Colors.white, - // margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2), child: Drawer( child: Column(children: [ Expanded( flex: 4, child: ListView(padding: EdgeInsets.zero, children: [ Container( + margin: EdgeInsets.symmetric(horizontal: 20), height: SizeConfig.heightMultiplier * 50, - child: InkWell( - child: DrawerHeader( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - child: Image.asset( - 'assets/images/logo.png', - ), - margin: EdgeInsets.only(top: 10, bottom: 15), - ), - SizedBox( - height: 1, - child: Container( - color: Colors.black26, - ), - ), - SizedBox(height: 15), - InkWell( - onTap: () { - Navigator.of(context) - .pushNamed(PROFILE, arguments: { - 'title': authProvider.doctorProfile.doctorName, - "doctorProfileall": authProvider.doctorProfile - }); - }, - child: Column( - children: [ - authProvider.doctorProfile != null - ? CircleAvatar( - radius: - SizeConfig.imageSizeMultiplier * 12, - // radius: (52) - child: ClipRRect( - borderRadius: BorderRadius.circular(50), - child: Image.network( - authProvider - .doctorProfile.doctorImageURL, - fit: BoxFit.fill, - width: 700, - ), - ), - backgroundColor: Colors.transparent, - ) - : SizedBox(), - authProvider.doctorProfile != null - ? Padding( - padding: EdgeInsets.only(top: 10), - child: AppText( - TranslationBase.of(context).dr + - authProvider - .doctorProfile?.doctorName, - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: SizeConfig.textMultiplier * 2, - )) - : SizedBox(), - ], - ), - ), - RaisedButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(18.0), - side: BorderSide(color: Colors.red)), - child: AppText( - TranslationBase.of(context).logout, - color: Colors.white, - ), - onPressed: () async { - Navigator.pop(context); - await helpers.logout(); - projectsProvider.isLogin = false; - }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Image.asset( + 'assets/images/dr_app_logo.png', + ), + margin: EdgeInsets.only(top: 10, bottom: 15), + ), + SizedBox(height: 15), + if (authProvider.doctorProfile != null) + InkWell( + onTap: () { + Navigator.of(context).pushNamed(PROFILE, arguments: { + 'title': authProvider.doctorProfile.doctorName, + "doctorProfileall": authProvider.doctorProfile + }); + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(top: 10), + child: AppText( + TranslationBase.of(context).dr + + authProvider.doctorProfile?.doctorName, + fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ), + Padding( + padding: EdgeInsets.only(top: 5), + child: AppText( + authProvider.doctorProfile?.clinicDescription, + fontWeight: FontWeight.w600, + color: Color(0xFF2E303A), + fontSize: SizeConfig.textMultiplier * 2, + fontFamily: 'Poppins', + )) + ], ), - ], + ), + SizedBox(height: 15), + InkWell( + child: DrawerItem( + TranslationBase.of(context).rescheduleLeaves, + // " or " + + // TranslationBase.of(context).leaves, + + DoctorApp.leaves, + // subTitle: , + ), + onTap: () { + Navigator.pop(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddRescheduleLeavScreen(), + // MyReferredPatient(), + )); + }, ), - ), + ], ), ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).settings, Icons.settings), - onTap: () { - Navigator.pop(context); - Navigator.of(context).pushNamed(SETTINGS); - }, + SizedBox( + height: 40, ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).reschedule, - DoctorApp.leaves, - subTitle: TranslationBase.of(context).leaves, + Container( + margin: EdgeInsets.symmetric(horizontal: 20), + child: Column( + children: [ + InkWell( + child: DrawerItem( + TranslationBase.of(context).logout, Icons.settings), + onTap: () async { + Navigator.pop(context); + await helpers.logout(); + projectsProvider.isLogin = false; + }, + ), + InkWell( + child: DrawerItem( + projectsProvider.isArabic + ? TranslationBase.of(context).lanEnglish + : TranslationBase.of(context).lanArabic, + DoctorApp.qr_code), + onTap: () { + if (projectsProvider.isArabic) + projectsProvider.changeLanguage('en'); + else + projectsProvider.changeLanguage('ar'); + }, + ), + ], ), - onTap: () { - Navigator.pop(context); - - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AddRescheduleLeavScreen(), - // MyReferredPatient(), - )); - }, - ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).qr + - TranslationBase.of(context).reader, - DoctorApp.qr_code), - onTap: () { - Navigator.pop(context); - Navigator.of(context).pushNamed(QR_READER); - }, ), ]), ), @@ -179,14 +156,35 @@ class _AppDrawerState extends State { child: Align( alignment: FractionalOffset.bottomCenter, child: Container( - child: Column( - children: [ - Text("Powered by"), - Image.asset( - 'assets/images/cs_logo_container.png', - width: SizeConfig.imageSizeMultiplier * 30, - ) - ], + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: MediaQuery.of(context).size.width *0.3, + child: RichText( + text: TextSpan( + text: 'Powered by', + style: TextStyle( + color: Color(0xFF989898), + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2, + fontFamily: 'Poppins',), + children: [ + TextSpan(text: ' Cloud Solutions', + style: TextStyle( + color: Color(0xFF2E303A), + fontSize: SizeConfig.textMultiplier * 2, + fontFamily: 'Poppins',), + ) + ] + ),), + ), + // Text("Powered by"), + Image.asset( + 'assets/images/cs_logo_container.png', + width: SizeConfig.imageSizeMultiplier * 20, + ) + ], )))) ])) ])), diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 83afb860..84691f7f 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -26,7 +26,7 @@ class _DrawerItemState extends State { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10), + margin: EdgeInsets.only(top: 5, bottom: 5, left: 0, right: 0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -39,15 +39,19 @@ class _DrawerItemState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - widget.title, - color: widget.color ?? Colors.black, - textOverflow: TextOverflow.ellipsis, - // fontWeight: FontWeight.bold, - // margin: 5, - marginLeft: 5, - marginRight: 5, - fontSize: SizeConfig.textMultiplier * 2.3, + Container( + width: MediaQuery.of(context).size.width *0.45, + child: Expanded( + child: AppText( + widget.title, + marginLeft: 5, + marginRight: 5, + color:widget.color ??Color(0xFF2E303A), + fontSize: SizeConfig.textMultiplier * 2.0, + fontFamily: 'Poppins', + fontWeight: FontWeight.bold, + ), + ), ), AppText( widget.subTitle,