103 lines
3.2 KiB
C#
103 lines
3.2 KiB
C#
using IRaCIS.Core.Domain.Models;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.Configuration.Json;
|
|
|
|
namespace IRaCIS.Core.Domain.Share
|
|
{
|
|
/// <summary>
|
|
/// 多环境 配置环境实体
|
|
/// </summary>
|
|
public class ServiceVerifyConfigOption
|
|
{
|
|
public bool OpenUserComplexPassword { get; set; }
|
|
|
|
public bool OpenSignDocumentBeforeWork { get; set; }
|
|
|
|
public bool OpenTrialRelationDelete { get; set; }
|
|
|
|
public bool OpenLoginLimit { get; set; }
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 项目基础配置规则
|
|
/// </summary>
|
|
public class AppSettings
|
|
{
|
|
public static string DoctorCodePrefix { get; set; }
|
|
public static string UserCodePrefix { get; set; }
|
|
|
|
|
|
public static string QCChallengeCodePrefix { get; set; }
|
|
|
|
public static string DicomStudyCodePrefix { get; set; }
|
|
|
|
public static string NoneDicomStudyCodePrefix { get; set; }
|
|
|
|
public static string DefaultInternalOrganizationName { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 用户默认密码
|
|
/// </summary>
|
|
public static readonly string DefaultPassword = "123456";
|
|
|
|
|
|
static AppSettings()
|
|
{
|
|
var configuration = new ConfigurationBuilder()
|
|
.Add(new JsonConfigurationSource
|
|
{
|
|
Path = "appsettings.json",
|
|
ReloadOnChange = true
|
|
})
|
|
.Build();
|
|
|
|
DoctorCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue<string>("DoctorCodePrefix");
|
|
UserCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue<string>("UserCodePrefix");
|
|
QCChallengeCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue<string>("QCChallengeCodePrefix");
|
|
NoneDicomStudyCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue<string>("NoneDicomStudyCodePrefix");
|
|
DicomStudyCodePrefix = configuration.GetSection("IRaCISBasicConfig").GetValue<string>("DicomStudyCodePrefix");
|
|
DefaultPassword= configuration.GetSection("IRaCISBasicConfig").GetValue<string>("DefaultPassword");
|
|
DefaultPassword = configuration.GetSection("IRaCISBasicConfig").GetValue<string>("DefaultInternalOrganizationName");
|
|
}
|
|
|
|
|
|
//获取实体编码字符串
|
|
public static string GetCodeStr(int codeInt ,string typeStr)
|
|
{
|
|
switch (typeStr)
|
|
{
|
|
case nameof(Doctor):
|
|
|
|
return DoctorCodePrefix + codeInt.ToString("D4");
|
|
|
|
case nameof(User):
|
|
|
|
return UserCodePrefix + codeInt.ToString("D4");
|
|
|
|
case nameof(QCChallenge):
|
|
|
|
return QCChallengeCodePrefix+ codeInt.ToString("D5");
|
|
|
|
case nameof(NoneDicomStudy):
|
|
|
|
return NoneDicomStudyCodePrefix + codeInt.ToString("D5");
|
|
|
|
case nameof(DicomStudy):
|
|
|
|
return DicomStudyCodePrefix + codeInt.ToString("D5");
|
|
|
|
case nameof(VisitTask):
|
|
|
|
return "W" + codeInt.ToString("D5");
|
|
|
|
default:
|
|
return string.Empty;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
} |