From 9a2cd1719b703052ad8f1575ded8b7ce5413592a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sat, 24 Apr 2021 22:03:18 +0300 Subject: [PATCH] procedure screen hot fix --- lib/config/config.dart | 2 + lib/core/model/sick_leave_patient_model.dart | 144 ++++++++++++++++++ .../sick_leave_patient_request_model.dart | 60 ++++++++ lib/core/service/sickleave_service.dart | 32 ++++ lib/screens/procedures/procedure_screen.dart | 5 +- 5 files changed, 240 insertions(+), 3 deletions(-) create mode 100644 lib/core/model/sick_leave_patient_model.dart create mode 100644 lib/core/model/sick_leave_patient_request_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 8b4bf1f9..6d48da3f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -265,6 +265,8 @@ const GET_PRESCRIPTION_IN_PATIENT = const GET_INSURANCE_IN_PATIENT = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/model/sick_leave_patient_model.dart b/lib/core/model/sick_leave_patient_model.dart new file mode 100644 index 00000000..e0637845 --- /dev/null +++ b/lib/core/model/sick_leave_patient_model.dart @@ -0,0 +1,144 @@ +class SickLeavePatientModel { + String setupID; + int projectID; + int patientID; + int patientType; + int clinicID; + int doctorID; + int requestNo; + String requestDate; + int sickLeaveDays; + int appointmentNo; + int admissionNo; + int actualDoctorRate; + String appointmentDate; + String clinicName; + String doctorImageURL; + String doctorName; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isLiveCareAppointment; + int noOfPatientsRate; + dynamic patientName; + String projectName; + String qR; + List speciality; + String strRequestDate; + + SickLeavePatientModel( + {this.setupID, + this.projectID, + this.patientID, + this.patientType, + this.clinicID, + this.doctorID, + this.requestNo, + this.requestDate, + this.sickLeaveDays, + this.appointmentNo, + this.admissionNo, + this.actualDoctorRate, + this.appointmentDate, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isLiveCareAppointment, + this.noOfPatientsRate, + this.patientName, + this.projectName, + this.qR, + this.speciality, + this.strRequestDate}); + + SickLeavePatientModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + patientType = json['PatientType']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + requestNo = json['RequestNo']; + requestDate = json['RequestDate']; + sickLeaveDays = json['SickLeaveDays']; + appointmentNo = json['AppointmentNo']; + admissionNo = json['AdmissionNo']; + actualDoctorRate = json['ActualDoctorRate']; + appointmentDate = json['AppointmentDate']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + noOfPatientsRate = json['NoOfPatientsRate']; + patientName = json['PatientName']; + projectName = json['ProjectName']; + qR = json['QR']; + speciality = json['Speciality'].cast(); + strRequestDate = json['StrRequestDate']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['RequestNo'] = this.requestNo; + data['RequestDate'] = this.requestDate; + data['SickLeaveDays'] = this.sickLeaveDays; + data['AppointmentNo'] = this.appointmentNo; + data['AdmissionNo'] = this.admissionNo; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['AppointmentDate'] = this.appointmentDate; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['PatientName'] = this.patientName; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + data['StrRequestDate'] = this.strRequestDate; + return data; + } +} diff --git a/lib/core/model/sick_leave_patient_request_model.dart b/lib/core/model/sick_leave_patient_request_model.dart new file mode 100644 index 00000000..ec588316 --- /dev/null +++ b/lib/core/model/sick_leave_patient_request_model.dart @@ -0,0 +1,60 @@ +class SickLeavePatientRequestModel { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + int deviceTypeID; + int patientType; + int patientTypeID; + String tokenID; + int patientID; + String sessionID; + + SickLeavePatientRequestModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.deviceTypeID, + this.patientType, + this.patientTypeID, + this.tokenID, + this.patientID, + this.sessionID}); + + SickLeavePatientRequestModel.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + deviceTypeID = json['DeviceTypeID']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + tokenID = json['TokenID']; + patientID = json['PatientID']; + sessionID = json['SessionID']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + data['TokenID'] = this.tokenID; + data['PatientID'] = this.patientID; + data['SessionID'] = this.sessionID; + return data; + } +} diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 1ea8669a..bba9b31f 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -1,4 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave_patient_model.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave_patient_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; @@ -16,6 +18,7 @@ class SickLeaveService extends BaseService { List reasonse = []; List get getAllSickLeave => _getAllsickLeave; List _getAllsickLeave = []; + List get coveringDoctorsList => _coveringDoctors; List _coveringDoctors = []; @@ -27,6 +30,14 @@ class SickLeaveService extends BaseService { dynamic get sickLeaveResponse => _sickLeaveResponse; dynamic _sickLeaveResponse; + + List get getAllSickLeavePatient => + _getAllsickLeavePatient; + List _getAllsickLeavePatient = []; + + SickLeavePatientRequestModel _sickLeavePatientRequestModel = + SickLeavePatientRequestModel(); + Future getStatistics(appoNo, patientMRN) async { hasError = false; await baseAppClient.post( @@ -104,6 +115,27 @@ class SickLeaveService extends BaseService { ); } + // Future getSickLeavePatient(patientMRN) async { + // _sickLeavePatientRequestModel = + // SickLeavePatientRequestModel(patientID: patientMRN, patientType: 1); + // hasError = false; + // await baseAppClient.post( + // GET_SICK_LEAVE_PATIENT, + // onSuccess: (dynamic response, int statusCode) { + // Future.value(response); + // _getAllsickLeavePatient.clear(); + // response['List_SickLeave'].forEach((v) { + // _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); + // }); + // }, + // onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, + // body: _sickLeavePatientRequestModel.toJson(), + // ); + // } + Future getRescheduleLeave() async { hasError = false; await baseAppClient.post( diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 0b3613f0..617e17d6 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -182,8 +182,7 @@ class ProcedureScreen extends StatelessWidget { doctorName: doctorNameP, ), ), - if (model.procedureList.length != 0 && - patient.patientStatusType != 43) + if (model.procedureList.isEmpty) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -194,7 +193,7 @@ class ProcedureScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), - child: AppText('No Procedure Found'), + child: AppText('No Procedure Found 0000'), ) ], ),