From 1ac94d9ec86f97cc5787d7d5f94099b9d17c3fa4 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 24 Mar 2021 10:53:32 +0300 Subject: [PATCH] bug fixes --- lib/config/config.dart | 3 ++ lib/core/service/patient_service.dart | 57 +++++++++++++++------------ 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 81dea160..56fe8bff 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -53,6 +53,9 @@ const GET_PRESCRIPTION_REPORT = const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; +const PRM_SEARCH_PATIENT = + 'Services/Patients.svc/REST/GetPatientInformation_PRM'; + const GET_PATIENT = 'Services/DoctorApplication.svc/REST/'; const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = diff --git a/lib/core/service/patient_service.dart b/lib/core/service/patient_service.dart index f18a9360..8370287a 100644 --- a/lib/core/service/patient_service.dart +++ b/lib/core/service/patient_service.dart @@ -87,13 +87,18 @@ class PatientService extends BaseService { ClinicByProjectIdRequest(); ReferToDoctorRequest _referToDoctorRequest; - Future getPatientList( patient, patientType) async { + Future getPatientList(patient, patientType, {isView}) async { hasError = false; int val = int.parse(patientType); - + var url; + if (isView == false && patientType == '1') { + url = PRM_SEARCH_PATIENT; + } else { + url = GET_PATIENT + SERVICES_PATIANT[val]; + } dynamic localRes; await baseAppClient.post( - GET_PATIENT + SERVICES_PATIANT[val], + url, onSuccess: (dynamic response, int statusCode) { localRes = response; }, @@ -101,28 +106,30 @@ class PatientService extends BaseService { hasError = true; super.error = error; }, - body:val ==7?patient: { - "ProjectID": patient.ProjectID, - "ClinicID": patient.ClinicID, - "DoctorID": patient.DoctorID, - "FirstName": patient.FirstName, - "MiddleName": patient.MiddleName, - "LastName": patient.LastName, - "PatientMobileNumber": patient.PatientMobileNumber, - "PatientIdentificationID": patient.PatientIdentificationID, - "PatientID": patient.PatientID, - "From": patient.From, - "To": patient.To, - "LanguageID": patient.LanguageID, - "stamp": patient.stamp, - "IPAdress": patient.IPAdress, - "VersionID": patient.VersionID, - "Channel": patient.Channel, - "TokenID": patient.TokenID, - "SessionID": patient.SessionID, - "IsLoginForDoctorApp": patient.IsLoginForDoctorApp, - "PatientOutSA": patient.PatientOutSA - }, + body: val == 7 + ? patient + : { + "ProjectID": patient.ProjectID, + "ClinicID": patient.ClinicID, + "DoctorID": patient.DoctorID, + "FirstName": patient.FirstName, + "MiddleName": patient.MiddleName, + "LastName": patient.LastName, + "PatientMobileNumber": patient.PatientMobileNumber, + "PatientIdentificationID": patient.PatientIdentificationID, + "PatientID": patient.PatientID, + "From": patient.From, + "To": patient.To, + "LanguageID": patient.LanguageID, + "stamp": patient.stamp, + "IPAdress": patient.IPAdress, + "VersionID": patient.VersionID, + "Channel": patient.Channel, + "TokenID": patient.TokenID, + "SessionID": patient.SessionID, + "IsLoginForDoctorApp": patient.IsLoginForDoctorApp, + "PatientOutSA": patient.PatientOutSA + }, ); return Future.value(localRes);