Backend Structure 1.0

development_mirza
mirza.shafique 3 years ago
parent b563c1c4bc
commit a7bc7df92d

@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 33
ndkVersion flutter.ndkVersion
compileOptions {
@ -44,10 +44,10 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.untitled1"
applicationId "com.hmg.hmgDr"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion
minSdkVersion 23
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
@ -69,3 +69,4 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
apply plugin: 'com.google.gms.google-services'

@ -0,0 +1,82 @@
{
"project_info": {
"project_number": "934365232760",
"project_id": "hmg-dr-app",
"storage_bucket": "hmg-dr-app.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:934365232760:android:024b3569972f1c09f9778d",
"android_client_info": {
"package_name": "COM.HMG.HMGDR"
}
},
"oauth_client": [
{
"client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCpYwrmuntOBdZv6GV6KEnLj8nQRvEnZ6I"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "934365232760-57v2ld1qqulc4nt4o5pgjfbpc47fj3qf.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "COM.HMG.HMGDR"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:934365232760:android:e0e185e68c0d7690f9778d",
"android_client_info": {
"package_name": "com.hmg.hmgDr"
}
},
"oauth_client": [
{
"client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCpYwrmuntOBdZv6GV6KEnLj8nQRvEnZ6I"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "934365232760-bobv1r1sn222le020jeni6u1bdbjdu1v.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "934365232760-57v2ld1qqulc4nt4o5pgjfbpc47fj3qf.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "COM.HMG.HMGDR"
}
}
]
}
}
}
],
"configuration_version": "1"
}

@ -8,6 +8,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
}
}

@ -1,6 +1,6 @@
import 'dart:async';
import 'package:hmg_nurses/api/api_client.dart';
import 'package:hmg_nurses/services/api_client.dart';
import 'package:hmg_nurses/app_state/app_state.dart';
import 'package:hmg_nurses/classes/consts.dart';

@ -0,0 +1,36 @@
import 'package:hmg_nurses/exceptions/api_exception.dart';
import 'package:hmg_nurses/main.dart';
import 'package:hmg_nurses/services/api_client.dart';
import 'package:hmg_nurses/classes/consts.dart';
import 'package:hmg_nurses/model/base/generic_response_model.dart';
import 'package:hmg_nurses/model/login/imei_details.dart';
import 'package:injector/injector.dart';
import '../services/firebase_service.dart';
abstract class ILoginApiRepo {
Future<List<GetIMEIDetailsModel>> getDeviceInfoByIMEI();
}
class LoginApiRepo implements ILoginApiRepo {
final IFirebaseService _firebaseService = Injector.appInstance.get<IFirebaseService>();
@override
Future<List<GetIMEIDetailsModel>> getDeviceInfoByIMEI() async {
String url = "${ApiConsts.baseUrlServices}DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI";
String token = await _firebaseService.getFirebaseToke();
logger.d("firebase_token: " + token);
Map<String, dynamic> postParams = {};
postParams.addAll(appState.postParamsJson);
postParams["stamp"] = DateTime.now().toIso8601String();
postParams["IMEI"] = token;
GenericResponseModel response;
try {
response = await Injector.appInstance.get<IApiClient>().postJsonForObject((json) => GenericResponseModel.fromJson(json), url, postParams);
} catch (e) {
rethrow;
}
return response.listDoctorDeviceDetails ?? [];
}
}

File diff suppressed because one or more lines are too long

