Commit 7768fba6 authored by 陶书衡's avatar 陶书衡

dumplicate bug fix

parent dae5cf1c
...@@ -4,33 +4,22 @@ import re ...@@ -4,33 +4,22 @@ import re
## ##
Finding = """ Finding = """
左IV区淋巴结:1枚,直径2.5cm(1) 一带黏膜组织5*4*3cm,切面见一溃疡性肿块2.5*1.5*0.5cm,灰白界不清(1)
颏下:1枚,直径2cm(1) 送检切缘:前、后、左、右、底、舌N、左舌、舌腹、右舌肌、下颌舌骨肌均0.5cm
左颊:部分上、下颌骨及颊部组织12*9*8cm,黏膜切面见一肿块6*3*2cm,灰白,界不清(1) 另送:
送检切缘:前内、前外、上内、上外、颊、翼内肌、翼外肌、腮腺、鼻底、鼻旁、鼻腔、软腭、舌根、颏突,均0.5cm 左颈大块9*6*4cm,一侧见一腺体4*3*2cm,灰黄分叶,余为脂肪血管。
送检切缘:腮腺2,0.5cm I区: 3只直径1-1.5cm。
左颈大块:9*6*4cm,为肌肉、脂肪、血管,灰黄。 II区: 4只直径0.5-1.5cm。
右颈大块:10*8*4cm,一侧见一腺体4*3*2cm,灰黄分叶,余为脂肪血管。 III区: 12只直径0.4-1cm。
左I区: 1只直径1cm。
左II区: 2只直径0.5-1cm。
左III区: 4只直径0.8-1.3cm。
左IV区: 3只直径1.2-1.8cm。
左V区: 1只直径1cm。
右I区: 3只直径1-3.5cm。
右II区: 3只直径0.8-2cm。
右III区: 4只直径0.5-1cm。
右IV区: 4只直径0.5-1.2cm。
右V区: 2只直径0.5-0.8cm。
""" """
Conclusion = """ Conclusion = """
“左颊”黏膜鳞状细胞癌,高-中分化,DOI>10mm “左口底”黏膜鳞状细胞癌,高-中分化,DOI≤5mm
送检切缘:“腮腺”阳性(+)、“前内、前外、上内、上外、颊、翼内肌、翼外肌、鼻底、鼻旁、鼻腔、软腭、舌根、颏突、腮腺2”均阴性(-) 送检切缘:“前、后、左、右、底、舌N、左舌、舌腹、右舌肌、下颌舌骨肌”均阴性(-)
冰冻送检:“颏下淋巴结”1只内见鳞状细胞癌转移(+),侵犯至包膜外,“左IV区淋巴结”1只为软组织,伴出血 “左颌下腺”轻度慢性炎
“左颈大块”为软组织、“右颌下腺”轻度慢性炎 送检淋巴结:“左”“I”3只,“II”4只,“III”12只均阴性(-)
送检淋巴结:“右I”1/3只有肿瘤转移(+),余及“左”“I”1只,“II”2只,“III”4只,“IV”3只,“V”1只,“右”“II”3只,“III”4只,“IV”4只,“V”2只均阴性(-) 北院分子结果(NM2021-0492):EGFR扩增探针 FISH(-)
免疫组化结果NI21-695 北院免疫组化结果(NI2021-1029):
AE1/AE3+ CKH+ CK5/6+ EGFR部分+ Ki67部分+ CD31- S-100- P16- AE1/AE3+ CKH+ CK5/6+ EGFR部分+ Ki67部分+ CD31- S-100- P16-
北院分子结果(NM2021-0316):EGFR扩增探针 FISH(未见明显扩增(-))
""" """
oral = Oral(Finding, Conclusion, verbose = False) oral = Oral(Finding, Conclusion, verbose = False)
...@@ -151,12 +140,21 @@ def get_color(text, entity_list, replaced_word, ImmunohistochemistryContent, Mol ...@@ -151,12 +140,21 @@ def get_color(text, entity_list, replaced_word, ImmunohistochemistryContent, Mol
# print(j) # print(j)
other.append(j.span()) other.append(j.span())
synonyms = list(set(synonyms)) synonyms = sorted(list(set(synonyms)))
negative = list(set(negative)) negative = sorted(list(set(negative)))
numeracal = list(set(numeracal)) numeracal = sorted(list(set(numeracal)))
summary = list(set(summary)) summary = sorted(list(set(summary)))
classification = list(set(classification)) classification = sorted(list(set(classification)))
other = list(set(other)) other = sorted(list(set(other)))
# print("*****************")
remove_dumplicate(other)
remove_dumplicate(synonyms)
remove_dumplicate(negative)
remove_dumplicate(numeracal)
remove_dumplicate(summary)
remove_dumplicate(classification)
# print("*****************")
return { return {
'医学术语解析': other, '医学术语解析': other,
...@@ -168,6 +166,13 @@ def get_color(text, entity_list, replaced_word, ImmunohistochemistryContent, Mol ...@@ -168,6 +166,13 @@ def get_color(text, entity_list, replaced_word, ImmunohistochemistryContent, Mol
} }
def remove_dumplicate(l):
for i in range(len(l) - 1):
if l[i + 1][0] < l[i][1]:
l.pop(i + 1)
## ##
if __name__ == '__main__': if __name__ == '__main__':
...@@ -182,17 +187,17 @@ if __name__ == '__main__': ...@@ -182,17 +187,17 @@ if __name__ == '__main__':
print("\n同义词判断:") print("\n同义词判断:")
for i in r1['同义词判断']: for i in r1['同义词判断']:
print(Finding[i[0]: i[1]], i[0], i[1]) print(Finding[i[0]: i[1]], i[0], i[1])
print("\n识别否定修饰词及其修饰对象:") print("\n否定修饰解析:")
for i in r1['识别否定修饰词及其修饰对象']: for i in r1['否定修饰解析']:
print(Finding[i[0]: i[1]], i[0], i[1]) print(Finding[i[0]: i[1]], i[0], i[1])
print("\n数值解析:") print("\n数值解析:")
for i in r1['数值解析']: for i in r1['数值解析']:
print(Finding[i[0]: i[1]], i[0], i[1]) print(Finding[i[0]: i[1]], i[0], i[1])
print("\n对可归纳总结的信息进行解析后归纳判断:") print("\n归纳解析:")
for i in r1['对可归纳总结的信息进行解析后归纳判断']: for i in r1['归纳解析']:
print(Finding[i[0]: i[1]], i[0], i[1]) print(Finding[i[0]: i[1]], i[0], i[1])
print("\n对定义明确的分类变量进行赋值:") print("\n分类变量解析:")
for i in r1['对定义明确的分类变量进行赋值']: for i in r1['分类变量解析']:
print(Finding[i[0]: i[1]], i[0], i[1]) print(Finding[i[0]: i[1]], i[0], i[1])
print("\n*****************************************\n") print("\n*****************************************\n")
...@@ -207,17 +212,17 @@ if __name__ == '__main__': ...@@ -207,17 +212,17 @@ if __name__ == '__main__':
print("\n同义词判断:") print("\n同义词判断:")
for i in r2['同义词判断']: for i in r2['同义词判断']:
print(Conclusion[i[0]: i[1]], i[0], i[1], ) print(Conclusion[i[0]: i[1]], i[0], i[1], )
print("\n识别否定修饰词及其修饰对象:") print("\n否定修饰解析:")
for i in r2['识别否定修饰词及其修饰对象']: for i in r2['否定修饰解析']:
print(Conclusion[i[0]: i[1]], i[0], i[1]) print(Conclusion[i[0]: i[1]], i[0], i[1])
print("\n数值解析:") print("\n数值解析:")
for i in r2['数值解析']: for i in r2['数值解析']:
print(Conclusion[i[0]: i[1]], i[0], i[1]) print(Conclusion[i[0]: i[1]], i[0], i[1])
print("\n对可归纳总结的信息进行解析后归纳判断:") print("\n归纳解析:")
for i in r2['对可归纳总结的信息进行解析后归纳判断']: for i in r2['归纳解析']:
print(Conclusion[i[0]: i[1]], i[0], i[1]) print(Conclusion[i[0]: i[1]], i[0], i[1])
print("\n对定义明确的分类变量进行赋值:") print("\n分类变量解析:")
for i in r2['对定义明确的分类变量进行赋值']: for i in r2['分类变量解析']:
print(Conclusion[i[0]: i[1]], i[0], i[1]) print(Conclusion[i[0]: i[1]], i[0], i[1])
# ## # ##
......
...@@ -33,7 +33,6 @@ ipython-genutils==0.2.0 ...@@ -33,7 +33,6 @@ ipython-genutils==0.2.0
ipywidgets==7.6.5 ipywidgets==7.6.5
itsdangerous==2.0.1 itsdangerous==2.0.1
jedi==0.18.0 jedi==0.18.0
Jinja2==1.2
jsonschema==3.2.0 jsonschema==3.2.0
jupyter==1.0.0 jupyter==1.0.0
jupyter-client==7.0.3 jupyter-client==7.0.3
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment