175 lines
4.9 KiB
C#
175 lines
4.9 KiB
C#
using IRaCIS.Core.Domain.Models;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.Configuration.Json;
|
|
using System.Collections.Generic;
|
|
|
|
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; }
|
|
|
|
public int LoginMaxFailCount { get; set; }
|
|
|
|
public int LoginFailLockMinutes { get; set; }
|
|
|
|
public int AutoLoginOutMinutes { get; set; }
|
|
|
|
public bool OpenLoginMFA { get; set; }
|
|
|
|
/// <summary>
|
|
/// 连续阅片时间 (min)
|
|
/// </summary>
|
|
public int ContinuousReadingTimeMin { get; set; }
|
|
|
|
/// <summary>
|
|
/// 休息时间 (min)
|
|
/// </summary>
|
|
public int ReadingRestTimeMin { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// 是否需要修改密码
|
|
/// </summary>
|
|
public bool IsNeedChangePassWord { get; set; }
|
|
|
|
/// <summary>
|
|
/// 修改密码的天数
|
|
/// </summary>
|
|
public int ChangePassWordDays { get; set; }
|
|
|
|
}
|
|
|
|
public class SystemEmailSendConfig
|
|
{
|
|
public int Port { get; set; }
|
|
|
|
public string Host { get; set; } = string.Empty;
|
|
|
|
|
|
public string FromEmail { get; set; } = string.Empty;
|
|
|
|
public string FromName { get; set; } = string.Empty;
|
|
|
|
public string AuthorizationCode { get; set; } = string.Empty;
|
|
|
|
public string SiteUrl { get; set; } = string.Empty;
|
|
|
|
public string OrganizationName { get; set; } = string.Empty;
|
|
public string OrganizationNameCN { get; set; } = string.Empty;
|
|
|
|
public string CompanyName { get; set; } = string.Empty;
|
|
|
|
public string CompanyNameCN { get; set; } = string.Empty;
|
|
|
|
public string CompanyShortName { get; set; } = string.Empty;
|
|
|
|
public string CompanyShortNameCN { get; set; } = string.Empty;
|
|
|
|
|
|
}
|
|
|
|
public class SystemPacsConfig
|
|
{
|
|
public int Port { get; set; }
|
|
|
|
public string IP { get; set; }=string.Empty;
|
|
}
|
|
|
|
|
|
|
|
public class EncreptResponseOption
|
|
{
|
|
public bool IsEnable { get; set; }
|
|
|
|
public List<string> ApiPathList { get; set; }
|
|
}
|
|
|
|
public class IRaCISBasicConfigOption
|
|
{
|
|
public string DoctorCodePrefix { get; set; }
|
|
public string UserCodePrefix { get; set; }
|
|
public string QCChallengeCodePrefix { get; set; }
|
|
public string DicomStudyCodePrefix { get; set; }
|
|
public string TaskStudyCodePrefix { get; set; }
|
|
public string NoneDicomStudyCodePrefix { get; set; }
|
|
public int ImageShareExpireDays { get; set; }
|
|
public string SystemSiteCodePrefix { get; set; }
|
|
public string BlindTaskPrefix { get; set; }
|
|
public string DefaultPassword { get; set; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 项目基础配置规则
|
|
/// </summary>
|
|
public static class AppSettings
|
|
{
|
|
|
|
public static IRaCISBasicConfigOption IRaCISBasicConfig { get; set; }
|
|
|
|
static AppSettings()
|
|
{
|
|
var configuration = new ConfigurationBuilder()
|
|
.Add(new JsonConfigurationSource
|
|
{
|
|
Path = "appsettings.json",
|
|
ReloadOnChange = true
|
|
})
|
|
.Build();
|
|
|
|
// 手动绑定配置
|
|
var appSettings = new IRaCISBasicConfigOption();
|
|
configuration.GetSection("IRaCISBasicConfig").Bind(appSettings);
|
|
|
|
IRaCISBasicConfig = appSettings;
|
|
}
|
|
|
|
|
|
//获取实体编码字符串
|
|
public static string GetCodeStr(int codeInt, string typeStr)
|
|
{
|
|
switch (typeStr)
|
|
{
|
|
case nameof(Doctor):
|
|
return IRaCISBasicConfig.DoctorCodePrefix + codeInt.ToString("D4");
|
|
|
|
case nameof(User):
|
|
return IRaCISBasicConfig.UserCodePrefix + codeInt.ToString("D4");
|
|
|
|
case nameof(QCChallenge):
|
|
return IRaCISBasicConfig.QCChallengeCodePrefix + codeInt.ToString("D5");
|
|
|
|
case nameof(NoneDicomStudy):
|
|
return IRaCISBasicConfig.NoneDicomStudyCodePrefix + codeInt.ToString("D5");
|
|
|
|
case nameof(DicomStudy):
|
|
return IRaCISBasicConfig.DicomStudyCodePrefix + codeInt.ToString("D5");
|
|
|
|
case nameof(TaskStudy):
|
|
return IRaCISBasicConfig.TaskStudyCodePrefix + codeInt.ToString("D5");
|
|
|
|
case nameof(VisitTask):
|
|
return "W" + codeInt.ToString("D5");
|
|
|
|
case nameof(Site):
|
|
return IRaCISBasicConfig.SystemSiteCodePrefix + codeInt.ToString("D4");
|
|
|
|
default:
|
|
return string.Empty;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
} |