From 17f8b05748436cc189d166b0fa9f5a7fefa4ea02 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 24 Mar 2021 13:17:11 +0200 Subject: [PATCH 1/2] Add prescriptions and radiology from the patient app --- ios/Podfile.lock | 4 +- lib/client/base_app_client.dart | 5 +- lib/config/config.dart | 19 +- lib/config/localized_values.dart | 5 + .../model/Prescriptions/Prescriptions.dart | 158 +++++++++++++++ .../Prescriptions/perscription_pharmacy.dart | 108 ++++++++++ .../Prescriptions/prescription_report.dart | 191 ++++++++++++++++++ .../prescription_report_enh.dart | 144 +++++++++++++ .../Prescriptions/prescriptions_order.dart | 134 ++++++++++++ ...t_get_list_pharmacy_for_prescriptions.dart | 60 ++++++ .../request_prescription_report.dart | 88 ++++++++ .../request_prescription_report_enh.dart | 86 ++++++++ lib/core/model/radiology/final_radiology.dart | 190 +++++++++++++++++ .../request_patient_rad_orders_details.dart | 92 +++++++++ .../request_send_rad_report_email.dart | 116 +++++++++++ lib/core/service/prescriptions_service.dart | 182 +++++++++++++++++ lib/core/service/radiology_service.dart | 48 +++++ .../viewModel/prescriptions_view_model.dart | 145 +++++++++++++ lib/core/viewModel/radiology_view_model.dart | 88 ++++++++ lib/locator.dart | 8 + lib/routes.dart | 3 + .../radiology/radiology_details_page.dart | 79 ++++++++ .../radiology/radiology_home_page.dart | 114 +++++++++++ .../prescription_details_page.dart | 168 +++++++++++++++ .../prescription/prescription_items_page.dart | 182 +++++++++++++++++ .../prescription/prescriptions_page.dart | 122 +++++++++++ lib/util/translations_delegate_base.dart | 4 + .../profile/profile_medical_info_widget.dart | 7 + .../profile_medical_info_widget_search.dart | 10 +- 29 files changed, 2549 insertions(+), 11 deletions(-) create mode 100644 lib/core/model/Prescriptions/Prescriptions.dart create mode 100644 lib/core/model/Prescriptions/perscription_pharmacy.dart create mode 100644 lib/core/model/Prescriptions/prescription_report.dart create mode 100644 lib/core/model/Prescriptions/prescription_report_enh.dart create mode 100644 lib/core/model/Prescriptions/prescriptions_order.dart create mode 100644 lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart create mode 100644 lib/core/model/Prescriptions/request_prescription_report.dart create mode 100644 lib/core/model/Prescriptions/request_prescription_report_enh.dart create mode 100644 lib/core/model/radiology/final_radiology.dart create mode 100644 lib/core/model/radiology/request_patient_rad_orders_details.dart create mode 100644 lib/core/model/radiology/request_send_rad_report_email.dart create mode 100644 lib/core/service/prescriptions_service.dart create mode 100644 lib/core/service/radiology_service.dart create mode 100644 lib/core/viewModel/prescriptions_view_model.dart create mode 100644 lib/core/viewModel/radiology_view_model.dart create mode 100644 lib/screens/patients/profile/radiology/radiology_details_page.dart create mode 100644 lib/screens/patients/profile/radiology/radiology_home_page.dart create mode 100644 lib/screens/prescription/prescription_details_page.dart create mode 100644 lib/screens/prescription/prescription_items_page.dart create mode 100644 lib/screens/prescription/prescriptions_page.dart diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 19ebd328..878a1850 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -98,7 +98,7 @@ PODS: - Flutter - path_provider_windows (0.0.1): - Flutter - - "permission_handler (5.0.1+1)": + - "permission_handler (5.1.0+2)": - Flutter - PromisesObjC (1.2.11) - Protobuf (3.13.0) @@ -297,7 +297,7 @@ SPEC CHECKSUMS: OpenTok: fde03ecc5ea31fe0a453242847c4ee1f47e1d735 path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b - permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6 + permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ae355a3f..722aa533 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; import 'dart:io' show Platform; @@ -85,7 +86,7 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); - + String asd= json.encode(body); if (await Helpers.checkConnection()) { final response = await http.post(url, body: json.encode(body), @@ -127,7 +128,7 @@ class BaseAppClient { {Map body, Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, - PatiantInformtion patient, + @required PatiantInformtion patient, bool isExternal = false}) async { String url = BASE_URL + endPoint; diff --git a/lib/config/config.dart b/lib/config/config.dart index 56fe8bff..3a72faba 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -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 = @@ -232,6 +232,21 @@ const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; +const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; +const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; +///Prescriptions +const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; +const GET_PRESCRIPTIONS_ALL_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT_NEW = + 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = + 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +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 4f64d5ee..eb860669 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -782,5 +782,10 @@ const Map> localizedValues = { "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, "procedureName": {"en": "Procedure Name", "ar": "اسم الاجراء"}, "usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"}, + "prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, + "notes": {"en": "Notes", "ar": "ملاحظات"}, + "dailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, + + }; diff --git a/lib/core/model/Prescriptions/Prescriptions.dart b/lib/core/model/Prescriptions/Prescriptions.dart new file mode 100644 index 00000000..78bc9105 --- /dev/null +++ b/lib/core/model/Prescriptions/Prescriptions.dart @@ -0,0 +1,158 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; + +class Prescriptions { + String setupID; + int projectID; + int patientID; + int appointmentNo; + String appointmentDate; + String doctorName; + String clinicDescription; + String name; + int episodeID; + int actualDoctorRate; + int admission; + int clinicID; + String companyName; + String despensedStatus; + DateTime dischargeDate; + int dischargeNo; + int doctorID; + String doctorImageURL; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + bool isLiveCareAppointment; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isInsurancePatient; + String nationalityFlagURL; + int noOfPatientsRate; + String qR; + List speciality; + + Prescriptions( + {this.setupID, + this.projectID, + this.patientID, + this.appointmentNo, + this.appointmentDate, + this.doctorName, + this.clinicDescription, + this.name, + this.episodeID, + this.actualDoctorRate, + this.admission, + this.clinicID, + this.companyName, + this.despensedStatus, + this.dischargeDate, + this.dischargeNo, + this.doctorID, + this.doctorImageURL, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isInsurancePatient, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.qR, + this.speciality,this.isLiveCareAppointment}); + + Prescriptions.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + doctorName = json['DoctorName']; + clinicDescription = json['ClinicDescription']; + name = json['Name']; + episodeID = json['EpisodeID']; + actualDoctorRate = json['ActualDoctorRate']; + admission = json['Admission']; + clinicID = json['ClinicID']; + companyName = json['CompanyName']; + despensedStatus = json['Despensed_Status']; + dischargeDate = DateUtils.convertStringToDate(json['DischargeDate']); + dischargeNo = json['DischargeNo']; + doctorID = json['DoctorID']; + doctorImageURL = json['DoctorImageURL']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + isInsurancePatient = json['IsInsurancePatient']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + qR = json['QR']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + // speciality = json['Speciality'].cast(); + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['DoctorName'] = this.doctorName; + data['ClinicDescription'] = this.clinicDescription; + data['Name'] = this.name; + data['EpisodeID'] = this.episodeID; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['Admission'] = this.admission; + data['ClinicID'] = this.clinicID; + data['CompanyName'] = this.companyName; + data['Despensed_Status'] = this.despensedStatus; + data['DischargeDate'] = this.dischargeDate; + data['DischargeNo'] = this.dischargeNo; + data['DoctorID'] = this.doctorID; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['IsInsurancePatient'] = this.isInsurancePatient; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + return data; + } +} + +class PrescriptionsList { + String filterName = ""; + List prescriptionsList = List(); + + PrescriptionsList({this.filterName, Prescriptions prescriptions}) { + prescriptionsList.add(prescriptions); + } +} diff --git a/lib/core/model/Prescriptions/perscription_pharmacy.dart b/lib/core/model/Prescriptions/perscription_pharmacy.dart new file mode 100644 index 00000000..3adaef7e --- /dev/null +++ b/lib/core/model/Prescriptions/perscription_pharmacy.dart @@ -0,0 +1,108 @@ +class PharmacyPrescriptions { + String expiryDate; + dynamic sellingPrice; + int quantity; + int itemID; + int locationID; + int projectID; + String setupID; + String locationDescription; + Null locationDescriptionN; + String itemDescription; + Null itemDescriptionN; + String alias; + int locationTypeID; + int barcode; + Null companybarcode; + int cityID; + String cityName; + int distanceInKilometers; + String latitude; + int locationType; + String longitude; + String phoneNumber; + String projectImageURL; + Null sortOrder; + + PharmacyPrescriptions( + {this.expiryDate, + this.sellingPrice, + this.quantity, + this.itemID, + this.locationID, + this.projectID, + this.setupID, + this.locationDescription, + this.locationDescriptionN, + this.itemDescription, + this.itemDescriptionN, + this.alias, + this.locationTypeID, + this.barcode, + this.companybarcode, + this.cityID, + this.cityName, + this.distanceInKilometers, + this.latitude, + this.locationType, + this.longitude, + this.phoneNumber, + this.projectImageURL, + this.sortOrder}); + + PharmacyPrescriptions.fromJson(Map json) { + expiryDate = json['ExpiryDate']; + sellingPrice = json['SellingPrice']; + quantity = json['Quantity']; + itemID = json['ItemID']; + locationID = json['LocationID']; + projectID = json['ProjectID']; + setupID = json['SetupID']; + locationDescription = json['LocationDescription']; + locationDescriptionN = json['LocationDescriptionN']; + itemDescription = json['ItemDescription']; + itemDescriptionN = json['ItemDescriptionN']; + alias = json['Alias']; + locationTypeID = json['LocationTypeID']; + barcode = json['Barcode']; + companybarcode = json['Companybarcode']; + cityID = json['CityID']; + cityName = json['CityName']; + distanceInKilometers = json['DistanceInKilometers']; + latitude = json['Latitude']; + locationType = json['LocationType']; + longitude = json['Longitude']; + phoneNumber = json['PhoneNumber']; + projectImageURL = json['ProjectImageURL']; + sortOrder = json['SortOrder']; + } + + Map toJson() { + final Map data = new Map(); + data['ExpiryDate'] = this.expiryDate; + data['SellingPrice'] = this.sellingPrice; + data['Quantity'] = this.quantity; + data['ItemID'] = this.itemID; + data['LocationID'] = this.locationID; + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['LocationDescription'] = this.locationDescription; + data['LocationDescriptionN'] = this.locationDescriptionN; + data['ItemDescription'] = this.itemDescription; + data['ItemDescriptionN'] = this.itemDescriptionN; + data['Alias'] = this.alias; + data['LocationTypeID'] = this.locationTypeID; + data['Barcode'] = this.barcode; + data['Companybarcode'] = this.companybarcode; + data['CityID'] = this.cityID; + data['CityName'] = this.cityName; + data['DistanceInKilometers'] = this.distanceInKilometers; + data['Latitude'] = this.latitude; + data['LocationType'] = this.locationType; + data['Longitude'] = this.longitude; + data['PhoneNumber'] = this.phoneNumber; + data['ProjectImageURL'] = this.projectImageURL; + data['SortOrder'] = this.sortOrder; + return data; + } +} diff --git a/lib/core/model/Prescriptions/prescription_report.dart b/lib/core/model/Prescriptions/prescription_report.dart new file mode 100644 index 00000000..d2427004 --- /dev/null +++ b/lib/core/model/Prescriptions/prescription_report.dart @@ -0,0 +1,191 @@ +class PrescriptionReport { + String address; + int appointmentNo; + String clinic; + String companyName; + int days; + String doctorName; + var doseDailyQuantity; + String frequency; + int frequencyNumber; + String image; + String imageExtension; + String imageSRCUrl; + String imageString; + String imageThumbUrl; + String isCovered; + String itemDescription; + int itemID; + String orderDate; + int patientID; + String patientName; + String phoneOffice1; + String prescriptionQR; + int prescriptionTimes; + String productImage; + String productImageBase64; + String productImageString; + int projectID; + String projectName; + String remarks; + String route; + String sKU; + int scaleOffset; + String startDate; + + String patientAge; + String patientGender; + String phoneOffice; + int doseTimingID; + int frequencyID; + int routeID; + String name; + String itemDescriptionN; + String routeN; + String frequencyN; + + PrescriptionReport({ + this.address, + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.image, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate, + this.patientAge, + this.patientGender, + this.phoneOffice, + this.doseTimingID, + this.frequencyID, + this.routeID, + this.name, + this.itemDescriptionN, + this.routeN, + this.frequencyN, + }); + + PrescriptionReport.fromJson(Map json) { + address = json['Address']; + appointmentNo = json['AppointmentNo']; + clinic = json['Clinic']; + companyName = json['CompanyName']; + days = json['Days']; + doctorName = json['DoctorName']; + doseDailyQuantity = json['DoseDailyQuantity']; + frequency = json['Frequency']; + frequencyNumber = json['FrequencyNumber']; + image = json['Image']; + imageExtension = json['ImageExtension']; + imageSRCUrl = json['ImageSRCUrl']; + imageString = json['ImageString']; + imageThumbUrl = json['ImageThumbUrl']; + isCovered = json['IsCovered']; + itemDescription = json['ItemDescription']; + itemID = json['ItemID']; + orderDate = json['OrderDate']; + patientID = json['PatientID']; + patientName = json['PatientName']; + phoneOffice1 = json['PhoneOffice1']; + prescriptionQR = json['PrescriptionQR']; + prescriptionTimes = json['PrescriptionTimes']; + productImage = json['ProductImage']; + productImageBase64 = json['ProductImageBase64']; + productImageString = json['ProductImageString']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + route = json['Route']; + sKU = json['SKU']; + scaleOffset = json['ScaleOffset']; + startDate = json['StartDate']; + + patientAge = json['patientAge']; + patientGender = json['patientGender']; + phoneOffice = json['phoneOffice']; + doseTimingID = json['doseTimingID']; + frequencyID = json['frequencyID']; + routeID = json['routeID']; + name = json['name']; + itemDescriptionN = json['itemDescriptionN']; + routeN = json['routeN']; + frequencyN = json['frequencyN']; + } + + Map toJson() { + final Map data = new Map(); + + data['Address'] = this.address; + data['AppointmentNo'] = this.appointmentNo; + data['Clinic'] = this.clinic; + data['CompanyName'] = this.companyName; + data['Days'] = this.days; + data['DoctorName'] = this.doctorName; + data['DoseDailyQuantity'] = this.doseDailyQuantity; + data['Frequency'] = this.frequency; + data['FrequencyNumber'] = this.frequencyNumber; + data['Image'] = this.image; + data['ImageExtension'] = this.imageExtension; + data['ImageSRCUrl'] = this.imageSRCUrl; + data['ImageString'] = this.imageString; + data['ImageThumbUrl'] = this.imageThumbUrl; + data['IsCovered'] = this.isCovered; + data['ItemDescription'] = this.itemDescription; + data['ItemID'] = this.itemID; + data['OrderDate'] = this.orderDate; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PhoneOffice1'] = this.phoneOffice1; + data['PrescriptionQR'] = this.prescriptionQR; + data['PrescriptionTimes'] = this.prescriptionTimes; + data['ProductImage'] = this.productImage; + data['ProductImageBase64'] = this.productImageBase64; + data['ProductImageString'] = this.productImageString; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['Route'] = this.route; + data['SKU'] = this.sKU; + data['ScaleOffset'] = this.scaleOffset; + data['StartDate'] = this.startDate; + + data['PatientAge'] = this.patientAge; + data['PatientGender'] = this.patientGender; + data['PhoneOffice'] = this.phoneOffice; + data['DoseTimingID'] = this.doseTimingID; + data['FrequencyID'] = this.frequencyID; + data['RouteID'] = this.routeID; + data['Name'] = this.name; + data['ItemDescriptionN'] = this.itemDescriptionN; + data['RouteN'] = this.routeN; + data['FrequencyN'] = this.frequencyN; + data['hasPlan'] = false; + + return data; + } +} diff --git a/lib/core/model/Prescriptions/prescription_report_enh.dart b/lib/core/model/Prescriptions/prescription_report_enh.dart new file mode 100644 index 00000000..203eaaff --- /dev/null +++ b/lib/core/model/Prescriptions/prescription_report_enh.dart @@ -0,0 +1,144 @@ +class PrescriptionReportEnh { + String address; + int appointmentNo; + String clinic; + Null companyName; + int days; + String doctorName; + int doseDailyQuantity; + String frequency; + int frequencyNumber; + Null image; + Null imageExtension; + String imageSRCUrl; + Null imageString; + String imageThumbUrl; + String isCovered; + String itemDescription; + int itemID; + String orderDate; + int patientID; + String patientName; + String phoneOffice1; + Null prescriptionQR; + int prescriptionTimes; + Null productImage; + Null productImageBase64; + String productImageString; + int projectID; + String projectName; + String remarks; + String route; + String sKU; + int scaleOffset; + String startDate; + + PrescriptionReportEnh( + {this.address, + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.image, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate}); + + PrescriptionReportEnh.fromJson(Map json) { + address = json['Address']; + appointmentNo = json['AppointmentNo']; + clinic = json['Clinic']; + companyName = json['CompanyName']; + days = json['Days']; + doctorName = json['DoctorName']; + doseDailyQuantity = json['DoseDailyQuantity']; + frequency = json['Frequency']; + frequencyNumber = json['FrequencyNumber']; + image = json['Image']; + imageExtension = json['ImageExtension']; + imageSRCUrl = json['ImageSRCUrl']; + imageString = json['ImageString']; + imageThumbUrl = json['ImageThumbUrl']; + isCovered = json['IsCovered']; + itemDescription = json['ItemDescription']; + itemID = json['ItemID']; + orderDate = json['OrderDate']; + patientID = json['PatientID']; + patientName = json['PatientName']; + phoneOffice1 = json['PhoneOffice1']; + prescriptionQR = json['PrescriptionQR']; + prescriptionTimes = json['PrescriptionTimes']; + productImage = json['ProductImage']; + productImageBase64 = json['ProductImageBase64']; + productImageString = json['ProductImageString']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + route = json['Route']; + sKU = json['SKU']; + scaleOffset = json['ScaleOffset']; + startDate = json['StartDate']; + } + + Map toJson() { + final Map data = new Map(); + data['Address'] = this.address; + data['AppointmentNo'] = this.appointmentNo; + data['Clinic'] = this.clinic; + data['CompanyName'] = this.companyName; + data['Days'] = this.days; + data['DoctorName'] = this.doctorName; + data['DoseDailyQuantity'] = this.doseDailyQuantity; + data['Frequency'] = this.frequency; + data['FrequencyNumber'] = this.frequencyNumber; + data['Image'] = this.image; + data['ImageExtension'] = this.imageExtension; + data['ImageSRCUrl'] = this.imageSRCUrl; + data['ImageString'] = this.imageString; + data['ImageThumbUrl'] = this.imageThumbUrl; + data['IsCovered'] = this.isCovered; + data['ItemDescription'] = this.itemDescription; + data['ItemID'] = this.itemID; + data['OrderDate'] = this.orderDate; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PhoneOffice1'] = this.phoneOffice1; + data['PrescriptionQR'] = this.prescriptionQR; + data['PrescriptionTimes'] = this.prescriptionTimes; + data['ProductImage'] = this.productImage; + data['ProductImageBase64'] = this.productImageBase64; + data['ProductImageString'] = this.productImageString; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['Route'] = this.route; + data['SKU'] = this.sKU; + data['ScaleOffset'] = this.scaleOffset; + data['StartDate'] = this.startDate; + return data; + } +} diff --git a/lib/core/model/Prescriptions/prescriptions_order.dart b/lib/core/model/Prescriptions/prescriptions_order.dart new file mode 100644 index 00000000..4f77f7ec --- /dev/null +++ b/lib/core/model/Prescriptions/prescriptions_order.dart @@ -0,0 +1,134 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; + +class PrescriptionsOrder { + int iD; + dynamic patientID; + bool patientOutSA; + bool isOutPatient; + int projectID; + int nearestProjectID; + double longitude; + double latitude; + dynamic appointmentNo; + dynamic dischargeID; + int lineItemNo; + int status; + dynamic description; + dynamic descriptionN; + DateTime createdOn; + int serviceID; + int createdBy; + DateTime editedOn; + int editedBy; + int channel; + dynamic clientRequestID; + bool returnedToQueue; + dynamic pickupDateTime; + dynamic pickupLocationName; + dynamic dropoffLocationName; + int realRRTHaveTransactions; + dynamic nearestProjectDescription; + dynamic nearestProjectDescriptionN; + dynamic projectDescription; + dynamic projectDescriptionN; + + PrescriptionsOrder( + {this.iD, + this.patientID, + this.patientOutSA, + this.isOutPatient, + this.projectID, + this.nearestProjectID, + this.longitude, + this.latitude, + this.appointmentNo, + this.dischargeID, + this.lineItemNo, + this.status, + this.description, + this.descriptionN, + this.createdOn, + this.serviceID, + this.createdBy, + this.editedOn, + this.editedBy, + this.channel, + this.clientRequestID, + this.returnedToQueue, + this.pickupDateTime, + this.pickupLocationName, + this.dropoffLocationName, + this.realRRTHaveTransactions, + this.nearestProjectDescription, + this.nearestProjectDescriptionN, + this.projectDescription, + this.projectDescriptionN}); + + PrescriptionsOrder.fromJson(Map json) { + iD = json['ID']; + patientID = json['PatientID']; + patientOutSA = json['PatientOutSA']; + isOutPatient = json['IsOutPatient']; + projectID = json['ProjectID']; + nearestProjectID = json['NearestProjectID']; + longitude = json['Longitude']; + latitude = json['Latitude']; + appointmentNo = json['AppointmentNo']; + dischargeID = json['DischargeID']; + lineItemNo = json['LineItemNo']; + status = json['Status']; + description = json['Description']; + descriptionN = json['DescriptionN']; + createdOn = DateUtils.convertStringToDate(json['CreatedOn']); + serviceID = json['ServiceID']; + createdBy = json['CreatedBy']; + editedOn = DateUtils.convertStringToDate(json['EditedOn']); + editedBy = json['EditedBy']; + channel = json['Channel']; + clientRequestID = json['ClientRequestID']; + returnedToQueue = json['ReturnedToQueue']; + pickupDateTime = json['PickupDateTime']; + pickupLocationName = json['PickupLocationName']; + dropoffLocationName = json['DropoffLocationName']; + realRRTHaveTransactions = json['RealRRT_HaveTransactions']; + nearestProjectDescription = json['NearestProjectDescription']; + nearestProjectDescriptionN = json['NearestProjectDescriptionN']; + projectDescription = json['ProjectDescription']; + projectDescriptionN = json['ProjectDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PatientID'] = this.patientID; + data['PatientOutSA'] = this.patientOutSA; + data['IsOutPatient'] = this.isOutPatient; + data['ProjectID'] = this.projectID; + data['NearestProjectID'] = this.nearestProjectID; + data['Longitude'] = this.longitude; + data['Latitude'] = this.latitude; + data['AppointmentNo'] = this.appointmentNo; + data['DischargeID'] = this.dischargeID; + data['LineItemNo'] = this.lineItemNo; + data['Status'] = this.status; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['CreatedOn'] = this.createdOn; + data['ServiceID'] = this.serviceID; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; + data['Channel'] = this.channel; + data['ClientRequestID'] = this.clientRequestID; + data['ReturnedToQueue'] = this.returnedToQueue; + data['PickupDateTime'] = this.pickupDateTime; + data['PickupLocationName'] = this.pickupLocationName; + data['DropoffLocationName'] = this.dropoffLocationName; + data['RealRRT_HaveTransactions'] = this.realRRTHaveTransactions; + data['NearestProjectDescription'] = this.nearestProjectDescription; + data['NearestProjectDescriptionN'] = this.nearestProjectDescriptionN; + data['ProjectDescription'] = this.projectDescription; + data['ProjectDescriptionN'] = this.projectDescriptionN; + return data; + } +} diff --git a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart new file mode 100644 index 00000000..739bb838 --- /dev/null +++ b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart @@ -0,0 +1,60 @@ +class RequestGetListPharmacyForPrescriptions { + int latitude; + int longitude; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int itemID; + + RequestGetListPharmacyForPrescriptions( + {this.latitude, + this.longitude, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.itemID}); + + RequestGetListPharmacyForPrescriptions.fromJson(Map json) { + latitude = json['Latitude']; + longitude = json['Longitude']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + itemID = json['ItemID']; + } + + Map toJson() { + final Map data = new Map(); + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['ItemID'] = this.itemID; + return data; + } +} diff --git a/lib/core/model/Prescriptions/request_prescription_report.dart b/lib/core/model/Prescriptions/request_prescription_report.dart new file mode 100644 index 00000000..c8323740 --- /dev/null +++ b/lib/core/model/Prescriptions/request_prescription_report.dart @@ -0,0 +1,88 @@ +class RequestPrescriptionReport { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int appointmentNo; + String setupID; + int episodeID; + int clinicID; + int projectID; + int dischargeNo; + + RequestPrescriptionReport( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID, + this.dischargeNo}); + + RequestPrescriptionReport.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + appointmentNo = json['AppointmentNo']; + setupID = json['SetupID']; + episodeID = json['EpisodeID']; + clinicID = json['ClinicID']; + projectID = json['ProjectID']; + dischargeNo = json['DischargeNo']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['AppointmentNo'] = this.appointmentNo; + data['SetupID'] = this.setupID; + data['EpisodeID'] = this.episodeID; + data['ClinicID'] = this.clinicID; + data['ProjectID'] = this.projectID; + data['DischargeNo'] = this.dischargeNo; + return data; + } +} diff --git a/lib/core/model/Prescriptions/request_prescription_report_enh.dart b/lib/core/model/Prescriptions/request_prescription_report_enh.dart new file mode 100644 index 00000000..4905fc2a --- /dev/null +++ b/lib/core/model/Prescriptions/request_prescription_report_enh.dart @@ -0,0 +1,86 @@ +class RequestPrescriptionReportEnh { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int appointmentNo; + String setupID; + int dischargeNo; + int episodeID; + int clinicID; + int projectID; + + RequestPrescriptionReportEnh( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID,this.dischargeNo}); + + RequestPrescriptionReportEnh.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + appointmentNo = json['AppointmentNo']; + setupID = json['SetupID']; + episodeID = json['EpisodeID']; + clinicID = json['ClinicID']; + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['AppointmentNo'] = this.appointmentNo; + data['SetupID'] = this.setupID; + data['EpisodeID'] = this.episodeID; + data['ClinicID'] = this.clinicID; + data['ProjectID'] = this.projectID; + data['DischargeNo'] = this.dischargeNo; + return data; + } +} diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart new file mode 100644 index 00000000..66433091 --- /dev/null +++ b/lib/core/model/radiology/final_radiology.dart @@ -0,0 +1,190 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; + +class FinalRadiology { + String setupID; + int projectID; + Null patientID; + int invoiceLineItemNo; + int invoiceNo; + int doctorID; + int clinicID; + DateTime orderDate; + String reportData; + String imageURL; + String procedureID; + int appointmentNo; + Null dIAPacsURL; + bool isRead; + String readOn; + var admissionNo; + bool isInOutPatient; + int actualDoctorRate; + String clinicDescription; + String dIAPACSURL; + String doctorImageURL; + String doctorName; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isExecludeDoctor; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + String nationalityFlagURL; + int noOfPatientsRate; + int orderNo; + String projectName; + String qR; + String reportDataHTML; + String reportDataTextString; + List speciality; + bool isCVI; + bool isRadMedicalReport; + bool isLiveCareAppointment; + + FinalRadiology( + {this.setupID, + this.projectID, + this.patientID, + this.invoiceLineItemNo, + this.invoiceNo, + this.doctorID, + this.clinicID, + this.orderDate, + this.reportData, + this.imageURL, + this.procedureID, + this.appointmentNo, + this.dIAPacsURL, + this.isRead, + this.readOn, + this.admissionNo, + this.isInOutPatient, + this.actualDoctorRate, + this.clinicDescription, + this.dIAPACSURL, + this.doctorImageURL, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isExecludeDoctor, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.orderNo, + this.projectName, + this.qR, + this.reportDataHTML, + this.reportDataTextString, + this.speciality, + this.isCVI, + this.isRadMedicalReport,this.isLiveCareAppointment}); + + FinalRadiology.fromJson(Map json) { + try { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + invoiceLineItemNo = json['InvoiceLineItemNo']; + invoiceNo = json['InvoiceNo']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + orderDate = DateUtils.convertStringToDate(json['OrderDate']); + reportData = json['ReportData']; + imageURL = json['ImageURL']; + procedureID = json['ProcedureID']; + appointmentNo = json['AppointmentNo']; + dIAPacsURL = json['DIAPacsURL']; + isRead = json['IsRead']; + readOn = json['ReadOn']; + admissionNo = json['AdmissionNo']; + isInOutPatient = json['IsInOutPatient']; + actualDoctorRate = json['ActualDoctorRate']; + clinicDescription = json['ClinicDescription']; + dIAPACSURL = json['DIA_PACS_URL']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + orderNo = json['OrderNo']; + projectName = json['ProjectName']; + qR = json['QR']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + reportDataHTML = json['ReportDataHTML']; + reportDataTextString = json['ReportDataTextString']; + // speciality = json['Speciality'].cast(); + isCVI = json['isCVI']; + isRadMedicalReport = json['isRadMedicalReport']; + + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['InvoiceLineItemNo'] = this.invoiceLineItemNo; + data['InvoiceNo'] = this.invoiceNo; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['OrderDate'] = this.orderDate; + data['ReportData'] = this.reportData; + data['ImageURL'] = this.imageURL; + data['ProcedureID'] = this.procedureID; + data['AppointmentNo'] = this.appointmentNo; + data['DIAPacsURL'] = this.dIAPacsURL; + data['IsRead'] = this.isRead; + data['ReadOn'] = this.readOn; + data['AdmissionNo'] = this.admissionNo; + data['IsInOutPatient'] = this.isInOutPatient; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicDescription'] = this.clinicDescription; + data['DIA_PACS_URL'] = this.dIAPACSURL; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OrderNo'] = this.orderNo; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['ReportDataHTML'] = this.reportDataHTML; + data['ReportDataTextString'] = this.reportDataTextString; + data['Speciality'] = this.speciality; + data['isCVI'] = this.isCVI; + data['isRadMedicalReport'] = this.isRadMedicalReport; + return data; + } +} + +class FinalRadiologyList { + String filterName = ""; + List finalRadiologyList = List(); + + FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) { + finalRadiologyList.add(finalRadiology); + } +} diff --git a/lib/core/model/radiology/request_patient_rad_orders_details.dart b/lib/core/model/radiology/request_patient_rad_orders_details.dart new file mode 100644 index 00000000..9e3458d5 --- /dev/null +++ b/lib/core/model/radiology/request_patient_rad_orders_details.dart @@ -0,0 +1,92 @@ +class RequestPatientRadOrdersDetails { + int projectID; + int orderNo; + int invoiceNo; + String setupID; + String procedureID; + bool isMedicalReport; + bool isCVI; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + RequestPatientRadOrdersDetails( + {this.projectID, + this.orderNo, + this.invoiceNo, + this.setupID, + this.procedureID, + this.isMedicalReport, + this.isCVI, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + RequestPatientRadOrdersDetails.fromJson(Map json) { + projectID = json['ProjectID']; + orderNo = json['OrderNo']; + invoiceNo = json['InvoiceNo']; + setupID = json['SetupID']; + procedureID = json['ProcedureID']; + isMedicalReport = json['IsMedicalReport']; + isCVI = json['isCVI']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['OrderNo'] = this.orderNo; + data['InvoiceNo'] = this.invoiceNo; + data['SetupID'] = this.setupID; + data['ProcedureID'] = this.procedureID; + data['IsMedicalReport'] = this.isMedicalReport; + data['isCVI'] = this.isCVI; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart new file mode 100644 index 00000000..6d68653d --- /dev/null +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -0,0 +1,116 @@ +class RequestSendRadReportEmail { + int channel; + String clinicName; + String dateofBirth; + int deviceTypeID; + String doctorName; + String generalid; + int invoiceNo; + String iPAdress; + bool isDentalAllowedBackend; + int languageID; + String orderDate; + int patientID; + String patientIditificationNum; + String patientMobileNumber; + String patientName; + int patientOutSA; + int patientType; + int patientTypeID; + int projectID; + String projectName; + String radResult; + String sessionID; + String setupID; + String to; + String tokenID; + double versionID; + + RequestSendRadReportEmail( + {this.channel, + this.clinicName, + this.dateofBirth, + this.deviceTypeID, + this.doctorName, + this.generalid, + this.invoiceNo, + this.iPAdress, + this.isDentalAllowedBackend, + this.languageID, + this.orderDate, + this.patientID, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.patientOutSA, + this.patientType, + this.patientTypeID, + this.projectID, + this.projectName, + this.radResult, + this.sessionID, + this.setupID, + this.to, + this.tokenID, + this.versionID}); + + RequestSendRadReportEmail.fromJson(Map json) { + channel = json['Channel']; + clinicName = json['ClinicName']; + dateofBirth = json['DateofBirth']; + deviceTypeID = json['DeviceTypeID']; + doctorName = json['DoctorName']; + generalid = json['generalid']; + invoiceNo = json['InvoiceNo']; + iPAdress = json['IPAdress']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + languageID = json['LanguageID']; + orderDate = json['OrderDate']; + patientID = json['PatientID']; + patientIditificationNum = json['PatientIditificationNum']; + patientMobileNumber = json['PatientMobileNumber']; + patientName = json['PatientName']; + patientOutSA = json['PatientOutSA']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + radResult = json['RadResult']; + sessionID = json['SessionID']; + setupID = json['SetupID']; + to = json['To']; + tokenID = json['TokenID']; + versionID = json['VersionID']; + } + + Map toJson() { + final Map data = new Map(); + data['Channel'] = this.channel; + data['ClinicName'] = this.clinicName; + data['DateofBirth'] = this.dateofBirth; + data['DeviceTypeID'] = this.deviceTypeID; + data['DoctorName'] = this.doctorName; + data['generalid'] = this.generalid; + data['InvoiceNo'] = this.invoiceNo; + data['IPAdress'] = this.iPAdress; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['LanguageID'] = this.languageID; + data['OrderDate'] = this.orderDate; + data['PatientID'] = this.patientID; + data['PatientIditificationNum'] = this.patientIditificationNum; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['PatientName'] = this.patientName; + data['PatientOutSA'] = this.patientOutSA; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['RadResult'] = this.radResult; + data['SessionID'] = this.sessionID; + data['SetupID'] = this.setupID; + data['To'] = this.to; + data['TokenID'] = this.tokenID; + data['VersionID'] = this.versionID; + return data; + } +} diff --git a/lib/core/service/prescriptions_service.dart b/lib/core/service/prescriptions_service.dart new file mode 100644 index 00000000..c720eec9 --- /dev/null +++ b/lib/core/service/prescriptions_service.dart @@ -0,0 +1,182 @@ +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/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'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:flutter/cupertino.dart'; + +import 'base/base_service.dart'; + +class PrescriptionsService extends BaseService { + List prescriptionsList = List(); + List prescriptionsOrderList = List(); + + Future getPrescriptions(PatiantInformtion patient) async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.postPatient(PRESCRIPTIONS,patient: patient, + onSuccess: (dynamic response, int statusCode) { + prescriptionsList.clear(); + response['PatientPrescriptionList'].forEach((prescriptions) { + prescriptionsList.add(Prescriptions.fromJson(prescriptions)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + RequestPrescriptionReport _requestPrescriptionReport = + RequestPrescriptionReport( + appointmentNo: 0, isDentalAllowedBackend: false); + List prescriptionReportList = List(); + + Future getPrescriptionReport({Prescriptions prescriptions,@required PatiantInformtion patient}) async { + hasError = false; + _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; + _requestPrescriptionReport.projectID = prescriptions.projectID; + _requestPrescriptionReport.clinicID = prescriptions.clinicID; + _requestPrescriptionReport.setupID = prescriptions.setupID; + _requestPrescriptionReport.episodeID = prescriptions.episodeID; + _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; + + await baseAppClient.postPatient( + 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)); + }); + } else { + response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { + prescriptionReportList + .add(PrescriptionReport.fromJson(prescriptions)); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPrescriptionReport.toJson()); + } + + RequestGetListPharmacyForPrescriptions + requestGetListPharmacyForPrescriptions = + RequestGetListPharmacyForPrescriptions( + latitude: 0, + longitude: 0, + isDentalAllowedBackend: false, + ); + List pharmacyPrescriptionsList = List(); + + 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) { + pharmacyPrescriptionsList.clear(); + response['PharmList'].forEach((prescriptions) { + pharmacyPrescriptionsList + .add(PharmacyPrescriptions.fromJson(prescriptions)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: requestGetListPharmacyForPrescriptions.toJson()); + } + + RequestPrescriptionReportEnh _requestPrescriptionReportEnh = + RequestPrescriptionReportEnh( + isDentalAllowedBackend: false, + ); + + List prescriptionReportEnhList = List(); + + 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) { + if (prescriptionsOrder.appointmentNo == "0") { + if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { + _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; + _requestPrescriptionReportEnh.clinicID = element.clinicID; + _requestPrescriptionReportEnh.projectID = element.projectID; + _requestPrescriptionReportEnh.episodeID = element.episodeID; + _requestPrescriptionReportEnh.setupID = element.setupID; + _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; + isInPatient = element.isInOutPatient; + } + } else { + if (int.parse(prescriptionsOrder.appointmentNo) == + element.appointmentNo) { + _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; + _requestPrescriptionReportEnh.clinicID = element.clinicID; + _requestPrescriptionReportEnh.projectID = element.projectID; + _requestPrescriptionReportEnh.episodeID = element.episodeID; + _requestPrescriptionReportEnh.setupID = element.setupID; + _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; + isInPatient = element.isInOutPatient; + + ///call inpGetPrescriptionReport + } + } + }); + + hasError = false; + + 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)); + }); + } else { + response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { + PrescriptionReportEnh reportEnh = + PrescriptionReportEnh.fromJson(prescriptions); + reportEnh.itemDescription = prescriptions['ItemDescriptionN']; + prescriptionReportEnhList.add(reportEnh); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPrescriptionReportEnh.toJson()); + } + Future getPrescriptionsOrders() async { + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, + onSuccess: (dynamic response, int statusCode) { + prescriptionsOrderList.clear(); + response['PatientER_GetPatientAllPresOrdersList'] + .forEach((prescriptionsOrder) { + prescriptionsOrderList + .add(PrescriptionsOrder.fromJson(prescriptionsOrder)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/radiology_service.dart b/lib/core/service/radiology_service.dart new file mode 100644 index 00000000..9c1f5a60 --- /dev/null +++ b/lib/core/service/radiology_service.dart @@ -0,0 +1,48 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; +import 'package:doctor_app_flutter/core/model/radiology/request_send_rad_report_email.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:flutter/cupertino.dart'; + +import 'base/base_service.dart'; + +class RadiologyService extends BaseService { + List finalRadiologyList = List(); + String url = ''; + + Future getRadImageURL({int invoiceNo, int lineItem, int projectId,@required PatiantInformtion patient}) async { + hasError = false; + final Map body = new Map(); + body['InvoiceNo'] = invoiceNo; + body['LineIt emNo'] = lineItem; + body['ProjectID'] = projectId; + + await baseAppClient.postPatient(GET_RAD_IMAGE_URL, + patient: patient, + onSuccess: (dynamic response, int statusCode) { + url = response['Data']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getPatientRadOrders(PatiantInformtion patient) async { + hasError = false; + await baseAppClient.postPatient(GET_PATIENT_ORDERS, + patient: patient, + onSuccess: (dynamic response, int statusCode) { + finalRadiologyList.clear(); + response['FinalRadiologyList'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + + + +} diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart new file mode 100644 index 00000000..916a6563 --- /dev/null +++ b/lib/core/viewModel/prescriptions_view_model.dart @@ -0,0 +1,145 @@ +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/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'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; +import 'package:doctor_app_flutter/core/service/prescriptions_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:flutter/material.dart'; + +import '../../locator.dart'; +import 'base_view_model.dart'; + +class PrescriptionsViewModel extends BaseViewModel { + FilterType filterType = FilterType.Clinic; + PrescriptionsService _prescriptionsService = locator(); + + List _prescriptionsOrderListClinic = List(); + List _prescriptionsOrderListHospital = List(); + + + List get prescriptionReportList => + _prescriptionsService.prescriptionReportList; + + List get prescriptionsList => + _prescriptionsService.prescriptionsList; + + List get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList ; + List get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList; + + + List get prescriptionsOrderList => + filterType == FilterType.Clinic + ? _prescriptionsOrderListClinic + : _prescriptionsOrderListHospital; + + getPrescriptions(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _prescriptionsService.getPrescriptions(patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + _filterList(); + await _getPrescriptionsOrders(); + + setState(ViewState.Idle); + } + } + _getPrescriptionsOrders() async { + await _prescriptionsService.getPrescriptionsOrders(); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + void _filterList() { + _prescriptionsService.prescriptionsList.forEach((element) { + /// PrescriptionsList list sort clinic + List prescriptionsByClinic = + _prescriptionsOrderListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (prescriptionsByClinic.length != 0) { + _prescriptionsOrderListClinic[ + _prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] + .prescriptionsList + .add(element); + } else { + _prescriptionsOrderListClinic.add(PrescriptionsList( + filterName: element.clinicDescription, prescriptions: element)); + } + + /// PrescriptionsList list sort via hospital + List prescriptionsByHospital = + _prescriptionsOrderListHospital + .where( + (elementClinic) => elementClinic.filterName == element.name, + ) + .toList(); + + if (prescriptionsByHospital.length != 0) { + _prescriptionsOrderListHospital[_prescriptionsOrderListHospital + .indexOf(prescriptionsByHospital[0])] + .prescriptionsList + .add(element); + } else { + _prescriptionsOrderListHospital.add(PrescriptionsList( + filterName: element.name, prescriptions: element)); + } + }); + } + + + setFilterType(FilterType filterType) { + this.filterType = filterType; + notifyListeners(); + } + + getPrescriptionReport({Prescriptions prescriptions,@required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions,patient: patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + + + getListPharmacyForPrescriptions({int itemId,@required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId,patient: patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + + + getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder,@required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder,patient: patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + + +} diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart new file mode 100644 index 00000000..3a194970 --- /dev/null +++ b/lib/core/viewModel/radiology_view_model.dart @@ -0,0 +1,88 @@ +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/radiology/final_radiology.dart'; +import 'package:doctor_app_flutter/core/service/radiology_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:flutter/foundation.dart'; + +import '../../locator.dart'; +import 'base_view_model.dart'; + +class RadiologyViewModel extends BaseViewModel { + FilterType filterType = FilterType.Clinic; + RadiologyService _radiologyService = locator(); + + List _finalRadiologyListClinic = List(); + List _finalRadiologyListHospital = List(); + + List get finalRadiologyList => + filterType == FilterType.Clinic + ? _finalRadiologyListClinic + : _finalRadiologyListHospital; + + void getPatientRadOrders(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _radiologyService.getPatientRadOrders(patient); + if (_radiologyService.hasError) { + error = _radiologyService.error; + setState(ViewState.Error); + } else { + _radiologyService.finalRadiologyList.forEach((element) { + List finalRadiologyListClinic = + _finalRadiologyListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (finalRadiologyListClinic.length != 0) { + _finalRadiologyListClinic[ + finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] + .finalRadiologyList + .add(element); + } else { + _finalRadiologyListClinic.add(FinalRadiologyList( + filterName: element.clinicDescription, finalRadiology: element)); + } + + // FinalRadiologyList list sort via project + List finalRadiologyListHospital = + _finalRadiologyListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (finalRadiologyListHospital.length != 0) { + _finalRadiologyListHospital[finalRadiologyListHospital + .indexOf(finalRadiologyListHospital[0])] + .finalRadiologyList + .add(element); + } else { + _finalRadiologyListHospital.add(FinalRadiologyList( + filterName: element.projectName, finalRadiology: element)); + } + }); + + setState(ViewState.Idle); + } + } + + String get radImageURL => _radiologyService.url; + + getRadImageURL({int invoiceNo, int lineItem, int projectId,@required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _radiologyService.getRadImageURL( + invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId,patient: patient); + if (_radiologyService.hasError) { + error = _radiologyService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + setFilterType(FilterType filterType) { + this.filterType = filterType; + notifyListeners(); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 68daa9d1..1e688d96 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -25,6 +25,8 @@ import 'core/service/medicine_service.dart'; import 'core/service/patient-ucaf-service.dart'; import 'core/service/patient-vital-signs-service.dart'; import 'core/service/patient-doctor-referral-service.dart'; +import 'core/service/prescriptions_service.dart'; +import 'core/service/radiology_service.dart'; import 'core/service/referral_patient_service.dart'; import 'core/service/referred_patient_service.dart'; import 'core/service/schedule_service.dart'; @@ -38,6 +40,8 @@ import 'core/viewModel/patient-admission-request-viewmodel.dart'; import 'core/viewModel/patient-ucaf-viewmodel.dart'; import 'core/viewModel/patient-vital-sign-viewmodel.dart'; import 'core/viewModel/patient-referral-viewmodel.dart'; +import 'core/viewModel/prescriptions_view_model.dart'; +import 'core/viewModel/radiology_view_model.dart'; import 'core/viewModel/referral_view_model.dart'; import 'core/viewModel/referred_view_model.dart'; import 'core/viewModel/schedule_view_model.dart'; @@ -67,6 +71,8 @@ void setupLocator() { locator.registerLazySingleton(() => PatientMuseService()); locator.registerLazySingleton(() => LabsService()); locator.registerLazySingleton(() => InsuranceCardService()); + locator.registerLazySingleton(() => RadiologyService()); + locator.registerLazySingleton(() => PrescriptionsService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -89,4 +95,6 @@ void setupLocator() { locator.registerFactory(() => PatientMuseViewModel()); locator.registerFactory(() => LabsViewModel()); locator.registerFactory(() => InsuranceViewModel()); + locator.registerFactory(() => RadiologyViewModel()); + locator.registerFactory(() => PrescriptionsViewModel()); } diff --git a/lib/routes.dart b/lib/routes.dart index c3930da2..909b1bf4 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_ import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; @@ -114,6 +115,7 @@ const String PATIENT_SICKLEAVE = 'patients/patient_sickleave'; const String ADD_SICKLEAVE = 'add-sickleave'; const String SHOW_SICKLEAVE = 'show-sickleave'; const String RADIOLOGY = 'radiology'; +const String RADIOLOGY_PATIENT = 'radiology-patient'; //todo: change the routing way. var routes = { ROOT: (_) => RootPage(), @@ -151,6 +153,7 @@ var routes = { VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), RADIOLOGY: (_) => RadiologyScreen(), + RADIOLOGY_PATIENT: (_) => RadiologyHomePage(), PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestFirstScreen(), PATIENT_ADMISSION_REQUEST_2: (_) => AdmissionRequestSecondScreen(), PATIENT_ADMISSION_REQUEST_3: (_) => AdmissionRequestThirdScreen(), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart new file mode 100644 index 00000000..fc9f207a --- /dev/null +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -0,0 +1,79 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/radiology_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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class RadiologyDetailsPage extends StatelessWidget { + final FinalRadiology finalRadiology; + final PatiantInformtion patient; + + RadiologyDetailsPage({Key key, this.finalRadiology, this.patient}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getRadImageURL( + patient: patient, + projectId: finalRadiology.projectID, + lineItem: finalRadiology.invoiceLineItemNo, + invoiceNo: finalRadiology.invoiceNo), + builder: (_, model, widget) => AppScaffold( + appBarTitle: TranslationBase.of(context).radiologyReport, + isShowAppBar: true, + baseViewModel: model, + body: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Texts( + '${finalRadiology.reportData}', + textAlign: TextAlign.center, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + '${finalRadiology.reportData}', + textAlign: TextAlign.start, + fontSize: 17, + ), + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.2, + ) + ], + ), + ), + bottomSheet: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.14, + color: Colors.grey[100], + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Divider(), + if (finalRadiology.dIAPACSURL != "") + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () { + launch(model.radImageURL); + }, + title: TranslationBase.of(context).openRad, + ), + ), + ], + ), + )), + ); + } +} diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart new file mode 100644 index 00000000..cce155d2 --- /dev/null +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -0,0 +1,114 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/radiology_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/screens/patients/profile/radiology/radiology_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/widgets/shared/app_expandable_notifier_new.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class RadiologyHomePage extends StatelessWidget { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + return BaseView( + onModelReady: (model) => model.getPatientRadOrders(patient), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).radiology, + baseViewModel: model, + body: FractionallySizedBox( + widthFactor: 1.0, + child: ListView( + physics: BouncingScrollPhysics(), + children: [ + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => model.setFilterType(FilterType.Clinic), + child: ListTile( + title: Text(TranslationBase.of(context).clinic), + leading: Radio( + value: FilterType.Clinic, + groupValue: model.filterType, + onChanged: (FilterType value) { + model.setFilterType(value); + }, + ), + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => model.setFilterType(FilterType.Hospital), + child: ListTile( + title: Text(TranslationBase.of(context).hospital), + leading: Radio( + value: FilterType.Hospital, + groupValue: model.filterType, + onChanged: (FilterType value) { + model.setFilterType(value); + }, + ), + ), + ), + ) + ], + ), + ...List.generate( + model.finalRadiologyList.length, + (index) => AppExpandableNotifier( + title: model.finalRadiologyList[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model + .finalRadiologyList[index].finalRadiologyList + .map((radiology) { + return InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: RadiologyDetailsPage( + finalRadiology: radiology, + patient: patient, + ), + ), + ), + child: DoctorCard( + isInOutPatient: radiology.isInOutPatient, + isLiveCareAppointment: + radiology.isLiveCareAppointment, + name: radiology.doctorName, + profileUrl: radiology.doctorImageURL, + billNo: '${radiology.invoiceNo}', + subName: '${radiology.projectName}', + date: projectViewModel.isArabic + ? DateUtils.getMonthDayYearDateFormattedAr( + radiology.orderDate) + : DateUtils.getMonthDayYearDateFormatted( + radiology.orderDate), + ), + ); + }).toList(), + )), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/prescription_details_page.dart b/lib/screens/prescription/prescription_details_page.dart new file mode 100644 index 00000000..e5d9ef7d --- /dev/null +++ b/lib/screens/prescription/prescription_details_page.dart @@ -0,0 +1,168 @@ +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PrescriptionDetailsPage extends StatelessWidget { + final PrescriptionReport prescriptionReport; + + PrescriptionDetailsPage({Key key, this.prescriptionReport}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescriptions, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(color: Colors.grey[200], width: 0.5), + ), + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + prescriptionReport.imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + prescriptionReport.itemDescription.isNotEmpty + ? prescriptionReport.itemDescription + : prescriptionReport.itemDescriptionN), + ), + ), + ) + ], + ), + ), + Container( + color: Colors.white, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + child: Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 0.5), + outside: BorderSide(width: 0.5)), + children: [ + TableRow( + children: [ + Container( + color: Colors.white, + height: 30, + width: double.infinity, + child: Center( + child: Texts( + TranslationBase.of(context).route, + fontSize: 14, + ))), + Container( + color: Colors.white, + height: 30, + width: double.infinity, + child: Center( + child: Texts( + TranslationBase.of(context).frequency, + fontSize: 14, + ))), + Container( + color: Colors.white, + width: double.infinity, + padding: EdgeInsets.symmetric(horizontal: 4), + child: Center( + child: Texts( + "${TranslationBase.of(context).dailyDoses}", + fontSize: 14, + ))), + Container( + color: Colors.white, + height: 30, + width: double.infinity, + child: Center( + child: Texts( + TranslationBase.of(context).duration, + fontSize: 14, + ))), + ], + ), + TableRow( + children: [ + Container( + color: Colors.white, + height: 50, + width: double.infinity, + child: + Center(child: Text(prescriptionReport.routeN))), + Container( + color: Colors.white, + height: 50, + width: double.infinity, + child: Center( + child: + Text(prescriptionReport.frequencyN ?? ''))), + Container( + color: Colors.white, + height: 50, + width: double.infinity, + child: Center( + child: Text( + '${prescriptionReport.doseDailyQuantity}'))), + Container( + color: Colors.white, + height: 50, + width: double.infinity, + child: + Center(child: Text('${prescriptionReport.days}'))) + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + width: double.infinity, + color: Colors.white, + padding: EdgeInsets.all(5), + child: Center( + child: Column( + children: [ + Texts(TranslationBase.of(context).notes), + SizedBox( + height: 5, + ), + Divider( + height: 0.5, + color: Colors.grey[300], + ), + SizedBox( + height: 5, + ), + Texts(prescriptionReport.remarks ?? ''), + ], + ), + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart new file mode 100644 index 00000000..a306a93f --- /dev/null +++ b/lib/screens/prescription/prescription_items_page.dart @@ -0,0 +1,182 @@ +import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescriptions_view_model.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/screens/prescription/prescription_details_page.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class PrescriptionItemsPage extends StatelessWidget { + final Prescriptions prescriptions; + final PatiantInformtion patient; + PrescriptionItemsPage({Key key, this.prescriptions, this.patient}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => + model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescriptions, + baseViewModel: model, + body: Container( + height: MediaQuery.of(context).size.height * 0.8, + child: Column( + children: [ + if (!prescriptions.isInOutPatient) + ...List.generate( + model.prescriptionReportList.length, + (index) => InkWell( + 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( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], width: 0.5), + ), + child: Row( + children: [ + 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( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts(model + .prescriptionReportList[index] + .itemDescription + .isNotEmpty + ? model.prescriptionReportList[index] + .itemDescription + : model.prescriptionReportList[index] + .itemDescriptionN)), + )), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), + ), + )) + 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, + ), + ), + ); + }, + child: Container( + margin: EdgeInsets.all(8.0), + color: Colors.white, + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + model + .prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(model.prescriptionReportEnhList[index] + .itemDescription), + ], + ), + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), + ), + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart new file mode 100644 index 00000000..2b99e53a --- /dev/null +++ b/lib/screens/prescription/prescriptions_page.dart @@ -0,0 +1,122 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescriptions_view_model.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/screens/prescription/prescription_items_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/widgets/shared/app_expandable_notifier_new.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class PrescriptionsPage extends StatelessWidget { + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getPrescriptions(patient), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescriptions, + body: FractionallySizedBox( + widthFactor: 1.0, + child: ListView( + physics: BouncingScrollPhysics(), + children: [ + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => model + .setFilterType(FilterType.Clinic), + child: ListTile( + title: Text(TranslationBase.of(context).clinic), + leading: Radio( + value: FilterType.Clinic, + groupValue: model.filterType, + onChanged: (FilterType value) { + model.setFilterType(value); + }, + ), + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => model + .setFilterType(FilterType.Hospital), + child: ListTile( + title: Text(TranslationBase.of(context).hospital), + leading: Radio( + value: FilterType.Hospital, + groupValue: model.filterType, + onChanged: (FilterType value) { + model.setFilterType(value); + }, + ), + ), + ), + ) + ], + ), + ...List.generate( + model.prescriptionsOrderList.length, + (index) => AppExpandableNotifier( + title: model + .prescriptionsOrderList[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model + .prescriptionsOrderList[index].prescriptionsList + .map((prescriptions) { + return InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsPage( + prescriptions: prescriptions, + ), + ), + ), + child: DoctorCard( + name: prescriptions.doctorName, + profileUrl: prescriptions.doctorImageURL, + rat: + prescriptions.actualDoctorRate.toDouble(), + subName: prescriptions.name, + isInOutPatient: prescriptions.isInOutPatient, + isLiveCareAppointment: + prescriptions.isLiveCareAppointment, + date: projectViewModel.isArabic + ? DateUtils + .getMonthDayYearDateFormattedAr( + DateUtils.convertStringToDate( + prescriptions + .appointmentDate)) + : DateUtils.getMonthDayYearDateFormatted( + DateUtils.convertStringToDate( + prescriptions.appointmentDate)), + ), + ); + }).toList(), + )), + ) + ], + ), + ), + )); + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 868ad086..331b2812 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1160,6 +1160,10 @@ class TranslationBase { String get companyName => localizedValues['companyName'][locale.languageCode]; String get procedureName => localizedValues['procedureName'][locale.languageCode]; String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; + String get prescriptions => localizedValues['prescriptions'][locale.languageCode]; + String get notes => localizedValues['notes'][locale.languageCode]; + String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; + } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 60a0154e..7a672570 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -172,6 +172,13 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).ucaf, icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'lab.png'), ], ), ); 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 883b3e4b..6863362b 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -8,10 +8,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ProfileMedicalInfoWidgetSearch extends StatelessWidget { - String from; - String to; - PatiantInformtion patient; - String patientType; + final String from; + final String to; + final PatiantInformtion patient; + final String patientType; ProfileMedicalInfoWidgetSearch( {Key key, this.patient, this.patientType, this.from, this.to}); @@ -29,7 +29,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: RADIOLOGY, + route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, icon: 'radiology-1.png'), From a167db7651b17594b3e5c2f2de1177e2d757676d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 24 Mar 2021 13:49:17 +0200 Subject: [PATCH 2/2] Fix prescription items --- lib/routes.dart | 3 + .../prescription/prescription_items_page.dart | 273 +++++++++--------- .../prescription/prescriptions_page.dart | 1 + .../profile_medical_info_widget_search.dart | 4 +- 4 files changed, 143 insertions(+), 138 deletions(-) diff --git a/lib/routes.dart b/lib/routes.dart index 909b1bf4..dc905ba8 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_screen_history.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescriptions_page.dart'; import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart'; import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart'; import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; @@ -108,6 +109,7 @@ const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; // const String VIDEO_CALL = 'video-call'; const String LIVECARE_PENDING_LIST = 'livecare-pendinglist'; const String ORDER_PRESCRIPTION = 'prescription/prescriptionsss'; +const String ORDER_PRESCRIPTION_NEW = 'prescription/prescription_new'; const String ORDER_PRESCRIPTION_HISTORY = 'prescription/prescriptionsssH'; const String ORDER_PROCEDURE = 'procedure/procedure'; // const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox'; @@ -173,6 +175,7 @@ var routes = { ADD_SICKLEAVE: (_) => AddSickLeavScreen(), SHOW_SICKLEAVE: (_) => ShowSickLeaveScreen(), ORDER_PRESCRIPTION: (_) => NewPrescriptionScreen(), + ORDER_PRESCRIPTION_NEW: (_) => PrescriptionsPage(), ORDER_PRESCRIPTION_HISTORY: (_) => NewPrescriptionHistoryScreen(), ORDER_PROCEDURE: (_) => ProcedureScreen(), diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index a306a93f..67e957a2 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -11,7 +11,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class PrescriptionItemsPage extends StatelessWidget { final Prescriptions prescriptions; @@ -27,153 +26,155 @@ class PrescriptionItemsPage extends StatelessWidget { isShowAppBar: true, appBarTitle: TranslationBase.of(context).prescriptions, baseViewModel: model, - body: Container( - height: MediaQuery.of(context).size.height * 0.8, - child: Column( - children: [ - if (!prescriptions.isInOutPatient) - ...List.generate( - model.prescriptionReportList.length, - (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport: - model.prescriptionReportList[index], + body: SingleChildScrollView( + child: Container( + child: Column( + children: [ + if (!prescriptions.isInOutPatient) + ...List.generate( + model.prescriptionReportList.length, + (index) => InkWell( + 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( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + child: Container( + width: double.infinity, + margin: + EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], width: 0.5), ), - border: Border.all( - color: Colors.grey[200], width: 0.5), - ), - child: Row( - children: [ - ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(5)), - child: Image.network( - model.prescriptionReportList[index] - .imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, + child: Row( + children: [ + 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( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts(model - .prescriptionReportList[index] - .itemDescription - .isNotEmpty - ? model.prescriptionReportList[index] - .itemDescription - : model.prescriptionReportList[index] - .itemDescriptionN)), - )), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts(model + .prescriptionReportList[index] + .itemDescription + .isNotEmpty + ? model.prescriptionReportList[index] + .itemDescription + : model.prescriptionReportList[index] + .itemDescriptionN)), + )), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), ), - ), - )) - 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, - ), - ), - ); - }, - child: Container( - margin: EdgeInsets.all(8.0), - color: Colors.white, - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - model - .prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, + )) + 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, ), ), - SizedBox( - width: 10, - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(model.prescriptionReportEnhList[index] - .itemDescription), - ], + ); + }, + child: Container( + margin: EdgeInsets.all(8.0), + color: Colors.white, + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + model + .prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, ), ), - ), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(model.prescriptionReportEnhList[index] + .itemDescription), + ], + ), + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), ), ), ), - ) - ], + + ], + ), ), ), ), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 2b99e53a..d595ff0b 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -88,6 +88,7 @@ class PrescriptionsPage extends StatelessWidget { FadePage( page: PrescriptionItemsPage( prescriptions: prescriptions, + patient: patient, ), ), ), 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 6863362b..b5e96ec7 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -69,14 +69,14 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { ? PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION, + route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'lab.png') : PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION_HISTORY, + route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'lab.png'),