|
|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
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';
|
|
|
|
|
@ -145,26 +146,53 @@ class PatientRegistrationViewModel extends BaseViewModel {
|
|
|
|
|
registrationModel,
|
|
|
|
|
int otpType,
|
|
|
|
|
PatientRegistrationViewModel user}) async {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
print(checkPatientForRegistrationModel);
|
|
|
|
|
print(checkPatientForRegistrationModel);
|
|
|
|
|
|
|
|
|
|
await _patientRegistrationService.sendActivationCodeByOTPNotificationType(
|
|
|
|
|
otpType: otpType,
|
|
|
|
|
model: this,
|
|
|
|
|
checkPatientForRegistrationModel: checkPatientForRegistrationModel);
|
|
|
|
|
if (_patientRegistrationService.hasError) {
|
|
|
|
|
error = _patientRegistrationService.error;
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future checkActivationCode(CheckActivationCodeModel registrationModel) async {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
await _patientRegistrationService.checkActivationCode(registrationModel);
|
|
|
|
|
Future checkActivationCode(String code) async {
|
|
|
|
|
CheckActivationCodeModel model = CheckActivationCodeModel(
|
|
|
|
|
activationCode: code,
|
|
|
|
|
patientIdentificationID:
|
|
|
|
|
checkPatientForRegistrationModel.patientIdentificationID,
|
|
|
|
|
patientMobileNumber: checkPatientForRegistrationModel.patientMobileNumber,
|
|
|
|
|
zipCode: checkPatientForRegistrationModel.zipCode,
|
|
|
|
|
patientOutSA: 0,
|
|
|
|
|
healthId: getPatientInfoResponseModel.healthId,
|
|
|
|
|
dOB: checkPatientForRegistrationModel.dOB,
|
|
|
|
|
isRegister: checkPatientForRegistrationModel.isRegister,
|
|
|
|
|
isHijri: checkPatientForRegistrationModel.isHijri,
|
|
|
|
|
sessionID: null,
|
|
|
|
|
generalid: GENERAL_ID,
|
|
|
|
|
forRegisteration: true,
|
|
|
|
|
isDentalAllowedBackend: false,
|
|
|
|
|
projectOutSA: 0,
|
|
|
|
|
searchType: 1,
|
|
|
|
|
versionID: 7.1,
|
|
|
|
|
channel: 3,
|
|
|
|
|
// TODO Elham* loginType
|
|
|
|
|
loginType: 4,
|
|
|
|
|
logInTokenID:_patientRegistrationService.logInTokenID ,
|
|
|
|
|
nationalID: checkPatientForRegistrationModel.patientIdentificationID,
|
|
|
|
|
patientID: 0,
|
|
|
|
|
mobileNo: checkPatientForRegistrationModel.patientMobileNumber.toString(),
|
|
|
|
|
);
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
await _patientRegistrationService.checkActivationCode(model);
|
|
|
|
|
if (_patientRegistrationService.hasError) {
|
|
|
|
|
error = _patientRegistrationService.error;
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
}
|
|
|
|
|
|