Merge branch 'development-3.3' of http://34.17.52.79/Haroon6138/doctor_app_flutter into update_flutter_3.16.0

# Conflicts:
#	ios/Runner.xcodeproj/project.pbxproj
#	lib/core/model/SOAP/assessment/patch_assessment_req_model.dart
#	lib/core/service/patient_medical_file/soap/SOAP_service.dart
#	lib/core/viewModel/SOAP_view_model.dart
#	lib/core/viewModel/dashboard_view_model.dart
#	lib/core/viewModel/prescription/prescription_view_model.dart
#	lib/core/viewModel/procedure_View_model.dart
#	lib/screens/doctor_schedule/doctor_schedule.dart
#	lib/screens/home/home_screen.dart
#	lib/screens/patients/insurance_approvals_details.dart
#	lib/screens/patients/profile/lab_result/labs_home_page.dart
#	lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart
#	lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart
#	lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart
#	lib/screens/prescription/add_prescription/prescription_form_widget.dart
#	lib/screens/prescription/new_prescriptions_page.dart
#	lib/screens/procedures/add_procedure_page.dart
#	lib/screens/procedures/procedure_screen.dart
#	lib/utils/translations_delegate_base_utils.dart
#	lib/widgets/shared/speech-text-popup.dart
#	pubspec.lock
#	pubspec.yaml
flutter_3.16.0_zoom
Sultan khan 2 years ago
commit e4b891bf68

@ -21,6 +21,6 @@
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>
<string>9.0</string> <string>13.0</string>
</dict> </dict>
</plist> </plist>

@ -506,7 +506,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 1.3.1; MARKETING_VERSION = 1.3.99;
PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@ -637,15 +637,12 @@
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 1.3.1; MARKETING_VERSION = 1.3.99;
PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@ -679,7 +676,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 1.3.1; MARKETING_VERSION = 1.3.99;
PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";

@ -40,7 +40,7 @@
</Testables> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Debug" buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0" launchStyle = "0"

@ -138,7 +138,11 @@ class BaseAppClient {
if (parsed['IsAuthenticated'] != null && !parsed['IsAuthenticated']) { if (parsed['IsAuthenticated'] != null && !parsed['IsAuthenticated']) {
if (body['OTP_SendType'] != null) { if (body['OTP_SendType'] != null) {
if(parsed['ErrorCode'] =='699'){
onSuccess(parsed, statusCode);
}else {
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);
}
} else if (!isAllowAny) { } else if (!isAllowAny) {
await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, listen: false).logout(); await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, listen: false).logout();

@ -9,9 +9,9 @@ const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/';
// const BASE_URL_LIVE_CARE = 'https://livecareuat.hmg.com/'; // const BASE_URL_LIVE_CARE = 'https://livecareuat.hmg.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
//const BASE_URL = 'https://webservices.hmg.com/'; const BASE_URL = 'https://webservices.hmg.com/';
// const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL // const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL
@ -144,6 +144,7 @@ const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcompl
const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam';
const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote';
const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment';
const IS_PRESCRIPTION_ORDER_CREATED = 'Services/DoctorApplication.svc/REST/IsPresecriptionOrderCreated';
const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies';
const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory';
@ -189,7 +190,8 @@ const GET_MY_REFERRAL_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GtMyRef
const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient";
const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; // const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus";
const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus_Async";
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
@ -202,6 +204,8 @@ const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptio
const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient";
const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient";
const IS_PRINCIPAL_COVERED = "Services/DoctorApplication.svc/REST/IsPrincipalDiagnosisCovered";
const GET_ICD10DISEASE = "Services/DoctorApplication.svc/REST/GetICD10DiseaseForItemId";
const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave";
const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient";
@ -277,6 +281,10 @@ const DOCTOR_ER_SIGN_ASSESSMENT = "Services/DoctorApplication.svc/REST/DoctorApp
const DOCTOR_SCHEDULE = "api/ScheduledSchedule/GetallSchedulebyUser"; const DOCTOR_SCHEDULE = "api/ScheduledSchedule/GetallSchedulebyUser";
const DOCTOR_RADIOLOGY_CRITICAL_FINDINGS = "Services/DoctorApplication.svc/REST/FetchRadCriticalFinding";
const ACKNOWLEDGE_RADIOLOGY_CRITICAL_FINDINGS = "Services/DoctorApplication.svc/REST/Acknowledgeradcriticalfindings";
var selectedPatientType = 1; var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************ //*********change value to decode json from Dropdown ************
@ -309,7 +317,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z'; const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9'; const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 8.7; const VERSION_ID = 8.9;
const CHANNEL = 9; const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt'; const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true; const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -669,6 +669,11 @@ const Map<String, Map<String, String>> localizedValues = {
"en": "Add Assessment Details", "en": "Add Assessment Details",
"ar": "أضف تفاصيل التقييم" "ar": "أضف تفاصيل التقييم"
}, },
"updateAssessmentDetails": {
"en": "Update Assessment Details",
"ar":"تحديث تفاصيل التقييم"
},
"progressNoteSOAP": {"en": "Progress Note", "ar": "ملاحظة التقدم"}, "progressNoteSOAP": {"en": "Progress Note", "ar": "ملاحظة التقدم"},
"addProgressNote": {"en": "Add Progress Note", "ar": "أضف ملاحظة التقدم"}, "addProgressNote": {"en": "Add Progress Note", "ar": "أضف ملاحظة التقدم"},
"createdBy": {"en": "Created By :", "ar": "أضيفت عن طريق: "}, "createdBy": {"en": "Created By :", "ar": "أضيفت عن طريق: "},
@ -1149,6 +1154,13 @@ const Map<String, Map<String, String>> localizedValues = {
"doctorSchedule": {"en": "Doctor Schedule", "ar":"جدول الطبيب"}, "doctorSchedule": {"en": "Doctor Schedule", "ar":"جدول الطبيب"},
"doctorRota": {"en": "Doctor Rota", "ar":"دوران الطبيب"}, "doctorRota": {"en": "Doctor Rota", "ar":"دوران الطبيب"},
"dateFrom": {"en": "Date From", "ar":"التاريخ من"}, "dateFrom": {"en": "Date From", "ar":"التاريخ من"},
"searchFindSchedule": {"en": "Search and find out the doctors schedule ", "ar":"بحث ومعرفة جدول الطبيب"} "searchFindSchedule": {"en": "Search and find out the doctors schedule ", "ar":"بحث ومعرفة جدول الطبيب"},
"onePrimaryDiagnosis": {"en": "There has to be at-least 1 principal diagnosis", "ar":"يجب أن يكون هناك تشخيص رئيسي واحد على الأقل"},
"principalDiagnosisCannot": {"en": "Principal Diagnosis cannot modify once the order created", "ar":"لا يمكن تعديل التشخيص الرئيسي بمجرد إنشاء الطلب"},
"afterOrderCreation": {"en": "After order created, you cannot modify the principal diagnosis, Do you want to continue?", "ar":"بعد إنشاء الطلب، لا يمكنك تعديل التشخيص الأساسي، هل تريد المتابعة؟"},
"principalCoveredOrNot": {"en": "Principal Diagnosis is not covered for this patient", "ar":"لا يتم تغطية التشخيص الرئيسي لهذا المريض"},
"complexDiagnosis": {"en": "Complex Diagnosis", "ar":"التشخيص المعقد"},
}; };

@ -1,7 +1,49 @@
class PatchAssessmentReqModel { class PostAssessmentRequestUpdateModel {
int? patientMRN; int? patientMRN;
int? appointmentNo; int? appointmentNo;
int? episodeID; int? episodeId;
String? createdByName;
int? createdBy;
List<IcdCodeDetailsUpdate?>? icdCodeDetails;
PostAssessmentRequestUpdateModel(
{this.patientMRN,
this.appointmentNo,
this.episodeId,
this.createdByName,
this.createdBy,
this.icdCodeDetails});
PostAssessmentRequestUpdateModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeID'];
createdByName = json['CreatedByName'];
createdBy= json['CreatedBy'];
if (json['icdCodeDetails'] != null) {
icdCodeDetails = [];
json['icdCodeDetails'].forEach((v) {
icdCodeDetails!.add(new IcdCodeDetailsUpdate.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeID'] = this.episodeId;
data['CreatedByName'] = this.createdByName;
data['CreatedBy'] = this.createdBy;
if (this.icdCodeDetails != null) {
data['icdCodeDetails'] =
this.icdCodeDetails!.map((v) => v?.toJson()).toList();
}
return data;
}
}
class IcdCodeDetailsUpdate {
String? icdcode10Id; String? icdcode10Id;
String? prevIcdCode10ID; String? prevIcdCode10ID;
int? conditionId; int? conditionId;
@ -9,40 +51,35 @@ class PatchAssessmentReqModel {
bool? complexDiagnosis; bool? complexDiagnosis;
String? remarks; String? remarks;
PatchAssessmentReqModel( IcdCodeDetailsUpdate(
{this.patientMRN, {this.icdcode10Id,
this.appointmentNo,
this.episodeID,
this.icdcode10Id,
this.prevIcdCode10ID,
this.conditionId, this.conditionId,
this.prevIcdCode10ID,
this.diagnosisTypeId, this.diagnosisTypeId,
this.complexDiagnosis, this.complexDiagnosis,
this.remarks}); this.remarks});
PatchAssessmentReqModel.fromJson(Map<String, dynamic> json) { IcdCodeDetailsUpdate.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN']; icdcode10Id = json['icdcode10Id'];
appointmentNo = json['AppointmentNo']; conditionId = json['conditionId'];
episodeID = json['EpisodeID']; prevIcdCode10ID = json['prevIcdCode10ID'];
icdcode10Id = json['Icdcode10Id']; diagnosisTypeId = json['diagnosisTypeId'];
prevIcdCode10ID = json['PrevIcdCode10ID']; complexDiagnosis = json['complexDiagnosis'];
conditionId = json['ConditionId']; remarks = json['remarks'];
diagnosisTypeId = json['DiagnosisTypeId'];
complexDiagnosis = json['ComplexDiagnosis'];
remarks = json['Remarks'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN; data['icdcode10Id'] = this.icdcode10Id;
data['AppointmentNo'] = this.appointmentNo; data['conditionId'] = this.conditionId;
data['EpisodeID'] = this.episodeID; data['prevIcdCode10ID'] = this.prevIcdCode10ID;
data['Icdcode10Id'] = this.icdcode10Id; data['diagnosisTypeId'] = this.diagnosisTypeId;
data['PrevIcdCode10ID'] = this.prevIcdCode10ID; data['complexDiagnosis'] = this.complexDiagnosis;
data['ConditionId'] = this.conditionId; data['remarks'] = this.remarks;
data['DiagnosisTypeId'] = this.diagnosisTypeId;
data['ComplexDiagnosis'] = this.complexDiagnosis;
data['Remarks'] = this.remarks;
return data; return data;
} }
} }

@ -2,6 +2,8 @@ class MasterKeyModel {
String? alias; String? alias;
String? aliasN; String? aliasN;
dynamic code; dynamic code;
dynamic codeId;
dynamic asciiDesc;
dynamic description; dynamic description;
dynamic detail1; dynamic detail1;
dynamic detail2; dynamic detail2;
@ -20,6 +22,8 @@ class MasterKeyModel {
{this.alias, {this.alias,
this.aliasN, this.aliasN,
this.code, this.code,
this.codeId,
this.asciiDesc,
this.description, this.description,
this.detail1, this.detail1,
this.detail2, this.detail2,
@ -39,6 +43,8 @@ class MasterKeyModel {
aliasN = json['aliasN']; aliasN = json['aliasN'];
code = json['code']; code = json['code'];
description = json['description']; description = json['description'];
codeId = json['codeId'];
asciiDesc = json['asciiDesc'];
detail1 = json['detail1']; detail1 = json['detail1'];
detail2 = json['detail2']; detail2 = json['detail2'];
detail3 = json['detail3']; detail3 = json['detail3'];
@ -59,6 +65,8 @@ class MasterKeyModel {
data['aliasN'] = this.aliasN; data['aliasN'] = this.aliasN;
data['code'] = this.code; data['code'] = this.code;
data['description'] = this.description; data['description'] = this.description;
data['codeId'] = this.codeId;
data['asciiDesc'] = this.asciiDesc;
data['detail1'] = this.detail1; data['detail1'] = this.detail1;
data['detail2'] = this.detail2; data['detail2'] = this.detail2;
data['detail3'] = this.detail3; data['detail3'] = this.detail3;

@ -0,0 +1,60 @@
class RadiologyCriticalFindingModel {
String? clinicName;
String? doctorName;
String? imageURL;
int? invoiceLineItemNo;
int? invoiceNo;
String? notificationMesssage;
int? patientId;
String? patientName;
String? procedureName;
String? reportData;
String? reportOn;
String? resultFindings;
RadiologyCriticalFindingModel(
{this.clinicName,
this.doctorName,
this.imageURL,
this.invoiceLineItemNo,
this.invoiceNo,
this.notificationMesssage,
this.patientId,
this.patientName,
this.procedureName,
this.reportData,
this.reportOn,
this.resultFindings});
RadiologyCriticalFindingModel.fromJson(Map<String, dynamic> json) {
clinicName = json['clinicName'];
doctorName = json['doctorName'];
imageURL = json['imageURL'];
invoiceLineItemNo = json['invoiceLineItemNo'];
invoiceNo = json['invoiceNo'];
notificationMesssage = json['notificationMesssage'];
patientId = json['patientId'];
patientName = json['patientName'];
procedureName = json['procedureName'];
reportData = json['reportData'];
reportOn = json['reportOn'];
resultFindings = json['resultFindings'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['clinicName'] = this.clinicName;
data['doctorName'] = this.doctorName;
data['imageURL'] = this.imageURL;
data['invoiceLineItemNo'] = this.invoiceLineItemNo;
data['invoiceNo'] = this.invoiceNo;
data['notificationMesssage'] = this.notificationMesssage;
data['patientId'] = this.patientId;
data['patientName'] = this.patientName;
data['procedureName'] = this.procedureName;
data['reportData'] = this.reportData;
data['reportOn'] = this.reportOn;
data['resultFindings'] = this.resultFindings;
return data;
}
}

@ -17,7 +17,8 @@ class AuthenticationService extends BaseService {
List<GetIMEIDetailsModel> get dashboardItemsList => _imeiDetails; List<GetIMEIDetailsModel> get dashboardItemsList => _imeiDetails;
NewLoginInformationModel _loginInfo = NewLoginInformationModel(); NewLoginInformationModel _loginInfo = NewLoginInformationModel();
String _errorCode ='';
String get errorCode => _errorCode;
NewLoginInformationModel get loginInfo => _loginInfo; NewLoginInformationModel get loginInfo => _loginInfo;
SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel(); SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel();
@ -105,12 +106,22 @@ class AuthenticationService extends BaseService {
_checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel();
try { try {
await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) {
_checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); if(response['ErrorCode'] =='699'){
_errorCode = response['ErrorCode'];
hasError = true;
super.error = response['ErrorEndUserMessage'];
}else {
_errorCode ='';
_checkActivationCodeForDoctorAppRes =
CheckActivationCodeForDoctorAppResponseModel.fromJson(response);
}
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
_errorCode ='';
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: checkActivationCodeRequestModel.toJson()); }, body: checkActivationCodeRequestModel.toJson());
} catch (error) { } catch (error) {
_errorCode ='';
hasError = true; hasError = true;
super.error = error.toString(); super.error = error.toString();
} }

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/dashboard/radiology_critical_finding_model.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/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart';
@ -7,8 +8,12 @@ import '../../model/dashboard/doctor_schedule.dart';
class DashboardService extends BaseService { class DashboardService extends BaseService {
List<DashboardModel> _dashboardItemsList = []; List<DashboardModel> _dashboardItemsList = [];
RadiologyCriticalFindingModel? _radiologyCriticalFindingModel;
List<DashboardModel> get dashboardItemsList => _dashboardItemsList; List<DashboardModel> get dashboardItemsList => _dashboardItemsList;
RadiologyCriticalFindingModel? get radiologyCriticalFindingModel => _radiologyCriticalFindingModel;
bool hasVirtualClinic = false; bool hasVirtualClinic = false;
String? sServiceID; String? sServiceID;
@ -48,4 +53,46 @@ class DashboardService extends BaseService {
}, },
); );
} }
Future acknowledgeDoctorHasRadiologyFindings(String invoiceNo, String invoiceLineItemNo) async {
hasError = false;
await getDoctorProfile(isGetProfile: true);
await baseAppClient.post(
ACKNOWLEDGE_RADIOLOGY_CRITICAL_FINDINGS,
onSuccess: (dynamic response, int statusCode) {
// _radiologyCriticalFindingModel = RadiologyCriticalFindingModel.fromJson(response["RadiologyVMEntityListInfoResponse"]["entityList"][0]);
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
"DoctorID": doctorProfile?.doctorID, // test user 9920
"LoginDoctorID": doctorProfile?.doctorID,
"invoiceNo": invoiceNo,
"invoiceLineItemNo": invoiceLineItemNo,
},
);
}
Future checkDoctorHasRadiologyFindings() async {
hasError = false;
await getDoctorProfile(isGetProfile: true);
await baseAppClient.post(
DOCTOR_RADIOLOGY_CRITICAL_FINDINGS,
onSuccess: (dynamic response, int statusCode) {
if(response["RadiologyVMEntityListInfoResponse"]["entityList"].length != 0) {
_radiologyCriticalFindingModel = RadiologyCriticalFindingModel.fromJson(response["RadiologyVMEntityListInfoResponse"]["entityList"][0]);
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
"DoctorID": doctorProfile?.doctorID, // test user 9920
"LoginDoctorID": doctorProfile?.doctorID
},
);
}
} }

@ -16,6 +16,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart';
@ -49,6 +50,8 @@ class PrescriptionService extends LookupService {
List<dynamic> itemMedicineList = []; List<dynamic> itemMedicineList = [];
List<dynamic> itemMedicineListRoute = []; List<dynamic> itemMedicineListRoute = [];
List<dynamic> itemMedicineListUnit = []; List<dynamic> itemMedicineListUnit = [];
List<MasterKeyModel> icd10CodeListByItem =[];
bool isDiagnosisCovered =true;
dynamic boxQuantity; dynamic boxQuantity;
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel();
@ -373,4 +376,41 @@ class PrescriptionService extends LookupService {
super.error = error; super.error = error;
}, body: _getMedicationForInPatientRequestModel.toJson()); }, body: _getMedicationForInPatientRequestModel.toJson());
} }
Future isPrincipalCovered(PatiantInformtion patient) async {
hasError = false;
await baseAppClient.post(IS_PRINCIPAL_COVERED,
body:{
"PatientID":patient.patientId,
"EncounterNo":patient.appointmentNo ?? 0,
"EncounterType":patient.appointmentTypeId ?? 0,
"DoctorID":patient.doctorId,
}, onSuccess: (dynamic response, int statusCode) {
isDiagnosisCovered = response['IsDiagnosisCovered'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
}
Future getIcd10DISESECode(PatiantInformtion patient, int itemID) async {
hasError = false;
await baseAppClient.post(GET_ICD10DISEASE,
body:{
"PatientMRN":patient.patientId,
"ItemID":itemID,
"DoctorID":patient.doctorId,
}, onSuccess: (dynamic response, int statusCode) {
icd10CodeListByItem.clear();
Map<String, dynamic> data = response['List_ICD10Desease'];
data['entityList'].forEach((v) {
icd10CodeListByItem.add(MasterKeyModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
}
} }

@ -3,7 +3,6 @@ import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_mod
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart'; import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_res_model.dart';
@ -22,6 +21,8 @@ import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressN
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart';
import '../../../model/SOAP/assessment/patch_assessment_req_model.dart';
import '../../../model/patient/patiant_info_model.dart';
import '../../base/lookup-service.dart'; import '../../base/lookup-service.dart';
class SOAPService extends LookupService { class SOAPService extends LookupService {
@ -33,7 +34,7 @@ class SOAPService extends LookupService {
List<GetAssessmentResModel> patientAssessmentList = []; List<GetAssessmentResModel> patientAssessmentList = [];
int? episodeID; int? episodeID;
bool isPrescriptionOrder =false;
Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async { Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async {
hasError = false; hasError = false;
@ -196,9 +197,9 @@ class SOAPService extends LookupService {
} }
Future patchAssessment( Future patchAssessment(
PatchAssessmentReqModel patchAssessmentRequestModel) async { PostAssessmentRequestUpdateModel patchAssessmentRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(PATCH_ASSESSMENT, await baseAppClient.post(POST_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -317,4 +318,22 @@ class SOAPService extends LookupService {
super.error = error; super.error = error;
}, body: getEpisodeForInpatientReqModel.toJson()); }, body: getEpisodeForInpatientReqModel.toJson());
} }
Future isPrescriptionOrderCreated(
PatiantInformtion patientInfo) async {
hasError = false;
await baseAppClient.post(IS_PRESCRIPTION_ORDER_CREATED,
onSuccess: (dynamic response, int statusCode) {
print("Success");
isPrescriptionOrder = response['IsPrescriptionCreated'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {
"PatientMRN":patientInfo.patientMRN,
"EncounterNo":patientInfo.appointmentNo,
"EncounterType":patientInfo.appointmentTypeId,
"DoctorID":patientInfo.doctorId,
});
}
} }

@ -4,7 +4,6 @@ import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_mod
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Allergy/post_allergy_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_res_model.dart';
@ -23,19 +22,20 @@ import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.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/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/soap/SOAP_service.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessment_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/assessment/assessment_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/objective/objective_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/subjective/subjective_call_back.dart';
import '../../locator.dart'; import '../../locator.dart';
import '../model/SOAP/assessment/patch_assessment_req_model.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
class SOAPViewModel extends BaseViewModel { class SOAPViewModel extends BaseViewModel {
@ -78,8 +78,8 @@ class SOAPViewModel extends BaseViewModel {
List<GetAssessmentResModel> get patientAssessmentList => _SOAPService.patientAssessmentList; List<GetAssessmentResModel> get patientAssessmentList => _SOAPService.patientAssessmentList;
int get episodeID => _SOAPService.episodeID!; int? get episodeID => _SOAPService.episodeID;
bool get isPrescriptionOrder => _SOAPService.isPrescriptionOrder;
bool isAddProgress = true; bool isAddProgress = true;
bool isAddExamInProgress = true; bool isAddExamInProgress = true;
String progressNoteText = ""; String progressNoteText = "";
@ -220,9 +220,9 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async { Future patchAssessment(PostAssessmentRequestUpdateModel patchAssessmentRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.patchAssessment(patchAssessmentRequestModel); await _SOAPService.patchAssessment(patchAssessmentRequestModel!);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -622,6 +622,18 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future isPrescriptionOrderCreated(PatiantInformtion patientInfo) async{
setState(ViewState.BusyLocal);
await _SOAPService.isPrescriptionOrderCreated(patientInfo);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
postSubjectServices({patientInfo, String? complaintsText, String? medicationText, String? illnessText, List<MySelectedHistory>? myHistoryList, List<MySelectedAllergy>? myAllergiesList}) async { postSubjectServices({patientInfo, String? complaintsText, String? medicationText, String? illnessText, List<MySelectedHistory>? myHistoryList, List<MySelectedAllergy>? myAllergiesList}) async {
List services = []; List services = [];

@ -37,6 +37,7 @@ enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED }
class AuthenticationViewModel extends BaseViewModel { class AuthenticationViewModel extends BaseViewModel {
AuthenticationService _authService = locator<AuthenticationService>(); AuthenticationService _authService = locator<AuthenticationService>();
HospitalsService _hospitalsService = locator<HospitalsService>(); HospitalsService _hospitalsService = locator<HospitalsService>();
get errorCode => _authService.errorCode;
List<GetIMEIDetailsModel> get imeiDetails => _authService.dashboardItemsList; List<GetIMEIDetailsModel> get imeiDetails => _authService.dashboardItemsList;
@ -198,6 +199,7 @@ class AuthenticationViewModel extends BaseViewModel {
error = _authService.error; error = _authService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await setDataAfterSendActivationSuccess(checkActivationCodeForDoctorAppRes); await setDataAfterSendActivationSuccess(checkActivationCodeForDoctorAppRes);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
@ -333,13 +335,19 @@ class AuthenticationViewModel extends BaseViewModel {
getDeviceInfoFromFirebase() async { getDeviceInfoFromFirebase() async {
// await checkIsHuawei(); // await checkIsHuawei();
var token; var token;
var APNSToken;
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
if (Platform.isIOS) { if (Platform.isIOS) {
_firebaseMessaging.requestPermission(); _firebaseMessaging.requestPermission();
} }
setState(ViewState.Busy); setState(ViewState.Busy);
try { try {
if (Platform.isIOS) {
APNSToken = await _firebaseMessaging.getAPNSToken();
print("APNS TOKEN: $APNSToken");
}
token = await _firebaseMessaging.getToken(); token = await _firebaseMessaging.getToken();
print("Device TOKEN: $token");
} catch (ex) { } catch (ex) {
print(ex); print(ex);
} }

@ -1,7 +1,5 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/core/model/dashboard/radiology_critical_finding_model.dart';
import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart';
import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart';
@ -9,6 +7,9 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import '../../locator.dart'; import '../../locator.dart';
import '../model/dashboard/dashboard_model.dart';
import '../model/dashboard/get_special_clinical_care_List_Respose_Model.dart';
import '../model/doctor/clinic_model.dart';
import 'authentication_view_model.dart'; import 'authentication_view_model.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
@ -20,6 +21,8 @@ class DashboardViewModel extends BaseViewModel {
List<DashboardModel> get dashboardItemsList => _dashboardService.dashboardItemsList; List<DashboardModel> get dashboardItemsList => _dashboardService.dashboardItemsList;
RadiologyCriticalFindingModel? get radiologyCriticalFindingModel => _dashboardService.radiologyCriticalFindingModel;
bool get hasVirtualClinic => _dashboardService.hasVirtualClinic; bool get hasVirtualClinic => _dashboardService.hasVirtualClinic;
String? get sServiceID => _dashboardService.sServiceID; String? get sServiceID => _dashboardService.sServiceID;
@ -37,6 +40,7 @@ class DashboardViewModel extends BaseViewModel {
_dashboardService.getDashboard(), _dashboardService.getDashboard(),
_dashboardService.checkDoctorHasLiveCare(), _dashboardService.checkDoctorHasLiveCare(),
_specialClinicsService.getSpecialClinicalCareList(), _specialClinicsService.getSpecialClinicalCareList(),
_dashboardService.checkDoctorHasRadiologyFindings()
]); ]);
if (_dashboardService.hasError) { if (_dashboardService.hasError) {
@ -70,6 +74,10 @@ class DashboardViewModel extends BaseViewModel {
await _dashboardService.checkDoctorHasLiveCare(); await _dashboardService.checkDoctorHasLiveCare();
} }
Future acknowledgeRadiologyCriticalFinding(String invoiceNo, String invoiceLineItemNo) async {
await _dashboardService.acknowledgeDoctorHasRadiologyFindings(invoiceNo, invoiceLineItemNo);
}
Future getSpecialClinicalCareList() async { Future getSpecialClinicalCareList() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _specialClinicsService.getSpecialClinicalCareList(); await _specialClinicsService.getSpecialClinicalCareList();
@ -80,7 +88,7 @@ class DashboardViewModel extends BaseViewModel {
// setState(ViewState.Idle); // setState(ViewState.Idle);
} }
Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async { Future changeClinic(dynamic clinicId, AuthenticationViewModel authProvider) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await getDoctorProfile(); await getDoctorProfile();
ClinicModel clinicModel = ClinicModel( ClinicModel clinicModel = ClinicModel(

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.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/model/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
@ -42,10 +43,12 @@ class PrescriptionViewModel extends BaseViewModel {
List<Prescriptions> get prescriptionsList => _prescriptionService.prescriptionsList; List<Prescriptions> get prescriptionsList => _prescriptionService.prescriptionsList;
Future getItem({required int itemID}) async { List<MasterKeyModel> get icd10DeseaseItems =>_prescriptionService.icd10CodeListByItem;
bool get isPrincipalCovered_ => _prescriptionService.isDiagnosisCovered;
Future getItem({int? itemID}) async {
hasError = false; hasError = false;
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _prescriptionService.getItem(itemID: itemID); await _prescriptionService.getItem(itemID: itemID!);
if (_prescriptionService.hasError) { if (_prescriptionService.hasError) {
error = _prescriptionService.error!; error = _prescriptionService.error!;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -173,4 +176,29 @@ class PrescriptionViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future isPrincipalCovered(
{
required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionService.isPrincipalCovered(patient);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future getIcd10DISESECode(
{
required PatiantInformtion patient, int? itemID}) async {
setState(ViewState.Busy);
await _prescriptionService.getIcd10DISESECode(patient, itemID!);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
} }

@ -29,11 +29,14 @@ import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import '../service/patient_medical_file/prescription/prescription_service.dart';
class ProcedureViewModel extends BaseViewModel { class ProcedureViewModel extends BaseViewModel {
//TODO Hussam clean it //TODO Hussam clean it
FilterType filterType = FilterType.Clinic; FilterType filterType = FilterType.Clinic;
bool hasError = false; bool hasError = false;
ProcedureService _procedureService = locator<ProcedureService>(); ProcedureService _procedureService = locator<ProcedureService>();
PrescriptionService _prescriptionService = locator<PrescriptionService>();
List<GetOrderedProcedureModel> get procedureList => _procedureService.procedureList; List<GetOrderedProcedureModel> get procedureList => _procedureService.procedureList;
@ -64,7 +67,9 @@ class ProcedureViewModel extends BaseViewModel {
bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus; bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus;
Future getProcedure({required int mrn, String? patientType, int? appointmentNo, bool isLocalBusy = false}) async { bool get isPrincipalCovered_ => _prescriptionService.isDiagnosisCovered;
Future getProcedure({int? mrn, String? patientType, int? appointmentNo, bool isLocalBusy = false}) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
if (isLocalBusy) if (isLocalBusy)
@ -457,4 +462,15 @@ class ProcedureViewModel extends BaseViewModel {
items.addAll(masterList); items.addAll(masterList);
} }
} }
Future isPrincipalCovered({required PatiantInformtion patient}) async {
// setState(ViewState.Busy);
await _prescriptionService.isPrincipalCovered(patient);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else {
// setState(ViewState.Idle);
}
}
} }

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/auth_method_types.dart'; import 'package:doctor_app_flutter/core/enum/auth_method_types.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/service/authentication_service.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
@ -464,6 +465,12 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context); Navigator.pop(context);
Utils.showErrorToast(authenticationViewModel.error); Utils.showErrorToast(authenticationViewModel.error);
if (authenticationViewModel.errorCode == '699') {
Navigator.pop(context);
authenticationViewModel.deleteUser();
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
}
} else { } else {
await authenticationViewModel.onCheckActivationCodeSuccess(); await authenticationViewModel.onCheckActivationCodeSuccess();
if (value != null) { if (value != null) {

@ -15,6 +15,7 @@ import '../../widgets/shared/app_scaffold_widget.dart';
import '../../widgets/shared/errors/error_message.dart'; import '../../widgets/shared/errors/error_message.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
class DoctorSchedulePage extends StatefulWidget { class DoctorSchedulePage extends StatefulWidget {
@override @override
_DoctorSchedulePageState createState() => _DoctorSchedulePageState(); _DoctorSchedulePageState createState() => _DoctorSchedulePageState();
@ -26,21 +27,16 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
double currentPage = 0; double currentPage = 0;
int selectedindex = 0; int selectedindex = 0;
List weeks = []; List weeks = [];
// List<DoctorScheduleResponse> doctorScheduleResponse = [];
int weekMS = 604800 * 1000; int weekMS = 604800 * 1000;
// DoctorList? doctorList;
List<String> freeSlots = []; List<String> freeSlots = [];
bool isPageChange = false; bool isPageChange = false;
String fromDate = DateFormat('yyyy-MM-dd').format(DateTime.now()); String fromDate = DateFormat('yyyy-MM-dd').format(DateTime.now());
String toDate = DateFormat('yyyy-MM-dd').format(DateTime.now().add(Duration(days: 30))); String toDate =
DateFormat('yyyy-MM-dd').format(DateTime.now().add(Duration(days: 30)));
// AppSharedPreferences sharedPref = AppSharedPreferences(); int pageNo=1;
@override @override
void initState() { void initState() {
// this.doctorList = widget.doctorList;
super.initState(); super.initState();
} }
@ -87,25 +83,37 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
children: [ children: [
IconButton( IconButton(
onPressed: () { onPressed: () {
model.getDoctorRota(
fromDate, if(pageNo >1) {
toDate, pageNo--;
); model.getDoctorRota(fromDate, toDate,
pageNo: pageNo);
}
}, },
icon: SvgPicture.asset('assets/images/svgs/prev.svg', height: 25, width: 10)), icon: SvgPicture.asset(
IconButton(onPressed: () {}, icon: SvgPicture.asset('assets/images/svgs/next.svg', height: 25, width: 10)) 'assets/images/svgs/prev.svg',
height: 25,
width: 10)),
IconButton(
onPressed: () {
pageNo++;
model.getDoctorRota(fromDate, toDate, pageNo: pageNo);
},
icon: SvgPicture.asset(
'assets/images/svgs/next.svg',
height: 25,
width: 10))
], ],
), ),
], ],
)), )),
], ],
), ),
model.getDoctorRotation.length == 0 model.getDoctorRotation.length ==0 ? Center(
? Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable, error: TranslationBase.of(context).noDataAvailable,
)) )) :
: Container( Container(
margin: EdgeInsets.only(top: 45), margin: EdgeInsets.only(top: 45),
child: PageView.builder( child: PageView.builder(
controller: _pageController, controller: _pageController,
@ -117,9 +125,14 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
}); });
}, },
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return model.getDoctorRotation[index]
.scheduleforuser!.length ==0 ? Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,
)) : Container(
child: ListView.builder( child: ListView.builder(
itemCount: model.getDoctorRotation[index].scheduleforuser!.length, itemCount: model.getDoctorRotation[index]
.scheduleforuser!.length,
itemBuilder: (context, index2) => InkWell( itemBuilder: (context, index2) => InkWell(
onTap: () { onTap: () {
// final weekDay = weeks[index][index2]['DayName']; // final weekDay = weeks[index][index2]['DayName'];
@ -129,11 +142,22 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Padding( child: Padding(
padding: projectViewModel.isArabic ? EdgeInsets.only(right: 17) : EdgeInsets.only(left: 17), padding:
projectViewModel.isArabic
? EdgeInsets.only(
right: 17)
: EdgeInsets.only(
left: 17),
child: Row(children: [ child: Row(children: [
Column( Column(
children: [ children: [
Text(DateFormat('EEEE').format(model.getDoctorRotation[index].scheduleforuser![index2].days!) Text(DateFormat('EEEE')
.format(model
.getDoctorRotation[
index]
.scheduleforuser![
index2]
.days!)
// fontSize: 13, // fontSize: 13,
// fontWeight: projectViewModel.isArabic ? FontWeight.w600 : FontWeight.w500, // fontWeight: projectViewModel.isArabic ? FontWeight.w600 : FontWeight.w500,
@ -188,9 +212,18 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
), ),
Container( Container(
height: 45, height: 45,
child: ListView.builder( child: ListView
itemCount: model.getDoctorRotation[index].scheduleforuser![index2]!.shiftforuser!.length, .builder(
itemBuilder: (context, index3) => Row(children: [ itemCount: model
.getDoctorRotation[
index]
.scheduleforuser![
index2]
.shiftforuser
!.length,
itemBuilder: (context,
index3) =>
Row(children: [
Text(model.getDoctorRotation[index].scheduleforuser![index2].shiftforuser![index3].fromtimetext.toString()), Text(model.getDoctorRotation[index].scheduleforuser![index2].shiftforuser![index3].fromtimetext.toString()),
Text(" "+TranslationBase.of(context).to +" "), Text(" "+TranslationBase.of(context).to +" "),
Text(model.getDoctorRotation[index].scheduleforuser![index2].shiftforuser![index3].totimetext.toString()) Text(model.getDoctorRotation[index].scheduleforuser![index2].shiftforuser![index3].totimetext.toString())
@ -218,8 +251,10 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return StatefulBuilder(builder: (context, setState) { return StatefulBuilder(
return AlertDialog( builder:(context, setState) {
return
AlertDialog(
title: Column( title: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -251,11 +286,19 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
); );
}, },
child: Container( child: Container(
padding: EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5), padding:
EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5),
width: double.infinity, width: double.infinity,
height: 55, height: 55,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), color: Colors.white, boxShadow: [BoxShadow(blurRadius: .26, spreadRadius: 1 * 1.5, color: Colors.black.withOpacity(.05))]), borderRadius: BorderRadius.circular(12),
color: Colors.white,
boxShadow: [
BoxShadow(
blurRadius: .26,
spreadRadius: 1 * 1.5,
color: Colors.black.withOpacity(.05))
]),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -263,12 +306,15 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
TranslationBase.of(context).dateFrom, TranslationBase.of(context).dateFrom,
style: TextStyle(fontSize: 12), style: TextStyle(fontSize: 12),
), ),
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [Text(fromDate), Icon(Icons.calendar_month_outlined)]) Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(fromDate, style: TextStyle(fontSize: 14),),
Icon(Icons.calendar_month_outlined)
])
], ],
))), ))),
SizedBox( SizedBox(height: 20,),
height: 20,
),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showDatePicker( DatePicker.showDatePicker(
@ -284,11 +330,19 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
); );
}, },
child: Container( child: Container(
padding: EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5), padding:
EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5),
width: double.infinity, width: double.infinity,
height: 55, height: 56,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), color: Colors.white, boxShadow: [BoxShadow(blurRadius: .26, spreadRadius: 1 * 1.5, color: Colors.black.withOpacity(.05))]), borderRadius: BorderRadius.circular(12),
color: Colors.white,
boxShadow: [
BoxShadow(
blurRadius: .26,
spreadRadius: 1 * 1.5,
color: Colors.black.withOpacity(.05))
]),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -296,7 +350,12 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
TranslationBase.of(context).toDate, TranslationBase.of(context).toDate,
style: TextStyle(fontSize: 12), style: TextStyle(fontSize: 12),
), ),
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [Text(toDate), Icon(Icons.calendar_month_outlined)]) Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(toDate, style: TextStyle(fontSize: 14),),
Icon(Icons.calendar_month_outlined)
])
], ],
))) )))
]), ]),
@ -314,7 +373,9 @@ class _DoctorSchedulePageState extends State<DoctorSchedulePage> {
], ],
); );
; ;
}); }
);
}, },
); );
} }

