|
|
@ -5,7 +5,9 @@ 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/models/patient/patiant_info_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/prescription/prescription_details_page.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/prescription/prescription_details_page.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/util/translations_delegate_base.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/Text.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_scaffold_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
|
|
@ -15,7 +17,9 @@ import 'package:flutter/material.dart';
|
|
|
|
class PrescriptionItemsPage extends StatelessWidget {
|
|
|
|
class PrescriptionItemsPage extends StatelessWidget {
|
|
|
|
final Prescriptions prescriptions;
|
|
|
|
final Prescriptions prescriptions;
|
|
|
|
final PatiantInformtion patient;
|
|
|
|
final PatiantInformtion patient;
|
|
|
|
PrescriptionItemsPage({Key key, this.prescriptions, this.patient});
|
|
|
|
final String patientType;
|
|
|
|
|
|
|
|
final String arrivalType;
|
|
|
|
|
|
|
|
PrescriptionItemsPage({Key key, this.prescriptions, this.patient, this.patientType, this.arrivalType});
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
@ -23,14 +27,28 @@ class PrescriptionItemsPage extends StatelessWidget {
|
|
|
|
onModelReady: (model) =>
|
|
|
|
onModelReady: (model) =>
|
|
|
|
model.getPrescriptionReport(prescriptions: prescriptions,patient: patient),
|
|
|
|
model.getPrescriptionReport(prescriptions: prescriptions,patient: patient),
|
|
|
|
builder: (_, model, widget) => AppScaffold(
|
|
|
|
builder: (_, model, widget) => AppScaffold(
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: false,
|
|
|
|
appBarTitle: TranslationBase.of(context).prescriptions,
|
|
|
|
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
PatientProfileHeaderWhitAppointment(patient: patient,
|
|
|
|
|
|
|
|
patientType: patientType??"0",
|
|
|
|
|
|
|
|
arrivalType: arrivalType??"0",
|
|
|
|
|
|
|
|
branch: '',
|
|
|
|
|
|
|
|
clinic: prescriptions.clinicDescription,
|
|
|
|
|
|
|
|
isPrescriptions: true,
|
|
|
|
|
|
|
|
appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate),
|
|
|
|
|
|
|
|
doctorName: prescriptions.doctorName,
|
|
|
|
|
|
|
|
profileUrl: prescriptions.doctorImageURL,
|
|
|
|
|
|
|
|
// invoiceNO: widget.patientLabOrders.invoiceNo,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!prescriptions.isInOutPatient)
|
|
|
|
|
|
|
|
...List.generate(
|
|
|
|
|
|
|
|
model.prescriptionReportList.length,
|
|
|
|
|
|
|
|
(index) => Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
@ -43,7 +61,8 @@ class PrescriptionItemsPage extends StatelessWidget {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 18,right: 18),
|
|
|
|
margin: EdgeInsets.only(left: 18,right: 18),
|
|
|
|
child: Texts('Name ',bold: true,)),
|
|
|
|
child: Texts(model.prescriptionReportList[index].itemDescription.isNotEmpty ? model.prescriptionReportList[index].itemDescription : model.prescriptionReportList[index].itemDescriptionN,bold: true,)),
|
|
|
|
|
|
|
|
SizedBox(height: 12,),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SizedBox(width: 18,),
|
|
|
|
SizedBox(width: 18,),
|
|
|
@ -52,17 +71,34 @@ class PrescriptionItemsPage extends StatelessWidget {
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
border: Border.all(width: 0.5,color: Colors.grey)
|
|
|
|
border: Border.all(width: 0.5,color: Colors.grey)
|
|
|
|
),
|
|
|
|
),
|
|
|
|
height: 45,
|
|
|
|
height: 55,
|
|
|
|
width: 45,
|
|
|
|
width: 55,
|
|
|
|
|
|
|
|
child: Padding(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
|
|
|
child: Image.network(
|
|
|
|
|
|
|
|
model.prescriptionReportList[index].imageSRCUrl,
|
|
|
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(width: 10,),
|
|
|
|
SizedBox(width: 10,),
|
|
|
|
Expanded(child: Column(
|
|
|
|
Expanded(child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts('Route: Monthly'),
|
|
|
|
Row(
|
|
|
|
Texts('Does: 2 Time a day with 1 hour gap'),
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Texts(TranslationBase.of(context).route,color: Colors.grey,),
|
|
|
|
|
|
|
|
Expanded(child: Texts(model.prescriptionReportList[index].routeN)),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Texts(TranslationBase.of(context).frequency,color: Colors.grey,),
|
|
|
|
|
|
|
|
Texts(model.prescriptionReportList[index].frequencyN ?? ''),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
SizedBox(height: 12,),
|
|
|
|
SizedBox(height: 12,),
|
|
|
|
Texts('Note: 2 Time a day with 1 hour gap'),
|
|
|
|
Texts(model.prescriptionReportList[index].remarks ?? ''),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),)
|
|
|
|
),)
|
|
|
|
|
|
|
|
|
|
|
@ -72,144 +108,70 @@ class PrescriptionItemsPage extends StatelessWidget {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
if (!prescriptions.isInOutPatient)
|
|
|
|
else
|
|
|
|
...List.generate(
|
|
|
|
...List.generate(
|
|
|
|
model.prescriptionReportList.length,
|
|
|
|
model.prescriptionReportEnhList.length,
|
|
|
|
(index) => InkWell(
|
|
|
|
(index) => Container(
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
FadePage(
|
|
|
|
|
|
|
|
page: PrescriptionDetailsPage(
|
|
|
|
|
|
|
|
prescriptionReport:
|
|
|
|
|
|
|
|
model.prescriptionReportList[index],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(top: 10, left: 10, right: 10),
|
|
|
|
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
|
|
|
Radius.circular(10.0),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
border: Border.all(
|
|
|
|
|
|
|
|
color: Colors.grey[200], width: 0.5),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
margin: EdgeInsets.all(12),
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
|
|
ClipRRect(
|
|
|
|
|
|
|
|
borderRadius:
|
|
|
|
|
|
|
|
BorderRadius.all(Radius.circular(5)),
|
|
|
|
|
|
|
|
child: Image.network(
|
|
|
|
|
|
|
|
model.prescriptionReportList[index]
|
|
|
|
|
|
|
|
.imageSRCUrl,
|
|
|
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
|
|
|
width: 60,
|
|
|
|
|
|
|
|
height: 70,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
width: 10,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
child: Center(
|
|
|
|
child: Column(
|
|
|
|
child: Texts(model
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
.prescriptionReportList[index]
|
|
|
|
children: [
|
|
|
|
.itemDescription
|
|
|
|
Container(
|
|
|
|
.isNotEmpty
|
|
|
|
margin: EdgeInsets.only(left: 18,right: 18),
|
|
|
|
? model.prescriptionReportList[index]
|
|
|
|
child: Texts(model.prescriptionReportEnhList[index].itemDescription,bold: true,),),
|
|
|
|
.itemDescription
|
|
|
|
SizedBox(height: 12,),
|
|
|
|
: model.prescriptionReportList[index]
|
|
|
|
Row(
|
|
|
|
.itemDescriptionN)),
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
)),
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
Icon(
|
|
|
|
children: [
|
|
|
|
Icons.arrow_forward_ios,
|
|
|
|
SizedBox(width: 18,),
|
|
|
|
size: 18,
|
|
|
|
Container(
|
|
|
|
color: Colors.grey[500],
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
)
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
],
|
|
|
|
border: Border.all(width: 0.5,color: Colors.grey)
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
...List.generate(
|
|
|
|
|
|
|
|
model.prescriptionReportEnhList.length,
|
|
|
|
|
|
|
|
(index) => InkWell(
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
PrescriptionReport prescriptionReport =
|
|
|
|
|
|
|
|
PrescriptionReport(
|
|
|
|
|
|
|
|
imageSRCUrl: model
|
|
|
|
|
|
|
|
.prescriptionReportEnhList[index].imageSRCUrl,
|
|
|
|
|
|
|
|
itemDescription: model
|
|
|
|
|
|
|
|
.prescriptionReportEnhList[index]
|
|
|
|
|
|
|
|
.itemDescription,
|
|
|
|
|
|
|
|
itemDescriptionN: model
|
|
|
|
|
|
|
|
.prescriptionReportEnhList[index]
|
|
|
|
|
|
|
|
.itemDescription,
|
|
|
|
|
|
|
|
routeN:
|
|
|
|
|
|
|
|
model.prescriptionReportEnhList[index].route,
|
|
|
|
|
|
|
|
frequency: model
|
|
|
|
|
|
|
|
.prescriptionReportEnhList[index].frequency,
|
|
|
|
|
|
|
|
frequencyN: model
|
|
|
|
|
|
|
|
.prescriptionReportEnhList[index].frequency,
|
|
|
|
|
|
|
|
doseDailyQuantity: model
|
|
|
|
|
|
|
|
.prescriptionReportEnhList[index]
|
|
|
|
|
|
|
|
.doseDailyQuantity,
|
|
|
|
|
|
|
|
days: model.prescriptionReportEnhList[index].days,
|
|
|
|
|
|
|
|
itemID:
|
|
|
|
|
|
|
|
model.prescriptionReportEnhList[index].itemID,
|
|
|
|
|
|
|
|
remarks: model
|
|
|
|
|
|
|
|
.prescriptionReportEnhList[index].remarks);
|
|
|
|
|
|
|
|
Navigator.push(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
FadePage(
|
|
|
|
|
|
|
|
page: PrescriptionDetailsPage(
|
|
|
|
|
|
|
|
prescriptionReport: prescriptionReport,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
height: 55,
|
|
|
|
},
|
|
|
|
width: 55,
|
|
|
|
child: Container(
|
|
|
|
child: Padding(
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
|
|
ClipRRect(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
|
|
|
|
|
|
|
child: Image.network(
|
|
|
|
child: Image.network(
|
|
|
|
model
|
|
|
|
model.prescriptionReportEnhList[index].imageSRCUrl,
|
|
|
|
.prescriptionReportEnhList[index].imageSRCUrl,
|
|
|
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: 60,
|
|
|
|
|
|
|
|
height: 70,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
width: 10,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
SizedBox(width: 10,),
|
|
|
|
child: Padding(
|
|
|
|
Expanded(child: Column(
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: <Widget>[
|
|
|
|
children: [
|
|
|
|
Texts(model.prescriptionReportEnhList[index]
|
|
|
|
Row(
|
|
|
|
.itemDescription),
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Texts(TranslationBase.of(context).route,color: Colors.grey,),
|
|
|
|
|
|
|
|
Expanded(child: Texts(model.prescriptionReportEnhList[index].route??'')),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Texts(TranslationBase.of(context).frequency,color: Colors.grey,),
|
|
|
|
|
|
|
|
Texts(model.prescriptionReportEnhList[index].frequency ?? ''),
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(height: 12,),
|
|
|
|
Icon(
|
|
|
|
Texts(model.prescriptionReportEnhList[index].remarks?? ''),
|
|
|
|
Icons.arrow_forward_ios,
|
|
|
|
],
|
|
|
|
size: 18,
|
|
|
|
),)
|
|
|
|
color: Colors.grey[500],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -217,6 +179,8 @@ class PrescriptionItemsPage extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|