@ -1,18 +1,18 @@
class ApiConsts {
//static String baseUrl = "http://10.200.204.20:2801/"; // Local server
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
// static String baseUrl = "https://hmgwebservices.com"; // Live server
//static String baseUrl = 'https://hmgwebservices.com/';
static String baseUrl = 'https://uat.hmgwebservices.com/';
static String baseUrlServices = baseUrl + "/Services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";
static String erpRest = baseUrlServices + "ERP.svc/REST/";
static String swpRest = baseUrlServices + "SWP.svc/REST/";
static String user = baseUrlServices + "api/User/";
static String user = baseUrlServices + "api_repo/User/";
static String cocRest = baseUrlServices + "COCWS.svc/REST/";
//Chat
static String chatServerBaseUrl = "https://apiderichat.hmg.com";
static String chatServerBaseApiUrl = "https://apiderichat.hmg.com/api/";
static String chatServerBaseApiUrl = "https://apiderichat.hmg.com/api_repo/";
static String chatHubConnectionUrl = chatServerBaseUrl + "/ConnectionChatHub";
static String chatSearchMember = "user/getUserWithStatusAndFavAsync/";
static String chatRecentUrl = "UserChatHistory/getchathistorybyuserid"; //For a Mem

@ -0,0 +1,22 @@
// import 'package:firebase_crashlytics/firebase_crashlytics.dart';
// import 'package:flutter/material.dart';
import 'package:hmg_nurses/app_state/app_state.dart';
import 'package:hmg_nurses/services/api_client.dart';
import 'package:hmg_nurses/api_repo/login_api_repo.dart';
import 'package:hmg_nurses/services/firebase_service.dart';
import 'package:injector/injector.dart';
class AppDependencies {
static void addDependencies() {
Injector injector = Injector.appInstance;
//add dependencies as needed
//services
injector.registerSingleton<AppState>(() => AppState());
injector.registerSingleton<IApiClient>(() => ApiClient());
injector.registerSingleton<IFirebaseService>(() => FirebaseService());
//repos
injector.registerSingleton<ILoginApiRepo>(() => LoginApiRepo());
}
}

@ -1,25 +1,16 @@
import 'package:flutter/material.dart';
import 'package:hmg_nurses/ui/login/splash_page.dart';
class AppRoutes {
//Login
static const String splash = "/splash";
static const String registerSelection = "/registerSelection";
static const String loginVerifyAccount = "/loginVerifyAccount";
static const String login = "/login";
static final Map<String, WidgetBuilder> routes = {
//Login
splash: (BuildContext context) => SplashPage(),
// login: (BuildContext context) => LoginScreen(),
};
}

@ -9,7 +9,6 @@ import 'package:hmg_nurses/extensions/string_extensions.dart';
import 'package:hmg_nurses/widgets/button/default_button.dart';
import 'package:hmg_nurses/widgets/otp_widget.dart';
final ValueNotifier<String> otpFieldClear = ValueNotifier<String>("");
class OtpDialog {
@ -132,8 +131,8 @@ class OtpDialog {
children: [
Expanded(
child: "LocaleKeys.codeExpire.tr()".toText16(
color: MyColors.redColor,
),
color: MyColors.redColor,
),
),
12.width,
Image.asset(

@ -1,6 +1,6 @@
import 'dart:convert';
import 'package:hmg_nurses/api/api_client.dart';
import 'package:hmg_nurses/services/api_client.dart';
class APIException implements Exception {
static const String BAD_REQUEST = 'api_common_bad_request';

@ -1,10 +1,14 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:hmg_nurses/app_state/app_state.dart';
import 'package:hmg_nurses/config/dependencies.dart';
import 'package:hmg_nurses/config/routes.dart';
import 'package:hmg_nurses/provider/dashboard_provider_model.dart';
import 'package:hmg_nurses/theme/app_theme.dart';
import 'package:injector/injector.dart';
import 'package:logger/logger.dart';
import 'package:provider/provider.dart';
import 'package:provider/single_child_widget.dart';
@ -12,6 +16,8 @@ import 'package:sizer/sizer.dart';
import 'generated/codegen_loader.g.dart';
late AppState appState;
Logger logger = Logger(
// filter: null, // Use the default LogFilter (-> only log in debug mode)
printer: PrettyPrinter(
@ -32,6 +38,7 @@ Future<void> main() async {
await EasyLocalization.ensureInitialized();
// AppState().setPostParamsInitConfig();
HttpOverrides.global = MyHttpOverrides();
await Firebase.initializeApp();
runApp(
EasyLocalization(
supportedLocales: const <Locale>[
@ -46,7 +53,7 @@ Future<void> main() async {
create: (_) => DashboardProviderModel(),
)
],
child: const MyApp(),
child: MyApp(),
),
),
);
@ -59,7 +66,11 @@ Future<void> main() async {
// command to generate languages data from json
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
MyApp({super.key}) {
AppDependencies.addDependencies();
appState = Injector.appInstance.get<AppState>();
appState.setPostParamsInitConfig();
}
@override
Widget build(BuildContext context) {

@ -0,0 +1,743 @@
// To parse this JSON data, do
//
// final genericResponseModel = genericResponseModelFromJson(jsonString);
import 'dart:convert';
import 'package:hmg_nurses/model/login/imei_details.dart';
GenericResponseModel genericResponseModelFromJson(String str) => GenericResponseModel.fromJson(json.decode(str));
String genericResponseModelToJson(GenericResponseModel data) => json.encode(data.toJson());
class GenericResponseModel {
GenericResponseModel({
this.date,
this.languageId,
this.serviceName,
this.time,
this.androidLink,
this.authenticationTokenId,
this.data,
this.dataw,
this.dietType,
this.dietTypeId,
this.errorCode,
this.errorEndUserMessage,
this.errorEndUserMessageN,
this.errorMessage,
this.errorType,
this.foodCategory,
this.iosLink,
this.isAuthenticated,
this.mealOrderStatus,
this.mealType,
this.messageStatus,
this.numberOfResultRecords,
this.patientBlodType,
this.successMsg,
this.successMsgN,
this.vidaUpdatedResponse,
this.admissionDiagnosisList,
this.admissionMasterList,
this.admissionProcedureList,
this.admissionRequestList,
this.appointmentDate,
this.appointmentId,
this.assessmentList,
this.boxQuantity,
this.chkStatusUpdated,
this.chiefComplaintAuditLogList,
this.clinicId,
this.created,
this.dietTypeList,
this.doctorDetails,
this.doctorHaveOneClinic,
this.doctorId,
this.doctorNotRepliedCounts,
this.doctorSesId,
this.doctorTokId,
this.drugToDrugResponse,
this.erlcInsertPatientInHisgenxList,
this.erlcIsInserted,
this.erlcRequestList,
this.endTime,
this.episodeId,
this.getErAppointmentFeesList,
this.getEpisodeNo,
this.getPatientErSessionStatusList,
this.getVcStatusBySessionIdList,
this.hasAppointment,
this.hasVirtualClinic,
this.httpStatusCode,
this.icdCodesList,
this.isAccepted,
this.isChangePassword,
this.isLogout,
this.isPatientErRequestVcSessionAndTokenUpdated,
this.isPatientSessionStatusInserted,
this.isPatientSessionStatusUpdated,
this.isSent,
this.labResultType,
this.listSickLeavesToExtent,
this.listAdmissionOrders,
this.listAllergies,
this.listApprovalMainInPatient,
this.listChiefComplaint,
this.listClinicAll,
this.listDiabeticChartValues,
this.listDiagnosisForInPatient,
this.listDischargeSummary,
this.listDoctorDeviceDetails,
this.listDoctorProfile,
this.listDoctorProgressNote,
this.listDoctorsClinic,
this.listDoctorsAll,
this.listDrugToDrugTherapy,
this.listGetLabNormal,
this.listGetLabOreders,
this.listGetLabSpecial,
this.listGetMedicationForInpatient,
this.listGetPatientVitalSign,
this.listGetPregressNoteForInPatient,
this.listGetRadOreders,
this.listGtMyPatientsQuestions,
this.listHistory,
this.listIcdCodes,
this.listInterventionHistory,
this.listInterventionMedications,
this.listMyDischargePatient,
this.listMyDischargeReferralPatient,
this.listMyDischargeReferredPatient,
this.listMyInPatient,
this.listMyOutPatient,
this.listMyOutPatientReferral,
this.listMyReferralPatient,
this.listMyReferredOutPatient,
this.listMyReferredPatient,
this.listMyTomorrowPatient,
this.listNursingProgressNote,
this.listOtReservationDetails,
this.listOperationDetails,
this.listPendingDischargeSummary,
this.listPendingOrders,
this.listPendingPatientAdminList,
this.listPendingPatientList,
this.listPrescriptionAuditLogInfo,
this.listPrescriptionReportByPatientId,
this.listPrescriptionReportForInPatient,
this.listRxAuditLogInfo,
this.listStpMasterList,
this.listSpecialClinicalCareList,
this.listSpecialClinicalCareMappingList,
this.logInTokenId,
this.masterLookUpList,
this.medicationList,
this.memberId,
this.orderedProcedureList,
this.patientDetails,
this.patientFileList,
this.patientInfoList,
this.patientInforBySearchCriteriaHisgenxList,
this.patientInforBySearchCriteriaList,
this.patientOutSa,
this.patientsFileInfoList,
this.pendingReferralList,
this.physicalExamAuditLogList,
this.physicalExamList,
this.prescriptionList,
this.procedureList,
this.progressNoteList,
this.progressNotesAuditLogList,
this.projectId,
this.projectInfo,
this.referralList,
this.requestCompleted,
this.requisitionResponse,
this.returnValue,
this.rowCount,
this.smsCode,
this.searchAdmissionList,
this.searchCriteriaKindList,
this.sickLeaveStatistics,
this.sickLeavesList,
this.sserviceId,
this.startTime,
this.statusMessage,
this.strAppointmentDate,
this.totalUnUsedCount,
this.ucafResponse,
this.validateProcedureList,
this.validationErrors,
this.verificationCode,
this.vidaAuthTokenId,
this.vidaRefreshTokenId,
this.vitalSignsHistory,
this.vitalSignsList,
this.admissionResponse,
this.coveringDoctorList,
this.isActiveCode,
this.isSmsSent,
this.listCategories,
this.listClinics,
this.listDoctorDashboarKpi,
this.listItemByMedicineCode,
this.listKeywords,
this.listProcedureCategories,
this.listProcedureResult,
this.memberInformation,
this.patientArrivalList,
this.requisitionList,
this.requisitionScheduleList,
this.requisitionStatusList,
this.resultValue,
this.specialAuthenticate,
});
final dynamic date;
final int? languageId;
final int? serviceName;
final dynamic time;
final dynamic androidLink;
final dynamic authenticationTokenId;
final dynamic data;
final bool? dataw;
final int? dietType;
final int? dietTypeId;
final dynamic errorCode;
final dynamic errorEndUserMessage;
final dynamic errorEndUserMessageN;
final dynamic errorMessage;
final int? errorType;
final int? foodCategory;
final dynamic iosLink;
final bool? isAuthenticated;
final int? mealOrderStatus;
final int? mealType;
final int? messageStatus;
final int? numberOfResultRecords;
final dynamic patientBlodType;
final dynamic successMsg;
final dynamic successMsgN;
final dynamic vidaUpdatedResponse;
final dynamic admissionDiagnosisList;
final dynamic admissionMasterList;
final dynamic admissionProcedureList;
final dynamic admissionRequestList;
final dynamic appointmentDate;
final dynamic appointmentId;
final dynamic assessmentList;
final int? boxQuantity;
final int? chkStatusUpdated;
final dynamic chiefComplaintAuditLogList;
final int? clinicId;
final bool? created;
final dynamic dietTypeList;
final dynamic doctorDetails;
final bool? doctorHaveOneClinic;
final int? doctorId;
final int? doctorNotRepliedCounts;
final dynamic doctorSesId;
final dynamic doctorTokId;
final dynamic drugToDrugResponse;
final dynamic erlcInsertPatientInHisgenxList;
final int? erlcIsInserted;
final dynamic erlcRequestList;
final dynamic endTime;
final int? episodeId;
final dynamic getErAppointmentFeesList;
final int? getEpisodeNo;
final dynamic getPatientErSessionStatusList;
final dynamic getVcStatusBySessionIdList;
final bool? hasAppointment;
final dynamic hasVirtualClinic;
final dynamic httpStatusCode;
final dynamic icdCodesList;
final bool? isAccepted;
final bool? isChangePassword;
final bool? isLogout;
final bool? isPatientErRequestVcSessionAndTokenUpdated;
final bool? isPatientSessionStatusInserted;
final bool? isPatientSessionStatusUpdated;
final bool? isSent;
final int? labResultType;
final dynamic listSickLeavesToExtent;
final dynamic listAdmissionOrders;
final dynamic listAllergies;
final dynamic listApprovalMainInPatient;
final dynamic listChiefComplaint;
final dynamic listClinicAll;
final dynamic listDiabeticChartValues;
final dynamic listDiagnosisForInPatient;
final dynamic listDischargeSummary;
final List<GetIMEIDetailsModel>? listDoctorDeviceDetails;
final dynamic listDoctorProfile;
final dynamic listDoctorProgressNote;
final dynamic listDoctorsClinic;
final dynamic listDoctorsAll;
final dynamic listDrugToDrugTherapy;
final dynamic listGetLabNormal;
final dynamic listGetLabOreders;
final dynamic listGetLabSpecial;
final dynamic listGetMedicationForInpatient;
final dynamic listGetPatientVitalSign;
final dynamic listGetPregressNoteForInPatient;
final dynamic listGetRadOreders;
final dynamic listGtMyPatientsQuestions;
final dynamic listHistory;
final dynamic listIcdCodes;
final dynamic listInterventionHistory;
final dynamic listInterventionMedications;
final dynamic listMyDischargePatient;
final dynamic listMyDischargeReferralPatient;
final dynamic listMyDischargeReferredPatient;
final dynamic listMyInPatient;
final dynamic listMyOutPatient;
final dynamic listMyOutPatientReferral;
final dynamic listMyReferralPatient;
final dynamic listMyReferredOutPatient;
final dynamic listMyReferredPatient;
final dynamic listMyTomorrowPatient;
final dynamic listNursingProgressNote;
final dynamic listOtReservationDetails;
final dynamic listOperationDetails;
final dynamic listPendingDischargeSummary;
final dynamic listPendingOrders;
final dynamic listPendingPatientAdminList;
final dynamic listPendingPatientList;
final dynamic listPrescriptionAuditLogInfo;
final dynamic listPrescriptionReportByPatientId;
final dynamic listPrescriptionReportForInPatient;
final dynamic listRxAuditLogInfo;
final dynamic listStpMasterList;
final dynamic listSpecialClinicalCareList;
final dynamic listSpecialClinicalCareMappingList;
final dynamic logInTokenId;
final dynamic masterLookUpList;
final dynamic medicationList;
final int? memberId;
final dynamic orderedProcedureList;
final dynamic patientDetails;
final dynamic patientFileList;
final dynamic patientInfoList;
final dynamic patientInforBySearchCriteriaHisgenxList;
final dynamic patientInforBySearchCriteriaList;
final bool? patientOutSa;
final dynamic patientsFileInfoList;
final dynamic pendingReferralList;
final dynamic physicalExamAuditLogList;
final dynamic physicalExamList;
final dynamic prescriptionList;
final dynamic procedureList;
final dynamic progressNoteList;
final dynamic progressNotesAuditLogList;
final int? projectId;
final dynamic projectInfo;
final dynamic referralList;
final bool? requestCompleted;
final dynamic requisitionResponse;
final int? returnValue;
final int? rowCount;
final dynamic smsCode;
final dynamic searchAdmissionList;
final dynamic searchCriteriaKindList;
final dynamic sickLeaveStatistics;
final dynamic sickLeavesList;
final dynamic sserviceId;
final dynamic startTime;
final dynamic statusMessage;
final dynamic strAppointmentDate;
final int? totalUnUsedCount;
final dynamic ucafResponse;
final dynamic validateProcedureList;
final dynamic validationErrors;
final dynamic verificationCode;
final dynamic vidaAuthTokenId;
final dynamic vidaRefreshTokenId;
final dynamic vitalSignsHistory;
final dynamic vitalSignsList;
final dynamic admissionResponse;
final dynamic coveringDoctorList;
final bool? isActiveCode;
final bool? isSmsSent;
final dynamic listCategories;
final dynamic listClinics;
final dynamic listDoctorDashboarKpi;
final dynamic listItemByMedicineCode;
final dynamic listKeywords;
final dynamic listProcedureCategories;
final dynamic listProcedureResult;
final dynamic memberInformation;
final dynamic patientArrivalList;
final dynamic requisitionList;
final dynamic requisitionScheduleList;
final dynamic requisitionStatusList;
final int? resultValue;
final bool? specialAuthenticate;
factory GenericResponseModel.fromJson(Map<String, dynamic> json) => GenericResponseModel(
date: json["Date"],
languageId: json["LanguageID"] == null ? null : json["LanguageID"],
serviceName: json["ServiceName"] == null ? null : json["ServiceName"],
time: json["Time"],
androidLink: json["AndroidLink"],
authenticationTokenId: json["AuthenticationTokenID"],
data: json["Data"],
dataw: json["Dataw"] == null ? null : json["Dataw"],
dietType: json["DietType"] == null ? null : json["DietType"],
dietTypeId: json["DietTypeID"] == null ? null : json["DietTypeID"],
errorCode: json["ErrorCode"],
errorEndUserMessage: json["ErrorEndUserMessage"],
errorEndUserMessageN: json["ErrorEndUserMessageN"],
errorMessage: json["ErrorMessage"],
errorType: json["ErrorType"] == null ? null : json["ErrorType"],
foodCategory: json["FoodCategory"] == null ? null : json["FoodCategory"],
iosLink: json["IOSLink"],
isAuthenticated: json["IsAuthenticated"] == null ? null : json["IsAuthenticated"],
mealOrderStatus: json["MealOrderStatus"] == null ? null : json["MealOrderStatus"],
mealType: json["MealType"] == null ? null : json["MealType"],
messageStatus: json["MessageStatus"] == null ? null : json["MessageStatus"],
numberOfResultRecords: json["NumberOfResultRecords"] == null ? null : json["NumberOfResultRecords"],
patientBlodType: json["PatientBlodType"],
successMsg: json["SuccessMsg"],
successMsgN: json["SuccessMsgN"],
vidaUpdatedResponse: json["VidaUpdatedResponse"],
admissionDiagnosisList: json["AdmissionDiagnosisList"],
admissionMasterList: json["AdmissionMasterList"],
admissionProcedureList: json["AdmissionProcedureList"],
admissionRequestList: json["AdmissionRequestList"],
appointmentDate: json["AppointmentDate"],
appointmentId: json["AppointmentID"],
assessmentList: json["AssessmentList"],
boxQuantity: json["BoxQuantity"] == null ? null : json["BoxQuantity"],
chkStatusUpdated: json["CHK_StatusUpdated"] == null ? null : json["CHK_StatusUpdated"],
chiefComplaintAuditLogList: json["ChiefComplaintAuditLogList"],
clinicId: json["ClinicID"] == null ? null : json["ClinicID"],
created: json["Created"] == null ? null : json["Created"],
dietTypeList: json["DietTypeList"],
doctorDetails: json["DoctorDetails"],
doctorHaveOneClinic: json["DoctorHaveOneClinic"] == null ? null : json["DoctorHaveOneClinic"],
doctorId: json["DoctorID"] == null ? null : json["DoctorID"],
doctorNotRepliedCounts: json["DoctorNotRepliedCounts"] == null ? null : json["DoctorNotRepliedCounts"],
doctorSesId: json["DoctorSesID"],
doctorTokId: json["DoctorTokID"],
drugToDrugResponse: json["DrugToDrugResponse"],
erlcInsertPatientInHisgenxList: json["ERLC_InsertPatientInHISGENXList"],
erlcIsInserted: json["ERLC_IsInserted"] == null ? null : json["ERLC_IsInserted"],
erlcRequestList: json["ERLC_RequestList"],
endTime: json["EndTime"],
episodeId: json["EpisodeID"] == null ? null : json["EpisodeID"],
getErAppointmentFeesList: json["GetERAppointmentFeesList"],
getEpisodeNo: json["GetEpisodeNo"] == null ? null : json["GetEpisodeNo"],
getPatientErSessionStatusList: json["GetPatientERSessionStatusList"],
getVcStatusBySessionIdList: json["GetVCStatusBySessionIDList"],
hasAppointment: json["HasAppointment"] == null ? null : json["HasAppointment"],
hasVirtualClinic: json["HasVirtualClinic"],
httpStatusCode: json["HttpStatusCode"],
icdCodesList: json["ICDCodesList"],
isAccepted: json["IsAccepted"] == null ? null : json["IsAccepted"],
isChangePassword: json["IsChangePassword"] == null ? null : json["IsChangePassword"],
isLogout: json["IsLogout"] == null ? null : json["IsLogout"],
isPatientErRequestVcSessionAndTokenUpdated: json["IsPatientERRequestVCSessionAndTokenUpdated"] == null ? null : json["IsPatientERRequestVCSessionAndTokenUpdated"],
isPatientSessionStatusInserted: json["IsPatientSessionStatusInserted"] == null ? null : json["IsPatientSessionStatusInserted"],
isPatientSessionStatusUpdated: json["IsPatientSessionStatusUpdated"] == null ? null : json["IsPatientSessionStatusUpdated"],
isSent: json["IsSent"] == null ? null : json["IsSent"],
labResultType: json["LabResultType"] == null ? null : json["LabResultType"],
listSickLeavesToExtent: json["ListSickLeavesToExtent"],
listAdmissionOrders: json["List_AdmissionOrders"],
listAllergies: json["List_Allergies"],
listApprovalMainInPatient: json["List_ApprovalMain_InPatient"],
listChiefComplaint: json["List_ChiefComplaint"],
listClinicAll: json["List_Clinic_All"],
listDiabeticChartValues: json["List_DiabeticChartValues"],
listDiagnosisForInPatient: json["List_DiagnosisForInPatient"],
listDischargeSummary: json["List_DischargeSummary"],
listDoctorDeviceDetails: json["List_DoctorDeviceDetails"] == null ? null : List<GetIMEIDetailsModel>.from(json["List_DoctorDeviceDetails"].map((x) => x)),
listDoctorProfile: json["List_DoctorProfile"],
listDoctorProgressNote: json["List_DoctorProgressNote"],
listDoctorsClinic: json["List_DoctorsClinic"],
listDoctorsAll: json["List_Doctors_All"],
listDrugToDrugTherapy: json["List_DrugToDrugTherapy"],
listGetLabNormal: json["List_GetLabNormal"],
listGetLabOreders: json["List_GetLabOreders"],
listGetLabSpecial: json["List_GetLabSpecial"],
listGetMedicationForInpatient: json["List_GetMedicationForInpatient"],
listGetPatientVitalSign: json["List_GetPatientVitalSign"],
listGetPregressNoteForInPatient: json["List_GetPregressNoteForInPatient"],
listGetRadOreders: json["List_GetRadOreders"],
listGtMyPatientsQuestions: json["List_GtMyPatientsQuestions"],
listHistory: json["List_History"],
listIcdCodes: json["List_ICDCodes"],
listInterventionHistory: json["List_InterventionHistory"],
listInterventionMedications: json["List_InterventionMedications"],
listMyDischargePatient: json["List_MyDischargePatient"],
listMyDischargeReferralPatient: json["List_MyDischargeReferralPatient"],
listMyDischargeReferredPatient: json["List_MyDischargeReferredPatient"],
listMyInPatient: json["List_MyInPatient"],
listMyOutPatient: json["List_MyOutPatient"],
listMyOutPatientReferral: json["List_MyOutPatientReferral"],
listMyReferralPatient: json["List_MyReferralPatient"],
listMyReferredOutPatient: json["List_MyReferredOutPatient"],
listMyReferredPatient: json["List_MyReferredPatient"],
listMyTomorrowPatient: json["List_MyTomorrowPatient"],
listNursingProgressNote: json["List_NursingProgressNote"],
listOtReservationDetails: json["List_OTReservationDetails"],
listOperationDetails: json["List_OperationDetails"],
listPendingDischargeSummary: json["List_PendingDischargeSummary"],
listPendingOrders: json["List_PendingOrders"],
listPendingPatientAdminList: json["List_PendingPatientAdminList"],
listPendingPatientList: json["List_PendingPatientList"],
listPrescriptionAuditLogInfo: json["List_PrescriptionAuditLogInfo"],
listPrescriptionReportByPatientId: json["List_PrescriptionReportByPatientID"],
listPrescriptionReportForInPatient: json["List_PrescriptionReportForInPatient"],
listRxAuditLogInfo: json["List_RxAuditLogInfo"],
listStpMasterList: json["List_STPMasterList"],
listSpecialClinicalCareList: json["List_SpecialClinicalCareList"],
listSpecialClinicalCareMappingList: json["List_SpecialClinicalCareMappingList"],
logInTokenId: json["LogInTokenID"],
masterLookUpList: json["MasterLookUpList"],
medicationList: json["MedicationList"],
memberId: json["MemberID"] == null ? null : json["MemberID"],
orderedProcedureList: json["OrderedProcedureList"],
patientDetails: json["PatientDetails"],
patientFileList: json["PatientFileList"],
patientInfoList: json["PatientInfo_List"],
patientInforBySearchCriteriaHisgenxList: json["PatientInforBySearchCriteriaHISGENX_List"],
patientInforBySearchCriteriaList: json["PatientInforBySearchCriteria_List"],
patientOutSa: json["PatientOutSA"] == null ? null : json["PatientOutSA"],
patientsFileInfoList: json["PatientsFileInfo_List"],
pendingReferralList: json["PendingReferralList"],
physicalExamAuditLogList: json["PhysicalExamAuditLogList"],
physicalExamList: json["PhysicalExamList"],
prescriptionList: json["PrescriptionList"],
procedureList: json["ProcedureList"],
progressNoteList: json["ProgressNoteList"],
progressNotesAuditLogList: json["ProgressNotesAuditLogList"],
projectId: json["ProjectID"] == null ? null : json["ProjectID"],
projectInfo: json["ProjectInfo"],
referralList: json["ReferralList"],
requestCompleted: json["RequestCompleted"] == null ? null : json["RequestCompleted"],
requisitionResponse: json["RequisitionResponse"],
returnValue: json["ReturnValue"] == null ? null : json["ReturnValue"],
rowCount: json["RowCount"] == null ? null : json["RowCount"],
smsCode: json["SMSCode"],
searchAdmissionList: json["SearchAdmissionList"],
searchCriteriaKindList: json["SearchCriteriaKindList"],
sickLeaveStatistics: json["SickLeaveStatistics"],
sickLeavesList: json["SickLeavesList"],
sserviceId: json["SserviceID"],
startTime: json["StartTime"],
statusMessage: json["StatusMessage"],
strAppointmentDate: json["StrAppointmentDate"],
totalUnUsedCount: json["TotalUnUsedCount"] == null ? null : json["TotalUnUsedCount"],
ucafResponse: json["UcafResponse"],
validateProcedureList: json["ValidateProcedureList"],
validationErrors: json["ValidationErrors"],
verificationCode: json["VerificationCode"],
vidaAuthTokenId: json["VidaAuthTokenID"],
vidaRefreshTokenId: json["VidaRefreshTokenID"],
vitalSignsHistory: json["VitalSignsHistory"],
vitalSignsList: json["VitalSignsList"],
admissionResponse: json["admissionResponse"],
coveringDoctorList: json["coveringDoctorList"],
isActiveCode: json["isActiveCode"] == null ? null : json["isActiveCode"],
isSmsSent: json["isSMSSent"] == null ? null : json["isSMSSent"],
listCategories: json["listCategories"],
listClinics: json["listClinics"],
listDoctorDashboarKpi: json["listDoctorDashboarKPI"],
listItemByMedicineCode: json["listItemByMedicineCode"],
listKeywords: json["listKeywords"],
listProcedureCategories: json["listProcedureCategories"],
listProcedureResult: json["listProcedureResult"],
memberInformation: json["memberInformation"],
patientArrivalList: json["patientArrivalList"],
requisitionList: json["requisitionList"],
requisitionScheduleList: json["requisitionScheduleList"],
requisitionStatusList: json["requisitionStatusList"],
resultValue: json["resultValue"] == null ? null : json["resultValue"],
specialAuthenticate: json["specialAuthenticate"] == null ? null : json["specialAuthenticate"],
);
Map<String, dynamic> toJson() => {
"Date": date,
"LanguageID": languageId == null ? null : languageId,
"ServiceName": serviceName == null ? null : serviceName,
"Time": time,
"AndroidLink": androidLink,
"AuthenticationTokenID": authenticationTokenId,
"Data": data,
"Dataw": dataw == null ? null : dataw,
"DietType": dietType == null ? null : dietType,
"DietTypeID": dietTypeId == null ? null : dietTypeId,
"ErrorCode": errorCode,
"ErrorEndUserMessage": errorEndUserMessage,
"ErrorEndUserMessageN": errorEndUserMessageN,
"ErrorMessage": errorMessage,
"ErrorType": errorType == null ? null : errorType,
"FoodCategory": foodCategory == null ? null : foodCategory,
"IOSLink": iosLink,
"IsAuthenticated": isAuthenticated == null ? null : isAuthenticated,
"MealOrderStatus": mealOrderStatus == null ? null : mealOrderStatus,
"MealType": mealType == null ? null : mealType,
"MessageStatus": messageStatus == null ? null : messageStatus,
"NumberOfResultRecords": numberOfResultRecords == null ? null : numberOfResultRecords,
"PatientBlodType": patientBlodType,
"SuccessMsg": successMsg,
"SuccessMsgN": successMsgN,
"VidaUpdatedResponse": vidaUpdatedResponse,
"AdmissionDiagnosisList": admissionDiagnosisList,
"AdmissionMasterList": admissionMasterList,
"AdmissionProcedureList": admissionProcedureList,
"AdmissionRequestList": admissionRequestList,
"AppointmentDate": appointmentDate,
"AppointmentID": appointmentId,
"AssessmentList": assessmentList,
"BoxQuantity": boxQuantity == null ? null : boxQuantity,
"CHK_StatusUpdated": chkStatusUpdated == null ? null : chkStatusUpdated,
"ChiefComplaintAuditLogList": chiefComplaintAuditLogList,
"ClinicID": clinicId == null ? null : clinicId,
"Created": created == null ? null : created,
"DietTypeList": dietTypeList,
"DoctorDetails": doctorDetails,
"DoctorHaveOneClinic": doctorHaveOneClinic == null ? null : doctorHaveOneClinic,
"DoctorID": doctorId == null ? null : doctorId,
"DoctorNotRepliedCounts": doctorNotRepliedCounts == null ? null : doctorNotRepliedCounts,
"DoctorSesID": doctorSesId,
"DoctorTokID": doctorTokId,
"DrugToDrugResponse": drugToDrugResponse,
"ERLC_InsertPatientInHISGENXList": erlcInsertPatientInHisgenxList,
"ERLC_IsInserted": erlcIsInserted == null ? null : erlcIsInserted,
"ERLC_RequestList": erlcRequestList,
"EndTime": endTime,
"EpisodeID": episodeId == null ? null : episodeId,
"GetERAppointmentFeesList": getErAppointmentFeesList,
"GetEpisodeNo": getEpisodeNo == null ? null : getEpisodeNo,
"GetPatientERSessionStatusList": getPatientErSessionStatusList,
"GetVCStatusBySessionIDList": getVcStatusBySessionIdList,
"HasAppointment": hasAppointment == null ? null : hasAppointment,
"HasVirtualClinic": hasVirtualClinic,
"HttpStatusCode": httpStatusCode,
"ICDCodesList": icdCodesList,
"IsAccepted": isAccepted == null ? null : isAccepted,
"IsChangePassword": isChangePassword == null ? null : isChangePassword,
"IsLogout": isLogout == null ? null : isLogout,
"IsPatientERRequestVCSessionAndTokenUpdated": isPatientErRequestVcSessionAndTokenUpdated == null ? null : isPatientErRequestVcSessionAndTokenUpdated,
"IsPatientSessionStatusInserted": isPatientSessionStatusInserted == null ? null : isPatientSessionStatusInserted,
"IsPatientSessionStatusUpdated": isPatientSessionStatusUpdated == null ? null : isPatientSessionStatusUpdated,
"IsSent": isSent == null ? null : isSent,
"LabResultType": labResultType == null ? null : labResultType,
"ListSickLeavesToExtent": listSickLeavesToExtent,
"List_AdmissionOrders": listAdmissionOrders,
"List_Allergies": listAllergies,
"List_ApprovalMain_InPatient": listApprovalMainInPatient,
"List_ChiefComplaint": listChiefComplaint,
"List_Clinic_All": listClinicAll,
"List_DiabeticChartValues": listDiabeticChartValues,
"List_DiagnosisForInPatient": listDiagnosisForInPatient,
"List_DischargeSummary": listDischargeSummary,
"List_DoctorDeviceDetails": listDoctorDeviceDetails == null ? null : List<dynamic>.from(listDoctorDeviceDetails!.map((x) => x)),
"List_DoctorProfile": listDoctorProfile,
"List_DoctorProgressNote": listDoctorProgressNote,
"List_DoctorsClinic": listDoctorsClinic,
"List_Doctors_All": listDoctorsAll,
"List_DrugToDrugTherapy": listDrugToDrugTherapy,
"List_GetLabNormal": listGetLabNormal,
"List_GetLabOreders": listGetLabOreders,
"List_GetLabSpecial": listGetLabSpecial,
"List_GetMedicationForInpatient": listGetMedicationForInpatient,
"List_GetPatientVitalSign": listGetPatientVitalSign,
"List_GetPregressNoteForInPatient": listGetPregressNoteForInPatient,
"List_GetRadOreders": listGetRadOreders,
"List_GtMyPatientsQuestions": listGtMyPatientsQuestions,
"List_History": listHistory,
"List_ICDCodes": listIcdCodes,
"List_InterventionHistory": listInterventionHistory,
"List_InterventionMedications": listInterventionMedications,
"List_MyDischargePatient": listMyDischargePatient,
"List_MyDischargeReferralPatient": listMyDischargeReferralPatient,
"List_MyDischargeReferredPatient": listMyDischargeReferredPatient,
"List_MyInPatient": listMyInPatient,
"List_MyOutPatient": listMyOutPatient,
"List_MyOutPatientReferral": listMyOutPatientReferral,
"List_MyReferralPatient": listMyReferralPatient,
"List_MyReferredOutPatient": listMyReferredOutPatient,
"List_MyReferredPatient": listMyReferredPatient,
"List_MyTomorrowPatient": listMyTomorrowPatient,
"List_NursingProgressNote": listNursingProgressNote,
"List_OTReservationDetails": listOtReservationDetails,
"List_OperationDetails": listOperationDetails,
"List_PendingDischargeSummary": listPendingDischargeSummary,
"List_PendingOrders": listPendingOrders,
"List_PendingPatientAdminList": listPendingPatientAdminList,
"List_PendingPatientList": listPendingPatientList,
"List_PrescriptionAuditLogInfo": listPrescriptionAuditLogInfo,
"List_PrescriptionReportByPatientID": listPrescriptionReportByPatientId,
"List_PrescriptionReportForInPatient": listPrescriptionReportForInPatient,
"List_RxAuditLogInfo": listRxAuditLogInfo,
"List_STPMasterList": listStpMasterList,
"List_SpecialClinicalCareList": listSpecialClinicalCareList,
"List_SpecialClinicalCareMappingList": listSpecialClinicalCareMappingList,
"LogInTokenID": logInTokenId,
"MasterLookUpList": masterLookUpList,
"MedicationList": medicationList,
"MemberID": memberId == null ? null : memberId,
"OrderedProcedureList": orderedProcedureList,
"PatientDetails": patientDetails,
"PatientFileList": patientFileList,
"PatientInfo_List": patientInfoList,
"PatientInforBySearchCriteriaHISGENX_List": patientInforBySearchCriteriaHisgenxList,
"PatientInforBySearchCriteria_List": patientInforBySearchCriteriaList,
"PatientOutSA": patientOutSa == null ? null : patientOutSa,
"PatientsFileInfo_List": patientsFileInfoList,
"PendingReferralList": pendingReferralList,
"PhysicalExamAuditLogList": physicalExamAuditLogList,
"PhysicalExamList": physicalExamList,
"PrescriptionList": prescriptionList,
"ProcedureList": procedureList,
"ProgressNoteList": progressNoteList,
"ProgressNotesAuditLogList": progressNotesAuditLogList,
"ProjectID": projectId == null ? null : projectId,
"ProjectInfo": projectInfo,
"ReferralList": referralList,
"RequestCompleted": requestCompleted == null ? null : requestCompleted,
"RequisitionResponse": requisitionResponse,
"ReturnValue": returnValue == null ? null : returnValue,
"RowCount": rowCount == null ? null : rowCount,
"SMSCode": smsCode,
"SearchAdmissionList": searchAdmissionList,
"SearchCriteriaKindList": searchCriteriaKindList,
"SickLeaveStatistics": sickLeaveStatistics,
"SickLeavesList": sickLeavesList,
"SserviceID": sserviceId,
"StartTime": startTime,
"StatusMessage": statusMessage,
"StrAppointmentDate": strAppointmentDate,
"TotalUnUsedCount": totalUnUsedCount == null ? null : totalUnUsedCount,
"UcafResponse": ucafResponse,
"ValidateProcedureList": validateProcedureList,
"ValidationErrors": validationErrors,
"VerificationCode": verificationCode,
"VidaAuthTokenID": vidaAuthTokenId,
"VidaRefreshTokenID": vidaRefreshTokenId,
"VitalSignsHistory": vitalSignsHistory,
"VitalSignsList": vitalSignsList,
"admissionResponse": admissionResponse,
"coveringDoctorList": coveringDoctorList,
"isActiveCode": isActiveCode == null ? null : isActiveCode,
"isSMSSent": isSmsSent == null ? null : isSmsSent,
"listCategories": listCategories,
"listClinics": listClinics,
"listDoctorDashboarKPI": listDoctorDashboarKpi,
"listItemByMedicineCode": listItemByMedicineCode,
"listKeywords": listKeywords,
"listProcedureCategories": listProcedureCategories,
"listProcedureResult": listProcedureResult,
"memberInformation": memberInformation,
"patientArrivalList": patientArrivalList,
"requisitionList": requisitionList,
"requisitionScheduleList": requisitionScheduleList,
"requisitionStatusList": requisitionStatusList,
"resultValue": resultValue == null ? null : resultValue,
"specialAuthenticate": specialAuthenticate == null ? null : specialAuthenticate,
};
}

@ -0,0 +1,104 @@
class PostParamsModel {
String? imei;
String? tokenID;
int? languageID;
String? stamp;
String? iPAdress;
double? versionID;
int? channel;
String? sessionID;
bool? isLoginForDoctorApp;
bool? patientOutSA;
String? vidaAuthTokenID;
String? vidaRefreshTokenID;
int? deviceTypeID;
PostParamsModel({
this.imei,
this.tokenID,
this.languageID,
this.stamp,
this.iPAdress,
this.versionID,
this.channel,
this.sessionID,
this.isLoginForDoctorApp,
this.patientOutSA,
this.vidaAuthTokenID,
this.vidaRefreshTokenID,
this.deviceTypeID,
});
PostParamsModel.fromJson(Map<String, dynamic> json) {
imei = json['IMEI'];
tokenID = json['TokenID'];
languageID = json['LanguageID'];
stamp = json['stamp'];
iPAdress = json['IPAdress'];
versionID = json['VersionID'];
channel = json['Channel'];
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
patientOutSA = json['PatientOutSA'];
vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID'];
deviceTypeID = json['DeviceTypeID'];
}
Map<String, dynamic> toJson() {
Map<String, dynamic> data = new Map<String, dynamic>();
data['IMEI'] = this.imei;
data['TokenID'] = this.tokenID;
data['LanguageID'] = this.languageID;
data['stamp'] = this.stamp;
data['IPAdress'] = this.iPAdress;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['PatientOutSA'] = this.patientOutSA;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['DeviceTypeID'] = this.deviceTypeID;
return data;
}
// Map<String, dynamic> toJsonAfterLogin() {
// Map<String, dynamic> data = new Map<String, dynamic>();
// data['VersionID'] = this.versionID;
// data['Channel'] = this.channel;
// data['LanguageID'] = this.languageID;
// data['MobileType'] = this.mobileType;
// data['LogInTokenID'] = this.logInTokenID;
// data['TokenID'] = this.tokenID;
// data['MobileNumber'] = this.mobileNumber;
// data['UserName'] = this.userName;
// data['P_EMAIL_ADDRESS'] = this.pEmailAddress;
// data['P_SESSION_ID'] = this.pSessionId;
// data['PayrollCodeStr'] = this.payrollCodeStr;
// data['LegislationCodeStr'] = this.pLegislationCode;
// data['P_SELECTED_EMPLOYEE_NUMBER'] = this.pSelectedEmployeeNumber;
// data['P_USER_NAME'] = this.pUserName;
// return data;
// }
//
// set setLogInTokenID(String? token) => logInTokenID = token;
//
// set setTokenID(String? token) => tokenID = token;
//
// set setMobileNumer(String? v) => mobileNumber = v;
//
// set setUserName(String? v) => userName = v;
//
// set setPEmailAddress(String? v) => pEmailAddress = v;
//
// set setPSessionId(int? v) => pSessionId = v;
//
// set setPUserName(String? v) => pUserName = v;
//
// set setPSelectedEmployeeNumber(String? v) => pSelectedEmployeeNumber = v;
//
// set setPLegislationCode(String? v) => pLegislationCode = v;
//
// set setPayrollCodeStr(String? v) => payrollCodeStr = v;
}

@ -0,0 +1,128 @@
class GetIMEIDetailsModel {
int? iD;
String? iMEI;
int? logInTypeID;
bool? outSA;
String? mobile;
dynamic identificationNo;
int? doctorID;
String? doctorName;
String? doctorNameN;
int? clinicID;
String? clinicDescription;
dynamic clinicDescriptionN;
int? projectID;
String? projectName;
String? genderDescription;
dynamic genderDescriptionN;
String? titleDescription;
dynamic titleDescriptionN;
dynamic zipCode;
String? createdOn;
dynamic createdBy;
String? editedOn;
dynamic editedBy;
bool? biometricEnabled;
dynamic preferredLanguage;
bool? isActive;
String? vidaAuthTokenID;
String? vidaRefreshTokenID;
String? password;
GetIMEIDetailsModel(
{this.iD,
this.iMEI,
this.logInTypeID,
this.outSA,
this.mobile,
this.identificationNo,
this.doctorID,
this.doctorName,
this.doctorNameN,
this.clinicID,
this.clinicDescription,
this.clinicDescriptionN,
this.projectID,
this.projectName,
this.genderDescription,
this.genderDescriptionN,
this.titleDescription,
this.titleDescriptionN,
this.zipCode,
this.createdOn,
this.createdBy,
this.editedOn,
this.editedBy,
this.biometricEnabled,
this.preferredLanguage,
this.isActive,
this.vidaAuthTokenID,
this.vidaRefreshTokenID,
this.password});
GetIMEIDetailsModel.fromJson(Map<String, dynamic> json) {
iD = json['ID'];
iMEI = json['IMEI'];
logInTypeID = json['LogInTypeID'];
outSA = json['OutSA'];
mobile = json['Mobile'];
identificationNo = json['IdentificationNo'];
doctorID = json['DoctorID'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
clinicID = json['ClinicID'];
clinicDescription = json['ClinicDescription'];
clinicDescriptionN = json['ClinicDescriptionN'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
genderDescription = json['Gender_Description'];
genderDescriptionN = json['Gender_DescriptionN'];
titleDescription = json['Title_Description'];
titleDescriptionN = json['Title_DescriptionN'];
zipCode = json['ZipCode'];
createdOn = json['CreatedOn'];
createdBy = json['CreatedBy'];
editedOn = json['EditedOn'];
editedBy = json['EditedBy'];
biometricEnabled = json['BiometricEnabled'];
preferredLanguage = json['PreferredLanguage'];
isActive = json['IsActive'];
vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID'];
password = json['Password'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ID'] = this.iD;
data['IMEI'] = this.iMEI;
data['LogInTypeID'] = this.logInTypeID;
data['OutSA'] = this.outSA;
data['Mobile'] = this.mobile;
data['IdentificationNo'] = this.identificationNo;
data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName;
data['DoctorNameN'] = this.doctorNameN;
data['ClinicID'] = this.clinicID;
data['ClinicDescription'] = this.clinicDescription;
data['ClinicDescriptionN'] = this.clinicDescriptionN;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['Gender_Description'] = this.genderDescription;
data['Gender_DescriptionN'] = this.genderDescriptionN;
data['Title_Description'] = this.titleDescription;
data['Title_DescriptionN'] = this.titleDescriptionN;
data['ZipCode'] = this.zipCode;
data['CreatedOn'] = this.createdOn;
data['CreatedBy'] = this.createdBy;
data['EditedOn'] = this.editedOn;
data['EditedBy'] = this.editedBy;
data['BiometricEnabled'] = this.biometricEnabled;
data['PreferredLanguage'] = this.preferredLanguage;
data['IsActive'] = this.isActive;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['Password'] = this.password;
return data;
}
}

@ -0,0 +1,46 @@
import 'package:flutter/widgets.dart';
enum _Action {
increment,
decrement,
}
class MyStore extends ValueNotifier<int> {
MyStore() : super(0);
void increment() => value++;
void decrement() => value--;
}
class Bar {}
class Initial implements Bar {}
class Loading implements Bar {}
class Error implements Bar {
Error(this.err);
final Object err;
}
class Loaded implements Bar {
Loaded(this.value);
final int value;
}
class Foo extends ValueNotifier<Bar> {
Foo() : super(Initial());
Future<void> fetch() async {
value = Loading();
try {
final result = await Future<int>.delayed(Duration(seconds: 1));
value = Loaded(result);
} catch (err) {
value = Error(err);
}
}
}

@ -18,8 +18,7 @@ class APIError {
APIError(this.errorCode, this.errorMessage);
Map<String, dynamic> toJson() =>
{'errorCode': errorCode, 'errorMessage': errorMessage};
Map<String, dynamic> toJson() => {'errorCode': errorCode, 'errorMessage': errorMessage};
@override
String toString() {
@ -54,27 +53,33 @@ APIException _throwAPIException(Response response) {
return APIException(APIException.INTERNAL_SERVER_ERROR);
case 444:
var downloadUrl = response.headers["location"];
return APIException(APIException.UPGRADE_REQUIRED,
arguments: downloadUrl);
return APIException(APIException.UPGRADE_REQUIRED, arguments: downloadUrl);
default:
return APIException(APIException.OTHER);
}
}
class ApiClient {
static final ApiClient _instance = ApiClient._internal();
abstract class IApiClient {
Future<U> postJsonForObject<T, U>(FactoryConstructor<U> factoryConstructor, String url, T jsonObject,
{String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0, bool isFormData = false});
ApiClient._internal();
Future<Response> postJsonForResponse<T>(String url, T jsonObject, {String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0, bool isFormData = false});
factory ApiClient() => _instance;
Future<Response> getJsonForResponse<T>(String url, {String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0});
Future<U> postJsonForObject<T, U>(
FactoryConstructor<U> factoryConstructor, String url, T jsonObject,
{String? token,
Map<String, dynamic>? queryParameters,
Map<String, String>? headers,
int retryTimes = 0,
bool isFormData = false}) async {
void setHomeUrl(String url);
}
class ApiClient implements IApiClient {
// static final ApiClient _instance = ApiClient._internal();
// ApiClient._internal();
// factory ApiClient() => _instance;
@override
Future<U> postJsonForObject<T, U>(FactoryConstructor<U> factoryConstructor, String url, T jsonObject,
{String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0, bool isFormData = false}) async {
var _headers = {'Accept': 'application/json'};
if (headers != null && headers.isNotEmpty) {
_headers.addAll(headers);
@ -84,12 +89,7 @@ class ApiClient {
var bodyJson = json.encode(jsonObject);
print("body:$bodyJson");
}
var response = await postJsonForResponse(url, jsonObject,
token: token,
queryParameters: queryParameters,
headers: _headers,
retryTimes: retryTimes,
isFormData: isFormData);
var response = await postJsonForResponse(url, jsonObject, token: token, queryParameters: queryParameters, headers: _headers, retryTimes: retryTimes, isFormData: isFormData);
// try {
if (!kReleaseMode) {
logger.i("res: " + response.body);
@ -102,8 +102,7 @@ class ApiClient {
return factoryConstructor(jsonData);
} else {
APIError? apiError;
apiError =
APIError(jsonData['ErrorCode'], jsonData['ErrorEndUserMessage']);
apiError = APIError(jsonData['ErrorCode'], jsonData['ErrorEndUserMessage']);
throw APIException(APIException.BAD_REQUEST, error: apiError);
}
// } catch (ex) {
@ -115,12 +114,9 @@ class ApiClient {
// }
}
@override
Future<Response> postJsonForResponse<T>(String url, T jsonObject,
{String? token,
Map<String, dynamic>? queryParameters,
Map<String, String>? headers,
int retryTimes = 0,
bool isFormData = false}) async {
{String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0, bool isFormData = false}) async {
String? requestBody;
late Map<String, String> stringObj;
if (jsonObject != null) {
@ -134,22 +130,13 @@ class ApiClient {
if (isFormData) {
headers = {'Content-Type': 'application/x-www-form-urlencoded'};
stringObj = ((jsonObject ?? {}) as Map<String, dynamic>)
.map((key, value) => MapEntry(key, value?.toString() ?? ""));
stringObj = ((jsonObject ?? {}) as Map<String, dynamic>).map((key, value) => MapEntry(key, value?.toString() ?? ""));
}
return await _postForResponse(url, isFormData ? stringObj : requestBody,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes);
return await _postForResponse(url, isFormData ? stringObj : requestBody, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes);
}
Future<Response> _postForResponse(String url, requestBody,
{String? token,
Map<String, dynamic>? queryParameters,
Map<String, String>? headers,
int retryTimes = 0}) async {
Future<Response> _postForResponse(String url, requestBody, {String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0}) async {
try {
var _headers = <String, String>{};
if (token != null) {
@ -164,9 +151,7 @@ class ApiClient {
var queryString = new Uri(queryParameters: queryParameters).query;
url = url + '?' + queryString;
}
var response =
await _post(Uri.parse(url), body: requestBody, headers: _headers)
.timeout(Duration(seconds: 120));
var response = await _post(Uri.parse(url), body: requestBody, headers: _headers).timeout(Duration(seconds: 120));
if (response.statusCode >= 200 && response.statusCode < 300) {
return response;
@ -177,11 +162,7 @@ class ApiClient {
if (retryTimes > 0) {
print('will retry after 3 seconds...');
await Future.delayed(Duration(seconds: 3));
return await _postForResponse(url, requestBody,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes - 1);
return await _postForResponse(url, requestBody, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1);
} else {
throw APIException(APIException.OTHER, arguments: e);
}
@ -189,11 +170,7 @@ class ApiClient {
if (retryTimes > 0) {
print('will retry after 3 seconds...');
await Future.delayed(Duration(seconds: 3));
return await _postForResponse(url, requestBody,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes - 1);
return await _postForResponse(url, requestBody, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1);
} else {
throw APIException(APIException.OTHER, arguments: e);
}
@ -203,39 +180,24 @@ class ApiClient {
if (retryTimes > 0) {
print('will retry after 3 seconds...');
await Future.delayed(Duration(seconds: 3));
return await _postForResponse(url, requestBody,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes - 1);
return await _postForResponse(url, requestBody, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1);
} else {
throw APIException(APIException.OTHER, arguments: e);
}
}
}
Future<Response> getJsonForResponse<T>(String url,
{String? token,
Map<String, dynamic>? queryParameters,
Map<String, String>? headers,
int retryTimes = 0}) async {
@override
Future<Response> getJsonForResponse<T>(String url, {String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0}) async {
if (headers == null) {
headers = {'Content-Type': 'application/json'};
} else {
headers['Content-Type'] = 'application/json';
}
return await _getForResponse(url,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes);
return await _getForResponse(url, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes);
}
Future<Response> _getForResponse(String url,
{String? token,
Map<String, dynamic>? queryParameters,
Map<String, String>? headers,
int retryTimes = 0}) async {
Future<Response> _getForResponse(String url, {String? token, Map<String, dynamic>? queryParameters, Map<String, String>? headers, int retryTimes = 0}) async {
try {
var _headers = <String, String>{};
if (token != null) {
@ -250,8 +212,7 @@ class ApiClient {
var queryString = new Uri(queryParameters: queryParameters).query;
url = url + '?' + queryString;
}
var response = await _get(Uri.parse(url), headers: _headers)
.timeout(Duration(seconds: 60));
var response = await _get(Uri.parse(url), headers: _headers).timeout(Duration(seconds: 60));
if (response.statusCode >= 200 && response.statusCode < 300) {
return response;
@ -262,11 +223,7 @@ class ApiClient {
if (retryTimes > 0) {
print('will retry after 3 seconds...');
await Future.delayed(Duration(seconds: 3));
return await _getForResponse(url,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes - 1);
return await _getForResponse(url, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1);
} else {
throw APIException(APIException.OTHER, arguments: e);
}
@ -274,11 +231,7 @@ class ApiClient {
if (retryTimes > 0) {
print('will retry after 3 seconds...');
await Future.delayed(Duration(seconds: 3));
return await _getForResponse(url,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes - 1);
return await _getForResponse(url, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1);
} else {
throw APIException(APIException.OTHER, arguments: e);
}
@ -288,19 +241,14 @@ class ApiClient {
if (retryTimes > 0) {
print('will retry after 3 seconds...');
await Future.delayed(Duration(seconds: 3));
return await _getForResponse(url,
token: token,
queryParameters: queryParameters,
headers: headers,
retryTimes: retryTimes - 1);
return await _getForResponse(url, token: token, queryParameters: queryParameters, headers: headers, retryTimes: retryTimes - 1);
} else {
throw APIException(APIException.OTHER, arguments: e);
}
}
}
Future<Response> _get(url, {Map<String, String>? headers}) =>
_withClient((client) => client.get(url, headers: headers));
Future<Response> _get(url, {Map<String, String>? headers}) => _withClient((client) => client.get(url, headers: headers));
bool _certificateCheck(X509Certificate cert, String host, int port) => true;
@ -314,8 +262,10 @@ class ApiClient {
}
}
Future<Response> _post(url,
{Map<String, String>? headers, body, Encoding? encoding}) =>
_withClient((client) =>
client.post(url, headers: headers, body: body, encoding: encoding));
Future<Response> _post(url, {Map<String, String>? headers, body, Encoding? encoding}) => _withClient((client) => client.post(url, headers: headers, body: body, encoding: encoding));
@override
void setHomeUrl(String url) {
// TODO: implement setHomeUrl
}
}

@ -0,0 +1,24 @@
import 'dart:io';
import 'package:firebase_messaging/firebase_messaging.dart';
abstract class IFirebaseService {
Future<String> getFirebaseToke();
}
class FirebaseService implements IFirebaseService {
final FirebaseMessaging? _firebaseMessaging = FirebaseMessaging.instance;
FirebaseService() {
_firebaseMessaging!.setAutoInitEnabled(true);
if (Platform.isIOS) {
_firebaseMessaging!.requestPermission();
}
}
@override
Future<String> getFirebaseToke() async {
var token = await _firebaseMessaging!.getToken();
return token ?? "";
}
}

@ -1,6 +1,34 @@
import 'package:flutter/material.dart';
import 'package:hmg_nurses/api_repo/login_api_repo.dart';
import 'package:hmg_nurses/services/firebase_service.dart';
import 'package:injector/injector.dart';
import '../../classes/utils.dart';
class SplashPage extends StatefulWidget {
@override
State<SplashPage> createState() => _SplashPageState();
}
class _SplashPageState extends State<SplashPage> {
final ILoginApiRepo _loginApiRepo = Injector.appInstance.get<ILoginApiRepo>();
@override
void initState() {
super.initState();
getData();
}
getData() async {
try {
await _loginApiRepo.getDeviceInfoByIMEI();
} catch (e) {
Utils.handleException(e, context, (msg) {
Utils.confirmDialog(context, msg);
});
}
}
class SplashPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold();

@ -1,6 +1,13 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_flutterfire_internals:
dependency: transitive
description:
name: _flutterfire_internals
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.8"
args:
dependency: transitive
description:
@ -43,6 +50,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
cloud_firestore_platform_interface:
dependency: transitive
description:
name: cloud_firestore_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "5.8.5"
cloud_firestore_web:
dependency: transitive
description:
name: cloud_firestore_web
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.5"
collection:
dependency: transitive
description:
@ -99,6 +120,48 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.4"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "4.5.2"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
firebase_messaging:
dependency: "direct main"
description:
name: firebase_messaging
url: "https://pub.dartlang.org"
source: hosted
version: "14.1.0"
firebase_messaging_platform_interface:
dependency: transitive
description:
name: firebase_messaging_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.6"
firebase_messaging_web:
dependency: transitive
description:
name: firebase_messaging_web
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.6"
flutter:
dependency: "direct main"
description: flutter

@ -50,6 +50,12 @@ dependencies:
shimmer: ^2.0.0
sizer: ^2.0.15
# Firebase
firebase_messaging: ^14.1.0
firebase_core: ^2.2.0
dev_dependencies:
flutter_test:
sdk: flutter

@ -13,7 +13,7 @@ import 'package:hmg_nurses/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);

Loading…
Cancel
Save