|
|
|
|
@ -40,14 +40,23 @@ class RequestUtils {
|
|
|
|
|
if (zipCode == "0") {
|
|
|
|
|
request.patientMobileNumberOthers = phoneNumber;
|
|
|
|
|
} else {
|
|
|
|
|
request.patientMobileNumber = int.parse(phoneNumber);
|
|
|
|
|
// Remove any non-numeric characters before parsing
|
|
|
|
|
final numericPhone = phoneNumber.replaceAll(RegExp(r'[^0-9]'), '');
|
|
|
|
|
final parsedPhone = int.tryParse(numericPhone);
|
|
|
|
|
if (parsedPhone != null) {
|
|
|
|
|
request.patientMobileNumber = parsedPhone;
|
|
|
|
|
} else {
|
|
|
|
|
// If parsing fails, use as string in Others field
|
|
|
|
|
request.patientMobileNumberOthers = phoneNumber;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
request.oTPSendType = otpTypeEnum.toInt(); // could map OTPTypeEnum if needed
|
|
|
|
|
request.zipCode = zipCode; // or countryCode if defined elsewhere
|
|
|
|
|
|
|
|
|
|
if (isForRegister) {
|
|
|
|
|
request.patientIdentificationID = int.parse(nationId);
|
|
|
|
|
final parsedNationId = int.tryParse(nationId.replaceAll(RegExp(r'[^0-9]'), ''));
|
|
|
|
|
request.patientIdentificationID = parsedNationId ?? 0;
|
|
|
|
|
request.searchType = 1;
|
|
|
|
|
request.isHijri = calenderType.toInt;
|
|
|
|
|
request.patientID = patientId;
|
|
|
|
|
@ -56,7 +65,7 @@ class RequestUtils {
|
|
|
|
|
request.isDentalAllowedBackend = false;
|
|
|
|
|
} else {
|
|
|
|
|
if (fileNo) {
|
|
|
|
|
request.patientID = patientId ?? int.parse(nationId);
|
|
|
|
|
request.patientID = patientId ?? (int.tryParse(nationId.replaceAll(RegExp(r'[^0-9]'), '')) ?? 0);
|
|
|
|
|
request.patientIdentificationID = request.nationalID;
|
|
|
|
|
request.searchType = 2;
|
|
|
|
|
} else {
|
|
|
|
|
@ -91,8 +100,17 @@ class RequestUtils {
|
|
|
|
|
request.patientMobileNumberOthers = phoneNumber;
|
|
|
|
|
request.mobileNo = phoneNumber;
|
|
|
|
|
} else {
|
|
|
|
|
request.patientMobileNumber = int.parse(phoneNumber);
|
|
|
|
|
request.mobileNo = '0$phoneNumber';
|
|
|
|
|
// Remove any non-numeric characters before parsing
|
|
|
|
|
final numericPhone = phoneNumber.replaceAll(RegExp(r'[^0-9]'), '');
|
|
|
|
|
final parsedPhone = int.tryParse(numericPhone);
|
|
|
|
|
if (parsedPhone != null) {
|
|
|
|
|
request.patientMobileNumber = parsedPhone;
|
|
|
|
|
request.mobileNo = '0$numericPhone';
|
|
|
|
|
} else {
|
|
|
|
|
// If parsing fails, use as string in Others field
|
|
|
|
|
request.patientMobileNumberOthers = phoneNumber;
|
|
|
|
|
request.mobileNo = phoneNumber;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
request.deviceToken = deviceToken;
|
|
|
|
|
request.projectOutSA = patientOutSA;
|
|
|
|
|
@ -115,7 +133,8 @@ class RequestUtils {
|
|
|
|
|
log("nationIdText: ${nationIdText}");
|
|
|
|
|
} else {
|
|
|
|
|
if (fileNo) {
|
|
|
|
|
request.patientID = patientId ?? int.parse(nationIdText);
|
|
|
|
|
final numericNationId = nationIdText.replaceAll(RegExp(r'[^0-9]'), '');
|
|
|
|
|
request.patientID = patientId ?? (int.tryParse(numericNationId) ?? 0);
|
|
|
|
|
request.patientIdentificationID = request.nationalID = '0';
|
|
|
|
|
request.searchType = 2;
|
|
|
|
|
//TODO: Issue HEre is Not Login
|
|
|
|
|
@ -155,8 +174,17 @@ class RequestUtils {
|
|
|
|
|
request.patientMobileNumberOthers = mobileNumber;
|
|
|
|
|
request.mobileNo = mobileNumber;
|
|
|
|
|
} else {
|
|
|
|
|
request.patientMobileNumber = int.parse(mobileNumber);
|
|
|
|
|
request.mobileNo = '0$mobileNumber';
|
|
|
|
|
// Remove any non-numeric characters before parsing
|
|
|
|
|
final numericMobile = mobileNumber.replaceAll(RegExp(r'[^0-9]'), '');
|
|
|
|
|
final parsedMobile = int.tryParse(numericMobile);
|
|
|
|
|
if (parsedMobile != null) {
|
|
|
|
|
request.patientMobileNumber = parsedMobile;
|
|
|
|
|
request.mobileNo = '0$numericMobile';
|
|
|
|
|
} else {
|
|
|
|
|
// If parsing fails, use as string in Others field
|
|
|
|
|
request.patientMobileNumberOthers = mobileNumber;
|
|
|
|
|
request.mobileNo = mobileNumber;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
request.projectOutSA = patientOutSA;
|
|
|
|
|
@ -314,7 +342,9 @@ class RequestUtils {
|
|
|
|
|
request.sharedPatientId = 0;
|
|
|
|
|
request.sharedPatientIdentificationId = nationalIDorFile;
|
|
|
|
|
} else if (loginType == 2) {
|
|
|
|
|
request.sharedPatientId = int.parse(nationalIDorFile);
|
|
|
|
|
// Remove any non-numeric characters before parsing
|
|
|
|
|
final numericId = nationalIDorFile.replaceAll(RegExp(r'[^0-9]'), '');
|
|
|
|
|
request.sharedPatientId = int.tryParse(numericId) ?? 0;
|
|
|
|
|
request.sharedPatientIdentificationId = '';
|
|
|
|
|
}
|
|
|
|
|
request.searchType = loginType;
|
|
|
|
|
|