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

dumplicate bug fix

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