@ -67,6 +67,7 @@ namespace Shentun.Peis.TransToWebPeis
private readonly IConfiguration _configuration ;
private readonly IRepository < Patient , Guid > _patientRepository ;
private readonly ThirdBookingPushAppService _thirdBookingPushAppService ;
private readonly CacheService _cacheService ;
private readonly SqlSugarClient Db = new SqlSugarClient ( new ConnectionConfig ( )
{
@ -103,7 +104,8 @@ namespace Shentun.Peis.TransToWebPeis
PrintReportAppService printReportAppService ,
IConfiguration configuration ,
IRepository < Patient , Guid > patientRepository ,
ThirdBookingPushAppService thirdBookingPushAppService )
ThirdBookingPushAppService thirdBookingPushAppService ,
CacheService cacheService )
{
_itemTypeRepository = itemTypeRepository ;
_logger = logger ;
@ -125,6 +127,7 @@ namespace Shentun.Peis.TransToWebPeis
_configuration = configuration ;
_patientRepository = patientRepository ;
_thirdBookingPushAppService = thirdBookingPushAppService ;
_cacheService = cacheService ;
}
@ -506,13 +509,39 @@ namespace Shentun.Peis.TransToWebPeis
var itemTypes = await _itemTypeRepository . GetListAsync ( ) ;
if ( itemTypes . Count > 0 )
{
var isMedicalReportTypeId = WebDb . Ado . GetInt ( @ " SELECT COUNT(*) FROM information_schema.columns
WHERE table_schema = ' public ' AND table_name = ' item_type '
AND column_name = ' medical_report_type_id ' ");
foreach ( var itemType in itemTypes )
{
await WebDb . Ado . ExecuteCommandAsync ( "INSERT INTO public.item_type(item_type_id,item_type_name,simple_code,parent_id,path_code,check_type_flag,display_order,is_wrap, concurrency_stamp,creation_time,creator_id,last_modification_time,last_modifier_id) " +
"VALUES (@item_type_id,@item_type_name,@simple_code,@parent_id::uuid,@path_code,@check_type_flag,@display_order,@is_wrap,@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id);" ,
new List < SugarParameter > ( ) {
if ( isMedicalReportTypeId > 0 )
{
await WebDb . Ado . ExecuteCommandAsync ( "INSERT INTO public.item_type(item_type_id,item_type_name,simple_code,parent_id,path_code,check_type_flag,display_order,is_wrap, concurrency_stamp,creation_time,creator_id,last_modification_time,last_modifier_id,medical_report_type_id) " +
"VALUES (@item_type_id,@item_type_name,@simple_code,@parent_id::uuid,@path_code,@check_type_flag,@display_order,@is_wrap,@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id,@medical_report_type_id);" ,
new List < SugarParameter > ( ) {
new SugarParameter ( "@item_type_id" , itemType . Id ) ,
new SugarParameter ( "@item_type_name" , itemType . DisplayName ) ,
new SugarParameter ( "@simple_code" , itemType . SimpleCode ) ,
new SugarParameter ( "@parent_id" , itemType . ParentId ) ,
new SugarParameter ( "@path_code" , itemType . PathCode ) ,
new SugarParameter ( "@check_type_flag" , itemType . CheckTypeFlag ) ,
new SugarParameter ( "@display_order" , itemType . DisplayOrder ) ,
new SugarParameter ( "@is_wrap" , itemType . IsWrap ) ,
new SugarParameter ( "@concurrency_stamp" , itemType . ConcurrencyStamp ) ,
new SugarParameter ( "@creation_time" , itemType . CreationTime ) ,
new SugarParameter ( "@creator_id" , itemType . CreatorId ) ,
new SugarParameter ( "@last_modification_time" , itemType . LastModificationTime ) ,
new SugarParameter ( "@last_modifier_id" , itemType . LastModifierId ) ,
new SugarParameter ( "@medical_report_type_id" , itemType . MedicalReportTypeId )
} ) ;
}
else
{
await WebDb . Ado . ExecuteCommandAsync ( "INSERT INTO public.item_type(item_type_id,item_type_name,simple_code,parent_id,path_code,check_type_flag,display_order,is_wrap, concurrency_stamp,creation_time,creator_id,last_modification_time,last_modifier_id) " +
"VALUES (@item_type_id,@item_type_name,@simple_code,@parent_id::uuid,@path_code,@check_type_flag,@display_order,@is_wrap,@concurrency_stamp,@creation_time,@creator_id,@last_modification_time,@last_modifier_id);" ,
new List < SugarParameter > ( ) {
new SugarParameter ( "@item_type_id" , itemType . Id ) ,
new SugarParameter ( "@item_type_name" , itemType . DisplayName ) ,
new SugarParameter ( "@simple_code" , itemType . SimpleCode ) ,
@ -526,7 +555,8 @@ namespace Shentun.Peis.TransToWebPeis
new SugarParameter ( "@creator_id" , itemType . CreatorId ) ,
new SugarParameter ( "@last_modification_time" , itemType . LastModificationTime ) ,
new SugarParameter ( "@last_modifier_id" , itemType . LastModifierId )
} ) ;
} ) ;
}
}
_logger . LogInformation ( $"项目类别数据处理完毕,数量{itemTypes.Count}" ) ;
@ -1079,6 +1109,16 @@ namespace Shentun.Peis.TransToWebPeis
foreach ( var registerCheckWithDetail in registerCheckWithDetails )
{
var checkDoctorIdConvert = registerCheckWithDetail . CheckDoctorId ;
if ( ! string . IsNullOrWhiteSpace ( checkDoctorIdConvert ) )
{
if ( Guid . TryParse ( checkDoctorIdConvert , out var checkDoctorIdGuid ) )
{
checkDoctorIdConvert = await _cacheService . GetSurnameAsync ( checkDoctorIdGuid ) ;
}
}
#region register_check
await WebDb . Ado . ExecuteCommandAsync ( "INSERT INTO public.register_check(register_check_id, patient_register_id, check_request_no, third_info, complete_flag, critical_value, critical_value_flag, critical_value_process_content," +
"critical_value_process_flag, critical_value_process_doctor, critical_value_process_date, critical_value_create_date, check_doctor_id, check_date, is_audit," +
@ -1099,7 +1139,7 @@ namespace Shentun.Peis.TransToWebPeis
new SugarParameter ( "critical_value_process_doctor" , "" ) ,
new SugarParameter ( "critical_value_process_date" , null ) ,
new SugarParameter ( "critical_value_create_date" , null ) ,
new SugarParameter ( "check_doctor_id" , registerChe ckWithDetail . C heckDoctorId) ,
new SugarParameter ( "check_doctor_id" , checkDoctorIdConvert ) ,
new SugarParameter ( "check_date" , registerCheckWithDetail . CheckDate ) ,
new SugarParameter ( "is_audit" , registerCheckWithDetail . IsAudit ) ,
new SugarParameter ( "auditor_user_id" , registerCheckWithDetail . AuditorUserId ) ,