You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RSGDoctorApp/lib/screens/prescription/prescription_items_page.dart

296 lines
15 KiB
Dart

import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/viewModel/prescriptions_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_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/shared/app_scaffold_widget.dart';
5 years ago
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/ShowImageDialog.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class PrescriptionItemsPage extends StatelessWidget {
final Prescriptions prescriptions;
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
PrescriptionItemsPage(
{Key? key,
required this.prescriptions,
required this.patient,
required this.patientType,
required this.arrivalType});
@override
Widget build(BuildContext context) {
return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => model.getPrescriptionReport(prescriptions: prescriptions, patient: patient),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
backgroundColor: Colors.grey[100]!,
baseViewModel: model,
patientProfileAppBarModel: PatientProfileAppBarModel(
patient: patient,
clinic: prescriptions.clinicDescription!,
branch: prescriptions.name!,
isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
Merge branch 'flutter_2_developemt' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into flutter_vervion_2_elham  Conflicts:  ios/Podfile  lib/client/base_app_client.dart  lib/core/model/patient_muse/PatientSearchRequestModel.dart  lib/core/model/referral/MyReferralPatientModel.dart  lib/core/service/patient/LiveCarePatientServices.dart  lib/core/service/patient/MyReferralPatientService.dart  lib/core/service/patient/patient_service.dart  lib/core/viewModel/LiveCarePatientViewModel.dart  lib/core/viewModel/PatientMedicalReportViewModel.dart  lib/core/viewModel/PatientSearchViewModel.dart  lib/core/viewModel/authentication_view_model.dart  lib/core/viewModel/dashboard_view_model.dart  lib/core/viewModel/patient-referral-viewmodel.dart  lib/core/viewModel/procedure_View_model.dart  lib/core/viewModel/referred_view_model.dart  lib/models/livecare/start_call_req.dart  lib/models/patient/patiant_info_model.dart  lib/screens/auth/login_screen.dart  lib/screens/auth/verification_methods_screen.dart  lib/screens/home/dashboard_slider-item-widget.dart  lib/screens/home/dashboard_swipe_widget.dart  lib/screens/home/home_page_card.dart  lib/screens/home/home_patient_card.dart  lib/screens/home/home_screen.dart  lib/screens/live_care/end_call_screen.dart  lib/screens/live_care/live-care_transfer_to_admin.dart  lib/screens/live_care/live_care_patient_screen.dart  lib/screens/medical-file/health_summary_page.dart  lib/screens/medical-file/medical_file_details.dart  lib/screens/patients/ECGPage.dart  lib/screens/patients/insurance_approval_screen_patient.dart  lib/screens/patients/insurance_approvals_details.dart  lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart  lib/screens/patients/profile/UCAF/UCAF-input-screen.dart  lib/screens/patients/profile/admission-request/admission-request-first-screen.dart  lib/screens/patients/profile/admission-request/admission-request-third-screen.dart  lib/screens/patients/profile/admission-request/admission-request_second-screen.dart  lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart  lib/screens/patients/profile/medical_report/MedicalReportPage.dart  lib/screens/patients/profile/note/progress_note_screen.dart  lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart  lib/screens/patients/profile/profile_screen/patient_profile_screen.dart  lib/screens/patients/profile/radiology/radiology_details_page.dart  lib/screens/patients/profile/radiology/radiology_home_page.dart  lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart  lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart  lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart  lib/screens/patients/profile/referral/refer-patient-screen.dart  lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart  lib/screens/patients/profile/referral/referred-patient-screen.dart  lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart  lib/screens/patients/profile/soap_update/update_soap_index.dart  lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart  lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart  lib/screens/prescription/add_favourite_prescription.dart  lib/screens/prescription/add_prescription_form.dart  lib/screens/prescription/prescription_home_screen.dart  lib/screens/prescription/prescription_item_in_patient_page.dart  lib/screens/prescription/prescription_items_page.dart  lib/screens/prescription/prescription_screen.dart  lib/screens/prescription/prescription_screen_history.dart  lib/screens/prescription/prescriptions_page.dart  lib/screens/procedures/ProcedureCard.dart  lib/screens/procedures/add-favourite-procedure.dart  lib/screens/procedures/add-procedure-form.dart  lib/screens/procedures/add_lab_home_screen.dart  lib/screens/procedures/add_lab_orders.dart  lib/screens/procedures/add_radiology_order.dart  lib/screens/procedures/add_radiology_screen.dart  lib/screens/procedures/base_add_procedure_tab_page.dart  lib/screens/procedures/entity_list_procedure_widget.dart  lib/screens/qr_reader/QR_reader_screen.dart  lib/util/VideoChannel.dart  lib/util/translations_delegate_base.dart  lib/widgets/auth/sms-popup.dart  lib/widgets/auth/verification_methods_list.dart  lib/widgets/dashboard/out_patient_stack.dart  lib/widgets/patients/patient-referral-item-widget.dart  lib/widgets/patients/patient_card/PatientCard.dart  lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart  lib/widgets/patients/profile/PatientProfileButton.dart  lib/widgets/patients/profile/patient-page-header-widget.dart  lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart  lib/widgets/patients/profile/patient-profile-header-new-design.dart  lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart  lib/widgets/patients/profile/profile-welcome-widget.dart  lib/widgets/shared/app_drawer_widget.dart  lib/widgets/shared/app_scaffold_widget.dart  lib/widgets/shared/app_texts_widget.dart  lib/widgets/shared/bottom_navigation_item.dart  lib/widgets/shared/buttons/app_buttons_widget.dart  lib/widgets/shared/drawer_item_widget.dart  pubspec.lock
5 years ago
prescriptions.appointmentDate!),
doctorName: prescriptions.doctorName!,
profileUrl: prescriptions.doctorImageURL!,
isAppointmentHeader: true,
),
body: SingleChildScrollView(
child: Container(
child: Column(
children: [
if (!prescriptions.isInOutPatient!)
...List.generate(
model.prescriptionReportList.length,
(index) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
margin: EdgeInsets.all(12),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(left: 18, right: 18),
child: AppText(
model.prescriptionReportList[index].itemDescription!.isNotEmpty
? model.prescriptionReportList[index].itemDescription
: model.prescriptionReportList[index].itemDescriptionN,
bold: true,
)),
SizedBox(
height: 12,
),
Row(
children: [
SizedBox(
width: 18,
),
Container(
decoration: BoxDecoration(
shape: BoxShape.circle, border: Border.all(width: 0.5, color: Colors.grey)),
height: 55,
width: 55,
child: InkWell(
onTap: () {
showDialog(
context: context,
builder: (ctx) => ShowImageDialog(
imageUrl:
model.prescriptionReportEnhList[index].imageSRCUrl ?? "",
));
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.network(
model.prescriptionReportList[index].imageSRCUrl ?? "",
fit: BoxFit.cover,
),
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
AppText(
TranslationBase.of(context).route,
color: Colors.grey,
),
Expanded(
child: AppText(" " + model.prescriptionReportList[index].routeN!)),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).frequency,
color: Colors.grey,
),
AppText(" " + model.prescriptionReportList[index].frequencyN! ?? ''),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).dailyDoses,
color: Colors.grey,
),
AppText(
" " + model.prescriptionReportList[index].doseDailyQuantity ?? ''),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).duration,
color: Colors.grey,
),
AppText(
" " + model.prescriptionReportList[index].days.toString() ?? ''),
],
),
SizedBox(
height: 12,
),
AppText(model.prescriptionReportList[index].remarks ?? ''),
],
),
)
],
)
],
),
),
))
else
...List.generate(
model.prescriptionReportEnhList.length,
(index) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
margin: EdgeInsets.all(12),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(left: 18, right: 18),
child: AppText(
model.prescriptionReportEnhList[index].itemDescription,
bold: true,
),
),
SizedBox(
height: 12,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 18,
),
Container(
decoration: BoxDecoration(
shape: BoxShape.circle, border: Border.all(width: 0.5, color: Colors.grey)),
height: 55,
width: 55,
child: InkWell(
onTap: () {
showDialog(
context: context,
builder: (ctx) => ShowImageDialog(
imageUrl: model.prescriptionReportEnhList[index].imageSRCUrl!,
));
},
child: Stack(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.network(
model.prescriptionReportEnhList[index].imageSRCUrl ?? "",
fit: BoxFit.cover,
),
),
Positioned(
top: 10,
right: 10,
child: Icon(
EvaIcons.search,
color: Colors.grey,
size: 35,
))
],
),
),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
AppText(
TranslationBase.of(context).route,
color: Colors.grey,
),
Expanded(
child:
AppText(" " + model.prescriptionReportEnhList[index].route! ?? '')),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).frequency,
color: Colors.grey,
),
AppText(" " + model.prescriptionReportEnhList[index].frequency! ?? ''),
5 years ago
],
),
Row(
children: [
AppText(
TranslationBase.of(context).dailyDoses,
color: Colors.grey,
),
AppText(" " +
model.prescriptionReportEnhList[index].doseDailyQuantity.toString() ??
''),
5 years ago
],
),
Row(
children: [
AppText(
TranslationBase.of(context).duration,
color: Colors.grey,
),
AppText(" " + model.prescriptionReportList[index].days.toString() ?? ''),
],
),
SizedBox(
height: 12,
),
AppText(model.prescriptionReportEnhList[index].remarks ?? ''),
],
),
)
],
)
],
),
),
),
),
],
),
),
),
),
);
}
}