diff --git a/assets/fonts/DoctorApp.ttf b/assets/fonts/DoctorApp.ttf index bc62109b..09f49270 100644 Binary files a/assets/fonts/DoctorApp.ttf and b/assets/fonts/DoctorApp.ttf differ diff --git a/assets/images/inpatient.png b/assets/images/inpatient.png new file mode 100644 index 00000000..7a715654 Binary files /dev/null and b/assets/images/inpatient.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index c10f8838..657ac507 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -253,6 +253,10 @@ const GET_PRESCRIPTION_REPORT_ENH = const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; + +const GET_PRESCRIPTION_IN_PATIENT = + 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; + 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 3a440c24..59bddc54 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -30,6 +30,8 @@ const Map> localizedValues = { 'ar': 'ملاحضات وتفاصيل العيادة' }, 'outPatients': {'en': 'Out Patient', 'ar': 'المريض الخارجي'}, + 'myOutPatient': {'en': 'My Out Patients', 'ar': 'المريض الخارجي'}, + 'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'}, 'searchAbout': {'en': 'Search', 'ar': 'البحث عن'}, 'patient': {'en': 'Patient', 'ar': ' مريض'}, @@ -45,7 +47,7 @@ const Map> localizedValues = { 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, - 'inPatient': {'en': 'In Patient', 'ar': 'المريض الداخلي'}, + 'inPatient': {'en': 'My In Patients', 'ar': 'المريض الداخلي'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, diff --git a/lib/core/model/Prescriptions/in_patient_prescription_model.dart b/lib/core/model/Prescriptions/in_patient_prescription_model.dart new file mode 100644 index 00000000..f6e88bf7 --- /dev/null +++ b/lib/core/model/Prescriptions/in_patient_prescription_model.dart @@ -0,0 +1,26 @@ +class InPatientPrescriptionRequestModel { + String vidaAuthTokenID; + dynamic patientMRN; + dynamic appNo; + dynamic admissionNo; + + InPatientPrescriptionRequestModel( + {this.vidaAuthTokenID, this.patientMRN, this.appNo, this.admissionNo}); + + InPatientPrescriptionRequestModel.fromJson(Map json) { + vidaAuthTokenID = json['VidaAuthTokenID']; + patientMRN = json['PatientID']; + appNo = json['AppointmentNo']; + admissionNo = json['AdmissionNo']; + } + + Map toJson() { + final Map data = new Map(); + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['PatientID'] = this.patientMRN; + data['AppointmentNo'] = this.appNo; + data['AdmissionNo'] = this.admissionNo; + + return data; + } +} diff --git a/lib/core/model/Prescriptions/prescription_in_patient.dart b/lib/core/model/Prescriptions/prescription_in_patient.dart new file mode 100644 index 00000000..c66bc8a4 --- /dev/null +++ b/lib/core/model/Prescriptions/prescription_in_patient.dart @@ -0,0 +1,200 @@ +class PrescriotionInPatient { + int admissionNo; + int authorizedBy; + dynamic bedNo; + String comments; + int createdBy; + String createdByName; + dynamic createdByNameN; + String createdOn; + String direction; + int directionID; + dynamic directionN; + String dose; + int editedBy; + dynamic iVDiluentLine; + int iVDiluentType; + dynamic iVDiluentVolume; + dynamic iVRate; + dynamic iVStability; + String itemDescription; + int itemID; + int lineItemNo; + int locationId; + int noOfDoses; + int orderNo; + int patientID; + String pharmacyRemarks; + String prescriptionDatetime; + int prescriptionNo; + String processedBy; + int projectID; + int refillID; + String refillType; + dynamic refillTypeN; + int reviewedPharmacist; + dynamic roomId; + String route; + int routeId; + dynamic routeN; + dynamic setupID; + String startDatetime; + int status; + String statusDescription; + dynamic statusDescriptionN; + String stopDatetime; + int unitofMeasurement; + String unitofMeasurementDescription; + dynamic unitofMeasurementDescriptionN; + + PrescriotionInPatient( + {this.admissionNo, + this.authorizedBy, + this.bedNo, + this.comments, + this.createdBy, + this.createdByName, + this.createdByNameN, + this.createdOn, + this.direction, + this.directionID, + this.directionN, + this.dose, + this.editedBy, + this.iVDiluentLine, + this.iVDiluentType, + this.iVDiluentVolume, + this.iVRate, + this.iVStability, + this.itemDescription, + this.itemID, + this.lineItemNo, + this.locationId, + this.noOfDoses, + this.orderNo, + this.patientID, + this.pharmacyRemarks, + this.prescriptionDatetime, + this.prescriptionNo, + this.processedBy, + this.projectID, + this.refillID, + this.refillType, + this.refillTypeN, + this.reviewedPharmacist, + this.roomId, + this.route, + this.routeId, + this.routeN, + this.setupID, + this.startDatetime, + this.status, + this.statusDescription, + this.statusDescriptionN, + this.stopDatetime, + this.unitofMeasurement, + this.unitofMeasurementDescription, + this.unitofMeasurementDescriptionN}); + + PrescriotionInPatient.fromJson(Map json) { + admissionNo = json['AdmissionNo']; + authorizedBy = json['AuthorizedBy']; + bedNo = json['BedNo']; + comments = json['Comments']; + createdBy = json['CreatedBy']; + createdByName = json['CreatedByName']; + createdByNameN = json['CreatedByNameN']; + createdOn = json['CreatedOn']; + direction = json['Direction']; + directionID = json['DirectionID']; + directionN = json['DirectionN']; + dose = json['Dose']; + editedBy = json['EditedBy']; + iVDiluentLine = json['IVDiluentLine']; + iVDiluentType = json['IVDiluentType']; + iVDiluentVolume = json['IVDiluentVolume']; + iVRate = json['IVRate']; + iVStability = json['IVStability']; + itemDescription = json['ItemDescription']; + itemID = json['ItemID']; + lineItemNo = json['LineItemNo']; + locationId = json['LocationId']; + noOfDoses = json['NoOfDoses']; + orderNo = json['OrderNo']; + patientID = json['PatientID']; + pharmacyRemarks = json['PharmacyRemarks']; + prescriptionDatetime = json['PrescriptionDatetime']; + prescriptionNo = json['PrescriptionNo']; + processedBy = json['ProcessedBy']; + projectID = json['ProjectID']; + refillID = json['RefillID']; + refillType = json['RefillType']; + refillTypeN = json['RefillTypeN']; + reviewedPharmacist = json['ReviewedPharmacist']; + roomId = json['RoomId']; + route = json['Route']; + routeId = json['RouteId']; + routeN = json['RouteN']; + setupID = json['SetupID']; + startDatetime = json['StartDatetime']; + status = json['Status']; + statusDescription = json['StatusDescription']; + statusDescriptionN = json['StatusDescriptionN']; + stopDatetime = json['StopDatetime']; + unitofMeasurement = json['UnitofMeasurement']; + unitofMeasurementDescription = json['UnitofMeasurementDescription']; + unitofMeasurementDescriptionN = json['UnitofMeasurementDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['AdmissionNo'] = this.admissionNo; + data['AuthorizedBy'] = this.authorizedBy; + data['BedNo'] = this.bedNo; + data['Comments'] = this.comments; + data['CreatedBy'] = this.createdBy; + data['CreatedByName'] = this.createdByName; + data['CreatedByNameN'] = this.createdByNameN; + data['CreatedOn'] = this.createdOn; + data['Direction'] = this.direction; + data['DirectionID'] = this.directionID; + data['DirectionN'] = this.directionN; + data['Dose'] = this.dose; + data['EditedBy'] = this.editedBy; + data['IVDiluentLine'] = this.iVDiluentLine; + data['IVDiluentType'] = this.iVDiluentType; + data['IVDiluentVolume'] = this.iVDiluentVolume; + data['IVRate'] = this.iVRate; + data['IVStability'] = this.iVStability; + data['ItemDescription'] = this.itemDescription; + data['ItemID'] = this.itemID; + data['LineItemNo'] = this.lineItemNo; + data['LocationId'] = this.locationId; + data['NoOfDoses'] = this.noOfDoses; + data['OrderNo'] = this.orderNo; + data['PatientID'] = this.patientID; + data['PharmacyRemarks'] = this.pharmacyRemarks; + data['PrescriptionDatetime'] = this.prescriptionDatetime; + data['PrescriptionNo'] = this.prescriptionNo; + data['ProcessedBy'] = this.processedBy; + data['ProjectID'] = this.projectID; + data['RefillID'] = this.refillID; + data['RefillType'] = this.refillType; + data['RefillTypeN'] = this.refillTypeN; + data['ReviewedPharmacist'] = this.reviewedPharmacist; + data['RoomId'] = this.roomId; + data['Route'] = this.route; + data['RouteId'] = this.routeId; + data['RouteN'] = this.routeN; + data['SetupID'] = this.setupID; + data['StartDatetime'] = this.startDatetime; + data['Status'] = this.status; + data['StatusDescription'] = this.statusDescription; + data['StatusDescriptionN'] = this.statusDescriptionN; + data['StopDatetime'] = this.stopDatetime; + data['UnitofMeasurement'] = this.unitofMeasurement; + data['UnitofMeasurementDescription'] = this.unitofMeasurementDescription; + data['UnitofMeasurementDescriptionN'] = this.unitofMeasurementDescriptionN; + return data; + } +} diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index 2deb13f3..1c09696b 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -47,10 +47,10 @@ class LabResult { lineItemNo = json['LineItemNo']; maleInterpretativeData = json['MaleInterpretativeData']; notes = json['Notes']; - packageID = json['PackageID']; + packageID = json['PackageID'].toString(); patientID = json['PatientID']; - projectID = json['ProjectID']; - referanceRange = json['ReferanceRange']; + projectID = json['ProjectID'].toString(); + referanceRange = json['ReferenceRange'] ?? json['ReferanceRange']; resultValue = json['ResultValue']; sampleCollectedOn = json['SampleCollectedOn']; sampleReceivedOn = json['SampleReceivedOn']; diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index 07044b0e..62eac5cc 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -85,7 +85,7 @@ class PatientLabOrders { doctorTitle = json['DoctorTitle']; gender = json['Gender']; genderDescription = json['GenderDescription']; - invoiceNo = json['InvoiceNo']; + invoiceNo = json['InvoiceNo'].toString(); isActiveDoctorProfile = json['IsActiveDoctorProfile']; isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; isExecludeDoctor = json['IsExecludeDoctor']; @@ -96,9 +96,9 @@ class PatientLabOrders { nationalityFlagURL = json['NationalityFlagURL']; noOfPatientsRate = json['NoOfPatientsRate']; orderDate = DateUtils.convertStringToDate(json['OrderDate']); - orderNo = json['OrderNo']; - patientID = json['PatientID']; - projectID = json['ProjectID']; + orderNo = json['OrderNo'].toString(); + patientID = json['PatientID'].toString(); + projectID = json['ProjectID'].toString(); projectName = json['ProjectName']; projectNameN = json['ProjectNameN']; qR = json['QR']; diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart index bdeb3930..b48cf0e1 100644 --- a/lib/core/model/labs/request_patient_lab_special_result.dart +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -65,7 +65,7 @@ class RequestPatientLabSpecialResult { data['OrderNo'] = this.orderNo; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; - data['ClinicID'] = this.clinicID; + data['ClinicID'] = this.clinicID ?? 0; data['VersionID'] = this.versionID; data['Channel'] = this.channel; data['LanguageID'] = this.languageID; diff --git a/lib/core/model/prescription_req_model.dart b/lib/core/model/prescription_req_model.dart index 3eb71072..a45878d8 100644 --- a/lib/core/model/prescription_req_model.dart +++ b/lib/core/model/prescription_req_model.dart @@ -2,13 +2,16 @@ class PrescriptionReqModel { String vidaAuthTokenID; dynamic patientMRN; dynamic appNo; + dynamic admissionNo; - PrescriptionReqModel({this.vidaAuthTokenID, this.patientMRN, this.appNo}); + PrescriptionReqModel( + {this.vidaAuthTokenID, this.patientMRN, this.appNo, this.admissionNo}); PrescriptionReqModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; patientMRN = json['PatientMRN']; appNo = json['AppointmentNo']; + admissionNo = json['AdmissionNo']; } Map toJson() { @@ -16,6 +19,8 @@ class PrescriptionReqModel { data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['PatientMRN'] = this.patientMRN; data['AppointmentNo'] = this.appNo; + data['AdmissionNo'] = this.admissionNo; + return data; } } diff --git a/lib/core/service/labs_service.dart b/lib/core/service/labs_service.dart index ecfc96a1..6ea6e6cf 100644 --- a/lib/core/service/labs_service.dart +++ b/lib/core/service/labs_service.dart @@ -12,16 +12,30 @@ import 'base/base_service.dart'; class LabsService extends BaseService { List patientLabOrdersList = List(); - Future getPatientLabOrdersList(PatiantInformtion patient) async { + Future getPatientLabOrdersList( + PatiantInformtion patient, bool isArrived) async { hasError = false; Map body = Map(); - body['isDentalAllowedBackend'] = false; - await baseAppClient.postPatient(GET_Patient_LAB_ORDERS, patient: patient, + String url = ""; + if (isArrived) { + body['isDentalAllowedBackend'] = false; + url = GET_Patient_LAB_ORDERS; + } else { + url = GET_PATIENT_LAB_OREDERS; + } + + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabOrdersList.clear(); - response['ListPLO'].forEach((hospital) { - patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); - }); + if (isArrived) { + response['ListPLO'].forEach((hospital) { + patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); + }); + } else { + response['List_GetLabOreders'].forEach((hospital) { + patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -40,42 +54,65 @@ class LabsService extends BaseService { int clinicID, String invoiceNo, String orderNo, - PatiantInformtion patient}) async { + PatiantInformtion patient, + bool isInpatient = false}) async { hasError = false; + + Map body = Map(); _requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.clinicID = clinicID; _requestPatientLabSpecialResult.invoiceNo = invoiceNo; _requestPatientLabSpecialResult.orderNo = orderNo; + body = _requestPatientLabSpecialResult.toJson(); - await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, - patient: patient, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient, + onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); + response['ListPLSR'].forEach((hospital) { patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); }); + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _requestPatientLabSpecialResult.toJson()); + }, body: body); } Future getPatientLabResult( - {PatientLabOrders patientLabOrder, PatiantInformtion patient}) async { + {PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async { hasError = false; + + String url = ""; + if (isInpatient) { + url = GET_PATIENT_LAB_RESULTS; + } else { + url = GET_Patient_LAB_RESULT; + } + Map body = Map(); body['InvoiceNo'] = patientLabOrder.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; - body['ClinicID'] = patientLabOrder.clinicID; - await baseAppClient.postPatient(GET_Patient_LAB_RESULT, patient: patient, + body['ClinicID'] = patientLabOrder.clinicID ?? 0; + + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); labResultList.clear(); - response['ListPLR'].forEach((lab) { - labResultList.add(LabResult.fromJson(lab)); - }); + + if(isInpatient){ + response['List_GetLabNormal'].forEach((hospital) { + labResultList.add(LabResult.fromJson(hospital)); + }); + }else { + response['ListPLR'].forEach((lab) { + labResultList.add(LabResult.fromJson(lab)); + }); + } + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/prescriptions_service.dart b/lib/core/service/prescriptions_service.dart index c720eec9..9ee725b2 100644 --- a/lib/core/service/prescriptions_service.dart +++ b/lib/core/service/prescriptions_service.dart @@ -1,26 +1,53 @@ 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/in_patient_prescription_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; 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/core/model/prescription_req_model.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(); + List prescriptionInPatientList = List(); + + InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel = + InPatientPrescriptionRequestModel(); + + Future getPrescriptionInPatient({int mrn, String adn}) async { + _inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel( + patientMRN: mrn, + admissionNo: adn, + ); + hasError = false; + prescriptionInPatientList.clear(); + + await baseAppClient.post(GET_PRESCRIPTION_IN_PATIENT, + onSuccess: (dynamic response, int statusCode) { + prescriptionsList.clear(); + response['List_PrescriptionReportForInPatient'].forEach((prescriptions) { + prescriptionInPatientList + .add(PrescriotionInPatient.fromJson(prescriptions)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _inPatientPrescriptionRequestModel.toJson()); + } Future getPrescriptions(PatiantInformtion patient) async { hasError = false; Map body = Map(); body['isDentalAllowedBackend'] = false; - await baseAppClient.postPatient(PRESCRIPTIONS,patient: patient, + await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionsList.clear(); response['PatientPrescriptionList'].forEach((prescriptions) { @@ -37,7 +64,9 @@ class PrescriptionsService extends BaseService { appointmentNo: 0, isDentalAllowedBackend: false); List prescriptionReportList = List(); - Future getPrescriptionReport({Prescriptions prescriptions,@required PatiantInformtion patient}) async { + Future getPrescriptionReport( + {Prescriptions prescriptions, + @required PatiantInformtion patient}) async { hasError = false; _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; _requestPrescriptionReport.projectID = prescriptions.projectID; @@ -50,8 +79,7 @@ class PrescriptionsService extends BaseService { prescriptions.isInOutPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, - patient: patient, - onSuccess: (dynamic response, int statusCode) { + patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionReportList.clear(); prescriptionReportEnhList.clear(); if (prescriptions.isInOutPatient) { @@ -82,11 +110,11 @@ class PrescriptionsService extends BaseService { ); List pharmacyPrescriptionsList = List(); - Future getListPharmacyForPrescriptions({int itemId,@required PatiantInformtion patient}) async { + Future getListPharmacyForPrescriptions( + {int itemId, @required PatiantInformtion patient}) async { hasError = false; requestGetListPharmacyForPrescriptions.itemID = itemId; - await baseAppClient.postPatient(GET_PHARMACY_LIST, - patient: patient, + await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient, onSuccess: (dynamic response, int statusCode) { pharmacyPrescriptionsList.clear(); response['PharmList'].forEach((prescriptions) { @@ -107,7 +135,8 @@ class PrescriptionsService extends BaseService { List prescriptionReportEnhList = List(); Future getPrescriptionReportEnh( - {PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async { + {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) { @@ -141,8 +170,7 @@ class PrescriptionsService extends BaseService { await baseAppClient.postPatient( isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, - patient: patient, - onSuccess: (dynamic response, int statusCode) { + patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionReportEnhList.clear(); if (isInPatient) { @@ -163,20 +191,21 @@ class PrescriptionsService extends BaseService { 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); + 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/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 43851649..020a6184 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -28,7 +28,7 @@ class LabsViewModel extends BaseViewModel { void getLabs(PatiantInformtion patient) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersList(patient); + await _labsService.getPatientLabOrdersList(patient, true); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -89,7 +89,6 @@ class LabsViewModel extends BaseViewModel { List labResultLists = List(); List get labResultListsCoustom { - return labResultLists; } @@ -98,14 +97,16 @@ class LabsViewModel extends BaseViewModel { int clinicID, String invoiceNo, String orderNo, - PatiantInformtion patient}) async { + PatiantInformtion patient, + bool isInpatient}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult( invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, - patient: patient); + patient: patient, + isInpatient: isInpatient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -114,9 +115,11 @@ class LabsViewModel extends BaseViewModel { } } - getPatientLabResult({PatientLabOrders patientLabOrder,PatiantInformtion patient}) async { + getPatientLabResult( + {PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async { setState(ViewState.Busy); - await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder,patient: patient); + await _labsService.getPatientLabResult( + patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -149,10 +152,14 @@ class LabsViewModel extends BaseViewModel { } getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, String procedure,PatiantInformtion patient}) async { + {PatientLabOrders patientLabOrder, + String procedure, + PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResults( - patientLabOrder: patientLabOrder, procedure: procedure,patient: patient); + patientLabOrder: patientLabOrder, + procedure: procedure, + patient: patient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 5ced6617..bb741537 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.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_in_patient.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'; @@ -56,6 +57,24 @@ class PrescriptionViewModel extends BaseViewModel { ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital; + List get inPatientPrescription => + _prescriptionsService.prescriptionInPatientList; + + getPrescriptionsInPatient(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _prescriptionsService.getPrescriptionInPatient( + mrn: patient.patientId, adn: patient.admissionNo); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + _filterList(); + await _getPrescriptionsOrders(); + + setState(ViewState.Idle); + } + } + Future getItem({int itemID}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 0d0b41ef..d35b2c14 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -228,7 +228,7 @@ class ProcedureViewModel extends BaseViewModel { void getLabs(PatiantInformtion patient,{bool isArrived}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersList(patient); + await _labsService.getPatientLabOrdersList(patient, isArrived); if (_labsService.hasError) { error = _labsService.error; if(isArrived) diff --git a/lib/icons_app/config.json b/lib/icons_app/config.json index 3fb1c2fa..2a88ccfa 100644 --- a/lib/icons_app/config.json +++ b/lib/icons_app/config.json @@ -2371,73 +2371,143 @@ ] }, { - "uid": "fbbe1c278b442a4840b03064fe4a2ea4", - "css": "respiration-rate-1", - "code": 59499, + "uid": "bffd96d1421ef42e3a097855b3820d42", + "css": "obese-bmi-r-1", + "code": 59561, "src": "custom_icons", - "selected": false, + "selected": true, "svg": { - "path": "M989.3 410.2C907.2 230.7 805.1 123.6 716.1 123.6A91.6 91.6 0 0 0 667.3 137C595.3 181.3 592 319.6 591.9 334.9 591.9 339.7 590.8 377.9 590 431.1L560.9 420.4V20.1A20.3 20.3 0 0 0 540.6-0.2H499.9A20.3 20.3 0 0 0 479.6 20.1V420.4L450.5 431.1C449.7 378 448.7 339.9 448.6 335.3 448.6 319.6 445.2 181.3 373.2 137A91.6 91.6 0 0 0 324.4 123.6C235.5 123.6 133.3 230.8 51.2 410.3-57.1 647.8 39 972 43.2 985.6A20.1 20.1 0 0 0 67.1 999.3 1776.9 1776.9 0 0 0 243.4 946.2C369.2 900.2 434.5 855.1 442.6 808.2A2836.5 2836.5 0 0 0 451.6 473.7L506.5 453.4H534.7L589.6 473.7A2835.8 2835.8 0 0 0 598.6 808.2C606.7 855.1 671.8 900.2 797.8 946.2A1778.4 1778.4 0 0 0 974.1 999.5 20.1 20.1 0 0 0 998 985.7C1001.8 972 1097.9 647.8 989.3 410.2ZM393.1 500.5L249.7 574.6V634.8L260.7 668.2 288.1 694.8A20.3 20.3 0 0 1 260.1 723.7L230.5 695.2 197 732.2A20.3 20.3 0 0 1 167.2 705.1L209.4 658.4V595.3L130.2 636.3A20.3 20.3 0 1 1 111.7 600.5L129.3 591.4 97.8 566.3A20.3 20.3 0 0 1 122.9 534.8L168.5 571.2 278.8 514.3 184.4 442.5A20.3 20.3 0 0 1 208.8 410.4L239.3 433.5 241.9 410.2A20.3 20.3 0 0 1 281.9 414.6L276.5 461.8 318.5 493.7 374.5 464.8A20.3 20.3 0 1 1 393 500.5ZM942.9 566.3L911.4 591.4 929 600.5A20.3 20.3 0 1 1 910.5 636.3L831.4 595.3V658.2L873.7 705A20.3 20.3 0 0 1 843.8 732.1L810.3 695.1 780.8 723.6A20.3 20.3 0 0 1 752.7 694.7L780.1 668.1 791.1 634.7V574.5L647.7 500.4A20.3 20.3 0 1 1 666.2 464.6L722.2 493.6 764.2 461.7 759 414.5A20.3 20.3 0 1 1 799 410L801.6 433.4 832.1 410.2A20.3 20.3 0 0 1 856.5 442.3L761.9 514 872.2 570.9 917.9 534.5A20.3 20.3 0 0 1 943 566Z", - "width": 1041 + "path": "M307.3 571.7C305.2 589.1 322 680.9 330.6 716.9 334.8 734 346.1 761.8 342 776.5A153.3 153.3 0 0 0 337.7 839.2C339.7 848.6 346 892 337 907.9A369.5 369.5 0 0 0 323.5 958.9C300.8 999.1 313.6 997.1 313.6 997.1 320.6 1003.2 332.7 997.6 332.7 997.6A15.3 15.3 0 0 0 348.1 996.6 18.9 18.9 0 0 0 365.2 996.1 22.4 22.4 0 0 0 384.2 993C389.9 995 391.3 992.5 391.3 992.5 408.3 991.7 381.8 953.5 381.8 953.5A76.3 76.3 0 0 1 388.1 900C429.5 813.7 431.7 790.8 415.1 758.3 410.4 748.9 409.2 745.2 411.4 741.1 416.3 731.7 412.7 693.9 418.8 678.8 430.5 649.9 442 576.4 448 542.1 456.1 495.9 419.4 434 419.4 434 411.4 408.8 423.1 319 423.1 319 439.6 336.9 439 368.6 439 368.6 436.4 401.9 477.2 452.7 477.2 452.7A118.4 118.4 0 0 1 504.3 495.1C504.3 501.1 502.4 515.8 502.4 515.8L503.2 528.5A129.3 129.3 0 0 1 505.7 548.3C502.6 581.6 510.2 575.3 510.2 575.3 516.5 575.3 523.5 548.5 523.5 548.5 523.5 555.4 521.1 576.1 526.4 583.9 532.7 593.2 537.4 582.3 537.5 580.1 539.2 537.8 542.8 548.9 542.8 548.9 546.3 583.2 550.7 591 558.4 588.3 564.3 586.3 558.9 547.1 558.9 547.1 569 570.4 576.7 574.1 576.7 574.1 593.3 582.3 583 559.6 580.7 555.1A99.2 99.2 0 0 1 568 523C583.4 544.5 595 543.6 595 543.6 610 540.3 581.9 509.9 565.4 495.4A126 126 0 0 1 543 472.2 203.5 203.5 0 0 1 534 430.1C532.4 392.3 519.1 375.9 519.1 375.9 496.3 350.3 492 302.5 492 302.5L491 221.9C483 166.9 425.3 166.5 425.3 166.5 366.9 160.4 358.8 147.2 358.8 147.2 346.4 134.7 353.5 110.8 353.5 110.8A38.7 38.7 0 0 0 367.7 89.4C384.7 80.2 383.9 66.8 376 66.9 369.7 67 371.2 63.4 371.2 63.4 381.9 3.1 305.5 0 305.5 0H293.9S217.5 3.1 228.1 63.4C228.1 63.4 229.6 67.1 223.2 67 215.4 66.8 214.6 80.3 231.6 89.4A38.7 38.7 0 0 0 245.8 110.8S252.9 134.8 240.5 147.2C240.5 147.2 232.4 160.5 174 166.6 174 166.6 116.2 167 108.3 222L107.2 302.6S103 350.3 80.2 375.9C80.2 375.9 66.9 392.4 65.4 430.2A204.8 204.8 0 0 1 56.4 472.3 124.6 124.6 0 0 1 33.9 495.5C17.3 510-10.7 540.2 4.3 543.7 4.3 543.7 16 544.5 31.3 523.1A98.1 98.1 0 0 1 18.7 555.2C16.3 559.6 6 582.3 22.6 574.2 22.6 574.2 30.3 570.4 40.4 547.1 40.4 547.1 35 586.4 41 588.4 48.8 591 53.1 583.3 56.6 548.9 56.6 548.9 60.2 537.8 61.9 580.2 62 582.4 66.5 593.3 72.9 584 78.3 576.2 75.9 555.5 75.9 548.6 75.9 548.6 82.8 575.4 89.2 575.4 89.2 575.4 96.8 581.7 93.7 548.4A119.1 119.1 0 0 1 96.2 528.5L96.9 515.8S95 501.1 95 495.1A118.3 118.3 0 0 1 122.1 452.7S162.9 401.8 160.3 368.6C160.3 368.6 159.7 336.9 176.2 319 176.2 319 187.9 408.8 180 434 180 434 143.2 495.9 151.3 542.1 157.3 576.5 168.8 649.9 180.5 678.8 186.6 693.8 183 731.7 187.9 741.1 190.1 745.2 188.9 749 184.2 758.3 167.7 790.8 169.8 813.7 211.3 900A75.6 75.6 0 0 1 217.6 953.5S191.1 991.7 208.1 992.5C208.1 992.5 209.4 995 215.1 993A22.4 22.4 0 0 0 234.2 996.1 18.8 18.8 0 0 0 251.2 996.6 15.2 15.2 0 0 0 266.7 997.6S278.7 1003.3 285.8 997.1C285.8 997.1 298.5 999.1 275.9 958.9A367.7 367.7 0 0 0 262.5 907.9C253.4 892.1 259.9 848.6 261.8 839.2A155.9 155.9 0 0 0 257.5 776.5C253.3 761.8 264.7 734 268.9 716.9 277.5 680.9 294.3 589.1 292.2 571.7L299.2 573.4A18.3 18.3 0 0 0 307.3 571.7Z", + "width": 599 }, "search": [ - "respiration-rate" + "obese-bmi-r" ] }, { - "uid": "bffd96d1421ef42e3a097855b3820d42", - "css": "obese-bmi-r", - "code": 59508, + "uid": "e3578bfad1396ea9b38bd70c249fa1e5", + "css": "inpatient", + "code": 59737, "src": "custom_icons", - "selected": false, + "selected": true, "svg": { - "path": "M307.3 571.7C305.2 589.1 322 680.9 330.6 716.9 334.8 734 346.1 761.8 342 776.5A153.3 153.3 0 0 0 337.7 839.2C339.7 848.6 346 892 337 907.9A369.5 369.5 0 0 0 323.5 958.9C300.8 999.1 313.6 997.1 313.6 997.1 320.6 1003.2 332.7 997.6 332.7 997.6A15.3 15.3 0 0 0 348.1 996.6 18.9 18.9 0 0 0 365.2 996.1 22.4 22.4 0 0 0 384.2 993C389.9 995 391.3 992.5 391.3 992.5 408.3 991.7 381.8 953.5 381.8 953.5A76.3 76.3 0 0 1 388.1 900C429.5 813.7 431.7 790.8 415.1 758.3 410.4 748.9 409.2 745.2 411.4 741.1 416.3 731.7 412.7 693.9 418.8 678.8 430.5 649.9 442 576.4 448 542.1 456.1 495.9 419.4 434 419.4 434 411.4 408.8 423.1 319 423.1 319 439.6 336.9 439 368.6 439 368.6 436.4 401.9 477.2 452.7 477.2 452.7A118.4 118.4 0 0 1 504.3 495.1C504.3 501.1 502.4 515.8 502.4 515.8L503.2 528.5A129.3 129.3 0 0 1 505.7 548.3C502.6 581.6 510.2 575.3 510.2 575.3 516.5 575.3 523.5 548.5 523.5 548.5 523.5 555.4 521.1 576.1 526.4 583.9 532.7 593.2 537.4 582.3 537.5 580.1 539.2 537.8 542.8 548.9 542.8 548.9 546.3 583.2 550.7 591 558.4 588.3 564.3 586.3 558.9 547.1 558.9 547.1 569 570.4 576.7 574.1 576.7 574.1 593.3 582.3 583 559.6 580.7 555.1A99.2 99.2 0 0 1 568 523C583.4 544.5 595 543.6 595 543.6 610 540.3 581.9 509.9 565.4 495.4A126 126 0 0 1 543 472.2 203.5 203.5 0 0 1 534 430.1C532.4 392.3 519.1 375.9 519.1 375.9 496.3 350.3 492 302.5 492 302.5L491 221.9C483 166.9 425.3 166.5 425.3 166.5 366.9 160.4 358.8 147.2 358.8 147.2 346.4 134.7 353.5 110.8 353.5 110.8A38.7 38.7 0 0 0 367.7 89.4C384.7 80.2 383.9 66.8 376 66.9 369.7 67 371.2 63.4 371.2 63.4 381.9 3.1 305.5 0 305.5 0H293.9S217.5 3.1 228.1 63.4C228.1 63.4 229.6 67.1 223.2 67 215.4 66.8 214.6 80.3 231.6 89.4A38.7 38.7 0 0 0 245.8 110.8S252.9 134.8 240.5 147.2C240.5 147.2 232.4 160.5 174 166.6 174 166.6 116.2 167 108.3 222L107.2 302.6S103 350.3 80.2 375.9C80.2 375.9 66.9 392.4 65.4 430.2A204.8 204.8 0 0 1 56.4 472.3 124.6 124.6 0 0 1 33.9 495.5C17.3 510-10.7 540.2 4.3 543.7 4.3 543.7 16 544.5 31.3 523.1A98.1 98.1 0 0 1 18.7 555.2C16.3 559.6 6 582.3 22.6 574.2 22.6 574.2 30.3 570.4 40.4 547.1 40.4 547.1 35 586.4 41 588.4 48.8 591 53.1 583.3 56.6 548.9 56.6 548.9 60.2 537.8 61.9 580.2 62 582.4 66.5 593.3 72.9 584 78.3 576.2 75.9 555.5 75.9 548.6 75.9 548.6 82.8 575.4 89.2 575.4 89.2 575.4 96.8 581.7 93.7 548.4A119.1 119.1 0 0 1 96.2 528.5L96.9 515.8S95 501.1 95 495.1A118.3 118.3 0 0 1 122.1 452.7S162.9 401.8 160.3 368.6C160.3 368.6 159.7 336.9 176.2 319 176.2 319 187.9 408.8 180 434 180 434 143.2 495.9 151.3 542.1 157.3 576.5 168.8 649.9 180.5 678.8 186.6 693.8 183 731.7 187.9 741.1 190.1 745.2 188.9 749 184.2 758.3 167.7 790.8 169.8 813.7 211.3 900A75.6 75.6 0 0 1 217.6 953.5S191.1 991.7 208.1 992.5C208.1 992.5 209.4 995 215.1 993A22.4 22.4 0 0 0 234.2 996.1 18.8 18.8 0 0 0 251.2 996.6 15.2 15.2 0 0 0 266.7 997.6S278.7 1003.3 285.8 997.1C285.8 997.1 298.5 999.1 275.9 958.9A367.7 367.7 0 0 0 262.5 907.9C253.4 892.1 259.9 848.6 261.8 839.2A155.9 155.9 0 0 0 257.5 776.5C253.3 761.8 264.7 734 268.9 716.9 277.5 680.9 294.3 589.1 292.2 571.7L299.2 573.4A18.3 18.3 0 0 0 307.3 571.7Z", - "width": 599 + "path": "M970.7 470.7A29.3 29.3 0 0 0 941.5 500V646.3H878A145.5 145.5 0 0 0 735.6 529.2H421.9V557.4L361.6 556.4A149.2 149.2 0 0 0 235.9 525.1 87.8 87.8 0 1 0 64.6 493.3L58.6 489.5V380.8A29.3 29.3 0 0 0 0 380.8V970.7A29.3 29.3 0 0 0 58.6 970.7V824.3H941.5V970.7A29.3 29.3 0 0 0 1000 970.7V500A29.3 29.3 0 0 0 970.7 470.7ZM58.5 646.3V558.5L197.7 646.3ZM294.9 89.9H353.4V148.4H324.1A29.3 29.3 0 0 0 294.9 177.7V236.2A87.8 87.8 0 0 0 470.5 236.2V177.7A29.3 29.3 0 0 0 441.2 148.4H412V89.9H529V470.7H587.6V29.3A29.3 29.3 0 1 0 529 31.2H294.9A29.3 29.3 0 0 0 294.9 89.8Z", + "width": 1000 }, "search": [ - "obese-bmi-r" + "inpatient" ] }, { - "uid": "328db07d0698d682a7598bc691b02556", - "css": "menu-2", - "code": 59566, + "uid": "1ca5ef3569be282fb05f15395a81d2a0", + "css": "discharge", + "code": 59738, "src": "custom_icons", - "selected": false, + "selected": true, "svg": { - "path": "", - "width": 3500 + "path": "M985.1 464.6H985.1L535.1 14.6A49.8 49.8 0 0 0 464.8 14.6L14.6 464.6A50.1 50.1 0 0 0 14.6 535.4L464.6 985.1V985.4A50.1 50.1 0 0 0 535.4 985.4L985.3 535.4A49.9 49.9 0 0 0 985.1 464.6ZM599.7 624.9V500H399.7V650H299.7V450A49.8 49.8 0 0 1 349.7 400H599.7V274.9L774.7 449.9Z", + "width": 1000 }, "search": [ - "menu" + "discharge" ] }, { - "uid": "0cc603ffdc0374e97a75a762f3a21b10", - "css": "menu-1", - "code": 59567, + "uid": "1738fd6466298efa6012247ca0941077", + "css": "order-sheets", + "code": 59739, "src": "custom_icons", - "selected": false, + "selected": true, "svg": { - "path": "", - "width": 3500 + "path": "M736 84.4A87.2 87.2 0 0 0 673.9 58.6H635V97.6A78.2 78.2 0 0 1 556.9 175.8H205.8A78.2 78.2 0 0 1 127.7 97.6V58.6H88.6A87.9 87.9 0 0 0 0.9 146.4L0 912A87.9 87.9 0 0 0 87.8 1000.1H673A87.9 87.9 0 0 0 760.7 912.3L761.6 146.7A87.4 87.4 0 0 0 736 84.4ZM390.7 351.6H598.7A29.3 29.3 0 0 1 598.7 410.1H390.8A29.3 29.3 0 0 1 390.8 351.6ZM390.7 546.9H598.7A29.3 29.3 0 0 1 598.7 605.5H390.8A29.3 29.3 0 0 1 390.8 546.9ZM390.7 742.2H599.6A29.3 29.3 0 0 1 599.6 800.8H390.7A29.3 29.3 0 0 1 390.7 742.2ZM141.5 352.7A29.2 29.2 0 0 1 182.8 352.7L198.7 368.6 266.2 301.1A29.3 29.3 0 1 1 307.6 342.5L219.4 430.8A29.2 29.2 0 0 1 178.1 430.8L141.6 394.2A29.3 29.3 0 0 1 141.5 352.7ZM141.5 562.9A29.2 29.2 0 0 1 182.8 562.9L198.7 578.8 266.2 511.3A29.3 29.3 0 0 1 307.6 552.7L219.4 641A29.2 29.2 0 0 1 178.1 641L141.6 604.4A29.3 29.3 0 0 1 141.5 562.9ZM141.5 758.2A29.2 29.2 0 0 1 182.8 758.2L198.7 774.2 266.2 706.6A29.3 29.3 0 0 1 307.6 748.1L219.5 836.3A29.2 29.2 0 0 1 178.1 836.3L141.6 799.7A29.3 29.3 0 0 1 141.5 758.2ZM186.2 97.7A19.5 19.5 0 0 0 205.8 117.2H556.9A19.5 19.5 0 0 0 576.4 97.7V19.5A19.5 19.5 0 0 0 556.9 0H205.7A19.5 19.5 0 0 0 186.2 19.5Z", + "width": 762 }, "search": [ - "menu" + "order-sheets" + ] + }, + { + "uid": "37fe23c97ab802ea172b84fc8a0ee196", + "css": "call", + "code": 59740, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M763.9 671.3L986.8 745.6A19.2 19.2 0 0 1 1000 763.8V846.1A153.8 153.8 0 0 1 846.2 1000 846.1 846.1 0 0 1 0 153.6 153.6 153.6 0 0 1 153.6 0H236A19.2 19.2 0 0 1 254.2 13.2L328.7 236A19.2 19.2 0 0 1 321.1 258.1L221.2 324.5A19.7 19.7 0 0 0 213.7 347.6 800 800 0 0 0 652.2 786 19.7 19.7 0 0 0 675.3 778.5L741.8 678.6A19.2 19.2 0 0 1 763.9 671Z", + "width": 1000 + }, + "search": [ + "call" + ] + }, + { + "uid": "ebce1ce36215365ca8c3dd958beaac65", + "css": "medical-report", + "code": 59741, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M764.6 1000H58.8A58.9 58.9 0 0 1 0 941.1V59A58.9 58.9 0 0 1 58.8 0.1H764.6A58.9 58.9 0 0 1 823.5 59V941.3A58.9 58.9 0 0 1 764.6 1000ZM617.4 690.9A112.6 112.6 0 0 0 504.9 803.4 112.6 112.6 0 0 0 617.4 915.9 112.6 112.6 0 0 0 729.9 803.4V795.9H624.8V690.9ZM640.9 659.9V779.9H760.9V772.4A112.6 112.6 0 0 0 648.4 659.9ZM176.6 417.3A29.5 29.5 0 0 0 147.1 446.7 29.5 29.5 0 0 0 176.6 476.2H647.2A29.4 29.4 0 0 0 676.6 446.7 29.4 29.4 0 0 0 647.2 417.3ZM176.6 276.2A29.4 29.4 0 0 0 147.1 305.6 29.5 29.5 0 0 0 176.6 335.1H647.2A29.4 29.4 0 0 0 676.6 305.6 29.4 29.4 0 0 0 647.2 276.2ZM176.6 147.1A29.4 29.4 0 0 0 147.1 176.5 29.5 29.5 0 0 0 176.6 205.9H382.3A29.5 29.5 0 0 0 411.7 176.5 29.4 29.4 0 0 0 382.3 147.1Z", + "width": 823 + }, + "search": [ + "medical-report" + ] + }, + { + "uid": "c8478a11a2d4271b16c1e1f0464ea1ff", + "css": "painscale", + "code": 59742, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M77 120.3L120.2 77 271.7 228.5 228.4 271.8ZM243.6 24.1L299.8 0 364.8 151.4 308.5 175.6ZM0 299.9L24.1 243.6 175.6 308.6 151.4 364.8ZM726 769.4L769.3 726.2 920.7 877.6 877.4 920.9ZM633.1 846.2L689.3 822.1 754.2 973.6 698 997.7ZM822.2 689.5L846.4 633.3 997.8 698.2 973.7 754.5ZM242.5 415.6A122.4 122.4 0 0 1 415.6 588.7 122.4 122.4 0 1 1 415.6 761.8L177.4 1000 4.3 827.1 242.5 588.9A122.4 122.4 0 0 1 242.5 415.8ZM588.7 415.6A122.4 122.4 0 1 1 588.7 242.5L827 4.3 1000.1 177.4 761.7 415.6A122.4 122.4 0 1 1 588.6 415.6Z", + "width": 1000 + }, + "search": [ + "painscale" + ] + }, + { + "uid": "5a0bdc9deb49171daf7251717ac6d715", + "css": "oxygenation", + "code": 59743, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M498.2 186.2A406.9 406.9 0 1 0 905.1 593.1 407.3 407.3 0 0 0 498.2 186.2ZM498.2 926.9A333.9 333.9 0 1 1 832.1 593 334.3 334.3 0 0 1 498.2 927.1ZM380.8 421A161 161 0 0 0 261.9 463.9 161.5 161.5 0 0 0 219.1 583.5 177.3 177.3 0 0 0 240.7 675 131.7 131.7 0 0 0 297 728.4 201.4 201.4 0 0 0 384.8 745.2 176.5 176.5 0 0 0 472 725.7 133 133 0 0 0 525.5 671 193.7 193.7 0 0 0 544 580.8 158.4 158.4 0 0 0 501.6 463 164 164 0 0 0 380.8 421ZM429.8 652.4A59.8 59.8 0 0 1 381.5 672.7 59.6 59.6 0 0 1 333.5 652 105 105 0 0 1 315.8 583.7 105.3 105.3 0 0 1 333.8 514.9 58.9 58.9 0 0 1 380.8 494.1 61.3 61.3 0 0 1 429.3 514.6 97 97 0 0 1 447.2 579.3 116.6 116.6 0 0 1 430 652.4ZM650.7 682.9C654.7 679.8 662.4 672.9 674.1 664.7A154.2 154.2 0 0 0 714.3 626.2 67.5 67.5 0 0 0 725.3 589.8 57.1 57.1 0 0 0 689 536.1 128.1 128.1 0 0 0 641.6 529 115.3 115.3 0 0 0 595.9 536.3 56.8 56.8 0 0 0 570.4 557.2 91.8 91.8 0 0 0 558 595.2L615.8 600A42.6 42.6 0 0 1 625.2 575.4 26.8 26.8 0 0 1 660.9 575.2 21.6 21.6 0 0 1 667.9 591.4 32.1 32.1 0 0 1 660.8 609.9 169.6 169.6 0 0 1 628.3 638.5 247.6 247.6 0 0 0 571.8 689.1 384.4 384.4 0 0 0 553.6 734.7H711.6V698.3H637.1C642.2 698.3 646.8 686.1 650.7 682.9Z", + "width": 1041 + }, + "search": [ + "oxygenation" ] }, { - "uid": "8fcf1c5195ef14fb32d53dc5f583ef40", - "css": "menu-3", - "code": 59568, + "uid": "169c700bad100df58cf4c5f69c96a27e", + "css": "speechtotext", + "code": 59744, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M499.8 132A97.3 97.3 0 0 1 597 229.1V248.1A102.7 102.7 0 0 1 708.8 292.8 98.7 98.7 0 0 1 714 388.3L775.6 461.6A281 281 0 0 0 859.7 261.2V261.2A261 261 0 0 0 598.7 0H317.4V60.6A142.4 142.4 0 0 0 336.6 132ZM816.3 680.9L506.4 787.5 439 1000H1001.6A365.8 365.8 0 0 0 816.3 680.9ZM514.7 722.7L769.6 635 749 552.7A92.8 92.8 0 0 1 747.1 518.5L639.5 390.9 655.3 372A41.8 41.8 0 0 0 614 304.4L538.4 321.9V229.1A38.6 38.6 0 0 0 499.9 190.6H359.1V272.6L275.7 411.6 317.4 453.3V488.2L400.4 522.6 325.7 579.1 332 613.1A41.6 41.6 0 0 0 380 646.6L505.6 625ZM231.1 479.7A81.3 81.3 0 0 0 231.1 594.4L272.5 553A22.6 22.6 0 0 1 272.5 521.1ZM157.7 406.3A185 185 0 0 0 157.7 667.7L199.1 626.2A126.4 126.4 0 0 1 199.1 447.7ZM125.8 374.5L84.4 333.1A288.8 288.8 0 0 0 84.4 741.1L125.8 699.7A230.2 230.2 0 0 1 125.8 374.5Z", + "width": 1002 + }, + "search": [ + "speechtotext" + ] + }, + { + "uid": "fbbe1c278b442a4840b03064fe4a2ea4", + "css": "respiration-rate-1", + "code": 59499, "src": "custom_icons", "selected": false, "svg": { - "path": "", - "width": 3500 + "path": "M989.3 410.2C907.2 230.7 805.1 123.6 716.1 123.6A91.6 91.6 0 0 0 667.3 137C595.3 181.3 592 319.6 591.9 334.9 591.9 339.7 590.8 377.9 590 431.1L560.9 420.4V20.1A20.3 20.3 0 0 0 540.6-0.2H499.9A20.3 20.3 0 0 0 479.6 20.1V420.4L450.5 431.1C449.7 378 448.7 339.9 448.6 335.3 448.6 319.6 445.2 181.3 373.2 137A91.6 91.6 0 0 0 324.4 123.6C235.5 123.6 133.3 230.8 51.2 410.3-57.1 647.8 39 972 43.2 985.6A20.1 20.1 0 0 0 67.1 999.3 1776.9 1776.9 0 0 0 243.4 946.2C369.2 900.2 434.5 855.1 442.6 808.2A2836.5 2836.5 0 0 0 451.6 473.7L506.5 453.4H534.7L589.6 473.7A2835.8 2835.8 0 0 0 598.6 808.2C606.7 855.1 671.8 900.2 797.8 946.2A1778.4 1778.4 0 0 0 974.1 999.5 20.1 20.1 0 0 0 998 985.7C1001.8 972 1097.9 647.8 989.3 410.2ZM393.1 500.5L249.7 574.6V634.8L260.7 668.2 288.1 694.8A20.3 20.3 0 0 1 260.1 723.7L230.5 695.2 197 732.2A20.3 20.3 0 0 1 167.2 705.1L209.4 658.4V595.3L130.2 636.3A20.3 20.3 0 1 1 111.7 600.5L129.3 591.4 97.8 566.3A20.3 20.3 0 0 1 122.9 534.8L168.5 571.2 278.8 514.3 184.4 442.5A20.3 20.3 0 0 1 208.8 410.4L239.3 433.5 241.9 410.2A20.3 20.3 0 0 1 281.9 414.6L276.5 461.8 318.5 493.7 374.5 464.8A20.3 20.3 0 1 1 393 500.5ZM942.9 566.3L911.4 591.4 929 600.5A20.3 20.3 0 1 1 910.5 636.3L831.4 595.3V658.2L873.7 705A20.3 20.3 0 0 1 843.8 732.1L810.3 695.1 780.8 723.6A20.3 20.3 0 0 1 752.7 694.7L780.1 668.1 791.1 634.7V574.5L647.7 500.4A20.3 20.3 0 1 1 666.2 464.6L722.2 493.6 764.2 461.7 759 414.5A20.3 20.3 0 1 1 799 410L801.6 433.4 832.1 410.2A20.3 20.3 0 0 1 856.5 442.3L761.9 514 872.2 570.9 917.9 534.5A20.3 20.3 0 0 1 943 566Z", + "width": 1041 }, "search": [ - "menu" + "respiration-rate" ] } ] diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index 881b4b22..7ab4e306 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -131,8 +131,7 @@ class DoctorApp { IconData(0xe833, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData edit = IconData(0xe834, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData lab_results2 = - IconData(0xe835, fontFamily: _kFontFam, fontPackage: _kFontPkg); + // static const IconData lab_results = IconData(0xe835, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData leaves = IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData logout = @@ -359,8 +358,24 @@ class DoctorApp { IconData(0xe8a5, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData verify_sms = IconData(0xe8a6, fontFamily: _kFontFam, fontPackage: _kFontPkg); - // static const IconData 124 = IconData(0xe8a7, fontFamily: _kFontFam, fontPackage: _kFontPkg); - // static const IconData 123 = IconData(0xe8a8, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData obese_bmi_r_1 = + IconData(0xe8a9, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData menu = IconData(0xe8ad, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData inpatient = + IconData(0xe959, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData discharge = + IconData(0xe95a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData order_sheets = + IconData(0xe95b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData call = + IconData(0xe95c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData medical_report = + IconData(0xe95d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData painscale = + IconData(0xe95e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData oxygenation = + IconData(0xe95f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData speechtotext = + IconData(0xe960, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index f609bf4b..c1d384dc 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -476,15 +476,15 @@ class _HomeScreenState extends State { padding: EdgeInsets.only( top: 10, left: 10, right: 0), child: Icon( - DoctorApp.referral_1, - size: 35, + DoctorApp.inpatient, + size: 32, color: Colors.white, )), Container( padding: EdgeInsets.all(10), child: AppText( TranslationBase.of(context) - .patientsreferral, + .inPatient, color: Colors.white, textAlign: TextAlign.start, fontSize: 15, @@ -493,14 +493,14 @@ class _HomeScreenState extends State { ), hasBorder: false, onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PatientReferralScreen(), - // MyReferredPatient(), - ), - ); + getRequestHeader(true); + Navigator.of(context) + .pushNamed(PATIENTS, arguments: { + "patientSearchForm": + _patientSearchFormValues, + "selectedType": "1", + "arrivalType": "1" + }); }, ), HomePageCard( @@ -524,7 +524,7 @@ class _HomeScreenState extends State { padding: EdgeInsets.all(10), child: AppText( TranslationBase.of(context) - .arrivalpatient, + .myOutPatient, color: Colors.black, textAlign: TextAlign.start, fontSize: 15, @@ -594,33 +594,33 @@ class _HomeScreenState extends State { padding: EdgeInsets.only( top: 10, left: 10, right: 0), child: Icon( - DoctorApp.search, - size: 32, + DoctorApp.referral_1, + size: 35, color: Colors.white, )), Container( padding: EdgeInsets.all(10), child: AppText( TranslationBase.of(context) - .inPatient, + .patientsreferral, color: Colors.white, textAlign: TextAlign.start, - fontSize: 13, + fontSize: 15, )) ], ), hasBorder: false, onTap: () { - getRequestHeader(true); - Navigator.of(context) - .pushNamed(PATIENTS, arguments: { - "patientSearchForm": - _patientSearchFormValues, - "selectedType": "1", - "arrivalType": "1" - }); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PatientReferralScreen(), + // MyReferredPatient(), + ), + ); }, - ) + ), ])), // Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 014f656d..5c72e574 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -21,6 +21,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; @@ -394,20 +395,51 @@ class _PatientsScreenState extends State { children: [ Column(children: [ SizedBox(height: 18.5), + Container( - width: SizeConfig.screenWidth * 0.9, - height: SizeConfig.screenHeight * 0.08, - child: TextField( - controller: _controller, - onChanged: (String str) { - this.searchData(str); - }, - decoration: buildInputDecoration( - context, - TranslationBase.of(context) - .searchPatientName), - ), - ), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, top: 10), + child: AppText( + TranslationBase.of(context) + .selectYourProject, + fontWeight: FontWeight.w600, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + suffixIcon: Icons.arrow_drop_down, + onTap: () {}, + ) + ])), + + // Container( + // width: SizeConfig.screenWidth * 0.9, + // height: SizeConfig.screenHeight * 0.08, + // child: TextField( + // controller: _controller, + // onChanged: (String str) { + // this.searchData(str); + // }, + // decoration: buildInputDecoration( + // context, + // TranslationBase.of(context) + // .searchPatientName), + // ), + // ), SizedBox( height: 10.0, ), @@ -484,21 +516,65 @@ class _PatientsScreenState extends State { : Column( children: [ SizedBox(height: 18.5), + Container( - width: SizeConfig.screenWidth * 0.9, - height: - SizeConfig.screenHeight * 0.08, - child: TextField( - controller: _controller, - onChanged: (String str) { - this.searchData(str); - }, - decoration: buildInputDecoration( - context, - TranslationBase.of(context) - .searchPatientName), - ), - ), + width: SizeConfig.screenWidth * 0.9, + height: 75, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, top: 10), + child: AppText( + TranslationBase.of( + context) + .searchPatientName, + fontWeight: + FontWeight.bold, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: + EdgeInsets.only( + bottom: 30), + ), + onChanged: (String str) { + this.searchData(str); + }), + ])), + // Container( + // width: SizeConfig.screenWidth * 0.9, + // height: + // SizeConfig.screenHeight * 0.08, + // child: TextField( + // controller: _controller, + // onChanged: (String str) { + // this.searchData(str); + // }, + // decoration: buildInputDecoration( + // context, + // TranslationBase.of(context) + // .searchPatientName), + // ), + // ), SizedBox( height: 10.0, ), @@ -696,28 +772,6 @@ class _PatientsScreenState extends State { }); } - InputDecoration buildInputDecoration(BuildContext context, hint) { - return InputDecoration( - suffixIcon: IconButton( - icon: Icon(DoctorApp.search_patient), - color: Colors.grey, - onPressed: () {}, - iconSize: 30, - ), - filled: true, - fillColor: Colors.white, - hintText: hint, - hintStyle: TextStyle(fontSize: 1.66 * SizeConfig.textMultiplier), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: HexColor('#CCCCCC')), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey), //), - )); - } - Widget _locationBar(BuildContext _context, model) { return Container( height: MediaQuery.of(context).size.height * 0.0619, diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 9bdd712c..c63f5bdf 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -11,15 +11,23 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; - class LabResultWidget extends StatelessWidget { - final String filterName; final List patientLabResultList; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; - LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key); + final bool isInpatient; + + LabResultWidget( + {Key key, + this.filterName, + this.patientLabResultList, + this.patientLabOrder, + this.patient, + this.isInpatient}) + : super(key: key); ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -29,31 +37,32 @@ class LabResultWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText(filterName), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: FlowChartPage( - filterName: filterName, - patientLabOrder: patientLabOrder, - patient: patient, + if (!isInpatient) + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText(filterName), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: FlowChartPage( + filterName: filterName, + patientLabOrder: patientLabOrder, + patient: patient, + ), ), - ), - ); - }, - child: AppText( - TranslationBase.of(context).showMoreBtn, - textDecoration: TextDecoration.underline, - color: Colors.blue, + ); + }, + child: AppText( + TranslationBase.of(context).showMoreBtn, + textDecoration: TextDecoration.underline, + color: Colors.blue, + ), ), - ), - ], - ), + ], + ), Row( children: [ Expanded( @@ -61,7 +70,8 @@ class LabResultWidget extends StatelessWidget { child: Center( child: AppText( TranslationBase.of(context).description, - color: Colors.black,bold: true, + color: Colors.black, + bold: true, ), ), ), @@ -69,68 +79,87 @@ class LabResultWidget extends StatelessWidget { Expanded( child: Container( child: Center( - child: AppText(TranslationBase.of(context).value, color: Colors.black,bold: true,), + child: AppText( + TranslationBase.of(context).value, + color: Colors.black, + bold: true, + ), ), ), ), Expanded( child: Container( child: Center( - child: AppText(TranslationBase.of(context).range, color: Colors.black,bold: true,), + child: AppText( + TranslationBase.of(context).range, + color: Colors.black, + bold: true, + ), ), ), ) ], ), - SizedBox(height: 7,), - Divider(color: Colors.black,thickness: 1,), - SizedBox(height: 12,), - ...List.generate(patientLabResultList.length, (index) => Column( - children: [ - Row( - children: [ - Expanded( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: AppText( - '${patientLabResultList[index].testCode}\n'+ - patientLabResultList[index].description, - textAlign: TextAlign.center, - ), - ), - ), - ), - Expanded( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: AppText( - patientLabResultList[index].resultValue+" "+patientLabResultList[index].uOM, - textAlign: TextAlign.center, - ), - ), - ), - ), - Expanded( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: AppText( - patientLabResultList[index].referanceRange, - textAlign: TextAlign.center, - ), + SizedBox( + height: 7, + ), + Divider( + color: Colors.black, + thickness: 1, + ), + SizedBox( + height: 12, + ), + ...List.generate( + patientLabResultList.length, + (index) => Column( + children: [ + Row( + children: [ + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: AppText( + '${patientLabResultList[index].testCode}\n' + + patientLabResultList[index].description, + textAlign: TextAlign.center, + ), + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: AppText( + patientLabResultList[index].resultValue + + " " + + "${patientLabResultList[index].uOM ?? ""}", + textAlign: TextAlign.center, + ), + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: AppText( + patientLabResultList[index].referanceRange, + textAlign: TextAlign.center, + ), + ), + ), + ), + ], ), - ), - ), - ], - ), - Divider(), - ], - )) + Divider(), + ], + )) // Table( // border: TableBorder.symmetric( // inside: BorderSide(width: 2.0, color: Colors.grey[300],style: BorderStyle.solid), @@ -141,7 +170,8 @@ class LabResultWidget extends StatelessWidget { ), ); } - List fullData(List labResultList,context) { + + List fullData(List labResultList, context) { List tableRow = []; tableRow.add( TableRow( @@ -150,18 +180,27 @@ class LabResultWidget extends StatelessWidget { child: Center( child: AppText( TranslationBase.of(context).description, - color: Colors.black,bold: true, + color: Colors.black, + bold: true, ), ), ), Container( child: Center( - child: AppText(TranslationBase.of(context).value, color: Colors.black,bold: true,), + child: AppText( + TranslationBase.of(context).value, + color: Colors.black, + bold: true, + ), ), ), Container( child: Center( - child: AppText(TranslationBase.of(context).range, color: Colors.black,bold: true,), + child: AppText( + TranslationBase.of(context).range, + color: Colors.black, + bold: true, + ), ), ), ], @@ -189,7 +228,7 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - lab.resultValue+" "+lab.uOM, + lab.resultValue + " " + lab.uOM, textAlign: TextAlign.center, ), ), @@ -213,7 +252,4 @@ class LabResultWidget extends StatelessWidget { }); return tableRow; } - } - - diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 0d8b1749..4a5a768d 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -18,7 +18,13 @@ class LaboratoryResultPage extends StatefulWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; - LaboratoryResultPage({Key key, this.patientLabOrders, this.patient, this.patientType, this.arrivalType}); + + LaboratoryResultPage( + {Key key, + this.patientLabOrders, + this.patient, + this.patientType, + this.arrivalType}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -33,15 +39,16 @@ class _LaboratoryResultPageState extends State { clinicID: widget.patientLabOrders.clinicID, projectID: widget.patientLabOrders.projectID, orderNo: widget.patientLabOrders.orderNo, - patient: widget.patient), + patient: widget.patient, + isInpatient: widget.patientType == "1"), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBar: PatientProfileHeaderWhitAppointmentAppBar( patient: widget.patient, - patientType: widget.patientType??"0", - arrivalType: widget.arrivalType??"0", + patientType: widget.patientType ?? "0", + arrivalType: widget.arrivalType ?? "0", orderNo: widget.patientLabOrders.orderNo, - appointmentDate:widget.patientLabOrders.orderDate, + appointmentDate: widget.patientLabOrders.orderDate, doctorName: widget.patientLabOrders.doctorName, branch: widget.patientLabOrders.projectName, clinic: widget.patientLabOrders.clinicDescription, @@ -53,17 +60,18 @@ class _LaboratoryResultPageState extends State { body: SingleChildScrollView( child: Column( children: [ - ...List.generate(model.patientLabSpecialResult.length, (index) => LaboratoryResultWidget( - onTap: () async { - - }, - billNo: widget.patientLabOrders.invoiceNo, - details: model.patientLabSpecialResult[index].resultDataHTML, - orderNo: widget.patientLabOrders.orderNo, - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, - )), - + ...List.generate( + model.patientLabSpecialResult.length, + (index) => LaboratoryResultWidget( + onTap: () async {}, + billNo: widget.patientLabOrders.invoiceNo, + details: model + .patientLabSpecialResult[index].resultDataHTML, + orderNo: widget.patientLabOrders.orderNo, + patientLabOrder: widget.patientLabOrders, + patient: widget.patient, + isInpatient: widget.patientType == "1", + )), ], ), ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 388a4859..8ae1e083 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -20,13 +20,17 @@ class LaboratoryResultWidget extends StatefulWidget { final String orderNo; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; + final bool isInpatient; + const LaboratoryResultWidget( {Key key, this.onTap, this.billNo, this.details, this.orderNo, - this.patientLabOrder, this.patient}) + this.patientLabOrder, + this.patient, + this.isInpatient}) : super(key: key); @override @@ -41,7 +45,10 @@ class _LaboratoryResultWidgetState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient), + onModelReady: (model) => model.getPatientLabResult( + patientLabOrder: widget.patientLabOrder, + patient: widget.patient, + isInpatient: widget.isInpatient), builder: (_, model, w) => NetworkBaseView( baseViewModel: model, child: Container( @@ -77,9 +84,15 @@ class _LaboratoryResultWidgetState extends State { )), child: Row( children: [ - Expanded(child: Container( - margin: EdgeInsets.only(left: 10, right: 10), - child: AppText(TranslationBase.of(context).generalResult,bold: true,))), + Expanded( + child: Container( + margin: EdgeInsets.only( + left: 10, right: 10), + child: AppText( + TranslationBase.of(context) + .generalResult, + bold: true, + ))), Container( width: 25, height: 25, @@ -115,14 +128,15 @@ class _LaboratoryResultWidgetState extends State { children: [ ...List.generate( model.labResultLists.length, - (index) => LabResultWidget( + (index) => LabResultWidget( patientLabOrder: widget.patientLabOrder, filterName: model .labResultLists[index].filterName, patientLabResultList: model .labResultLists[index] .patientLabResultList, - patient:widget.patient, + patient: widget.patient, + isInpatient: widget.isInpatient, ), ) ], @@ -135,7 +149,6 @@ class _LaboratoryResultWidgetState extends State { SizedBox( height: 10, ), - ], ), ], diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 7e812848..ddb0d3de 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -13,14 +13,11 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.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/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class LabsHomePage extends StatelessWidget { String patientType; diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart new file mode 100644 index 00000000..12299785 --- /dev/null +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -0,0 +1,453 @@ +import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.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/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/ShowImageDialog.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 PrescriptionItemsInPatientPage extends StatelessWidget { + final PrescriotionInPatient prescriptions; + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final DateTime startOn; + final DateTime stopOn; + final int prescriptionIndex; + + PrescriptionItemsInPatientPage( + {Key key, + this.prescriptions, + this.patient, + this.patientType, + this.arrivalType, + this.stopOn, + this.startOn, + this.prescriptionIndex}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) async { + if (model.inPatientPrescription.length == 0) { + await model.getPrescriptionsInPatient(patient); + } + }, + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + backgroundColor: Colors.grey[100], + baseViewModel: model, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patient.patientType.toString(), patient.arrivedOn), + body: SingleChildScrollView( + child: Container( + child: Column( + children: [ + // if (!prescriptions.isInOutPatient) + // ...List.generate( + // model.prescriptionReportList.length, + // (index) => Container( + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(12), + // color: Colors.white, + // ), + // margin: EdgeInsets.all(12), + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Container( + // margin: + // EdgeInsets.only(left: 18, right: 18), + // child: AppText( + // model.prescriptionReportList[index] + // .itemDescription.isNotEmpty + // ? model + // .prescriptionReportList[index] + // .itemDescription + // : model + // .prescriptionReportList[index] + // .itemDescriptionN, + // bold: true, + // )), + // SizedBox( + // height: 12, + // ), + // Row( + // children: [ + // SizedBox( + // width: 18, + // ), + // Container( + // decoration: BoxDecoration( + // shape: BoxShape.circle, + // border: Border.all( + // width: 0.5, + // color: Colors.grey)), + // height: 55, + // width: 55, + // child: InkWell( + // onTap: () { + // showDialog( + // context: context, + // child: ShowImageDialog( + // imageUrl: model + // .prescriptionReportEnhList[ + // index] + // .imageSRCUrl, + // )); + // }, + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Image.network( + // model + // .prescriptionReportList[index] + // .imageSRCUrl, + // fit: BoxFit.cover, + // ), + // ), + // ), + // ), + // SizedBox( + // width: 10, + // ), + // Expanded( + // child: Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Row( + // children: [ + // AppText( + // TranslationBase.of(context) + // .route, + // color: Colors.grey, + // ), + // Expanded( + // child: AppText(" " + + // model + // .prescriptionReportList[ + // index] + // .routeN)), + // ], + // ), + // Row( + // children: [ + // AppText( + // TranslationBase.of(context) + // .frequency, + // color: Colors.grey, + // ), + // AppText(" " + + // model + // .prescriptionReportList[ + // index] + // .frequencyN ?? + // ''), + // ], + // ), + // Row( + // children: [ + // AppText( + // TranslationBase.of(context) + // .dailyDoses, + // color: Colors.grey, + // ), + // AppText(" " + + // model + // .prescriptionReportList[ + // index] + // .doseDailyQuantity ?? + // ''), + // ], + // ), + // Row( + // children: [ + // AppText( + // TranslationBase.of(context) + // .duration, + // color: Colors.grey, + // ), + // AppText(" " + + // model + // .prescriptionReportList[ + // index] + // .days + // .toString() ?? + // ''), + // ], + // ), + // SizedBox( + // height: 12, + // ), + // AppText(model + // .prescriptionReportList[ + // index] + // .remarks ?? + // ''), + // ], + // ), + // ) + // ], + // ) + // ], + // ), + // ), + // )) + // else + + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18, right: 18), + child: AppText( + model.inPatientPrescription[prescriptionIndex] + .itemDescription, + bold: true, + ), + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 18, + ), + // Container( + // decoration: BoxDecoration( + // shape: BoxShape.circle, + // border: Border.all( + // width: 0.5, color: Colors.grey)), + // height: 55, + // width: 55, + // child: InkWell( + // onTap: () { + // showDialog( + // context: context, + // // child: ShowImageDialog( + // // imageUrl: model + // // .inPatientPrescription[index] + // // .imageSRCUrl, + // // ), + // ); + // }, + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // // child: Image.network( + // // model.prescriptionReportEnhList[index] + // // .imageSRCUrl, + // // fit: BoxFit.cover, + // // ), + // ), + // ), + // ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + 'Direction', + color: Colors.grey, + ), + Expanded( + child: AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .direction ?? + '')), + ], + ), + Row( + children: [ + AppText( + 'Route', + color: Colors.grey, + ), + AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .route + .toString() ?? + ''), + ], + ), + Row( + children: [ + AppText( + 'Refill', + color: Colors.grey, + ), + Expanded( + child: AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .refillType ?? + '')), + ], + ), + Row( + children: [ + AppText( + 'Start Date ', + color: Colors.grey, + ), + Expanded( + child: AppText( + '${DateUtils.getDayMonthYearDateFormatted(startOn, isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ), + ], + ), + Row( + children: [ + AppText( + 'Stop Date', + color: Colors.grey, + ), + Expanded( + child: AppText( + '${DateUtils.getDayMonthYearDateFormatted(stopOn, isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + ), + ], + ), + Row( + children: [ + AppText( + 'UOM', + color: Colors.grey, + ), + AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .unitofMeasurementDescription ?? + ''), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).dailyDoses, + color: Colors.grey, + ), + AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .dose + .toString() ?? + ''), + ], + ), + Row( + children: [ + AppText( + 'Status', + color: Colors.grey, + ), + AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .statusDescription + .toString() ?? + ''), + ], + ), + Row( + children: [ + AppText( + 'Processed', + color: Colors.grey, + ), + AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .processedBy ?? + ''), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).dailyDoses, + color: Colors.grey, + ), + AppText(" " + + model + .inPatientPrescription[ + prescriptionIndex] + .dose + .toString() ?? + ''), + ], + ), + SizedBox( + height: 12, + ), + AppText(model + .inPatientPrescription[ + prescriptionIndex] + .comments ?? + ''), + ], + ), + ) + ], + ) + ], + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 5b57db44..c0eae3c4 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -5,6 +5,7 @@ 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/add_prescription_form.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescription_item_in_patient_page.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'; @@ -15,6 +16,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.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/shared/user-guid/in_patient_doctor_card.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -29,116 +31,193 @@ class PrescriptionsPage extends StatelessWidget { String arrivalType = routeArgs['arrivalType']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPrescriptions(patient,patientType:patientType), + onModelReady: (model) => patientType == "1" + ? model.getPrescriptionsInPatient(patient) + : model.getPrescriptions(patient, patientType: patientType), builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - backgroundColor: Colors.grey[100], - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType ?? '0', arrivalType), - body: FractionallySizedBox( - widthFactor: 1.0, - child: ListView( - physics: BouncingScrollPhysics(), - children: [ - SizedBox( - height: 12, - ), - if(model.prescriptionsList.isNotEmpty && patient.patientStatusType != 43) - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Order', - style: "caption2", - color: Colors.black, - fontSize: 13, - ), - AppText( - 'Prescriptions', - bold: true, - fontSize: 22, - ), - ], - ), - ), - if(patient.patientStatusType == 43) - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Order', - style: "caption2", - color: Colors.black, - fontSize: 13, + baseViewModel: model, + isShowAppBar: true, + backgroundColor: Colors.grey[100], + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType ?? '0', arrivalType), + body: patientType != "1" + ? FractionallySizedBox( + widthFactor: 1.0, + child: ListView( + physics: BouncingScrollPhysics(), + children: [ + SizedBox( + height: 12, + ), + if (model.prescriptionsList.isNotEmpty && + patient.patientStatusType != 43) + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Order', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + AppText( + 'Prescriptions', + bold: true, + fontSize: 22, + ), + ], ), - AppText( - 'Prescriptions', - bold: true, - fontSize: 22, + ), + if (patient.patientStatusType == 43) + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Order', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + AppText( + 'Prescriptions', + bold: true, + fontSize: 22, + ), + ], ), - ], - ), - ), - if (patientType != null && - patientType == '7' && - patient.patientStatusType == 43) - AddNewOrder( onTap: () { - addPrescriptionForm( - context, model, patient, model.prescriptionList); - },label: 'Apply for New Prescriptions Order',), - ...List.generate( - model.prescriptionsList.length, - (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionItemsPage( - prescriptions: - model.prescriptionsList[index], - patient: patient, - patientType: patientType, - arrivalType: arrivalType, + ), + if (patientType != null && + patientType == '7' && + patient.patientStatusType == 43) + AddNewOrder( + onTap: () { + addPrescriptionForm(context, model, patient, + model.prescriptionList); + }, + label: 'Apply for New Prescriptions Order', + ), + ...List.generate( + model.prescriptionsList.length, + (index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsPage( + prescriptions: + model.prescriptionsList[index], + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + ), + ), ), + child: DoctorCard( + doctorName: + model.prescriptionsList[index].doctorName, + profileUrl: model + .prescriptionsList[index].doctorImageURL, + branch: model.prescriptionsList[index].name, + clinic: model.prescriptionsList[index] + .clinicDescription, + isPrescriptions: true, + appointmentDate: + DateUtils.getDateTimeFromServerFormat( + model.prescriptionsList[index] + .appointmentDate, ), + ))), + if (model.prescriptionsList.isEmpty && + patient.patientStatusType != 43) + Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, ), - child: DoctorCard( - doctorName: - model.prescriptionsList[index].doctorName, - profileUrl: - model.prescriptionsList[index].doctorImageURL, - branch: model.prescriptionsList[index].name, - clinic: model - .prescriptionsList[index].clinicDescription, - isPrescriptions: true, - appointmentDate: - DateUtils.getDateTimeFromServerFormat( - model.prescriptionsList[index].appointmentDate, - ), - ))), - if(model.prescriptionsList.isEmpty && patient.patientStatusType != 43) - Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: 100,), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText('No Lab Result Found'), - ) + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText('No Prescriptions Found'), + ) + ], + ), + ) + ], + ), + ) + : FractionallySizedBox( + widthFactor: 1.0, + child: ListView( + physics: BouncingScrollPhysics(), + children: [ + // SizedBox( + // height: 12, + // ), - ], - ), - ) - ], - ), - ), - )); + ...List.generate( + model.inPatientPrescription.length, + (index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsInPatientPage( + prescriptionIndex: index, + prescriptions: model + .inPatientPrescription[index], + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + startOn: DateUtils + .getDateTimeFromServerFormat( + model.inPatientPrescription[index] + .startDatetime, + ), + stopOn: DateUtils + .getDateTimeFromServerFormat( + model.inPatientPrescription[index] + .stopDatetime, + ), + ), + ), + ), + child: InPatientDoctorCard( + doctorName: model.inPatientPrescription[index] + .itemDescription, + profileUrl: 'sss', + branch: 'hamza', + clinic: 'basheer', + isPrescriptions: true, + appointmentDate: + DateUtils.getDateTimeFromServerFormat( + model.inPatientPrescription[index] + .prescriptionDatetime, + ), + createdBy: model.inPatientPrescription[index] + .createdByName, + ))), + if (model.inPatientPrescription.length == 0) + Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText('No Prescriptions Found'), + ) + ], + ), + ) + ], + ), + ))); } } - diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index c41f18c2..51cca1cc 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -393,6 +393,9 @@ class TranslationBase { String get outPatient => localizedValues['outPatients'][locale.languageCode]; + String get myOutPatient => + localizedValues['myOutPatient'][locale.languageCode]; + String get logout => localizedValues['logout'][locale.languageCode]; String get pharmaciesList => diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 5ae0f88d..a1c913e2 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -29,16 +29,13 @@ class PatientCard extends StatelessWidget { return Container( width: SizeConfig.screenWidth * 0.9, margin: EdgeInsets.all(6), - padding: - (SERVICES_PATIANT2[int.parse(patientType)] == "List_MyInPatient") - ? EdgeInsets.only(left: 0, right: 5, bottom: 20, top: 5) - : EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), color: Colors.white, ), child: Stack(children: [ - if (SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient") + if (SERVICES_PATIANT2[int.parse(patientType)] != "List_MyInPatient") Container( height: MediaQuery.of(context).size.height * .20, width: 5, @@ -216,8 +213,8 @@ class PatientCard extends StatelessWidget { ), ), ), - if (SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient") + if (SERVICES_PATIANT2[int.parse(patientType)] != + "List_InPatient") Container( child: RichText( text: new TextSpan( @@ -364,20 +361,6 @@ class PatientCard extends StatelessWidget { children: [ Container( padding: EdgeInsets.all(4), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.only( - // bottomRight: Radius.circular(8), - // topLeft: Radius.circular(8), - // ), - // color: patientInfo.appointmentType == - // 'Regular' && - // patientInfo.visitTypeId == 100 - // ? HexColor('#D02127') - // : patientInfo.appointmentType == - // 'Walkin' - // ? HexColor('#28323A') - // : HexColor('#6C7379'), - // ), child: Image.asset( patientInfo.appointmentType == 'Regular' && @@ -391,7 +374,20 @@ class PatientCard extends StatelessWidget { width: 35, )), ]) - : SizedBox() + : (SERVICES_PATIANT2[int.parse(patientType)] == + "List_MyInPatient") + ? Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.all(4), + child: Image.asset( + 'assets/images/inpatient.png', + height: 25, + width: 35, + )), + ]) + : SizedBox() ], ), onTap: onTap, diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart index 0425794b..fe118973 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; +import 'package:url_launcher/url_launcher.dart'; class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { final PatiantInformtion patient; @@ -77,7 +78,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - // should call patient or show mobile number : patient.mobileNumber + launch("tel://" + patient.mobileNumber); }, child: Icon( Icons.phone, diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart index 230cce06..c1f746aa 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -124,7 +124,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: null, + route: MEDICAL_FILE, nameLine1: "Health", //TranslationBase.of(context).medicalReport, nameLine2: "Summery", @@ -135,7 +135,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: null, + route: REFER_PATIENT_TO_DOCTOR, nameLine1: TranslationBase.of(context).referral, nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), @@ -144,7 +144,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: null, + route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).approvals, icon: 'patient/vital_signs.png'), @@ -153,6 +153,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, + isDisable: true, route: null, nameLine1: "Discharge", nameLine2: "Summery", diff --git a/lib/widgets/shared/user-guid/in_patient_doctor_card.dart b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart new file mode 100644 index 00000000..cea72dd0 --- /dev/null +++ b/lib/widgets/shared/user-guid/in_patient_doctor_card.dart @@ -0,0 +1,199 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/patients/profile/large_avatar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +class InPatientDoctorCard extends StatelessWidget { + final String doctorName; + final String branch; + final DateTime appointmentDate; + final String profileUrl; + final String invoiceNO; + final String orderNo; + final Function onTap; + final bool isPrescriptions; + final String clinic; + final createdBy; + + InPatientDoctorCard( + {this.doctorName, + this.branch, + this.profileUrl, + this.invoiceNO, + this.onTap, + this.appointmentDate, + this.orderNo, + this.isPrescriptions = false, + this.clinic, + this.createdBy}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + color: Colors.white), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: InkWell( + onTap: onTap, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: AppText( + doctorName, + bold: true, + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + if (!isPrescriptions) + AppText( + '${DateUtils.getHour(appointmentDate)}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], + ), + ), + ], + ), + Row( + children: [ + AppText( + 'CreatedBy ', + //bold: true, + ), + Expanded( + child: AppText( + createdBy, + bold: true, + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // Container( + // child: LargeAvatar( + // name: doctorName, + // url: profileUrl, + // ), + // width: 55, + // height: 55, + // ), + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // if (orderNo != null && !isPrescriptions) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderNo + + // ": ", + // color: Colors.grey[500], + // fontSize: 14, + // ), + // AppText( + // orderNo ?? '', + // fontSize: 14, + // ) + // ], + // ), + // if (invoiceNO != null && !isPrescriptions) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context) + // .invoiceNo + + // ": ", + // fontSize: 14, + // color: Colors.grey[500], + // ), + // AppText( + // invoiceNO, + // fontSize: 14, + // ) + // ], + // ), + // if (clinic != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).clinic + + // ": ", + // color: Colors.grey[500], + // fontSize: 14, + // ), + // AppText( + // clinic, + // fontSize: 14, + // ) + // ], + // ), + // if (branch != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).branch + + // ": ", + // fontSize: 14, + // color: Colors.grey[500], + // ), + // AppText( + // branch, + // fontSize: 14, + // ) + // ], + // ) + ]), + ), + ), + Icon( + EvaIcons.eye, + ) + ], + ), + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index e9386145..d338a618 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -608,7 +608,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -900,7 +900,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1091,5 +1091,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <=2.11.0-213.1.beta" + dart: ">=2.10.0 <2.11.0" flutter: ">=1.22.0 <2.0.0"