diff --git a/lib/config/config.dart b/lib/config/config.dart index f402bea2..ba33110c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -244,6 +244,7 @@ const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 240f235f..980a2e9b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -824,5 +824,8 @@ const Map> localizedValues = { "accepted": {"en": "Accepted", "ar": "وافقت"}, "cancelled": {"en": "Cancelled", "ar": "ألغيت"}, "unReplied": {"en": "UnReplied", "ar": "لم يتم الرد"}, - "replied": {"en": "Replied", "ar": " تم الرد"}, + "replied": {"en": "Replied", "ar": " تم الرد"},"typeHereToReply": { + "en": "Type here to reply", + "ar": "اكتب هنا للرد" + }, }; diff --git a/lib/core/model/insurance_approval.dart b/lib/core/model/insurance_approval.dart index 894fad46..9eef97bb 100644 --- a/lib/core/model/insurance_approval.dart +++ b/lib/core/model/insurance_approval.dart @@ -43,6 +43,7 @@ class InsuranceApprovalModel { int approvalNo; String approvalStatusDescption; int unUsedCount; + String doctorImage; //String companyName; String expiryDate; @@ -75,7 +76,8 @@ class InsuranceApprovalModel { this.expiryDate, this.rceiptOn, this.approvalDetails, - this.appointmentNo}); + this.appointmentNo, + this.doctorImage}); InsuranceApprovalDetails x = InsuranceApprovalDetails(); @@ -104,6 +106,7 @@ class InsuranceApprovalModel { eXuldAPPNO = json['EXuldAPPNO']; projectID = json['ProjectID']; doctorName = json['DoctorName']; + doctorImage = json['DoctorImageURL']; clinicName = json['ClinicName']; approvalDetails = InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]); @@ -126,6 +129,8 @@ class InsuranceApprovalModel { data['DeviceTypeID'] = this.deviceTypeID; data['PatientID'] = this.patientID; data['TokenID'] = this.tokenID; + data['DoctorImageURL'] = this.doctorImage; + data['PatientTypeID'] = this.patientTypeID; data['PatientType'] = this.patientType; if (appointmentNo == null) { diff --git a/lib/core/service/doctor_reply_service.dart b/lib/core/service/doctor_reply_service.dart index 5025037d..44fb2287 100644 --- a/lib/core/service/doctor_reply_service.dart +++ b/lib/core/service/doctor_reply_service.dart @@ -2,7 +2,10 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/hospitals_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart'; import 'package:doctor_app_flutter/models/doctor/request_doctor_reply.dart'; +import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; +import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; class DoctorReplyService extends BaseService { @@ -11,7 +14,11 @@ class DoctorReplyService extends BaseService { RequestDoctorReply _requestDoctorReply = RequestDoctorReply(); + List _listMyReferralPatientModel = []; + List get listMyReferralPatientModel => _listMyReferralPatientModel; + Future getDoctorReply() async { + hasError = false; await baseAppClient.post(GT_MY_PATIENT_QUESTION, onSuccess: (dynamic response, int statusCode) { _listDoctorWorkingHoursTable.clear(); @@ -24,4 +31,32 @@ class DoctorReplyService extends BaseService { super.error = error; }, body: _requestDoctorReply.toJson(),); } + + Future replay( + String referredDoctorRemarks, MyReferralPatientModel model) async { + RequestMyReferralPatientModel _requestMyReferralPatient = + RequestMyReferralPatientModel(); + RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = + RequestAddReferredDoctorRemarks(); + + _requestAddReferredDoctorRemarks.admissionNo = model.admissionNo; + _requestAddReferredDoctorRemarks.patientID = model.patientID; + _requestAddReferredDoctorRemarks.referredDoctorRemarks = + referredDoctorRemarks; + _requestAddReferredDoctorRemarks.lineItemNo = model.lineItemNo; + _requestAddReferredDoctorRemarks.referringDoctor = model.referringDoctor; + await baseAppClient.post( + ADD_REFERRED_DOCTOR_REMARKS, + body: _requestAddReferredDoctorRemarks.toJson(), + onSuccess: (dynamic body, int statusCode) { + model.referredDoctorRemarks = referredDoctorRemarks; + listMyReferralPatientModel[listMyReferralPatientModel.indexOf(model)] = + model; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + ); + } } diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 29d3b125..f010bf60 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/doctor_reply_service.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -19,4 +20,14 @@ class DoctorReplayViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future replay(String referredDoctorRemarks, MyReferralPatientModel model) async { + setState(ViewState.BusyLocal); + await _doctorReplyService.replay(referredDoctorRemarks, model); + if (_doctorReplyService.hasError) { + error = _doctorReplyService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index c1fd1aa1..8714aaf8 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -196,14 +196,14 @@ class _DashboardScreenState extends State { return Row( mainAxisSize: MainAxisSize.max, children: [ - AppText( - item.clinicName, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors.black, - fontWeight: FontWeight.bold, - ), + AppText(item.clinicName, + fontSize: SizeConfig + .textMultiplier * + 1.6, + color: Colors.black, + fontWeight: FontWeight.bold, + textAlign: + TextAlign.center), ], ); }).toList(); @@ -1004,7 +1004,7 @@ class _DashboardScreenState extends State { top: 10, left: 10, right: 0), child: Icon( DoctorApp.search, - size: 35, + size: 32, color: Colors.white, )), Container( @@ -1014,6 +1014,7 @@ class _DashboardScreenState extends State { .searchmedicinepatient, color: Colors.white, textAlign: TextAlign.start, + fontSize: 14, )) ], ), diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart new file mode 100644 index 00000000..35718793 --- /dev/null +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -0,0 +1,330 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.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/card_with_bg_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class DoctorReplayChat extends StatelessWidget { + + final ListGtMyPatientsQuestions reply; + TextEditingController msgController = TextEditingController(); + + DoctorReplayChat( + {Key key, this.reply, + }); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Container( + color: Color(0XFFF2F2F2), + child: Stack( + children: [ + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + height: 150, + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: reply.patientName + .toString(), + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 20)), + ], + ), + ), + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Icon(FontAwesomeIcons.times, + size: 30, + color: Color(0xFF2B353E))) + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + InkWell( + onTap: () { + // TODO: move to doctor profile + }, + child: RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + 'Tap here to view patient profile' + .toString(), + style: TextStyle( + fontFamily: 'Poppins', + fontSize: 12)), + ], + ), + ), + ), + ], + ), + ], + ), + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + SizedBox(height: 30,), + Container( + // color: Color(0xFF2B353E), + width: MediaQuery.of(context).size.width * 0.8, + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Color(0xFF2B353E), + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070') , + width: 0.30), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 5), + width: 60, + height: 60, + child: Image.asset( + 1 == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + Column( + children: [ + AppText( + "07 Jan 2021", + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + color: Colors.white, + // fontSize: 18 + ), + AppText( + "07:00 PM", + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + color: Colors.white, + // fontSize: 18 + ), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: MediaQuery.of(context).size.width * 0.7, + child: AppText( + "This procedure should be taken only when the patient is below 99o", + fontSize: 15, + fontFamily: 'Poppins', + color: Colors.white, + // fontSize: 18 + ), + ), + ), + ], + ), + ], + ), + ], + ), + ), + SizedBox(height: 30,), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + // color: Color(0xFF2B353E), + width: MediaQuery.of(context).size.width * 0.8, + padding: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.white,// Color(0xFF2B353E), + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: HexColor('#707070') , + width: 0.30), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 5), + width: 60, + height: 60, + child: Image.asset( + 1 == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + Column( + children: [ + AppText( + "07 Jan 2021", + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + // fontSize: 18 + ), + AppText( + "07:00 PM", + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + // fontSize: 18 + ), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + width: MediaQuery.of(context).size.width * 0.7, + child: AppText( + "This procedure should be taken only when the patient is below 99o", + fontSize: 15, + fontFamily: 'Poppins', + color: Color(0xFF2B353E), + // fontSize: 18 + ), + ), + ), + ], + ), + ], + ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ) + ], + ), + ), + ], + ), + ), + bottomSheet: Container( + child:TextFields( + hasLabelText: msgController.text != '' + ? true + : false, + showLabelText: false, + hintText: TranslationBase + .of(context) + .typeHereToReply, + fontSize: 13.5, + suffixIcon: FontAwesomeIcons.arrowRight, + suffixIconColor: Colors.green, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 50, + minLines: 3, + controller: msgController, + validator: (value) { + if (value == null || value == "") + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + height: MediaQuery.of(context).size.height * 0.1, + ), + )); + } +} diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index b57bd1a2..62d46d5e 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_repaly_chat.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/doctor/doctor_reply_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -18,7 +19,9 @@ class DoctorReplyScreen extends StatelessWidget { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getDoctorReply(), + onModelReady: (model) { + model.getDoctorReply(); + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).replay2, @@ -35,7 +38,15 @@ class DoctorReplyScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: model.listDoctorWorkingHoursTable.map((reply) { - return DoctorReplyWidget(reply: reply); + return InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + DoctorReplayChat(reply: reply))); + }, + child: DoctorReplyWidget(reply: reply)); }).toList(), ) ], diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 95f55e27..0eb3da80 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -1,13 +1,21 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/insurance_approvals_details.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/patients/profile/large_avatar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.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'; +import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/shared/doctor_card_insurance.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import '../base/base_view.dart'; @@ -17,393 +25,635 @@ class InsuranceApprovalScreenNew extends StatefulWidget { InsuranceApprovalScreenNew({this.appointmentNo}); @override - _InsuranceApprovalScreenNewState createState() => _InsuranceApprovalScreenNewState(); + _InsuranceApprovalScreenNewState createState() => + _InsuranceApprovalScreenNewState(); } -class _InsuranceApprovalScreenNewState extends State { - +class _InsuranceApprovalScreenNewState + extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; return BaseView( - onModelReady: widget.appointmentNo != null - ? (model) => - model.getInsuranceApproval(patient,appointmentNo: widget.appointmentNo) + onModelReady: patient.appointmentNo != null + ? (model) => model.getInsuranceApproval(patient, + appointmentNo: patient.appointmentNo) : (model) => model.getInsuranceApproval(patient), builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType.toString() ?? "0", patientType), isShowAppBar: true, baseViewModel: model, appBarTitle: TranslationBase.of(context).approvals, - body: SingleChildScrollView( child: Container( - margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04, - ), - child: Column( - children: [ - Container( - width: double.infinity, - height: SizeConfig.screenHeight * 0.09, - color: Color(0xffEEEEEE), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: model.insuranceApproval.length != 0 + ? Column( children: [ - Texts( - TranslationBase.of(context).totalApproval, - color: Color(0xff60688B), - fontSize: 19.0, - fontWeight: FontWeight.w600, - ), - if (model.insuranceApproval.length > 0) - Container( - width: 60, - height: 40, - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.circular(19.0)), - child: Center( - child: Texts( - model.insuranceApproval[0].unUsedCount - .toString(), - color: Colors.white, fontSize: 17.0, - ), - )) - ], - )), - ...List.generate( - model.insuranceApproval.length, - (index) => RoundedContainer( - backgroundColor: Colors.white, + // Container( + // width: double.infinity, + // height: SizeConfig.screenHeight * 0.09, + // color: Color(0xffEEEEEE), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Texts( + // TranslationBase.of(context).totalApproval, + // color: Color(0xff60688B), + // fontSize: 19.0, + // fontWeight: FontWeight.w600, + // ), + // if (model.insuranceApproval.length > 0) + // Container( + // width: 60, + // height: 40, + // decoration: BoxDecoration( + // color: Theme.of(context).primaryColor, + // borderRadius: BorderRadius.circular(19.0)), + // child: Center( + // child: Texts( + // model.insuranceApproval[0].unUsedCount + // .toString(), + // color: Colors.white, + // fontSize: 17.0, + // ), + // )) + // ], + // )), + Padding( + padding: const EdgeInsets.all(8.0), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ExpansionTile( - title: Container( - //height: 120.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - model.insuranceApproval[index].patientDescription == "In Patient" - ? Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: - BorderRadius.circular( - 16.0)), - width: 115.0, - padding: - EdgeInsets.only(left: 11.5), - child: Center( - child: Texts( - TranslationBase.of(context).inPatient, - color: Colors.white, - ), - ), - ) - : Container( - decoration: BoxDecoration( - color: Color(0xff505A5D), - borderRadius: - BorderRadius.circular( - 16.0)), - width: 115.0, - padding: - EdgeInsets.only(left: 11.5), - child: Center( - child: Texts( - TranslationBase.of(context).outpatient, - color: Colors.white, - ), - ), - ), - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0), - child: Texts( - model.insuranceApproval[index] - .clinicName, - fontSize: 20.0, - color: Color(0xff60686B), - fontWeight: FontWeight.w600, - ), - ), - Texts( - model.insuranceApproval[index] - .doctorName, - fontSize: 17.0, - ), - ], + children: [ + Row( + children: [ + AppText( + 'Insurance', + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', ), - ), - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 12.0, horizontal: 12.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - Texts( - TranslationBase.of(context).approvalNo, - fontSize: 18.0, - ), - Texts(model.insuranceApproval[index].approvalNo.toString(), - fontSize: 18.0, - fontWeight: FontWeight.w600,), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Row( - children: [ - Texts( - TranslationBase.of(context).procedureStatus , - fontSize: 17.5, - ), - SizedBox(width: 12,), - Expanded( - child: Texts( - model.insuranceApproval[index].approvalStatusDescption, - fontWeight: FontWeight.w600, - fontSize: 17.5, - ), - ), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Row( - children: [ - Texts( - TranslationBase.of(context).unusedCount, - fontSize: 17.5, - ), - Texts( - model.insuranceApproval[index].unUsedCount.toString(), - fontSize: 17.5, - fontWeight: FontWeight.w600, - ), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), -// Text( -// 'Company Name: ' + -// model.insuranceApproval[index] -// .companyName == -// null -// ? '000' -// : model -// .insuranceApproval[index].companyName, -// style: TextStyle( -// fontSize: 17.5, -// fontWeight: FontWeight.w600), -// ), - Texts( - TranslationBase.of(context).companyName, - fontWeight: FontWeight.w600, - fontSize: 17.5, - ), - - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Row( - children: [ - Texts( - TranslationBase.of(context).receiptOn , - fontSize: 17.5, - fontWeight: FontWeight.w600, - - ), - Texts( - DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[index].rceiptOn).toString(), - fontSize: 17.5, - fontWeight: FontWeight.w600, - - ), - ], - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - Row( - children: [ - Texts( - TranslationBase.of(context).expiryDate, - fontSize: 17.5, - fontWeight: FontWeight.w600, - - ), - Texts( - DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[index].expiryDate).toString(), - fontSize: 17.5, - fontWeight: FontWeight.w600, - - ), - ], - ), - Divider( - color: Colors.black, - height: 55.0, - thickness: 1.2, - ), - IntrinsicHeight( - child: Row( - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Expanded( - flex: 1, - child: Column( - children: [ - Text(TranslationBase.of( - context) - .procedureName), - Padding( - padding: EdgeInsets.only( - top: SizeConfig - .heightMultiplier * - 3.0), - child: Text( - model - .insuranceApproval[ - index] - .approvalDetails == - null - ? '' - : model - .insuranceApproval[ - index] - .approvalDetails - .procedureName, - style: TextStyle( - fontWeight: - FontWeight.w600, - fontSize: 15.5), - ), - ), - ], - ), - ), - VerticalDivider( - width: 10.0, - thickness: 1.2, - color: Colors.black, - ), - Expanded( - flex: 1, - child: Column( - children: [ - Text(TranslationBase.of( - context) - .procedureStatus), - Padding( - padding: EdgeInsets.only( - top: SizeConfig - .heightMultiplier * - 3.0), - child: Text( - model - .insuranceApproval[ - index] - .approvalDetails == - null - ? '' - : model - .insuranceApproval[ - index] - .approvalDetails - .status, - style: TextStyle( - fontSize: 17.5, - fontWeight: - FontWeight - .w600), - ), - ), - ], - ), - ), - VerticalDivider( - width: 2.3, - thickness: 1.2, - color: Colors.black, - ), - Expanded( - flex: 1, - child: Column( - children: [ - Text(TranslationBase.of( - context) - .usageStatus), - Padding( - padding: EdgeInsets.only( - top: SizeConfig - .heightMultiplier * - 3.0), - child: Text( - model - .insuranceApproval[ - index] - .approvalDetails == - null - ? '' - : model - .insuranceApproval[ - index] - .approvalDetails - .isInvoicedDesc, - style: TextStyle( - fontWeight: - FontWeight.w600, - fontSize: 17.5), - ), - ), - ], - ), - ), - ], - ), - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 1.0, - ), - ], - ), + ], + ), + Row( + children: [ + AppText( + 'Approvals', + fontSize: 30.0, + fontWeight: FontWeight.w700, ), ], ), ], ), - )), - ], - ), - ), + ), + + ...List.generate( + model.insuranceApproval.length, + (index) => Container( + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + InsuranceApprovalsDetails( + patient: patient, + indexInsurance: index, + )), + ); + }, + child: DoctorCardInsurance( + patientOut: model.insuranceApproval[index] + .patientDescription, + profileUrl: + model.insuranceApproval[index].doctorImage, + clinic: + model.insuranceApproval[index].clinicName, + doctorName: + model.insuranceApproval[index].doctorName, + branch: model + .insuranceApproval[index].approvalNo + .toString(), + isPrescriptions: true, + approvalStatus: model.insuranceApproval[index] + .approvalDetails.status, + ), + ), + ), + // (index) => Container( + // width: double.maxFinite, + // height: MediaQuery.of(context).size.height * .20, + // margin: EdgeInsets.all(10), + // padding: + // EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(15), + // color: Colors.white, + // ), + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Container( + // child: Row( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Container( + // height: MediaQuery.of(context).size.height * .20, + // width: 5, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.only( + // topLeft: Radius.circular(10), + // bottomLeft: Radius.circular(10), + // ), + // color: model.insuranceApproval[index] + // .approvalStatusDescption != + // "Approved" + // ? Colors.red[500] + // : Colors.green, + // ), + // ), + // Expanded( + // child: Container( + // padding: EdgeInsets.only( + // left: projectViewModel.isArabic ? 0 : 15, + // right: projectViewModel.isArabic ? 15 : 0), + // child: InkWell( + // child: Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Row( + // // mainAxisAlignment: + // // MainAxisAlignment.spaceBetween, + // children: [ + // Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Texts( + // model.insuranceApproval[index] + // .approvalDetails.status, + // color: model + // .insuranceApproval[ + // index] + // .approvalStatusDescption == + // "Approved" + // ? Colors.green + // : Colors.red[800], + // fontWeight: FontWeight.w600, + // ), + // SizedBox( + // height: 5, + // ), + // AppText(model + // .insuranceApproval[index] + // .doctorName), + // Container( + // child: LargeAvatar( + // url: model + // .insuranceApproval[index] + // .doctorImage, + // ), + // width: 55, + // height: 55, + // ), + // ], + // ), + // Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Row( + // children: [ + // Texts( + // 'Clinic: ', + // color: Colors.grey[500], + // ), + // Texts( + // model + // .insuranceApproval[ + // index] + // .clinicName, + // ), + // ], + // ), + // Row( + // children: [ + // Texts( + // 'Approval No', + // color: Colors.grey[500], + // ), + // Texts( + // model + // .insuranceApproval[ + // index] + // .approvalNo + // .toString(), + // ), + // ], + // ), + // ], + // ), + // SizedBox( + // width: 5, + // ), + // ], + // ), + // Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Row( + // children: [ + // Texts( + // 'Clinic: ', + // color: Colors.grey[500], + // ), + // Texts( + // model + // .insuranceApproval[ + // index] + // .clinicName, + // ), + // ], + // ), + // Row( + // children: [ + // Texts( + // 'Approval No', + // color: Colors.grey[500], + // ), + // Texts( + // model + // .insuranceApproval[ + // index] + // .approvalNo + // .toString(), + // ), + // ], + // ), + // ], + // ), + // Row( + // mainAxisAlignment: + // MainAxisAlignment.end, + // children: [ + // Icon(Icons.remove_red_eye_outlined) + // ], + // ) + // ], + // ), + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ), +// RoundedContainer( +// backgroundColor: Colors.white, +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// ExpansionTile( +// title: Container( +// //height: 120.0, +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// model.insuranceApproval[index] +// .patientDescription == +// "In Patient" +// ? Container( +// decoration: BoxDecoration( +// color: +// Theme.of(context).primaryColor, +// borderRadius: +// BorderRadius.circular(16.0)), +// width: 115.0, +// padding: EdgeInsets.only(left: 11.5), +// child: Center( +// child: Texts( +// TranslationBase.of(context) +// .inPatient, +// color: Colors.white, +// ), +// ), +// ) +// : Container( +// decoration: BoxDecoration( +// color: Color(0xff505A5D), +// borderRadius: +// BorderRadius.circular(16.0)), +// width: 115.0, +// padding: EdgeInsets.only(left: 11.5), +// child: Center( +// child: Texts( +// TranslationBase.of(context) +// .outpatient, +// color: Colors.white, +// ), +// ), +// ), +// Padding( +// padding: EdgeInsets.symmetric(vertical: 10.0), +// child: Texts( +// model.insuranceApproval[index].clinicName, +// fontSize: 20.0, +// color: Color(0xff60686B), +// fontWeight: FontWeight.w600, +// ), +// ), +// Texts( +// model.insuranceApproval[index].doctorName, +// fontSize: 17.0, +// ), +// ], +// ), +// ), +// children: [ +// Padding( +// padding: EdgeInsets.symmetric( +// vertical: 12.0, horizontal: 12.0), +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Row( +// children: [ +// Texts( +// TranslationBase.of(context).approvalNo, +// fontSize: 18.0, +// ), +// Texts( +// model +// .insuranceApproval[index].approvalNo +// .toString(), +// fontSize: 18.0, +// fontWeight: FontWeight.w600, +// ), +// ], +// ), +// Divider( +// color: Colors.black, +// height: 25.0, +// thickness: 1.0, +// ), +// Row( +// children: [ +// Texts( +// TranslationBase.of(context) +// .procedureStatus, +// fontSize: 17.5, +// ), +// SizedBox( +// width: 12, +// ), +// Expanded( +// child: Texts( +// model.insuranceApproval[index] +// .approvalStatusDescption, +// fontWeight: FontWeight.w600, +// fontSize: 17.5, +// ), +// ), +// ], +// ), +// Divider( +// color: Colors.black, +// height: 25.0, +// thickness: 1.0, +// ), +// Row( +// children: [ +// Texts( +// TranslationBase.of(context).unusedCount, +// fontSize: 17.5, +// ), +// Texts( +// model.insuranceApproval[index] +// .unUsedCount +// .toString(), +// fontSize: 17.5, +// fontWeight: FontWeight.w600, +// ), +// ], +// ), +// Divider( +// color: Colors.black, +// height: 25.0, +// thickness: 1.0, +// ), +// // Text( +// // 'Company Name: ' + +// // model.insuranceApproval[index] +// // .companyName == +// // null +// // ? '000' +// // : model +// // .insuranceApproval[index].companyName, +// // style: TextStyle( +// // fontSize: 17.5, +// // fontWeight: FontWeight.w600), +// // ), +// Texts( +// TranslationBase.of(context).companyName, +// fontWeight: FontWeight.w600, +// fontSize: 17.5, +// ), +// +// Divider( +// color: Colors.black, +// height: 25.0, +// thickness: 1.0, +// ), +// Row( +// children: [ +// Texts( +// TranslationBase.of(context).receiptOn, +// fontSize: 17.5, +// fontWeight: FontWeight.w600, +// ), +// Texts( +// DateUtils.getDateTimeFromServerFormat( +// model.insuranceApproval[index] +// .rceiptOn) +// .toString(), +// fontSize: 17.5, +// fontWeight: FontWeight.w600, +// ), +// ], +// ), +// Divider( +// color: Colors.black, +// height: 25.0, +// thickness: 1.0, +// ), +// Row( +// children: [ +// Texts( +// TranslationBase.of(context).expiryDate, +// fontSize: 17.5, +// fontWeight: FontWeight.w600, +// ), +// Texts( +// DateUtils.getDateTimeFromServerFormat( +// model.insuranceApproval[index] +// .expiryDate) +// .toString(), +// fontSize: 17.5, +// fontWeight: FontWeight.w600, +// ), +// ], +// ), +// Divider( +// color: Colors.black, +// height: 55.0, +// thickness: 1.2, +// ), +// IntrinsicHeight( +// child: Row( +// crossAxisAlignment: +// CrossAxisAlignment.center, +// children: [ +// Expanded( +// flex: 1, +// child: Column( +// children: [ +// Text(TranslationBase.of(context) +// .procedureName), +// Padding( +// padding: EdgeInsets.only( +// top: SizeConfig +// .heightMultiplier * +// 3.0), +// child: Text( +// model.insuranceApproval[index] +// .approvalDetails == +// null +// ? '' +// : model +// .insuranceApproval[ +// index] +// .approvalDetails +// .procedureName, +// style: TextStyle( +// fontWeight: +// FontWeight.w600, +// fontSize: 15.5), +// ), +// ), +// ], +// ), +// ), +// VerticalDivider( +// width: 10.0, +// thickness: 1.2, +// color: Colors.black, +// ), +// Expanded( +// flex: 1, +// child: Column( +// children: [ +// Text(TranslationBase.of(context) +// .procedureStatus), +// Padding( +// padding: EdgeInsets.only( +// top: SizeConfig +// .heightMultiplier * +// 3.0), +// child: Text( +// model.insuranceApproval[index] +// .approvalDetails == +// null +// ? '' +// : model +// .insuranceApproval[ +// index] +// .approvalDetails +// .status, +// style: TextStyle( +// fontSize: 17.5, +// fontWeight: +// FontWeight.w600), +// ), +// ), +// ], +// ), +// ), +// VerticalDivider( +// width: 2.3, +// thickness: 1.2, +// color: Colors.black, +// ), +// Expanded( +// flex: 1, +// child: Column( +// children: [ +// Text(TranslationBase.of(context) +// .usageStatus), +// Padding( +// padding: EdgeInsets.only( +// top: SizeConfig +// .heightMultiplier * +// 3.0), +// child: Text( +// model.insuranceApproval[index] +// .approvalDetails == +// null +// ? '' +// : model +// .insuranceApproval[ +// index] +// .approvalDetails +// .isInvoicedDesc, +// style: TextStyle( +// fontWeight: +// FontWeight.w600, +// fontSize: 17.5), +// ), +// ), +// ], +// ), +// ), +// ], +// ), +// ), +// Divider( +// color: Colors.black, +// height: 25.0, +// thickness: 1.0, +// ), +// ], +// ), +// ), +// ], +// ), +// ], +// ), +// ), + ), + ], + ) + : Column( + children: [ + Container( + height: 200, + width: double.infinity, + child: Center( + child: Text("No Insurance Approvals Found"))) + ], + )), ), ), ); diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart new file mode 100644 index 00000000..ba93b780 --- /dev/null +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -0,0 +1,329 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.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'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class InsuranceApprovalsDetails extends StatefulWidget { + PatiantInformtion patient; + int indexInsurance; + InsuranceApprovalsDetails({this.patient, this.indexInsurance}); + @override + _InsuranceApprovalsDetailsState createState() => + _InsuranceApprovalsDetailsState( + patient: patient, indexInsurance: indexInsurance); +} + +class _InsuranceApprovalsDetailsState extends State { + PatiantInformtion patient; + int indexInsurance; + + _InsuranceApprovalsDetailsState({this.patient, this.indexInsurance}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + + return BaseView( + onModelReady: patient.appointmentNo != null + ? (model) => model.getInsuranceApproval(patient, + appointmentNo: patient.appointmentNo) + : (model) => model.getInsuranceApproval(patient), + builder: (BuildContext context, InsuranceViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patient.patientType.toString(), patient.arrivedOn), + body: SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + 'Insurance', + fontSize: 15.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + 'Approvals', + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + Texts( + model.insuranceApproval[indexInsurance] + .approvalDetails.status, + color: + model.insuranceApproval[indexInsurance] + .approvalDetails.status == + "Approved" + ? Color(0xff359846) + : Color(0xffD02127), + ), + ], + ), + Row( + children: [ + Texts( + model.insuranceApproval[indexInsurance] + .doctorName + .toUpperCase(), + color: Colors.black, + fontSize: 18, + fontWeight: FontWeight.bold, + ) + ], + ), + Padding( + padding: + const EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + children: [ + Column( + children: [ + Container( + height: 85.0, + width: 85.0, + child: CircleAvatar( + radius: + SizeConfig.imageSizeMultiplier * + 12, + // radius: (52) + child: ClipRRect( + borderRadius: + BorderRadius.circular(50), + child: Image.network( + model + .insuranceApproval[ + indexInsurance] + .doctorImage, + fit: BoxFit.fill, + width: 700, + ), + ), + backgroundColor: Colors.transparent, + ), + ), + ], + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 25.0, + ), + Row( + children: [ + Texts( + 'Clinic: ', + color: Colors.grey[500], + ), + Texts( + model + .insuranceApproval[ + indexInsurance] + .clinicName, + ) + ], + ), + Row( + children: [ + Texts( + 'Approval No: ', + color: Colors.grey[500], + ), + Texts( + model + .insuranceApproval[ + indexInsurance] + .approvalNo + .toString(), + ) + ], + ), + Row( + children: [ + Texts( + 'Unused Count:', + color: Colors.grey[500], + ), + Texts(model + .insuranceApproval[ + indexInsurance] + .unUsedCount + .toString()) + ], + ), + Row( + children: [ + Texts( + 'Company Name :', + color: Colors.grey[500], + ), + Texts('Sample') + ], + ), + SizedBox( + height: 25.0, + ), + Row( + children: [ + Texts( + 'Receipt on :', + color: Colors.grey[500], + ), + Texts( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ], + ), + Row( + children: [ + Texts( + 'Exp on:', + color: Colors.grey[500], + ), + Texts( + '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ], + ), + ], + ), + ), + ], + ), + ), + SizedBox( + height: 20.0, + ), + Container( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + children: [ + Texts('Procedure'), + Texts('Status'), + Texts('Usage Status') + ], + ), + Divider( + color: Colors.black45, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + children: [ + Container( + height: MediaQuery.of(context) + .size + .height * + 0.2, //130.0, + width: MediaQuery.of(context) + .size + .width * + 0.33, + child: Texts(model + .insuranceApproval[indexInsurance] + .approvalDetails + .procedureName), + ), + Container( + height: MediaQuery.of(context) + .size + .height * + 0.2, + width: MediaQuery.of(context) + .size + .width * + 0.33, + child: Texts(model + .insuranceApproval[indexInsurance] + .approvalDetails + .status), + ), + Container( + height: MediaQuery.of(context) + .size + .height * + 0.2, + width: MediaQuery.of(context) + .size + .width * + 0.25, + child: Texts(model + .insuranceApproval[indexInsurance] + .approvalDetails + .isInvoicedDesc), + ), + ], + ) + ], + ), + ), + ], + ), + ), + ), + ], + ), + ), + )), + ); + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 4961d2f8..243f742e 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1204,6 +1204,7 @@ class TranslationBase { String get cancelled => localizedValues['cancelled'][locale.languageCode]; String get unReplied => localizedValues['unReplied'][locale.languageCode]; String get replied => localizedValues['replied'][locale.languageCode]; + String get typeHereToReply => localizedValues['typeHereToReply'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index c28cc8d3..fca0e0b4 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -78,10 +78,18 @@ class MyScheduleWidget extends StatelessWidget { 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: Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: AppText( + work.from + ' - ' + work.to, + fontSize: 15, + fontWeight: FontWeight.w300, + ), + ), + ), ) ], ), 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 b4c445ca..c49c4576 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -134,16 +134,6 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'patient/Progress_notes.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), ], ), ); diff --git a/lib/widgets/shared/doctor_card_insurance.dart b/lib/widgets/shared/doctor_card_insurance.dart new file mode 100644 index 00000000..4c2bc6d1 --- /dev/null +++ b/lib/widgets/shared/doctor_card_insurance.dart @@ -0,0 +1,182 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_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/patients/profile/large_avatar.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +import 'StarRating.dart'; +import 'Text.dart'; + +class DoctorCardInsurance extends StatelessWidget { + final String doctorName; + final String branch; + final DateTime appointmentDate; + final String profileUrl; + final String invoiceNO; + final String orderNo; + final Function onTap; + final bool isPrescriptions; + final String clinic; + final String approvalStatus; + final String patientOut; + + DoctorCardInsurance( + {this.doctorName, + this.branch, + this.profileUrl, + this.invoiceNO, + this.onTap, + this.appointmentDate, + this.orderNo, + this.isPrescriptions = false, + this.clinic, + this.approvalStatus, + this.patientOut}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: approvalStatus == "Approved" + ? Color(0xff359846) + : Color(0xffD02127), + width: 3.5), + top: BorderSide(color: Colors.white, width: 0.5), + bottom: BorderSide(color: Colors.white, width: 0.5), + right: BorderSide(color: Colors.white, width: 0.5), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: InkWell( + onTap: onTap, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + "$approvalStatus", + color: approvalStatus == "Approved" + ? Color(0xff359846) + : Color(0xffD02127), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(25.0), + ), + color: Color(0xff2E303A)), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Texts( + '$patientOut', + color: Colors.white, + fontSize: 15.0, + ), + ), + ) + ], + ), + Row( + children: [ + Expanded( + child: Texts( + doctorName, + bold: true, + )), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + child: LargeAvatar( + name: doctorName, + url: profileUrl, + ), + width: 55, + height: 55, + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (orderNo != null && !isPrescriptions) + Row( + children: [ + Texts( + 'order No:', + color: Colors.grey[500], + ), + Texts( + orderNo ?? '', + ) + ], + ), + if (invoiceNO != null && !isPrescriptions) + Row( + children: [ + Texts( + 'Invoice:', + color: Colors.grey[500], + ), + Texts( + invoiceNO, + ) + ], + ), + if (isPrescriptions) + Row( + children: [ + Texts( + 'Clinic: ', + color: Colors.grey[500], + ), + Expanded( + child: Texts( + clinic, + ), + ) + ], + ), + if (branch != null) + Row( + children: [ + Texts( + 'Approval No: ', + color: Colors.grey[500], + ), + Texts( + branch, + ) + ], + ) + ]), + ), + ), + Icon( + EvaIcons.eye, + size: 38.0, + ) + ], + ), + ], + ), + ), + ), + ); + } +}