bug resolution

ipd-changes-for-vida-plus
parent 65ceda64d8
commit c3e4ef142d

@ -1216,6 +1216,10 @@ const Map<String, Map<String, String>> localizedValues = {
"moderate": {"en": "Moderate", "ar":"معتدل"}, "moderate": {"en": "Moderate", "ar":"معتدل"},
"remarksCanNotBeEmpty": {"en": "Remarks Can Not Be Empty", "ar":"لا يمكن أن تكون الملاحظات فارغة"}, "remarksCanNotBeEmpty": {"en": "Remarks Can Not Be Empty", "ar":"لا يمكن أن تكون الملاحظات فارغة"},
"kindlySelectCategory": {"en": "Kindly Select Any Diagnosis Category", "ar":"يرجى اختيار أي فئة تشخيص"}, "kindlySelectCategory": {"en": "Kindly Select Any Diagnosis Category", "ar":"يرجى اختيار أي فئة تشخيص"},
"kindlySelectAllMandatoryField": {
"en": "Please complete all mandatory fields.",
"ar": "يرجى استكمال جميع الحقول الإلزامية"
},
"noRemarks": {"en": "No Remarks", "ar":"لا ملاحظات"}, "noRemarks": {"en": "No Remarks", "ar":"لا ملاحظات"},
"event": {"en": "Event: ", "ar":"حدث: "}, "event": {"en": "Event: ", "ar":"حدث: "},
"editDiagnosis": {"en": "Edit Diagnosis ", "ar":"تحرير التشخيص"}, "editDiagnosis": {"en": "Edit Diagnosis ", "ar":"تحرير التشخيص"},

@ -1,9 +1,10 @@
class PrescriptionReqModel { class PrescriptionReqModel {
dynamic patientMRN; dynamic patientMRN;
dynamic appNo; dynamic appNo;
dynamic? episodeId;
PrescriptionReqModel( PrescriptionReqModel(
{ this.patientMRN, this.appNo}); { this.patientMRN, this.appNo, this.episodeId});
PrescriptionReqModel.fromJson(Map<String, dynamic> json) { PrescriptionReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
@ -15,6 +16,9 @@ class PrescriptionReqModel {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN; data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appNo; data['AppointmentNo'] = this.appNo;
if(this.episodeId != null) {
data['EpisodeID'] = this.episodeId;
}
return data; return data;
} }
} }

@ -51,6 +51,8 @@ class InsuranceApprovalModel {
String? expiryDate; String? expiryDate;
String? rceiptOn; String? rceiptOn;
int? appointmentNo; int? appointmentNo;
String? companyName;
String? companyNameN;
InsuranceApprovalModel( InsuranceApprovalModel(
{this.versionID, {this.versionID,
@ -112,6 +114,8 @@ class InsuranceApprovalModel {
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
doctorImage = json['DoctorImageURL']; doctorImage = json['DoctorImageURL'];
clinicName = json['ClinicName']; clinicName = json['ClinicName'];
companyName = json['CompanyName'];
companyNameN = json['CompanyNameN'];
if (json['ApporvalDetails'] != null) { if (json['ApporvalDetails'] != null) {
apporvalDetails = <ApporvalDetails>[]; apporvalDetails = <ApporvalDetails>[];
json['ApporvalDetails'].forEach((v) { json['ApporvalDetails'].forEach((v) {

@ -25,6 +25,7 @@ class MedicalReportModel {
String? clinicName; String? clinicName;
String? clinicNameN; String? clinicNameN;
String? reportDataHtml; String? reportDataHtml;
int? summaryId;
MedicalReportModel( MedicalReportModel(
{this.reportData, {this.reportData,
@ -113,4 +114,41 @@ class MedicalReportModel {
data['ReportDataHtml'] = this.reportDataHtml; data['ReportDataHtml'] = this.reportDataHtml;
return data; return data;
} }
///handling this to change the status of vida 4 to make it as vida 3 so ui does not handle these things
///https://cloudsolutions-sa.atlassian.net/browse/V4-38664?focusedCommentId=469446
MedicalReportModel.fromJsonForVidaPlus(Map<String, dynamic> json) {
if(json['Status'] == 1){
json['Status'] = 0;
}else{
json['Status'] = 1;
}
reportData = json['ReportData'];
setupID = json['SetupID'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
patientID = json['PatientID'];
invoiceNo = json['InvoiceNo']??"0";
status = json['Status'];
verifiedOn = json['VerifiedOn'];
verifiedBy = json['VerifiedBy'];
editedOn = json['EditedOn'];
editedBy = json['EditedBy'];
lineItemNo = json['LineItemNo']??0;
createdOn = json['CreatedOn'];
templateID = json['TemplateID'];
doctorID = json['DoctorID'];
doctorGender = json['DoctorGender'];
doctorGenderDescription = json['DoctorGenderDescription'];
doctorGenderDescriptionN = json['DoctorGenderDescriptionN'];
doctorImageURL = json['DoctorImageURL'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
clinicID = json['ClinicID'];
clinicName = json['ClinicName'];
clinicNameN = json['ClinicNameN'];
reportDataHtml = json['ReportDataHtml'];
summaryId = json['summaryId'];
}
} }

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.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:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
class OutPatientService extends BaseService { class OutPatientService extends BaseService {
List<PatiantInformtion> _patientList = []; List<PatiantInformtion> _patientList = [];
@ -9,6 +10,9 @@ class OutPatientService extends BaseService {
List<PatiantInformtion> get patientList => _patientList; List<PatiantInformtion> get patientList => _patientList;
Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async { Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async {
if(ProjectViewModel.getVidaPlusStatus()){
patientSearchRequestModel.pageSize = 0;
}
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
GET_MY_OUT_PATIENT, GET_MY_OUT_PATIENT,

@ -4,6 +4,8 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MedicalReportTemplate.dart'; import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MedicalReportTemplate.dart';
import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MeidcalReportModel.dart'; import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MeidcalReportModel.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
class PatientMedicalReportService extends BaseService { class PatientMedicalReportService extends BaseService {
List<MedicalReportModel> medicalReportList = []; List<MedicalReportModel> medicalReportList = [];
@ -21,7 +23,11 @@ class PatientMedicalReportService extends BaseService {
await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) { await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) {
if (response['DAPP_ListMedicalReportList'] != null) { if (response['DAPP_ListMedicalReportList'] != null) {
response['DAPP_ListMedicalReportList'].forEach((v) { response['DAPP_ListMedicalReportList'].forEach((v) {
if (isVidaPlusProject) {
medicalReportList.add(MedicalReportModel.fromJsonForVidaPlus(v));
} else {
medicalReportList.add(MedicalReportModel.fromJson(v)); medicalReportList.add(MedicalReportModel.fromJson(v));
}
}); });
} }
medicalReportList = medicalReportList.reversed.toList(); medicalReportList = medicalReportList.reversed.toList();
@ -64,11 +70,26 @@ class PatientMedicalReportService extends BaseService {
Future verifyMedicalReport(PatiantInformtion patient, MedicalReportModel medicalReport, bool? isVidaPlusProject,) async { Future verifyMedicalReport(PatiantInformtion patient, MedicalReportModel medicalReport, bool? isVidaPlusProject,) async {
hasError = false; hasError = false;
print("the isVidaPlusProject flag in Service is $isVidaPlusProject");
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
if (isVidaPlusProject == true) {
body['SetupID'] = doctorProfile!.setupID;
} else
body['SetupID'] = "91877"; body['SetupID'] = "91877";
body['AdmissionNo'] = isVidaPlusProject == true? patient.admissionID : patient.admissionNo; body['AdmissionNo'] = isVidaPlusProject == true? patient.admissionID : patient.admissionNo;
body['InvoiceNo'] = medicalReport.invoiceNo; body['InvoiceNo'] = medicalReport.invoiceNo;
body['LineItemNo'] = medicalReport.lineItemNo; body['LineItemNo'] = medicalReport.lineItemNo;
if (isVidaPlusProject == true) {
body['TemplateID'] = medicalReport.templateID ?? 0;
body['summaryId'] = medicalReport.summaryId ?? 0;
try {
if (body['InvoiceNo'].toString().isEmpty) {
body['InvoiceNo'] = "0";
}
} catch (e) {
body['InvoiceNo'] = "0";
}
}
if (body['ProjectID'] == null) { if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID; body['ProjectID'] = doctorProfile?.projectID;
} }
@ -83,14 +104,16 @@ class PatientMedicalReportService extends BaseService {
Future addMedicalReport(PatiantInformtion patient, String htmlText, bool? isVidaPlusProject) async { Future addMedicalReport(PatiantInformtion patient, String htmlText, bool? isVidaPlusProject) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
if (isVidaPlusProject == false) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
? body['SetupID'] ? body['SetupID']
: SETUP_ID : SETUP_ID
: SETUP_ID; : SETUP_ID;
print("isVidaPlusProject $isVidaPlusProject"); }
body['AdmissionNo'] = isVidaPlusProject == true? patient.admissionID ?? -1 :int.parse(patient.admissionNo!); body['AdmissionNo'] = isVidaPlusProject == true? patient.admissionID ?? -1 :int.parse(patient.admissionNo!);
print('the admission no is ${body['AdmissionNo']}');
body['MedicalReportHTML'] = htmlText; body['MedicalReportHTML'] = htmlText;
body['ProjectID'] = doctorProfile?.projectID; body['ProjectID'] = doctorProfile?.projectID;
body['PatientID'] = patient.patientId; body['PatientID'] = patient.patientId;
@ -111,6 +134,11 @@ class PatientMedicalReportService extends BaseService {
body['LineItemNo'] = limitNumber; body['LineItemNo'] = limitNumber;
body['InvoiceNo'] = invoiceNumber; body['InvoiceNo'] = invoiceNumber;
if (ProjectViewModel.getVidaPlusStatus()) {
if (body['InvoiceNo'].toString().isEmpty) {
body['InvoiceNo'] = "0";
}
}
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null

@ -94,8 +94,8 @@ class PrescriptionService extends LookupService {
}, body: getAssessmentReqModel.toJson()); }, body: getAssessmentReqModel.toJson());
} }
Future getPrescriptionListNew({required int mrn, required int appNo}) async { Future getPrescriptionListNew({required int mrn, required int appNo, int? episodeID}) async {
_prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn, appNo: appNo); _prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn, appNo: appNo, episodeId: episodeID);
hasError = false; hasError = false;
_prescriptionList.clear(); _prescriptionList.clear();
_prescriptionListNew.clear(); _prescriptionListNew.clear();
@ -127,10 +127,10 @@ class PrescriptionService extends LookupService {
} }
Future getMedicationList({String drug = ''}) async { Future getMedicationList({String drug = ''}) async {
allMedicationList = [];
hasError = false; hasError = false;
_drugRequestModel.search = ["$drug"]; _drugRequestModel.search = ["$drug"];
await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) {
allMedicationList = [];
response['MedicationList']['entityList'].forEach((v) { response['MedicationList']['entityList'].forEach((v) {
allMedicationList.add(GetMedicationResponseModel.fromJson(v)); allMedicationList.add(GetMedicationResponseModel.fromJson(v));
}); });

@ -707,6 +707,9 @@ class SOAPService extends LookupService {
hasError = false; hasError = false;
await baseAppClient.post(POST_CHIEF_COMPLAINT_VP, await baseAppClient.post(POST_CHIEF_COMPLAINT_VP,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['List_CreateChiefComplaint']['resultData'].forEach((v) {
episodeID = v['episodeId'];
});
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -48,6 +48,7 @@ class PatientMedicalReportViewModel extends BaseViewModel {
Future verifyMedicalReport( Future verifyMedicalReport(
PatiantInformtion patient, MedicalReportModel medicalReport, bool? isVidaPlusProject) async { PatiantInformtion patient, MedicalReportModel medicalReport, bool? isVidaPlusProject) async {
setState(ViewState.Busy); setState(ViewState.Busy);
print("the isVidaPlusProject flag in VM is $isVidaPlusProject");
await _service.verifyMedicalReport(patient, medicalReport, isVidaPlusProject); await _service.verifyMedicalReport(patient, medicalReport, isVidaPlusProject);
if (_service.hasError) { if (_service.hasError) {
error = _service.error; error = _service.error;

@ -31,6 +31,7 @@ class PatientSearchViewModel extends BaseViewModel {
int firstSubsetIndex = 0; int firstSubsetIndex = 0;
int inPatientPageSize = 20; int inPatientPageSize = 20;
int lastSubsetIndex = 20; int lastSubsetIndex = 20;
String noDataFoundText = "";
List<String> InpatientClinicList = []; List<String> InpatientClinicList = [];
@ -192,6 +193,7 @@ class PatientSearchViewModel extends BaseViewModel {
FutureOr<void> paginatedInPatientCall(String? selectedClinicName, String? query, bool? isSortDes,{bool isMyInPatient = false,bool isAllClinic = false }) async { FutureOr<void> paginatedInPatientCall(String? selectedClinicName, String? query, bool? isSortDes,{bool isMyInPatient = false,bool isAllClinic = false }) async {
if(isVidaPlusProject == false) return; if(isVidaPlusProject == false) return;
if(paginationLoading == true) return;
if(this.requestModel == null) return; if(this.requestModel == null) return;
PatientSearchRequestModel requestModel = this.requestModel!; PatientSearchRequestModel requestModel = this.requestModel!;
@ -200,18 +202,23 @@ class PatientSearchViewModel extends BaseViewModel {
notifyListeners(); notifyListeners();
await _inPatientService.getInPatientList(requestModel, false, isVidaPlusProject: isVidaPlusProject); await _inPatientService.getInPatientList(requestModel, false, isVidaPlusProject: isVidaPlusProject);
paginationLoading = false; paginationLoading = false;
notifyListeners();
if (_inPatientService.hasError) { if (_inPatientService.hasError) {
error = _inPatientService.error; error = _inPatientService.error;
requestModel.pageIndex = (requestModel.pageIndex??1) - 1 ;
} else { } else {
this.requestModel = requestModel; this.requestModel = requestModel;
if (inPatientList.isEmpty == true) {
requestModel.pageIndex = (requestModel.pageIndex??1) - 1 ;
Utils.showErrorToast(noDataFoundText);
return;
}
await setDefaultInPatientList(isFromPagination: true); await setDefaultInPatientList(isFromPagination: true);
generateInpatientClinicList(isFromPagination: true); generateInpatientClinicList(isFromPagination: true);
sortInPatient(isDes:isSortDes == true, isAllClinic: isAllClinic, isMyInPatient: isMyInPatient ); sortInPatient(isDes:isSortDes == true, isAllClinic: isAllClinic, isMyInPatient: isMyInPatient );
filterSearchResults(query!, isAllClinic: isAllClinic, isMyInPatient: isMyInPatient); filterSearchResults(query!, isAllClinic: isAllClinic, isMyInPatient: isMyInPatient);
filterByClinic(clinicName: selectedClinicName!); filterByClinic(clinicName: selectedClinicName!);
} }
notifyListeners();
} }

@ -1100,9 +1100,12 @@ class SOAPViewModel extends BaseViewModel {
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else {
if(patientInfo.episodeNo == 0)
patientInfo.episodeNo = _SOAPService.episodeID;
setState(ViewState.Idle); setState(ViewState.Idle);
} }
}
updateChiefComplaint( updateChiefComplaint(
PatiantInformtion patientInfo, GetChiefComplaintVidaPlus CC) async { PatiantInformtion patientInfo, GetChiefComplaintVidaPlus CC) async {

@ -180,15 +180,15 @@ class MedicineViewModel extends BaseViewModel {
} }
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel getAssessmentReqModel =
GetAssessmentReqModel(patientMRN: patientInfo!.patientMRN!, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: patientInfo.appointmentNo); GetAssessmentReqModel(patientMRN: patientInfo!.patientMRN!, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: patientInfo.appointmentNo);
if (medicationStrengthList.length == 0) { // if (medicationStrengthList.length == 0) {
await getMedicationStrength(isLocalBusy: true); await getMedicationStrength(isLocalBusy: true);
} // }
if (medicationDurationList.length == 0) { // if (medicationDurationList.length == 0) {
await getMedicationDuration(isLocalBusy: true); await getMedicationDuration(isLocalBusy: true);
} // }
if (medicationDoseTimeList.length == 0) { // if (medicationDoseTimeList.length == 0) {
await getMedicationDoseTime(isLocalBusy: true); await getMedicationDoseTime(isLocalBusy: true);
} // }
await getPatientAssessment(getAssessmentReqModel, isLocalBusy: true); await getPatientAssessment(getAssessmentReqModel, isLocalBusy: true);
if (_prescriptionService.hasError) { if (_prescriptionService.hasError) {
error = _prescriptionService.error; error = _prescriptionService.error;
@ -260,15 +260,15 @@ class MedicineViewModel extends BaseViewModel {
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel getAssessmentReqModel =
GetAssessmentReqModel(patientMRN: patient!.patientMRN!, episodeID: patient.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: patient.appointmentNo); GetAssessmentReqModel(patientMRN: patient!.patientMRN!, episodeID: patient.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: patient.appointmentNo);
if (medicationStrengthList.length == 0) { // if (medicationStrengthList.length == 0) {
await getMedicationStrength(); await getMedicationStrength();
} // }
if (medicationDurationList.length == 0) { // if (medicationDurationList.length == 0) {
await getMedicationDuration(); await getMedicationDuration();
} // }
if (medicationDoseTimeList.length == 0) { // if (medicationDoseTimeList.length == 0) {
await getMedicationDoseTime(); await getMedicationDoseTime();
} // }
await getPatientAssessment(getAssessmentReqModel); await getPatientAssessment(getAssessmentReqModel);
} }

@ -126,9 +126,11 @@ class PatientReferralViewModel extends BaseViewModel {
} }
} }
mapHospitalToBranchList(){ mapHospitalToBranchList() async {
branchesList!.clear(); branchesList!.clear();
DoctorProfileModel doctorProfile = await getDoctorProfile();
_hospitalService.hospitals.forEach((element) { _hospitalService.hospitals.forEach((element) {
if(doctorProfile.projectID != element.facilityId)
branchesList!.add({"facilityId": element.facilityId, "facilityName": element.facilityName}); branchesList!.add({"facilityId": element.facilityId, "facilityName": element.facilityName});
}); });
} }

@ -56,13 +56,13 @@ class PrescriptionViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getPrescriptionListNew({int? mrn, int appNo = 0, bool isLocalBusy = false}) async { Future getPrescriptionListNew({int? mrn, int appNo = 0, bool isLocalBusy = false, int? episodeId}) async {
hasError = false; hasError = false;
if (isLocalBusy) if (isLocalBusy)
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
else else
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService.getPrescriptionListNew(mrn: mrn!, appNo: appNo); await _prescriptionService.getPrescriptionListNew(mrn: mrn!, appNo: appNo, episodeID: episodeId);
if (_prescriptionService.hasError) { if (_prescriptionService.hasError) {
error = _prescriptionService.error!; error = _prescriptionService.error!;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -78,7 +78,7 @@ class PrescriptionViewModel extends BaseViewModel {
error = _prescriptionService.error!; error = _prescriptionService.error!;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await getPrescriptionListNew(mrn: mrn); await getPrescriptionListNew(mrn: mrn, episodeId: postProcedureReqModel.episodeID);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

@ -130,6 +130,7 @@ class ProcedureViewModel extends BaseViewModel {
} }
setTemplateListDependOnId() { setTemplateListDependOnId() {
templateList.clear();
procedureTemplate.forEach((element) { procedureTemplate.forEach((element) {
List<ProcedureTempleteDetailsModelList> templateListData = templateList.where((elementTemplate) => elementTemplate.templateId == element.templateID).toList(); List<ProcedureTempleteDetailsModelList> templateListData = templateList.where((elementTemplate) => elementTemplate.templateId == element.templateID).toList();
@ -444,22 +445,20 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
void filterProcedureSearchResults(String query, List<ProcedureTempleteModel> masterList, List<ProcedureTempleteModel> items) { void filterProcedureSearchResults(String query, List<ProcedureTempleteDetailsModelList> masterList, Function(List<ProcedureTempleteDetailsModelList>) onItemSearched) {
List<ProcedureTempleteModel> dummySearchList = []; List<ProcedureTempleteDetailsModelList> dummySearchList = [];
if (masterList != null) dummySearchList.addAll(masterList); if (masterList != null) dummySearchList.addAll(masterList);
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<ProcedureTempleteModel> dummyListData = []; List<ProcedureTempleteDetailsModelList> dummyListData = [];
dummySearchList.forEach((item) { dummySearchList.forEach((item) {
if (item.templateName!.toLowerCase().contains(query.toLowerCase())) { if (item.templateName!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item); dummyListData.add(item);
} }
}); });
items.clear(); onItemSearched(dummyListData);
items.addAll(dummyListData);
return; return;
} else { } else {
items.clear(); onItemSearched(dummySearchList);
items.addAll(masterList);
} }
} }

@ -24,6 +24,7 @@ class ProjectViewModel with ChangeNotifier {
String? currentLanguage = 'ar'; String? currentLanguage = 'ar';
bool _isArabic = false; bool _isArabic = false;
static bool _isVidaPlusProject = false;
bool isInternetConnection = true; bool isInternetConnection = true;
List<ClinicModel> doctorClinicsList = []; List<ClinicModel> doctorClinicsList = [];
bool isLoading = false; bool isLoading = false;
@ -149,4 +150,13 @@ class ProjectViewModel with ChangeNotifier {
await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, listen: false).getDoctorProfileBasedOnClinic(clinicModel); await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, listen: false).getDoctorProfileBasedOnClinic(clinicModel);
} }
static setVidaPlusStatus(bool isVidaPlus){
_isVidaPlusProject = isVidaPlus;
}
static getVidaPlusStatus(){
return _isVidaPlusProject;
}
} }

@ -18,13 +18,14 @@ import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:timezone/data/latest_all.dart' as tz;
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(); await Firebase.initializeApp();
HttpOverrides.global = MyHttpOverrides(); HttpOverrides.global = MyHttpOverrides();
setupLocator(); setupLocator();
await clearPrefsOnFirstLaunch(); await clearPrefsOnFirstLaunch();
tz.initializeTimeZones();
runApp(MyApp()); runApp(MyApp());
} }

@ -82,6 +82,8 @@ class _HomeScreenState extends State<HomeScreen> {
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
var doctorProfile = await model.getDoctorProfile();
ProjectViewModel.setVidaPlusStatus(Utils.isVidaPlusProject(projectsProvider!, doctorProfile.projectID ?? -1));
model.startHomeScreenServices(projectsProvider, authenticationViewModel).then((value) { model.startHomeScreenServices(projectsProvider, authenticationViewModel).then((value) {
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
if (model.radiologyCriticalFindingModel != null) { if (model.radiologyCriticalFindingModel != null) {

@ -80,8 +80,15 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
model.getMedicalFile(mrn: pp!); model.getMedicalFile(mrn: pp!);
} }
}, },
builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold( builder: (BuildContext context, MedicalFileViewModel model, Widget? child) =>
appBar: PatientProfileAppBar( // AppScaffold(
// isShowAppBar: false,
// appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),
// body:
Material(
child: Column(
children: [
PatientProfileAppBar(
patient!, patient!,
doctorName: doctorName!, doctorName: doctorName!,
profileUrl: doctorImage!, profileUrl: doctorImage!,
@ -94,13 +101,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
), isArabic: projectViewModel.isArabic)}', ), isArabic: projectViewModel.isArabic)}',
isAppointmentHeader: true, isAppointmentHeader: true,
), ),
isShowAppBar: true, Expanded(
appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Center(
child: Container(
child: Column( child: Column(
children: [ children: [
model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0 model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0
@ -290,7 +292,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
height: 15.0, height: 15.0,
), ),
AppText( AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].remarks! model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].remarks??""
.trim(), .trim(),
), ),
Divider( Divider(
@ -497,15 +499,15 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
), ),
], ],
), ),
Row( // Row(
children: [ // children: [
AppText( // AppText(
model // model
.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!, // .medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!,
fontWeight: FontWeight.w700, // fontWeight: FontWeight.w700,
) // )
], // ],
), // ),
Row( Row(
children: [ children: [
AppText(TranslationBase.of(context).abnormal + ": "), AppText(TranslationBase.of(context).abnormal + ": "),
@ -554,9 +556,10 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
), ),
), ),
), ),
],
), ),
), ),
), // ),
); );
} }
} }

@ -119,7 +119,7 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
addSickLeave.noOfDays = value; addSickLeave.noOfDays = value;
}); });
}, },
validationError: isFormSubmitted && (addSickLeave.noOfDays == null) ? TranslationBase.of(context).pleaseEnterNoOfDays : "", validationError: isFormSubmitted && (addSickLeave.noOfDays == null) ? TranslationBase.of(context).pleaseEnterNoOfDays : null,
onClick: () {}, onClick: () {},
onFieldSubmitted: () {}, onFieldSubmitted: () {},
), ),
@ -148,7 +148,7 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
addSickLeave.startDate = value; addSickLeave.startDate = value;
}); });
}, },
validationError: isFormSubmitted && (addSickLeave.startDate == null) ? TranslationBase.of(context).pleaseEnterDate : "", validationError: isFormSubmitted && (addSickLeave.startDate == null) ? TranslationBase.of(context).pleaseEnterDate : null,
onFieldSubmitted: () {}, onFieldSubmitted: () {},
), ),
SizedBox( SizedBox(
@ -293,6 +293,7 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
addSickLeave.patientMRN = widget.patient!.patientMRN.toString(); addSickLeave.patientMRN = widget.patient!.patientMRN.toString();
addSickLeave.appointmentNo = widget.patient!.appointmentNo.toString(); addSickLeave.appointmentNo = widget.patient!.appointmentNo.toString();
await model.addSickLeave(addSickLeave); await model.addSickLeave(addSickLeave);
print("the state is ${model.state}");
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {

@ -158,10 +158,10 @@ class _InPatientListPageState extends State<InPatientListPage> {
onFieldSubmitted: () {}, onFieldSubmitted: () {},
), ),
widget.patientSearchViewModel!.state == ViewState.Idle widget.patientSearchViewModel!.state == ViewState.Idle
? (widget.isMyInPatient && widget.patientSearchViewModel!.myIinPatientList.length > 0) ? (widget.isMyInPatient && widget.patientSearchViewModel!.filteredMyInPatientItems.length > 0)
? ListOfMyInpatient(isAllClinic: widget.isAllClinic, hasQuery: hasQuery, patientSearchViewModel: widget.patientSearchViewModel!, isVidaPlusProject: widget.isVidaPlusProject,) ? ListOfMyInpatient(isAllClinic: widget.isAllClinic, hasQuery: hasQuery, patientSearchViewModel: widget.patientSearchViewModel!, isVidaPlusProject: widget.isVidaPlusProject,)
: widget.patientSearchViewModel!.filteredInPatientItems.length > 0 : widget.patientSearchViewModel!.filteredInPatientItems.length > 0
? (widget.isMyInPatient && widget.patientSearchViewModel!.myIinPatientList.length == 0) ? (widget.isMyInPatient && widget.patientSearchViewModel!.filteredMyInPatientItems.length == 0)
? NoData() ? NoData()
: ListOfAllInPatient(isAllClinic: widget.isAllClinic, hasQuery: hasQuery, patientSearchViewModel: widget.patientSearchViewModel!, isVidaPlusProject: widget : ListOfAllInPatient(isAllClinic: widget.isAllClinic, hasQuery: hasQuery, patientSearchViewModel: widget.patientSearchViewModel!, isVidaPlusProject: widget
.isVidaPlusProject,query: _searchController.text, selectedClinicName: widget.selectedClinicName,isSortDes: isSortDes) .isVidaPlusProject,query: _searchController.text, selectedClinicName: widget.selectedClinicName,isSortDes: isSortDes)

@ -67,6 +67,7 @@ class _InPatientScreenState extends State<InPatientScreen> with SingleTickerProv
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.noDataFoundText = TranslationBase.of(context).noDataAvailable;
model.clearPatientList(); model.clearPatientList();
var doctorProfile = await model.getDoctorProfile(); var doctorProfile = await model.getDoctorProfile();
if (widget.specialClinic != null && widget.specialClinic!.clinicID != null) { if (widget.specialClinic != null && widget.specialClinic!.clinicID != null) {

@ -433,7 +433,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
TranslationBase.of(context).companyName + ": ", TranslationBase.of(context).companyName + ": ",
color: Colors.grey[500], color: Colors.grey[500],
), ),
AppText('Sample') Expanded(child: AppText(projectViewModel.isArabic?model.insuranceApproval[indexInsurance].companyNameN??'':model.insuranceApproval[indexInsurance].companyName??''))
], ],
), ),
Row( Row(

@ -32,7 +32,7 @@ class ProceduresWidget extends StatelessWidget {
SizedBox(width: 10,), SizedBox(width: 10,),
CustomRow( CustomRow(
label: "${TranslationBase.of(context).quantity}: ", label: "${TranslationBase.of(context).quantity}: ",
value: "${procedure.lineItemNo}", value: "1",//done as prescribed https://cloudsolutions-sa.atlassian.net/browse/V4-40476?focusedCommentId=471705
isExpanded: false, isExpanded: false,
valueSize: SizeConfig.textMultiplier! * 1.8, valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6, labelSize: SizeConfig.textMultiplier! * 1.6,

@ -86,8 +86,9 @@ class _VitalSignDetailsWidgetState extends State<DiabeticDetails> {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
widget.diabeticDetailsList!.forEach((diabetic) { widget.diabeticDetailsList!.forEach((diabetic) {
var data = diabetic.resultValue; var data = diabetic.resultValue;
//https://cloudsolutions-sa.atlassian.net/browse/V4-39217?focusedCommentId=47028722
DateTime elementDate = DateTime elementDate =
AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart!); AppDateUtils.parseDateTimeWithRiyadhTZ(diabetic.dateChart!);
if (data != 0) if (data != 0)
tableRow.add(TableRow(children: [ tableRow.add(TableRow(children: [
Container( Container(

@ -52,15 +52,26 @@ class _LabsHomePageState extends State<LabsHomePage> {
model.getLabs(patient!, isInpatient: false); model.getLabs(patient!, isInpatient: false);
model.isPrincipalCovered(patient: patient!); model.isPrincipalCovered(patient: patient!);
}, },
builder: (context, ProcedureViewModel model, widget) => AppScaffold( builder: (context, ProcedureViewModel model, widget) =>
baseViewModel: model,
backgroundColor: Colors.grey[100]!, // AppScaffold(
isShowAppBar: true, // baseViewModel: model,
appBar: PatientProfileAppBar( // backgroundColor: Colors.grey[100]!,
// isShowAppBar: true,
// appBar: PatientProfileAppBar(
// patient!,
// isInpatient: isInpatient!,
// ),
// body:
Material(
child: Column(
children: [
PatientProfileAppBar(
patient!, patient!,
isInpatient: isInpatient!, isInpatient: isInpatient!,
), ),
body: SingleChildScrollView( Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
@ -192,6 +203,9 @@ class _LabsHomePageState extends State<LabsHomePage> {
), ),
), ),
), ),
],
),
),
); );
} }
} }

@ -98,8 +98,8 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
if (txtOfMedicalReport.isNotEmpty) { if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.medicalReport != null widget.medicalReport != null
? await widget.model!.updateMedicalReport(widget.patient!, txtOfMedicalReport, widget.medicalReport != null ? widget.medicalReport!.lineItemNo! : 0, ? await widget.model!.updateMedicalReport(widget.patient!, txtOfMedicalReport, widget.medicalReport != null ? widget.medicalReport!.lineItemNo??0: 0,
widget.medicalReport != null ? widget.medicalReport!.invoiceNo! : "", widget.isVidaPlusProject) widget.medicalReport != null ? widget.medicalReport!.invoiceNo??"" : "", widget.isVidaPlusProject)
: await widget.model!.addMedicalReport(widget.patient!, txtOfMedicalReport, widget.isVidaPlusProject); : await widget.model!.addMedicalReport(widget.patient!, txtOfMedicalReport, widget.isVidaPlusProject);
//model.getMedicalReportList(patient); //model.getMedicalReportList(patient);
@ -128,6 +128,7 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
txtOfMedicalReport = (await _controller.getText())!; txtOfMedicalReport = (await _controller.getText())!;
if (txtOfMedicalReport.isNotEmpty) { if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
print("isVidaPlusProject: ${widget.isVidaPlusProject}");
await widget.model!.verifyMedicalReport(widget.patient!, widget.medicalReport!, widget.isVidaPlusProject); await widget.model!.verifyMedicalReport(widget.patient!, widget.medicalReport!, widget.isVidaPlusProject);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.pop(context); Navigator.pop(context);

@ -124,6 +124,7 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
model: model, model: model,
medicalNote: model medicalNote: model
.medicalReportList[index].reportDataHtml, .medicalReportList[index].reportDataHtml,
isVidaPlusProject: isVidaPlusProject
), ),
settings: settings:
RouteSettings(name: 'AddVerifyMedicalReport')), RouteSettings(name: 'AddVerifyMedicalReport')),
@ -157,7 +158,10 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
children: [ children: [
AppText( AppText(
model.medicalReportList[index].status == 1 model.medicalReportList[index].status == 1
? TranslationBase.of(context).onHold ? isVidaPlusProject
? TranslationBase.of(context)
.pending
: TranslationBase.of(context).onHold
: TranslationBase.of(context).verified, : TranslationBase.of(context).verified,
color: color:
model.medicalReportList[index].status == model.medicalReportList[index].status ==

@ -267,6 +267,13 @@ String noteValidation ="";
height: 30, height: 30,
), ),
onPressed: () async { onPressed: () async {
if(ProjectViewModel.getVidaPlusStatus() && !isInpatient){
Navigator.of(context).pushNamed(
UPDATE_EPISODE_VIDA_PLUS, arguments: {
'patient': patient
});
return;
}
if ((isFromLiveCare && patient.appointmentNo != null) || patient.patientStatusType == 43 || isInpatient) { if ((isFromLiveCare && patient.appointmentNo != null) || patient.patientStatusType == 43 || isInpatient) {
createEpisode(patient: patient, model: model); createEpisode(patient: patient, model: model);
} }
@ -489,7 +496,8 @@ String noteValidation ="";
eventAction: "Create Episode", eventAction: "Create Episode",
); );
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (patient.admissionNo != null && patient.admissionNo!.isNotEmpty) { var admissionNo = isVidaPlusProject?patient.admissionID?.toString()??"":patient.admissionNo??"";
if (admissionNo.isNotEmpty) {
PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: isVidaPlusProject?patient.admissionID: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); await model.postEpisodeForInPatient(postEpisodeReqModel);
} else { } else {

@ -49,7 +49,7 @@ class RadiologyDetailsPage extends StatelessWidget {
clinic: finalRadiology.clinicDescription, clinic: finalRadiology.clinicDescription,
branch: finalRadiology.projectName, branch: finalRadiology.projectName,
profileUrl: finalRadiology.doctorImageURL, profileUrl: finalRadiology.doctorImageURL,
invoiceNO: finalRadiology.invoiceNo.toString(), invoiceNO: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP.toString() : finalRadiology.invoiceNo.toString(),
isAppointmentHeader: true, isAppointmentHeader: true,
), ),
isShowAppBar: true, isShowAppBar: true,

@ -51,6 +51,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
int _activePriority = 1; int _activePriority = 1;
String? appointmentDate; String? appointmentDate;
String? branchError; String? branchError;
String? diagnosisError;
String? hospitalError; String? hospitalError;
String? clinicError; String? clinicError;
String? doctorError; String? doctorError;
@ -132,15 +133,15 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
dynamic priority1 = { dynamic priority1 = {
"ParameterCode": 1, "ParameterCode": isVidaPlusProject ? 2 :1,
"Description": TranslationBase.of(context).veryUrgent.toUpperCase(), "Description": TranslationBase.of(context).veryUrgent.toUpperCase(),
}; };
dynamic priority2 = { dynamic priority2 = {
"ParameterCode": 2, "ParameterCode": isVidaPlusProject? 1 :2,
'Description': TranslationBase.of(context).urgent.toUpperCase(), 'Description': TranslationBase.of(context).urgent.toUpperCase(),
}; };
dynamic priority3 = { dynamic priority3 = {
"ParameterCode": 0, "ParameterCode": isVidaPlusProject? 3 :0,
'Description': TranslationBase.of(context).routine.toUpperCase(), 'Description': TranslationBase.of(context).routine.toUpperCase(),
}; };
@ -482,7 +483,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: selectedDiagnosis != null ? selectedDiagnosis['selectedDisease'] : null, dropDownText: selectedDiagnosis != null ? selectedDiagnosis['selectedDisease'] : null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: branchError, validationError: diagnosisError,
onClick: () { onClick: () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: model.diagnosisForInPatientList, list: model.diagnosisForInPatientList,
@ -619,6 +620,11 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
} else { } else {
frequencyError = null; frequencyError = null;
} }
if ( isVidaPlusProject && selectedDiagnosis == null) {
diagnosisError = TranslationBase.of(context).fieldRequired;
} else {
diagnosisError = null;
}
if (_selectedPriority == null) { if (_selectedPriority == null) {
priorityError = TranslationBase.of(context).fieldRequired; priorityError = TranslationBase.of(context).fieldRequired;
} else { } else {

@ -103,9 +103,9 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}", patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}",
isSameBranch: model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch, isSameBranch: model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch,
isReferral: true, isReferral: true,
remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource!, remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource,
nationality: model.patientReferral[model.patientReferral.length - 1].patientDetails!.nationalityName!, nationality: model.patientReferral[model.patientReferral.length - 1].patientDetails!.nationalityName!,
nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl!, nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl,
doctorAvatar: model.patientReferral[model.patientReferral.length - 1].doctorImageUrl!, doctorAvatar: model.patientReferral[model.patientReferral.length - 1].doctorImageUrl!,
referralDoctorName: model.patientReferral[model.patientReferral.length - 1].referredByDoctorInfo!, referralDoctorName: model.patientReferral[model.patientReferral.length - 1].referredByDoctorInfo!,
clinicDescription: "", clinicDescription: "",

@ -123,7 +123,7 @@ class _AddDetailsToExaminationVidaPlusState
if (listOfSelectedCategory.isEmpty) { if (listOfSelectedCategory.isEmpty) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context) TranslationBase.of(context)
.kindlySelectCategory); .kindlySelectAllMandatoryField);
return; return;
} }
/* if (listOfSelectedCategory.any((value) { /* if (listOfSelectedCategory.any((value) {

@ -128,7 +128,7 @@ class _AddExaminationPageVidaPlusState
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
onPressed: () async { onPressed: () async {
if(mySelectedExaminationLocal.isEmpty){ if(mySelectedExaminationLocal.isEmpty){
DrAppToastMsg.showErrorToast(TranslationBase.of(context).kindlySelectCategory); DrAppToastMsg.showErrorToast(TranslationBase.of(context).kindlySelectAllMandatoryField);
return; return;
} }
pushAddExamination(mySelectedExaminationLocal); pushAddExamination(mySelectedExaminationLocal);

@ -240,11 +240,11 @@ class UpdatePresentIllnessState extends State<UpdatePresentIllness> {
); );
} }
saveHopi(SOAPViewModel model) async{ saveHopi(SOAPViewModel model) async{
GifLoaderDialogUtils.showMyDialog(context);
if(patientController.text.isEmpty) { if(patientController.text.isEmpty) {
DrAppToastMsg.showErrorToast("Please Enter Remarks"); DrAppToastMsg.showErrorToast("Please Enter Remarks");
return; return;
} }
GifLoaderDialogUtils.showMyDialog(context);
Map<String,dynamic> request = { Map<String,dynamic> request = {
"hpi": patientController.text, "hpi": patientController.text,
"isHpiTakenPatient": isPatientSelected, "isHpiTakenPatient": isPatientSelected,

@ -151,6 +151,7 @@ class _AddDrugWidgetState extends State<AddDrugWidget> {
!.getPrescriptionListNew( !.getPrescriptionListNew(
appNo: widget.patient!.appointmentNo, appNo: widget.patient!.appointmentNo,
mrn: widget.patient!.patientMRN, mrn: widget.patient!.patientMRN,
episodeId: widget.patient!.episodeNo,
isLocalBusy: true); isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast( DrAppToastMsg.showSuccesToast(

@ -160,32 +160,33 @@ getIcdCodeData() async{
SizedBox( SizedBox(
height: 15.0, height: 15.0,
), ),
Container( // Container(
child: Row( // child:
mainAxisAlignment: MainAxisAlignment.start, // Row(
children: [ // mainAxisAlignment: MainAxisAlignment.start,
SizedBox( // children: [
width: 6, // SizedBox(
), // width: 6,
AppText( // ),
TranslationBase.of(context).orderType, // AppText(
fontWeight: FontWeight.w500, // TranslationBase.of(context).orderType,
), // fontWeight: FontWeight.w500,
SizedBox( // ),
width: 18, // SizedBox(
), // width: 18,
Radio( // ),
activeColor: AppGlobal.appRedColor, // Radio(
value: 1, // activeColor: AppGlobal.appRedColor,
groupValue: selectedType, // value: 1,
onChanged: (value) { // groupValue: selectedType,
setSelectedType(value!); // onChanged: (value) {
}, // setSelectedType(value!);
), // },
Text(TranslationBase.of(context).regular), // ),
], // Text(TranslationBase.of(context).regular),
), // ],
), // ),
// ),
Row( Row(
children: [ children: [
Container( Container(

@ -14,15 +14,27 @@ import '../../../widgets/shared/network_base_view.dart';
import '../../../widgets/shared/text_fields/app_text_form_field.dart'; import '../../../widgets/shared/text_fields/app_text_form_field.dart';
import '../../base/base_view.dart'; import '../../base/base_view.dart';
final myController = TextEditingController();
class SearchPrescriptionWidget extends StatelessWidget { class SearchPrescriptionWidget extends StatefulWidget {
final double? spaceBetweenTextFields; final double? spaceBetweenTextFields;
final MedicineViewModel? medicineViewModel; final MedicineViewModel? medicineViewModel;
final PrescriptionViewModel? prescriptionViewModel; final PrescriptionViewModel? prescriptionViewModel;
final Function(GetMedicationResponseModel)? onItemSelected; final Function(GetMedicationResponseModel)? onItemSelected;
const SearchPrescriptionWidget({Key? key, this.spaceBetweenTextFields, this.medicineViewModel, this.prescriptionViewModel, this.onItemSelected}) : super(key: key); SearchPrescriptionWidget({Key? key, this.spaceBetweenTextFields, this.medicineViewModel, this.prescriptionViewModel, this.onItemSelected}) : super(key: key);
@override
State<SearchPrescriptionWidget> createState() => _SearchPrescriptionWidgetState();
}
class _SearchPrescriptionWidgetState extends State<SearchPrescriptionWidget> {
final myController = TextEditingController();
@override
void initState() {
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -93,7 +105,7 @@ class SearchPrescriptionWidget extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.getItem(itemID: model.allMedicationList[index].itemId!, isLocalBusy: true); await model.getItem(itemID: model.allMedicationList[index].itemId!, isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
onItemSelected!(model.allMedicationList[index]); widget.onItemSelected!(model.allMedicationList[index]);
// uom = _selectedMedication.uom; // uom = _selectedMedication.uom;
}, },
); );
@ -104,7 +116,7 @@ class SearchPrescriptionWidget extends StatelessWidget {
), ),
), ),
SizedBox( SizedBox(
height: spaceBetweenTextFields, height: widget.spaceBetweenTextFields,
), ),
], ],
), ),

@ -36,7 +36,9 @@ class NewPrescriptionsPage extends StatelessWidget {
mrn: patient.patientMRN, mrn: patient.patientMRN,
appNo: patient.appointmentNo == null appNo: patient.appointmentNo == null
? 0 ? 0
: int.parse(patient.appointmentNo.toString())); : int.parse(patient.appointmentNo.toString()),
episodeId: patient.episodeNo,
);
// } // }
await model.isPrincipalCovered(patient: patient); await model.isPrincipalCovered(patient: patient);

@ -217,15 +217,15 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
}); });
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel getAssessmentReqModel =
GetAssessmentReqModel(patientMRN: widget.patient.patientMRN, episodeID: widget.patient.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: widget.patient.appointmentNo); GetAssessmentReqModel(patientMRN: widget.patient.patientMRN, episodeID: widget.patient.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: widget.patient.appointmentNo);
if (model.medicationStrengthList.length == 0) { // if (model.medicationStrengthList.length == 0) {
await model.getMedicationStrength(); await model.getMedicationStrength();
} // }
if (model.medicationDurationList.length == 0) { // if (model.medicationDurationList.length == 0) {
await model.getMedicationDuration(); await model.getMedicationDuration();
} // }
if (model.medicationDoseTimeList.length == 0) { // if (model.medicationDoseTimeList.length == 0) {
await model.getMedicationDoseTime(); await model.getMedicationDoseTime();
} // }
await model.getPatientAssessment(getAssessmentReqModel); await model.getPatientAssessment(getAssessmentReqModel);
}, },
builder: ( builder: (

@ -148,9 +148,12 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
model: widget.model, model: widget.model,
masterList: model.categoriesList[0].entityList!, masterList: model.categoriesList[0].entityList!,
removeProcedure: (item) { removeProcedure: (item) {
EntityList? itemToBeRemoved = entityList.firstWhere((element) => item.procedureId == element.procedureId, orElse: () => EntityList());
if (itemToBeRemoved.procedureId != null) {
setState(() { setState(() {
entityList.remove(item); entityList.remove(itemToBeRemoved);
}); });
}
}, },
addProcedure: (history) { addProcedure: (history) {
setState(() { setState(() {

@ -60,7 +60,10 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage> with
onModelReady: (model) async { onModelReady: (model) async {
if (widget.previousProcedureViewModel == null) { if (widget.previousProcedureViewModel == null) {
await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()); await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId());
}else{
await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId());
} }
}, },
builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold(
baseViewModel: model, baseViewModel: model,

@ -61,13 +61,14 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State<EntityList
}); });
} }
List<ProcedureTempleteModel> items = []; List<ProcedureTempleteDetailsModelList> items = [];
List<ProcedureTempleteDetailsModel> itemsProcedure = []; List<ProcedureTempleteDetailsModel> itemsProcedure = [];
List<String> remarksList = []; List<String> remarksList = [];
List<int> typeList = []; List<int> typeList = [];
@override @override
void initState() { void initState() {
items = [...widget.model!.templateList];
super.initState(); super.initState();
} }
@ -90,7 +91,11 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State<EntityList
AppTextFieldCustomSearch( AppTextFieldCustomSearch(
searchController: patientFileInfoController, searchController: patientFileInfoController,
onChangeFun: (value) { onChangeFun: (value) {
widget.model!.filterProcedureSearchResults(value, widget.masterList!, items); widget.model!.filterProcedureSearchResults(value, widget.model!.templateList, (items){
setState(() {
this.items = items;
});
});
}, },
marginTop: 5, marginTop: 5,
inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))], inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))],
@ -101,9 +106,9 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State<EntityList
SizedBox( SizedBox(
height: 15, height: 15,
), ),
widget.model!.templateList.length != 0 this.items.length != 0
? Column( ? Column(
children: widget.model!.templateList.map((historyInfo) { children: this.items.map((historyInfo) {
return ExpansionProcedure( return ExpansionProcedure(
procedureTempleteModel: historyInfo, procedureTempleteModel: historyInfo,
model: widget.model!, model: widget.model!,

@ -1,7 +1,8 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:timezone/timezone.dart' as tz;
class AppDateUtils { class AppDateUtils {
static String convertDateToFormat(DateTime dateTime, String dateFormat) { static String convertDateToFormat(DateTime dateTime, String dateFormat) {
return DateFormat(dateFormat).format(dateTime); return DateFormat(dateFormat).format(dateTime);
@ -37,8 +38,58 @@ class AppDateUtils {
return DateFormat(dateFormat).format(date); return DateFormat(dateFormat).format(date);
} }
static DateTime getDateTimeFromServerFormat(String str) { static DateTime getDateTimeFromServerFormat(String str) {
if(ProjectViewModel.getVidaPlusStatus()){
return getDateTimeFromServerFormatForVida4(str);
}
return getDateTimeFromServerFormatForVida3(str);
}
static DateTime getDateTimeFromServerFormatForVida4(String str) {
DateTime date = DateTime.now();
const start = "/Date(";
const end = "+0300)";
if (str.contains("/Date")) {
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var epoch = int.parse(str.substring(startIndex + start.length, endIndex));
final riyadh = tz.getLocation('Asia/Riyadh');
final dateTime = tz.TZDateTime.fromMillisecondsSinceEpoch(riyadh, epoch);
// date = new DateTime.fromMillisecondsSinceEpoch(
// int.parse(str.substring(startIndex + start.length, endIndex), ), isUtc: true);
var dateString = DateFormat('yyyy-MM-dd HH:mm:ss').format(dateTime);
return DateTime.parse("${dateString}Z").toLocal();
} else {
if(str.contains("T")){
date = DateTime.parse("${str}").toLocal();
}else
date = DateTime.parse("${str}Z").toLocal();
}
return date;
}
static DateTime parseMicrosoftJsonDate(String jsonDate) {
// Remove /Date( and )/
RegExp regExp = RegExp(r'/Date\((\d+)([+-]\d{4})?\)/');
Match? match = regExp.firstMatch(jsonDate);
if (match == null) {
throw FormatException('Invalid Microsoft JSON date format: $jsonDate');
}
// Extract timestamp in milliseconds
int timestamp = int.parse(match.group(1)!);
// Create UTC DateTime from timestamp
DateTime utcTime = DateTime.fromMillisecondsSinceEpoch(timestamp, isUtc: true);
// Convert to local timezone
return utcTime.toLocal();
}
static DateTime getDateTimeFromServerFormatForVida3(String str) {
DateTime date = DateTime.now(); DateTime date = DateTime.now();
const start = "/Date("; const start = "/Date(";
@ -56,6 +107,24 @@ class AppDateUtils {
return date; return date;
} }
static DateTime parseDateTimeWithRiyadhTZ(String str) {
DateTime date = DateTime.now();
const start = "/Date(";
const end = "+0300)";
if (str.contains("/Date")) {
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
final riyadh = tz.getLocation('Asia/Riyadh');
date = tz.TZDateTime.fromMillisecondsSinceEpoch(riyadh,
int.parse(str.substring(startIndex + start.length, endIndex)));
} else {
date = DateTime.parse(str);
}
return date;
}
static String differenceBetweenDateAndCurrentInYearMonthDay( static String differenceBetweenDateAndCurrentInYearMonthDay(
DateTime firstDate, BuildContext context) { DateTime firstDate, BuildContext context) {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
@ -328,7 +397,7 @@ class AppDateUtils {
/// get data formatted like 10:45 PM /// get data formatted like 10:45 PM
/// [dateTime] convert DateTime to data formatted /// [dateTime] convert DateTime to data formatted
static String getHour(DateTime dateTime) { static String getHour(DateTime dateTime) {
print("the time is ${DateFormat('hh:mm a').format(dateTime)}"); // print("the time is ${DateFormat('hh:mm a').format(dateTime)}");
return DateFormat('hh:mm a').format(dateTime); return DateFormat('hh:mm a').format(dateTime);
} }

@ -1947,6 +1947,7 @@ class TranslationBase {
String get noRemarks => localizedValues['noRemarks']![locale.languageCode]!; String get noRemarks => localizedValues['noRemarks']![locale.languageCode]!;
String get kindlySelectCategory => localizedValues['kindlySelectCategory']![locale.languageCode]!; String get kindlySelectCategory => localizedValues['kindlySelectCategory']![locale.languageCode]!;
String get kindlySelectAllMandatoryField => localizedValues['kindlySelectAllMandatoryField']![locale.languageCode]!;
String get remarksCanNotBeEmpty => localizedValues['remarksCanNotBeEmpty']![locale.languageCode]!; String get remarksCanNotBeEmpty => localizedValues['remarksCanNotBeEmpty']![locale.languageCode]!;
String get selectedDiagnosis => localizedValues['selectedDiagnosis']![locale.languageCode]!; String get selectedDiagnosis => localizedValues['selectedDiagnosis']![locale.languageCode]!;
String get selectConditionFirst => localizedValues['selectConditionFirst']![locale.languageCode]!; String get selectConditionFirst => localizedValues['selectConditionFirst']![locale.languageCode]!;

@ -94,9 +94,9 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
children: [ children: [
...items ...items
.map((item) => RadioListTile( .map((item) => RadioListTile(
title: Text("${Utils.convertToTitleCase(item[widget.attributeName].toString())}"), title: Text(Utils.convertToTitleCase(item[widget.attributeName].toString())),
groupValue: Utils.convertToTitleCase(widget.selectedValue[widget.attributeValueId].toString()), groupValue: widget.selectedValue[widget.attributeValueId].toString().toLowerCase(),
value: item[widget.attributeValueId].toString(), value: item[widget.attributeValueId].toString().toLowerCase(),
activeColor: AppGlobal.appRedColor, activeColor: AppGlobal.appRedColor,
selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId].toString(), selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId].toString(),
onChanged: (val) { onChanged: (val) {

@ -42,7 +42,8 @@ class CustomRow extends StatelessWidget {
SizedBox( SizedBox(
width: 1, width: 1,
), ),
AppText( Expanded(
child: AppText(
value, value,
fontSize: valueSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.9, fontSize: valueSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.9,
color: valueColor ?? Color(0xFF2B353E), color: valueColor ?? Color(0xFF2B353E),
@ -50,6 +51,7 @@ class CustomRow extends StatelessWidget {
letterSpacing: -0.48, letterSpacing: -0.48,
isCopyable: isCopyable, isCopyable: isCopyable,
), ),
),
], ],
); );
} }

@ -1594,6 +1594,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.6" version: "0.7.6"
timezone:
dependency: "direct main"
description:
name: timezone
sha256: dd14a3b83cfd7cb19e7888f1cbc20f258b8d71b54c06f79ac585f14093a287d1
url: "https://pub.dev"
source: hosted
version: "0.10.1"
timing: timing:
dependency: transitive dependency: transitive
description: description:

@ -138,6 +138,7 @@ dependencies:
flutter_zoom_videosdk: 1.12.10 flutter_zoom_videosdk: 1.12.10
dart_jsonwebtoken: ^2.14.0 dart_jsonwebtoken: ^2.14.0
two_dimensional_scrollables: ^0.3.3 two_dimensional_scrollables: ^0.3.3
timezone: ^0.10.1
dependency_overrides: dependency_overrides:

Loading…
Cancel
Save