优化医院的匹配
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
x-env:
|
x-env:
|
||||||
&template
|
&template
|
||||||
image: fcb_photo_review:1.11.1
|
image: fcb_photo_review:1.11.2
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ from time import sleep
|
|||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
import requests
|
import requests
|
||||||
from sqlalchemy import update
|
from sqlalchemy import update, or_
|
||||||
|
|
||||||
from db import MysqlSession
|
from db import MysqlSession
|
||||||
from db.mysql import BdYljg, BdYlks, ZxIeResult, ZxIeCost, ZxIeDischarge, ZxIeSettlement, ZxPhhd, ZxPhrec
|
from db.mysql import BdYljg, BdYlks, ZxIeResult, ZxIeCost, ZxIeDischarge, ZxIeSettlement, ZxPhhd, ZxPhrec
|
||||||
@@ -239,8 +239,8 @@ def discharge_task(pk_phhd, discharge_record, identity):
|
|||||||
hospital_value = get_values_of_keys(discharge_record_ie_result, HOSPITAL)
|
hospital_value = get_values_of_keys(discharge_record_ie_result, HOSPITAL)
|
||||||
if hospital_value:
|
if hospital_value:
|
||||||
session = MysqlSession()
|
session = MysqlSession()
|
||||||
yljg = session.query(BdYljg.pk_yljg, BdYljg.name) \
|
yljg = (session.query(BdYljg.pk_yljg, BdYljg.name)
|
||||||
.filter(BdYljg.name.in_(hospital_value)).limit(1).one_or_none()
|
.filter(or_(*[BdYljg.name.like(f'%{hos}%') for hos in hospital_value])).limit(1).one_or_none())
|
||||||
session.close()
|
session.close()
|
||||||
if yljg:
|
if yljg:
|
||||||
discharge_data["pk_yljg"] = yljg.pk_yljg
|
discharge_data["pk_yljg"] = yljg.pk_yljg
|
||||||
|
|||||||
Reference in New Issue
Block a user