|
|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
@ -26,6 +27,7 @@ class PrescriptionsPage extends StatelessWidget {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
|
|
|
PatientViewModel patientViewModel;
|
|
|
|
|
PatiantInformtion patient = routeArgs['patient'];
|
|
|
|
|
String patientType = routeArgs['patientType'];
|
|
|
|
|
String arrivalType = routeArgs['arrivalType'];
|
|
|
|
|
@ -33,9 +35,16 @@ class PrescriptionsPage extends StatelessWidget {
|
|
|
|
|
bool isFromLiveCare = routeArgs['isFromLiveCare'];
|
|
|
|
|
bool isSelectInpatient = routeArgs['isSelectInpatient'];
|
|
|
|
|
return BaseView<PrescriptionViewModel>(
|
|
|
|
|
onModelReady: (model) => patient.admissionNo == null
|
|
|
|
|
? model.getPrescriptions(patient, patientType: patientType)
|
|
|
|
|
: model.getMedicationForInPatient(patient),
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
await model.getOutPatientPrescriptions(
|
|
|
|
|
patient.admissionNo == null
|
|
|
|
|
? model.getPrescriptions(patient, patientType: patientType)
|
|
|
|
|
: model.getMedicationForInPatient(patient),
|
|
|
|
|
isLocalBusy: false,
|
|
|
|
|
context: context,
|
|
|
|
|
patientInformation: patient
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
@ -118,29 +127,24 @@ class PrescriptionsPage extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
model.prescriptionsList[index].despensedStatus,
|
|
|
|
|
),
|
|
|
|
|
DoctorCard(
|
|
|
|
|
doctorName:
|
|
|
|
|
model.prescriptionsList[index].doctorName,
|
|
|
|
|
profileUrl: model
|
|
|
|
|
.prescriptionsList[index].doctorImageURL,
|
|
|
|
|
branch: model.prescriptionsList[index].name,
|
|
|
|
|
clinic: model.prescriptionsList[index]
|
|
|
|
|
.clinicDescription,
|
|
|
|
|
isPrescriptions: true,
|
|
|
|
|
appointmentDate:
|
|
|
|
|
AppDateUtils.getDateTimeFromServerFormat(
|
|
|
|
|
model.prescriptionsList[index]
|
|
|
|
|
.appointmentDate,
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
DoctorCard(
|
|
|
|
|
doctorName:
|
|
|
|
|
model.prescriptionsList[index].doctorName,
|
|
|
|
|
profileUrl: model
|
|
|
|
|
.prescriptionsList[index].doctorImageURL,
|
|
|
|
|
branch: model.prescriptionsList[index].name,
|
|
|
|
|
clinic: model.prescriptionsList[index]
|
|
|
|
|
.clinicDescription,
|
|
|
|
|
isPrescriptions: true,
|
|
|
|
|
appointmentDate:
|
|
|
|
|
AppDateUtils.getDateTimeFromServerFormat(
|
|
|
|
|
model.prescriptionsList[index]
|
|
|
|
|
.appointmentDate,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
))),
|
|
|
|
|
if (model.prescriptionsList.isEmpty &&
|
|
|
|
|
patient.patientStatusType != 43)
|
|
|
|
|
|