|
|
|
@ -126,7 +126,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters |
|
|
|
if (input == null) throw new UserFriendlyException("参数不能为空"); |
|
|
|
|
|
|
|
Guid medicalCenterId; |
|
|
|
if (input.MedicalCenterId == null || input.MedicalCenterId == Guid.Empty ) |
|
|
|
if (input.MedicalCenterId == null || input.MedicalCenterId == Guid.Empty) |
|
|
|
{ |
|
|
|
var webPeisOrganizationUnit = await _webPeisOrganizationUnitManager.GetMedicalCenterListAsync(); |
|
|
|
if (webPeisOrganizationUnit.Count > 1 || webPeisOrganizationUnit.Count == 0) |
|
|
|
@ -137,9 +137,9 @@ namespace Shentun.WebPeis.AppointPatientRegisters |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
medicalCenterId = (Guid) input.MedicalCenterId; |
|
|
|
medicalCenterId = (Guid)input.MedicalCenterId; |
|
|
|
} |
|
|
|
if(input.AppointStartDate == null ) |
|
|
|
if (input.AppointStartDate == null) |
|
|
|
{ |
|
|
|
input.AppointStartDate = DateTime.Now.Date; |
|
|
|
} |
|
|
|
@ -202,7 +202,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("身份证长度必须是18位"); |
|
|
|
} |
|
|
|
query = query.Where(o => o.person.IdNo == input.IdNo ); |
|
|
|
query = query.Where(o => o.person.IdNo == input.IdNo); |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
@ -228,7 +228,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters |
|
|
|
CustomerOrgId = o.FirstOrDefault().appointPatientRegister.CustomerOrgId, |
|
|
|
ChildCustomerOrgName = o.FirstOrDefault().customerOrg.PathCode.Length == 5 ? "" : o.FirstOrDefault().customerOrg.CustomerOrgName, |
|
|
|
CustomerOrgGroupId = o.FirstOrDefault().appointPatientRegister.CustomerOrgGroupId, |
|
|
|
CustomerOrgGroupName = o.FirstOrDefault().haveCustomerOrgGroup == null ? "" : o.FirstOrDefault().haveCustomerOrgGroup.DisplayName, |
|
|
|
CustomerOrgGroupName = o.FirstOrDefault().haveCustomerOrgGroup == null ? "" : o.FirstOrDefault().haveCustomerOrgGroup.CustomerOrgGroupName, |
|
|
|
CustomerOrgRegisterId = o.FirstOrDefault().appointPatientRegister.CustomerOrgRegisterId, |
|
|
|
MedicalPackageId = o.FirstOrDefault().appointPatientRegister.MedicalPackageId, |
|
|
|
MedicalPackageName = o.FirstOrDefault().haveMedicalPackage == null ? "" : o.FirstOrDefault().haveMedicalPackage.MedicalPackageName, |
|
|
|
@ -304,12 +304,12 @@ namespace Shentun.WebPeis.AppointPatientRegisters |
|
|
|
o.IsInMedicalPackage = 'Y'; |
|
|
|
} |
|
|
|
var itemType = itemTypes.Where(o => o.ItemTypeId == o.ItemTypeId).First(); |
|
|
|
itemType = itemTypes.Where(o=>o.PathCode == itemType.PathCode.Substring(0,5)).First(); |
|
|
|
itemType = itemTypes.Where(o => o.PathCode == itemType.PathCode.Substring(0, 5)).First(); |
|
|
|
o.ItemTypeId = itemType.ItemTypeId; |
|
|
|
o.ItemTypeDisplayOrder = itemType.DisplayOrder; |
|
|
|
}); |
|
|
|
appointRegisterAsbitemDtos = appointRegisterAsbitemDtos.OrderBy(o=>o.ItemTypeDisplayOrder) |
|
|
|
.OrderBy(o=>o.DisplayOrder).ToList(); |
|
|
|
appointRegisterAsbitemDtos = appointRegisterAsbitemDtos.OrderBy(o => o.ItemTypeDisplayOrder) |
|
|
|
.OrderBy(o => o.DisplayOrder).ToList(); |
|
|
|
return appointRegisterAsbitemDtos; |
|
|
|
} |
|
|
|
|
|
|
|
@ -330,10 +330,13 @@ namespace Shentun.WebPeis.AppointPatientRegisters |
|
|
|
on patient.PatientId equals patientRegister.PatientId |
|
|
|
join customerOrg in await _customerOrgRepository.GetQueryableAsync() |
|
|
|
on patientRegister.CustomerOrgId equals customerOrg.CustomerOrgId |
|
|
|
join customerOrgGroup in await _customerOrgGroupRepository.GetQueryableAsync() |
|
|
|
on patientRegister.CustomerOrgGroupId equals customerOrgGroup.CustomerOrgGroupId into canEmptyCustomerOrgGroup |
|
|
|
from haveCustomerOrgGroup in canEmptyCustomerOrgGroup.DefaultIfEmpty() |
|
|
|
where user.Id == input.PersonId && |
|
|
|
(patientRegister.CompleteFlag == PatientRegisterCompleteFlag.PreRegistration || |
|
|
|
patientRegister.CompleteFlag == PatientRegisterCompleteFlag.Registration) && |
|
|
|
patientRegister.MedicalStartDate >= DateTime.Now.Date.AddDays(-365) |
|
|
|
(patientRegister.CompleteFlag == PatientRegisterCompleteFlag.PreRegistration || |
|
|
|
patientRegister.CompleteFlag == PatientRegisterCompleteFlag.Registration) && |
|
|
|
patientRegister.MedicalStartDate >= DateTime.Now.Date.AddDays(-365) |
|
|
|
orderby patientRegister.MedicalStartDate descending |
|
|
|
select new PatientRegisterDto() |
|
|
|
{ |
|
|
|
@ -342,6 +345,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters |
|
|
|
ChildCustomerOrgName = customerOrg.CustomerOrgName, |
|
|
|
CustomerOrgRegisterId = patientRegister.CustomerOrgRegisterId, |
|
|
|
CustomerOrgGroupId = patientRegister.CustomerOrgGroupId, |
|
|
|
CustomerOrgGroupName = haveCustomerOrgGroup == null?"": haveCustomerOrgGroup.CustomerOrgGroupName |
|
|
|
}).FirstOrDefault(); |
|
|
|
if (patientRegisterDto == null) |
|
|
|
{ |
|
|
|
|