Add models and create vm, services for patient registration
parent
52e5b86f6c
commit
9689044be7
@ -0,0 +1,112 @@
|
|||||||
|
class CheckActivationCodeModel {
|
||||||
|
int patientMobileNumber;
|
||||||
|
String mobileNo;
|
||||||
|
int projectOutSA;
|
||||||
|
int loginType;
|
||||||
|
String zipCode;
|
||||||
|
bool isRegister;
|
||||||
|
String logInTokenID;
|
||||||
|
int searchType;
|
||||||
|
int patientID;
|
||||||
|
int nationalID;
|
||||||
|
int patientIdentificationID;
|
||||||
|
bool forRegisteration;
|
||||||
|
String activationCode;
|
||||||
|
double versionID;
|
||||||
|
int channel;
|
||||||
|
int languageID;
|
||||||
|
String iPAdress;
|
||||||
|
String generalid;
|
||||||
|
int patientOutSA;
|
||||||
|
Null sessionID;
|
||||||
|
bool isDentalAllowedBackend;
|
||||||
|
int deviceTypeID;
|
||||||
|
String dOB;
|
||||||
|
int isHijri;
|
||||||
|
String healthId;
|
||||||
|
|
||||||
|
CheckActivationCodeModel(
|
||||||
|
{this.patientMobileNumber,
|
||||||
|
this.mobileNo,
|
||||||
|
this.projectOutSA,
|
||||||
|
this.loginType,
|
||||||
|
this.zipCode,
|
||||||
|
this.isRegister,
|
||||||
|
this.logInTokenID,
|
||||||
|
this.searchType,
|
||||||
|
this.patientID,
|
||||||
|
this.nationalID,
|
||||||
|
this.patientIdentificationID,
|
||||||
|
this.forRegisteration,
|
||||||
|
this.activationCode,
|
||||||
|
this.versionID,
|
||||||
|
this.channel,
|
||||||
|
this.languageID,
|
||||||
|
this.iPAdress,
|
||||||
|
this.generalid,
|
||||||
|
this.patientOutSA,
|
||||||
|
this.sessionID,
|
||||||
|
this.isDentalAllowedBackend,
|
||||||
|
this.deviceTypeID,
|
||||||
|
this.dOB,
|
||||||
|
this.isHijri,
|
||||||
|
this.healthId});
|
||||||
|
|
||||||
|
CheckActivationCodeModel.fromJson(Map<String, dynamic> 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<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
@ -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<String, dynamic> 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<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
@ -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<String, dynamic> 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<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
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<String, dynamic> 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<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
@ -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<String, dynamic> 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<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
@ -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());
|
||||||
|
}
|
||||||
|
}
|
@ -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<PatientRegistrationService>();
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue