调整各字段长度限制,与其他表长度保持一致

This commit is contained in:
2025-01-22 16:19:52 +08:00
parent ed77b8ed82
commit 16ab4c78d5
4 changed files with 28 additions and 19 deletions

View File

@@ -57,7 +57,7 @@ class ZxIeCost(Base):
pk_ie_cost = Column(INTEGER(11), primary_key=True, comment='费用明细信息抽取主键') pk_ie_cost = Column(INTEGER(11), primary_key=True, comment='费用明细信息抽取主键')
pk_phhd = Column(INTEGER(11), nullable=False, unique=True, comment='报销案子主键') pk_phhd = Column(INTEGER(11), nullable=False, unique=True, comment='报销案子主键')
content = Column(Text, comment='详细内容') content = Column(Text, comment='详细内容')
name = Column(String(30), comment='患者姓名') name = Column(String(20), comment='患者姓名')
admission_date_str = Column(String(255), comment='入院日期字符串') admission_date_str = Column(String(255), comment='入院日期字符串')
admission_date = Column(Date, comment='入院日期') admission_date = Column(Date, comment='入院日期')
discharge_date_str = Column(String(255), comment='出院日期字符串') discharge_date_str = Column(String(255), comment='出院日期字符串')
@@ -98,18 +98,18 @@ class ZxIeDischarge(Base):
pk_ie_discharge = Column(INTEGER(11), primary_key=True, comment='出院记录信息抽取主键') pk_ie_discharge = Column(INTEGER(11), primary_key=True, comment='出院记录信息抽取主键')
pk_phhd = Column(INTEGER(11), nullable=False, unique=True, comment='报销案子主键') pk_phhd = Column(INTEGER(11), nullable=False, unique=True, comment='报销案子主键')
content = Column(Text, comment='详细内容') content = Column(Text, comment='详细内容')
hospital = Column(String(255), comment='医院') hospital = Column(String(200), comment='医院')
pk_yljg = Column(INTEGER(11), comment='医院主键') pk_yljg = Column(INTEGER(11), comment='医院主键')
department = Column(String(255), comment='科室') department = Column(String(200), comment='科室')
pk_ylks = Column(INTEGER(11), comment='科室主键') pk_ylks = Column(INTEGER(11), comment='科室主键')
name = Column(String(30), comment='患者姓名') name = Column(String(20), comment='患者姓名')
age = Column(INTEGER(3), comment='年龄') age = Column(INTEGER(3), comment='年龄')
admission_date_str = Column(String(255), comment='入院日期字符串') admission_date_str = Column(String(255), comment='入院日期字符串')
admission_date = Column(Date, comment='入院日期') admission_date = Column(Date, comment='入院日期')
discharge_date_str = Column(String(255), comment='出院日期字符串') discharge_date_str = Column(String(255), comment='出院日期字符串')
discharge_date = Column(Date, comment='出院日期') discharge_date = Column(Date, comment='出院日期')
doctor = Column(String(20), comment='主治医生') doctor = Column(String(20), comment='主治医生')
admission_id = Column(String(50), comment='住院号') admission_id = Column(String(20), comment='住院号')
create_time = Column(DateTime, server_default=text("CURRENT_TIMESTAMP"), comment='创建时间') create_time = Column(DateTime, server_default=text("CURRENT_TIMESTAMP"), comment='创建时间')
creator = Column(String(255), comment='创建人') creator = Column(String(255), comment='创建人')
update_time = Column(DateTime, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), update_time = Column(DateTime, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"),
@@ -141,7 +141,7 @@ class ZxIeSettlement(Base):
pk_ie_settlement = Column(INTEGER(11), primary_key=True, comment='结算清单信息抽取主键') pk_ie_settlement = Column(INTEGER(11), primary_key=True, comment='结算清单信息抽取主键')
pk_phhd = Column(INTEGER(11), nullable=False, unique=True, comment='报销案子主键') pk_phhd = Column(INTEGER(11), nullable=False, unique=True, comment='报销案子主键')
name = Column(String(30), comment='患者姓名') name = Column(String(20), comment='患者姓名')
admission_date_str = Column(String(255), comment='入院日期字符串') admission_date_str = Column(String(255), comment='入院日期字符串')
admission_date = Column(Date, comment='入院日期') admission_date = Column(Date, comment='入院日期')
discharge_date_str = Column(String(255), comment='出院日期字符串') discharge_date_str = Column(String(255), comment='出院日期字符串')
@@ -155,9 +155,9 @@ class ZxIeSettlement(Base):
personal_funded_amount_str = Column(String(255), comment='自费金额字符串') personal_funded_amount_str = Column(String(255), comment='自费金额字符串')
personal_funded_amount = Column(DECIMAL(18, 2), comment='自费金额') personal_funded_amount = Column(DECIMAL(18, 2), comment='自费金额')
medical_insurance_type_str = Column(String(255), comment='医保类型字符串') medical_insurance_type_str = Column(String(255), comment='医保类型字符串')
medical_insurance_type = Column(String(40), comment='医保类型') medical_insurance_type = Column(String(10), comment='医保类型')
admission_id = Column(String(50), comment='住院号') admission_id = Column(String(20), comment='住院号')
settlement_id = Column(String(50), comment='医保结算单号码') settlement_id = Column(String(30), comment='医保结算单号码')
create_time = Column(DateTime, server_default=text("CURRENT_TIMESTAMP"), comment='创建时间') create_time = Column(DateTime, server_default=text("CURRENT_TIMESTAMP"), comment='创建时间')
creator = Column(String(255), comment='创建人') creator = Column(String(255), comment='创建人')
update_time = Column(DateTime, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), update_time = Column(DateTime, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"),

View File

@@ -1,6 +1,6 @@
x-env: x-env:
&template &template
image: fcb_photo_review:1.14.13 image: fcb_photo_review:1.14.14
restart: always restart: always
x-review: x-review:

View File

@@ -25,8 +25,8 @@ from photo_review import PATIENT_NAME, ADMISSION_DATE, DISCHARGE_DATE, MEDICAL_E
from ucloud import ufile from ucloud import ufile
from util import image_util, util, html_util from util import image_util, util, html_util
from util.data_util import handle_date, handle_decimal, parse_department, handle_name, \ from util.data_util import handle_date, handle_decimal, parse_department, handle_name, \
handle_insurance_type, handle_original_data, handle_hospital, handle_department, handle_id, handle_age, parse_money, \ handle_insurance_type, handle_original_data, handle_hospital, handle_department, handle_age, parse_money, \
parse_hospital, handle_doctor, handle_text parse_hospital, handle_doctor, handle_text, handle_admission_id, handle_settlement_id
# 合并信息抽取结果 # 合并信息抽取结果
@@ -389,8 +389,8 @@ def settlement_task(pk_phhd, settlement_list, identity):
get_best_value_in_keys(settlement_list_ie_result, PERSONAL_FUNDED_AMOUNT)), get_best_value_in_keys(settlement_list_ie_result, PERSONAL_FUNDED_AMOUNT)),
"medical_insurance_type_str": handle_original_data( "medical_insurance_type_str": handle_original_data(
get_best_value_in_keys(settlement_list_ie_result, MEDICAL_INSURANCE_TYPE)), get_best_value_in_keys(settlement_list_ie_result, MEDICAL_INSURANCE_TYPE)),
"admission_id": handle_id(get_best_value_in_keys(settlement_list_ie_result, ADMISSION_ID)), "admission_id": handle_admission_id(get_best_value_in_keys(settlement_list_ie_result, ADMISSION_ID)),
"settlement_id": handle_id(get_best_value_in_keys(settlement_list_ie_result, SETTLEMENT_ID)), "settlement_id": handle_settlement_id(get_best_value_in_keys(settlement_list_ie_result, SETTLEMENT_ID)),
} }
settlement_data["admission_date"] = handle_date(settlement_data["admission_date_str"]) settlement_data["admission_date"] = handle_date(settlement_data["admission_date_str"])
settlement_data["admission_date"] = handle_date(settlement_data["admission_date_str"]) settlement_data["admission_date"] = handle_date(settlement_data["admission_date_str"])