@ -68,7 +68,14 @@ class _HomeScreenState extends State<HomeScreen> {
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.startHomeScreenServices(projectsProvider, authenticationViewModel); model.startHomeScreenServices(projectsProvider, authenticationViewModel).then((value) {
if (model.radiologyCriticalFindingModel != null) {
print("onModelReady radiologyCriticalFindingModel!!!");
showRadiologyFindingDialog(model);
} else {
print("onModelReady radiologyCriticalFindingModel EMPTYYYY!!!");
}
});
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
@ -142,7 +149,7 @@ class _HomeScreenState extends State<HomeScreen> {
)), )),
], ],
), ),
AppText(Utils.convertToTitleCase(item.clinicName!), AppText(Utils.convertToTitleCase(item.clinicName),
fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, textAlign: TextAlign.end), fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, textAlign: TextAlign.end),
], ],
); );
@ -151,7 +158,7 @@ class _HomeScreenState extends State<HomeScreen> {
onChanged: (newValue) async { onChanged: (newValue) async {
clinicId = newValue; clinicId = newValue;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.changeClinic(int.parse(newValue.toString()), authenticationViewModel); await model.changeClinic(newValue, authenticationViewModel);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
@ -160,7 +167,7 @@ class _HomeScreenState extends State<HomeScreen> {
items: projectsProvider.doctorClinicsList.map((item) { items: projectsProvider.doctorClinicsList.map((item) {
return DropdownMenuItem( return DropdownMenuItem(
child: AppText( child: AppText(
Utils.convertToTitleCase(item.clinicName!), Utils.convertToTitleCase(item.clinicName),
fontSize: 14, fontSize: 14,
letterSpacing: -0.96, letterSpacing: -0.96,
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
@ -270,37 +277,28 @@ class _HomeScreenState extends State<HomeScreen> {
); );
} }
showRadiologyFindingDialog(DashboardViewModel model) {
Utils.showConfirmationDialog(context, model.radiologyCriticalFindingModel!.notificationMesssage!, () async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
await model.acknowledgeRadiologyCriticalFinding(model.radiologyCriticalFindingModel!.invoiceNo.toString(), model.radiologyCriticalFindingModel!.invoiceLineItemNo.toString());
GifLoaderDialogUtils.hideDialog(context);
}, isShowCancelButton: false);
}
List<Widget> homePatientsCardsWidget(DashboardViewModel model, projectsProvider) { List<Widget> homePatientsCardsWidget(DashboardViewModel model, projectsProvider) {
colorIndex = 0; colorIndex = 0;
List<LinearGradient> backgroundColors =[]; List<LinearGradient> backgroundColors =[];
backgroundColors.add( backgroundColors.add(LinearGradient(begin: Alignment(-1.0, -2.0), end: Alignment(1.0, 2.0), colors: [
LinearGradient(
begin: Alignment(-1.0, -2.0),
end: Alignment(1.0, 2.0),
colors: [
AppGlobal.appRedColor, AppGlobal.appRedColor,
Color(0xFFAD3B3B), Color(0xFFAD3B3B),
], ])); //AppGlobal.appRedColor;
), backgroundColors.add(LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [
); //AppGlobal.appRedColor;
backgroundColors.add(
LinearGradient(
begin: Alignment.center,
end: Alignment.center,
colors: [
Color(0xFFC9C9C9), Color(0xFFC9C9C9),
Color(0xFFC9C9C9), Color(0xFFC9C9C9),
], ]));
), backgroundColors.add(LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [Color(0xFF71787E), AppGlobal.appTextColor]));
);
backgroundColors.add(
LinearGradient(
begin: Alignment.center,
end: Alignment.center,
colors: [Color(0xFF71787E), AppGlobal.appTextColor],
),
);
List<Color> backgroundIconColors = []; List<Color> backgroundIconColors = [];
backgroundIconColors.add(Colors.white12); backgroundIconColors.add(Colors.white12);
backgroundIconColors.add( Colors.white38); backgroundIconColors.add( Colors.white38);
@ -313,8 +311,7 @@ class _HomeScreenState extends State<HomeScreen> {
List<HomePatientCard> patientCards = []; List<HomePatientCard> patientCards = [];
if (model.hasVirtualClinic) { if (model.hasVirtualClinic) {
patientCards.add( patientCards.add(HomePatientCard(
HomePatientCard(
gradient: backgroundColors[colorIndex], gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.livecare, cardIcon: DoctorApp.livecare,
@ -346,8 +343,7 @@ class _HomeScreenState extends State<HomeScreen> {
), ),
); );
}, },
), ));
);
changeColorIndex(); changeColorIndex();
} }
@ -418,11 +414,7 @@ class _HomeScreenState extends State<HomeScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => OutPatientsScreen( builder: (context) => OutPatientsScreen(
patientSearchRequestModel: PatientSearchRequestModel( patientSearchRequestModel: PatientSearchRequestModel(from: date, to: date, doctorID: authenticationViewModel.doctorProfile!.doctorID),
from: date,
to: date,
doctorID: authenticationViewModel.doctorProfile!.doctorID,
),
), ),
settings: RouteSettings(name: 'OutPatientsScreen'), settings: RouteSettings(name: 'OutPatientsScreen'),
)); ));

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/In_patient/NoData.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.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:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
@ -47,7 +48,8 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
? (model) => model.getInsuranceApproval(patient, appointmentNo: patient!.appointmentNo, projectId: patient!.projectId) ? (model) => model.getInsuranceApproval(patient, appointmentNo: patient!.appointmentNo, projectId: patient!.projectId)
: (model) => model.getInsuranceApproval(patient) : (model) => model.getInsuranceApproval(patient)
: null, : null,
builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold( builder: (BuildContext context, InsuranceViewModel model, Widget? child) =>
AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
appBar: PatientProfileAppBar(patient!), appBar: PatientProfileAppBar(patient!),
@ -79,25 +81,45 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption != null model
? model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption ?? "" .insuranceApprovalInPatient[
indexInsurance]
.approvalStatusDescption !=
null
? model
.insuranceApprovalInPatient[
indexInsurance]
.approvalStatusDescption ??
""
: "", : "",
color: model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption != null color: model
? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == "Approved" || .insuranceApprovalInPatient[
"${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" == "تمت الموافقة" indexInsurance]
.approvalStatusDescption !=
null
? "${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" ==
"Approved" ||
"${model.insuranceApprovalInPatient[indexInsurance].approvalStatusDescption}" ==
"تمت الموافقة"
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: Color(0xffD02127) : Color(0xffD02127)
: Color(0xffD02127), : Color(0xffD02127),
letterSpacing: -0.4, letterSpacing: -0.4,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
2.7,
), ),
], ],
), ),
Row( Row(
children: [ children: [
AppText( AppText(
model.insuranceApprovalInPatient[indexInsurance].doctorName!.toUpperCase(), model
.insuranceApprovalInPatient[
indexInsurance]
.doctorName!
.toUpperCase(),
color: Color(0xff2E303A), color: Color(0xff2E303A),
fontSize: 16, fontSize: 16,
letterSpacing: -0.64, letterSpacing: -0.64,
@ -106,59 +128,105 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
], ],
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(
horizontal: 8.0),
child: Row( child: Row(
children: [ children: [
Column( Column(
children: [ children: [
Container( Container(
height: MediaQuery.of(context).size.height * 0.065, height: MediaQuery.of(context)
width: MediaQuery.of(context).size.height * 0.065, .size
.height *
0.065,
width: MediaQuery.of(context)
.size
.height *
0.065,
child: CircleAvatar( child: CircleAvatar(
radius: SizeConfig.imageSizeMultiplier! * 12, radius: SizeConfig
.imageSizeMultiplier! *
12,
// radius: (52) // radius: (52)
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(50), borderRadius:
BorderRadius.circular(
50),
child: Image.network( child: Image.network(
model.insuranceApprovalInPatient[indexInsurance].doctorImage!, model
.insuranceApprovalInPatient[
indexInsurance]
.doctorImage!,
fit: BoxFit.fill, fit: BoxFit.fill,
width: 700, width: 700,
), ),
), ),
backgroundColor: Colors.transparent, backgroundColor:
Colors.transparent,
), ),
), ),
], ],
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding:
const EdgeInsets.symmetric(
horizontal: 8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.center, //mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SizedBox( SizedBox(
height: 25.0, height: 25.0,
), ),
CustomRow( CustomRow(
label: TranslationBase.of(context).clinic + ": ", label: TranslationBase.of(
value: model.insuranceApprovalInPatient[indexInsurance].clinicName!, context)
.clinic +
": ",
value: model
.insuranceApprovalInPatient[
indexInsurance]
.clinicName!,
), ),
CustomRow( CustomRow(
label: TranslationBase.of(context).approvalNo + ": ", label: TranslationBase.of(
value: model.insuranceApprovalInPatient[indexInsurance].approvalNo.toString(), context)
.approvalNo +
": ",
value: model
.insuranceApprovalInPatient[
indexInsurance]
.approvalNo
.toString(),
), ),
CustomRow( CustomRow(
label: 'Unused Count:', label: 'Unused Count:',
value: model.insuranceApprovalInPatient[indexInsurance].unUsedCount.toString(), value: model
.insuranceApprovalInPatient[
indexInsurance]
.unUsedCount
.toString(),
), ),
CustomRow(label: TranslationBase.of(context).companyName + ": ", value: 'Sample'),
CustomRow( CustomRow(
label: TranslationBase.of(context).receiptOn + ": ", label: TranslationBase.of(
context)
.companyName +
": ",
value: 'Sample'),
CustomRow(
label: TranslationBase.of(
context)
.receiptOn +
": ",
value: value:
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn ?? ""), isArabic: projectViewModel.isArabic)}'), '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].receiptOn ?? ""), isArabic: projectViewModel.isArabic)}'),
CustomRow( CustomRow(
label: TranslationBase.of(context).expiryDate + ": ", label: TranslationBase.of(
context)
.expiryDate +
": ",
value: value:
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate ?? ""), isArabic: projectViewModel.isArabic)}'), '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApprovalInPatient[indexInsurance].expiryDate ?? ""), isArabic: projectViewModel.isArabic)}'),
], ],
@ -175,34 +243,44 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(
horizontal: 8.0),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
TranslationBase.of(context).procedure, TranslationBase.of(context)
.procedure,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xff2E303A), color: Color(0xff2E303A),
letterSpacing: -0.48, letterSpacing: -0.48,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.9, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
2.9,
), ),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
TranslationBase.of(context).status, TranslationBase.of(context)
.status,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xff2E303A), color: Color(0xff2E303A),
letterSpacing: -0.48, letterSpacing: -0.48,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.9, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
2.9,
), ),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
TranslationBase.of(context).usageStatus, TranslationBase.of(context)
.usageStatus,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xff2E303A), color: Color(0xff2E303A),
letterSpacing: -0.48, letterSpacing: -0.48,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.9, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
2.9,
), ),
) )
], ],
@ -212,12 +290,19 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
color: Colors.black, color: Colors.black,
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(
horizontal: 8.0),
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
itemCount: model.insuranceApprovalInPatient[indexInsurance].apporvalDetails!.length, itemCount: model
itemBuilder: (BuildContext context, int index) { .insuranceApprovalInPatient[
indexInsurance]
.apporvalDetails!
.length,
itemBuilder:
(BuildContext context,
int index) {
return Container( return Container(
child: Column( child: Column(
children: [ children: [
@ -226,36 +311,81 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Expanded( Expanded(
child: Container( child: Container(
child: AppText( child: AppText(
model.insuranceApprovalInPatient[indexInsurance].apporvalDetails![index].procedureName ?? "", model
textAlign: TextAlign.center, .insuranceApprovalInPatient[
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, indexInsurance]
letterSpacing: -0.4, ?.apporvalDetails![
color: Color(0xff575757), index]
fontWeight: FontWeight.w500, ?.procedureName ??
"",
textAlign:
TextAlign
.center,
fontSize:
SizeConfig
.getTextMultiplierBasedOnWidth() *
2.7,
letterSpacing:
-0.4,
color: Color(
0xff575757),
fontWeight:
FontWeight
.w500,
), ),
), ),
), ),
Expanded( Expanded(
child: Container( child: Container(
child: AppText( child: AppText(
model.insuranceApprovalInPatient[indexInsurance].apporvalDetails![index].status ?? "", model
textAlign: TextAlign.center, .insuranceApprovalInPatient[
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, indexInsurance]
letterSpacing: -0.4, ?.apporvalDetails![
color: Color(0xff575757), index]
fontWeight: FontWeight.w500, ?.status ??
"",
textAlign:
TextAlign
.center,
fontSize:
SizeConfig
.getTextMultiplierBasedOnWidth() *
2.7,
letterSpacing:
-0.4,
color: Color(
0xff575757),
fontWeight:
FontWeight
.w500,
), ),
), ),
), ),
Expanded( Expanded(
child: Container( child: Container(
child: AppText( child: AppText(
model.insuranceApprovalInPatient[indexInsurance].apporvalDetails![index].isInvoicedDesc ?? "", model
textAlign: TextAlign.center, .insuranceApprovalInPatient[
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 2.7, indexInsurance]
letterSpacing: -0.4, ?.apporvalDetails![
color: Color(0xff575757), index]
fontWeight: FontWeight.w500, ?.isInvoicedDesc ??
"",
textAlign:
TextAlign
.center,
fontSize:
SizeConfig
.getTextMultiplierBasedOnWidth() *
2.7,
letterSpacing:
-0.4,
color: Color(
0xff575757),
fontWeight:
FontWeight
.w500,
), ),
), ),
), ),
@ -331,9 +461,24 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
model.insuranceApproval[indexInsurance].approvalStatusDescption != null ? model.insuranceApproval[indexInsurance].approvalStatusDescption ?? "" : "", model
color: model.insuranceApproval[indexInsurance].approvalStatusDescption != null .insuranceApproval[
? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" == "Approved" indexInsurance]
.approvalStatusDescption !=
null
? model
.insuranceApproval[
indexInsurance]
.approvalStatusDescption ??
""
: "",
color: model
.insuranceApproval[
indexInsurance]
.approvalStatusDescption !=
null
? "${model.insuranceApproval[indexInsurance].approvalStatusDescption}" ==
"Approved"
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: Color(0xffD02127) : Color(0xffD02127)
: Color(0xffD02127), : Color(0xffD02127),
@ -343,7 +488,10 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
model.insuranceApproval[indexInsurance].doctorName!.toUpperCase(), model
.insuranceApproval[indexInsurance]
.doctorName!
.toUpperCase(),
color: Colors.black, color: Colors.black,
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -351,7 +499,8 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
], ],
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(
horizontal: 8.0),
child: Row( child: Row(
children: [ children: [
Column( Column(
@ -360,26 +509,37 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
height: 85.0, height: 85.0,
width: 85.0, width: 85.0,
child: CircleAvatar( child: CircleAvatar(
radius: SizeConfig.imageSizeMultiplier! * 12, radius: SizeConfig
.imageSizeMultiplier! *
12,
// radius: (52) // radius: (52)
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(50), borderRadius:
BorderRadius.circular(
50),
child: Image.network( child: Image.network(
model.insuranceApproval[indexInsurance].doctorImage!, model
.insuranceApproval[
indexInsurance]
.doctorImage!,
fit: BoxFit.fill, fit: BoxFit.fill,
width: 700, width: 700,
), ),
), ),
backgroundColor: Colors.transparent, backgroundColor:
Colors.transparent,
), ),
), ),
], ],
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding:
const EdgeInsets.symmetric(
horizontal: 8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.center, //mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SizedBox( SizedBox(
@ -388,13 +548,19 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).clinic + ": ", TranslationBase.of(
color: Colors.grey[500]!, context)
.clinic +
": ",
color: Colors.grey[500],
fontSize: 14, fontSize: 14,
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model.insuranceApproval[indexInsurance].clinicName!, model
.insuranceApproval[
indexInsurance]
.clinicName!,
fontSize: 14, fontSize: 14,
), ),
) )
@ -403,12 +569,19 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row( Row(
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).approvalNo + ": ", TranslationBase.of(
color: Colors.grey[500]!, context)
.approvalNo +
": ",
color: Colors.grey[500],
fontSize: 14, fontSize: 14,
), ),
AppText( AppText(
model.insuranceApproval[indexInsurance].approvalNo.toString(), model
.insuranceApproval[
indexInsurance]
.approvalNo
.toString(),
fontSize: 14, fontSize: 14,
) )
], ],
@ -416,12 +589,19 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row( Row(
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).unusedCount + ": ", TranslationBase.of(
color: Colors.grey[500]!, context)
.unusedCount +
": ",
color: Colors.grey[500],
fontSize: 14, fontSize: 14,
), ),
AppText( AppText(
model.insuranceApproval[indexInsurance].unUsedCount.toString(), model
.insuranceApproval[
indexInsurance]
.unUsedCount
.toString(),
fontSize: 14, fontSize: 14,
) )
], ],
@ -429,8 +609,11 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row( Row(
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).companyName + ": ", TranslationBase.of(
color: Colors.grey[500]!, context)
.companyName +
": ",
color: Colors.grey[500],
), ),
AppText('Sample') AppText('Sample')
], ],
@ -438,14 +621,18 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).receiptOn + ": ", TranslationBase.of(
color: Colors.grey[500]!, context)
.receiptOn +
": ",
color: Colors.grey[500],
), ),
Expanded( Expanded(
child: AppText( child: AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn!), isArabic: projectViewModel.isArabic)}', '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn!), isArabic: projectViewModel.isArabic)}',
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w600, fontWeight:
FontWeight.w600,
), ),
), ),
], ],
@ -453,14 +640,22 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).expiryDate + ": ", TranslationBase.of(
color: Colors.grey[500]!, context)
), .expiryDate +
if (model.insuranceApproval[indexInsurance].expiryDate != null) ": ",
color: Colors.grey[500],
),
if (model
.insuranceApproval[
indexInsurance]
.expiryDate !=
null)
AppText( AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}', '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate!), isArabic: projectViewModel.isArabic)}',
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w600, fontWeight:
FontWeight.w600,
), ),
], ],
), ),
@ -478,24 +673,28 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(
horizontal: 8.0),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
TranslationBase.of(context).procedure, TranslationBase.of(context)
.procedure,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
TranslationBase.of(context).status, TranslationBase.of(context)
.status,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
TranslationBase.of(context).usageStatus, TranslationBase.of(context)
.usageStatus,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
) )
@ -506,12 +705,19 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
color: Colors.black, color: Colors.black,
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(
child: ListView.builder( horizontal: 8.0),
child: (model.insuranceApproval[indexInsurance].apporvalDetails != null && model.insuranceApproval[indexInsurance].apporvalDetails!.isNotEmpty) ? ListView.builder(
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
itemCount: model.insuranceApproval[indexInsurance].apporvalDetails!.length, itemCount: model
itemBuilder: (BuildContext context, int index) { .insuranceApproval[
indexInsurance]
.apporvalDetails!
.length,
itemBuilder:
(BuildContext context,
int index) {
return Container( return Container(
child: Column( child: Column(
children: [ children: [
@ -520,24 +726,48 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
Expanded( Expanded(
child: Container( child: Container(
child: AppText( child: AppText(
model.insuranceApproval[indexInsurance].apporvalDetails![index].procedureName ?? "", model
textAlign: TextAlign.start, .insuranceApproval[
indexInsurance]
?.apporvalDetails![
index]
?.procedureName ??
"",
textAlign:
TextAlign
.start,
), ),
), ),
), ),
Expanded( Expanded(
child: Container( child: Container(
child: AppText( child: AppText(
model.insuranceApproval[indexInsurance].apporvalDetails![index].status ?? "", model
textAlign: TextAlign.center, .insuranceApproval[
indexInsurance]
?.apporvalDetails![
index]
?.status ??
"",
textAlign:
TextAlign
.center,
), ),
), ),
), ),
Expanded( Expanded(
child: Container( child: Container(
child: AppText( child: AppText(
model.insuranceApproval[indexInsurance].apporvalDetails![index].isInvoicedDesc ?? "", model
textAlign: TextAlign.center, .insuranceApproval[
indexInsurance]
?.apporvalDetails![
index]
?.isInvoicedDesc ??
"",
textAlign:
TextAlign
.center,
), ),
), ),
), ),
@ -552,7 +782,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
], ],
), ),
); );
}), }) : NoData(),
), ),
], ],
), ),

