diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 2475931a..8ba9b615 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 50;
+ objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
@@ -210,7 +210,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1300;
+ LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
@@ -256,10 +256,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
+ "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
@@ -292,6 +294,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
+ alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -342,13 +345,10 @@
"${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework",
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
"${BUILT_PRODUCTS_DIR}/path_provider_ios/path_provider_ios.framework",
- "${BUILT_PRODUCTS_DIR}/shared_preferences_ios/shared_preferences_ios.framework",
+ "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework",
"${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework",
"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
"${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework",
- "${BUILT_PRODUCTS_DIR}/video_player_avfoundation/video_player_avfoundation.framework",
- "${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework",
- "${BUILT_PRODUCTS_DIR}/webview_flutter_wkwebview/webview_flutter_wkwebview.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
@@ -383,13 +383,10 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_ios.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_ios.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player_avfoundation.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter_wkwebview.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@@ -501,7 +498,10 @@
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
@@ -637,7 +637,10 @@
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
@@ -668,7 +671,10 @@
);
INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
- LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 31c95209..5fc389f9 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -67,5 +67,7 @@
CADisableMinimumFrameDurationOnPhone
+ UIApplicationSupportsIndirectInputEvents
+
diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart
index 2faae2c9..51a10e79 100644
--- a/lib/client/base_app_client.dart
+++ b/lib/client/base_app_client.dart
@@ -1,5 +1,3 @@
-//@dart=2.9
-
import 'dart:convert';
import 'dart:io' show Platform;
@@ -24,9 +22,9 @@ Utils helpers = new Utils();
class BaseAppClient {
//TODO change the post fun to nun static when you change all service
post(String endPoint,
- {Map body,
- Function(dynamic response, int statusCode) onSuccess,
- Function(String error, int statusCode) onFailure,
+ {Map? body,
+ required Function(dynamic response, int statusCode) onSuccess,
+ required Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isLiveCare = false,
bool isFallLanguage = false}) async {
@@ -38,24 +36,24 @@ class BaseAppClient {
bool callLog = true;
try {
- Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
+ Map? profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
- if (body['DoctorID'] == null) {
- body['DoctorID'] = doctorProfile?.doctorID;
+ if (body!['DoctorID'] == null) {
+ body['DoctorID'] = doctorProfile.doctorID;
}
if (body['DoctorID'] == "") body['DoctorID'] = null;
- if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile?.doctorID;
+ if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID;
if (body['ProjectID'] == null) {
- body['ProjectID'] = doctorProfile?.projectID;
+ body['ProjectID'] = doctorProfile.projectID;
}
- if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID;
+ if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile.clinicID;
} else {
- String doctorID = await sharedPref.getString(DOCTOR_ID);
- if (body['DoctorID'] == '') {
+ String? doctorID = await sharedPref.getString(DOCTOR_ID);
+ if (body!['DoctorID'] == '') {
body['DoctorID'] = null;
} else if (doctorID != null) body['DoctorID'] = int.parse(doctorID);
}
@@ -74,7 +72,7 @@ class BaseAppClient {
}
if (!isFallLanguage) {
- String lang = await sharedPref.getString(APP_Language);
+ String? lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;
else
@@ -167,12 +165,11 @@ class BaseAppClient {
}
}
-
postPatient(String endPoint,
- {Map body,
- Function(dynamic response, int statusCode) onSuccess,
- Function(String error, int statusCode) onFailure,
- @required PatiantInformtion patient,
+ {Map? body,
+ required Function(dynamic response, int statusCode) onSuccess,
+ required Function(String error, int statusCode) onFailure,
+ PatiantInformtion? patient,
bool isExternal = false}) async {
String url = BASE_URL + endPoint;
@@ -180,19 +177,19 @@ class BaseAppClient {
Map headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
String token = await sharedPref.getString(TOKEN);
- Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
+ Map? profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
- if (body['DoctorID'] == null) {
- body['DoctorID'] = doctorProfile?.doctorID;
+ if (body!['DoctorID'] == null) {
+ body['DoctorID'] = doctorProfile.doctorID;
}
}
- if (body['DoctorID'] == 0) {
+ if (body!['DoctorID'] == 0) {
body['DoctorID'] = null;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
- body['SetupID'] = body.containsKey('SetupID')
+ body['SetupID'] = body!.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: await sharedPref.getString(DOCTOR_SETUP_ID)
@@ -223,7 +220,7 @@ class BaseAppClient {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
? body['PatientType']
- : patient.patientType != null
+ : patient!.patientType != null
? patient.patientType
: PATIENT_TYPE
: PATIENT_TYPE;
@@ -231,13 +228,13 @@ class BaseAppClient {
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
- : patient.patientType != null
+ : patient!.patientType != null
? patient.patientType
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] ?? token : token;
- body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient.patientId ?? patient.patientMRN;
+ body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient!.patientId ?? patient.patientMRN;
body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it
body['SessionID'] = SESSION_ID; //getSe
@@ -347,11 +344,10 @@ class BaseAppClient {
}
return error;
}
- get({String endPoint,
- Function(dynamic response, int statusCode) onSuccess,
- Function(String error, int statusCode) onFailure}) async{
+
+ get({required String endPoint, required Function(dynamic response, int statusCode) onSuccess, required Function(String error, int statusCode) onFailure}) async {
String token = await sharedPref.getString(TOKEN);
- String url = DOCTOR_ROTATION + endPoint+'&token='+token;
+ String url = DOCTOR_ROTATION + endPoint + '&token=' + token;
final response = await http.get(Uri.parse(url));
final int statusCode = response.statusCode;
@@ -359,7 +355,7 @@ class BaseAppClient {
onFailure(Utils.generateContactAdminMsg(), statusCode);
} else {
var parsed = json.decode(response.body.toString());
- onSuccess(parsed,statusCode);
+ onSuccess(parsed, statusCode);
}
}
}
diff --git a/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart b/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart
index b0d56669..3016d2d3 100644
--- a/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart
+++ b/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart
@@ -1,8 +1,8 @@
class DoctorErSignAssessmentReqModel {
// String setupID;
- int signInType;
- int loginDoctorID;
- int patientID;
+ int? signInType;
+ int? loginDoctorID;
+ int? patientID;
DoctorErSignAssessmentReqModel(
{
diff --git a/lib/core/model/SOAP/assessment/post_assessment_request_model.dart b/lib/core/model/SOAP/assessment/post_assessment_request_model.dart
index c71ed174..28457018 100644
--- a/lib/core/model/SOAP/assessment/post_assessment_request_model.dart
+++ b/lib/core/model/SOAP/assessment/post_assessment_request_model.dart
@@ -1,29 +1,23 @@
class PostAssessmentRequestModel {
- int patientMRN;
- int appointmentNo;
- int episodeId;
- String createdByName;
- int createdBy;
- List icdCodeDetails;
+ int? patientMRN;
+ int? appointmentNo;
+ int? episodeId;
+ String? createdByName;
+ int? createdBy;
+ List? icdCodeDetails;
- PostAssessmentRequestModel(
- {this.patientMRN,
- this.appointmentNo,
- this.episodeId,
- this.createdByName,
- this.createdBy,
- this.icdCodeDetails});
+ PostAssessmentRequestModel({this.patientMRN, this.appointmentNo, this.episodeId, this.createdByName, this.createdBy, this.icdCodeDetails});
PostAssessmentRequestModel.fromJson(Map json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeID'];
createdByName = json['CreatedByName'];
- createdBy= json['CreatedBy'];
+ createdBy = json['CreatedBy'];
if (json['icdCodeDetails'] != null) {
- icdCodeDetails = new List();
+ icdCodeDetails = [];
json['icdCodeDetails'].forEach((v) {
- icdCodeDetails.add(new IcdCodeDetails.fromJson(v));
+ icdCodeDetails!.add(new IcdCodeDetails.fromJson(v));
});
}
}
@@ -36,26 +30,20 @@ class PostAssessmentRequestModel {
data['CreatedByName'] = this.createdByName;
data['CreatedBy'] = this.createdBy;
if (this.icdCodeDetails != null) {
- data['icdCodeDetails'] =
- this.icdCodeDetails.map((v) => v.toJson()).toList();
+ data['icdCodeDetails'] = this.icdCodeDetails!.map((v) => v.toJson()).toList();
}
return data;
}
}
class IcdCodeDetails {
- String icdcode10Id;
- int conditionId;
- int diagnosisTypeId;
- bool complexDiagnosis;
- String remarks;
+ String? icdcode10Id;
+ int? conditionId;
+ int? diagnosisTypeId;
+ bool? complexDiagnosis;
+ String? remarks;
- IcdCodeDetails(
- {this.icdcode10Id,
- this.conditionId,
- this.diagnosisTypeId,
- this.complexDiagnosis,
- this.remarks});
+ IcdCodeDetails({this.icdcode10Id, this.conditionId, this.diagnosisTypeId, this.complexDiagnosis, this.remarks});
IcdCodeDetails.fromJson(Map json) {
icdcode10Id = json['icdcode10Id'];
diff --git a/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart b/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart
index 64071736..b5bc7aa3 100644
--- a/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart
+++ b/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart
@@ -5,19 +5,10 @@ class PostProgressNoteRequestModel {
String? planNote;
dynamic doctorID;
dynamic editedBy;
- String createdByName;
- int createdBy;
+ String? createdByName;
+ int? createdBy;
- PostProgressNoteRequestModel(
- {this.appointmentNo,
- this.episodeId,
- this.patientMRN,
- this.planNote,
- this.doctorID,
- this.editedBy,
- this.createdByName,
- this.createdBy
- });
+ PostProgressNoteRequestModel({this.appointmentNo, this.episodeId, this.patientMRN, this.planNote, this.doctorID, this.editedBy, this.createdByName, this.createdBy});
PostProgressNoteRequestModel.fromJson(Map json) {
appointmentNo = json['AppointmentNo'];
diff --git a/lib/core/model/admissionRequest/admission-request.dart b/lib/core/model/admissionRequest/admission-request.dart
index dc78f7af..371bb110 100644
--- a/lib/core/model/admissionRequest/admission-request.dart
+++ b/lib/core/model/admissionRequest/admission-request.dart
@@ -1,46 +1,46 @@
class AdmissionRequest {
- int patientMRN;
- int admitToClinic;
- bool isPregnant;
- int pregnancyWeeks;
- int pregnancyType;
- int noOfBabies;
- int mrpDoctorID;
- String admissionDate;
- int expectedDays;
- int admissionType;
- int admissionLocationID;
- int roomCategoryID;
- int wardID;
- bool isSickLeaveRequired;
- String sickLeaveComments;
- bool isTransport;
- String transportComments;
- bool isPhysioAppointmentNeeded;
- String physioAppointmentComments;
- bool isOPDFollowupAppointmentNeeded;
- String opdFollowUpComments;
- bool isDietType;
- int dietType;
- String dietRemarks;
- String diagnosis;
- bool isPhysicalActivityModification;
- String physicalActivityModificationComments;
- int orStatus;
- String mainLineOfTreatment;
- int estimatedCost;
- String elementsForImprovement;
- bool isPackagePatient;
- String complications;
- String otherDepartmentInterventions;
- String otherProcedures;
- String pastMedicalHistory;
- String pastSurgicalHistory;
- List admissionRequestDiagnoses;
- List admissionRequestProcedures;
- int appointmentNo;
- int episodeID;
- int admissionRequestNo;
+ int? patientMRN;
+ int? admitToClinic;
+ bool? isPregnant;
+ int? pregnancyWeeks;
+ int? pregnancyType;
+ int? noOfBabies;
+ int? mrpDoctorID;
+ String? admissionDate;
+ int? expectedDays;
+ int? admissionType;
+ int? admissionLocationID;
+ int? roomCategoryID;
+ int? wardID;
+ bool? isSickLeaveRequired;
+ String? sickLeaveComments;
+ bool? isTransport;
+ String? transportComments;
+ bool? isPhysioAppointmentNeeded;
+ String? physioAppointmentComments;
+ bool? isOPDFollowupAppointmentNeeded;
+ String? opdFollowUpComments;
+ bool? isDietType;
+ int? dietType;
+ String? dietRemarks;
+ String? diagnosis;
+ bool? isPhysicalActivityModification;
+ String? physicalActivityModificationComments;
+ int? orStatus;
+ String? mainLineOfTreatment;
+ int? estimatedCost;
+ String? elementsForImprovement;
+ bool? isPackagePatient;
+ String? complications;
+ String? otherDepartmentinterventions;
+ String? otherProcedures;
+ String? pastMedicalHistory;
+ String? pastSurgicalHistory;
+ List? admissionRequestDiagnoses;
+ List? admissionRequestProcedures;
+ int? appointmentNo;
+ int? episodeID;
+ int? admissionRequestNo;
AdmissionRequest(
{this.patientMRN,
@@ -76,7 +76,7 @@ class AdmissionRequest {
this.elementsForImprovement,
this.isPackagePatient = false,
this.complications = "",
- this.otherDepartmentInterventions = "",
+ this.otherDepartmentinterventions = "",
this.otherProcedures = "",
this.pastMedicalHistory = "",
this.pastSurgicalHistory = "",
@@ -120,22 +120,22 @@ class AdmissionRequest {
elementsForImprovement = json['elementsForImprovement'];
isPackagePatient = json['isPackagePatient'];
complications = json['complications'];
- otherDepartmentInterventions = json['otherDepartmentInterventions'];
+ otherDepartmentinterventions = json['otherDepartmentInterventions'];
otherProcedures = json['otherProcedures'];
pastMedicalHistory = json['pastMedicalHistory'];
pastSurgicalHistory = json['pastSurgicalHistory'];
if (json['admissionRequestDiagnoses'] != null) {
- admissionRequestDiagnoses = new List();
+ admissionRequestDiagnoses = [];
json['admissionRequestDiagnoses'].forEach((v) {
- admissionRequestDiagnoses.add(v);
+ admissionRequestDiagnoses!.add(v);
// admissionRequestDiagnoses
// .add(new AdmissionRequestDiagnoses.fromJson(v));
});
}
if (json['admissionRequestProcedures'] != null) {
- admissionRequestProcedures = new List();
+ admissionRequestProcedures = [];
json['admissionRequestProcedures'].forEach((v) {
- admissionRequestProcedures.add(v);
+ admissionRequestProcedures!.add(v);
// admissionRequestProcedures
// .add(new AdmissionRequestProcedures.fromJson(v));
});
@@ -180,7 +180,7 @@ class AdmissionRequest {
data['elementsForImprovement'] = this.elementsForImprovement;
data['isPackagePatient'] = this.isPackagePatient;
data['complications'] = this.complications;
- data['otherDepartmentInterventions'] = this.otherDepartmentInterventions;
+ data['otherDepartmentInterventions'] = this.otherDepartmentinterventions;
data['otherProcedures'] = this.otherProcedures;
data['pastMedicalHistory'] = this.pastMedicalHistory;
data['pastSurgicalHistory'] = this.pastSurgicalHistory;
@@ -189,7 +189,7 @@ class AdmissionRequest {
// this.admissionRequestDiagnoses.map((v) => v.toJson()).toList();
}
if (this.admissionRequestProcedures != null) {
- data['admissionRequestProcedures'] = this.admissionRequestProcedures.map((v) => v.toJson()).toList();
+ data['admissionRequestProcedures'] = this.admissionRequestProcedures!.map((v) => v.toJson()).toList();
}
data['appointmentNo'] = this.appointmentNo;
data['episodeID'] = this.episodeID;
diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart
index 1bb10d1f..fa3a18b4 100644
--- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart
+++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart
@@ -1,79 +1,62 @@
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
class CheckActivationCodeForDoctorAppResponseModel {
- String authenticationTokenID;
- List listDoctorsClinic;
- List listDoctorProfile;
- MemberInformation memberInformation;
- String vidaAuthTokenID;
- String vidaRefreshTokenID;
-
- CheckActivationCodeForDoctorAppResponseModel(
- {this.authenticationTokenID,
- this.listDoctorsClinic,
- this.memberInformation,
- this.listDoctorProfile,
- this.vidaAuthTokenID,
- this.vidaRefreshTokenID});
-
- CheckActivationCodeForDoctorAppResponseModel.fromJson(
- Map json) {
+ String? authenticationTokenID;
+ List? listDoctorsClinic;
+ List? listDoctorProfile;
+ MemberInformation? memberInformation;
+ String? vidaAuthTokenID;
+ String? vidaRefreshTokenID;
+
+ CheckActivationCodeForDoctorAppResponseModel({this.authenticationTokenID, this.listDoctorsClinic, this.memberInformation, this.listDoctorProfile, this.vidaAuthTokenID, this.vidaRefreshTokenID});
+
+ CheckActivationCodeForDoctorAppResponseModel.fromJson(Map json) {
authenticationTokenID = json['AuthenticationTokenID'];
if (json['List_DoctorsClinic'] != null) {
- listDoctorsClinic = new List();
+ listDoctorsClinic = [];
json['List_DoctorsClinic'].forEach((v) {
- listDoctorsClinic.add(new ListDoctorsClinic.fromJson(v));
+ listDoctorsClinic!.add(new ListDoctorsClinic.fromJson(v));
});
}
if (json['List_DoctorProfile'] != null) {
- listDoctorProfile = new List();
+ listDoctorProfile = [];
json['List_DoctorProfile'].forEach((v) {
- listDoctorProfile.add(new DoctorProfileModel.fromJson(v));
+ listDoctorProfile!.add(new DoctorProfileModel.fromJson(v));
});
}
vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID'];
- memberInformation = json['memberInformation'] != null
- ? new MemberInformation.fromJson(json['memberInformation'])
- : null;
+ memberInformation = json['memberInformation'] != null ? new MemberInformation.fromJson(json['memberInformation']) : null;
}
Map toJson() {
final Map data = new Map();
data['AuthenticationTokenID'] = this.authenticationTokenID;
if (this.listDoctorsClinic != null) {
- data['List_DoctorsClinic'] =
- this.listDoctorsClinic.map((v) => v.toJson()).toList();
+ data['List_DoctorsClinic'] = this.listDoctorsClinic!.map((v) => v.toJson()).toList();
}
if (this.listDoctorProfile != null) {
- data['List_DoctorProfile'] =
- this.listDoctorProfile.map((v) => v.toJson()).toList();
+ data['List_DoctorProfile'] = this.listDoctorProfile!.map((v) => v.toJson()).toList();
}
if (this.memberInformation != null) {
- data['memberInformation'] = this.memberInformation.toJson();
+ data['memberInformation'] = this.memberInformation!.toJson();
}
return data;
}
}
class ListDoctorsClinic {
- String setupID;
- int projectID;
- int doctorID;
- int clinicID;
- bool isActive;
- String clinicName;
-
- ListDoctorsClinic(
- {this.setupID,
- this.projectID,
- this.doctorID,
- this.clinicID,
- this.isActive,
- this.clinicName});
+ String? setupID;
+ int? projectID;
+ int? doctorID;
+ int? clinicID;
+ bool? isActive;
+ String? clinicName;
+
+ ListDoctorsClinic({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName});
ListDoctorsClinic.fromJson(Map json) {
setupID = json['SetupID'];
@@ -97,32 +80,23 @@ class ListDoctorsClinic {
}
class MemberInformation {
- List clinics;
- int doctorId;
- String email;
- int employeeId;
- int memberId;
- Null memberName;
- Null memberNameArabic;
- String preferredLanguage;
- List roles;
-
- MemberInformation(
- {this.clinics,
- this.doctorId,
- this.email,
- this.employeeId,
- this.memberId,
- this.memberName,
- this.memberNameArabic,
- this.preferredLanguage,
- this.roles});
+ List? clinics;
+ int? doctorId;
+ String? email;
+ int? employeeId;
+ int? memberId;
+ dynamic memberName;
+ dynamic memberNameArabic;
+ String? preferredLanguage;
+ List? roles;
+
+ MemberInformation({this.clinics, this.doctorId, this.email, this.employeeId, this.memberId, this.memberName, this.memberNameArabic, this.preferredLanguage, this.roles});
MemberInformation.fromJson(Map json) {
if (json['clinics'] != null) {
- clinics = new List();
+ clinics = [];
json['clinics'].forEach((v) {
- clinics.add(new Clinics.fromJson(v));
+ clinics!.add(new Clinics.fromJson(v));
});
}
doctorId = json['doctorId'];
@@ -133,9 +107,9 @@ class MemberInformation {
memberNameArabic = json['memberNameArabic'];
preferredLanguage = json['preferredLanguage'];
if (json['roles'] != null) {
- roles = new List();
+ roles =[];
json['roles'].forEach((v) {
- roles.add(new Roles.fromJson(v));
+ roles!.add(new Roles.fromJson(v));
});
}
}
@@ -143,7 +117,7 @@ class MemberInformation {
Map toJson() {
final Map data = new Map();
if (this.clinics != null) {
- data['clinics'] = this.clinics.map((v) => v.toJson()).toList();
+ data['clinics'] = this.clinics!.map((v) => v.toJson()).toList();
}
data['doctorId'] = this.doctorId;
data['email'] = this.email;
@@ -153,16 +127,16 @@ class MemberInformation {
data['memberNameArabic'] = this.memberNameArabic;
data['preferredLanguage'] = this.preferredLanguage;
if (this.roles != null) {
- data['roles'] = this.roles.map((v) => v.toJson()).toList();
+ data['roles'] = this.roles!.map((v) => v.toJson()).toList();
}
return data;
}
}
class Clinics {
- bool defaultClinic;
- int id;
- String name;
+ bool? defaultClinic;
+ int? id;
+ String? name;
Clinics({this.defaultClinic, this.id, this.name});
@@ -182,8 +156,8 @@ class Clinics {
}
class Roles {
- String name;
- int roleId;
+ String? name;
+ int? roleId;
Roles({this.name, this.roleId});
diff --git a/lib/core/model/dashboard/doctor_schedule.dart b/lib/core/model/dashboard/doctor_schedule.dart
index ab8cf192..22bf324b 100644
--- a/lib/core/model/dashboard/doctor_schedule.dart
+++ b/lib/core/model/dashboard/doctor_schedule.dart
@@ -1,14 +1,15 @@
import 'dart:convert';
+
List doctorScheduleFromJson(String str) => List.from(json.decode(str).map((x) => DoctorSchedule.fromJson(x)));
String doctorScheduleToJson(List data) => json.encode(List.from(data.map((x) => x.toJson())));
class DoctorSchedule {
- int scheduledid;
- int status;
- String clinicname;
- int clinicid;
- List scheduleforuser;
+ int? scheduledid;
+ int? status;
+ String? clinicname;
+ int? clinicid;
+ List? scheduleforuser;
DoctorSchedule({
this.scheduledid,
@@ -19,26 +20,26 @@ class DoctorSchedule {
});
factory DoctorSchedule.fromJson(Map json) => DoctorSchedule(
- scheduledid: json["scheduledid"],
- status: json["status"],
- clinicname: json["clinicname"],
- clinicid: json["clinicid"],
- scheduleforuser: List.from(json["scheduleforuser"].map((x) => Scheduleforuser.fromJson(x))),
- );
+ scheduledid: json["scheduledid"],
+ status: json["status"],
+ clinicname: json["clinicname"],
+ clinicid: json["clinicid"],
+ scheduleforuser: List.from(json["scheduleforuser"].map((x) => Scheduleforuser.fromJson(x))),
+ );
Map toJson() => {
- "scheduledid": scheduledid,
- "status": status,
- "clinicname": clinicname,
- "clinicid": clinicid,
- "scheduleforuser": List.from(scheduleforuser.map((x) => x.toJson())),
- };
+ "scheduledid": scheduledid,
+ "status": status,
+ "clinicname": clinicname,
+ "clinicid": clinicid,
+ "scheduleforuser": List.from(scheduleforuser!.map((x) => x.toJson())),
+ };
}
class Scheduleforuser {
- DateTime days;
- int duration;
- List shiftforuser;
+ DateTime? days;
+ int? duration;
+ List? shiftforuser;
Scheduleforuser({
this.days,
@@ -47,21 +48,21 @@ class Scheduleforuser {
});
factory Scheduleforuser.fromJson(Map json) => Scheduleforuser(
- days: DateTime.parse(json["days"]),
- duration: json["duration"],
- shiftforuser: List.from(json["shiftforuser"].map((x) => Shiftforuser.fromJson(x))),
- );
+ days: DateTime.parse(json["days"]),
+ duration: json["duration"],
+ shiftforuser: List.from(json["shiftforuser"].map((x) => Shiftforuser.fromJson(x))),
+ );
Map toJson() => {
- "days": days.toIso8601String(),
- "duration": duration,
- "shiftforuser": List.from(shiftforuser.map((x) => x.toJson())),
- };
+ "days": days!.toIso8601String(),
+ "duration": duration,
+ "shiftforuser": List.from(shiftforuser!.map((x) => x.toJson())),
+ };
}
class Shiftforuser {
- int fromtime;
- int totime;
+ int? fromtime;
+ int? totime;
Shiftforuser({
this.fromtime,
@@ -69,12 +70,12 @@ class Shiftforuser {
});
factory Shiftforuser.fromJson(Map json) => Shiftforuser(
- fromtime: json["fromtime"],
- totime: json["totime"],
- );
+ fromtime: json["fromtime"],
+ totime: json["totime"],
+ );
Map toJson() => {
- "fromtime": fromtime,
- "totime": totime,
- };
+ "fromtime": fromtime,
+ "totime": totime,
+ };
}
diff --git a/lib/core/model/doctor/clinic_model.dart b/lib/core/model/doctor/clinic_model.dart
index 4ea7636c..319a925d 100644
--- a/lib/core/model/doctor/clinic_model.dart
+++ b/lib/core/model/doctor/clinic_model.dart
@@ -1,25 +1,12 @@
-/*
- *@author: Elham Rababah
- *@Date:17/5/2020
- *@param:
- *@return:
- *@desc: Clinic Model
- */
class ClinicModel {
- String setupID;
- int projectID;
- int doctorID;
- int clinicID;
- bool isActive;
- String clinicName;
+ String? setupID;
+ int? projectID;
+ int? doctorID;
+ int? clinicID;
+ bool? isActive;
+ String? clinicName;
- ClinicModel(
- {this.setupID,
- this.projectID,
- this.doctorID,
- this.clinicID,
- this.isActive,
- this.clinicName});
+ ClinicModel({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName});
ClinicModel.fromJson(Map json) {
setupID = json['SetupID'];
diff --git a/lib/core/model/hospitals/VidaPlusProjectListModel.dart b/lib/core/model/hospitals/VidaPlusProjectListModel.dart
index e56b82db..75978110 100644
--- a/lib/core/model/hospitals/VidaPlusProjectListModel.dart
+++ b/lib/core/model/hospitals/VidaPlusProjectListModel.dart
@@ -1,5 +1,5 @@
class VidaPlusProjectListModel {
- int projectID;
+ int? projectID;
VidaPlusProjectListModel({this.projectID});
diff --git a/lib/core/model/hospitals/get_hospitals_request_model.dart b/lib/core/model/hospitals/get_hospitals_request_model.dart
index 03485aa2..fb78cb51 100644
--- a/lib/core/model/hospitals/get_hospitals_request_model.dart
+++ b/lib/core/model/hospitals/get_hospitals_request_model.dart
@@ -1,27 +1,27 @@
class GetHospitalsRequestModel {
- int languageID;
- String stamp;
- String iPAdress;
- double versionID;
- int channel;
- String tokenID;
- String sessionID;
- bool isLoginForDoctorApp;
- String memberID;
- String doctorID;
+ int? languageID;
+ String? stamp;
+ String? iPAdress;
+ double? versionID;
+ int? channel;
+ String? tokenID;
+ String? sessionID;
+ bool? isLoginForDoctorApp;
+ String? memberID;
+ String? doctorID;
- GetHospitalsRequestModel(
- {this.languageID,
- this.stamp,
- this.iPAdress,
- this.versionID,
- this.channel,
- this.tokenID,
- this.sessionID,
- this.isLoginForDoctorApp,
- this.memberID,
- this.doctorID,
- });
+ GetHospitalsRequestModel({
+ this.languageID,
+ this.stamp,
+ this.iPAdress,
+ this.versionID,
+ this.channel,
+ this.tokenID,
+ this.sessionID,
+ this.isLoginForDoctorApp,
+ this.memberID,
+ this.doctorID,
+ });
GetHospitalsRequestModel.fromJson(Map json) {
languageID = json['LanguageID'];
diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart
index d4d621b0..16f1ebd7 100644
--- a/lib/core/model/labs/patient_lab_orders.dart
+++ b/lib/core/model/labs/patient_lab_orders.dart
@@ -1,42 +1,42 @@
import 'package:doctor_app_flutter/utils/date-utils.dart';
class PatientLabOrders {
- int actualDoctorRate;
- String clinicDescription;
- String clinicDescriptionEnglish;
- Null clinicDescriptionN;
- int clinicID;
- int doctorID;
- String doctorImageURL;
- String doctorName;
- String doctorNameEnglish;
- Null doctorNameN;
- int doctorRate;
- String doctorTitle;
- int gender;
- String genderDescription;
- String invoiceNo;
- bool isActiveDoctorProfile;
- bool isDoctorAllowVedioCall;
- bool isExecludeDoctor;
- bool isInOutPatient;
- String isInOutPatientDescription;
- String isInOutPatientDescriptionN;
- bool isRead;
- String nationalityFlagURL;
- int noOfPatientsRate;
- DateTime orderDate;
- DateTime createdOn;
- String orderNo;
- String patientID;
- String projectID;
- String projectName;
- Null projectNameN;
- String qR;
- String setupID;
- List speciality;
- bool isLiveCareAppointment;
- String invoiceType;
+ int? actualDoctorRate;
+ String? clinicDescription;
+ String? clinicDescriptionEnglish;
+ dynamic clinicDescriptionN;
+ int? clinicID;
+ int? doctorID;
+ String? doctorImageURL;
+ String? doctorName;
+ String? doctorNameEnglish;
+ dynamic doctorNameN;
+ int? doctorRate;
+ String? doctorTitle;
+ int? gender;
+ String? genderDescription;
+ String? invoiceNo;
+ bool? isActiveDoctorProfile;
+ bool? isDoctorAllowVedioCall;
+ bool? isExecludeDoctor;
+ bool? isInOutPatient;
+ String? isInOutPatientDescription;
+ String? isInOutPatientDescriptionN;
+ bool? isRead;
+ String? nationalityFlagURL;
+ int? noOfPatientsRate;
+ DateTime? orderDate;
+ DateTime? createdOn;
+ String? orderNo;
+ String? patientID;
+ String? projectID;
+ String? projectName;
+ dynamic projectNameN;
+ String? qR;
+ String? setupID;
+ List? speciality;
+ bool? isLiveCareAppointment;
+ String? invoiceType;
PatientLabOrders(
{this.actualDoctorRate,
this.clinicDescription,
@@ -72,8 +72,7 @@ class PatientLabOrders {
this.setupID,
this.speciality,
this.isLiveCareAppointment,
- this.invoiceType
- });
+ this.invoiceType});
PatientLabOrders.fromJson(Map json) {
actualDoctorRate = json['ActualDoctorRate'];
@@ -157,10 +156,9 @@ class PatientLabOrders {
class PatientLabOrdersList {
String filterName = "";
- List patientLabOrdersList = List();
+ List patientLabOrdersList = [];
- PatientLabOrdersList(
- {this.filterName, PatientLabOrders patientDoctorAppointment}) {
+ PatientLabOrdersList({required this.filterName, required PatientLabOrders patientDoctorAppointment}) {
patientLabOrdersList.add(patientDoctorAppointment);
}
}
diff --git a/lib/core/model/patient/get_doctor_by_clinic_id_request.dart b/lib/core/model/patient/get_doctor_by_clinic_id_request.dart
index 2dff34a5..3853ad7a 100644
--- a/lib/core/model/patient/get_doctor_by_clinic_id_request.dart
+++ b/lib/core/model/patient/get_doctor_by_clinic_id_request.dart
@@ -1,17 +1,17 @@
class DoctorsByClinicIdRequest {
- int clinicID;
- int projectID;
- bool continueDentalPlan;
- bool isSearchAppointmnetByClinicID;
- int patientID;
- int doctorID;
- int gender;
- bool isGetNearAppointment;
- bool isVoiceCommand;
- int latitude;
- int longitude;
- bool license;
- bool isDentalAllowedBackend;
+ int? clinicID;
+ int? projectID;
+ bool? continueDentalPlan;
+ bool? isSearchAppointmnetByClinicID;
+ int? patientID;
+ int? doctorID;
+ int? gender;
+ bool? isGetNearAppointment;
+ bool? isVoiceCommand;
+ int? latitude;
+ int? longitude;
+ bool? license;
+ bool? isDentalAllowedBackend;
DoctorsByClinicIdRequest({
this.clinicID,
diff --git a/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart b/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart
index 25104d07..708fa77f 100644
--- a/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart
+++ b/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart
@@ -1,33 +1,33 @@
class VitalSignData {
- int appointmentNo;
- int bloodPressureCuffLocation;
- int bloodPressureCuffSize;
- int bloodPressureHigher;
- int bloodPressureLower;
- int bloodPressurePatientPosition;
+ int? appointmentNo;
+ int? bloodPressureCuffLocation;
+ int? bloodPressureCuffSize;
+ int? bloodPressureHigher;
+ int? bloodPressureLower;
+ int? bloodPressurePatientPosition;
var bodyMassIndex;
- int fio2;
- int headCircumCm;
+ int? fio2;
+ int? headCircumCm;
var heightCm;
- int idealBodyWeightLbs;
- bool isPainManagementDone;
- bool isVitalsRequired;
- int leanBodyWeightLbs;
- String painCharacter;
- String painDuration;
- String painFrequency;
- String painLocation;
- int painScore;
- int patientMRN;
- int patientType;
- int pulseBeatPerMinute;
- int pulseRhythm;
- num respirationBeatPerMinute;
- int respirationPattern;
- int sao2;
- int status;
+ int? idealBodyWeightLbs;
+ bool? isPainManagementDone;
+ bool? isVitalsRequired;
+ int? leanBodyWeightLbs;
+ String? painCharacter;
+ String? painDuration;
+ String? painFrequency;
+ String? painLocation;
+ int? painScore;
+ int? patientMRN;
+ int? patientType;
+ int? pulseBeatPerMinute;
+ int? pulseRhythm;
+ dynamic respirationBeatPerMinute;
+ int? respirationPattern;
+ int? sao2;
+ int? status;
var temperatureCelcius;
- int temperatureCelciusMethod;
+ int? temperatureCelciusMethod;
var waistSizeInch;
var weightKg;
diff --git a/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart
index e753ad62..cec79b1d 100644
--- a/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart
+++ b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart
@@ -1,21 +1,21 @@
class InterventionMedicationHistoryResModel {
- String setupId;
- String projectId;
- int patientId;
- int admissionNo;
- int prescriptionId;
- int orderNo;
- int id;
- int interventionId;
+ String? setupId;
+ String? projectId;
+ int? patientId;
+ int? admissionNo;
+ int? prescriptionId;
+ int? orderNo;
+ int? id;
+ int? interventionId;
dynamic intervention;
- String remark;
- int commentedBy;
- bool isDoctor;
- bool isActive;
- int createdBy;
- String createdByName;
- String createdByNameN;
- String createdOn;
+ String? remark;
+ int? commentedBy;
+ bool? isDoctor;
+ bool? isActive;
+ int? createdBy;
+ String? createdByName;
+ String? createdByNameN;
+ String? createdOn;
dynamic editedBy;
dynamic editedByName;
dynamic editedByNameN;
@@ -23,26 +23,26 @@ class InterventionMedicationHistoryResModel {
InterventionMedicationHistoryResModel(
{this.setupId,
- this.projectId,
- this.patientId,
- this.admissionNo,
- this.prescriptionId,
- this.orderNo,
- this.id,
- this.interventionId,
- this.intervention,
- this.remark,
- this.commentedBy,
- this.isDoctor,
- this.isActive,
- this.createdBy,
- this.createdByName,
- this.createdByNameN,
- this.createdOn,
- this.editedBy,
- this.editedByName,
- this.editedByNameN,
- this.editedOn});
+ this.projectId,
+ this.patientId,
+ this.admissionNo,
+ this.prescriptionId,
+ this.orderNo,
+ this.id,
+ this.interventionId,
+ this.intervention,
+ this.remark,
+ this.commentedBy,
+ this.isDoctor,
+ this.isActive,
+ this.createdBy,
+ this.createdByName,
+ this.createdByNameN,
+ this.createdOn,
+ this.editedBy,
+ this.editedByName,
+ this.editedByNameN,
+ this.editedOn});
InterventionMedicationHistoryResModel.fromJson(Map json) {
setupId = json['SetupId'];
@@ -93,4 +93,4 @@ class InterventionMedicationHistoryResModel {
data['EditedOn'] = this.editedOn;
return data;
}
-}
\ No newline at end of file
+}
diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart
index f5fae7c6..7149ff2f 100644
--- a/lib/core/model/radiology/final_radiology.dart
+++ b/lib/core/model/radiology/final_radiology.dart
@@ -9,17 +9,17 @@ class FinalRadiology {
dynamic invoiceNo_VP;
dynamic doctorID;
dynamic clinicID;
- DateTime orderDate;
- DateTime reportDate;
+ DateTime? orderDate;
+ DateTime? reportDate;
dynamic reportData;
dynamic imageURL;
dynamic procedureID;
dynamic appodynamicmentNo;
dynamic dIAPacsURL;
- bool isRead;
+ bool? isRead;
dynamic readOn;
var admissionNo;
- bool isInOutPatient;
+ bool? isInOutPatient;
dynamic actualDoctorRate;
dynamic clinicDescription;
dynamic dIAPACSURL;
@@ -29,8 +29,8 @@ class FinalRadiology {
dynamic doctorTitle;
dynamic gender;
dynamic genderDescription;
- bool isActiveDoctorProfile;
- bool isExecludeDoctor;
+ bool? isActiveDoctorProfile;
+ bool? isExecludeDoctor;
dynamic isInOutPatientDescription;
dynamic isInOutPatientDescriptionN;
dynamic nationalityFlagURL;
@@ -40,12 +40,13 @@ class FinalRadiology {
dynamic qR;
dynamic reportDataHTML;
dynamic reportDataTextdynamic;
- List speciality;
- bool isCVI;
- bool isRadMedicalReport;
- bool isLiveCareAppodynamicment;
- bool isRecordFromVidaPlus;
- String invoiceType;
+ List? speciality;
+ bool? isCVI;
+ bool? isRadMedicalReport;
+ bool? isLiveCareAppodynamicment;
+ bool? isRecordFromVidaPlus;
+ String? invoiceType;
+
FinalRadiology(
{this.setupID,
this.projectID,
@@ -89,7 +90,9 @@ class FinalRadiology {
this.speciality,
this.isCVI,
this.isRadMedicalReport,
- this.isLiveCareAppodynamicment, this.isRecordFromVidaPlus, this.invoiceType});
+ this.isLiveCareAppodynamicment,
+ this.isRecordFromVidaPlus,
+ this.invoiceType});
FinalRadiology.fromJson(Map json) {
try {
@@ -187,16 +190,16 @@ class FinalRadiology {
data['isCVI'] = this.isCVI;
data['isRadMedicalReport'] = this.isRadMedicalReport;
data['IsRecordFromVidaPlus'] = this.isRecordFromVidaPlus;
- data["InvoiceType"] =invoiceType;
+ data["InvoiceType"] = invoiceType;
return data;
}
}
class FinalRadiologyList {
dynamic filterName = "";
- List finalRadiologyList = List();
+ List finalRadiologyList = [];
- FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) {
+ FinalRadiologyList({this.filterName, required FinalRadiology finalRadiology}) {
finalRadiologyList.add(finalRadiology);
}
}
diff --git a/lib/core/service/AnalyticsService.dart b/lib/core/service/AnalyticsService.dart
index b2290299..9ff219bc 100644
--- a/lib/core/service/AnalyticsService.dart
+++ b/lib/core/service/AnalyticsService.dart
@@ -1,6 +1,4 @@
import 'package:firebase_analytics/firebase_analytics.dart';
-import 'package:firebase_analytics/observer.dart';
-import 'package:flutter/cupertino.dart';
class AnalyticsService {
// final FirebaseAnalytics _analytics = FirebaseAnalytics();
@@ -8,7 +6,7 @@ class AnalyticsService {
static FirebaseAnalytics analytics = FirebaseAnalytics.instance;
FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: analytics);
- Future logEvent({@required String eventCategory, @required String eventAction}) async {
+ Future logEvent({required String eventCategory, required String eventAction}) async {
await analytics.logEvent(name: 'event', parameters: {
"eventCategory": eventCategory,
"eventAction": eventAction,
diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart
index 0aa770ca..666b5ce1 100644
--- a/lib/core/service/VideoCallService.dart
+++ b/lib/core/service/VideoCallService.dart
@@ -1,12 +1,12 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
-import 'package:doctor_app_flutter/core/service/base/base_service.dart';
-import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart';
import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart';
import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
+import 'package:doctor_app_flutter/core/service/base/base_service.dart';
+import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/video_channel_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
@@ -17,40 +17,29 @@ import '../../routes.dart';
import 'NavigationService.dart';
class VideoCallService extends BaseService {
- StartCallRes startCallRes;
- PatiantInformtion patient;
- LiveCarePatientServices _liveCarePatientServices =
- locator();
+ late StartCallRes startCallRes;
+ late PatiantInformtion patient;
+ LiveCarePatientServices _liveCarePatientServices = locator();
- openVideo(
- StartCallRes startModel,
- PatiantInformtion patientModel,
- bool isRecording,
- VoidCallback onCallConnected,
- VoidCallback onCallDisconnected) async {
+ openVideo(StartCallRes startModel, PatiantInformtion patientModel, bool isRecording, VoidCallback onCallConnected, VoidCallback onCallDisconnected) async {
this.startCallRes = startModel;
this.patient = patientModel;
- DoctorProfileModel doctorProfile =
- await getDoctorProfile(isGetProfile: true);
+ DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true);
await VideoChannel.openVideoCallScreen(
// TODO MOSA TEST
kApiKey: '46209962',
-
kToken: startCallRes.openTokenID,
kSessionId: startCallRes.openSessionID,
//
// kToken: "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9NzE0MGE4YzM0ZTU2YjQ5NmQzOTgwOTNkYmU1NzEzMmQxYTdkMDliZTpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTVNakkxTkRjMU1EUTRObjVCVFZsM2MwODFNV1ZhTjFsUlEyZGxiRFZxZVZjNWNHMS1mbjQmY3JlYXRlX3RpbWU9MTY5MjI1NDc1MCZub25jZT0wLjY5OTQyNzkzMTg1NDg4NSZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjkyMjU2NTUwJmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
// kSessionId: "1_MX40NjIwOTk2Mn5-MTY5MjI1NDc1MDQ4Nn5BTVl3c081MWVaN1lRQ2dlbDVqeVc5cG1-fn4",
- vcId: patient.vcId,
+ vcId: patient.vcId!,
isRecording: isRecording,
- patientName: patient.fullName ??
- (patient.firstName != null
- ? "${patient.firstName} ${patient.lastName}"
- : "-"),
+ patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
tokenID: await sharedPref.getString(TOKEN),
generalId: GENERAL_ID,
- doctorId: doctorProfile.doctorID,
+ doctorId: doctorProfile.doctorID!,
onFailure: (String error) {
DrAppToastMsg.showErrorToast(error);
},
@@ -58,19 +47,16 @@ class VideoCallService extends BaseService {
onCallDisconnected: onCallDisconnected,
onCallEnd: () {
WidgetsBinding.instance.addPostFrameCallback((_) async {
- GifLoaderDialogUtils.showMyDialog(
- locator().navigatorKey.currentContext);
+ GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext!);
endCall(
- patient.vcId,
+ patient.vcId!,
false,
).then((value) {
- GifLoaderDialogUtils.hideDialog(
- locator().navigatorKey.currentContext);
+ GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext!);
if (hasError) {
DrAppToastMsg.showErrorToast(error);
} else
- locator()
- .navigateTo(PATIENTS_END_Call, arguments: {
+ locator().navigateTo(PATIENTS_END_Call, arguments: {
"patient": patient,
});
});
@@ -78,19 +64,16 @@ class VideoCallService extends BaseService {
},
onCallNotRespond: (SessionStatusModel sessionStatusModel) {
WidgetsBinding.instance.addPostFrameCallback((_) {
- GifLoaderDialogUtils.showMyDialog(
- locator().navigatorKey.currentContext);
+ GifLoaderDialogUtils.showMyDialog(locator().navigatorKey.currentContext!);
endCall(
- patient.vcId,
+ patient.vcId!,
sessionStatusModel.sessionStatus == 3,
).then((value) {
- GifLoaderDialogUtils.hideDialog(
- locator().navigatorKey.currentContext);
+ GifLoaderDialogUtils.hideDialog(locator().navigatorKey.currentContext!);
if (hasError) {
DrAppToastMsg.showErrorToast(error);
} else {
- locator()
- .navigateTo(PATIENTS_END_Call, arguments: {
+ locator().navigateTo(PATIENTS_END_Call, arguments: {
"patient": patient,
});
}
@@ -103,7 +86,7 @@ class VideoCallService extends BaseService {
hasError = false;
await getDoctorProfile(isGetProfile: true);
EndCallReq endCallReq = new EndCallReq();
- endCallReq.doctorId = doctorProfile.doctorID;
+ endCallReq.doctorId = doctorProfile!.doctorID;
endCallReq.generalid = 'Cs2020@2016\$2958';
endCallReq.vCID = vCID;
endCallReq.isDestroy = isPatient;
diff --git a/lib/core/service/authentication_service.dart b/lib/core/service/authentication_service.dart
index b25dbcc6..9538c3d9 100644
--- a/lib/core/service/authentication_service.dart
+++ b/lib/core/service/authentication_service.dart
@@ -48,7 +48,7 @@ class AuthenticationService extends BaseService {
}, body: {"IMEI": imei});
} catch (error) {
hasError = true;
- super.error = error;
+ super.error = error.toString();
}
}
@@ -64,7 +64,7 @@ class AuthenticationService extends BaseService {
}, body: userInfo.toJson());
} catch (error) {
hasError = true;
- super.error = error;
+ super.error = error.toString();
}
}
@@ -80,7 +80,7 @@ class AuthenticationService extends BaseService {
}, body: activationCodeModel.toJson());
} catch (error) {
hasError = true;
- super.error = error;
+ super.error = error.toString();
}
}
@@ -96,7 +96,7 @@ class AuthenticationService extends BaseService {
}, body: activationCodeModel.toJson());
} catch (error) {
hasError = true;
- super.error = error;
+ super.error = error.toString();
}
}
@@ -112,7 +112,7 @@ class AuthenticationService extends BaseService {
}, body: checkActivationCodeRequestModel.toJson());
} catch (error) {
hasError = true;
- super.error = error;
+ super.error = error.toString();
}
}
@@ -128,7 +128,7 @@ class AuthenticationService extends BaseService {
}, body: insertIMEIDetailsModel.toJson());
} catch (error) {
hasError = true;
- super.error = error;
+ super.error = error.toString();
}
}
@@ -146,7 +146,7 @@ class AuthenticationService extends BaseService {
}, body: profileReqModel.toJson());
} catch (error) {
hasError = true;
- super.error = error;
+ super.error = error.toString();
}
}
}
diff --git a/lib/core/service/hospitals/hospitals_service.dart b/lib/core/service/hospitals/hospitals_service.dart
index 09e5a365..c3bac631 100644
--- a/lib/core/service/hospitals/hospitals_service.dart
+++ b/lib/core/service/hospitals/hospitals_service.dart
@@ -5,8 +5,8 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class HospitalsService extends BaseService {
- List hospitals = List();
- List vidaPlusProjectListModel = List();
+ List hospitals = [];
+ List vidaPlusProjectListModel = [];
Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async {
hasError = false;
diff --git a/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart b/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart
index 4d953350..1294d44f 100644
--- a/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart
+++ b/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart
@@ -1,46 +1,13 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.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/Assessment/get_assessment_res_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/item_by_medicine_request_model.dart';
-import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart';
-import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
-import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_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/utils/date-utils.dart';
-import 'package:flutter/cupertino.dart';
class ERSignInService extends LookupService {
-
-
- Future signInERPatient({DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async {
+ Future signInERPatient({required DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async {
hasError = false;
- await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT,
- onSuccess: (dynamic response, int statusCode) {
-
- }, onFailure: (String error, int statusCode) {
+ await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: doctorErSignAssessmentReqModel.toJson());
}
-
}
diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart
index 0e0e99c0..cd113840 100644
--- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart
+++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart
@@ -1,9 +1,9 @@
import 'package:doctor_app_flutter/config/config.dart';
-import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart';
-import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart';
import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart';
import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_request.dart';
+import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
+import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
import 'package:doctor_app_flutter/core/model/labs/request_patient_lab_special_result.dart';
@@ -13,22 +13,20 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import '../../base/base_service.dart';
class LabsService extends BaseService {
- List patientLabOrdersList = List();
- List _allSpecialLab = List();
+ List patientLabOrdersList = [];
+ List _allSpecialLab = [];
List get allSpecialLab => _allSpecialLab;
- AllSpecialLabResultRequestModel _allSpecialLabResultRequestModel =
- AllSpecialLabResultRequestModel();
+ AllSpecialLabResultRequestModel _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel();
- Future getPatientLabOrdersList(
- PatiantInformtion patient, bool isInpatient) async {
+ Future getPatientLabOrdersList(PatiantInformtion patient, bool isInpatient) async {
hasError = false;
Map body = Map();
String url = "";
if (isInpatient) {
await getDoctorProfile();
- body['ProjectID'] = doctorProfile.projectID;
+ body['ProjectID'] = doctorProfile?.projectID;
url = GET_PATIENT_LAB_OREDERS;
} else {
body['isDentalAllowedBackend'] = false;
@@ -36,8 +34,7 @@ class LabsService extends BaseService {
}
patientLabOrdersList = [];
patientLabOrdersList.clear();
- await baseAppClient.postPatient(url, patient: patient,
- onSuccess: (dynamic response, int statusCode) {
+ await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) {
patientLabOrdersList = [];
if (!isInpatient) {
response['ListPLO'].forEach((hospital) {
@@ -55,21 +52,14 @@ class LabsService extends BaseService {
}, body: body);
}
- RequestPatientLabSpecialResult _requestPatientLabSpecialResult =
- RequestPatientLabSpecialResult();
-
- List patientLabSpecialResult = List();
- List labResultList = List();
- List labOrdersResultsList = List();
- List labOrdersResultHistoryList = List();
-
- Future getLaboratoryResult(
- {String projectID,
- int clinicID,
- String invoiceNo,
- String orderNo,
- PatiantInformtion patient,
- bool isInpatient = false}) async {
+ RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult();
+
+ List patientLabSpecialResult = [];
+ List labResultList = [];
+ List labOrdersResultsList = [];
+ List labOrdersResultHistoryList = [];
+
+ Future getLaboratoryResult({String? projectID, int? clinicID, String? invoiceNo, String? orderNo, required PatiantInformtion patient, bool isInpatient = false}) async {
hasError = false;
Map body = Map();
@@ -79,8 +69,7 @@ class LabsService extends BaseService {
_requestPatientLabSpecialResult.orderNo = orderNo;
body = _requestPatientLabSpecialResult.toJson();
- await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT,
- patient: patient, onSuccess: (dynamic response, int statusCode) {
+ await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient, onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear();
response['ListPLSR'].forEach((hospital) {
@@ -92,10 +81,7 @@ class LabsService extends BaseService {
}, body: body);
}
- Future getPatientLabResult(
- {PatientLabOrders patientLabOrder,
- PatiantInformtion patient,
- bool isInpatient}) async {
+ Future getPatientLabResult({required PatientLabOrders patientLabOrder, required PatiantInformtion patient, bool isInpatient = false}) async {
hasError = false;
String url = "";
@@ -112,9 +98,8 @@ class LabsService extends BaseService {
body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID ?? 0;
- body['InvoiceType'] = patientLabOrder.invoiceType ??"";
- await baseAppClient.postPatient(url, patient: patient,
- onSuccess: (dynamic response, int statusCode) {
+ body['InvoiceType'] = patientLabOrder.invoiceType ?? "";
+ await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult = [];
labResultList = [];
@@ -123,8 +108,7 @@ class LabsService extends BaseService {
labResultList.add(LabResult.fromJson(hospital));
});
response['List_GetLabSpecial'].forEach((hospital) {
- patientLabSpecialResult
- .add(PatientLabSpecialResult.fromJson(hospital));
+ patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital));
});
} else {
response['ListPLR'].forEach((lab) {
@@ -137,10 +121,7 @@ class LabsService extends BaseService {
}, body: body);
}
- Future getPatientLabOrdersResults(
- {PatientLabOrders patientLabOrder,
- String procedure,
- PatiantInformtion patient}) async {
+ Future getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, required String procedure, required PatiantInformtion patient}) async {
hasError = false;
Map body = Map();
if (patientLabOrder != null) {
@@ -152,8 +133,7 @@ class LabsService extends BaseService {
}
body['isDentalAllowedBackend'] = false;
body['Procedure'] = procedure;
- await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT,
- patient: patient, onSuccess: (dynamic response, int statusCode) {
+ await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, patient: patient, onSuccess: (dynamic response, int statusCode) {
labOrdersResultsList.clear();
response['ListPLR'].forEach((lab) {
labOrdersResultsList.add(LabOrderResult.fromJson(lab));
@@ -164,10 +144,9 @@ class LabsService extends BaseService {
}, body: body);
}
- RequestSendLabReportEmail _requestSendLabReportEmail =
- RequestSendLabReportEmail();
+ RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail();
- Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async {
+ Future sendLabReportEmail({required PatientLabOrders patientLabOrder}) async {
// _requestSendLabReportEmail.projectID = patientLabOrder.projectID;
// _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo;
// _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
@@ -191,10 +170,7 @@ class LabsService extends BaseService {
// }, body: _requestSendLabReportEmail.toJson());
}
- Future getPatientLabOrdersResultHistoryByDescription(
- {PatientLabOrders patientLabOrder,
- String procedureDescription,
- PatiantInformtion patient}) async {
+ Future getPatientLabOrdersResultHistoryByDescription({PatientLabOrders? patientLabOrder, String? procedureDescription, required PatiantInformtion patient}) async {
hasError = false;
Map body = Map();
if (patientLabOrder != null) {
@@ -204,9 +180,7 @@ class LabsService extends BaseService {
}
body['isDentalAllowedBackend'] = false;
body['ProcedureDescription'] = procedureDescription;
- await baseAppClient.postPatient(
- GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION,
- patient: patient, onSuccess: (dynamic response, int statusCode) {
+ await baseAppClient.postPatient(GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, patient: patient, onSuccess: (dynamic response, int statusCode) {
labOrdersResultHistoryList.clear();
response['ListGeneralResultHistory'].forEach((lab) {
labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab));
@@ -217,7 +191,7 @@ class LabsService extends BaseService {
}, body: body);
}
- Future getAllSpecialLabResult({int mrn}) async {
+ Future getAllSpecialLabResult({required int mrn}) async {
_allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel(
patientID: mrn,
patientType: 1,
@@ -225,12 +199,10 @@ class LabsService extends BaseService {
);
hasError = false;
_allSpecialLab.clear();
- await baseAppClient.post(ALL_SPECIAL_LAB_RESULT,
- onSuccess: (dynamic response, int statusCode) {
+ await baseAppClient.post(ALL_SPECIAL_LAB_RESULT, onSuccess: (dynamic response, int statusCode) {
response['ListPLSRALL'].forEach((lab) {
var labs = AllSpecialLabResultModel.fromJson(lab);
- if (labs.invoiceNo != "0")
- _allSpecialLab.add(AllSpecialLabResultModel.fromJson(lab));
+ if (labs.invoiceNo != "0") _allSpecialLab.add(AllSpecialLabResultModel.fromJson(lab));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart
index 1dca2462..bca644dc 100644
--- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart
+++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart
@@ -1,16 +1,15 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
-import 'package:flutter/cupertino.dart';
import '../../base/base_service.dart';
class RadiologyService extends BaseService {
- List finalRadiologyList = List();
+ List finalRadiologyList = [];
String url = '';
bool isRadiologyVIDAPlus = false;
- Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient,String invoiceType}) async {
+ Future getRadImageURL({required invoiceNo, required int lineItem, required int projectId, bool isVidaPlus = false, required PatiantInformtion patient, String? invoiceType}) async {
hasError = false;
final Map body = new Map();
body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo;
diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart
index 8f148f21..6572f24c 100644
--- a/lib/core/service/pending_order_service.dart
+++ b/lib/core/service/pending_order_service.dart
@@ -1,33 +1,29 @@
import 'package:doctor_app_flutter/config/config.dart';
-import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_model.dart';
import 'package:doctor_app_flutter/core/model/admisson_orders/admission_orders_request_model.dart';
import 'package:doctor_app_flutter/core/model/pending_orders/pending_order_request_model.dart';
import 'package:doctor_app_flutter/core/model/pending_orders/pending_orders_model.dart';
+import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class PendingOrderService extends BaseService {
- List _pendingOrderList = List();
+ List _pendingOrderList = [];
List get pendingOrderList => _pendingOrderList;
- List _admissionOrderList = List();
+ List _admissionOrderList = [];
List get admissionOrderList => _admissionOrderList;
- Future getPendingOrders(
- {PendingOrderRequestModel pendingOrderRequestModel,
- int patientId,
- int admissionNo}) async {
+ Future getPendingOrders({PendingOrderRequestModel? pendingOrderRequestModel, int? patientId, int? admissionNo}) async {
pendingOrderRequestModel = PendingOrderRequestModel(
- patientID: patientId,
- admissionNo: admissionNo,
- patientTypeID: 1,
- patientType: 1,
- );
+ patientID: patientId,
+ admissionNo: admissionNo,
+ patientTypeID: 1,
+ patientType: 1,
+ );
hasError = false;
- await baseAppClient.post(GET_PENDING_ORDERS,
- onSuccess: (dynamic response, int statusCode) {
+ await baseAppClient.post(GET_PENDING_ORDERS, onSuccess: (dynamic response, int statusCode) {
print("Success");
_pendingOrderList.clear();
response['List_PendingOrders'].forEach(
@@ -41,20 +37,16 @@ class PendingOrderService extends BaseService {
}, body: pendingOrderRequestModel.toJson());
}
- Future getAdmissionOrders(
- {AdmissionOrdersRequestModel admissionOrdersRequestModel,
- int patientId,
- int admissionNo}) async {
+ Future getAdmissionOrders({AdmissionOrdersRequestModel? admissionOrdersRequestModel, int? patientId, int? admissionNo}) async {
admissionOrdersRequestModel = AdmissionOrdersRequestModel(
- patientID: patientId,
- admissionNo: admissionNo,
- patientTypeID: 1,
- patientType: 1,
- );
+ patientID: patientId,
+ admissionNo: admissionNo,
+ patientTypeID: 1,
+ patientType: 1,
+ );
hasError = false;
- await baseAppClient.post(GET_ADMISSION_ORDERS,
- onSuccess: (dynamic response, int statusCode) {
+ await baseAppClient.post(GET_ADMISSION_ORDERS, onSuccess: (dynamic response, int statusCode) {
print("Success");
//admissionOrderList.clear();
response['List_AdmissionOrders'].forEach(
diff --git a/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart b/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart
index f1e9104f..097dfd62 100644
--- a/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart
+++ b/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart
@@ -1,33 +1,18 @@
-import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
-import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.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/Assessment/get_assessment_res_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/service/patient_medical_file/ER_signin/ER_signin_service.dart';
-import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
-import 'package:flutter/cupertino.dart';
class ERSignInViewModel extends BaseViewModel {
bool hasError = false;
ERSignInService _ERSignInService = locator();
- Future signInERPatient({int patientId, int signInType}) async {
+ Future signInERPatient({required int patientId, required int signInType}) async {
hasError = false;
await getDoctorProfile();
- DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(signInType: signInType, loginDoctorID: doctorProfile.doctorID, patientID: patientId);
+ DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(signInType: signInType, loginDoctorID: doctorProfile!.doctorID, patientID: patientId);
setState(ViewState.BusyLocal);
await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel);
if (_ERSignInService.hasError) {
diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart
index 866321fe..a23752dd 100644
--- a/lib/core/viewModel/SOAP_view_model.dart
+++ b/lib/core/viewModel/SOAP_view_model.dart
@@ -1,40 +1,39 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_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_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/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/post_chief_complaint_request_model.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/general_get_req_for_SOAP.dart';
import 'package:doctor_app_flutter/core/model/SOAP/history/get_history_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/history/get_history_res_model.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/history/post_histories_request_model.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/in_patient/get_episode_for_inpatient_req_model.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart';
+import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/get_physical_exam_list_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/get_physical_exam_req_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/physical_exam/post_physical_exam_request_model.dart';
+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/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/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/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/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/in_patient/get_episode_for_inpatient_req_model.dart';
-import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart';
-import 'package:doctor_app_flutter/core/model/SOAP/master_key_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/post_assessment_request_model.dart';
-import 'package:doctor_app_flutter/core/model/SOAP/history/post_histories_request_model.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_history.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/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/subjective/subjective_call_back.dart';
-import 'package:flutter/material.dart';
import '../../locator.dart';
import 'base_view_model.dart';
@@ -79,7 +78,7 @@ class SOAPViewModel extends BaseViewModel {
List get patientAssessmentList => _SOAPService.patientAssessmentList;
- int get episodeID => _SOAPService.episodeID;
+ int get episodeID => _SOAPService.episodeID!;
bool isAddProgress = true;
bool isAddExamInProgress = true;
@@ -98,7 +97,7 @@ class SOAPViewModel extends BaseViewModel {
List get allMedicationList => _prescriptionService.allMedicationList;
- SubjectiveCallBack subjectiveCallBack;
+ late SubjectiveCallBack subjectiveCallBack;
setSubjectiveCallBack(SubjectiveCallBack callBack) {
this.subjectiveCallBack = callBack;
@@ -108,7 +107,7 @@ class SOAPViewModel extends BaseViewModel {
subjectiveCallBack.nextFunction(model);
}
- ObjectiveCallBack objectiveCallBack;
+ late ObjectiveCallBack objectiveCallBack;
setObjectiveCallBack(ObjectiveCallBack callBack) {
this.objectiveCallBack = callBack;
@@ -118,7 +117,7 @@ class SOAPViewModel extends BaseViewModel {
objectiveCallBack.nextFunction(model);
}
- AssessmentCallBack assessmentCallBack;
+ late AssessmentCallBack assessmentCallBack;
setAssessmentCallBack(AssessmentCallBack callBack) {
this.assessmentCallBack = callBack;
@@ -128,7 +127,7 @@ class SOAPViewModel extends BaseViewModel {
assessmentCallBack.nextFunction(model);
}
- PlanCallBack planCallBack;
+ late PlanCallBack planCallBack;
setPlanCallBack(PlanCallBack callBack) {
this.planCallBack = callBack;
@@ -250,8 +249,8 @@ class SOAPViewModel extends BaseViewModel {
String getAllergicNames(isArabic) {
String allergiesString = '';
patientAllergiesList.forEach((element) {
- MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
- if (selectedAllergy != null && element.isChecked) allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + ' , ';
+ MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType!)!;
+ if (selectedAllergy != null && element.isChecked!) allergiesString += ((isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , ')!;
});
return allergiesString;
}
@@ -268,8 +267,8 @@ class SOAPViewModel extends BaseViewModel {
patientInfo.appointmentNo.toString(),
),
);
- if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty)
- getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo);
+ if (patientInfo.admissionNo != null && patientInfo.admissionNo!.isNotEmpty)
+ getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo!);
else
getPhysicalExamReqModel.admissionNo = 0;
setState(ViewState.Busy);
@@ -303,7 +302,7 @@ class SOAPViewModel extends BaseViewModel {
Future getEpisodeForInpatient(PatiantInformtion patient) async {
setState(ViewState.BusyLocal);
- GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel(patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo), patientTypeID: 1);
+ GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel(patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo!), patientTypeID: 1);
await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
@@ -315,7 +314,7 @@ class SOAPViewModel extends BaseViewModel {
}
// ignore: missing_return
- MasterKeyModel getOneMasterKey({@required MasterKeysService masterKeys, dynamic id, int typeId}) {
+ MasterKeyModel? getOneMasterKey({required MasterKeysService masterKeys, dynamic id, int? typeId}) {
switch (masterKeys) {
case MasterKeysService.Allergies:
List result = allergiesList.where((element) {
@@ -406,7 +405,28 @@ class SOAPViewModel extends BaseViewModel {
return result.first;
}
break;
- break;
+ case MasterKeysService.physiotherapyGoals:
+ return MasterKeyModel();
+ case MasterKeysService.TemperatureMethods:
+ return MasterKeyModel();
+ case MasterKeysService.Speciality:
+ return MasterKeyModel();
+ case MasterKeysService.MedicationStrength:
+ return MasterKeyModel();
+ case MasterKeysService.MedicationDuration:
+ return MasterKeyModel();
+ case MasterKeysService.MedicationRoute:
+ return MasterKeyModel();
+ case MasterKeysService.MedicationFrequency:
+ return MasterKeyModel();
+ case MasterKeysService.MedicationDoseTime:
+ return MasterKeyModel();
+ case MasterKeysService.MedicationIndications:
+ return MasterKeyModel();
+ case MasterKeysService.AdmissionRequestType:
+ return MasterKeyModel();
+ case MasterKeysService.DiagnosisSelectionType:
+ return MasterKeyModel();
}
}
@@ -421,7 +441,7 @@ class SOAPViewModel extends BaseViewModel {
onUpdateSubjectStepStart(PatiantInformtion patientInfo) async {
GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(
- admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
+ admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo!) : null,
patientMRN: patientInfo.patientMRN,
appointmentNo: patientInfo.appointmentNo != null ? int.parse(patientInfo.appointmentNo.toString()) : null,
episodeId: patientInfo.episodeNo,
@@ -541,7 +561,7 @@ class SOAPViewModel extends BaseViewModel {
final results = await Future.wait(services ?? []);
if (_SOAPService.hasError || _prescriptionService.hasError) {
- error = _SOAPService.error + _prescriptionService.error;
+ error = _SOAPService.error! + _prescriptionService.error!;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
@@ -601,11 +621,11 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
- postSubjectServices({patientInfo, String complaintsText, String medicationText, String illnessText, List myHistoryList, List myAllergiesList}) async {
+ postSubjectServices({patientInfo, String? complaintsText, String? medicationText, String? illnessText, List? myHistoryList, List? myAllergiesList}) async {
var services;
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
- createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText, medicationText: medicationText, complaintsText: complaintsText);
+ createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText!, medicationText: medicationText!, complaintsText: complaintsText!);
if (patientChiefComplaintList.isEmpty) {
postChiefComplaintRequestModel.editedBy = '';
services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)];
@@ -614,7 +634,7 @@ class SOAPViewModel extends BaseViewModel {
services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)];
}
- if (myHistoryList.length != 0) {
+ if (myHistoryList!.length != 0) {
PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList);
if (patientHistoryList.isEmpty) {
@@ -624,7 +644,7 @@ class SOAPViewModel extends BaseViewModel {
}
}
- if (myAllergiesList.length != 0) {
+ if (myAllergiesList!.length != 0) {
PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo);
if (patientAllergiesList.isEmpty) {
services.add(_SOAPService.postAllergy(postAllergyRequestModel));
@@ -642,7 +662,7 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
- PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String complaintsText, String medicationText, String illnessText}) {
+ PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String? complaintsText, String? medicationText, String? illnessText}) {
return new PostChiefComplaintRequestModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
patientMRN: patientInfo.patientMRN,
@@ -657,17 +677,17 @@ class SOAPViewModel extends BaseViewModel {
numberOfWeeks: 0);
}
- PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List myHistoryList}) {
+ PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List? myHistoryList}) {
PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: '');
- myHistoryList.forEach((history) {
+ myHistoryList!.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = [];
- postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM(
+ postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM(
patientMRN: patientInfo.patientMRN,
episodeId: patientInfo.episodeNo,
appointmentNo: patientInfo.appointmentNo,
remarks: "",
- historyId: history.selectedHistory.id,
- historyType: history.selectedHistory.typeId,
+ historyId: history.selectedHistory!.id,
+ historyType: history.selectedHistory!.typeId,
isChecked: history.isChecked,
));
});
@@ -679,7 +699,7 @@ class SOAPViewModel extends BaseViewModel {
PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel();
myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
- postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM(
+ postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: patientInfo.patientMRN,
@@ -687,9 +707,9 @@ class SOAPViewModel extends BaseViewModel {
appointmentNo: patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
- createdBy: allergy.createdBy ?? doctorProfile.doctorID,
+ createdBy: allergy.createdBy ?? doctorProfile!.doctorID,
createdOn: DateTime.now().toIso8601String(),
- editedBy: doctorProfile.doctorID,
+ editedBy: doctorProfile!.doctorID,
editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked,
isUpdatedByNurse: false));
diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart
index aec315c8..a0674f0f 100644
--- a/lib/core/viewModel/authentication_view_model.dart
+++ b/lib/core/viewModel/authentication_view_model.dart
@@ -27,11 +27,10 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/services.dart';
-import 'package:local_auth/auth_strings.dart';
-
// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
// import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart';
+import 'package:local_auth_ios/local_auth_ios.dart';
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED }
@@ -55,12 +54,12 @@ class AuthenticationViewModel extends BaseViewModel {
List get vidaPlusProjectList => _hospitalsService.vidaPlusProjectListModel;
- NewLoginInformationModel loggedUser;
- GetIMEIDetailsModel user;
+ NewLoginInformationModel loggedUser = NewLoginInformationModel();
+ GetIMEIDetailsModel user = GetIMEIDetailsModel();
UserModel userInfo = UserModel();
final LocalAuthentication auth = LocalAuthentication();
- List _availableBiometrics;
+ List _availableBiometrics = [];
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
bool isLogin = false;
@@ -88,7 +87,7 @@ class AuthenticationViewModel extends BaseViewModel {
profileInfo['IMEI'] = token;
profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE);
profileInfo['BioMetricEnabled'] = true;
- profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile;
+ profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user!.mobile;
InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo);
insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description'];
insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN'];
@@ -96,12 +95,12 @@ class AuthenticationViewModel extends BaseViewModel {
insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description'];
insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN'];
insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID);
- insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID;
- insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA;
+ insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user!.doctorID;
+ insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA;
insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
insertIMEIDetailsModel.password = userInfo.password;
- insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString());
+ insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser!.listMemberInformation![0].employeeID : int.parse(user!.editedBy.toString());
await _authService.insertDeviceImei(insertIMEIDetailsModel);
if (_authService.hasError) {
@@ -119,11 +118,11 @@ class AuthenticationViewModel extends BaseViewModel {
error = _authService.error;
setState(ViewState.ErrorLocal);
} else {
- sharedPref.setInt(PROJECT_ID, userInfo.projectID);
+ sharedPref.setInt(PROJECT_ID, userInfo.projectID!);
loggedUser = loginInfo;
saveObjToString(LOGGED_IN_USER, loginInfo);
sharedPref.remove(LAST_LOGIN_USER);
- sharedPref.setString(TOKEN, loginInfo.logInTokenID);
+ sharedPref.setString(TOKEN, loginInfo.logInTokenID!);
setState(ViewState.Idle);
}
}
@@ -132,17 +131,17 @@ class AuthenticationViewModel extends BaseViewModel {
Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async {
setState(ViewState.BusyLocal);
ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel(
- iMEI: user.iMEI,
- facilityId: user.projectID,
- memberID: user.doctorID,
- loginDoctorID: int.parse(user.editedBy.toString()),
- zipCode: user.outSA == true ? '971' : '966',
- mobileNumber: user.mobile,
+ iMEI: user!.iMEI,
+ facilityId: user!.projectID,
+ memberID: user!.doctorID,
+ loginDoctorID: int.parse(user!.editedBy.toString()),
+ zipCode: user!.outSA == true ? '971' : '966',
+ mobileNumber: user!.mobile,
oTPSendType: authMethodType.getTypeIdService(),
isMobileFingerPrint: 1,
- vidaAuthTokenID: user.vidaAuthTokenID,
- vidaRefreshTokenID: user.vidaRefreshTokenID);
- await sharedPref.setString(DOCTOR_ID, user.editedBy.toString());
+ vidaAuthTokenID: user!.vidaAuthTokenID,
+ vidaRefreshTokenID: user!.vidaRefreshTokenID);
+ await sharedPref.setString(DOCTOR_ID, user!.editedBy.toString());
await _authService.sendActivationCodeVerificationScreen(activationCodeModel);
if (_authService.hasError) {
@@ -153,28 +152,28 @@ class AuthenticationViewModel extends BaseViewModel {
}
/// send activation code for silent login
- Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password}) async {
+ Future sendActivationCodeForDoctorApp({required AuthMethodTypes authMethodType, required String password}) async {
setState(ViewState.BusyLocal);
int projectID = await sharedPref.getInt(PROJECT_ID);
ActivationCodeModel activationCodeModel = ActivationCodeModel(
facilityId: projectID,
- memberID: loggedUser.listMemberInformation[0].memberID,
- loginDoctorID: loggedUser.listMemberInformation[0].employeeID,
+ memberID: loggedUser.listMemberInformation![0].memberID,
+ loginDoctorID: loggedUser.listMemberInformation![0].employeeID,
otpSendType: authMethodType.getTypeIdService().toString(),
);
- await sharedPref.setString(DOCTOR_ID, (loggedUser.listMemberInformation[0].employeeID).toString());
+ await sharedPref.setString(DOCTOR_ID, (loggedUser.listMemberInformation![0].employeeID).toString());
await _authService.sendActivationCodeForDoctorApp(activationCodeModel);
if (_authService.hasError) {
error = _authService.error;
setState(ViewState.ErrorLocal);
} else {
- await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID);
+ await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID!);
setState(ViewState.Idle);
}
}
/// check activation code for sms and whats app
- Future checkActivationCodeForDoctorApp({String activationCode, bool isSilentLogin = false}) async {
+ Future checkActivationCodeForDoctorApp({String? activationCode, bool isSilentLogin = false}) async {
setState(ViewState.BusyLocal);
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel(
@@ -183,12 +182,12 @@ class AuthenticationViewModel extends BaseViewModel {
projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user.projectID,
logInTokenID: await sharedPref.getString(TOKEN),
activationCode: activationCode ?? '0000',
- memberID: userInfo.userID != null ? int.parse(userInfo.userID) : user.doctorID,
+ memberID: userInfo.userID != null ? int.parse(userInfo.userID!) : user.doctorID,
password: userInfo.password,
facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken,
- loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()),
+ loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation![0].employeeID : int.parse(user.editedBy.toString()),
///loggedUser.listMemberInformation[0].employeeID,
// loggedUser.listMemberInformation[0].employeeID,
@@ -242,10 +241,10 @@ class AuthenticationViewModel extends BaseViewModel {
setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async {
// print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
await sharedPref.setString(
- DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : "");
- await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
- await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID);
- await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID);
+ DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic![0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic![0].setupID! : "");
+ await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!);
+ await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!);
+ await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID!);
}
saveObjToString(String key, value) async {
@@ -254,10 +253,16 @@ class AuthenticationViewModel extends BaseViewModel {
/// ask user to add his biometric
showIOSAuthMessages() async {
- const iosStrings = const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please Enable Your Touch ID');
-
+ const iosStrings = IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please Enable Your Touch ID');
try {
- await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings);
+ await auth.authenticate(
+ localizedReason: 'Scan your fingerprint to authenticate',
+ authMessages: [iosStrings],
+ options: AuthenticationOptions(
+ useErrorDialogs: true,
+ stickyAuth: true,
+ ),
+ );
} on PlatformException catch (e) {
DrAppToastMsg.showErrorToast(e.toString());
}
@@ -285,12 +290,12 @@ class AuthenticationViewModel extends BaseViewModel {
/// add some logic in case of check activation code is success
onCheckActivationCodeSuccess({bool isSilentLogin = false}) async {
- sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID);
- if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) {
- localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile[0]);
+ sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!);
+ if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile!.isNotEmpty) {
+ localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile![0]);
} else {
sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic);
- ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson());
+ ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic![0].toJson());
await getDoctorProfileBasedOnClinic(clinic);
}
}
@@ -350,8 +355,8 @@ class AuthenticationViewModel extends BaseViewModel {
if (_authService.dashboardItemsList.length > 0) {
user = _authService.dashboardItemsList[0];
sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]);
- await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID);
- await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID);
+ await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID!);
+ await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID!);
this.unverified = true;
}
setState(ViewState.Idle);
@@ -405,7 +410,7 @@ class AuthenticationViewModel extends BaseViewModel {
}
deleteUser() {
- user = null;
+ user = GetIMEIDetailsModel();
unverified = false;
isLogin = false;
}
diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart
index 76e4efcd..bfee098b 100644
--- a/lib/core/viewModel/dashboard_view_model.dart
+++ b/lib/core/viewModel/dashboard_view_model.dart
@@ -1,12 +1,11 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart';
-import 'package:doctor_app_flutter/core/model/dashboard/doctor_schedule.dart';
+import 'package:doctor_app_flutter/core/model/dashboard/dashboard_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/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
-import 'package:doctor_app_flutter/core/model/dashboard/dashboard_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:firebase_messaging/firebase_messaging.dart';
import '../../locator.dart';
@@ -16,23 +15,20 @@ import 'base_view_model.dart';
class DashboardViewModel extends BaseViewModel {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
DashboardService _dashboardService = locator();
- SpecialClinicsService _specialClinicsService =
- locator();
+ SpecialClinicsService _specialClinicsService = locator();
DoctorReplyService _doctorReplyService = locator();
- List get dashboardItemsList =>
- _dashboardService.dashboardItemsList;
+ List get dashboardItemsList => _dashboardService.dashboardItemsList;
bool get hasVirtualClinic => _dashboardService.hasVirtualClinic;
- String get sServiceID => _dashboardService.sServiceID;
+ String? get sServiceID => _dashboardService.sServiceID;
int get notRepliedCount => _doctorReplyService.notRepliedCount;
- List get specialClinicalCareList =>
- _specialClinicsService.specialClinicalCareList;
- Future startHomeScreenServices(ProjectViewModel projectsProvider,
- AuthenticationViewModel authProvider) async {
+ List get specialClinicalCareList => _specialClinicsService.specialClinicalCareList;
+
+ Future startHomeScreenServices(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async {
setState(ViewState.Busy);
await getDoctorProfile(isGetProfile: true);
@@ -53,14 +49,13 @@ class DashboardViewModel extends BaseViewModel {
}
Future setFirebaseNotification(AuthenticationViewModel authProvider) async {
- _firebaseMessaging.requestPermission(
- sound: true, badge: true, alert: true, provisional: true);
+ _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true);
- _firebaseMessaging.getToken().then((String token) async {
+ _firebaseMessaging.getToken().then((String? token) async {
if (token != '') {
// DEVICE_TOKEN = token;
///TODO Elham* return it back
- authProvider.insertDeviceImei(token);
+ authProvider.insertDeviceImei(token);
}
});
}
@@ -85,14 +80,13 @@ class DashboardViewModel extends BaseViewModel {
// setState(ViewState.Idle);
}
- Future changeClinic(
- int clinicId, AuthenticationViewModel authProvider) async {
+ Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async {
setState(ViewState.BusyLocal);
await getDoctorProfile();
ClinicModel clinicModel = ClinicModel(
- doctorID: doctorProfile.doctorID,
+ doctorID: doctorProfile!.doctorID,
clinicID: clinicId,
- projectID: doctorProfile.projectID,
+ projectID: doctorProfile!.projectID,
);
await authProvider.getDoctorProfileBasedOnClinic(clinicModel);
if (authProvider.state == ViewState.ErrorLocal) {
@@ -102,13 +96,13 @@ class DashboardViewModel extends BaseViewModel {
getPatientCount(DashboardModel inPatientCount) {
int value = 0;
- inPatientCount.summaryoptions.forEach((result) => {value += result.value});
+ inPatientCount.summaryoptions!.forEach((result) => {value += result.value!});
return value.toString();
}
GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId) {
- GetSpecialClinicalCareListResponseModel special;
+ GetSpecialClinicalCareListResponseModel special = GetSpecialClinicalCareListResponseModel();
specialClinicalCareList.forEach((element) {
if (element.clinicID == clinicId) {
special = element;
@@ -130,6 +124,4 @@ class DashboardViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
-
-
}
diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart
index 86c04528..8b43bd91 100644
--- a/lib/core/viewModel/doctor_replay_view_model.dart
+++ b/lib/core/viewModel/doctor_replay_view_model.dart
@@ -1,8 +1,8 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart';
-import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/model/doctor/list_gt_my_patients_question_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/replay/request_create_doctor_response.dart';
import 'package:doctor_app_flutter/core/model/doctor/replay/request_doctor_reply.dart';
+import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart';
import '../../locator.dart';
import 'base_view_model.dart';
@@ -10,30 +10,21 @@ import 'base_view_model.dart';
class DoctorReplayViewModel extends BaseViewModel {
DoctorReplyService _doctorReplyService = locator();
- List get listDoctorWorkingHoursTable =>
- _doctorReplyService.listDoctorWorkingHoursTable;
+ List get listDoctorWorkingHoursTable => _doctorReplyService.listDoctorWorkingHoursTable;
- List get listDoctorNotRepliedQuestions =>
- _doctorReplyService.listDoctorNotRepliedQuestions;
+ List get listDoctorNotRepliedQuestions => _doctorReplyService.listDoctorNotRepliedQuestions;
- Future getDoctorReply(
- {int pageSize = 10,
- int pageIndex = 1,
- bool isLocalBusy = true,
- bool isGettingNotReply = false}) async {
+ Future getDoctorReply({int pageSize = 10, int pageIndex = 1, bool isLocalBusy = true, bool isGettingNotReply = false}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
}
await getDoctorProfile();
- RequestDoctorReply _requestDoctorReply =
- RequestDoctorReply(pageIndex: pageIndex, pageSize: pageSize);
- if (isGettingNotReply)
- _requestDoctorReply.infoStatus = 99; //to get the not replied only
+ RequestDoctorReply _requestDoctorReply = RequestDoctorReply(pageIndex: pageIndex, pageSize: pageSize);
+ if (isGettingNotReply) _requestDoctorReply.infoStatus = 99; //to get the not replied only
- await _doctorReplyService.getDoctorReply(_requestDoctorReply,
- clearData: !isLocalBusy, isGettingNotReply: isGettingNotReply);
+ await _doctorReplyService.getDoctorReply(_requestDoctorReply, clearData: !isLocalBusy, isGettingNotReply: isGettingNotReply);
if (_doctorReplyService.hasError) {
error = _doctorReplyService.error;
if (isLocalBusy) {
@@ -45,17 +36,15 @@ class DoctorReplayViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
- Future createDoctorResponse(
- String response, ListGtMyPatientsQuestions model) async {
+ Future createDoctorResponse(String response, ListGtMyPatientsQuestions model) async {
await getDoctorProfile();
- CreateDoctorResponseModel createDoctorResponseModel =
- CreateDoctorResponseModel(
- transactionNo: model.transactionNo.toString(),
- doctorResponse: response,
- infoStatus: 6,
- createdBy: this.doctorProfile.doctorID,
- infoEnteredBy: this.doctorProfile.doctorID,
- );
+ CreateDoctorResponseModel createDoctorResponseModel = CreateDoctorResponseModel(
+ transactionNo: model.transactionNo.toString(),
+ doctorResponse: response,
+ infoStatus: 6,
+ createdBy: this.doctorProfile!.doctorID,
+ infoEnteredBy: this.doctorProfile!.doctorID,
+ );
setState(ViewState.BusyLocal);
await _doctorReplyService.createDoctorResponse(createDoctorResponseModel);
if (_doctorReplyService.hasError) {
diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart
index f15ee42f..db524c2c 100644
--- a/lib/core/viewModel/labs_view_model.dart
+++ b/lib/core/viewModel/labs_view_model.dart
@@ -1,14 +1,14 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
-import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart';
-import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart';
import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart';
+import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
+import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
+import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/lab_order/labs_service.dart';
import 'package:doctor_app_flutter/locator.dart';
-import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'base_view_model.dart';
@@ -17,22 +17,16 @@ class LabsViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic;
LabsService _labsService = locator();
- List get labOrdersResultsList =>
- _labsService.labOrdersResultsList;
+ List get labOrdersResultsList => _labsService.labOrdersResultsList;
- List get allSpecialLabList =>
- _labsService.allSpecialLab;
+ List get allSpecialLabList => _labsService.allSpecialLab;
- List _patientLabOrdersListClinic =[];
- List _patientLabOrdersListHospital =[];
+ List _patientLabOrdersListClinic = [];
+ List _patientLabOrdersListHospital = [];
- List get patientLabOrdersList =>
- filterType == FilterType.Clinic
- ? _patientLabOrdersListClinic
- : _patientLabOrdersListHospital;
+ List get patientLabOrdersList => filterType == FilterType.Clinic ? _patientLabOrdersListClinic : _patientLabOrdersListHospital;
- List get labOrdersResultHistoryList =>
- _labsService.labOrdersResultHistoryList;
+ List get labOrdersResultHistoryList => _labsService.labOrdersResultHistoryList;
void getLabs(PatiantInformtion patient) async {
setState(ViewState.Busy);
@@ -42,41 +36,25 @@ class LabsViewModel extends BaseViewModel {
setState(ViewState.Error);
} else {
_labsService.patientLabOrdersList.forEach((element) {
- List patientLabOrdersClinic =
- _patientLabOrdersListClinic
- .where((elementClinic) =>
- elementClinic.filterName == element.clinicDescription)
- .toList();
+ List patientLabOrdersClinic = _patientLabOrdersListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList();
if (patientLabOrdersClinic.length != 0) {
- _patientLabOrdersListClinic[_patientLabOrdersListClinic
- .indexOf(patientLabOrdersClinic[0])]
- .patientLabOrdersList
- .add(element);
+ _patientLabOrdersListClinic[_patientLabOrdersListClinic.indexOf(patientLabOrdersClinic[0])].patientLabOrdersList.add(element);
} else {
- _patientLabOrdersListClinic.add(PatientLabOrdersList(
- filterName: element.clinicDescription!,
- patientDoctorAppointment: element));
+ _patientLabOrdersListClinic.add(PatientLabOrdersList(filterName: element.clinicDescription!, patientDoctorAppointment: element));
}
// doctor list sort via project
- List patientLabOrdersHospital =
- _patientLabOrdersListHospital
- .where(
- (elementClinic) =>
- elementClinic.filterName == element.projectName,
- )
- .toList();
+ List patientLabOrdersHospital = _patientLabOrdersListHospital
+ .where(
+ (elementClinic) => elementClinic.filterName == element.projectName,
+ )
+ .toList();
if (patientLabOrdersHospital.length != 0) {
- _patientLabOrdersListHospital[_patientLabOrdersListHospital
- .indexOf(patientLabOrdersHospital[0])]
- .patientLabOrdersList
- .add(element);
+ _patientLabOrdersListHospital[_patientLabOrdersListHospital.indexOf(patientLabOrdersHospital[0])].patientLabOrdersList.add(element);
} else {
- _patientLabOrdersListHospital.add(PatientLabOrdersList(
- filterName: element.projectName!,
- patientDoctorAppointment: element));
+ _patientLabOrdersListHospital.add(PatientLabOrdersList(filterName: element.projectName!, patientDoctorAppointment: element));
}
});
@@ -89,28 +67,15 @@ class LabsViewModel extends BaseViewModel {
notifyListeners();
}
- List get patientLabSpecialResult =>
- _labsService.patientLabSpecialResult;
+ List get patientLabSpecialResult => _labsService.patientLabSpecialResult;
List get labResultList => _labsService.labResultList;
- List labResultLists =[];
+ List labResultLists = [];
- getLaboratoryResult(
- {String? projectID,
- int? clinicID,
- String? invoiceNo,
- String? orderNo,
- PatiantInformtion? patient,
- bool? isInpatient}) async {
+ getLaboratoryResult({String? projectID, int? clinicID, String? invoiceNo, String? orderNo, PatiantInformtion? patient, bool? isInpatient}) async {
setState(ViewState.Busy);
- await _labsService.getLaboratoryResult(
- invoiceNo: invoiceNo,
- orderNo: orderNo,
- projectID: projectID,
- clinicID: clinicID,
- patient: patient,
- isInpatient: isInpatient);
+ await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient!, isInpatient: isInpatient!);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
@@ -119,15 +84,9 @@ class LabsViewModel extends BaseViewModel {
}
}
- getPatientLabResult(
- {PatientLabOrders? patientLabOrder,
- PatiantInformtion? patient,
- bool? isInpatient}) async {
+ getPatientLabResult({PatientLabOrders? patientLabOrder, PatiantInformtion? patient, bool? isInpatient}) async {
setState(ViewState.Busy);
- await _labsService.getPatientLabResult(
- patientLabOrder: patientLabOrder,
- patient: patient,
- isInpatient: isInpatient!);
+ await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder!, patient: patient!, isInpatient: isInpatient!);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
@@ -138,31 +97,19 @@ class LabsViewModel extends BaseViewModel {
void setLabResultDependOnFilterName() {
_labsService.labResultList.forEach((element) {
- List patientLabOrdersClinic = labResultLists
- .where(
- (elementClinic) => elementClinic.filterName == element.testCode)
- .toList();
+ List patientLabOrdersClinic = labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList();
if (patientLabOrdersClinic.length != 0) {
- labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])]
- .patientLabResultList
- .add(element);
+ labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList.add(element);
} else {
- labResultLists
- .add(LabResultList(filterName: element.testCode!, lab: element));
+ labResultLists.add(LabResultList(filterName: element.testCode!, lab: element));
}
});
}
- getPatientLabOrdersResults(
- {PatientLabOrders? patientLabOrder,
- String? procedure,
- PatiantInformtion? patient}) async {
+ getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, String? procedure, PatiantInformtion? patient}) async {
setState(ViewState.Busy);
- await _labsService.getPatientLabOrdersResults(
- patientLabOrder: patientLabOrder,
- procedure: procedure,
- patient: patient);
+ await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure!, patient: patient!);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
@@ -170,9 +117,7 @@ class LabsViewModel extends BaseViewModel {
bool isShouldClear = false;
if (_labsService.labOrdersResultsList.length == 1) {
labOrdersResultsList.forEach((element) {
- if (element.resultValue!.contains('/') ||
- element.resultValue!.contains('*') ||
- element.resultValue!.isEmpty) isShouldClear = true;
+ if (element.resultValue!.contains('/') || element.resultValue!.contains('*') || element.resultValue!.isEmpty) isShouldClear = true;
});
}
if (isShouldClear) _labsService.labOrdersResultsList.clear();
@@ -180,15 +125,9 @@ class LabsViewModel extends BaseViewModel {
}
}
- getPatientLabResultHistoryByDescription(
- {PatientLabOrders? patientLabOrder,
- String? procedureDescription,
- PatiantInformtion? patient}) async {
+ getPatientLabResultHistoryByDescription({PatientLabOrders? patientLabOrder, String? procedureDescription, PatiantInformtion? patient}) async {
setState(ViewState.Busy);
- await _labsService.getPatientLabOrdersResultHistoryByDescription(
- patientLabOrder: patientLabOrder,
- procedureDescription: procedureDescription,
- patient: patient);
+ await _labsService.getPatientLabOrdersResultHistoryByDescription(patientLabOrder: patientLabOrder, procedureDescription: procedureDescription, patient: patient!);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
@@ -198,7 +137,7 @@ class LabsViewModel extends BaseViewModel {
}
sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes}) async {
- await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder);
+ await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder!);
if (_labsService.hasError) {
error = _labsService.error;
} else
diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart
index dd543642..95d51409 100644
--- a/lib/core/viewModel/patient-admission-request-viewmodel.dart
+++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart
@@ -7,8 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import '../../locator.dart';
class AdmissionRequestViewModel extends BaseViewModel {
- AdmissionRequestService _admissionRequestService =
- locator();
+ AdmissionRequestService _admissionRequestService = locator();
List get clinicList => _admissionRequestService.clinicList;
@@ -20,26 +19,21 @@ class AdmissionRequestViewModel extends BaseViewModel {
List get wardList => _admissionRequestService.wardList;
- List get roomCategoryList =>
- _admissionRequestService.roomCategoryList;
+ List get roomCategoryList => _admissionRequestService.roomCategoryList;
- List get admissionTypeList =>
- _admissionRequestService.listOfAdmissionType;
+ List get admissionTypeList => _admissionRequestService.listOfAdmissionType;
- List get diagnosisTypesList =>
- _admissionRequestService.diagnosisTypesList;
+ List get diagnosisTypesList => _admissionRequestService.diagnosisTypesList;
- List get allergiesList =>
- _admissionRequestService.allergiesLookupList;
+ List get allergiesList => _admissionRequestService.allergiesLookupList;
List get dietTypesList => _admissionRequestService.dietTypesList;
List get icdCodes => _admissionRequestService.icdCodes;
- List get listOfDiagnosisSelectionTypes =>
- _admissionRequestService.listOfDiagnosisSelectionTypes;
+ List get listOfDiagnosisSelectionTypes => _admissionRequestService.listOfDiagnosisSelectionTypes;
- AdmissionRequest? admissionRequestData;
+ AdmissionRequest admissionRequestData = AdmissionRequest();
Future getSpecialityList() async {
await getMasterLookup(MasterKeysService.Speciality);
diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart
index 741344b2..853749c0 100644
--- a/lib/core/viewModel/patient-ucaf-viewmodel.dart
+++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart
@@ -4,23 +4,22 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_res_model.dart';
-import 'package:doctor_app_flutter/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart';
-import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
-import 'package:doctor_app_flutter/core/model/procedure/order-procedure.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-history.dart';
+import 'package:doctor_app_flutter/core/model/procedure/order-procedure.dart';
+import 'package:doctor_app_flutter/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart';
+import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
-import 'package:flutter/material.dart';
import '../../locator.dart';
class UcafViewModel extends BaseViewModel {
UcafService _ucafService = locator();
- List get patientChiefComplaintList => _ucafService.patientChiefComplaintList;
+ List? get patientChiefComplaintList => _ucafService.patientChiefComplaintList;
- List get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory;
+ List? get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory;
List get patientAssessmentList => _ucafService.patientAssessmentList;
@@ -28,13 +27,13 @@ class UcafViewModel extends BaseViewModel {
List get diagnosisConditions => _ucafService.listOfDiagnosisCondition;
- PrescriptionModel get prescriptionList => _ucafService.prescriptionList;
+ PrescriptionModel? get prescriptionList => _ucafService.prescriptionList;
- List get orderProcedures => _ucafService.orderProcedureList;
+ List? get orderProcedures => _ucafService.orderProcedureList;
- Function saveUCAFOnTap;
+ late Function saveUCAFOnTap;
- String selectedLanguage;
+ String selectedLanguage = 'en';
String heightCm = "0";
String weightKg = "0";
String bodyMax = "0";
@@ -60,8 +59,8 @@ class UcafViewModel extends BaseViewModel {
Future getUCAFData(PatiantInformtion patient) async {
// setState(ViewState.Busy);
- String from;
- String to;
+ String? from;
+ String? to;
if (from == null || from == "0") {
from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
@@ -77,7 +76,7 @@ class UcafViewModel extends BaseViewModel {
error = _ucafService.error;
setState(ViewState.Error);
} else {
- patientVitalSignsHistory.forEach((element) {
+ patientVitalSignsHistory!.forEach((element) {
if (heightCm == "0" || heightCm == null || heightCm == 'null') {
heightCm = element.heightCm.toString();
}
@@ -132,7 +131,7 @@ class UcafViewModel extends BaseViewModel {
}
Future getOrderProcedures(PatiantInformtion patient) async {
- if (orderProcedures.isEmpty) {
+ if (orderProcedures!.isEmpty) {
// setState(ViewState.Busy);
await _ucafService.getOrderProcedures(patient);
if (_ucafService.hasError) {
@@ -157,7 +156,7 @@ class UcafViewModel extends BaseViewModel {
}
}
- MasterKeyModel findMasterDataById({@required MasterKeysService masterKeys, dynamic id}) {
+ MasterKeyModel findMasterDataById({required MasterKeysService masterKeys, dynamic id}) {
switch (masterKeys) {
case MasterKeysService.DiagnosisCondition:
List result = diagnosisConditions.where((element) {
@@ -166,7 +165,7 @@ class UcafViewModel extends BaseViewModel {
if (result.isNotEmpty) {
return result.first;
}
- return null;
+ return MasterKeyModel();
case MasterKeysService.DiagnosisType:
List result = diagnosisTypes.where((element) {
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
@@ -174,9 +173,9 @@ class UcafViewModel extends BaseViewModel {
if (result.isNotEmpty) {
return result.first;
}
- return null;
+ return MasterKeyModel();
default:
- return null;
+ return MasterKeyModel();
}
}
diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart
index 005d095d..0186fa26 100644
--- a/lib/core/viewModel/procedure_View_model.dart
+++ b/lib/core/viewModel/procedure_View_model.dart
@@ -5,9 +5,10 @@ import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
+import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
-import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe;
+import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart';
@@ -22,11 +23,9 @@ import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/p
import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
-import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
-import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
class ProcedureViewModel extends BaseViewModel {
@@ -44,8 +43,8 @@ class ProcedureViewModel extends BaseViewModel {
List get categoryList => _procedureService.categoryList;
RadiologyService _radiologyService = locator();
LabsService _labsService = locator();
- List _finalRadiologyListClinic = List();
- List _finalRadiologyListHospital = List();
+ List _finalRadiologyListClinic = [];
+ List _finalRadiologyListHospital = [];
List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital;
@@ -56,7 +55,7 @@ class ProcedureViewModel extends BaseViewModel {
List get labOrdersResultsList => _labsService.labOrdersResultsList;
List get procedureTemplate => _procedureService.templateList;
- List templateList = List();
+ List templateList = [];
List get procedureTemplateDetails => _procedureService.templateDetailsList;
@@ -64,7 +63,7 @@ class ProcedureViewModel extends BaseViewModel {
bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus;
- Future getProcedure({int mrn, String patientType, int appointmentNo, bool isLocalBusy = false}) async {
+ Future getProcedure({required int mrn, String? patientType, int? appointmentNo, bool isLocalBusy = false}) async {
hasError = false;
await getDoctorProfile();
if (isLocalBusy)
@@ -82,7 +81,7 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
- Future getProcedureCategory({String categoryName, String categoryID, patientId, bool isLocalBusy = false}) async {
+ Future getProcedureCategory({String? categoryName, String? categoryID, patientId, bool isLocalBusy = false}) async {
if (categoryName == null) return;
hasError = false;
if (isLocalBusy)
@@ -109,7 +108,7 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
- Future getProcedureTemplate({String categoryID, bool isLocalBusy = false, BuildContext context}) async {
+ Future getProcedureTemplate({String? categoryID, bool isLocalBusy = false, BuildContext? context}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
@@ -140,7 +139,7 @@ class ProcedureViewModel extends BaseViewModel {
int tempId = 0;
- Future getProcedureTemplateDetails({int templateId}) async {
+ Future getProcedureTemplateDetails({required int templateId}) async {
tempId = templateId;
hasError = false;
//_insuranceCardService.clearInsuranceCard();
@@ -185,7 +184,7 @@ class ProcedureViewModel extends BaseViewModel {
}
}
- Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn, bool isLocalBusy = false}) async {
+ Future updateProcedure({required UpdateProcedureRequestModel updateProcedureRequestModel, int? mrn, bool isLocalBusy = false}) async {
hasError = false;
if (isLocalBusy)
setState(ViewState.BusyLocal);
@@ -200,7 +199,7 @@ class ProcedureViewModel extends BaseViewModel {
//await getProcedure(mrn: mrn);
}
- void getPatientRadOrders(PatiantInformtion patient, {String patientType, bool isInPatient = false}) async {
+ void getPatientRadOrders(PatiantInformtion patient, {String? patientType, bool isInPatient = false}) async {
setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient);
_isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus;
@@ -240,7 +239,7 @@ class ProcedureViewModel extends BaseViewModel {
String get radImageURL => _radiologyService.url;
- getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async {
+ getRadImageURL({int? invoiceNo, int lineItem = 0, int projectId = 0, required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient);
if (_radiologyService.hasError) {
@@ -259,7 +258,7 @@ class ProcedureViewModel extends BaseViewModel {
List get labResultList => _labsService.labResultList;
- List labResultLists = List();
+ List labResultLists = [];
List get labResultListsCoustom {
return labResultLists;
@@ -276,7 +275,7 @@ class ProcedureViewModel extends BaseViewModel {
}
}
- getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async {
+ getLaboratoryResult({required String projectID, required int clinicID, required String invoiceNo, required String orderNo, required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient);
if (_labsService.hasError) {
@@ -287,7 +286,7 @@ class ProcedureViewModel extends BaseViewModel {
}
}
- getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async {
+ getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, required String procedure, required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, patient: patient);
if (_labsService.hasError) {
@@ -297,7 +296,7 @@ class ProcedureViewModel extends BaseViewModel {
bool isShouldClear = false;
if (_labsService.labOrdersResultsList.length == 1) {
labOrdersResultsList.forEach((element) {
- if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) isShouldClear = true;
+ if (element.resultValue!.contains('/') || element.resultValue!.contains('*') || element.resultValue!.isEmpty) isShouldClear = true;
});
}
if (isShouldClear) _labsService.labOrdersResultsList.clear();
@@ -305,7 +304,7 @@ class ProcedureViewModel extends BaseViewModel {
}
}
- sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async {
+ sendLabReportEmail({required PatientLabOrders patientLabOrder, required String mes}) async {
await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder);
if (_labsService.hasError) {
error = _labsService.error;
@@ -314,11 +313,11 @@ class ProcedureViewModel extends BaseViewModel {
}
Future preparePostProcedure({
- String remarks,
- String orderType,
- PatiantInformtion patient,
- List entityList,
- ProcedureType procedureType,
+ String? remarks,
+ String? orderType,
+ required PatiantInformtion patient,
+ List? entityList,
+ ProcedureType? procedureType,
bool isLocalBusy = false,
}) async {
///TODO Roaa Move it to function
@@ -333,15 +332,15 @@ class ProcedureViewModel extends BaseViewModel {
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
- List controlsProcedure = List();
+ List controlsProcedure = [];
postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = patient.patientMRN;
- entityList.forEach((element) {
- procedureValadteRequestModel.procedure = [element.procedureId];
- List controls = List();
+ entityList!.forEach((element) {
+ procedureValadteRequestModel.procedure = [element.procedureId!];
+ List controls = [];
controls.add(
Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""),
);
@@ -354,12 +353,12 @@ class ProcedureViewModel extends BaseViewModel {
postProcedureReqModel.procedures = controlsProcedure;
await validationProcedure(procedureValadteRequestModel, isLocalBusy: isLocalBusy);
if (state == ViewState.Idle) {
- if (valadteProcedureList[0].entityList.length == 0) {
- await postProcedure(postProcedureReqModel, patient.patientMRN, isLocalBusy: isLocalBusy);
+ if (valadteProcedureList[0].entityList!.length == 0) {
+ await postProcedure(postProcedureReqModel, patient.patientMRN!, isLocalBusy: isLocalBusy);
if (state == ViewState.ErrorLocal) {
Utils.showErrorToast(error);
- getProcedure(mrn: patient.patientMRN, isLocalBusy: isLocalBusy);
+ getProcedure(mrn: patient.patientMRN!, isLocalBusy: isLocalBusy);
} else if (state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added');
if (Navigator.canPop(AppGlobal.CONTEX)) Navigator.pop(AppGlobal.CONTEX);
@@ -368,9 +367,9 @@ class ProcedureViewModel extends BaseViewModel {
} else {
if (state == ViewState.ErrorLocal) {
Utils.showErrorToast(error);
- getProcedure(mrn: patient.patientMRN);
+ getProcedure(mrn: patient.patientMRN!);
} else if (state == ViewState.Idle) {
- Utils.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages);
+ Utils.showErrorToast(valadteProcedureList[0].entityList![0].warringMessages);
}
}
} else {
@@ -400,7 +399,7 @@ class ProcedureViewModel extends BaseViewModel {
} else {
setState(ViewState.Busy);
}
- List entityList = List();
+ List entityList = [];
items.forEach((element) {
entityList.add(
cpe.EntityList(
@@ -419,12 +418,12 @@ class ProcedureViewModel extends BaseViewModel {
}
Future filterSearchResults(String query, List masterList, List items) async {
- List dummySearchList = List();
+ List dummySearchList = [];
dummySearchList.addAll(masterList);
if (query.isNotEmpty) {
- List dummyListData = List();
+ List dummyListData = [];
dummySearchList.forEach((item) {
- if (item.procedureName.toLowerCase().contains(query.toLowerCase())) {
+ if (item.procedureName!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);
}
});
@@ -437,12 +436,12 @@ class ProcedureViewModel extends BaseViewModel {
}
void filterProcedureSearchResults(String query, List masterList, List items) {
- List dummySearchList = List();
+ List dummySearchList = [];
if (masterList != null) dummySearchList.addAll(masterList);
if (query.isNotEmpty) {
- List dummyListData = List();
+ List dummyListData = [];
dummySearchList.forEach((item) {
- if (item.templateName.toLowerCase().contains(query.toLowerCase())) {
+ if (item.templateName!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);
}
});
diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart
index 72206475..123482d7 100644
--- a/lib/core/viewModel/project_view_model.dart
+++ b/lib/core/viewModel/project_view_model.dart
@@ -35,7 +35,7 @@ class ProjectViewModel with ChangeNotifier {
bool get isArabic => _isArabic;
late StreamSubscription subscription;
- List _vidaPlusProjectListModel = List();
+ List _vidaPlusProjectListModel = [];
List get vidaPlusProjectList => _vidaPlusProjectListModel;
diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart
index a5241ed9..c4fe87a0 100644
--- a/lib/core/viewModel/radiology_view_model.dart
+++ b/lib/core/viewModel/radiology_view_model.dart
@@ -1,9 +1,8 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
+import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/radiology/radiology_service.dart';
-import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
-import 'package:flutter/foundation.dart';
import '../../locator.dart';
import 'base_view_model.dart';
@@ -12,8 +11,8 @@ class RadiologyViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic;
RadiologyService _radiologyService = locator();
- List _finalRadiologyListClinic = List();
- List _finalRadiologyListHospital = List();
+ List _finalRadiologyListClinic = [];
+ List _finalRadiologyListHospital = [];
List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital;
@@ -53,7 +52,7 @@ class RadiologyViewModel extends BaseViewModel {
String get radImageURL => _radiologyService.url;
- getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient, String invoiceType}) async {
+ getRadImageURL({required int invoiceNo, required int lineItem, required int projectId, required bool isVidaPlus, required PatiantInformtion patient, required String invoiceType}) async {
setState(ViewState.Busy);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus, patient: patient, invoiceType: invoiceType);
if (_radiologyService.hasError) {
diff --git a/lib/screens/ER_singin/ER_singin_screen.dart b/lib/screens/ER_singin/ER_singin_screen.dart
index b4f6a363..b2e515ab 100644
--- a/lib/screens/ER_singin/ER_singin_screen.dart
+++ b/lib/screens/ER_singin/ER_singin_screen.dart
@@ -1,26 +1,22 @@
import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
-import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
-import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
-import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
+import 'package:doctor_app_flutter/utils/utils.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/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
-import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
-import '../../routes.dart';
import '../base/base_view.dart';
Utils helpers = Utils();
@@ -31,7 +27,7 @@ class ErSignInScreen extends StatefulWidget {
}
class _ErSignInScreenState extends State {
- ProjectViewModel projectViewModel;
+ late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
@@ -45,7 +41,7 @@ class _ErSignInScreenState extends State {
),
body: Center(
child: Container(
- margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
+ margin: EdgeInsets.only(top: SizeConfig.realScreenHeight! / 7),
child: FractionallySizedBox(
widthFactor: 0.9,
child: ListView(
@@ -111,7 +107,7 @@ class _ErSignInScreenState extends State {
}
}
- signInERPatient({BuildContext context, ERSignInViewModel model, patientId, signInType}) async {
+ signInERPatient({required BuildContext context, required ERSignInViewModel model, patientId, signInType}) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.signInERPatient(patientId: patientId, signInType: signInType);
if (model.state == ViewState.ErrorLocal) {
@@ -126,9 +122,9 @@ class _ErSignInScreenState extends State {
/// TODO Elham* Make this as custom Dialog
showMyDialog({
- BuildContext context,
- Function firstAction,
- Function secondAction,
+ required BuildContext context,
+ required Function firstAction,
+ required Function secondAction,
}) {
showDialog(
context: context,
diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart
index c1ce9c3c..cb613263 100644
--- a/lib/screens/auth/login_screen.dart
+++ b/lib/screens/auth/login_screen.dart
@@ -4,8 +4,8 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_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/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
+import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
@@ -21,7 +21,7 @@ class LoginScreen extends StatefulWidget {
}
class _LoginScreenState extends State {
- String platformImei;
+ String? platformImei;
bool allowCallApi = true;
//TODO change AppTextFormField to AppTextFormFieldCustom
@@ -32,8 +32,8 @@ class _LoginScreenState extends State