| 
					
					
						
							
						
					
					
				 | 
				@ -295,10 +295,16 @@ namespace Shentun.Peis.PatientRegisters | 
			
		
		
	
		
			
				 | 
				 | 
				                throw new ArgumentException("完成标志错误"); | 
				 | 
				 | 
				                throw new ArgumentException("完成标志错误"); | 
			
		
		
	
		
			
				 | 
				 | 
				            } | 
				 | 
				 | 
				            } | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            string patientRegisterNo; | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            if (entity.CompleteFlag != PatientRegisterCompleteFlag.PreRegistration) | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            { | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                patientRegisterNo = await CreatePrePatientRegisterNo(); | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            } | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            else | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            { | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                patientRegisterNo = await CreatePatientRegisterNo(entity.MedicalCenterId); | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            } | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				            var patientRegisterNo = await CreatePatientRegisterNo(entity.MedicalCenterId); | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				            if (entity.MedicalTimes == 0) | 
				 | 
				 | 
				            if (entity.MedicalTimes == 0) | 
			
		
		
	
		
			
				 | 
				 | 
				            { | 
				 | 
				 | 
				            { | 
			
		
		
	
		
			
				 | 
				 | 
				                entity.MedicalTimes = await GetPatientCount(entity.PatientId); | 
				 | 
				 | 
				                entity.MedicalTimes = await GetPatientCount(entity.PatientId); | 
			
		
		
	
	
		
			
				| 
					
						
							
						
					
					
						
							
						
					
					
				 | 
				@ -505,7 +511,12 @@ namespace Shentun.Peis.PatientRegisters | 
			
		
		
	
		
			
				 | 
				 | 
				            { | 
				 | 
				 | 
				            { | 
			
		
		
	
		
			
				 | 
				 | 
				                throw new ArgumentException("完成标志错误"); | 
				 | 
				 | 
				                throw new ArgumentException("完成标志错误"); | 
			
		
		
	
		
			
				 | 
				 | 
				            } | 
				 | 
				 | 
				            } | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				 | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            if(targetEntity.CompleteFlag == PatientRegisterCompleteFlag.PreRegistration  | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                && sourceEntity.CompleteFlag == PatientRegisterCompleteFlag.Registration | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                && targetEntity.PatientRegisterNo.StartsWith("P")) | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            { | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				                targetEntity.PatientRegisterNo = await CreatePatientRegisterNo(targetEntity.MedicalCenterId); | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            } | 
			
		
		
	
		
			
				 | 
				 | 
				            //if (sourceEntity.MedicalTimes < 1)
 | 
				 | 
				 | 
				            //if (sourceEntity.MedicalTimes < 1)
 | 
			
		
		
	
		
			
				 | 
				 | 
				            //{
 | 
				 | 
				 | 
				            //{
 | 
			
		
		
	
		
			
				 | 
				 | 
				            //    throw new UserFriendlyException("体检次数必须大于0");
 | 
				 | 
				 | 
				            //    throw new UserFriendlyException("体检次数必须大于0");
 | 
			
		
		
	
	
		
			
				| 
					
						
							
						
					
					
						
							
						
					
					
				 | 
				@ -925,6 +936,7 @@ namespace Shentun.Peis.PatientRegisters | 
			
		
		
	
		
			
				 | 
				 | 
				
 | 
				 | 
				 | 
				
 | 
			
		
		
	
		
			
				 | 
				 | 
				                await _primarykeyBuilderRepository.InsertAsync(primarykeyBuilderEnt, true); | 
				 | 
				 | 
				                await _primarykeyBuilderRepository.InsertAsync(primarykeyBuilderEnt, true); | 
			
		
		
	
		
			
				 | 
				 | 
				            } | 
				 | 
				 | 
				            } | 
			
		
		
	
		
			
				 | 
				 | 
				 | 
				 | 
				 | 
				            prePatientRegisterNo = "P" + prePatientRegisterNo; | 
			
		
		
	
		
			
				 | 
				 | 
				            return prePatientRegisterNo; | 
				 | 
				 | 
				            return prePatientRegisterNo; | 
			
		
		
	
		
			
				 | 
				 | 
				        } | 
				 | 
				 | 
				        } | 
			
		
		
	
		
			
				 | 
				 | 
				        ///// <summary>
 | 
				 | 
				 | 
				        ///// <summary>
 | 
			
		
		
	
	
		
			
				| 
					
						
							
						
					
					
					
				 | 
				
  |