@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../widgets/shared/app_texts_widget.dart';
import '../../../../widgets/shared/errors/error_message.dart'; import '../../../../widgets/shared/errors/error_message.dart';
class LabsHomePage extends StatefulWidget { class LabsHomePage extends StatefulWidget {
@ -48,7 +48,10 @@ class _LabsHomePageState extends State<LabsHomePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getLabs(patient!, isInpatient: false), onModelReady: (model) {
model.getLabs(patient!, isInpatient: false);
model.isPrincipalCovered(patient: patient!);
},
builder: (context, ProcedureViewModel model, widget) => AppScaffold( builder: (context, ProcedureViewModel model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
backgroundColor: Colors.grey[100]!, backgroundColor: Colors.grey[100]!,
@ -72,6 +75,17 @@ class _LabsHomePageState extends State<LabsHomePage> {
title: TranslationBase.of(context).lab, title: TranslationBase.of(context).lab,
subTitle: TranslationBase.of(context).result, subTitle: TranslationBase.of(context).result,
), ),
SizedBox(
height: 20,
),
!model.isPrincipalCovered_
? Center(
child: AppText(
TranslationBase.of(context).principalCoveredOrNot,
color: Colors.red,
textAlign: TextAlign.center,
))
: SizedBox(),
if ((patient!.patientStatusType != null && patient!.patientStatusType == 43) || (isFromLiveCare! && patient!.appointmentNo != null)) if ((patient!.patientStatusType != null && patient!.patientStatusType == 43) || (isFromLiveCare! && patient!.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () {
@ -111,7 +125,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
child: Container( child: Container(
width: 20, width: 20,
decoration: BoxDecoration( decoration: BoxDecoration(
color: model.patientLabOrdersList[index].isLiveCareAppointment! color: model.patientLabOrdersList![index].isLiveCareAppointment!
? Colors.red[900] ? Colors.red[900]
: !model.patientLabOrdersList[index].isInOutPatient! : !model.patientLabOrdersList[index].isInOutPatient!
? Colors.black ? Colors.black
@ -142,8 +156,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
margin: EdgeInsets.only(left: 20), margin: EdgeInsets.only(left: 20),
child: DoctorCard( child: DoctorCard(
isNoMargin: true, isNoMargin: true,
onTap: () { onTap: () => Navigator.push(
Navigator.push(
context, context,
FadePage( FadePage(
page: LaboratoryResultPage( page: LaboratoryResultPage(
@ -154,15 +167,14 @@ class _LabsHomePageState extends State<LabsHomePage> {
patientType: patientType!, patientType: patientType!,
), ),
), ),
); ),
}, doctorName: Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName),
doctorName: Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName!),
invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}',
profileUrl: model.patientLabOrdersList[index].doctorImageURL!, profileUrl: model.patientLabOrdersList[index].doctorImageURL,
branch: model.patientLabOrdersList[index].projectName!, branch: model.patientLabOrdersList[index].projectName,
clinic: Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription!), clinic: Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription),
appointmentDate: model.patientLabOrdersList[index].createdOn!, appointmentDate: model.patientLabOrdersList[index].createdOn,
orderNo: model.patientLabOrdersList[index].orderNo!, orderNo: model.patientLabOrdersList[index].orderNo,
isShowTime: false, isShowTime: false,
), ),
), ),
@ -170,7 +182,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
), ),
), ),
), ),
if (model.patientLabOrdersList.isEmpty && patient!.patientStatusType != 43) if (model.patientLabOrdersList.isEmpty && patient!.patientStatusType! != 43)
Center( Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable, error: TranslationBase.of(context).noDataAvailable,

@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../widgets/shared/app_texts_widget.dart';
import '../../../../widgets/shared/errors/error_message.dart'; import '../../../../widgets/shared/errors/error_message.dart';
class RadiologyHomePage extends StatefulWidget { class RadiologyHomePage extends StatefulWidget {
@ -47,7 +48,11 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false), onModelReady: (model) {
model.getPatientRadOrders(
patient, patientType: patientType, isInPatient: false);
model.isPrincipalCovered(patient: patient);
},
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100]!, backgroundColor: Colors.grey[100]!,
@ -70,11 +75,16 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
subTitle: TranslationBase.of(context).result, subTitle: TranslationBase.of(context).result,
), ),
if (patient.patientStatusType != null && patient.patientStatusType == 43) if (patient.patientStatusType != null && patient.patientStatusType == 43)
ServiceTitle( ServiceTitle(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
subTitle: TranslationBase.of(context).result, subTitle: TranslationBase.of(context).result,
), ),
SizedBox(height: 20,),
!model.isPrincipalCovered_ ? Center(child: AppText(TranslationBase.of(context).principalCoveredOrNot,color: Colors.red, textAlign: TextAlign.center, )) :SizedBox(),
if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () {

@ -2,14 +2,12 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_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/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.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/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.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/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
@ -23,6 +21,8 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../../core/model/SOAP/Assessment/post_assessment_request_model.dart';
import '../../../../../core/model/SOAP/assessment/patch_assessment_req_model.dart';
class AddAssessmentDetails extends StatefulWidget { class AddAssessmentDetails extends StatefulWidget {
final MySelectedAssessment mySelectedAssessment; final MySelectedAssessment mySelectedAssessment;
@ -46,6 +46,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
bool isFormSubmitted = false; bool isFormSubmitted = false;
bool complexDiagnosis = true;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -95,7 +96,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: BottomSheetTitle(title: TranslationBase.of(context).addAssessmentDetails), appBar: BottomSheetTitle(title: widget.isUpdate ? TranslationBase.of(context).updateAssessmentDetails : TranslationBase.of(context).addAssessmentDetails),
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Center( child: Center(
@ -108,6 +109,23 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
SizedBox( SizedBox(
height: 16, height: 16,
), ),
Row(children: [
Checkbox(
value: complexDiagnosis,
onChanged: (bool? value) {
complexDiagnosis = value!;
setState(() {});
},
checkColor: Colors.white,
activeColor: Colors.green,
),
Text(
TranslationBase.of(context).complexDiagnosis,
),
]),
SizedBox(
height: 16,
),
Container( Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15), margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom( child: AppTextFieldCustom(
@ -157,9 +175,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
suffixIcon: IconButton( suffixIcon: IconButton(
onPressed: () { onPressed: () {
print(icdNameController.text); if (icdNameController.text.length <= 2) {
if (icdNameController.text.length <= 3) { DrAppToastMsg.showErrorToast("Please enter 3 or more characters");
DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
} else { } else {
model.listOfICD10!.clear(); model.listOfICD10!.clear();
model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
@ -172,20 +189,20 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
onFieldSubmitted: () {}, onFieldSubmitted: () {},
)), )),
model.listOfICD10!.length > 0 && icdNameController.text.isNotEmpty model.listOfICD10.length > 0 && icdNameController.text.isNotEmpty
? Container( ? Container(
color: Colors.white, color: Colors.white,
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height, height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
itemCount: model.listOfICD10!.length, itemCount: model.listOfICD10.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return InkWell(
child: ListTile(title: AppText(model.listOfICD10![index].description + " / " + model.listOfICD10![index].code.toString(), fontSize: 12.0)), child: ListTile(title: AppText(model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)),
onTap: () { onTap: () {
widget.mySelectedAssessment.selectedICD = model.listOfICD10![index]; widget.mySelectedAssessment.selectedICD = model.listOfICD10[index];
icdNameController.text = model.listOfICD10![index].description; icdNameController.text = model.listOfICD10[index].description;
model.listOfICD10!.clear(); model.listOfICD10.clear();
setState(() {}); setState(() {});
}); });
}, },
@ -369,7 +386,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: 0, height: 0,
) )
: CustomBottomSheetContainer( : CustomBottomSheetContainer(
label: (widget.isUpdate ? 'Update Assessment Details' : 'Add Assessment Details'), label: (widget.isUpdate ? TranslationBase.of(context).updateAssessmentDetails : TranslationBase.of(context).addAssessmentDetails),
onTap: () async { onTap: () async {
setState(() { setState(() {
isFormSubmitted = true; isFormSubmitted = true;
@ -388,24 +405,31 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
); );
} }
submitAssessment({required SOAPViewModel model, required MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { submitAssessment({SOAPViewModel? model, MySelectedAssessment? mySelectedAssessment, bool isUpdate = false}) async {
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (isUpdate) { if (isUpdate) {
PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( PostAssessmentRequestUpdateModel patchAssessmentReqModel = PostAssessmentRequestUpdateModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
remarks: mySelectedAssessment.remark, createdByName: doctorProfile.doctorName,
complexDiagnosis: true, createdBy: doctorProfile.doctorID,
conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, icdCodeDetails: [
new IcdCodeDetailsUpdate(
remarks: mySelectedAssessment!.remark,
complexDiagnosis: complexDiagnosis,
conditionId: mySelectedAssessment!.selectedDiagnosisCondition!.id,
prevIcdCode10ID: mySelectedAssessment.icdCode10ID,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD!.code, icdcode10Id: mySelectedAssessment.selectedICD!.code)
prevIcdCode10ID: mySelectedAssessment.icdCode10ID); ]);
await model.patchAssessment(patchAssessmentReqModel); await model?.patchAssessment(patchAssessmentReqModel);
} else { } else {
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE); // Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); // DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel( PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
@ -414,16 +438,16 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
createdBy: doctorProfile.doctorID, createdBy: doctorProfile.doctorID,
icdCodeDetails: [ icdCodeDetails: [
new IcdCodeDetails( new IcdCodeDetails(
remarks: mySelectedAssessment.remark, remarks: mySelectedAssessment!.remark,
complexDiagnosis: true, complexDiagnosis: complexDiagnosis,
conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, conditionId: mySelectedAssessment!.selectedDiagnosisCondition!.id,
diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id,
icdcode10Id: mySelectedAssessment.selectedICD!.code) icdcode10Id: mySelectedAssessment.selectedICD!.code)
]); ]);
await model.postAssessment(postAssessmentRequestModel); await model?.postAssessment(postAssessmentRequestModel);
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) { if (model!.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);

@ -39,7 +39,7 @@ class UpdateAssessmentPage extends StatefulWidget {
class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements AssessmentCallBack { class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements AssessmentCallBack {
bool isAssessmentExpand = false; bool isAssessmentExpand = false;
List<MySelectedAssessment> mySelectedAssessmentList = []; List<MySelectedAssessment> mySelectedAssessmentList = [];
bool isPrescriptionOrder =false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -48,7 +48,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
onModelReady: (model) async { onModelReady: (model) async {
model.setAssessmentCallBack(this); model.setAssessmentCallBack(this);
mySelectedAssessmentList.clear(); mySelectedAssessmentList.clear();
await model.isPrescriptionOrderCreated(widget.patientInfo);
await model.onUpdateAssessmentStepStart(widget.patientInfo); await model.onUpdateAssessmentStepStart(widget.patientInfo);
if (model.patientAssessmentList.isNotEmpty) { if (model.patientAssessmentList.isNotEmpty) {
@ -324,11 +324,20 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
), ),
InkWell( InkWell(
onTap: () { onTap: () {
openAssessmentDialog(context, isUpdate: true, assessment: assessment, model: model); if(model.isPrescriptionOrder && assessment.selectedDiagnosisType!.id ==2) {
Utils.showErrorToast(TranslationBase.of(context).principalDiagnosisCannot);
}else{
openAssessmentDialog(
context, isUpdate: true,
assessment: assessment,
model: model);
}
}, },
child: Icon( child: Icon(
DoctorApp.edit, DoctorApp.edit,
size: 18, size: 18,
color: model.isPrescriptionOrder && assessment.selectedDiagnosisType!.id ==2 ? Colors.grey : Colors.black ,
), ),
) )
], ],
@ -384,9 +393,15 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
nextFunction(model) { nextFunction(model) {
if (mySelectedAssessmentList.isEmpty) { if (mySelectedAssessmentList.isEmpty) {
Utils.showErrorToast(TranslationBase.of(context).assessmentErrorMsg); Utils.showErrorToast(TranslationBase.of(context).assessmentErrorMsg);
} else if(!checkPrimaryDiagnosis()) {
Utils.showErrorToast(TranslationBase.of(context).onePrimaryDiagnosis);
}else{ }else{
widget.changeLoadingState(true); widget.changeLoadingState(true);
widget.changePageViewIndex(3); widget.changePageViewIndex(3);
} }
} }
bool checkPrimaryDiagnosis(){
List<MySelectedAssessment> type = mySelectedAssessmentList.where((element) => element.selectedDiagnosisType!.id==2).toList();
return type.isEmpty ? false : true;
}
} }

@ -14,6 +14,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../widgets/dialog/confirm_dialog.dart';
import 'drug_to_drug.dart'; import 'drug_to_drug.dart';
class AddDrugWidget extends StatefulWidget { class AddDrugWidget extends StatefulWidget {
@ -81,40 +82,85 @@ class _AddDrugWidgetState extends State<AddDrugWidget> {
: CustomBottomSheetContainer( : CustomBottomSheetContainer(
label: TranslationBase.of(context).addMedication, label: TranslationBase.of(context).addMedication,
onTap: () async { onTap: () async {
showDialog(
context: context,
builder: (BuildContext context2) {
return ConfirmationDialog(
title: TranslationBase.of(context2).afterOrderCreation,
onTapGrant: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.medicineModel!.postPrescription( await widget.medicineModel!.postPrescription(
isLocalBusy: true, isLocalBusy: true,
icdCode: widget.medicineModel!.patientAssessmentList.isNotEmpty icdCode: widget.medicineModel!
? widget.medicineModel!.patientAssessmentList[0].icdCode10ID!.isEmpty .patientAssessmentList.isNotEmpty
? widget
.medicineModel
!.patientAssessmentList[0]
.icdCode10ID!
.isEmpty
? "test" ? "test"
: widget.medicineModel!.patientAssessmentList[0].icdCode10ID.toString() : widget.medicineModel!
.patientAssessmentList![0].icdCode10ID
.toString()
: "test", : "test",
dose: widget.strength, dose: widget.strength,
doseUnit: doseUnit:
widget.medicineModel!.itemMedicineListUnit.length == 1 ? widget.medicineModel!.itemMedicineListUnit[0]['parameterCode'].toString() : widget.units['parameterCode'].toString(), widget.medicineModel!.itemMedicineListUnit
.length ==
1
? widget
.medicineModel
!.itemMedicineListUnit[0]
['parameterCode']
.toString()
: widget.units['parameterCode']
.toString(),
patient: widget.patient, patient: widget.patient,
doseTimeIn: widget.doseTime['id'].toString(), doseTimeIn: widget.doseTime['id'].toString(),
model: widget.modelPrescription, model: widget.modelPrescription,
duration: widget.duration['id'].toString(), duration: widget.duration['id'].toString(),
frequency: widget.medicineModel!.itemMedicineList.length == 1 ? widget.medicineModel!.itemMedicineList[0]['parameterCode'].toString() : widget.frequency['parameterCode'].toString(), frequency: widget.medicineModel!.itemMedicineList
route: .length ==
widget.medicineModel!.itemMedicineListRoute.length == 1 ? widget.medicineModel!.itemMedicineListRoute[0]['parameterCode'].toString() : widget.route['parameterCode'].toString(), 1
drugId: widget.selectedMedication!.itemId.toString(), ? widget.medicineModel!
.itemMedicineList![0]['parameterCode']
.toString()
: widget.frequency['parameterCode']
.toString(),
route: widget.medicineModel!.itemMedicineListRoute
.length ==
1
? widget.medicineModel!
.itemMedicineListRoute![0]['parameterCode']
.toString()
: widget.route['parameterCode'].toString(),
drugId:
widget.selectedMedication!.itemId.toString(),
strength: widget.strength, strength: widget.strength,
indication: widget.indication, indication: widget.indication,
instruction: widget.instruction, instruction: widget.instruction,
doseTime: widget.selectedDate, doseTime: widget.selectedDate,
); );
if (widget.medicineModel!.state == ViewState.ErrorLocal) { if (widget.medicineModel!.state ==
ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Utils.showErrorToast(widget.medicineModel!.error); Utils.showErrorToast(widget.medicineModel!.error);
} else if (widget.modelPrescription!.state == ViewState.Idle) { } else if (widget.modelPrescription!.state ==
await widget.modelPrescription!.getPrescriptionListNew(appNo: widget.patient!.appointmentNo, mrn: widget.patient!.patientMRN, isLocalBusy: true); ViewState.Idle) {
await widget.modelPrescription
!.getPrescriptionListNew(
appNo: widget.patient!.appointmentNo,
mrn: widget.patient!.patientMRN,
isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).medicationHasBeenAdded); DrAppToastMsg.showSuccesToast(
TranslationBase.of(context)
.medicationHasBeenAdded);
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
});
});
}, },
), ),
); );

@ -24,6 +24,7 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../../../core/model/SOAP/master_key_model.dart';
import '../../../widgets/transitions/slide_up_page.dart'; import '../../../widgets/transitions/slide_up_page.dart';
import 'add_drug/add_drug_widget.dart'; import 'add_drug/add_drug_widget.dart';
@ -49,7 +50,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
String? durationError; String? durationError;
String? unitError; String? unitError;
String? strengthError; String? strengthError;
String? icdCodeError;
int? selectedType; int? selectedType;
TextEditingController strengthController = TextEditingController(); TextEditingController strengthController = TextEditingController();
@ -81,6 +82,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
dynamic uom; dynamic uom;
dynamic box; dynamic box;
dynamic x; dynamic x;
dynamic icdCode;
TextEditingController icdNameController = TextEditingController();
List<MasterKeyModel> icdCodeList =[];
@override
void initState() {
getIcdCodeData();
super.initState();
}
setSelectedType(int val) { setSelectedType(int val) {
setState(() { setState(() {
@ -88,6 +97,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}); });
} }
getIcdCodeData() async{
await widget.prescriptionViewModel.getIcd10DISESECode(patient: widget.patient, itemID:widget.selectedMedication.itemId );
icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems);
}
onVoiceText() async { onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context); new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
@ -269,9 +282,85 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}); });
}), }),
SizedBox(height: spaceBetweenTextFields), SizedBox(height: spaceBetweenTextFields),
if (widget.medicineViewModel.patientAssessmentList.isNotEmpty) widget.prescriptionViewModel.icd10DeseaseItems.isNotEmpty ?
// PrescriptionTextFiled(
// hintText: TranslationBase.of(context).nameOrICD,
// elementError: icdCodeError,
// element: icdCode,
// elementList: widget.prescriptionViewModel.icd10DeseaseItems,
// keyId: 'codeId',
// keyName: 'asciiDesc',
// okFunction: (selectedValue) {
// setState(() {
// icdCode = selectedValue;
// });
// })
Column(
children:[ InkWell(
onTap: widget.prescriptionViewModel.icd10DeseaseItems != null
? () {
icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems);
setState(() {
icdCode = null;
icdNameController.text = '';
});
}
: null,
child: AppTextFieldCustom(
validationError: icdCodeError,
onChanged: (text){
icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems);
setState(() {
icdNameController.text;
});
},
height: Utils.getTextFieldHeight(),
onClick: widget.prescriptionViewModel.icd10DeseaseItems != null
? () {
setState(() {
icdCode = null;
icdNameController.text = '';
});
}
: null,
hintText: TranslationBase.of(context).nameOrICD,
maxLines: 1,
minLines: 1,
controller: icdNameController,
enabled:true,
isTextFieldHasSuffix: true, onFieldSubmitted: () { },
)),
icdCodeList.isNotEmpty && icdNameController.text.isNotEmpty ? Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
child:ListView.builder(
shrinkWrap: true,
itemCount:icdCodeList.length,
itemBuilder: (context, index) {
return InkWell(child:ListTile(
title: AppText( widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc + " / " + widget.prescriptionViewModel.icd10DeseaseItems[index].codeId.toString(), fontSize: 12.0)),
onTap: (){
icdCode = widget.prescriptionViewModel.icd10DeseaseItems[index];
icdNameController.text = widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc;
widget.medicineViewModel.patientAssessmentList[0].icdCode10ID = widget.prescriptionViewModel.icd10DeseaseItems[index].codeId;
widget.medicineViewModel.patientAssessmentList[0].asciiDesc = widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc;
icdCodeList.clear();
setState(() {
});
}
);
},
)) :SizedBox()
])
: widget.medicineViewModel.patientAssessmentList.isNotEmpty ?
Container( Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.068,
width: double.infinity, width: double.infinity,
color: Colors.white, color: Colors.white,
child: Row( child: Row(
@ -298,8 +387,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
), ),
], ],
), ),
), ) :SizedBox(),
SizedBox(height: spaceBetweenTextFields), SizedBox(height: spaceBetweenTextFields),
SizedBox(height: 10,),
Container( Container(
color: Colors.transparent, color: Colors.transparent,
child: InkWell( child: InkWell(
@ -512,6 +602,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
} else { } else {
strengthError = null; strengthError = null;
} }
if ( icdNameController.text == "" && widget.prescriptionViewModel.icd10DeseaseItems.isNotEmpty) {
icdCodeError = TranslationBase.of(context).fieldRequired;
} else {
icdCodeError = null;
}
}); });
} }
formKey.currentState!.save(); formKey.currentState!.save();

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
@ -26,7 +27,9 @@ class NewPrescriptionsPage extends StatelessWidget {
bool isFromLiveCare = routeArgs['isFromLiveCare']; bool isFromLiveCare = routeArgs['isFromLiveCare'];
return BaseView<PrescriptionViewModel>( return BaseView<PrescriptionViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.getPrescriptionListNew(mrn: patient.patientMRN, appNo: patient.appointmentNo ?? 0); await model.getPrescriptionListNew(
mrn: patient.patientMRN, appNo: patient.appointmentNo);
await model.isPrincipalCovered(patient: patient);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
@ -45,6 +48,8 @@ class NewPrescriptionsPage extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -57,7 +62,11 @@ class NewPrescriptionsPage extends StatelessWidget {
], ],
), ),
), ),
if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) !model.isPrincipalCovered_ ? Center(child: AppText(TranslationBase.of(context).principalCoveredOrNot,color: Colors.red, textAlign: TextAlign.center, )) :SizedBox(),
SizedBox(height: 20,),
if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () {
Navigator.push( Navigator.push(

@ -14,6 +14,8 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../widgets/dialog/confirm_dialog.dart';
import '../../widgets/transitions/slide_up_page.dart';
import 'entity_list_checkbox_search_widget.dart'; import 'entity_list_checkbox_search_widget.dart';
class AddProcedurePage extends StatefulWidget { class AddProcedurePage extends StatefulWidget {
@ -177,18 +179,23 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
: CustomBottomSheetContainer( : CustomBottomSheetContainer(
label: procedureType.getAddButtonTitle(context), label: procedureType.getAddButtonTitle(context),
onTap: () async { onTap: () async {
{
GifLoaderDialogUtils.showMyDialog(context);
if (entityList.isEmpty == true) { if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context).fillTheMandatoryProcedureDetails, TranslationBase.of(context).fillTheMandatoryProcedureDetails,
); );
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
return; return;
} }
showDialog(
context: context,
builder: (BuildContext context) {
return ConfirmationDialog(title:TranslationBase.of(context).afterOrderCreation,
onTapGrant: () async{
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.model.preparePostProcedure( await widget.model.preparePostProcedure(
orderType: selectedType, orderType: selectedType.toString(),
entityList: entityList, entityList: entityList,
patient: patient, patient: patient,
remarks: remarksController.text, remarks: remarksController.text,
@ -196,7 +203,12 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
isLocalBusy: true, isLocalBusy: true,
); );
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} });
},
);
}), }),
), ),
); );

