|
@@ -431,6 +431,16 @@ public partial class HealthExamBookingService : JsonRpcService, IVitalHealthExam
|
|
var userInfo = await GetUserInfoByTokenAsync(token);
|
|
var userInfo = await GetUserInfoByTokenAsync(token);
|
|
var dto = request.MappingTo<RegisterInfoDTO>();
|
|
var dto = request.MappingTo<RegisterInfoDTO>();
|
|
var idCardNo = request.IDCardNo;
|
|
var idCardNo = request.IDCardNo;
|
|
|
|
+
|
|
|
|
+ if (string.IsNullOrEmpty(request.Name))
|
|
|
|
+ {
|
|
|
|
+ ThrowCustomerException(CustomerRpcCode.PatientNameIsEmpty, "Patient name is empty");
|
|
|
|
+ }
|
|
|
|
+ if (string.IsNullOrEmpty(idCardNo))
|
|
|
|
+ {
|
|
|
|
+ ThrowCustomerException(CustomerRpcCode.IdentityCardIsRequired, "IdentityCard is required");
|
|
|
|
+ }
|
|
|
|
+
|
|
if (!string.IsNullOrWhiteSpace(idCardNo) && Regex.IsMatch(idCardNo, @"^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})(\d|X)$"))
|
|
if (!string.IsNullOrWhiteSpace(idCardNo) && Regex.IsMatch(idCardNo, @"^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})(\d|X)$"))
|
|
{
|
|
{
|
|
var birthDay = new DateTime(Convert.ToInt32(idCardNo.Substring(6, 4)), Convert.ToInt32(idCardNo.Substring(10, 2)), Convert.ToInt32(idCardNo.Substring(12, 2)));
|
|
var birthDay = new DateTime(Convert.ToInt32(idCardNo.Substring(6, 4)), Convert.ToInt32(idCardNo.Substring(10, 2)), Convert.ToInt32(idCardNo.Substring(12, 2)));
|