View File

@@ -91,7 +91,7 @@ def handle_hospital(string):
return "" return ""
# 只允许汉字、数字 # 只允许汉字、数字
string = re.sub(r'[^⺀-鿿0-9]', '', string) string = re.sub(r'[^⺀-鿿0-9]', '', string)
return string[:255] return string[:200]
def handle_department(string): def handle_department(string):
@@ -99,7 +99,7 @@ def handle_department(string):
return "" return ""
# 只允许汉字 # 只允许汉字
string = re.sub(r'[^⺀-鿿]', '', string) string = re.sub(r'[^⺀-鿿]', '', string)
return string[:255] return string[:200]
def parse_department(string): def parse_department(string):
@@ -123,7 +123,7 @@ def parse_department(string):
def handle_name(string): def handle_name(string):
if not string: if not string:
return "" return ""
return re.sub(r'[^⺀-鿿·]', '', string)[:30] return re.sub(r'[^⺀-鿿·]', '', string)[:20]
def handle_doctor(string): def handle_doctor(string):
@@ -160,13 +160,22 @@ def handle_original_data(string):
# 处理id类数据 # 处理id类数据
def handle_id(string): def handle_admission_id(string):
if not string: if not string:
return "" return ""
# 只允许字母和数字 # 只允许字母和数字
string = re.sub(r'[^0-9a-zA-Z]', '', string) string = re.sub(r'[^0-9a-zA-Z]', '', string)
# 防止过长存入数据库失败 # 防止过长存入数据库失败
return string[:50] return string[:20]
def handle_settlement_id(string):
if not string:
return ""
# 只允许字母和数字
string = re.sub(r'[^0-9a-zA-Z]', '', string)
# 防止过长存入数据库失败
return string[:30]
# 处理年龄类数据 # 处理年龄类数据