@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../widgets/shared/app_texts_widget.dart';
import '../../widgets/shared/errors/error_message.dart'; import '../../widgets/shared/errors/error_message.dart';
import 'base_add_procedure_tab_page.dart'; import 'base_add_procedure_tab_page.dart';
@ -37,12 +38,16 @@ class ProcedureScreen extends StatelessWidget {
bool isFromLiveCare = routeArgs['isFromLiveCare']; bool isFromLiveCare = routeArgs['isFromLiveCare'];
bool isInpatient = routeArgs['isInpatient']; bool isInpatient = routeArgs['isInpatient'];
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedure( onModelReady: (model) {
model.getProcedure(
mrn: patient.patientId, mrn: patient.patientId,
patientType: patientType, patientType: patientType,
appointmentNo: patient.appointmentNo), appointmentNo: patient.appointmentNo);
builder: model.isPrincipalCovered(patient: patient);
(BuildContext context, ProcedureViewModel model, Widget? child) =>
},
builder: (BuildContext context, ProcedureViewModel model, Widget? child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100]!, backgroundColor: Colors.grey[100]!,
@ -91,6 +96,9 @@ class ProcedureScreen extends StatelessWidget {
}, },
label: TranslationBase.of(context).addMoreProcedure, label: TranslationBase.of(context).addMoreProcedure,
), ),
!model.isPrincipalCovered_ ? Center(child: AppText(TranslationBase.of(context).principalCoveredOrNot,color: Colors.red, textAlign: TextAlign.center, )) :SizedBox(),
SizedBox(height: 20,),
if (model.procedureList.isNotEmpty) if (model.procedureList.isNotEmpty)
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,

