vida request changes.

ipd-changes-for-vida-plus
Sultan Khan 4 days ago
parent 58f3f62120
commit 9f8482176b

@ -81,7 +81,37 @@ class ReferralRequest {
patientOutSA = json['PatientOutSA'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> toJsonForVidaThree() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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<String, dynamic> toJsonForVidaPlus() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['RoomID'] = this.roomID;
data['ReferralClinic'] = this.referralClinic;

@ -87,7 +87,12 @@ class SickLeavePatientModel {
SickLeavePatientModel.fromJson(Map<String, dynamic> 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'];

@ -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<String, dynamic> json = {};
if(ProjectViewModel.getVidaPlusStatus()) {
json = referralRequest.toJsonForVidaPlus();
json["Specialty"] = doctorProfile?.specialty?.first;
}else{
json = referralRequest.toJsonForVidaThree();
}
await baseAppClient.post(
REFER_TO_DOCTOR,

@ -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) {

Loading…
Cancel
Save