diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 82805ecc..9cd98ee3 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -30,7 +30,7 @@
json) {
+ patientMobileNumber = json['PatientMobileNumber'];
+ mobileNo = json['MobileNo'];
+ projectOutSA = json['ProjectOutSA'];
+ loginType = json['LoginType'];
+ zipCode = json['ZipCode'];
+ isRegister = json['isRegister'];
+ logInTokenID = json['LogInTokenID'];
+ searchType = json['SearchType'];
+ patientID = json['PatientID'];
+ nationalID = json['NationalID'];
+ patientIdentificationID = json['PatientIdentificationID'];
+ forRegisteration = json['ForRegisteration'];
+ activationCode = json['activationCode'];
+ versionID = json['VersionID'];
+ channel = json['Channel'];
+ languageID = json['LanguageID'];
+ iPAdress = json['IPAdress'];
+ generalid = json['generalid'];
+ patientOutSA = json['PatientOutSA'];
+ sessionID = json['SessionID'];
+ isDentalAllowedBackend = json['isDentalAllowedBackend'];
+ deviceTypeID = json['DeviceTypeID'];
+ dOB = json['DOB'];
+ isHijri = json['IsHijri'];
+ healthId = json['HealthId'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['PatientMobileNumber'] = this.patientMobileNumber;
+ data['MobileNo'] = this.mobileNo;
+ data['ProjectOutSA'] = this.projectOutSA;
+ data['LoginType'] = this.loginType;
+ data['ZipCode'] = this.zipCode;
+ data['isRegister'] = this.isRegister;
+ data['LogInTokenID'] = this.logInTokenID;
+ data['SearchType'] = this.searchType;
+ data['PatientID'] = this.patientID;
+ data['NationalID'] = this.nationalID;
+ data['PatientIdentificationID'] = this.patientIdentificationID;
+ data['ForRegisteration'] = this.forRegisteration;
+ data['activationCode'] = this.activationCode;
+ data['VersionID'] = this.versionID;
+ data['Channel'] = this.channel;
+ data['LanguageID'] = this.languageID;
+ data['IPAdress'] = this.iPAdress;
+ data['generalid'] = this.generalid;
+ data['PatientOutSA'] = this.patientOutSA;
+ data['SessionID'] = this.sessionID;
+ data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
+ data['DeviceTypeID'] = this.deviceTypeID;
+ data['DOB'] = this.dOB;
+ data['IsHijri'] = this.isHijri;
+ data['HealthId'] = this.healthId;
+ return data;
+ }
+}
diff --git a/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart
new file mode 100644
index 00000000..3465cf8d
--- /dev/null
+++ b/lib/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart
@@ -0,0 +1,80 @@
+class CheckPatientForRegistrationModel {
+ int patientIdentificationID;
+ int patientMobileNumber;
+ String zipCode;
+ double versionID;
+ int channel;
+ int languageID;
+ String iPAdress;
+ String generalid;
+ int patientOutSA;
+ Null sessionID;
+ bool isDentalAllowedBackend;
+ int deviceTypeID;
+ String tokenID;
+ int patientID;
+ bool isRegister;
+ String dOB;
+ int isHijri;
+
+ CheckPatientForRegistrationModel(
+ {this.patientIdentificationID,
+ this.patientMobileNumber,
+ this.zipCode,
+ this.versionID,
+ this.channel,
+ this.languageID,
+ this.iPAdress,
+ this.generalid,
+ this.patientOutSA,
+ this.sessionID,
+ this.isDentalAllowedBackend,
+ this.deviceTypeID,
+ this.tokenID,
+ this.patientID,
+ this.isRegister,
+ this.dOB,
+ this.isHijri});
+
+ CheckPatientForRegistrationModel.fromJson(Map json) {
+ patientIdentificationID = json['PatientIdentificationID'];
+ patientMobileNumber = json['PatientMobileNumber'];
+ zipCode = json['ZipCode'];
+ versionID = json['VersionID'];
+ channel = json['Channel'];
+ languageID = json['LanguageID'];
+ iPAdress = json['IPAdress'];
+ generalid = json['generalid'];
+ patientOutSA = json['PatientOutSA'];
+ sessionID = json['SessionID'];
+ isDentalAllowedBackend = json['isDentalAllowedBackend'];
+ deviceTypeID = json['DeviceTypeID'];
+ tokenID = json['TokenID'];
+ patientID = json['PatientID'];
+ isRegister = json['isRegister'];
+ dOB = json['DOB'];
+ isHijri = json['IsHijri'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['PatientIdentificationID'] = this.patientIdentificationID;
+ data['PatientMobileNumber'] = this.patientMobileNumber;
+ data['ZipCode'] = this.zipCode;
+ data['VersionID'] = this.versionID;
+ data['Channel'] = this.channel;
+ data['LanguageID'] = this.languageID;
+ data['IPAdress'] = this.iPAdress;
+ data['generalid'] = this.generalid;
+ data['PatientOutSA'] = this.patientOutSA;
+ data['SessionID'] = this.sessionID;
+ data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
+ data['DeviceTypeID'] = this.deviceTypeID;
+ data['TokenID'] = this.tokenID;
+ data['PatientID'] = this.patientID;
+ data['isRegister'] = this.isRegister;
+ data['DOB'] = this.dOB;
+ data['IsHijri'] = this.isHijri;
+ return data;
+ }
+}
diff --git a/lib/core/model/PatientRegistration/PatientRegistrationModel.dart b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart
new file mode 100644
index 00000000..83ff53d7
--- /dev/null
+++ b/lib/core/model/PatientRegistration/PatientRegistrationModel.dart
@@ -0,0 +1,185 @@
+class PatientRegistrationModel {
+ Patientobject patientobject;
+ String patientIdentificationID;
+ String patientMobileNumber;
+ String logInTokenID;
+ double versionID;
+ int channel;
+ int languageID;
+ String iPAdress;
+ String generalid;
+ int patientOutSA;
+ Null sessionID;
+ bool isDentalAllowedBackend;
+ int deviceTypeID;
+ String tokenID;
+ String dOB;
+ int isHijri;
+ String healthId;
+ String zipCode;
+
+ PatientRegistrationModel(
+ {this.patientobject,
+ this.patientIdentificationID,
+ this.patientMobileNumber,
+ this.logInTokenID,
+ this.versionID,
+ this.channel,
+ this.languageID,
+ this.iPAdress,
+ this.generalid,
+ this.patientOutSA,
+ this.sessionID,
+ this.isDentalAllowedBackend,
+ this.deviceTypeID,
+ this.tokenID,
+ this.dOB,
+ this.isHijri,
+ this.healthId,
+ this.zipCode});
+
+ PatientRegistrationModel.fromJson(Map json) {
+ patientobject = json['Patientobject'] != null
+ ? new Patientobject.fromJson(json['Patientobject'])
+ : null;
+ patientIdentificationID = json['PatientIdentificationID'];
+ patientMobileNumber = json['PatientMobileNumber'];
+ logInTokenID = json['LogInTokenID'];
+ versionID = json['VersionID'];
+ channel = json['Channel'];
+ languageID = json['LanguageID'];
+ iPAdress = json['IPAdress'];
+ generalid = json['generalid'];
+ patientOutSA = json['PatientOutSA'];
+ sessionID = json['SessionID'];
+ isDentalAllowedBackend = json['isDentalAllowedBackend'];
+ deviceTypeID = json['DeviceTypeID'];
+ tokenID = json['TokenID'];
+ dOB = json['DOB'];
+ isHijri = json['IsHijri'];
+ healthId = json['HealthId'];
+ zipCode = json['ZipCode'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ if (this.patientobject != null) {
+ data['Patientobject'] = this.patientobject.toJson();
+ }
+ data['PatientIdentificationID'] = this.patientIdentificationID;
+ data['PatientMobileNumber'] = this.patientMobileNumber;
+ data['LogInTokenID'] = this.logInTokenID;
+ data['VersionID'] = this.versionID;
+ data['Channel'] = this.channel;
+ data['LanguageID'] = this.languageID;
+ data['IPAdress'] = this.iPAdress;
+ data['generalid'] = this.generalid;
+ data['PatientOutSA'] = this.patientOutSA;
+ data['SessionID'] = this.sessionID;
+ data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
+ data['DeviceTypeID'] = this.deviceTypeID;
+ data['TokenID'] = this.tokenID;
+ data['DOB'] = this.dOB;
+ data['IsHijri'] = this.isHijri;
+ data['HealthId'] = this.healthId;
+ data['ZipCode'] = this.zipCode;
+ return data;
+ }
+}
+
+class Patientobject {
+ bool tempValue;
+ int patientIdentificationType;
+ String patientIdentificationNo;
+ int mobileNumber;
+ int patientOutSA;
+ String firstNameN;
+ String middleNameN;
+ String lastNameN;
+ String firstName;
+ String middleName;
+ String lastName;
+ String strDateofBirth;
+ String dateofBirth;
+ int gender;
+ String nationalityID;
+ String dateofBirthN;
+ String emailAddress;
+ String sourceType;
+ String preferredLanguage;
+ String marital;
+ String eHealthIDField;
+
+ Patientobject(
+ {this.tempValue,
+ this.patientIdentificationType,
+ this.patientIdentificationNo,
+ this.mobileNumber,
+ this.patientOutSA,
+ this.firstNameN,
+ this.middleNameN,
+ this.lastNameN,
+ this.firstName,
+ this.middleName,
+ this.lastName,
+ this.strDateofBirth,
+ this.dateofBirth,
+ this.gender,
+ this.nationalityID,
+ this.dateofBirthN,
+ this.emailAddress,
+ this.sourceType,
+ this.preferredLanguage,
+ this.marital,
+ this.eHealthIDField});
+
+ Patientobject.fromJson(Map json) {
+ tempValue = json['TempValue'];
+ patientIdentificationType = json['PatientIdentificationType'];
+ patientIdentificationNo = json['PatientIdentificationNo'];
+ mobileNumber = json['MobileNumber'];
+ patientOutSA = json['PatientOutSA'];
+ firstNameN = json['FirstNameN'];
+ middleNameN = json['MiddleNameN'];
+ lastNameN = json['LastNameN'];
+ firstName = json['FirstName'];
+ middleName = json['MiddleName'];
+ lastName = json['LastName'];
+ strDateofBirth = json['StrDateofBirth'];
+ dateofBirth = json['DateofBirth'];
+ gender = json['Gender'];
+ nationalityID = json['NationalityID'];
+ dateofBirthN = json['DateofBirthN'];
+ emailAddress = json['EmailAddress'];
+ sourceType = json['SourceType'];
+ preferredLanguage = json['PreferredLanguage'];
+ marital = json['Marital'];
+ eHealthIDField = json['eHealthIDField'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['TempValue'] = this.tempValue;
+ data['PatientIdentificationType'] = this.patientIdentificationType;
+ data['PatientIdentificationNo'] = this.patientIdentificationNo;
+ data['MobileNumber'] = this.mobileNumber;
+ data['PatientOutSA'] = this.patientOutSA;
+ data['FirstNameN'] = this.firstNameN;
+ data['MiddleNameN'] = this.middleNameN;
+ data['LastNameN'] = this.lastNameN;
+ data['FirstName'] = this.firstName;
+ data['MiddleName'] = this.middleName;
+ data['LastName'] = this.lastName;
+ data['StrDateofBirth'] = this.strDateofBirth;
+ data['DateofBirth'] = this.dateofBirth;
+ data['Gender'] = this.gender;
+ data['NationalityID'] = this.nationalityID;
+ data['DateofBirthN'] = this.dateofBirthN;
+ data['EmailAddress'] = this.emailAddress;
+ data['SourceType'] = this.sourceType;
+ data['PreferredLanguage'] = this.preferredLanguage;
+ data['Marital'] = this.marital;
+ data['eHealthIDField'] = this.eHealthIDField;
+ return data;
+ }
+}
diff --git a/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart
new file mode 100644
index 00000000..8244a95f
--- /dev/null
+++ b/lib/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart
@@ -0,0 +1,109 @@
+class SendActivationCodeByOTPNotificationTypeForRegistrationModel {
+ int patientMobileNumber;
+ String mobileNo;
+ int projectOutSA;
+ int loginType;
+ String zipCode;
+ bool isRegister;
+ String logInTokenID;
+ int searchType;
+ int patientID;
+ int nationalID;
+ int patientIdentificationID;
+ int oTPSendType;
+ int languageID;
+ double versionID;
+ int channel;
+ String iPAdress;
+ String generalid;
+ int patientOutSA;
+ Null sessionID;
+ bool isDentalAllowedBackend;
+ int deviceTypeID;
+ String dOB;
+ int isHijri;
+ String healthId;
+
+ SendActivationCodeByOTPNotificationTypeForRegistrationModel(
+ {this.patientMobileNumber,
+ this.mobileNo,
+ this.projectOutSA,
+ this.loginType,
+ this.zipCode,
+ this.isRegister,
+ this.logInTokenID,
+ this.searchType,
+ this.patientID,
+ this.nationalID,
+ this.patientIdentificationID,
+ this.oTPSendType,
+ this.languageID,
+ this.versionID,
+ this.channel,
+ this.iPAdress,
+ this.generalid,
+ this.patientOutSA,
+ this.sessionID,
+ this.isDentalAllowedBackend,
+ this.deviceTypeID,
+ this.dOB,
+ this.isHijri,
+ this.healthId});
+
+ SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson(
+ Map json) {
+ patientMobileNumber = json['PatientMobileNumber'];
+ mobileNo = json['MobileNo'];
+ projectOutSA = json['ProjectOutSA'];
+ loginType = json['LoginType'];
+ zipCode = json['ZipCode'];
+ isRegister = json['isRegister'];
+ logInTokenID = json['LogInTokenID'];
+ searchType = json['SearchType'];
+ patientID = json['PatientID'];
+ nationalID = json['NationalID'];
+ patientIdentificationID = json['PatientIdentificationID'];
+ oTPSendType = json['OTP_SendType'];
+ languageID = json['LanguageID'];
+ versionID = json['VersionID'];
+ channel = json['Channel'];
+ iPAdress = json['IPAdress'];
+ generalid = json['generalid'];
+ patientOutSA = json['PatientOutSA'];
+ sessionID = json['SessionID'];
+ isDentalAllowedBackend = json['isDentalAllowedBackend'];
+ deviceTypeID = json['DeviceTypeID'];
+ dOB = json['DOB'];
+ isHijri = json['IsHijri'];
+ healthId = json['HealthId'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['PatientMobileNumber'] = this.patientMobileNumber;
+ data['MobileNo'] = this.mobileNo;
+ data['ProjectOutSA'] = this.projectOutSA;
+ data['LoginType'] = this.loginType;
+ data['ZipCode'] = this.zipCode;
+ data['isRegister'] = this.isRegister;
+ data['LogInTokenID'] = this.logInTokenID;
+ data['SearchType'] = this.searchType;
+ data['PatientID'] = this.patientID;
+ data['NationalID'] = this.nationalID;
+ data['PatientIdentificationID'] = this.patientIdentificationID;
+ data['OTP_SendType'] = this.oTPSendType;
+ data['LanguageID'] = this.languageID;
+ data['VersionID'] = this.versionID;
+ data['Channel'] = this.channel;
+ data['IPAdress'] = this.iPAdress;
+ data['generalid'] = this.generalid;
+ data['PatientOutSA'] = this.patientOutSA;
+ data['SessionID'] = this.sessionID;
+ data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
+ data['DeviceTypeID'] = this.deviceTypeID;
+ data['DOB'] = this.dOB;
+ data['IsHijri'] = this.isHijri;
+ data['HealthId'] = this.healthId;
+ return data;
+ }
+}
diff --git a/lib/core/service/PatientRegistrationService.dart b/lib/core/service/PatientRegistrationService.dart
new file mode 100644
index 00000000..fefa9021
--- /dev/null
+++ b/lib/core/service/PatientRegistrationService.dart
@@ -0,0 +1,51 @@
+import 'package:doctor_app_flutter/config/config.dart';
+import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckActivationCodeModel.dart';
+import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart';
+import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart';
+import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart';
+import 'package:doctor_app_flutter/core/service/base/base_service.dart';
+
+class PatientRegistrationService extends BaseService {
+ checkPatientForRegistration(
+ CheckPatientForRegistrationModel registrationModel) async {
+ hasError = false;
+ await baseAppClient.post(CHECK_PATIENT_FOR_REGISTRATION,
+ onSuccess: (dynamic response, int statusCode) {},
+ onFailure: (String error, int statusCode) {
+ hasError = true;
+ super.error = error;
+ }, body: registrationModel.toJson());
+ }
+
+ sendActivationCodeByOTPNotificationType(
+ SendActivationCodeByOTPNotificationTypeForRegistrationModel
+ registrationModel) async {
+ hasError = false;
+ await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE,
+ onSuccess: (dynamic response, int statusCode) {},
+ onFailure: (String error, int statusCode) {
+ hasError = true;
+ super.error = error;
+ }, body: registrationModel.toJson());
+ }
+
+ checkActivationCode(CheckActivationCodeModel registrationModel) async {
+ hasError = false;
+ await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_PATIENT,
+ onSuccess: (dynamic response, int statusCode) {},
+ onFailure: (String error, int statusCode) {
+ hasError = true;
+ super.error = error;
+ }, body: registrationModel.toJson());
+ }
+
+ registrationPatient(PatientRegistrationModel registrationModel) async {
+ hasError = false;
+ await baseAppClient.post(PATIENT_REGISTRATION,
+ onSuccess: (dynamic response, int statusCode) {},
+ onFailure: (String error, int statusCode) {
+ hasError = true;
+ super.error = error;
+ }, body: registrationModel.toJson());
+ }
+}
diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart
index ade01d9b..58526da7 100644
--- a/lib/core/service/base/base_service.dart
+++ b/lib/core/service/base/base_service.dart
@@ -1,5 +1,4 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
-import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@@ -44,38 +43,5 @@ class BaseService {
}
}
- Future getPatientArrivalList(String date,{String fromDate, int patientMrn = -1, int appointmentNo = -1}) async{
- hasError = false;
- Map body = Map();
- body['From'] = fromDate == null ? date : fromDate;
- body['To'] = date;
- body['PageIndex'] = 0;
- body['PageSize'] = 0;
- if(patientMrn != -1){
- body['PatientMRN'] = patientMrn;
- }
- if(appointmentNo != -1){
- body['AppointmentNo'] = appointmentNo;
- }
-
- await baseAppClient.post(
- ARRIVED_PATIENT_URL,
- onSuccess: (dynamic response, int statusCode) {
- patientArrivalList.clear();
-
- if(response['patientArrivalList']['entityList'] != null){
- response['patientArrivalList']['entityList'].forEach((v) {
- PatiantInformtion item = PatiantInformtion.fromJson(v);
- patientArrivalList.add(item);
- });
- }
- },
- onFailure: (String error, int statusCode) {
- hasError = true;
- this.error = error;
- },
- body: body,
- );
- }
}
diff --git a/lib/core/service/patient/PatientRegisterService.dart b/lib/core/service/patient/PatientRegisterService.dart
deleted file mode 100644
index a7013a3c..00000000
--- a/lib/core/service/patient/PatientRegisterService.dart
+++ /dev/null
@@ -1,5 +0,0 @@
-import 'package:doctor_app_flutter/core/service/base/base_service.dart';
-
-class PatientRegisterService extends BaseService{
-
-}
\ No newline at end of file
diff --git a/lib/core/viewModel/PatientRegisterViewModel.dart b/lib/core/viewModel/PatientRegisterViewModel.dart
deleted file mode 100644
index 43aa7500..00000000
--- a/lib/core/viewModel/PatientRegisterViewModel.dart
+++ /dev/null
@@ -1,8 +0,0 @@
-import 'package:doctor_app_flutter/core/service/patient/PatientRegisterService.dart';
-import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
-
-import '../../locator.dart';
-
-class PatientRegisterViewModel extends BaseViewModel {
- PatientRegisterService _service = locator();
-}
\ No newline at end of file
diff --git a/lib/core/viewModel/PatientRegistrationViewModel.dart b/lib/core/viewModel/PatientRegistrationViewModel.dart
new file mode 100644
index 00000000..6dddffcd
--- /dev/null
+++ b/lib/core/viewModel/PatientRegistrationViewModel.dart
@@ -0,0 +1,59 @@
+import 'package:doctor_app_flutter/core/enum/viewstate.dart';
+import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckActivationCodeModel.dart';
+import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart';
+import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart';
+import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart';
+import 'package:doctor_app_flutter/core/service/PatientRegistrationService.dart';
+import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
+
+import '../../locator.dart';
+
+class PatientRegistrationViewModel extends BaseViewModel {
+ PatientRegistrationService _patientRegistrationService =
+ locator();
+
+ Future checkPatientForRegistration(
+ CheckPatientForRegistrationModel registrationModel) async {
+ setState(ViewState.Busy);
+ await _patientRegistrationService
+ .checkPatientForRegistration(registrationModel);
+ if (_patientRegistrationService.hasError) {
+ error = _patientRegistrationService.error;
+ setState(ViewState.Error);
+ } else
+ setState(ViewState.Idle);
+ }
+
+ Future sendActivationCodeByOTPNotificationType(
+ SendActivationCodeByOTPNotificationTypeForRegistrationModel
+ registrationModel) async {
+ setState(ViewState.Busy);
+ await _patientRegistrationService
+ .sendActivationCodeByOTPNotificationType(registrationModel);
+ if (_patientRegistrationService.hasError) {
+ error = _patientRegistrationService.error;
+ setState(ViewState.Error);
+ } else
+ setState(ViewState.Idle);
+ }
+
+ Future checkActivationCode(CheckActivationCodeModel registrationModel) async {
+ setState(ViewState.Busy);
+ await _patientRegistrationService.checkActivationCode(registrationModel);
+ if (_patientRegistrationService.hasError) {
+ error = _patientRegistrationService.error;
+ setState(ViewState.Error);
+ } else
+ setState(ViewState.Idle);
+ }
+
+ Future registrationPatient(PatientRegistrationModel registrationModel) async {
+ setState(ViewState.Busy);
+ await _patientRegistrationService.registrationPatient(registrationModel);
+ if (_patientRegistrationService.hasError) {
+ error = _patientRegistrationService.error;
+ setState(ViewState.Error);
+ } else
+ setState(ViewState.Idle);
+ }
+}
diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart
index 4240e848..93635629 100644
--- a/lib/core/viewModel/patient-referral-viewmodel.dart
+++ b/lib/core/viewModel/patient-referral-viewmodel.dart
@@ -256,17 +256,7 @@ class PatientReferralViewModel extends BaseViewModel {
}
}
- Future getPatientDetails(String fromDate, String toDate, int patientMrn, int appointmentNo) async {
- setState(ViewState.Busy);
- await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn);
- if (_referralPatientService.hasError) {
- error = _referralPatientService.error;
- setState(ViewState.Error);
- } else {
- setState(ViewState.Idle);
- }
- }
Future getReferralFrequencyList() async {
setState(ViewState.Busy);
diff --git a/lib/locator.dart b/lib/locator.dart
index d67b2d35..243905d8 100644
--- a/lib/locator.dart
+++ b/lib/locator.dart
@@ -16,6 +16,7 @@ import 'package:get_it/get_it.dart';
import 'core/service/AnalyticsService.dart';
import 'core/service/NavigationService.dart';
+import 'core/service/PatientRegistrationService.dart';
import 'core/service/VideoCallService.dart';
import 'core/service/home/dasboard_service.dart';
import 'core/service/home/doctor_reply_service.dart';
@@ -25,7 +26,6 @@ import 'core/service/patient/DischargedPatientService.dart';
import 'core/service/patient/LiveCarePatientServices.dart';
import 'core/service/patient/MyReferralPatientService.dart';
import 'core/service/patient/PatientMuseService.dart';
-import 'core/service/patient/PatientRegisterService.dart';
import 'core/service/patient/ReferralService.dart';
import 'core/service/patient/out_patient_service.dart';
import 'core/service/patient/patient-doctor-referral-service.dart';
@@ -52,7 +52,7 @@ import 'core/viewModel/InsuranceViewModel.dart';
import 'core/viewModel/LiveCarePatientViewModel.dart';
import 'core/viewModel/PatientMedicalReportViewModel.dart';
import 'core/viewModel/PatientMuseViewModel.dart';
-import 'core/viewModel/PatientRegisterViewModel.dart';
+import 'core/viewModel/PatientRegistrationViewModel.dart';
import 'core/viewModel/PatientSearchViewModel.dart';
import 'core/viewModel/SOAP_view_model.dart';
import 'core/viewModel/doctor_replay_view_model.dart';
@@ -108,7 +108,7 @@ void setupLocator() {
locator.registerLazySingleton(() => AnalyticsService());
locator.registerLazySingleton(() => OperationReportService());
locator.registerLazySingleton(() => PendingOrderService());
- locator.registerLazySingleton(() => PatientRegisterService());
+ locator.registerLazySingleton(() => PatientRegistrationService());
/// View Model
locator.registerFactory(() => DoctorReplayViewModel());
@@ -138,6 +138,7 @@ void setupLocator() {
locator.registerFactory(() => PatientMedicalReportViewModel());
locator.registerFactory(() => ScanQrViewModel());
locator.registerFactory(() => OperationReportViewModel());
+ locator.registerFactory(() => PatientRegistrationViewModel());
locator.registerFactory(() => PendingOrdersViewModel());
- locator.registerFactory(() => PatientRegisterViewModel());
+
}
diff --git a/lib/screens/patients/register_patient/RegisterPatientPage.dart b/lib/screens/patients/register_patient/RegisterPatientPage.dart
index ab85d820..8b79225d 100644
--- a/lib/screens/patients/register_patient/RegisterPatientPage.dart
+++ b/lib/screens/patients/register_patient/RegisterPatientPage.dart
@@ -1,6 +1,5 @@
-import 'package:doctor_app_flutter/core/viewModel/PatientRegisterViewModel.dart';
+import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
-import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@@ -53,7 +52,7 @@ class _RegisterPatientPageState extends State
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
- return BaseView(
+ return BaseView(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
@@ -116,7 +115,7 @@ class _RegisterPatientPageState extends State
);
}
- Widget pagerButtons(PatientRegisterViewModel model) {
+ Widget pagerButtons(PatientRegistrationViewModel model) {
switch (_currentIndex) {
case 2:
return Container(
diff --git a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart
index 3aafe5bd..5260cc3b 100644
--- a/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart
+++ b/lib/screens/patients/register_patient/RegisterSearchPatientPage.dart
@@ -1,14 +1,15 @@
import 'package:doctor_app_flutter/config/size_config.dart';
-import 'package:doctor_app_flutter/core/enum/viewstate.dart';
-import 'package:doctor_app_flutter/core/viewModel/PatientRegisterViewModel.dart';
+import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart';
+import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
+
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
-import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
+
import 'package:doctor_app_flutter/util/translations_delegate_base.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/dialogs/dailog-list-select.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';
import 'package:flutter/material.dart';
@@ -37,7 +38,7 @@ class _RegisterSearchPatientPageState extends State {
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
- return BaseView(
+ return BaseView(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,