medication for in patient

merge-requests/820/head
hussam al-habibeh 4 years ago
parent 41ed593707
commit b461af1be2

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
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 = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
@ -239,6 +239,7 @@ const REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue";
const CREATE_DOCTOR_RESPONSE = "Services/DoctorApplication.svc/REST/CreateDoctorResponse";
const GET_DOCTOR_NOT_REPLIED_COUNTS = "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts";
const ALL_SPECIAL_LAB_RESULT = "services/Patients.svc/REST/GetPatientLabSpecialResultsALL";
const GET_MEDICATION_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient";
var selectedPatientType = 1;

@ -0,0 +1,136 @@
class GetMedicationForInPatientModel {
String setupID;
int projectID;
int admissionNo;
int patientID;
int orderNo;
int prescriptionNo;
int lineItemNo;
String prescriptionDatetime;
int itemID;
int directionID;
int refillID;
String dose;
int unitofMeasurement;
String startDatetime;
String stopDatetime;
int noOfDoses;
int routeId;
String comments;
int reviewedPharmacist;
dynamic reviewedPharmacistDatetime;
dynamic discountinueDatetime;
dynamic rescheduleDatetime;
int status;
String statusDescription;
int createdBy;
String createdOn;
dynamic editedBy;
dynamic editedOn;
dynamic strength;
String pHRItemDescription;
String pHRItemDescriptionN;
GetMedicationForInPatientModel(
{this.setupID,
this.projectID,
this.admissionNo,
this.patientID,
this.orderNo,
this.prescriptionNo,
this.lineItemNo,
this.prescriptionDatetime,
this.itemID,
this.directionID,
this.refillID,
this.dose,
this.unitofMeasurement,
this.startDatetime,
this.stopDatetime,
this.noOfDoses,
this.routeId,
this.comments,
this.reviewedPharmacist,
this.reviewedPharmacistDatetime,
this.discountinueDatetime,
this.rescheduleDatetime,
this.status,
this.statusDescription,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn,
this.strength,
this.pHRItemDescription,
this.pHRItemDescriptionN});
GetMedicationForInPatientModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
admissionNo = json['AdmissionNo'];
patientID = json['PatientID'];
orderNo = json['OrderNo'];
prescriptionNo = json['PrescriptionNo'];
lineItemNo = json['LineItemNo'];
prescriptionDatetime = json['PrescriptionDatetime'];
itemID = json['ItemID'];
directionID = json['DirectionID'];
refillID = json['RefillID'];
dose = json['Dose'];
unitofMeasurement = json['UnitofMeasurement'];
startDatetime = json['StartDatetime'];
stopDatetime = json['StopDatetime'];
noOfDoses = json['NoOfDoses'];
routeId = json['RouteId'];
comments = json['Comments'];
reviewedPharmacist = json['ReviewedPharmacist'];
reviewedPharmacistDatetime = json['ReviewedPharmacistDatetime'];
discountinueDatetime = json['DiscountinueDatetime'];
rescheduleDatetime = json['RescheduleDatetime'];
status = json['Status'];
statusDescription = json['StatusDescription'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedOn = json['EditedOn'];
strength = json['Strength'];
pHRItemDescription = json['PHRItemDescription'];
pHRItemDescriptionN = json['PHRItemDescriptionN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['AdmissionNo'] = this.admissionNo;
data['PatientID'] = this.patientID;
data['OrderNo'] = this.orderNo;
data['PrescriptionNo'] = this.prescriptionNo;
data['LineItemNo'] = this.lineItemNo;
data['PrescriptionDatetime'] = this.prescriptionDatetime;
data['ItemID'] = this.itemID;
data['DirectionID'] = this.directionID;
data['RefillID'] = this.refillID;
data['Dose'] = this.dose;
data['UnitofMeasurement'] = this.unitofMeasurement;
data['StartDatetime'] = this.startDatetime;
data['StopDatetime'] = this.stopDatetime;
data['NoOfDoses'] = this.noOfDoses;
data['RouteId'] = this.routeId;
data['Comments'] = this.comments;
data['ReviewedPharmacist'] = this.reviewedPharmacist;
data['ReviewedPharmacistDatetime'] = this.reviewedPharmacistDatetime;
data['DiscountinueDatetime'] = this.discountinueDatetime;
data['RescheduleDatetime'] = this.rescheduleDatetime;
data['Status'] = this.status;
data['StatusDescription'] = this.statusDescription;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedOn'] = this.editedOn;
data['Strength'] = this.strength;
data['PHRItemDescription'] = this.pHRItemDescription;
data['PHRItemDescriptionN'] = this.pHRItemDescriptionN;
return data;
}
}

@ -0,0 +1,60 @@
class GetMedicationForInPatientRequestModel {
bool isDentalAllowedBackend;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int deviceTypeID;
String tokenID;
int patientID;
int admissionNo;
String sessionID;
int projectID;
GetMedicationForInPatientRequestModel(
{this.isDentalAllowedBackend,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.deviceTypeID,
this.tokenID,
this.patientID,
this.admissionNo,
this.sessionID,
this.projectID});
GetMedicationForInPatientRequestModel.fromJson(Map<String, dynamic> json) {
isDentalAllowedBackend = json['isDentalAllowedBackend'];
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
deviceTypeID = json['DeviceTypeID'];
tokenID = json['TokenID'];
patientID = json['PatientID'];
admissionNo = json['AdmissionNo'];
sessionID = json['SessionID'];
projectID = json['ProjectID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['DeviceTypeID'] = this.deviceTypeID;
data['TokenID'] = this.tokenID;
data['PatientID'] = this.patientID;
data['AdmissionNo'] = this.admissionNo;
data['SessionID'] = this.sessionID;
data['ProjectID'] = this.projectID;
return data;
}
}

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/in_patient_prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
@ -16,11 +18,13 @@ import '../../base/base_service.dart';
class PrescriptionsService extends BaseService {
List<Prescriptions> prescriptionsList = List();
List<GetMedicationForInPatientModel> medicationForInPatient = List();
List<PrescriptionsOrder> prescriptionsOrderList = List();
List<PrescriotionInPatient> prescriptionInPatientList = List();
InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel =
InPatientPrescriptionRequestModel();
InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel();
GetMedicationForInPatientRequestModel _getMedicationForInPatientRequestModel =
GetMedicationForInPatientRequestModel();
Future getPrescriptionInPatient({int mrn, String adn}) async {
_inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel(
@ -30,12 +34,10 @@ class PrescriptionsService extends BaseService {
hasError = false;
prescriptionInPatientList.clear();
await baseAppClient.post(GET_PRESCRIPTION_IN_PATIENT,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_PRESCRIPTION_IN_PATIENT, onSuccess: (dynamic response, int statusCode) {
prescriptionsList.clear();
response['List_PrescriptionReportForInPatient'].forEach((prescriptions) {
prescriptionInPatientList
.add(PrescriotionInPatient.fromJson(prescriptions));
prescriptionInPatientList.add(PrescriotionInPatient.fromJson(prescriptions));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -47,8 +49,7 @@ class PrescriptionsService extends BaseService {
hasError = false;
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient, onSuccess: (dynamic response, int statusCode) {
prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((prescriptions) {
prescriptionsList.add(Prescriptions.fromJson(prescriptions));
@ -60,13 +61,10 @@ class PrescriptionsService extends BaseService {
}
RequestPrescriptionReport _requestPrescriptionReport =
RequestPrescriptionReport(
appointmentNo: 0, isDentalAllowedBackend: false);
RequestPrescriptionReport(appointmentNo: 0, isDentalAllowedBackend: false);
List<PrescriptionReport> prescriptionReportList = List();
Future getPrescriptionReport(
{Prescriptions prescriptions,
@required PatiantInformtion patient}) async {
Future getPrescriptionReport({Prescriptions prescriptions, @required PatiantInformtion patient}) async {
hasError = false;
_requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo;
_requestPrescriptionReport.projectID = prescriptions.projectID;
@ -76,23 +74,18 @@ class PrescriptionsService extends BaseService {
_requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo;
await baseAppClient.postPatient(
prescriptions.isInOutPatient
? GET_PRESCRIPTION_REPORT_ENH
: GET_PRESCRIPTION_REPORT_NEW,
prescriptions.isInOutPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW,
patient: patient, onSuccess: (dynamic response, int statusCode) {
prescriptionReportList.clear();
prescriptionReportEnhList.clear();
if (prescriptions.isInOutPatient) {
response['ListPRM'].forEach((prescriptions) {
prescriptionReportList
.add(PrescriptionReport.fromJson(prescriptions));
prescriptionReportEnhList
.add(PrescriptionReportEnh.fromJson(prescriptions));
prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions));
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions));
});
} else {
response['INP_GetPrescriptionReport_List'].forEach((prescriptions) {
prescriptionReportList
.add(PrescriptionReport.fromJson(prescriptions));
prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions));
});
}
}, onFailure: (String error, int statusCode) {
@ -101,8 +94,7 @@ class PrescriptionsService extends BaseService {
}, body: _requestPrescriptionReport.toJson());
}
RequestGetListPharmacyForPrescriptions
requestGetListPharmacyForPrescriptions =
RequestGetListPharmacyForPrescriptions requestGetListPharmacyForPrescriptions =
RequestGetListPharmacyForPrescriptions(
latitude: 0,
longitude: 0,
@ -110,16 +102,13 @@ class PrescriptionsService extends BaseService {
);
List<PharmacyPrescriptions> pharmacyPrescriptionsList = List();
Future getListPharmacyForPrescriptions(
{int itemId, @required PatiantInformtion patient}) async {
Future getListPharmacyForPrescriptions({int itemId, @required PatiantInformtion patient}) async {
hasError = false;
requestGetListPharmacyForPrescriptions.itemID = itemId;
await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient, onSuccess: (dynamic response, int statusCode) {
pharmacyPrescriptionsList.clear();
response['PharmList'].forEach((prescriptions) {
pharmacyPrescriptionsList
.add(PharmacyPrescriptions.fromJson(prescriptions));
pharmacyPrescriptionsList.add(PharmacyPrescriptions.fromJson(prescriptions));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -127,16 +116,13 @@ class PrescriptionsService extends BaseService {
}, body: requestGetListPharmacyForPrescriptions.toJson());
}
RequestPrescriptionReportEnh _requestPrescriptionReportEnh =
RequestPrescriptionReportEnh(
RequestPrescriptionReportEnh _requestPrescriptionReportEnh = RequestPrescriptionReportEnh(
isDentalAllowedBackend: false,
);
List<PrescriptionReportEnh> prescriptionReportEnhList = List();
Future getPrescriptionReportEnh(
{PrescriptionsOrder prescriptionsOrder,
@required PatiantInformtion patient}) async {
Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async {
///This logic copy from the old app from class [order-history.component.ts] in line 45
bool isInPatient = false;
prescriptionsList.forEach((element) {
@ -151,8 +137,7 @@ class PrescriptionsService extends BaseService {
isInPatient = element.isInOutPatient;
}
} else {
if (int.parse(prescriptionsOrder.appointmentNo) ==
element.appointmentNo) {
if (int.parse(prescriptionsOrder.appointmentNo) == element.appointmentNo) {
_requestPrescriptionReportEnh.appointmentNo = element.appointmentNo;
_requestPrescriptionReportEnh.clinicID = element.clinicID;
_requestPrescriptionReportEnh.projectID = element.projectID;
@ -168,20 +153,17 @@ class PrescriptionsService extends BaseService {
hasError = false;
await baseAppClient.postPatient(
isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW,
await baseAppClient.postPatient(isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW,
patient: patient, onSuccess: (dynamic response, int statusCode) {
prescriptionReportEnhList.clear();
if (isInPatient) {
response['ListPRM'].forEach((prescriptions) {
prescriptionReportEnhList
.add(PrescriptionReportEnh.fromJson(prescriptions));
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions));
});
} else {
response['INP_GetPrescriptionReport_List'].forEach((prescriptions) {
PrescriptionReportEnh reportEnh =
PrescriptionReportEnh.fromJson(prescriptions);
PrescriptionReportEnh reportEnh = PrescriptionReportEnh.fromJson(prescriptions);
reportEnh.itemDescription = prescriptions['ItemDescriptionN'];
prescriptionReportEnhList.add(reportEnh);
});
@ -195,17 +177,34 @@ class PrescriptionsService extends BaseService {
Future getPrescriptionsOrders() async {
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, onSuccess: (dynamic response, int statusCode) {
prescriptionsOrderList.clear();
response['PatientER_GetPatientAllPresOrdersList']
.forEach((prescriptionsOrder) {
prescriptionsOrderList
.add(PrescriptionsOrder.fromJson(prescriptionsOrder));
response['PatientER_GetPatientAllPresOrdersList'].forEach((prescriptionsOrder) {
prescriptionsOrderList.add(PrescriptionsOrder.fromJson(prescriptionsOrder));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getMedicationForInPatient(PatiantInformtion patient) async {
hasError = false;
_getMedicationForInPatientRequestModel = GetMedicationForInPatientRequestModel(
isDentalAllowedBackend: false,
admissionNo: int.parse(patient.admissionNo),
tokenID: "@dm!n",
projectID: 15,
);
await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, patient: patient,
onSuccess: (dynamic response, int statusCode) {
medicationForInPatient.clear();
response['List_GetMedicationForInpatient'].forEach((prescriptions) {
medicationForInPatient.add(GetMedicationForInPatientModel.fromJson(prescriptions));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _getMedicationForInPatientRequestModel.toJson());
}
}

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
@ -26,11 +27,10 @@ class PrescriptionViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic;
bool hasError = false;
PrescriptionService _prescriptionService = locator<PrescriptionService>();
List<GetMedicationResponseModel> get allMedicationList =>
_prescriptionService.allMedicationList;
List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList;
List<GetMedicationForInPatientModel> get medicationForInPatient => _prescriptionsService.medicationForInPatient;
List<PrescriptionModel> get prescriptionList =>
_prescriptionService.prescriptionList;
List<PrescriptionModel> get prescriptionList => _prescriptionService.prescriptionList;
List<dynamic> get drugsList => _prescriptionService.doctorsList;
//List<dynamic> get allMedicationList => _prescriptionService.allMedicationList;
List<dynamic> get drugToDrug => _prescriptionService.drugToDrugList;
@ -41,30 +41,22 @@ class PrescriptionViewModel extends BaseViewModel {
List<PrescriptionsList> _prescriptionsOrderListClinic = List();
List<PrescriptionsList> _prescriptionsOrderListHospital = List();
List<PrescriptionReport> get prescriptionReportList =>
_prescriptionsService.prescriptionReportList;
List<PrescriptionReport> get prescriptionReportList => _prescriptionsService.prescriptionReportList;
List<Prescriptions> get prescriptionsList =>
_prescriptionsService.prescriptionsList;
List<Prescriptions> get prescriptionsList => _prescriptionsService.prescriptionsList;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList =>
_prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionReportEnh> get prescriptionReportEnhList =>
_prescriptionsService.prescriptionReportEnhList;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList;
List<PrescriptionsList> get prescriptionsOrderList =>
filterType == FilterType.Clinic
? _prescriptionsOrderListClinic
: _prescriptionsOrderListHospital;
filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital;
List<PrescriotionInPatient> get inPatientPrescription =>
_prescriptionsService.prescriptionInPatientList;
List<PrescriotionInPatient> get inPatientPrescription => _prescriptionsService.prescriptionInPatientList;
getPrescriptionsInPatient(PatiantInformtion patient) async {
setState(ViewState.Busy);
error = "";
await _prescriptionsService.getPrescriptionInPatient(
mrn: patient.patientId, adn: patient.admissionNo);
await _prescriptionsService.getPrescriptionInPatient(mrn: patient.patientId, adn: patient.admissionNo);
if (_prescriptionsService.hasError) {
error = "No Prescription Found";
setState(ViewState.Error);
@ -100,8 +92,7 @@ class PrescriptionViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postPrescription(
PostPrescriptionReqModel postProcedureReqModel, int mrn) async {
Future postPrescription(PostPrescriptionReqModel postProcedureReqModel, int mrn) async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
@ -125,8 +116,7 @@ class PrescriptionViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future updatePrescription(
PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async {
Future updatePrescription(PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
@ -152,16 +142,11 @@ class PrescriptionViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getDrugToDrug(
VitalSignData vital,
List<GetAssessmentResModel> lstAssessments,
List<GetAllergiesResModel> allergy,
PatiantInformtion patient,
List<dynamic> prescription) async {
Future getDrugToDrug(VitalSignData vital, List<GetAssessmentResModel> lstAssessments,
List<GetAllergiesResModel> allergy, PatiantInformtion patient, List<dynamic> prescription) async {
hasError = false;
setState(ViewState.Busy);
await _prescriptionService.getDrugToDrug(
vital, lstAssessments, allergy, patient, prescription);
await _prescriptionService.getDrugToDrug(vital, lstAssessments, allergy, patient, prescription);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
@ -174,12 +159,9 @@ class PrescriptionViewModel extends BaseViewModel {
notifyListeners();
}
getPrescriptionReport(
{Prescriptions prescriptions,
@required PatiantInformtion patient}) async {
getPrescriptionReport({Prescriptions prescriptions, @required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReport(
prescriptions: prescriptions, patient: patient);
await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);
@ -188,11 +170,9 @@ class PrescriptionViewModel extends BaseViewModel {
}
}
getListPharmacyForPrescriptions(
{int itemId, @required PatiantInformtion patient}) async {
getListPharmacyForPrescriptions({int itemId, @required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionsService.getListPharmacyForPrescriptions(
itemId: itemId, patient: patient);
await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
@ -204,48 +184,39 @@ class PrescriptionViewModel extends BaseViewModel {
void _filterList() {
_prescriptionsService.prescriptionsList.forEach((element) {
/// PrescriptionsList list sort clinic
List<PrescriptionsList> prescriptionsByClinic =
_prescriptionsOrderListClinic
.where((elementClinic) =>
elementClinic.filterName == element.clinicDescription)
.toList();
List<PrescriptionsList> prescriptionsByClinic = _prescriptionsOrderListClinic
.where((elementClinic) => elementClinic.filterName == element.clinicDescription)
.toList();
if (prescriptionsByClinic.length != 0) {
_prescriptionsOrderListClinic[
_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])]
_prescriptionsOrderListClinic[_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])]
.prescriptionsList
.add(element);
} else {
_prescriptionsOrderListClinic.add(PrescriptionsList(
filterName: element.clinicDescription, prescriptions: element));
_prescriptionsOrderListClinic
.add(PrescriptionsList(filterName: element.clinicDescription, prescriptions: element));
}
/// PrescriptionsList list sort via hospital
List<PrescriptionsList> prescriptionsByHospital =
_prescriptionsOrderListHospital
.where(
(elementClinic) => elementClinic.filterName == element.name,
)
.toList();
List<PrescriptionsList> prescriptionsByHospital = _prescriptionsOrderListHospital
.where(
(elementClinic) => elementClinic.filterName == element.name,
)
.toList();
if (prescriptionsByHospital.length != 0) {
_prescriptionsOrderListHospital[_prescriptionsOrderListHospital
.indexOf(prescriptionsByHospital[0])]
_prescriptionsOrderListHospital[_prescriptionsOrderListHospital.indexOf(prescriptionsByHospital[0])]
.prescriptionsList
.add(element);
} else {
_prescriptionsOrderListHospital.add(PrescriptionsList(
filterName: element.name, prescriptions: element));
_prescriptionsOrderListHospital.add(PrescriptionsList(filterName: element.name, prescriptions: element));
}
});
}
getPrescriptionReportEnh(
{PrescriptionsOrder prescriptionsOrder,
@required PatiantInformtion patient}) async {
getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReportEnh(
prescriptionsOrder: prescriptionsOrder, patient: patient);
await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
@ -280,4 +251,15 @@ class PrescriptionViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
getMedicationForInPatient(PatiantInformtion patient) async {
setState(ViewState.Busy);
await _prescriptionsService.getMedicationForInPatient(patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
}

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
@ -19,21 +20,19 @@ class PrescriptionsViewModel extends BaseViewModel {
List<PrescriptionsList> _prescriptionsOrderListClinic = List();
List<PrescriptionsList> _prescriptionsOrderListHospital = List();
List<PrescriptionReport> get prescriptionReportList =>
_prescriptionsService.prescriptionReportList;
List<PrescriptionReport> get prescriptionReportList => _prescriptionsService.prescriptionReportList;
List<Prescriptions> get prescriptionsList =>
_prescriptionsService.prescriptionsList;
List<Prescriptions> get prescriptionsList => _prescriptionsService.prescriptionsList;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList =>
_prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionReportEnh> get prescriptionReportEnhList =>
_prescriptionsService.prescriptionReportEnhList;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList;
List<PrescriptionsList> get prescriptionsOrderList =>
filterType == FilterType.Clinic
? _prescriptionsOrderListClinic
: _prescriptionsOrderListHospital;
filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital;
List<GetMedicationForInPatientModel> get medicationForInPatient => _prescriptionsService.medicationForInPatient;
List<PrescriptionsList> _medicationForInPatient = List();
getPrescriptions(PatiantInformtion patient) async {
setState(ViewState.Busy);
@ -62,38 +61,32 @@ class PrescriptionsViewModel extends BaseViewModel {
void _filterList() {
_prescriptionsService.prescriptionsList.forEach((element) {
/// PrescriptionsList list sort clinic
List<PrescriptionsList> prescriptionsByClinic =
_prescriptionsOrderListClinic
.where((elementClinic) =>
elementClinic.filterName == element.clinicDescription)
.toList();
List<PrescriptionsList> prescriptionsByClinic = _prescriptionsOrderListClinic
.where((elementClinic) => elementClinic.filterName == element.clinicDescription)
.toList();
if (prescriptionsByClinic.length != 0) {
_prescriptionsOrderListClinic[
_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])]
_prescriptionsOrderListClinic[_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])]
.prescriptionsList
.add(element);
} else {
_prescriptionsOrderListClinic.add(PrescriptionsList(
filterName: element.clinicDescription, prescriptions: element));
_prescriptionsOrderListClinic
.add(PrescriptionsList(filterName: element.clinicDescription, prescriptions: element));
}
/// PrescriptionsList list sort via hospital
List<PrescriptionsList> prescriptionsByHospital =
_prescriptionsOrderListHospital
.where(
(elementClinic) => elementClinic.filterName == element.name,
)
.toList();
List<PrescriptionsList> prescriptionsByHospital = _prescriptionsOrderListHospital
.where(
(elementClinic) => elementClinic.filterName == element.name,
)
.toList();
if (prescriptionsByHospital.length != 0) {
_prescriptionsOrderListHospital[_prescriptionsOrderListHospital
.indexOf(prescriptionsByHospital[0])]
_prescriptionsOrderListHospital[_prescriptionsOrderListHospital.indexOf(prescriptionsByHospital[0])]
.prescriptionsList
.add(element);
} else {
_prescriptionsOrderListHospital.add(PrescriptionsList(
filterName: element.name, prescriptions: element));
_prescriptionsOrderListHospital.add(PrescriptionsList(filterName: element.name, prescriptions: element));
}
});
}
@ -103,12 +96,9 @@ class PrescriptionsViewModel extends BaseViewModel {
notifyListeners();
}
getPrescriptionReport(
{Prescriptions prescriptions,
@required PatiantInformtion patient}) async {
getPrescriptionReport({Prescriptions prescriptions, @required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReport(
prescriptions: prescriptions, patient: patient);
await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);
@ -117,11 +107,9 @@ class PrescriptionsViewModel extends BaseViewModel {
}
}
getListPharmacyForPrescriptions(
{int itemId, @required PatiantInformtion patient}) async {
getListPharmacyForPrescriptions({int itemId, @required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionsService.getListPharmacyForPrescriptions(
itemId: itemId, patient: patient);
await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
@ -130,12 +118,9 @@ class PrescriptionsViewModel extends BaseViewModel {
}
}
getPrescriptionReportEnh(
{PrescriptionsOrder prescriptionsOrder,
@required PatiantInformtion patient}) async {
getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReportEnh(
prescriptionsOrder: prescriptionsOrder, patient: patient);
await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
@ -143,4 +128,14 @@ class PrescriptionsViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
getMedicationForInPatient(PatiantInformtion patient) async {
await _prescriptionsService.getMedicationForInPatient(patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
}

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -13,7 +14,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PrescriptionItemsInPatientPage extends StatelessWidget {
final PrescriotionInPatient prescriptions;
final GetMedicationForInPatientModel prescriptions;
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
@ -36,16 +37,15 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PrescriptionViewModel>(
onModelReady: (model) async {
if (model.inPatientPrescription.length == 0) {
await model.getPrescriptionsInPatient(patient);
if (model.medicationForInPatient.length == 0) {
await model.getMedicationForInPatient(patient);
}
},
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
backgroundColor: Colors.grey[100],
baseViewModel: model,
appBar: PatientProfileAppBar(
patient),
appBar: PatientProfileAppBar(patient),
body: SingleChildScrollView(
child: Container(
child: Column(
@ -64,8 +64,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
Container(
margin: EdgeInsets.only(left: 18, right: 18),
child: AppText(
model.inPatientPrescription[prescriptionIndex]
.itemDescription,
prescriptions.pHRItemDescription,
bold: true,
),
),
@ -92,13 +91,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).direction,
color: Colors.grey,
),
Expanded(
child: AppText(" " +
model
.inPatientPrescription[
prescriptionIndex]
.direction ??
'')),
Expanded(child: AppText(" " + prescriptions.directionID.toString() ?? '')),
],
),
Row(
@ -107,13 +100,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).route,
color: Colors.grey,
),
AppText(" " +
model
.inPatientPrescription[
prescriptionIndex]
.route
.toString() ??
''),
AppText(" " + prescriptions.routeId.toString() ?? ''),
],
),
Row(
@ -122,13 +109,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).refill,
color: Colors.grey,
),
Expanded(
child: AppText(" " +
model
.inPatientPrescription[
prescriptionIndex]
.refillType ??
'')),
Expanded(child: AppText(" " + prescriptions.refillID.toString() ?? '')),
],
),
Row(
@ -169,12 +150,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
'UOM',
color: Colors.grey,
),
AppText(" " +
model
.inPatientPrescription[
prescriptionIndex]
.unitofMeasurementDescription ??
''),
AppText(" " + prescriptions.unitofMeasurement.toString() ?? ''),
],
),
Row(
@ -183,13 +159,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).dailyDoses,
color: Colors.grey,
),
AppText(" " +
model
.inPatientPrescription[
prescriptionIndex]
.dose
.toString() ??
''),
AppText(" " + prescriptions.dose.toString() ?? ''),
],
),
Row(
@ -198,13 +168,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).status,
color: Colors.grey,
),
AppText(" " +
model
.inPatientPrescription[
prescriptionIndex]
.statusDescription
.toString() ??
''),
AppText(" " + prescriptions.statusDescription.toString() ?? ''),
],
),
Row(
@ -213,12 +177,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).processed,
color: Colors.grey,
),
AppText(" " +
model
.inPatientPrescription[
prescriptionIndex]
.processedBy ??
''),
// AppText(" " + prescriptions.editedBy.toString() ?? ''),
],
),
Row(
@ -227,23 +186,13 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).dailyDoses,
color: Colors.grey,
),
AppText(" " +
model
.inPatientPrescription[
prescriptionIndex]
.dose
.toString() ??
''),
AppText(" " + prescriptions.dose.toString() ?? ''),
],
),
SizedBox(
height: 12,
),
AppText(model
.inPatientPrescription[
prescriptionIndex]
.comments ??
''),
AppText(prescriptions.comments ?? ''),
],
),
)

@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-
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/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
@ -28,208 +29,191 @@ class PrescriptionsPage extends StatelessWidget {
bool isFromLiveCare = routeArgs['isFromLiveCare'];
bool isSelectInpatient = routeArgs['isSelectInpatient'];
return BaseView<PrescriptionViewModel>(
onModelReady: (model) => isSelectInpatient
? model.getPrescriptionsInPatient(patient)
: model.getPrescriptions(patient, patientType: patientType),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Colors.grey[100],
appBar: PatientProfileAppBar(
patient,
isInpatient: isInpatient,
),
body: patient.admissionNo == null
? FractionallySizedBox(
widthFactor: 1.0,
child: ListView(
physics: BouncingScrollPhysics(),
children: <Widget>[
SizedBox(
height: 12,
),
if (model.prescriptionsList.isNotEmpty &&
patient.patientStatusType != 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).orders,
style: "caption2",
color: Colors.black,
fontSize: 13,
),
AppText(
TranslationBase.of(context).prescriptions,
bold: true,
fontSize: 22,
),
],
),
),
if (patient.patientStatusType != null &&
patient.patientStatusType == 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).orders,
style: "caption2",
color: Colors.black,
fontSize: 13,
),
AppText(
TranslationBase.of(context).prescriptions,
bold: true,
fontSize: 22,
),
],
),
),
if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
BaseAddProcedureTabPage(
patient: patient,
prescriptionModel: model,
procedureType:
ProcedureType.PRESCRIPTION,
),settings: RouteSettings(name: 'AddProcedureTabPage')),
);
},
label: TranslationBase.of(context)
.applyForNewPrescriptionsOrder,
),
...List.generate(
model.prescriptionsList.length,
(index) => InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: PrescriptionItemsPage(
prescriptions:
model.prescriptionsList[index],
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
),
onModelReady: (model) => patient.admissionNo == null
? model.getPrescriptions(patient, patientType: patientType)
: model.getMedicationForInPatient(patient),
builder: (_, model, w) => NetworkBaseView(
baseViewModel: model,
child: AppScaffold(
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Colors.grey[100],
appBar: PatientProfileAppBar(
patient,
isInpatient: isInpatient,
),
body: patient.admissionNo == null
? FractionallySizedBox(
widthFactor: 1.0,
child: ListView(
physics: BouncingScrollPhysics(),
children: <Widget>[
SizedBox(
height: 12,
),
if (model.prescriptionsList.isNotEmpty && patient.patientStatusType != 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).orders,
style: "caption2",
color: Colors.black,
fontSize: 13,
),
),
child: 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,
AppText(
TranslationBase.of(context).prescriptions,
bold: true,
fontSize: 22,
),
],
),
))),
if (model.prescriptionsList.isEmpty &&
patient.patientStatusType != 43)
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
if (patient.patientStatusType != null && patient.patientStatusType == 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context)
.noPrescriptionsFound),
)
],
),
)
],
),
)
: FractionallySizedBox(
widthFactor: 1.0,
child: ListView(
physics: BouncingScrollPhysics(),
children: <Widget>[
// SizedBox(
// height: 12,
// ),
...List.generate(
model.inPatientPrescription.length,
(index) => InkWell(
onTap: () => Navigator.push(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).orders,
style: "caption2",
color: Colors.black,
fontSize: 13,
),
AppText(
TranslationBase.of(context).prescriptions,
bold: true,
fontSize: 22,
),
],
),
),
if ((patient.patientStatusType != null && patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
context,
FadePage(
page: PrescriptionItemsInPatientPage(
prescriptionIndex: index,
prescriptions: model
.inPatientPrescription[index],
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
startOn: AppDateUtils
.getDateTimeFromServerFormat(
model.inPatientPrescription[index]
.startDatetime,
),
stopOn: AppDateUtils
.getDateTimeFromServerFormat(
model.inPatientPrescription[index]
.stopDatetime,
MaterialPageRoute(
builder: (context) => BaseAddProcedureTabPage(
patient: patient,
prescriptionModel: model,
procedureType: ProcedureType.PRESCRIPTION,
),
settings: RouteSettings(name: 'AddProcedureTabPage')),
);
},
label: TranslationBase.of(context).applyForNewPrescriptionsOrder,
),
...List.generate(
model.prescriptionsList.length,
(index) => InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: PrescriptionItemsPage(
prescriptions: model.prescriptionsList[index],
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
),
),
),
child: 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)
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
),
child: InPatientDoctorCard(
doctorName: model.inPatientPrescription[index]
.itemDescription,
profileUrl: 'sss',
branch: 'hamza',
clinic: 'basheer',
isPrescriptions: true,
appointmentDate:
AppDateUtils.getDateTimeFromServerFormat(
model.inPatientPrescription[index]
.prescriptionDatetime,
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context).noPrescriptionsFound),
)
],
),
createdBy: model.inPatientPrescription[index]
.createdByName,
))),
if (model.inPatientPrescription.length == 0)
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context)
.noPrescriptionsFound),
)
],
),
)
: NetworkBaseView(
baseViewModel: model,
child: FractionallySizedBox(
widthFactor: 1.0,
child: ListView(
physics: BouncingScrollPhysics(),
children: <Widget>[
// SizedBox(
// height: 12,
// ),
...List.generate(
model.medicationForInPatient.length,
(index) => InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: PrescriptionItemsInPatientPage(
prescriptionIndex: index,
prescriptions: model.medicationForInPatient[index],
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
startOn: AppDateUtils.getDateTimeFromServerFormat(
model.medicationForInPatient[index].startDatetime,
),
stopOn: AppDateUtils.getDateTimeFromServerFormat(
model.medicationForInPatient[index].stopDatetime,
),
),
),
),
child: InPatientDoctorCard(
doctorName: model.medicationForInPatient[index].pHRItemDescription,
profileUrl: 'sss',
branch: 'hamza',
clinic: 'basheer',
isPrescriptions: true,
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
model.medicationForInPatient[index].prescriptionDatetime,
),
createdBy: model.medicationForInPatient[index].createdBy.toString(),
))),
if (model.medicationForInPatient.length == 0)
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context).noPrescriptionsFound),
)
],
),
)
],
),
)
],
),
)));
),
)),
));
}
}

Loading…
Cancel
Save