From 9f8482176b2525ecb399b072ed4560170255a2a4 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 11 Feb 2026 18:54:42 +0300 Subject: [PATCH] vida request changes. --- lib/core/model/referral/ReferralRequest.dart | 32 ++++++++++++++++++- .../sick_leave/sick_leave_patient_model.dart | 6 +++- lib/core/service/patient/ReferralService.dart | 11 +++++-- .../viewModel/patient-referral-viewmodel.dart | 5 +-- 4 files changed, 48 insertions(+), 6 deletions(-) diff --git a/lib/core/model/referral/ReferralRequest.dart b/lib/core/model/referral/ReferralRequest.dart index a51b4e94..f65917e8 100644 --- a/lib/core/model/referral/ReferralRequest.dart +++ b/lib/core/model/referral/ReferralRequest.dart @@ -81,7 +81,37 @@ class ReferralRequest { patientOutSA = json['PatientOutSA']; } - Map toJson() { + + Map toJsonForVidaThree() { + final Map data = new Map(); + data['RoomID'] = this.roomID; + data['ReferralClinic'] = this.referralClinic; + data['ReferralDoctor'] = this.referralDoctor; + data['CreatedBy'] = this.createdBy; + data['EditedBy'] = this.editedBy; + data['PatientID'] = this.patientID; + data['PatientTypeID'] = this.patientTypeID; + data['ReferringClinic'] = this.referringClinic; + data['ReferringDoctor'] = this.referringDoctor; + data['ProjectID'] = this.projectID; + data['AdmissionNo'] = this.admissionNo; + data['ReferringDoctorRemarks'] = this.referringDoctorRemarks; + data['Priority'] = this.priority; + data['Frequency'] = this.frequency; + data['Extension'] = this.extension; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + data['ToDate'] = this.toDate; + return data; + } + Map toJsonForVidaPlus() { final Map data = new Map(); data['RoomID'] = this.roomID; data['ReferralClinic'] = this.referralClinic; diff --git a/lib/core/model/sick_leave/sick_leave_patient_model.dart b/lib/core/model/sick_leave/sick_leave_patient_model.dart index 525ad448..8a42500c 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_model.dart @@ -87,7 +87,12 @@ class SickLeavePatientModel { SickLeavePatientModel.fromJson(Map json) { setupID = json['SetupID']; isExtendedLeave = json['isExtendedLeave']; + ///this was done with coordination of eservises they are not providing any value for the sick leave days + ///that's why to make the scope of changes smaller we are providing the same value for both variables noOfDays = json['noOfDays']; + sickLeaveDays = json['noOfDays']; + ///end of the changes + patientMRN = json['patientMRN']; status = json['status']; @@ -98,7 +103,6 @@ class SickLeavePatientModel { doctorID = json['DoctorID']; requestNo = json['RequestNo']; requestDate = json['RequestDate']; - sickLeaveDays = json['SickLeaveDays']; appointmentNo = (json['AppointmentNo'] ==null ? json['appointmentNo'] : json['AppointmentNo']); admissionNo = json['AdmissionNo']; actualDoctorRate = json['ActualDoctorRate']; diff --git a/lib/core/service/patient/ReferralService.dart b/lib/core/service/patient/ReferralService.dart index 6292125e..312dd072 100644 --- a/lib/core/service/patient/ReferralService.dart +++ b/lib/core/service/patient/ReferralService.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/referral/ReferralRequest.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; class ReferralService extends BaseService { @@ -42,8 +43,14 @@ class ReferralService extends BaseService { referralRequest.diseaseCode = diagnosisCode; referralRequest.diseaseDescription = diagnosisDescription; referralRequest.toDate = AppDateUtils.convertDateToServerFormat(DateTime.now()); - var json =referralRequest.toJson(); - json["Specialty"] = doctorProfile?.specialty?.first; + + Map json = {}; + if(ProjectViewModel.getVidaPlusStatus()) { + json = referralRequest.toJsonForVidaPlus(); + json["Specialty"] = doctorProfile?.specialty?.first; + }else{ + json = referralRequest.toJsonForVidaThree(); + } await baseAppClient.post( REFER_TO_DOCTOR, diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index eebc25e0..5ed21b44 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart'; import 'package:doctor_app_flutter/core/service/patient/patient-doctor-referral-service.dart'; import 'package:doctor_app_flutter/core/service/patient/patient_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:flutter/cupertino.dart'; @@ -300,8 +301,8 @@ class PatientReferralViewModel extends BaseViewModel { referringDoctorRemarks: remarks, priority: priority, frequency: frequencyCode, - diagnosisCode: diagnosis['selectedIcdCode'], - diagnosisDescription: diagnosis['selectedDisease'], + diagnosisCode: ProjectViewModel.getVidaPlusStatus()? diagnosis['selectedIcdCode']:null, + diagnosisDescription: ProjectViewModel.getVidaPlusStatus()?diagnosis['selectedDisease']: null , extension: ext, ); if (_referralService.hasError) {