pushed reverted code

vida--4-ipd-reverted-test
Sultan Khan 3 months ago
parent 83f7c48bcf
commit b592b424a0

@ -6,6 +6,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/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/NavigationService.dart';
import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
@ -41,6 +42,8 @@ class BaseAppClient {
bool callLog = true;
try {
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (body?['MemberID'] == null) body?['MemberID'] = HospitalsService.memberId; // changed from null; because create update episode not working
String? token = await sharedPref.getString(TOKEN);
if(!isCustomRequest) {
if (profile != null) {
@ -93,10 +96,11 @@ class BaseAppClient {
body['SessionID'] = SESSION_ID.toString();
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP.toString();
body['PatientOutSA'] = body['PatientOutSA'] ?? '0'; // PATIENT_OUT_SA;
if (body['VidaAuthTokenID'] == null) {
print("the token is ${await sharedPref.getString(VIDA_AUTH_TOKEN_ID)}");
if (body['VidaAuthTokenID'] == null && await sharedPref.getString(VIDA_AUTH_TOKEN_ID) !=null) {
body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
}
if (body['VidaRefreshTokenID'] == null) {
if (body['VidaRefreshTokenID'] == null && await sharedPref.getString(VIDA_REFRESH_TOKEN_ID) !=null) {
body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
}
@ -125,7 +129,7 @@ class BaseAppClient {
// body['ProjectID'] = 12;
// body['DoctorID'] = 1002; //3844083
// body?['TokenID'] = "@dm!n";
// body['TokenID'] = "@dm!n";
// print("ProjectID :");
// print(body['ProjectID']);
@ -216,7 +220,7 @@ class BaseAppClient {
String? token = await sharedPref.getString(TOKEN);
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (body?['MemberID'] == null) body?['MemberID'] = HospitalsService.memberId;
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body!['DoctorID'] == null) {
@ -273,6 +277,10 @@ class BaseAppClient {
body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] ?? token : token;
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient!.patientId ?? patient.patientMRN;
body['PatientMRN'] = body['PatientMRN'] != null ? body['PatientMRN'] : patient!.patientId ?? patient.patientMRN;
if (body['ProjectID'] == null) {
body['ProjectID'] = patient?.projectId.toString();
}
body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it
body['SessionID'] = SESSION_ID; //getSe

@ -13,9 +13,7 @@ const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/';
// const BASE_URL = 'http://10.20.200.111:1010/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://webservices.hmg.com/';
//
@ -217,6 +215,7 @@ const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave";
const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient";
const PATIENT_MEDICAL_REPORT_GET_LIST = "Services/Patients.svc/REST/DAPP_ListMedicalReport";
const PATIENT_MEDICAL_REPORT_GET_LIST_VIDA_PLUS = "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New";
const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = "Services/Patients.svc/REST/DAPP_GetTemplateByID";
const PATIENT_MEDICAL_REPORT_INSERT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport";
const PATIENT_MEDICAL_REPORT_VERIFIED = "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport";
@ -259,6 +258,7 @@ const GET_DIAGNOSIS_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/Doctor
const GET_DIABETIC_CHART_VALUES = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues";
const GET_PENDING_ORDERS = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient";
const GET_PENDING_ORDERS_VIDA_PLUS = "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorProgressNote";
const GET_ADMISSION_ORDERS = "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders";
@ -413,7 +413,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 9.9;
const VERSION_ID = 10.5;
const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -1253,5 +1253,14 @@ const Map<String, Map<String, String>> localizedValues = {
"progressNoteCanNotBeEmpty": {"en": "Progress Note Can Not Be Empty", "ar":"تعذر تنفيذ الإجراء"},
"youHavePendingInterventions": {"en": "You Have Pending Interventions. That need your attention", "ar":"لديك تدخلات معلقة. التي تحتاج إلى اهتمامك"},
"open": {"en": "Open", "ar":"يفتح"},
"chiefComplaintLengthErrorMsg":{"en": "The text is too short; minimum 26 characters required.", "ar":"النص قصير جدًا؛ الحد الأدنى المطلوب هو 26 حرفًا."}
"chiefComplaintLengthErrorMsg":{"en": "The text is too short; minimum 26 characters required.", "ar":"النص قصير جدًا؛ الحد الأدنى المطلوب هو 26 حرفًا."},
"filterInPatient":{"en": "Select Dates", "ar":"حدد التواريخ."},
"remarksNotAdded": {
"en": "Remarks Not Added",
"ar": "لم تتم إضافة ملاحظات"
},
"addDoctorRemarks": {
"en": " Doctor Remarks",
"ar": " ملاحظات الطبيب"
}
};

@ -1,6 +1,7 @@
class PostChiefComplaintRequestModel {
int? appointmentNo;
int? episodeID;
String? pomrId;
int? patientMRN;
int? admissionNo;
String? chiefComplaint;
@ -24,7 +25,7 @@ class PostChiefComplaintRequestModel {
this.doctorID,
this.editedBy,
this.numberOfWeeks,
this.admissionNo});
this.admissionNo,this.pomrId});
PostChiefComplaintRequestModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo'];
@ -39,6 +40,7 @@ class PostChiefComplaintRequestModel {
doctorID = json['DoctorID'];
editedBy = json['EditedBy'];
admissionNo = json['AdmissionNo'];
pomrId = json[' String? pomrId;'];
}
Map<String, dynamic> toJson() {
@ -58,6 +60,7 @@ class PostChiefComplaintRequestModel {
data['isLactation'] = this.isLactation;
data['numberOfWeeks'] = this.numberOfWeeks;
data['DoctorID'] = this.doctorID;
data['pomrId'] = this.pomrId;
if (editedBy != null) {
data['EditedBy'] = this.editedBy;
}

@ -1,7 +1,7 @@
class GetEpisodeForInpatientReqModel {
int? patientID;
int? patientTypeID;
int? admissionNo;
dynamic? admissionNo;
GetEpisodeForInpatientReqModel(
{this.patientID, this.patientTypeID, this.admissionNo});

@ -64,7 +64,9 @@ class AdmissionOrdersRequestModel {
data['DeviceTypeID'] = this.deviceTypeID;
data['TokenID'] = this.tokenID;
data['PatientID'] = this.patientID;
data['PatientMRN'] = this.patientID;
data['AdmissionNo'] = this.admissionNo;
data['AdmissionRequestNo'] = this.admissionNo;
data['SessionID'] = this.sessionID;
data['ProjectID'] = this.projectID;
data['SetupID'] = this.setupID;

@ -50,4 +50,32 @@ class GetDiagnosisForInPatientResponseModel {
data['EditedOn'] = this.editedOn;
return data;
}
/*
*
* String? iCDCode10ID;
int? diagnosisTypeID;
int? conditionID;
bool? complexDiagnosis;
String? asciiDesc;
int? createdBy;
String? createdOn;
int? editedBy;
String? editedOn;
String? createdByName;
String? editedByName;
*/
GetDiagnosisForInPatientResponseModel.fromJsonForVidaPlus(json) {
iCDCode10ID = json['selectedIcdCode'];
diagnosisTypeID = json['DiagnosisTypeID'];
conditionID = json['ConditionID'];
complexDiagnosis = json['ComplexDiagnosis'];
asciiDesc = json['selectedDisease'];
createdBy = json['CreatedBy'];
createdOn = json['createdOn'];
editedBy = json['EditedBy'];
editedOn = json['EditedOn'];
createdByName = json['createdBy'];
editedByName = json['EditedByName'];
}
}

@ -3,11 +3,15 @@ class GetDischargeSummaryReqModel {
int? admissionNo;
int? patientType;
int? patientTypeID;
int? clinicId;
int? doctorId;
GetDischargeSummaryReqModel(
{this.patientID,
this.admissionNo,
this.patientType = 1,
this.clinicId = null,
this.doctorId = null,
this.patientTypeID = 1});
GetDischargeSummaryReqModel.fromJson(Map<String, dynamic> json) {
@ -15,14 +19,20 @@ class GetDischargeSummaryReqModel {
admissionNo = json['AdmissionNo'];
patientType = json['PatientType'];
patientTypeID = json['PatientTypeID'];
clinicId = json['ClinicID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
print("the clinic id is $clinicId");
print("the doctorId id is $doctorId");
data['PatientID'] = this.patientID;
data['PatientMRN'] = this.patientID;
data['AdmissionNo'] = this.admissionNo;
data['PatientType'] = this.patientType;
data['PatientTypeID'] = this.patientTypeID;
data['ClinicID'] = this.clinicId;
data['DoctorID'] = this.doctorId;
data['isDentalAllowedBackend'] = false;
return data;

@ -47,6 +47,7 @@ class InsuranceApprovalInPatientRequestModel {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientID'] = this.patientID;
data['PatientMRN'] = this.patientID;
data['PatientTypeID'] = this.patientTypeID;
data['EXuldAPPNO'] = this.eXuldAPPNO;
data['ProjectID'] = this.projectID;

@ -1,5 +1,6 @@
class GetNursingProgressNoteRequestModel {
int? patientID;
int? patientMRN;
int? admissionNo;
int? patientTypeID;
int? patientType;
@ -10,6 +11,7 @@ class GetNursingProgressNoteRequestModel {
this.admissionNo,
this.patientTypeID = 1,
this.patientType = 1,
this.patientMRN,
this.setupID});
GetNursingProgressNoteRequestModel.fromJson(Map<String, dynamic> json) {
@ -18,6 +20,7 @@ class GetNursingProgressNoteRequestModel {
patientTypeID = json['PatientTypeID'];
patientType = json['PatientType'];
setupID = json['SetupID'];
patientMRN = json['PatientMRN'];
}
Map<String, dynamic> toJson() {
@ -27,6 +30,7 @@ class GetNursingProgressNoteRequestModel {
data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType;
data['SetupID'] = this.setupID;
data['PatientMRN'] = this.patientMRN;
return data;
}
}

@ -1,3 +1,5 @@
import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
class NoteModel {
String? setupID;
int? projectID;
@ -73,6 +75,30 @@ class NoteModel {
conditionDescription = json['ConditionDescription'];
}
NoteModel.fromJsonForVidaPlusResponse(json){
setupID = json['SetupID'];
projectID = json['ProjectID'];
patientID = json['PatientID'];
patientType = json['PatientType'];
admissionNo = json['AdmissionNo'];
lineItemNo = json['LineItemNo'];
visitType = json['VisitType'];
notes = json['progressNote'];
assessmentDate = json['AssessmentDate'];
visitTime = json['VisitTime'];
status = json['Status'];
nursingRemarks = json['NursingRemarks'];
createdOn = json['CreatedOn'];
editedOn = json['EditedOn'];
createdBy = json['CreatedBy'];
admissionClinicID = int.parse(json['speciality'].isEmpty == true?"-1":json['speciality']);
admissionClinicName = json['specialityName'];
doctorClinicName = json['DoctorClinicName'];
doctorName = json['userFullName'];
visitTypeDesc = json['VisitTypeDesc'];
condition = int.parse(json['patientCondition'].isEmpty == true?"-1":json['patientCondition']);
conditionDescription = json['patientConditionName'];}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;

@ -17,6 +17,7 @@ class UpdateNoteReqModel {
bool? patientOutSA;
int? patientTypeID;
int? conditionId;
String? patientMRN;
UpdateNoteReqModel(
@ -37,7 +38,8 @@ class UpdateNoteReqModel {
this.isLoginForDoctorApp,
this.patientOutSA,
this.patientTypeID,
this.conditionId});
this.conditionId,
this.patientMRN});
UpdateNoteReqModel.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
@ -58,6 +60,7 @@ class UpdateNoteReqModel {
patientOutSA = json['PatientOutSA'];
patientTypeID = json['PatientTypeID'];
conditionId = json['ConditionId'];
patientMRN = json['PatientMRN'];
}
Map<String, dynamic> toJson() {
@ -80,6 +83,7 @@ class UpdateNoteReqModel {
data['PatientOutSA'] = this.patientOutSA;
data['PatientTypeID'] = this.patientTypeID;
data['ConditionId'] = this.conditionId;
data['PatientMRN'] = this.patientMRN;
return data;
}
}

@ -12,6 +12,12 @@ class GetReservationsRequestModel {
int? deviceTypeID;
String? tokenID;
String? sessionID;
int? patientMRN;
int? AdmissionRequestNo;
int? PatientTypeID;
int? ResultType;
int? AdmissionNo;
int? LoginDoctorID;
GetReservationsRequestModel(
{this.patientID,
@ -26,7 +32,14 @@ class GetReservationsRequestModel {
this.patientOutSA,
this.deviceTypeID,
this.tokenID,
this.sessionID});
this.patientMRN,
this.sessionID,
this.AdmissionRequestNo = 0,
this.PatientTypeID= 0,
this.ResultType = 0,
this.AdmissionNo = 0,
this.LoginDoctorID ,
});
GetReservationsRequestModel.fromJson(Map<String, dynamic> json) {
patientID = json['PatientID'];
@ -42,6 +55,7 @@ class GetReservationsRequestModel {
deviceTypeID = json['DeviceTypeID'];
tokenID = json['TokenID'];
sessionID = json['SessionID'];
patientMRN = json['PatientMRN'];
}
Map<String, dynamic> toJson() {
@ -59,6 +73,12 @@ class GetReservationsRequestModel {
data['DeviceTypeID'] = this.deviceTypeID;
data['TokenID'] = this.tokenID;
data['SessionID'] = this.sessionID;
data['PatientMRN'] = this.patientMRN;
data['AdmissionRequestNo'] = this.AdmissionRequestNo;
data['PatientTypeID'] = this.PatientTypeID;
data['ResultType'] = this.ResultType;
data['AdmissionNo'] = this.AdmissionNo;
data['LoginDoctorID'] = this.LoginDoctorID;
return data;
}
}

@ -101,7 +101,7 @@ class GetReservationsResponseModel {
editedOn = json['EditedOn'];
patientName = json['PatientName'];
patientNameN = json['PatientNameN'];
gender = json['Gender'];
gender = json['Gender']?.toString()??"";
dateofBirth = json['DateofBirth'];
mobileNumber = json['MobileNumber'];
emailAddress = json['EmailAddress'];

@ -55,6 +55,7 @@ class PatiantInformtion {
int? patientType;
int? patientMRN;
String? admissionNo;
int? admissionID;
String? admissionDate;
DateTime? admissionDateWithDateTimeForm;
String? createdOn;
@ -80,6 +81,12 @@ class PatiantInformtion {
int? vcId;
String? voipToken;
String? pomrId;
int? rowId;
int? createdBy;
int? editedBy;
String? editedOn;
PatiantInformtion(
{this.patientDetails,
this.projectId,
@ -156,7 +163,8 @@ class PatiantInformtion {
this.voipToken,
this.admissionDateWithDateTimeForm,
this.appointmentDateWithDateTimeForm,
this.pomrId
this.pomrId,
this.admissionID
});
PatiantInformtion.fromJson(Map<String, dynamic> json) {
@ -264,7 +272,7 @@ class PatiantInformtion {
consultationNotes = json['ConsultationNotes'];
patientStatus = json['PatientStatus'];
voipToken = json['VoipToken'];
pomrId = json['pomrId'];
pomrId = json['pomrId']??(json["PatientPomrID"]?.toString());
admissionDateWithDateTimeForm = json["AdmissionDate"] != null
? AppDateUtils.convertStringToDate(json["AdmissionDate"])
: json["admissionDate"] != null
@ -274,6 +282,10 @@ class PatiantInformtion {
appointmentDateWithDateTimeForm = json["AppointmentDate"] != null
? AppDateUtils.convertStringToDate(json["AppointmentDate"])
: null;
rowId = json['RowID'];
createdBy = json['CreatedBy'];
editedBy = json['EditedBy'];
admissionID = json['AdmissionID'];
}
}

@ -56,6 +56,8 @@ class ProgressNoteRequest {
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['PatientOutSA'] = this.patientOutSA;
data['PatientTypeID'] = this.patientTypeID;
return data;
}
}

@ -15,6 +15,8 @@ class PatientSearchRequestModel {
int? nursingStationID;
int? clinicID = 0;
int? loginDoctorID;
int? pageIndex;
int? pageSize;
PatientSearchRequestModel(
@ -27,12 +29,16 @@ class PatientSearchRequestModel {
this.patientID = 0,
this.searchType = 1,
this.mobileNo = "",
this.identificationNo = "0",
this.from = "0",
this.to = "0",
this.clinicID,
this.identificationNo = "",
this.from = "",
this.to = "",
this.clinicID = 0,
this.nursingStationID = 0,
this.projectID, this.loginDoctorID});
this.projectID,
this.loginDoctorID,
this.pageIndex = 0 ,
this.pageSize = 10
});
PatientSearchRequestModel.fromJson(Map<String, dynamic> json) {
doctorID = json['DoctorID'];
@ -51,11 +57,14 @@ class PatientSearchRequestModel {
clinicID = json['ClinicID'];
projectID = json['ProjectID'];
loginDoctorID = json['LoginDoctorID'];
pageIndex = json['PageIndex'];
pageSize = json['PageSize'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['DoctorID'] = this.doctorID;
data['MemberID'] = this.doctorID;
data['FirstName'] = this.firstName;
data['MiddleName'] = this.middleName;
data['LastName'] = this.lastName;
@ -71,6 +80,8 @@ class PatientSearchRequestModel {
data['ClinicID'] = this.clinicID;
data['ProjectID'] = this.projectID;
data['LoginDoctorID'] = this.loginDoctorID;
data['PageIndex'] = this.pageIndex;
data['PageSize'] = this.pageSize;
return data;
}
}

@ -64,6 +64,7 @@ class PendingOrderRequestModel {
data['DeviceTypeID'] = this.deviceTypeID;
data['TokenID'] = this.tokenID;
data['PatientID'] = this.patientID;
data['PatientMRN'] = this.patientID;
data['AdmissionNo'] = this.admissionNo;
data['SessionID'] = this.sessionID;
data['ProjectID'] = this.projectID;

@ -23,6 +23,10 @@ class ReferralRequest {
String? sessionID;
bool? isLoginForDoctorApp;
bool? patientOutSA;
String? diseaseDescription;
String? diseaseCode;
String? toDate;
ReferralRequest(
{this.roomID,
@ -103,6 +107,9 @@ class ReferralRequest {
data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['PatientOutSA'] = this.patientOutSA;
data['Diagnosis'] = this.diseaseDescription;
data['DiagnosisCode'] = this.diseaseCode;
data['ToDate'] = this.toDate;
return data;
}
}

@ -5,11 +5,15 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_mo
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class HospitalsService extends BaseService {
static String memberId = "";
List<GetHospitalsResponseModel> hospitals = [];
List<VidaPlusProjectListModel> vidaPlusProjectListModel = [];
Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async {
memberId = getHospitalsRequestModel.memberID??"";
hasError = false;
await baseAppClient.post(
GET_PROJECTS,

@ -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/utils/date-utils.dart';
class ReferralService extends BaseService {
Future referralPatient(
@ -15,8 +16,11 @@ class ReferralService extends BaseService {
int? priority,
int? frequency,
String? referringDoctorRemarks,
String? extension}) async {
// await getDoctorProfile();
String? extension,
String? diagnosisCode,
String? diagnosisDescription}) async {
// await getDoctorProfile();
print("the referralClinic is $referralClinic");
ReferralRequest referralRequest = ReferralRequest();
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile!);
@ -35,6 +39,11 @@ class ReferralService extends BaseService {
referralRequest.editedBy = doctorProfile!.doctorID;
referralRequest.createdBy = doctorProfile!.doctorID;
referralRequest.patientOutSA = false;
referralRequest.diseaseCode = diagnosisCode;
referralRequest.diseaseDescription = diagnosisDescription;
referralRequest.toDate = AppDateUtils.convertDateToServerFormat(DateTime.now());
var json =referralRequest.toJson();
json["Specialty"] = doctorProfile?.specialty?.first;
await baseAppClient.post(
REFER_TO_DOCTOR,
@ -43,7 +52,7 @@ class ReferralService extends BaseService {
hasError = true;
super.error = error;
},
body: referralRequest.toJson(),
body: json,
);
}
}

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/lookups/hospital_lookup.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
@ -72,6 +73,7 @@ class PatientReferralService extends LookupService {
await baseAppClient.post(
PROJECT_GET_INFO,
onSuccess: (dynamic response, int statusCode) {
print("the response is ${response['ProjectInfo'][0]['facilityGroupId']}");
setupID = response['ProjectInfo'][0]['facilityGroupId'];
},
onFailure: (String error, int statusCode) {

@ -2,12 +2,14 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:flutter/material.dart';
class PatientInPatientService extends BaseService {
List<PatiantInformtion> inPatientList = [];
List<PatiantInformtion> myInPatientList = [];
Future getInPatientList(PatientSearchRequestModel requestModel, bool isMyInpatient) async {
Future getInPatientList(PatientSearchRequestModel requestModel, bool isMyInpatient,
{bool isVidaPlusProject = false}) async {
hasError = false;
await getDoctorProfile(isGetProfile: true);
requestModel.loginDoctorID = doctorProfile!.doctorID;

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/model/SOAP/assessment/patient_previous_diagnosis.dart';
import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesRequestModel.dart';
import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart';
import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart';
@ -27,6 +28,7 @@ import 'package:doctor_app_flutter/core/model/patient/refer_to_doctor_request.da
import 'package:doctor_app_flutter/core/model/patient/vital_sign/vital_sign_res_model.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:flutter/material.dart';
class PatientService extends BaseService {
List<VitalSignResModel> _patientVitalSignList = [];
@ -339,6 +341,29 @@ class PatientService extends BaseService {
);
}
Future getVidaPlusProgressNote(patient) async {
hasError = false;
await baseAppClient.post(
GET_PROGRESS_NOTE,
onSuccess: (dynamic response, int statusCode) {
_patientProgressNoteList = [];
// _patientProgressNoteList =
response['ListProgressNote']['resultData'].forEach((v) {
v['data'].forEach((response) {
_patientProgressNoteList.add(new NoteModel.fromJsonForVidaPlusResponse(response));
});
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future updatePatientProgressNote(UpdateNoteReqModel req) async {
hasError = false;
@ -524,6 +549,42 @@ class PatientService extends BaseService {
);
}
getDiagnosis(PatiantInformtion patient) async {
Map<String, dynamic> request = {
// "hospitalGroupId": 105,
// "hospitalId": 313,
// "patientId": 70023498,
// "patientPomrId": 9907,
// "startRow": 0,
// "endRow": 10,
// "isSelected": true,
// "ProjectID": 313
"hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
"hospitalId": patient.projectId,
"patientId": patient.patientId,
"patientPomrId": patient.pomrId,
"startRow": 0,
"endRow": 1000000,
"ProjectID": patient.projectId
};
List<dynamic> dynamicResponse = [];
hasError = false;
await baseAppClient.post(GET_LIST_OF_DIAGNOSIS,
onSuccess: (dynamic response, int statusCode) {
_diagnosisForInPatientList.clear();
dynamicResponse = response['ListDiagnosisDetailsSearch']['resultData'];
response['ListDiagnosisDetailsSearch']['resultData'].forEach((v) =>
_diagnosisForInPatientList.add(GetDiagnosisForInPatientResponseModel.fromJsonForVidaPlus(v)));
}, onFailure: (String error, int statusCode) {
_diagnosisForInPatientList.clear();
hasError = true;
super.error = error;
}, body: request);
return dynamicResponse;
}
Future getDiabeticChartValues(GetDiabeticChartValuesRequestModel getDiabeticChartValuesRequestModel) async {
hasError = false;
@ -559,4 +620,38 @@ class PatientService extends BaseService {
body: stpMasterListRequestModel.toJson(),
);
}
Future<bool> createProgressNote(
CreateNoteModel data,
PatiantInformtion patient,
) async {
var profile = await getDoctorProfile();
Map<String, dynamic> request = {
"planNote": data.notes,
"PatientMRN": patient.patientMRN,
"EpisodeID": patient.pomrId,
"CreatedByName": patient.doctorName,
"CreatedBy": patient.doctorId,
"Speciality": patient.clinicId,
"ProgressNotesTypes": "DOCTOR_NOTE",
"PatientCondition": data.conditionId,
"ProjectID": patient.projectId
};
var success = false;
await baseAppClient.post(CREATE_PROGRESS_NOTE,
onSuccess: (dynamic response, int statusCode) {
if (response['ListCreateProgressNote'] != null) {
// DrAppToastMsg.showSuccesToast(
// response['ListCreateProgressNote']['message']);
success = true;
}
}, onFailure: (String error, int statusCode) {
success = false;
hasError = true;
super.error = error;
}, body: request);
return success;
}
}

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/operation_report/create_update_operation_report_request_model.dart';
import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_request_modle.dart';
@ -6,6 +7,8 @@ import 'package:doctor_app_flutter/core/model/operation_report/get_operation_det
import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart';
import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_request_model.dart';
import '../../../../config/shared_pref_kay.dart' show DOCTOR_PROFILE;
class OperationReportService extends BaseService {
List<GetReservationsResponseModel> _reservationList = [];
@ -18,9 +21,12 @@ class OperationReportService extends BaseService {
Future getReservations(
{GetReservationsRequestModel? getReservationsRequestModel,
int? patientId}) async {
int? patientId, int? patientMRN}) async {
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile!);
getReservationsRequestModel =
GetReservationsRequestModel(patientID: patientId);
GetReservationsRequestModel(patientID: patientId,patientMRN: patientMRN, LoginDoctorID: doctorProfile.doctorID);
hasError = false;
await baseAppClient.post(GET_RESERVATIONS,

@ -9,14 +9,15 @@ class PatientMedicalReportService extends BaseService {
List<MedicalReportModel> medicalReportList = [];
List<MedicalReportTemplate> medicalReportTemplate = [];
Future getMedicalReportList(PatiantInformtion patient) async {
Future getMedicalReportList(PatiantInformtion patient, bool isVidaPlusProject) async {
hasError = false;
Map<String, dynamic> body = Map();
await getDoctorProfile();
body['AdmissionNo'] = patient.admissionNo;
body['AdmissionNo'] = isVidaPlusProject ?patient.admissionID : patient.admissionNo;
body['SetupID'] = doctorProfile!.setupID;
// body['ProjectID'] = doctorProfile!.projectID;
body['ProjectID'] = doctorProfile!.projectID;
medicalReportList = [];
await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) {
if (response['DAPP_ListMedicalReportList'] != null) {
response['DAPP_ListMedicalReportList'].forEach((v) {
@ -33,8 +34,7 @@ class PatientMedicalReportService extends BaseService {
Future getMedicalReportTemplate() async {
hasError = false;
Map<String, dynamic> body = Map();
body['SetupID'] = "91877";
body['TemplateID'] = 43;
await baseAppClient.post(PATIENT_MEDICAL_REPORT_GET_TEMPLATE, onSuccess: (dynamic response, int statusCode) {
medicalReportTemplate.clear();
@ -62,11 +62,11 @@ class PatientMedicalReportService extends BaseService {
}, body: body, patient: patient);
}
Future verifyMedicalReport(PatiantInformtion patient, MedicalReportModel medicalReport) async {
Future verifyMedicalReport(PatiantInformtion patient, MedicalReportModel medicalReport, bool? isVidaPlusProject,) async {
hasError = false;
Map<String, dynamic> body = Map();
body['SetupID'] = "91877";
body['AdmissionNo'] = patient.admissionNo;
body['AdmissionNo'] = isVidaPlusProject == true? patient.admissionID : patient.admissionNo;
body['InvoiceNo'] = medicalReport.invoiceNo;
body['LineItemNo'] = medicalReport.lineItemNo;
if (body['ProjectID'] == null) {
@ -80,7 +80,7 @@ class PatientMedicalReportService extends BaseService {
}, body: body, patient: patient);
}
Future addMedicalReport(PatiantInformtion patient, String htmlText) async {
Future addMedicalReport(PatiantInformtion patient, String htmlText, bool? isVidaPlusProject) async {
hasError = false;
Map<String, dynamic> body = Map();
body['SetupID'] = body.containsKey('SetupID')
@ -88,15 +88,21 @@ class PatientMedicalReportService extends BaseService {
? body['SetupID']
: SETUP_ID
: SETUP_ID;
body['AdmissionNo'] = int.parse(patient.admissionNo!);
print("isVidaPlusProject $isVidaPlusProject");
body['AdmissionNo'] = isVidaPlusProject == true? patient.admissionID ?? -1 :int.parse(patient.admissionNo!);
print('the admission no is ${body['AdmissionNo']}');
body['MedicalReportHTML'] = htmlText;
body['ProjectID'] = patient.projectId;
body['PatientID'] = patient.patientId;
body['DoctorID'] = patient.doctorId;
if(isVidaPlusProject == true) {
body['PatientType'] = patient.patientType;
}
await baseAppClient.postPatient(INSERT_MEDICAL_REPORT, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
await baseAppClient.post(INSERT_MEDICAL_REPORT, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error.toString();
}, body: body, patient: patient);
}, body: body);
}
Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async {

@ -359,11 +359,11 @@ class PrescriptionService extends LookupService {
}, body: body);
}
Future getMedicationForInPatient(PatiantInformtion patient) async {
Future getMedicationForInPatient(PatiantInformtion patient, {required bool isVidaPlusProject}) async {
hasError = false;
_getMedicationForInPatientRequestModel = GetMedicationForInPatientRequestModel(
isDentalAllowedBackend: false,
admissionNo: int.parse(patient.admissionNo!),
admissionNo: isVidaPlusProject ? patient.admissionID : int.parse(patient.admissionNo!),
projectID: patient.projectId,
);
await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, patient: patient, onSuccess: (dynamic response, int statusCode) {

@ -37,6 +37,29 @@ class PendingOrderService extends BaseService {
}, body: pendingOrderRequestModel.toJson());
}
Future getPendingOrdersForVidaPlus({PendingOrderRequestModel? pendingOrderRequestModel, int? patientId, int? admissionNo,}) async {
pendingOrderRequestModel = PendingOrderRequestModel(
patientID: patientId,
admissionNo: admissionNo,
patientTypeID: 1,
patientType: 1,
);
hasError = false;
await baseAppClient.post(GET_PENDING_ORDERS_VIDA_PLUS, onSuccess: (dynamic response, int statusCode) {
print("Success");
_pendingOrderList.clear();
response['List_DoctorProgressNote'].forEach(
(v) {
_pendingOrderList.add(PendingOrderModel.fromJson(v));
},
);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: pendingOrderRequestModel.toJson());
}
Future getAdmissionOrders({AdmissionOrdersRequestModel? admissionOrdersRequestModel, int? patientId, int? admissionNo}) async {
admissionOrdersRequestModel = AdmissionOrdersRequestModel(
patientID: patientId,

@ -15,9 +15,9 @@ class PatientMedicalReportViewModel extends BaseViewModel {
List<MedicalReportTemplate> get medicalReportTemplate =>
_service.medicalReportTemplate;
Future getMedicalReportList(PatiantInformtion patient) async {
Future getMedicalReportList(PatiantInformtion patient,{bool isVidaPlusProject = false}) async {
setState(ViewState.Busy);
await _service.getMedicalReportList(patient);
await _service.getMedicalReportList(patient, isVidaPlusProject);
if (_service.hasError) {
error = _service.error;
setState(ViewState.ErrorLocal); // ViewState.Error
@ -46,41 +46,41 @@ class PatientMedicalReportViewModel extends BaseViewModel {
}
Future verifyMedicalReport(
PatiantInformtion patient, MedicalReportModel medicalReport) async {
PatiantInformtion patient, MedicalReportModel medicalReport, bool? isVidaPlusProject) async {
setState(ViewState.Busy);
await _service.verifyMedicalReport(patient, medicalReport);
await _service.verifyMedicalReport(patient, medicalReport, isVidaPlusProject);
if (_service.hasError) {
error = _service.error;
setState(ViewState.ErrorLocal);
} else
await getMedicalReportList(patient);
await getMedicalReportList(patient, isVidaPlusProject: isVidaPlusProject == true);
setState(ViewState.Idle);
}
Future addMedicalReport(PatiantInformtion patient, String htmlText) async {
Future addMedicalReport(PatiantInformtion patient, String htmlText, bool? isVidaPlusProject) async {
setState(ViewState.Busy);
await _service.addMedicalReport(patient, htmlText);
await _service.addMedicalReport(patient, htmlText, isVidaPlusProject);
if (_service.hasError) {
error = _service.error;
await getMedicalReportList(patient);
await getMedicalReportList(patient, isVidaPlusProject: isVidaPlusProject == true);
setState(ViewState.ErrorLocal);
} else {
await getMedicalReportList(patient);
await getMedicalReportList(patient,isVidaPlusProject: isVidaPlusProject == true);
setState(ViewState.Idle);
}
}
Future updateMedicalReport(PatiantInformtion patient, String htmlText,
int limitNumber, String invoiceNumber) async {
int limitNumber, String invoiceNumber, bool? isVidaPlusProject) async {
setState(ViewState.Busy);
await _service.updateMedicalReport(
patient, htmlText, limitNumber, invoiceNumber);
if (_service.hasError) {
error = _service.error;
await getMedicalReportList(patient);
await getMedicalReportList(patient, isVidaPlusProject: isVidaPlusProject == true);
setState(ViewState.ErrorLocal);
} else {
await getMedicalReportList(patient);
await getMedicalReportList(patient,isVidaPlusProject: isVidaPlusProject == true);
setState(ViewState.Idle);
}
}

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_s
import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_mapping_List_Respose_Model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import '../../locator.dart';
import 'base_view_model.dart';
@ -132,14 +133,14 @@ class PatientSearchViewModel extends BaseViewModel {
List<PatiantInformtion> filteredInPatientItems = [];
List<PatiantInformtion> filteredMyInPatientItems = [];
Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false, bool isLocalBusy = false}) async {
Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false, bool isLocalBusy = false, bool isVidaPlusProject = false, bool isForceFullRefresh = false}) async {
await getDoctorProfile();
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
}
if (inPatientList.length == 0) await _inPatientService.getInPatientList(requestModel, false);
if (inPatientList.length == 0 || isForceFullRefresh) await _inPatientService.getInPatientList(requestModel, false, isVidaPlusProject: isVidaPlusProject);
if (_inPatientService.hasError) {
error = _inPatientService.error;
if (isLocalBusy) {
@ -342,4 +343,10 @@ class PatientSearchViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
flushSelectedDates(){
selectedFromDate = null;
selectedToDate = null;
}
}

@ -430,12 +430,14 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getEpisodeForInpatient(PatiantInformtion patient) async {
Future getEpisodeForInpatient(PatiantInformtion patient, bool isVidaPlusProject ) async {
setState(ViewState.BusyLocal);
var admissionNo = (isVidaPlusProject)? (patient.admissionID??"-1"):int.parse( (patient.admissionNo??"-1")) ;
GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel =
GetEpisodeForInpatientReqModel(
patientID: patient.patientId,
admissionNo: int.parse(patient.admissionNo!),
admissionNo: admissionNo,
patientTypeID: 1);
await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel);
if (_SOAPService.hasError) {
@ -932,6 +934,7 @@ class SOAPViewModel extends BaseViewModel {
isLactation: false,
ispregnant: false,
doctorID: '',
pomrId: patientInfo.pomrId,
numberOfWeeks: 0);
}

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart';
import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/clinic-doctor.dart';
@ -11,6 +13,7 @@ import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService
import 'package:doctor_app_flutter/core/service/patient/MyReferralPatientService.dart';
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/utils/translations_delegate_base_utils.dart';
import 'package:flutter/cupertino.dart';
@ -48,6 +51,31 @@ class PatientReferralViewModel extends BaseViewModel {
List<PatiantInformtion> get patientArrivalList => _referralPatientService.patientArrivalList;
PatientService _patientService = locator<PatientService>();
List<dynamic> diagnosisForInPatientList = [];
Future getDiagnosisForInPatient(
GetDiagnosisForInPatientRequestModel requestModel, bool isVidaPlusProject, PatiantInformtion patient) async {
await getDoctorProfile();
setState(ViewState.Busy);
List<dynamic> response = [];
if(isVidaPlusProject){
response = await _patientService.getDiagnosis(patient);
}
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.ErrorLocal);
} else {
diagnosisForInPatientList = response;
setState(ViewState.Idle);
}
}
Future getPatientReferral(PatiantInformtion patient) async {
setState(ViewState.Busy);
await _referralPatientService.getPatientReferral(patient);
@ -222,7 +250,7 @@ class PatientReferralViewModel extends BaseViewModel {
}
}
Future makeInPatientReferral(
Future makeInPatientReferral(bool isVidaPlusProject,
{PatiantInformtion? patient,
int? projectID,
int? clinicID,
@ -232,7 +260,8 @@ class PatientReferralViewModel extends BaseViewModel {
String? referralDate,
String? remarks,
String? ext,
bool isLocalBusy = false}) async {
bool isLocalBusy = false,
dynamic? diagnosis}) async {
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
@ -241,12 +270,14 @@ class PatientReferralViewModel extends BaseViewModel {
patientID: patient!.patientId,
roomID: patient.roomId,
referralClinic: clinicID,
admissionNo: int.parse(patient.admissionNo!),
admissionNo: isVidaPlusProject?patient.admissionID:int.parse(patient.admissionNo!),
referralDoctor: doctorID,
patientTypeID: patient.patientType,
referringDoctorRemarks: remarks,
priority: priority,
frequency: frequencyCode,
diagnosisCode: diagnosis['selectedIcdCode'],
diagnosisDescription: diagnosis['selectedDisease'],
extension: ext,
);
if (_referralService.hasError) {

@ -19,6 +19,7 @@ import 'package:doctor_app_flutter/core/model/patient/vital_sign/vital_sign_res_
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/patient/patient_service.dart';
import '../../config/shared_pref_kay.dart';
import '../../locator.dart';
import '../model/note/stp_master_list_req_model.dart';
import '../model/note/stp_master_list_res_model.dart';
@ -156,14 +157,27 @@ class PatientViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPatientProgressNote(patient, {bool isLocalBusy = false}) async {
Future getPatientProgressNote(patientRequest,PatiantInformtion patient,
{bool isLocalBusy = false, bool isVidaPlus = false}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
}
await _patientService.getPatientProgressNote(patient);
if (isVidaPlus) {
Map<String, dynamic> request = {
"hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID),
"hospitalId": patient.projectId,
"patientId": patient.patientId,
"patientPomrId": patient.pomrId,
"endRow": 10000, // because no information is provided for the end row
"startRow": 0,
"ProjectID": patient.projectId
};
await _patientService.getVidaPlusProgressNote(request);
} else {
await _patientService.getPatientProgressNote(patientRequest);
}
if (_patientService.hasError) {
error = _patientService.error;
if (isLocalBusy) {
@ -185,9 +199,14 @@ class PatientViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future createPatientProgressNote(CreateNoteModel req) async {
Future createPatientProgressNote(CreateNoteModel req, PatiantInformtion patient,
{bool isVidaPlus = false}) async {
setState(ViewState.BusyLocal);
await _patientService.createPatientProgressNote(req);
if (isVidaPlus) {
await _patientService.createProgressNote(req, patient);
} else {
await _patientService.createPatientProgressNote(req);
}
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.ErrorLocal);
@ -326,11 +345,16 @@ class PatientViewModel extends BaseViewModel {
}
Future getDiagnosisForInPatient(
GetDiagnosisForInPatientRequestModel requestModel) async {
GetDiagnosisForInPatientRequestModel requestModel, bool isVidaPlusProject, PatiantInformtion patient) async {
await getDoctorProfile();
setState(ViewState.Busy);
await _patientService.getDiagnosisForInPatient(requestModel);
if(isVidaPlusProject){
await _patientService.getDiagnosis(patient);
}else {
await _patientService.getDiagnosisForInPatient(requestModel);
}
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.ErrorLocal);
@ -340,7 +364,7 @@ class PatientViewModel extends BaseViewModel {
}
Future getDiabeticChartValues(PatiantInformtion patient, int resultType,
{bool isLocalBusy = false}) async {
{bool isLocalBusy = false, bool isVidaPlusProject = false}) async {
await getDoctorProfile();
if (isLocalBusy)
setState(ViewState.BusyLocal);
@ -350,9 +374,8 @@ class PatientViewModel extends BaseViewModel {
GetDiabeticChartValuesRequestModel requestModel =
GetDiabeticChartValuesRequestModel(
patientID: patient.patientId,
admissionNo: int.parse(patient.admissionNo!),
admissionNo:isVidaPlusProject? patient.admissionID ?? -1 : int.parse(patient.admissionNo!),
patientTypeID: 1,
patientType: 1,
resultType: resultType,
);
await _patientService.getDiabeticChartValues(requestModel);

@ -15,11 +15,19 @@ class PendingOrdersViewModel extends BaseViewModel {
List<AdmissionOrdersModel> get admissionOrderList =>
_pendingOrderService.admissionOrderList;
Future getPendingOrders({required int patientId, required int admissionNo}) async {
Future getPendingOrders(
{required int patientId,
required int admissionNo,
required bool isVidaPlus}) async {
hasError = false;
setState(ViewState.Busy);
await _pendingOrderService.getPendingOrders(
patientId: patientId, admissionNo: admissionNo);
if (isVidaPlus) {
await _pendingOrderService.getPendingOrdersForVidaPlus(
patientId: patientId, admissionNo: admissionNo);
} else {
await _pendingOrderService.getPendingOrders(
patientId: patientId, admissionNo: admissionNo);
}
if (_pendingOrderService.hasError) {
error = _pendingOrderService.error;
setState(ViewState.ErrorLocal);

@ -155,9 +155,9 @@ class PrescriptionViewModel extends BaseViewModel {
}
}
getMedicationForInPatient(PatiantInformtion patient) async {
getMedicationForInPatient(PatiantInformtion patient, bool isVidaPlusProject) async {
setState(ViewState.Busy);
await _prescriptionService.getMedicationForInPatient(patient);
await _prescriptionService.getMedicationForInPatient(patient, isVidaPlusProject: isVidaPlusProject);
if (_prescriptionService.hasError) {
error = _prescriptionService.error!;
setState(ViewState.Error);

@ -18,11 +18,14 @@ class DischargeSummaryViewModel extends BaseViewModel {
Future getPendingDischargeSummary({
required int patientId,
required int admissionNo,
required int admissionNo, required int? clinicId, required int? doctorId,
}) async {
print("the clinic id is $clinicId");
print("the doctorId id is $doctorId");
GetDischargeSummaryReqModel getDischargeSummaryReqModel =
GetDischargeSummaryReqModel(
admissionNo: admissionNo, patientID: patientId);
admissionNo: admissionNo, patientID: patientId, clinicId: clinicId , doctorId:doctorId);
hasError = false;
setState(ViewState.Busy);
await _dischargeSummaryService.getPendingDischargeSummary(

@ -21,7 +21,7 @@ class OperationReportViewModel extends BaseViewModel {
Future getReservations(int patientId) async {
hasError = false;
setState(ViewState.Busy);
await _operationReportService.getReservations(patientId: patientId);
await _operationReportService.getReservations(patientId: patientId, patientMRN: patientId);
if (_operationReportService.hasError) {
error = _operationReportService.error;
setState(ViewState.ErrorLocal);

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -36,6 +37,7 @@ import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart';
import 'package:provider/provider.dart';
import 'package:sticky_headers/sticky_headers/widget.dart';
import '../../locator.dart';
import '../../utils/notification_permission_utils.dart';
import '../video_call_zoom/zoom_video_call.dart';
import '../patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
@ -94,7 +96,7 @@ class _HomeScreenState extends State<HomeScreen> {
}
}
});
startZoom();
//startZoom();
});
},
builder: (_, model, w) => AppScaffold(
@ -418,14 +420,16 @@ class _HomeScreenState extends State<HomeScreen> {
));
changeColorIndex();
if (model.doctorProfile != null && !Utils.isVidaPlusInPatientProject(projectsProvider, model.doctorProfile!.projectID!)) {
patientCards.add(HomePatientCard(
if (model.doctorProfile != null) {
patientCards.add(
HomePatientCard(
gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.inpatient,
textColor: textColors[colorIndex],
text: TranslationBase.of(context).myInPatient,
onTap: () {
locator<PatientSearchViewModel>().flushSelectedDates();
Navigator.push(
context,
FadePage(
@ -487,7 +491,7 @@ class _HomeScreenState extends State<HomeScreen> {
text: TranslationBase.of(context).myOutPatient_2lines,
onTap: () {
String date = AppDateUtils.convertDateToFormat(DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd');
locator<PatientSearchViewModel>().flushSelectedDates();
Navigator.push(
context,
MaterialPageRoute(

@ -14,6 +14,9 @@ import '../../routes.dart';
import '../../widgets/shared/errors/error_message.dart';
class DischargedPatient extends StatefulWidget {
final bool isVidaPlusProject;
const DischargedPatient({super.key, required this.isVidaPlusProject});
@override
_DischargedPatientState createState() => _DischargedPatientState();
}

@ -9,12 +9,17 @@ class NoData extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Expanded(
child: SingleChildScrollView(
child: Container(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable)),
return Center(
child: Container(
child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable),
),
);
// Expanded(
// child: SingleChildScrollView(
// child: Container(
// child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable),
// ),
// ),
// );
}
}

@ -0,0 +1,254 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../config/config.dart';
class FilterDatePage extends StatefulWidget {
final PatientSearchViewModel patientSearchViewModel;
const FilterDatePage({Key? key, required this.patientSearchViewModel})
: super(key: key);
@override
_FilterDatePageState createState() => _FilterDatePageState();
}
class _FilterDatePageState extends State<FilterDatePage> {
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
var screenSize;
return AppScaffold(
isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.0,
child: Padding(
padding: EdgeInsets.all(0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(
title: TranslationBase.of(context).filterInPatient,
),
SizedBox(
height: 10.0,
),
Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: [
Container(
color: Colors.white,
child: InkWell(
onTap: () => selectDate(context,
firstDate: getFirstDate(),
lastDate: getLastDate()),
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).fromDate,
widget.patientSearchViewModel
.selectedFromDate !=
null
? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedFromDate.toString(), "yyyy-MM-dd")}"
: "",
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
color: Colors.white,
child: InkWell(
onTap: () => selectDate(context,
isFromDate: false,
firstDate: getFirstDate(),
lastDate: getLastDate()),
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).toDate,
widget.patientSearchViewModel
.selectedToDate !=
null
? "${AppDateUtils.convertStringToDateFormat(widget.patientSearchViewModel.selectedToDate.toString(), "yyyy-MM-dd")}"
: "",
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
],
),
),
),
],
),
),
),
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context).search,
padding: 10,
color: AppGlobal.appGreenColor,
onPressed: () async {
if (widget.patientSearchViewModel.selectedFromDate ==
null ||
widget.patientSearchViewModel.selectedToDate ==
null) {
Utils.showErrorToast(
"Please Select All The date Fields ");
} else {
Navigator.pop(context);
await widget.patientSearchViewModel.getInPatientList(
PatientSearchRequestModel(
from:
"${AppDateUtils.convertDateToFormat(widget.patientSearchViewModel.selectedFromDate!, "yyyy-MM-dd")} 00:00:00",
to: "${AppDateUtils.convertDateToFormat(widget.patientSearchViewModel.selectedToDate!, "yyyy-MM-dd")} 00:00:00",
searchType: null),
isForceFullRefresh: true);
Navigator.of(context).pop();
}
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
));
}
selectDate(BuildContext context,
{bool isFromDate = true, DateTime? firstDate, lastDate}) async {
Utils.hideKeyboard(context);
DateTime currentDate = DateTime.now();
DateTime? selectedDate = isFromDate
? this.widget.patientSearchViewModel.selectedFromDate ?? currentDate
: this.widget.patientSearchViewModel.selectedToDate ?? currentDate;
final DateTime? picked = await showDatePicker(
context: context,
initialDate: selectedDate,
firstDate: firstDate!,
lastDate: lastDate,
initialEntryMode: DatePickerEntryMode.calendar,
);
if (picked != null) {
if (isFromDate) {
setState(() {
this.widget.patientSearchViewModel.selectedFromDate = picked;
var date = picked.add(Duration(days: 30));
if (date.isBefore(lastDate)) {
this.widget.patientSearchViewModel.selectedToDate = date;
} else
this.widget.patientSearchViewModel.selectedToDate = lastDate;
});
} else {
setState(() {
this.widget.patientSearchViewModel.selectedToDate = picked;
});
}
}
}
getFirstDate() {
DateTime dateTime = DateTime.now().subtract(Duration(days: 30 * 24));
return DateTime(dateTime.year, dateTime.month, dateTime.day + 1);
}
getLastDate() {
DateTime dateTime = DateTime.now().add(Duration(days: 30 * 24));
return DateTime(dateTime.year, dateTime.month, dateTime.day);
}
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon? suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.keyboard_arrow_down_sharp,
color: Color(0xff2E303A),
)
: null,
hintStyle: TextStyle(
fontSize: 13,
color: Color(0xff2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
labelText: selectedText != null ? '$hintText\n$selectedText' : null,
labelStyle: TextStyle(
fontSize: 13,
color: Color(0xff2E303A),
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
),
);
}
}

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/patients/In_patient/filter_date_page.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -22,8 +23,9 @@ class InPatientListPage extends StatefulWidget {
final bool showBottomSheet;
final String? selectedClinicName;
final Function? onChangeValue;
final bool isVidaPlusProject;
InPatientListPage({this.isMyInPatient = false, this.patientSearchViewModel, this.selectedClinicName, this.onChangeValue, this.isAllClinic = false, this.showBottomSheet = false});
InPatientListPage({this.isMyInPatient = false, this.patientSearchViewModel, this.selectedClinicName, this.onChangeValue, this.isAllClinic = false, this.showBottomSheet = false, required this.isVidaPlusProject});
@override
_InPatientListPageState createState() => _InPatientListPageState();
@ -135,15 +137,32 @@ class _InPatientListPageState extends State<InPatientListPage> {
GifLoaderDialogUtils.hideDialog(context);
},
),
suffixIcon: (widget.isVidaPlusProject)?IconButton(
icon: Icon(
DoctorApp.filter_1,
color: Colors.black,
),
iconSize: 20,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => FilterDatePage(
patientSearchViewModel: widget.patientSearchViewModel!,
),
settings: RouteSettings(name: 'FilterOutPatentDateScreen'),
));
},
):null,
onFieldSubmitted: () {},
),
widget.patientSearchViewModel!.state == ViewState.Idle
? (widget.isMyInPatient && widget.patientSearchViewModel!.myIinPatientList.length > 0)
? ListOfMyInpatient(isAllClinic: widget.isAllClinic, hasQuery: hasQuery, patientSearchViewModel: widget.patientSearchViewModel!)
? ListOfMyInpatient(isAllClinic: widget.isAllClinic, hasQuery: hasQuery, patientSearchViewModel: widget.patientSearchViewModel!, isVidaPlusProject: widget.isVidaPlusProject,)
: widget.patientSearchViewModel!.filteredInPatientItems.length > 0
? (widget.isMyInPatient && widget.patientSearchViewModel!.myIinPatientList.length == 0)
? NoData()
: ListOfAllInPatient(isAllClinic: widget.isAllClinic, hasQuery: hasQuery, patientSearchViewModel: widget.patientSearchViewModel!)
: ListOfAllInPatient(isAllClinic: widget.isAllClinic, hasQuery: hasQuery, patientSearchViewModel: widget.patientSearchViewModel!, isVidaPlusProject: widget.isVidaPlusProject,)
: NoData()
: Center(
child: Container(

@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/tab_utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -33,9 +34,10 @@ class InPatientScreen extends StatefulWidget {
class _InPatientScreenState extends State<InPatientScreen> with SingleTickerProviderStateMixin {
late TabController _tabController;
ProjectViewModel? viewModel = null;
int _activeTab = 0;
int selectedMapId = 0;
bool isVidaPlusProject = false;
@override
void initState() {
super.initState();
@ -60,11 +62,13 @@ class _InPatientScreenState extends State<InPatientScreen> with SingleTickerProv
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
viewModel = Provider.of<ProjectViewModel>(context);
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {
model.clearPatientList();
var doctorProfile = await model.getDoctorProfile();
if (widget.specialClinic != null && widget.specialClinic!.clinicID != null) {
print(widget.specialClinic!.toJson());
await model.getSpecialClinicalCareMappingList(widget.specialClinic!.clinicID);
@ -72,7 +76,27 @@ class _InPatientScreenState extends State<InPatientScreen> with SingleTickerProv
// model.specialClinicalCareMappingList[0].nursingStationID;
}
requestModel.clinicID = 0;
await model.getInPatientList(requestModel);
isVidaPlusProject =
Utils.isVidaPlusProject(viewModel!, doctorProfile.projectID ?? -1);
if (isVidaPlusProject) {
DateTime dateTime = DateTime.now();
String currentDate = AppDateUtils.convertDateToFormat(
dateTime,
'yyyy-MM-dd');
print("the current date is $currentDate");
requestModel.from = "$currentDate 00:00:00";
dateTime = dateTime.add(Duration(days: 1));
currentDate = AppDateUtils.convertDateToFormat(
dateTime,
'yyyy-MM-dd');
requestModel.to = "$currentDate 00:00:00";
requestModel.pageSize = 10;
requestModel.pageIndex = 0;
requestModel.searchType = null;
}
await model.getInPatientList(requestModel,
isVidaPlusProject: isVidaPlusProject);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
@ -90,7 +114,11 @@ class _InPatientScreenState extends State<InPatientScreen> with SingleTickerProv
GifLoaderDialogUtils.showMyDialog(context);
PatientSearchRequestModel requestModel = PatientSearchRequestModel(nursingStationID: selectedMapId, clinicID: 0);
await model.getInPatientList(requestModel, isLocalBusy: true);
await model.getInPatientList(requestModel,
isLocalBusy: true,
isVidaPlusProject: Utils.isVidaPlusProject(
Provider.of<ProjectViewModel>(context),
requestModel.projectID ?? -1));
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
@ -161,15 +189,21 @@ class _InPatientScreenState extends State<InPatientScreen> with SingleTickerProv
isAllClinic: widget.isAllClinic,
showBottomSheet: widget.showBottomSheet,
selectedClinicName: widget.selectedClinicName,
onChangeValue: onChangeState),
onChangeValue: onChangeState,
isVidaPlusProject: isVidaPlusProject,
),
InPatientListPage(
isMyInPatient: true,
patientSearchViewModel: model,
isAllClinic: widget.isAllClinic,
showBottomSheet: widget.showBottomSheet,
selectedClinicName: widget.selectedClinicName,
onChangeValue: onChangeState),
DischargedPatient(),
onChangeValue: onChangeState,
isVidaPlusProject: isVidaPlusProject,
),
DischargedPatient(
isVidaPlusProject: isVidaPlusProject,
),
],
),
),

@ -12,11 +12,12 @@ class ListOfAllInPatient extends StatelessWidget {
required this.isAllClinic,
required this.hasQuery,
required this.patientSearchViewModel,
required this.isVidaPlusProject,
}) : super(key: key);
final bool isAllClinic;
final bool hasQuery;
final bool isVidaPlusProject;
final PatientSearchViewModel patientSearchViewModel;
@override
@ -55,6 +56,7 @@ class ListOfAllInPatient extends StatelessWidget {
"isInpatient": true,
"arrivalType": "1",
"isMyPatient": patientSearchViewModel.filteredInPatientItems[index].doctorId == patientSearchViewModel.doctorProfile!.doctorID,
"isVidaPlusProject": isVidaPlusProject,
});
});
},

@ -11,10 +11,12 @@ class ListOfMyInpatient extends StatelessWidget {
required this.isAllClinic,
required this.hasQuery,
required this.patientSearchViewModel,
required this.isVidaPlusProject,
}) : super(key: key);
final bool isAllClinic;
final bool hasQuery;
final bool isVidaPlusProject;
final PatientSearchViewModel patientSearchViewModel;
@override
@ -56,6 +58,7 @@ class ListOfMyInpatient extends StatelessWidget {
"isInpatient": true,
"arrivalType": "1",
"isMyPatient": true,
"isVidaPlusProject": isVidaPlusProject,
});
},
);

@ -94,7 +94,7 @@ class _InsuranceApprovalScreenNewState
onTap: (){},
profileUrl: model
.insuranceApprovalInPatient[index]
.doctorImage!,
.doctorImage??'',
clinic: model
.insuranceApprovalInPatient[index]
.clinicName!,

@ -121,7 +121,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
child: ClipRRect(
borderRadius: BorderRadius.circular(50),
child: Image.network(
model.insuranceApprovalInPatient[indexInsurance].doctorImage!,
model.insuranceApprovalInPatient[indexInsurance].doctorImage??'',
fit: BoxFit.fill,
width: 700,
),

@ -34,11 +34,12 @@ class _AdmissionOrdersScreenState extends State<AdmissionOrdersScreen> {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String arrivalType = routeArgs['arrivalType'];
bool isVidaPlusProject = routeArgs['isVidaPlusProject'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PendingOrdersViewModel>(
onModelReady: (model) => model.getAdmissionOrders(
admissionNo: int.parse(patient.admissionNo!),
admissionNo: isVidaPlusProject? patient.admissionID??-1 :int.parse(patient.admissionNo!),
patientId: patient.patientMRN!),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,

@ -33,6 +33,7 @@ class _DiabeticChartState extends State<DiabeticChart> {
List<TimeSeriesSales2> timeSeriesData1 = [];
List<TimeSeriesSales2> timeSeriesData2 = [];
bool isVidaPlusProject= false;
List<DiabeticType> diabeticType = [
DiabeticType(nameAr: "Urine Glucose", nameEn: "Urine Glucose", value: 1),
@ -47,12 +48,13 @@ class _DiabeticChartState extends State<DiabeticChart> {
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
isVidaPlusProject = routeArgs['isVidaPlusProject'];
ProjectViewModel projectsProvider = Provider.of(context);
return BaseView<PatientViewModel>(
onModelReady: (model) async {
selectedDiabeticType = diabeticType[2];
await model.getDiabeticChartValues(patient, selectedDiabeticType.value!, isLocalBusy: false);
await model.getDiabeticChartValues(patient, selectedDiabeticType.value!, isLocalBusy: false, isVidaPlusProject: isVidaPlusProject);
generateData(model);
},
builder: (_, model, w) => AppScaffold(
@ -178,6 +180,7 @@ class _DiabeticChartState extends State<DiabeticChart> {
if (model.diabeticChartValuesList.length > 0) {
model.diabeticChartValuesList.toList().forEach(
(element) {
if(element.dateChart == null ) return;
DateTime elementDate = AppDateUtils.getDateTimeFromServerFormat(element.dateChart!);
if (element.resultValue!.toInt() != 0)
timeSeriesData1.add(
@ -206,7 +209,7 @@ class _DiabeticChartState extends State<DiabeticChart> {
timeSeriesData2.clear();
});
await model.getDiabeticChartValues(patient, selectedDiabeticType.value!, isLocalBusy: true);
await model.getDiabeticChartValues(patient, selectedDiabeticType.value!, isLocalBusy: true, isVidaPlusProject: isVidaPlusProject);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
}

@ -29,6 +29,7 @@ class _ProgressNoteState extends State<DiagnosisScreen> {
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel();
late ProjectViewModel projectViewModel;
bool isVidaPlusProject = false;
getDiagnosisForInPatient(BuildContext context, PatientViewModel model,
{bool isLocalBusy = false}) async {
@ -42,11 +43,11 @@ class _ProgressNoteState extends State<DiagnosisScreen> {
print(type);
GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel =
GetDiagnosisForInPatientRequestModel(
admissionNo: int.parse(patient.admissionNo!),
admissionNo: isVidaPlusProject? patient.admissionID : int.parse(patient.admissionNo!),
patientTypeID: patient.patientType,
patientID: patient.patientId,
);
model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel);
model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel,isVidaPlusProject,patient);
}
@override
@ -55,6 +56,7 @@ class _ProgressNoteState extends State<DiagnosisScreen> {
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
isVidaPlusProject = routeArgs['isVidaPlusProject'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PatientViewModel>(

@ -12,8 +12,9 @@ import 'discharge_Summary_widget.dart';
class AllDischargeSummary extends StatefulWidget {
final Function? changeCurrentTab;
final PatiantInformtion? patient;
final bool isVidaPlusProject;
const AllDischargeSummary({this.changeCurrentTab, this.patient});
const AllDischargeSummary({this.changeCurrentTab, this.patient, this.isVidaPlusProject = false});
@override
_AllDischargeSummaryState createState() => _AllDischargeSummaryState();
@ -28,7 +29,8 @@ class _AllDischargeSummaryState extends State<AllDischargeSummary> {
onModelReady: (model) {
model.getAllDischargeSummary(
patientId: widget.patient!.patientId!,
admissionNo: int.parse(widget.patient!.admissionNo!),
admissionNo: widget.isVidaPlusProject? widget.patient?.admissionID ?? -1 :int.parse(widget.patient!.admissionNo!),
);
},
builder: (_, model, w) => AppScaffold(

@ -26,6 +26,7 @@ class _DoctorReplyScreenState extends State<DischargeSummaryPage>
late TabController _tabController;
int _activeTab = 0;
int pageIndex = 1;
bool isVidaPlusProject = false;
@override
void initState() {
@ -51,6 +52,7 @@ class _DoctorReplyScreenState extends State<DischargeSummaryPage>
final screenSize = MediaQuery.of(context).size;
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
isVidaPlusProject = routeArgs['isVidaPlusProject'];
return WillPopScope(
onWillPop: () async {
@ -119,8 +121,9 @@ class _DoctorReplyScreenState extends State<DischargeSummaryPage>
children: [
PendingDischargeSummary(
patient: patient,
isVidaPlusProject: isVidaPlusProject,
),
AllDischargeSummary(patient: patient),
AllDischargeSummary(patient: patient, isVidaPlusProject: isVidaPlusProject,),
],
),
),

@ -12,8 +12,9 @@ import 'discharge_Summary_widget.dart';
class PendingDischargeSummary extends StatefulWidget {
final Function? changeCurrentTab;
final PatiantInformtion? patient;
final bool isVidaPlusProject;
const PendingDischargeSummary({Key? key, this.changeCurrentTab, this.patient})
const PendingDischargeSummary({Key? key, this.changeCurrentTab, this.patient, this.isVidaPlusProject = false})
: super(key: key);
@override
@ -30,7 +31,9 @@ class _PendingDischargeSummaryState extends State<PendingDischargeSummary> {
onModelReady: (model) {
model.getPendingDischargeSummary(
patientId: widget.patient!.patientId!,
admissionNo: int.parse(widget.patient!.admissionNo!),
clinicId: widget.patient?.clinicId,
doctorId: widget.patient?.doctorId,
admissionNo: widget.isVidaPlusProject? widget.patient?.admissionID ?? -1 :int.parse(widget.patient!.admissionNo!),
);
},
builder: (_, model, w) => AppScaffold(

@ -23,8 +23,9 @@ class AddVerifyMedicalReport extends StatefulWidget {
final PatientMedicalReportViewModel? model;
final MedicalReportStatus? status;
final String? medicalNote;
final bool? isVidaPlusProject;
const AddVerifyMedicalReport({Key? key, this.patient, this.patientType, this.arrivalType, this.medicalReport, this.model, this.status, this.medicalNote}) : super(key: key);
const AddVerifyMedicalReport({Key? key, this.patient, this.patientType, this.arrivalType, this.medicalReport, this.model, this.status, this.medicalNote, this.isVidaPlusProject}) : super(key: key);
@override
_AddVerifyMedicalReportState createState() => _AddVerifyMedicalReportState();
@ -98,8 +99,8 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
GifLoaderDialogUtils.showMyDialog(context);
widget.medicalReport != null
? await widget.model!.updateMedicalReport(widget.patient!, txtOfMedicalReport, widget.medicalReport != null ? widget.medicalReport!.lineItemNo! : 0,
widget.medicalReport != null ? widget.medicalReport!.invoiceNo! : "")
: await widget.model!.addMedicalReport(widget.patient!, txtOfMedicalReport);
widget.medicalReport != null ? widget.medicalReport!.invoiceNo! : "", widget.isVidaPlusProject)
: await widget.model!.addMedicalReport(widget.patient!, txtOfMedicalReport, widget.isVidaPlusProject);
//model.getMedicalReportList(patient);
Navigator.pop(context);
@ -127,7 +128,7 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
txtOfMedicalReport = (await _controller.getText())!;
if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.model!.verifyMedicalReport(widget.patient!, widget.medicalReport!);
await widget.model!.verifyMedicalReport(widget.patient!, widget.medicalReport!, widget.isVidaPlusProject);
GifLoaderDialogUtils.hideDialog(context);
Navigator.pop(context);
if (widget.model!.state == ViewState.ErrorLocal) {

@ -33,18 +33,20 @@ class MedicalReportPage extends StatefulWidget {
}
class _MedicalReportPageState extends State<MedicalReportPage> {
bool isVidaPlusProject = false;
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
isVidaPlusProject = routeArgs['isVidaPlusProject'];
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PatientMedicalReportViewModel>(
onModelReady: (model) async {
await model.getDoctorProfile(isGetProfile: true);
await model.getMedicalReportList(patient);
await model.getMedicalReportList(patient, isVidaPlusProject: isVidaPlusProject);
await model.getMedicalReportTemplate();
},
builder: (_, model, w) => AppScaffold(
@ -97,6 +99,7 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
arrivalType: arrivalType,
model: model,
status: MedicalReportStatus.ADD,
isVidaPlusProject: isVidaPlusProject
),
settings: RouteSettings(name: 'AddVerifyMedicalReport'),
),

@ -31,6 +31,7 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class ProgressNoteScreen extends StatefulWidget {
final int visitType;
const ProgressNoteScreen({Key? key, required this.visitType}) : super(key: key);
@override
@ -43,6 +44,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
bool isDischargedPatient = false;
late AuthenticationViewModel authenticationViewModel;
late ProjectViewModel projectViewModel;
bool isVidaPlusProject = false;
getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
@ -54,12 +56,12 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo: int.parse(patient.admissionNo!),
admissionNo: (isVidaPlusProject)?patient.admissionID:int.parse(patient.admissionNo!),
projectID: patient.projectId,
tokenID: token,
patientTypeID: patient.patientType,
languageID: 2);
model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) {
model.getPatientProgressNote(progressNoteRequest.toJson(),patient, isLocalBusy: isLocalBusy, isVidaPlus: isVidaPlusProject).then((c) {
notesList = model.patientProgressNoteList;
});
}
@ -71,9 +73,10 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String arrivalType = routeArgs['arrivalType'];
isVidaPlusProject = routeArgs['isVidaPlusProject'] ?? false;
if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PatientViewModel>(
onModelReady: (model) => getProgressNoteList(context, model),
onModelReady: (model) => getProgressNoteList(context, model, ),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
@ -101,6 +104,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
patient: patient,
visitType: widget.visitType,
isUpdate: false,
isVidaPlusProject:isVidaPlusProject
),
settings: RouteSettings(name: 'UpdateNoteOrder'),
),
@ -219,7 +223,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
patientOutSA: false,
);
await model.updatePatientProgressNote(reqModel);
await getProgressNoteList(context, model, isLocalBusy: true);
await getProgressNoteList(context, model, isLocalBusy: true,);
GifLoaderDialogUtils.hideDialog(context);
});
},
@ -274,7 +278,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
patientOutSA: false,
);
await model.updatePatientProgressNote(reqModel);
await getProgressNoteList(context, model, isLocalBusy: true);
await getProgressNoteList(context, model, isLocalBusy: true, );
GifLoaderDialogUtils.hideDialog(context);
});
},

@ -36,10 +36,11 @@ class UpdateNoteOrder extends StatefulWidget {
final PatiantInformtion patient;
final int? visitType;
final bool isUpdate;
final bool isVidaPlusProject;
final List<dynamic>? elementList;
final Function(dynamic)? okFunction;
const UpdateNoteOrder({Key? key, this.note, required this.patientModel, required this.patient, this.visitType, required this.isUpdate, this.elementList, this.okFunction}) : super(key: key);
const UpdateNoteOrder({Key? key, this.note, required this.patientModel, required this.patient, this.visitType, required this.isUpdate, this.elementList, this.okFunction, this.isVidaPlusProject = false}) : super(key: key);
@override
_UpdateNoteOrderState createState() => _UpdateNoteOrderState();
@ -249,7 +250,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
await widget.patientModel.updatePatientProgressNote(reqModel);
} else {
CreateNoteModel reqModel = CreateNoteModel(
admissionNo: int.parse(widget.patient.admissionNo!),
admissionNo: (widget.isVidaPlusProject)?widget.patient.admissionID:int.parse(widget.patient.admissionNo!),
createdBy: doctorProfile.doctorID,
visitType: widget.visitType,
patientID: widget.patient.patientId,
@ -259,7 +260,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
notes: progressNoteController.text,
conditionId: selectValue['ParameterCode']);
await widget.patientModel.createPatientProgressNote(reqModel);
await widget.patientModel.createPatientProgressNote(reqModel, widget.patient, isVidaPlus: widget.isVidaPlusProject);
}
if (widget.patientModel.state == ViewState.ErrorLocal) {
@ -268,11 +269,11 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
visitType: widget.visitType,
// if equal 5 then this will return progress note
admissionNo: int.parse(widget.patient.admissionNo!),
admissionNo: (widget.isVidaPlusProject)?widget.patient.admissionID:int.parse(widget.patient.admissionNo!),
projectID: widget.patient.projectId,
patientTypeID: widget.patient.patientType,
languageID: 2);
await widget.patientModel.getPatientProgressNote(progressNoteRequest.toJson());
await widget.patientModel.getPatientProgressNote(progressNoteRequest.toJson(), widget.patient, isVidaPlus: widget.isVidaPlusProject);
}
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).yourOrderAddedSuccessfully);

@ -32,6 +32,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
bool isDischargedPatient = false;
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel();
late ProjectViewModel projectViewModel;
bool isVidaPlusProject= false;
getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
@ -40,9 +41,10 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
print(type);
GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel = GetNursingProgressNoteRequestModel(
admissionNo: int.parse(patient.admissionNo!),
admissionNo: (isVidaPlusProject)? patient.admissionID :int.parse(patient.admissionNo!),
patientTypeID: patient.patientType,
patientID: patient.patientId,
patientMRN: patient.patientId,
);
model.getNursingProgressNote(getNursingProgressNoteRequestModel);
}
@ -53,6 +55,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
isVidaPlusProject = routeArgs['isVidaPlusProject']?? false;
if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PatientViewModel>(
onModelReady: (model) => getProgressNoteList(context, model),

@ -19,8 +19,10 @@ class PendingOrdersScreen extends StatelessWidget {
patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
bool isInpatient = routeArgs['isInpatient'];
var isVidaPlus = routeArgs['isVidaPlusProject'];
return BaseView<PendingOrdersViewModel>(
onModelReady: (model) => model.getPendingOrders(patientId: patient.patientMRN!, admissionNo: int.parse(patient.admissionNo!)),
onModelReady: (model) => model.getPendingOrders(patientId: patient.patientMRN!, admissionNo: isVidaPlus? patient.admissionID?? 0 :int.parse(patient.admissionNo!), isVidaPlus: isVidaPlus),
builder: (BuildContext context, PendingOrdersViewModel model, Widget? child) => AppScaffold(
appBar: PatientProfileAppBar(
patient,

@ -14,6 +14,7 @@ class PatientProfileCardModel {
final bool isDartIcon;
final IconData? dartIcon;
final Color? color;
final bool isVidaPlusProject;
PatientProfileCardModel(
this.nameLine1,
@ -29,5 +30,6 @@ class PatientProfileCardModel {
this.isDartIcon = false,
this.dartIcon,
this.color,
this.isVidaPlusProject = false,
});
}

@ -68,6 +68,7 @@ String noteValidation ="";
TextEditingController noteController = TextEditingController();
late StreamController<String> videoCallDurationStreamController;
late Stream<String> videoCallDurationStream;
bool isVidaPlusProject = false;
@override
void initState() {
@ -95,6 +96,7 @@ String noteValidation ="";
arrivalType = routeArgs['arrivalType'];
from = routeArgs['from'];
to = routeArgs['to'];
isVidaPlusProject = routeArgs['isVidaPlusProject']?? false;
isSigned = routeArgs['isSigned'] ?? false;
if (routeArgs.containsKey("isSearch")) {
isFromSearch = routeArgs['isSearch'];
@ -148,7 +150,7 @@ String noteValidation ="";
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context);
ProjectViewModel projectViewModel = Provider.of<ProjectViewModel>(context, listen: false);
return BaseView<LiveCarePatientViewModel>(
onModelReady: (model) async {
if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId!);
@ -202,6 +204,7 @@ String noteValidation ="";
to: to,
isDischargedPatient: isDischargedPatient,
isFromSearch: isFromSearch,
isVidaPlusProject: isVidaPlusProject
)
: ProfileGridForOther(
patient: patient,
@ -231,7 +234,7 @@ String noteValidation ="";
onModelReady: (model) async {
model.getDoctorProfile();
if (isInpatient) {
await model.getEpisodeForInpatient(patient);
await model.getEpisodeForInpatient(patient, isVidaPlusProject);
}
},
builder: (_, model, w) => Positioned(
@ -487,7 +490,7 @@ String noteValidation ="";
);
GifLoaderDialogUtils.showMyDialog(context);
if (patient.admissionNo != null && patient.admissionNo!.isNotEmpty) {
PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo!), patientID: patient.patientId);
PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: isVidaPlusProject?patient.admissionID:int.parse(patient.admissionNo!), patientID: patient.patientId);
await model.postEpisodeForInPatient(postEpisodeReqModel);
} else {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN);
@ -501,7 +504,7 @@ String noteValidation ="";
} else {
patient.episodeNo = model.episodeID;
if(Utils.isVidaPlusProject(
Provider.of<ProjectViewModel>(context),
Provider.of<ProjectViewModel>(context, listen: false),
patient.projectId!,
)){
Navigator.of(context).pushNamed(

@ -15,11 +15,12 @@ class ProfileGridForInPatient extends StatelessWidget {
final bool isInpatient;
final bool isDischargedPatient;
final bool isFromSearch;
final bool isVidaPlusProject;
String? from;
String? to;
ProfileGridForInPatient(
{Key? key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient = false, this.from, this.to, this.isDischargedPatient = false, this.isFromSearch = false})
{Key? key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient = false, this.from, this.to, this.isDischargedPatient = false, this.isFromSearch = false, required this.isVidaPlusProject})
: super(key: key);
@override
@ -31,6 +32,7 @@ class ProfileGridForInPatient extends StatelessWidget {
VITAL_SIGN_DETAILS,
'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).lab,
@ -38,6 +40,8 @@ class ProfileGridForInPatient extends StatelessWidget {
LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).lab,
@ -45,6 +49,7 @@ class ProfileGridForInPatient extends StatelessWidget {
ALL_SPECIAL_LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).radiology,
@ -52,6 +57,7 @@ class ProfileGridForInPatient extends StatelessWidget {
RADIOLOGY_PATIENT,
'assets/images/svgs/profile_screen/Radiology.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).patient,
@ -59,6 +65,7 @@ class ProfileGridForInPatient extends StatelessWidget {
ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).patient,
@ -66,6 +73,7 @@ class ProfileGridForInPatient extends StatelessWidget {
ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).progress,
@ -74,6 +82,7 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/Progress notes.svg',
isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).order,
@ -82,6 +91,7 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/order sheets.svg',
isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).orders,
@ -90,6 +100,7 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/Order Procedures.svg',
isInPatient: isInpatient,
//onTap: () {},
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).health,
@ -97,6 +108,7 @@ class ProfileGridForInPatient extends StatelessWidget {
HEALTH_SUMMARY,
'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).medical,
@ -105,6 +117,7 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/medical report.svg',
isInPatient: isInpatient,
isDisable: false,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).referral,
@ -113,6 +126,7 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient,
isDisable: isDischargedPatient || isFromSearch,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).insurance,
@ -121,6 +135,7 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/insurance approval.svg',
isInPatient: isInpatient,
//onTap: () {},
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).discharge,
@ -128,6 +143,7 @@ class ProfileGridForInPatient extends StatelessWidget {
DISCHARGE_SUMMARY,
'assets/images/svgs/profile_screen/discharge summary.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).patientSick,
@ -136,6 +152,7 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/patient sick leave.svg',
isInPatient: isInpatient,
//onTap: () {},
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).operation,
@ -143,6 +160,7 @@ class ProfileGridForInPatient extends StatelessWidget {
GET_OPERATION_REPORT,
'assets/images/svgs/profile_screen/operating report.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject,
),
PatientProfileCardModel(
TranslationBase.of(context).pending,
@ -150,6 +168,7 @@ class ProfileGridForInPatient extends StatelessWidget {
PENDING_ORDERS,
'assets/images/svgs/profile_screen/pending orders.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).admission,
@ -157,6 +176,7 @@ class ProfileGridForInPatient extends StatelessWidget {
ADMISSION_ORDERS,
'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
"Nursing",
@ -164,6 +184,7 @@ class ProfileGridForInPatient extends StatelessWidget {
NURSING_PROGRESS_NOTE,
'assets/images/svgs/profile_screen/Progress notes.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).diagnosis,
@ -171,6 +192,7 @@ class ProfileGridForInPatient extends StatelessWidget {
DIAGNOSIS_FOR_IN_PATIENT,
'assets/images/svgs/profile_screen/diagnosis.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).diabetic,
@ -178,6 +200,7 @@ class ProfileGridForInPatient extends StatelessWidget {
DIABETIC_CHART_VALUES,
'assets/images/svgs/profile_screen/diabetic chart.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
"VTE",
@ -185,6 +208,7 @@ class ProfileGridForInPatient extends StatelessWidget {
VTE_ASSESSMENT,
'assets/images/svgs/profile_screen/diabetic chart.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
PatientProfileCardModel(
TranslationBase.of(context).pharmacy,
@ -192,6 +216,7 @@ class ProfileGridForInPatient extends StatelessWidget {
PHARMACY_INTERVENTION,
'assets/images/svgs/profile_screen/medical report.svg',
isInPatient: isInpatient,
isVidaPlusProject: isVidaPlusProject
),
];
@ -223,6 +248,7 @@ class ProfileGridForInPatient extends StatelessWidget {
isDisable: item.isDisable,
onTap: item.onTap,
isLoading: item.isLoading,
isVidaPlusProject: item.isVidaPlusProject
);
}).toList(),
),

@ -1,9 +1,12 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart';
import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
@ -25,6 +28,9 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../../../../../client/base_app_client.dart' show sharedPref;
import '../../../../../config/shared_pref_kay.dart' show SLECTED_PATIENT_TYPE;
class PatientMakeInPatientReferralScreen extends StatefulWidget {
@override
_PatientMakeInPatientReferralScreenState createState() => _PatientMakeInPatientReferralScreenState();
@ -34,6 +40,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
PatiantInformtion? patient;
List<dynamic>? referToList;
dynamic _referTo;
dynamic? selectedDiagnosis;
dynamic _selectedBranch;
dynamic _selectedClinic;
dynamic _selectedDoctor;
@ -53,6 +60,8 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
var recognizedWord;
var event = RobotProvider();
var isVidaPlusProject = false;
@override
void initState() {
requestPermissions();
@ -141,6 +150,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
patient = routeArgs['patient'];
bool isInpatient = routeArgs['isInpatient'];
isVidaPlusProject = routeArgs['isVidaPlusProject'];
referToList = [];
dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch};
dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch};
@ -149,8 +159,30 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
final screenSize = MediaQuery.of(context).size;
getDiagnosisForInPatient(BuildContext context, PatientReferralViewModel model,
{bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
// String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
//
// print(type);
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE) == '0' ? "2" : "1";
print(type);
GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel =
GetDiagnosisForInPatientRequestModel(
admissionNo: isVidaPlusProject? patient.admissionID : int.parse(patient.admissionNo!),
patientTypeID: patient.patientType,
patientID: patient.patientId,
);
model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel,isVidaPlusProject,patient);
}
return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getReferralFrequencyList(),
onModelReady: (model) {
model.getReferralFrequencyList();
getDiagnosisForInPatient(context, model);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient,
@ -434,6 +466,47 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
onChanged: (value) {},
onFieldSubmitted: () {},
),
Visibility(
visible: isVidaPlusProject,
child:
Column(
children: [
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).diagnosis,
dropDownText: selectedDiagnosis != null ? selectedDiagnosis['selectedDisease'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: branchError,
onClick: () {
ListSelectDialog dialog = ListSelectDialog(
list: model.diagnosisForInPatientList,
attributeName: 'selectedDisease',
attributeValueId: 'selectedIcdCode',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
selectedDiagnosis = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
},
onChanged: (value) {},
onFieldSubmitted: () {},
),
],
),
),
SizedBox(
height: 10,
),
@ -552,6 +625,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
_selectedBranch == null ||
_selectedClinic == null ||
_selectedDoctor == null ||
( isVidaPlusProject && selectedDiagnosis == null) ||
_remarksController.text == null ||
_extController.text == null) return;
{
@ -566,7 +640,10 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
remarks: _remarksController.text,
priority: _activePriority,
referralDate: appointmentDate,
isLocalBusy: true);
diagnosis: selectedDiagnosis,
isLocalBusy: true,
isVidaPlusProject
);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal)
DrAppToastMsg.showErrorToast(model.error);

@ -54,8 +54,9 @@ class InterventionHistoryBottomSheet extends StatelessWidget {
color: Colors.white,
child: InterventionHistoryItem(
interventionHistory: interventionList[index],
onAcceptClick: (intervention) {
onAcceptClick: (intervention, remarks) {
model.updateInterventionDiseaseStatus(
remarks: remarks,
isAccepted: true,
interventionID: interventionList[index].interventionId.toString(),
successMessage: TranslationBase.of(context).interventionAcceptedSuccessfully,
@ -63,8 +64,9 @@ class InterventionHistoryBottomSheet extends StatelessWidget {
);
Navigator.pop(context);
},
onRejectClick: (intervention) {
onRejectClick: (intervention, remarks) {
model.updateInterventionDiseaseStatus(
remarks: remarks,
interventionID: interventionList[index].interventionId.toString(),
successMessage: TranslationBase.of(context).interventionRejectedSuccessfully,
errorMessage: TranslationBase.of(context).unableToPerformTheAction

@ -1,22 +1,26 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/intervention_history.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
class InterventionHistoryItem extends StatelessWidget {
final InterventionHistory interventionHistory;
final Function(InterventionHistory) onAcceptClick;
final Function(InterventionHistory, String) onAcceptClick;
// string is index here
final Function(InterventionHistory) onRejectClick;
final Function(InterventionHistory, String) onRejectClick;
final TextEditingController remarksController = TextEditingController();
const InterventionHistoryItem({
InterventionHistoryItem({
super.key,
required this.interventionHistory,
required this.onAcceptClick,
required this.onRejectClick,
});
@override
@ -56,6 +60,19 @@ class InterventionHistoryItem extends StatelessWidget {
color: Color(0xFF2B353E),
),
SizedBox(height: 8,),
AppTextFieldCustom(
hintText: TranslationBase.of(context).addDoctorRemarks,
controller: remarksController,
maxLines: 48,
minLines: 2,
hasBorder: true,
inputType: TextInputType.multiline,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
),
SizedBox(height: 16,),
Row(children: [
Expanded(
child: SizedBox(
@ -69,7 +86,11 @@ class InterventionHistoryItem extends StatelessWidget {
color: AppGlobal.appRedColor,
fontColor: Colors.white,
onPressed: () async {
onRejectClick(interventionHistory);
if(remarksController.text.isEmpty == true) {
DrAppToastMsg.showErrorToast(TranslationBase.of(context).remarksNotAdded);
return;
}
onRejectClick(interventionHistory, remarksController.text);
},
),
),
@ -89,7 +110,11 @@ class InterventionHistoryItem extends StatelessWidget {
color: AppGlobal.appGreenColor,
fontColor: Colors.white,
onPressed: () async {
onAcceptClick(interventionHistory);
if(remarksController.text.isEmpty == true) {
DrAppToastMsg.showErrorToast(TranslationBase.of(context).remarksNotAdded);
return;
}
onAcceptClick(interventionHistory,remarksController.text);
},
),
),

@ -25,9 +25,19 @@ class NewPrescriptionsPage extends StatelessWidget {
PatiantInformtion patient = routeArgs['patient'];
bool isInpatient = routeArgs['isInpatient'];
bool isFromLiveCare = routeArgs['isFromLiveCare'];
bool isVidaPlusProject = routeArgs['isVidaPlusProject'];
return BaseView<PrescriptionViewModel>(
onModelReady: (model) async {
await model.getPrescriptionListNew(mrn: patient.patientMRN, appNo: patient.appointmentNo == null ? 0 : int.parse(patient.appointmentNo.toString()));
// if(isVidaPlusProject)
// {
// model.getMedicationForInPatient(patient, isVidaPlusProject);
// }else {
await model.getPrescriptionListNew(
mrn: patient.patientMRN,
appNo: patient.appointmentNo == null
? 0
: int.parse(patient.appointmentNo.toString()));
// }
await model.isPrincipalCovered(patient: patient);
},

@ -27,9 +27,11 @@ class OldPrescriptionsPage extends StatelessWidget {
String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient'];
bool isFromLiveCare = routeArgs['isFromLiveCare'];
bool isVidaPlusProject = routeArgs['isVidaPlusProject'];
var admissionNumber = isVidaPlusProject ? patient.admissionID : patient.admissionNo;
return BaseView<PrescriptionViewModel>(
onModelReady: (model) async {
patient.admissionNo == null ? model.getPrescriptions(patient, patientType: patientType, isLocalBusy: false) : model.getMedicationForInPatient(patient);
admissionNumber == null ? model.getPrescriptions(patient, patientType: patientType, isLocalBusy: false) : model.getMedicationForInPatient(patient, isVidaPlusProject);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
@ -39,7 +41,7 @@ class OldPrescriptionsPage extends StatelessWidget {
patient,
isInpatient: isInpatient,
),
body: patient.admissionNo == null
body: admissionNumber == null
? FractionallySizedBox(
widthFactor: 1.0,
child: SingleChildScrollView(
@ -167,6 +169,7 @@ class OldPrescriptionsPage extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isVidaPlusProject: isVidaPlusProject,
startOn: AppDateUtils.getDateTimeFromServerFormat(
model.medicationForInPatient[index].startDatetime!,
),

@ -21,6 +21,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
final DateTime? startOn;
final DateTime? stopOn;
final int? prescriptionIndex;
final bool isVidaPlusProject;
PrescriptionItemsInPatientPage(
{Key? key,
@ -30,6 +31,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
this.arrivalType,
this.stopOn,
this.startOn,
this.isVidaPlusProject = false,
this.prescriptionIndex});
@override
@ -38,7 +40,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
return BaseView<PrescriptionViewModel>(
onModelReady: (model) async {
if (model.medicationForInPatient.length == 0) {
await model.getMedicationForInPatient(patient!);
await model.getMedicationForInPatient(patient!,isVidaPlusProject);
}
},
builder: (_, model, widget) => AppScaffold(

@ -1996,6 +1996,9 @@ class TranslationBase {
String get dateFromCanNotBeEmpty => localizedValues['dateFromCanNotBeEmpty']![locale.languageCode]!;
String get open => localizedValues['open']![locale.languageCode]!;
String get chiefComplaintLengthErrorMsg => localizedValues['chiefComplaintLengthErrorMsg']![locale.languageCode]!;
String get filterInPatient => localizedValues['filterInPatient']![locale.languageCode]!;
String get remarksNotAdded => localizedValues['remarksNotAdded']![locale.languageCode]!;
String get addDoctorRemarks => localizedValues['addDoctorRemarks']![locale.languageCode]!;
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -31,6 +31,7 @@ class PatientProfileButton extends StatelessWidget {
final IconData? dartIcon;
final bool isFromLiveCare;
final Color? color;
final bool isVidaPlusProject;
PatientProfileButton({
Key? key,
@ -53,6 +54,7 @@ class PatientProfileButton extends StatelessWidget {
this.dartIcon,
this.isFromLiveCare = false,
this.color,
this.isVidaPlusProject = false
}) : super(key: key);
@override
@ -152,7 +154,8 @@ class PatientProfileButton extends StatelessWidget {
'isInpatient': isInPatient,
'isDischargedPatient': isDischargedPatient,
'isSelectInpatient': isSelectInpatient,
"isFromLiveCare": isFromLiveCare
"isFromLiveCare": isFromLiveCare,
"isVidaPlusProject": isVidaPlusProject
});
}
}

@ -104,26 +104,28 @@ class AppScaffold extends StatelessWidget {
)
: null,
bottomSheet: bottomSheet,
body: projectProvider.isInternetConnection
? baseViewModel != null
body:
// projectProvider.isInternetConnection
// ?
baseViewModel != null
? NetworkBaseView(
baseViewModel: baseViewModel!,
child: body!,
)
: Stack(children: <Widget>[body!, buildAppLoaderWidget(isLoading)])
: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
"assets/images/undraw_connected_world_wuay.png",
height: 250,
),
AppText('No Internet Connection')
],
),
),
// : Center(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: <Widget>[
// Image.asset(
// "assets/images/undraw_connected_world_wuay.png",
// height: 250,
// ),
// AppText('No Internet Connection')
// ],
// ),
// ),
),
);
}

@ -6,6 +6,7 @@ import '../../../config/config.dart';
class ListSelectDialog extends StatefulWidget {
final List<dynamic> list;
final String attributeName;
final String attributeValueId;
final okText;

Loading…
Cancel
Save