You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RSGDoctorApp/lib/core/service/PatientRegistrationService....

84 lines
3.3 KiB
Dart

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/GetPatientInfoRequestModel.dart';
import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfoResponseModel.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 {
GetPatientInfoResponseModel getPatientInfoResponseModel;
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());
}
getPatientInfo(GetPatientInfoRequestModel getPatientInfoRequestMode) async {
hasError = false;
await baseAppClient.post(GET_PATIENT_INFO,
onSuccess: (dynamic response, int statusCode) {
getPatientInfoResponseModel =
GetPatientInfoResponseModel.fromJson(response);
print("ddd");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getPatientInfoRequestMode.toJson());
}
sendActivationCodeByOTPNotificationType(
{SendActivationCodeByOTPNotificationTypeForRegistrationModel
registrationModel,
int otpType}) async {
registrationModel =
SendActivationCodeByOTPNotificationTypeForRegistrationModel(
oTPSendType: otpType,
patientIdentificationID: 1062938285,
patientMobileNumber: 785228065,
zipCode: "966",
patientOutSA: false,
mobileNo: "785228065",
healthId: "30000018540264",
dOB: "31/07/1988",
);
hasError = false;
await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE,
onSuccess: (dynamic response, int statusCode) {
registrationModel =
SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson(
response);
}, 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());
}
}