From 0e2bcd79164182366886fa070d50f18275344729 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 21 Jun 2021 10:10:12 +0300 Subject: [PATCH] Fix Qr issues --- lib/config/config.dart | 4 ++-- .../model/patient_muse/PatientSearchRequestModel.dart | 8 +++++--- lib/core/viewModel/scan_qr_view_model.dart | 2 +- lib/screens/qr_reader/QR_reader_screen.dart | 6 ++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index eb361798..8241b36c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index c2658c9f..124f463a 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -9,6 +9,7 @@ class PatientSearchRequestModel { String from; String to; int searchType; + int projectID; String mobileNo; String identificationNo; int nursingStationID; @@ -28,7 +29,7 @@ class PatientSearchRequestModel { this.from = "0", this.to = "0", this.clinicID, - this.nursingStationID = 0}); + this.nursingStationID = 0,this.projectID=0}); PatientSearchRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; @@ -45,11 +46,12 @@ class PatientSearchRequestModel { identificationNo = json['IdentificationNo']; nursingStationID = json['NursingStationID']; clinicID = json['ClinicID']; + projectID = json['ProjectID']; } Map toJson() { final Map data = new Map(); - data['DoctorID'] = this.doctorID; + data['DoctorID'] = 0; data['FirstName'] = this.firstName; data['MiddleName'] = this.middleName; data['LastName'] = this.lastName; @@ -63,7 +65,7 @@ class PatientSearchRequestModel { data['IdentificationNo'] = this.identificationNo; data['NursingStationID'] = this.nursingStationID; data['ClinicID'] = this.clinicID; - data['ProjectID'] = 0; + data['ProjectID'] =this.projectID; return data; } } diff --git a/lib/core/viewModel/scan_qr_view_model.dart b/lib/core/viewModel/scan_qr_view_model.dart index 86e975e3..b49078c7 100644 --- a/lib/core/viewModel/scan_qr_view_model.dart +++ b/lib/core/viewModel/scan_qr_view_model.dart @@ -13,7 +13,7 @@ class ScanQrViewModel extends BaseViewModel { await getDoctorProfile(); setState(ViewState.Busy); - await _scanQrService.getInPatient(requestModel, true); + await _scanQrService.getInPatient(requestModel, isMyInpatient); if (_scanQrService.hasError) { error = _scanQrService.error; diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index c70563f9..3d50d53a 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -76,9 +76,6 @@ class _QrReaderScreenState extends State { } _scanQrAndGetPatient(BuildContext context, ScanQrViewModel model) async { - /// When give qr we will change this method to get data - /// var result = await BarcodeScanner.scan(); - /// int patientID = get from qr result var result = await BarcodeScanner.scan(); if (result != "") { List listOfParams = result.split(','); @@ -86,9 +83,10 @@ class _QrReaderScreenState extends State { if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]); PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel( patientID: patientID, + projectID: int.parse(listOfParams[0]) ); - await model.getInPatientList(patientSearchRequestModel, isMyInpatient: true).then((d) { + await model.getInPatientList(patientSearchRequestModel, isMyInpatient: false).then((d) { if (model.state != ViewState.ErrorLocal) { if (model.inPatientList.isEmpty) DrAppToastMsg.showErrorToast('No patient');