|
|
|
@ -2,6 +2,9 @@ import 'package:hmg_patient_app_new/core/api_consts.dart';
|
|
|
|
import 'package:hmg_patient_app_new/core/app_state.dart';
|
|
|
|
import 'package:hmg_patient_app_new/core/app_state.dart';
|
|
|
|
import 'package:hmg_patient_app_new/core/dependencies.dart';
|
|
|
|
import 'package:hmg_patient_app_new/core/dependencies.dart';
|
|
|
|
import 'package:hmg_patient_app_new/core/enums.dart';
|
|
|
|
import 'package:hmg_patient_app_new/core/enums.dart';
|
|
|
|
|
|
|
|
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
|
|
|
|
|
|
|
|
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
|
|
|
|
|
|
|
import 'package:hmg_patient_app_new/features/authentication/models/request_models/registration_payload_model.dart';
|
|
|
|
import 'package:hmg_patient_app_new/features/authentication/models/request_models/send_activation_request_model.dart';
|
|
|
|
import 'package:hmg_patient_app_new/features/authentication/models/request_models/send_activation_request_model.dart';
|
|
|
|
import 'package:hmg_patient_app_new/features/common/models/commong_authanticated_req_model.dart';
|
|
|
|
import 'package:hmg_patient_app_new/features/common/models/commong_authanticated_req_model.dart';
|
|
|
|
|
|
|
|
|
|
|
|
@ -169,4 +172,56 @@ class RequestUtils {
|
|
|
|
request.tokenId = null;
|
|
|
|
request.tokenId = null;
|
|
|
|
return request;
|
|
|
|
return request;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static dynamic getUserSignupCompletionRequest() {
|
|
|
|
|
|
|
|
AppState appState = getIt.get<AppState>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool isDubai = appState.getUserRegistrationPayload.patientOutSa == 1 ? true : false;
|
|
|
|
|
|
|
|
List<String> names = appState.getUserRegistrationPayload.fullName != null ? appState.getUserRegistrationPayload.fullName!.split(" ") : [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var dob = appState.getUserRegistrationPayload.dob;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
"Patientobject": {
|
|
|
|
|
|
|
|
"TempValue": true,
|
|
|
|
|
|
|
|
"PatientIdentificationType":
|
|
|
|
|
|
|
|
(isDubai ? appState.getNHICUserData.idNumber!.substring(0, 1) : appState.getUserRegistrationPayload.patientIdentificationId?.toString().substring(0, 1)) == "1" ? 1 : 2,
|
|
|
|
|
|
|
|
"PatientIdentificationNo": isDubai ? appState.getNHICUserData.idNumber! : appState.getUserRegistrationPayload.patientIdentificationId,
|
|
|
|
|
|
|
|
"MobileNumber": appState.getUserRegistrationPayload.patientMobileNumber ?? 0,
|
|
|
|
|
|
|
|
"PatientOutSA": (appState.getUserRegistrationPayload.zipCode == CountryEnum.saudiArabia.countryCode || appState.getUserRegistrationPayload.zipCode == '+966') ? 0 : 1,
|
|
|
|
|
|
|
|
"FirstNameN": isDubai ? "..." : appState.getNHICUserData.firstNameAr,
|
|
|
|
|
|
|
|
"FirstName": isDubai ? (names.isNotEmpty ? names[0] : "...") : appState.getNHICUserData.firstNameEn,
|
|
|
|
|
|
|
|
"MiddleNameN": isDubai ? "..." : appState.getNHICUserData.secondNameAr,
|
|
|
|
|
|
|
|
"MiddleName": isDubai ? "..." : appState.getNHICUserData.secondNameEn,
|
|
|
|
|
|
|
|
"LastNameN": isDubai ? "..." : appState.getNHICUserData.lastNameAr,
|
|
|
|
|
|
|
|
"LastName": isDubai ? (names.length > 1 ? names[1] : "...") : appState.getNHICUserData.lastNameEn,
|
|
|
|
|
|
|
|
"StrDateofBirth": dob,
|
|
|
|
|
|
|
|
"DateofBirth": DateUtil.convertISODateToJsonDate((dob ?? "").replaceAll('/', '-')),
|
|
|
|
|
|
|
|
"Gender": isDubai ? (appState.getUserRegistrationPayload.gender == GenderTypeEnum.male ? 1 : 2) : (appState.getNHICUserData.gender == 'M' ? 1 : 2),
|
|
|
|
|
|
|
|
"NationalityID": isDubai ? "UAE" : appState.getUserRegistrationPayload.nationalityCode,
|
|
|
|
|
|
|
|
"eHealthIDField": isDubai ? null : appState.getNHICUserData.healthId,
|
|
|
|
|
|
|
|
"DateofBirthN": DateTime.now(),
|
|
|
|
|
|
|
|
"EmailAddress": appState.getUserRegistrationPayload.emailAddress,
|
|
|
|
|
|
|
|
"SourceType": (appState.getUserRegistrationPayload.zipCode == CountryEnum.saudiArabia.countryCode || appState.getUserRegistrationPayload.zipCode == '+966') ? 1 : 2,
|
|
|
|
|
|
|
|
"PreferredLanguage": appState.getLanguageCode() == "ar" ? (isDubai ? "1" : 1) : (isDubai ? "2" : 2),
|
|
|
|
|
|
|
|
"Marital": isDubai
|
|
|
|
|
|
|
|
? (appState.getUserRegistrationPayload.maritalStatus == MaritalStatusTypeEnum.single
|
|
|
|
|
|
|
|
? '0'
|
|
|
|
|
|
|
|
: appState.getUserRegistrationPayload.maritalStatus == MaritalStatusTypeEnum.married
|
|
|
|
|
|
|
|
? '1'
|
|
|
|
|
|
|
|
: '2')
|
|
|
|
|
|
|
|
: (appState.getNHICUserData.maritalStatusCode == 'U'
|
|
|
|
|
|
|
|
? '0'
|
|
|
|
|
|
|
|
: appState.getNHICUserData.maritalStatusCode == 'M'
|
|
|
|
|
|
|
|
? '1'
|
|
|
|
|
|
|
|
: '2'),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"PatientIdentificationID": isDubai ? appState.getUserRegistrationPayload.patientIdentificationId : appState.getNHICUserData.idNumber,
|
|
|
|
|
|
|
|
"PatientMobileNumber": appState.getUserRegistrationPayload.patientMobileNumber.toString()[0] == '0'
|
|
|
|
|
|
|
|
? appState.getUserRegistrationPayload.patientMobileNumber
|
|
|
|
|
|
|
|
: '0${appState.getUserRegistrationPayload.patientMobileNumber}',
|
|
|
|
|
|
|
|
if (isDubai) "DOB": dob,
|
|
|
|
|
|
|
|
if (isDubai) "IsHijri": appState.getUserRegistrationPayload.isHijri,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|