@ -1456,6 +1456,13 @@ class TranslationBase {
String get dateFrom => localizedValues['dateFrom']![locale.languageCode]!; String get dateFrom => localizedValues['dateFrom']![locale.languageCode]!;
String get searchFindSchedule => localizedValues['searchFindSchedule']![locale.languageCode]!; String get searchFindSchedule => localizedValues['searchFindSchedule']![locale.languageCode]!;
String get onePrimaryDiagnosis => localizedValues['onePrimaryDiagnosis']![locale.languageCode]!;
String get principalDiagnosisCannot => localizedValues['principalDiagnosisCannot']![locale.languageCode]!;
String get afterOrderCreation => localizedValues['afterOrderCreation']![locale.languageCode]!;
String get principalCoveredOrNot => localizedValues['principalCoveredOrNot']![locale.languageCode]!;
String get complexDiagnosis => localizedValues['complexDiagnosis']![locale.languageCode]!;
String get updateAssessmentDetails =>
localizedValues['updateAssessmentDetails']![locale.languageCode]!;
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -26,7 +26,7 @@ class Utils {
get currentLanguage => null; get currentLanguage => null;
static showConfirmationDialog(BuildContext context, String message, Function okFunction) { static showConfirmationDialog(BuildContext context, String message, Function okFunction, {bool isShowCancelButton = true}) {
return showDialog( return showDialog(
context: context, context: context,
barrierDismissible: false, // user must tap button! barrierDismissible: false, // user must tap button!
@ -47,6 +47,10 @@ class Utils {
fontColor: Colors.white, fontColor: Colors.white,
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
), ),
SizedBox(
height: 30,
),
if (isShowCancelButton)
AppButton( AppButton(
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();

@ -0,0 +1,40 @@
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:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import '../../utils/translations_delegate_base_utils.dart';
class ConfirmationDialog extends StatefulWidget {
final String? title;
final Function? onTapGrant;
ConfirmationDialog({this.title, this.onTapGrant});
@override
_ConfirmationDialogState createState() => _ConfirmationDialogState();
}
class _ConfirmationDialogState extends State<ConfirmationDialog> {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text("Alert"),
content: Text(widget.title!),
actions: [
TextButton(
child: Text(TranslationBase.of(context).cancel),
onPressed: () {
Navigator.pop(context);
},
),
TextButton(
child: Text(TranslationBase.of(context).ok),
onPressed: () {
Navigator.pop(context);
widget.onTapGrant!();
},
)
],
);
}
}

@ -3,6 +3,7 @@ import 'dart:async';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/utils/extenstions_utils.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:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -62,21 +63,7 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
@override @override
void initState() { void initState() {
streamSubscription = event.controller.stream.listen((p) { startStreamListener();
if ((p['searchText'] != 'null' &&
p['searchText'] != null &&
p['searchText'] != "" &&
isClosed == false)) {
setState(() {
searchText = p['searchText'];
SpeechToText.closeAlertDialog(context);
});
} else if (p['searchText'] == 'null') {
setState(() {
searchText = p['searchText'];
});
}
});
super.initState(); super.initState();
} }
@ -104,9 +91,7 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
child: Container( child: Container(
margin: EdgeInsets.all(20), margin: EdgeInsets.all(20),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(100), border: Border.all(width: 2, color: Colors.red)),
borderRadius: BorderRadius.circular(100),
border: Border.all(width: 2, color: Colors.red)),
child: Icon( child: Icon(
Icons.mic, Icons.mic,
color: Colors.blue, color: Colors.blue,
@ -135,8 +120,7 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
? Center( ? Center(
child: InkWell( child: InkWell(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(border: Border.all(color: Colors.grey[300]!)),
border: Border.all(color: Colors.grey[300]!)),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: AppText( child: AppText(
'Try Again', 'Try Again',
@ -160,7 +144,23 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
@override @override
void dispose() { void dispose() {
super.dispose();
widget.dispose(); widget.dispose();
streamSubscription.cancel();
super.dispose();
}
void startStreamListener() {
streamSubscription = event.controller.stream.listen((p) {
if ((p['searchText'] != 'null' && p['searchText'] != null && p['searchText'] != "" && isClosed == false && mounted)) {
setState(() {
searchText = p['searchText'];
// SpeechToText.closeAlertDialog(context);
});
} else if (p['searchText'] == 'null' && mounted) {
setState(() {
searchText = p['searchText'];
});
}
});
} }
} }

Loading…
Cancel
Save