From 8f522a68b12caa9ccccb80bf0d96c6b295db5fb7 Mon Sep 17 00:00:00 2001 From: Tommy in Tongji <36354458+TommyZihao@users.noreply.github.com> Date: Sat, 25 Jun 2022 18:09:41 +0800 Subject: [PATCH 1/5] Update question_classifier.py --- question_classifier.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/question_classifier.py b/question_classifier.py index 2ee72b8..f04cf74 100644 --- a/question_classifier.py +++ b/question_classifier.py @@ -64,10 +64,10 @@ def classify(self, question): if not medical_dict: return {} data['args'] = medical_dict - #收集问句当中所涉及到的实体类型 + # 收集问题当中所涉及到的实体类型 types = [] - for type_ in medical_dict.values(): - types += type_ + for each in medical_dict.values(): + types.extend(each) question_type = 'others' question_types = [] @@ -224,4 +224,4 @@ def check_words(self, wds, sent): while 1: question = input('input an question:') data = handler.classify(question) - print(data) \ No newline at end of file + print(data) From a75b6838f4e9783e1be23455b4deaf0e85683b9a Mon Sep 17 00:00:00 2001 From: Tommy in Tongji <36354458+TommyZihao@users.noreply.github.com> Date: Sun, 26 Jun 2022 10:34:40 +0800 Subject: [PATCH 2/5] Add files via upload --- notebook_tutorials/medical_data.csv | 190 ++ ...347\275\256\347\216\257\345\242\203.ipynb" | 134 + ...350\257\206\345\233\276\350\260\261.ipynb" | 2922 +++++++++++++++++ ...350\257\206\345\233\276\350\260\261.ipynb" | 106 + ...225\264demo\344\275\223\351\252\214.ipynb" | 758 +++++ ...345\222\214\345\205\263\347\263\273.ipynb" | 1676 ++++++++++ ...350\257\242\350\257\255\345\217\245.ipynb" | 458 +++ ...346\210\220\345\233\236\347\255\224.ipynb" | 287 ++ ...346\235\245\345\261\225\346\234\233.ipynb" | 46 + ...260\346\215\256-json\350\275\254csv.ipynb" | 323 ++ 10 files changed, 6900 insertions(+) create mode 100644 notebook_tutorials/medical_data.csv create mode 100644 "notebook_tutorials/\343\200\220A\343\200\221\345\256\211\350\243\205\351\205\215\347\275\256\347\216\257\345\242\203.ipynb" create mode 100644 "notebook_tutorials/\343\200\220B\343\200\221\345\257\274\345\205\245\346\225\260\346\215\256\357\274\214\345\210\233\345\273\272\345\214\273\347\226\227\347\237\245\350\257\206\345\233\276\350\260\261.ipynb" create mode 100644 "notebook_tutorials/\343\200\220C\343\200\221\346\216\242\347\264\242\347\237\245\350\257\206\345\233\276\350\260\261.ipynb" create mode 100644 "notebook_tutorials/\343\200\220D\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272\345\256\214\346\225\264demo\344\275\223\351\252\214.ipynb" create mode 100644 "notebook_tutorials/\343\200\220E\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272-\346\217\220\345\217\226\351\227\256\351\242\230\347\233\270\345\205\263\345\256\236\344\275\223\345\222\214\345\205\263\347\263\273.ipynb" create mode 100644 "notebook_tutorials/\343\200\220F\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272-\347\224\237\346\210\220Cypher\346\237\245\350\257\242\350\257\255\345\217\245.ipynb" create mode 100644 "notebook_tutorials/\343\200\220G\343\200\221\346\237\245\350\257\242\345\233\276\346\225\260\346\215\256\345\272\223\357\274\214\347\224\237\346\210\220\345\233\236\347\255\224.ipynb" create mode 100644 "notebook_tutorials/\343\200\220Y\343\200\221\346\234\252\346\235\245\345\261\225\346\234\233.ipynb" create mode 100644 "notebook_tutorials/\343\200\220Z\343\200\221\346\225\264\347\220\206\346\225\260\346\215\256-json\350\275\254csv.ipynb" diff --git a/notebook_tutorials/medical_data.csv b/notebook_tutorials/medical_data.csv new file mode 100644 index 0000000..4c5441d --- /dev/null +++ b/notebook_tutorials/medical_data.csv @@ -0,0 +1,190 @@ +疾病名称,疾病描述,疾病种类,科室,病因,症状,检查,并发症,花费,疗程,疗法,治愈率,易感人群,感染概率,感染途径,预防措施,推荐药物,常用药物,具体药物,可以吃,不可以吃,推荐吃,是否纳入医保 +肺泡蛋白质沉积症,肺泡蛋白质沉积症(简称PAP),又称Rosen-Castle-man-Liebow综合征,是一种罕见疾病。该病以肺泡和细支气管腔内充满PAS染色阳性,来自肺的富磷脂蛋白质物质为其特征,好发于青中年,男性发病约3倍于女性。,"疾病百科,内科,呼吸内科","内科,呼吸内科","病因未明,推测与几方面因素有关:如大量粉尘吸入(铝,二氧化硅等),机体免疫功能下降(尤其婴幼儿),遗传因素,酗酒,微生物感染等,而对于感染,有时很难确认是原发致病因素还是继发于肺泡蛋白沉着症,例如巨细胞病毒,卡氏肺孢子虫,组织胞浆菌感染等均发现有肺泡内高蛋白沉着。 +虽然启动因素尚不明确,但基本上同意发病过程为脂质代谢障碍所致,即由于机体内,外因素作用引起肺泡表面活性物质的代谢异常,到目前为止,研究较多的有肺泡巨噬细胞活力,动物实验证明巨噬细胞吞噬粉尘后其活力明显下降,而病员灌洗液中的巨噬细胞内颗粒可使正常细胞活力下降,经支气管肺泡灌洗治疗后,其肺泡巨噬细胞活力可上升,而研究未发现Ⅱ型细胞生成蛋白增加,全身脂代谢也无异常,因此目前一般认为本病与清除能力下降有关。","紫绀,胸痛,呼吸困难,乏力,毓卓","胸部CT检查,肺活检,支气管镜检查",多重肺部感染,根据不同医院,收费标准不一致,省市三甲医院约( 8000——15000 元),约3个月,支气管肺泡灌洗,约40%,,0.00002%,无传染性,"1、避免感染分支杆菌病,卡氏肺囊肿肺炎,巨细胞病毒等。 +2、注意锻炼身体,提高免疫力。",,,,,,,否 +百日咳,"百日咳(pertussis,whoopingcough)是由百日咳杆菌所致的急性呼吸道传染病。其特征为阵发性痉挛性咳嗽,咳嗽末伴有特殊的鸡鸣样吸气吼声。病程较长,可达数周甚至3个月左右,故有百日咳之称。多见于5岁以下的小儿,幼婴患本病时易有窒息、肺炎,脑病等并发症,病死率高。百日咳患者,阴性感染者及带菌者为传染源。潜伏期末到病后2-3周传染性最强。百日咳经呼吸道飞沫传播。典型患者病程6-8周,临床病程可分3期:1.卡他期,从发病到开始出现咳嗽,一般1-2周。2,痉咳期,一般2-4周或更长,阵发性痉挛性咳嗽为本期特点。3,恢复期,一般1-2周,咳嗽发作的次数减少,程度减轻,不再出现阵发性痉咳。一般外周血白细胞计数明显增高,分类以淋巴细胞为主。在诊断本病时要注意与支气管异物及肺门淋巴结结核鉴别。近年来幼婴及成人发病有增多趋势。","疾病百科,儿科,小儿内科","儿科,小儿内科","(一)发病原因 +病原菌是鲍特菌属(Bordetella)中的百日咳鲍特菌(B.pertussis),常称百日咳杆菌,已知鲍特菌属有四种杆菌,除百日咳鲍特菌外还有副百日咳鲍特菌(B.parapertussis),支气管败血鲍特菌(B.bronchiseptica)和鸟型鲍特菌(B.avium),鸟型鲍特菌一般不引起人类致病,仅引起鸟类感染,百日咳杆菌长约1.0~1.5μm,宽约0.3~0.5μm,有荚膜,不能运动,革兰染色阴性,需氧,无芽孢,无鞭毛,用甲苯胺蓝染色两端着色较深,细菌培养需要大量(15%~25%)鲜血才能繁殖良好,故常以鲍-金(Border-Gengous)培养基(即血液,甘油,马铃薯)分离菌落,百日咳杆菌生长缓慢,在35~37℃潮湿的环境中3~7天后,一种细小的,不透明的菌落生长,初次菌落隆起而光滑,为光滑(S)型,又称I相细菌,形态高低一致,有荚膜和较强的毒力及抗原性,致病力强,如将分离菌落在普通培养基中继续培养,菌落由光滑型变为粗糙(R)型,称Ⅳ相细菌,无荚膜,毒力及抗原性丢失,并失去致病力,Ⅱ相,Ⅲ相为中间过渡型,百日咳杆菌能产生许多毒性因子,已知有五种毒素: +1、百日咳外毒素(PT):是存在百日咳杆菌细胞壁中一种蛋白质,过去称作为白细胞或淋巴细胞增多促进因子(leukocytosis or lymphocyte promoting factor,LPE),组胺致敏因子(histamin sensitizing factor,HSF),胰岛素分泌活性蛋白(insulin activating protein,IAP),百日咳外毒素由五种非共价链亚单位(S1~S5)所组成,亚单位(S2~S5)为无毒性单位,能与宿主细胞膜结合,通过具有酶活力的亚单位S1介导毒性作用,S1能通过腺苷二磷酸(ADP)-核糖转移酶的活力,催化部分ADP-核糖从烟酰胺腺嘌呤二核苷酸(NAD)中分离出来,转移至细胞膜抑制鸟苷三磷酸(CTP)结合即G蛋白合成,导致细胞变生,同时还能促使淋巴细胞增高,活化胰岛细胞及增强免疫应答。 +2、耐热的内毒素(endotoxin,ET),100℃60min只能部分破坏,180℃才能灭活,此毒素能引起机体发热及痉咳。 +3、不耐热毒素(HLT)这种毒素加热55℃30min后能破坏其毒性作用,此毒素抗体对百日咳杆菌感染无保护作用。 +4、气管细胞毒素(TCT):能损害宿主呼吸道纤毛上皮细胞,使之变性,坏死。 +5、腺苷环化酶毒素(ACT):存在百日咳杆菌细胞表面的一种酶,此酶进入吞噬细胞后被调钙蛋白所激活,催化cAMP的生成,干扰吞噬作用,并抑制中性粒细胞的趋化和吞噬细胞杀菌能力,使其能持续感染,ACT也是一种溶血素,能起溶血作用,百日咳的重要抗原是百日咳菌的两种血凝活性抗原,一种为丝状血凝素(filamentous hemagglutinin,FHA),因来自菌体表面菌毛故又称菌毛抗原,FHA在百日咳杆菌黏附于呼吸道上皮细胞的过程中起决定作用,为致病的主要原因。实验发现,FHA免疫小鼠能对抗百日咳杆菌致死性攻击,因此FHA为保护性抗原,另一种凝集原(aggluginogens,AGG)为百日咳杆菌外膜及菌毛中的一种蛋白质成分,主要含1,2,3三种血清型凝血因子,AGG-1具有种特异性;AGG-2,3具有型特异性,通过检测凝集原的型别来了解当地流行情况,目前认为这两种血凝素抗原相应抗体是保护性抗体,百日咳杆菌根据不耐热凝集原抗原性不同分为七型凝集原,1型凝集原为所有百日咳杆菌均具备,7型凝集原为鲍特菌属(包括副百日咳杆菌,支气管败血性杆菌)所共有,2~6型以不同的配合将百日咳杆菌分为不同血清型,测定血清型主要是研究流行时菌株的血清型和选择特殊血清型菌株生产菌苗,此外,副百日咳杆菌与百日咳杆菌无交叉免疫,亦可引起流行,百日咳杆菌对外界理化因素抵抗力弱,55℃经30min即被破坏,干燥数小时即可杀灭,对一般消毒剂敏感,对紫外线抵抗力弱,但在0~10℃存活较长。 +(二)发病机制 +1、发病机制:百日咳发病机制不甚清楚,很可能是百日咳毒素对机体综合作用的结果,当细菌随空气飞沫浸入易感者的呼吸道后,细菌的丝状血凝素黏附于咽喉至细支气管黏膜的纤毛上皮细胞表面;继之,细菌在局部繁殖并产生多种毒素如百日咳外毒素,腺苷环化酶等引起上皮细胞纤毛麻痹和细胞变性,使其蛋白合成降低,上皮细胞坏死脱落,以及全身反应,由于上皮细胞的病变发生和纤毛麻痹使小支气管中黏液及坏死上皮堆聚潴留,分泌物排出受阻,不断刺激呼吸道的周围神经,传入大脑皮质及延髓咳嗽中枢,反射性引起痉挛性咳嗽,由于长期刺激使咳嗽中枢形成兴奋灶,以致非特异性刺激,如进食,咽部检查,冷风,烟雾以及注射疼痛等,均可引起反射性的痉咳,恢复期间亦可因哭泣及其他感染,诱发百日咳样痉咳,近来研究表明百日咳发生机制与百日咳杆菌毒素类物质损害宿主细胞免疫功能有关,CD4+T细胞和Th1细胞分泌的细胞因子所介导的免疫反应,在百日咳杆菌感染中起重要作用。 +2、病理解剖:百日咳杆菌侵犯鼻咽,喉,气管,支气管黏膜,可见黏膜充血,上皮细胞的基底部有多核白细胞,单核细胞浸润及部分细胞坏死。支气管及肺泡周围间质除炎症浸润外,可见上皮细胞胞质空泡形成,甚至核膜破裂溶解,坏死,脱落,但极少波及肺泡。若分泌物阻塞可引起肺不张,支气管扩张,有继发感染者,易发生支气管肺炎,有时可有间质性肺炎;若发生百日咳脑病,镜检或肉眼可见脑组织充血水肿,点状出血,皮质萎缩,神经细胞变性,脑水肿等改变,此时常可见到肝脏脂肪浸润等变化。","吸气时有蝉鸣音,痉挛性咳嗽,胸闷,肺阴虚,抽搐,低热,闫鹏辉,惊厥","耳、鼻、咽拭子细菌培养,周围血白细胞计数及分类检验,血常规,酶联免疫吸附试验,白细胞分类计数",肺不张,根据不同医院,收费标准不一致,市三甲医院约(1000-4000元),1-2个月,"药物治疗,支持性治疗",98%,多见于小儿,0.5%,呼吸道传播,"1、控制传染源:在流行季节,若有前驱症状应及早抗生素治疗。 +2、切断传播途径:由于百日咳杆菌对外界抵抗力较弱,无需消毒处理,但应保持室内通风,衣物在阳光下曝晒,对痰液及口鼻分泌物则应进行消毒处理。","琥乙红霉素片,琥乙红霉素颗粒,百咳静糖浆,穿心莲内酯片,红霉素肠溶片,环酯红霉素片","穿心莲内酯片,百咳静糖浆","惠普森穿心莲内酯片(穿心莲内酯片),北京同仁堂百咳静糖浆(百咳静糖浆),邦琪药业百咳静糖浆(百咳静糖浆),东新药业百咳静糖浆(百咳静糖浆),达发新(环酯红霉素片),康美药业红霉素肠溶片(红霉素肠溶片),旺龙药业琥乙红霉素颗粒(琥乙红霉素颗粒),白云山医药琥乙红霉素片(琥乙红霉素片),国瑞琥乙红霉素片(琥乙红霉素片),利君制药红霉素肠溶片(红霉素肠溶片),东信药业琥乙红霉素颗粒(琥乙红霉素颗粒),石药欧意红霉素肠溶片(红霉素肠溶片),平光制药红霉素肠溶片(红霉素肠溶片),北京曙光药业红霉素肠溶片(红霉素肠溶片),迪瑞制药琥乙红霉素颗粒(琥乙红霉素颗粒),永定制药百咳静糖浆(百咳静糖浆),东信药业琥乙红霉素片(琥乙红霉素片),利君制药琥乙红霉素片(琥乙红霉素片),北京中新制药琥乙红霉素片(琥乙红霉素片),华南药业红霉素肠溶片(红霉素肠溶片),佐今明百咳静糖浆(百咳静糖浆),恒益药业琥乙红霉素颗粒(琥乙红霉素颗粒),利君沙(琥乙红霉素颗粒)","南瓜子仁,圆白菜,樱桃番茄,小白菜","螃蟹,海蟹,海虾,海螺","清蒸鸡蛋羹,百合双耳鸡蛋羹,排骨汤,罗汉果雪耳鸡汤,小黄瓜凉拌面,黄瓜三丝汤,黄瓜拌兔丝,黄瓜拌皮丝",否 +苯中毒,"苯(benzene)是从煤焦油分馏及石油裂解所得的一种芳香烃化合物,系无色有芳香气味的油状液体。挥发甚速,易燃易爆。工业上用作溶剂、稀释剂和化工原料。苯属中等毒类,可引起急性或慢性中毒。 +急性苯中毒是指口服含苯的有机溶剂或吸入高浓度苯蒸气后,出现以中枢神经系统麻醉作用为主要表现的病理生理过程,主要症状轻者为醉酒状,步态不稳,哭笑失常,重者意识丧失,抽搐,可因呼吸中枢麻痹或循环衰竭死亡。慢性苯中毒是指苯及其代谢产物酚类影响了骨髓的造血功能,临床表现为白细胞计数和血小板立秋持续减少,最终发展为再生障碍性贫血或白血病。也可影响神经系统,表现为神经衰弱和自主神经功能紊乱。","疾病百科,急诊科",急诊科,"吸入苯蒸气或皮肤接触苯而引起的中毒,有急性、慢性之分。急性苯中毒主要对中枢神经系统产生麻醉作用,出现昏迷和肌肉抽搐;高浓度的苯对皮肤有刺激作用。长期接角低浓度的苯可引起慢性苯中毒,出现造血障碍,早期常见血白细胞数减低,进而出现血小板数减少和贫血。患者可有鼻出血、牙龈出血、皮下出血、月经过多等临床表现。 +急性苯中毒多为误服或急性吸入含苯的有机溶剂所致。这些有机溶剂包括油漆、稀料、工业胶水等。慢性苯中毒是长期吸入低浓度苯及代谢产物酚类所致。","恶心,抽搐,感觉障碍","血常规,骨髓象分析,先令氏指数",贫血,根据不同病情,不同医院,收费标准不一致,市三甲医院约(5000——8000元),根据不同病情一般为2-4周,"药物治疗,支持性治疗",75%,多见于制鞋工人及接触化工染料的工人,0.065%,无传染性,对于急性中毒患者,可以立即脱离现场至空气新鲜处,脱去污染的衣着,并用肥皂水或清水冲洗污染的皮肤。口服中毒者,要给患者洗胃,中毒者应卧床静息,并接受对症、支持治疗,可给予葡萄糖醛酸。要注意防止患者出现脑水肿,切记勿给心搏未停者使用肾上腺素,对由于苯中毒引起的再生障碍性贫血症患者,可给予小量多次输血及糖皮质激素治疗。,"布美他尼片,十一味金色丸,注射用布美他尼,注射用呋塞米,盐酸利多卡因注射液,注射用硫代硫酸钠,大月晶丸,仁青芒觉,注射用鼠神经生长因子,地塞米松磷酸钠注射液","布美他尼片,十一味金色丸","桂林南药布美他尼片(布美他尼片),雄巴拉曲神水十一味金色丸(十一味金色丸),西藏甘露仁青芒觉(仁青芒觉),金诃藏药大月晶丸(大月晶丸),金诃藏药仁青芒觉(仁青芒觉),苏肽生(注射用鼠神经生长因子),新峰药业盐酸利多卡因注射液(盐酸利多卡因注射液),海斯制药盐酸利多卡因注射液(盐酸利多卡因注射液),西藏甘露十一味金色丸(十一味金色丸),卓峰地塞米松磷酸钠注射液(地塞米松磷酸钠注射液),白云山天心地塞米松磷酸钠注(地塞米松磷酸钠注射液),涟水制药地塞米松磷酸钠注射(地塞米松磷酸钠注射液),金耀药业地塞米松磷酸钠注射(地塞米松磷酸钠注射液),遂成药业地塞米松磷酸钠注射(地塞米松磷酸钠注射液),恩经复(注射用鼠神经生长因子),金路捷(注射用鼠神经生长因子),新亚注射用硫代硫酸钠(注射用硫代硫酸钠),北京永康药业盐酸利多卡因注(盐酸利多卡因注射液),北京益民药业盐酸利多卡因注(盐酸利多卡因注射液),中国大冢盐酸利多卡因注射液(盐酸利多卡因注射液),盐酸利多卡因注射液(盐酸利多卡因注射液),全星制药注射用布美他尼(注射用布美他尼),皇隆制药注射用呋塞米(注射用呋塞米)","鸡蛋,大豆,猪肉(瘦),樱桃番茄","海蟹,海虾,海参(水浸),辣椒(青、尖)","豆腐干炒韭菜,素炒小白菜,白菜蛋花粥",否 +喘息样支气管炎,喘息样支气管炎(asthmatoidbronchitis)又称哮喘性支气管炎,泛指一组喘息表现的婴幼儿急性支气管炎,是一种过敏性质的、常与呼吸道感染有关的疾病。患者常有湿疹及其他过敏史,尤以肥胖者多发,病程较长有反复发作史。急性喘息样支气管炎的主要病理基础是支气管平滑肌痉挛、微血管渗漏、粘膜水肿、炎性细胞浸润、分泌物增多滞留所致的气道可逆性阻塞。婴幼儿的气管和支气管都比较狭小,其周围弹力纤维发育完善,故其粘膜易受感染或其他刺激而肿胀充血,引起管道狭窄,分泌物粘稠不易咳出,从而产生喘鸣音。喘息伴呼气性呼吸困难以夜间为重,可有刺激性咳嗽。喘息可自行缓解或经治疗后缓解,发作间隙可无任何症状和体征,部分可发展为支气管哮喘。,"疾病百科,内科,呼吸内科","内科,呼吸内科","因为多种病毒和细菌感染均可引起,较常见的有合胞病毒、副流感病毒、流感病毒、腺病毒、鼻病毒及肺炎支原体等,大多数病例可在病毒感染基础上并发细菌感染。 +婴幼儿的气管和支气管都比较狭小,其周围弹力纤维发育完善,故其粘膜易受感染或其他刺激而肿胀充血,引起管道狭窄,分泌物粘稠不易咳出,从而产生喘鸣音。 +因为婴幼儿患病毒感染者甚多,仅一小部分患儿呈喘息样支气管炎表现,提示同一病毒在不同个别中所产生的不同病理生理改变和临床表现,与机体内在因素密切相关。如近年发现合胞病毒引起的喘息样支气管炎患儿出现特异性IgE抗体,其鼻咽分泌物中组织胺浓度明显高于同样感染而无喘息表现的患儿,其亲属往往有过敏性鼻炎、荨麻疹、哮喘等变态反应性疾病史。约30%左右的患儿曾患湿疹,测血清SIgE含量常见增高。","耸肩喘息,哮鸣音,纤毛上皮细胞损伤脱落,变应性咳嗽,化学性支气管炎,喘息,冬春季的慢性咳...,咳嗽伴哮鸣音","肺部检查,肺和胸膜听诊,抗链球菌型M蛋白抗体,抗链球菌壁多糖抗体,酶联免疫吸附试验",支气管哮喘,根据不同医院,收费标准不一致,市三甲医院约(5000——8000元),6-12个月,"药物治疗,支持性治疗",95%,无特定的人群,3-5%,无传染性,根据上节所述,对喘息样支气管炎病儿,要注意家族与患儿自身过敏史,嗜酸性粒细胞检查,血清IgE水平等进行分析。如有支气管哮喘可疑时,应及早给予哮喘的防治措施。,"枸橼酸喷托维林片,氨茶碱片,二羟丙茶碱片,胸腺肽肠溶片,硫酸沙丁胺醇气雾剂,小青龙合剂,硫酸沙丁胺醇片,蛇胆川贝液,小青龙颗粒,布地奈德气雾剂,喷托维林氯化铵糖浆","布地奈德气雾剂,喷托维林氯化铵糖浆","信谊布地奈德气雾剂(布地奈德气雾剂),桑海制药喷托维林氯化铵糖浆(喷托维林氯化铵糖浆),赣南制药喷托维林氯化铵糖浆(喷托维林氯化铵糖浆),奇莫欣(胸腺肽肠溶片),振兴氨茶碱片(氨茶碱片),盛翔制药蛇胆川贝液(蛇胆川贝液),蛇胆川贝液(蛇胆川贝液),晶珠藏药蛇胆川贝液(蛇胆川贝液),天天乐药业蛇胆川贝液(蛇胆川贝液),东信药业蛇胆川贝液(蛇胆川贝液),广西灵峰药业蛇胆川贝液(蛇胆川贝液),吉林东方制药枸橼酸喷托维林(枸橼酸喷托维林片),万托林(硫酸沙丁胺醇气雾剂),天津太平洋二羟丙茶碱片(二羟丙茶碱片),海南制药厂蛇胆川贝液(蛇胆川贝液),首儿药厂小青龙颗粒(小青龙颗粒),石药欧意枸橼酸喷托维林片(枸橼酸喷托维林片),纽兰药业小青龙颗粒(小青龙颗粒),纽兰药业小青龙合剂(小青龙合剂),济安堂蛇胆川贝液(蛇胆川贝液),迪龙制药胸腺肽肠溶片(胸腺肽肠溶片),天津力生制药硫酸沙丁胺醇片(硫酸沙丁胺醇片),仁和堂硫酸沙丁胺醇片(硫酸沙丁胺醇片)","鸡蛋,海蚌,赤贝,圆白菜","海蟹,海虾,海螺,猪肉(肥瘦)","紫苏粥,菊花芦根茶,生芦根粥,鲜芦根粥,薏仁党参粥,党参粥,黄芪粥,鸡蛋木耳粥",否 +成人呼吸窘迫综合征,成人呼吸窘迫综合征简称ARDS,是一种继发的,以急性呼吸窘迫和低氧血症为特征的综合征。又称休克肺、创伤肺等。为成人急性呼吸衰竭的一种类型。病因包括:休克、严重感染、颅脑损伤、严重创伤、骨折时脂肪栓塞、输血输液过量、DIC、吸入刺激性气体、氧中毒、长期使用呼吸器、体外循环、昏迷或全身麻醉后误吸、烧伤等。尽管原发损害不同,但在肺脏所引起的病理生理改变却相似,其主要特点为:①肺微血管壁通透性增加,间质水肿;②肺表面活性物质缺失,肺泡群萎陷。,"疾病百科,内科,呼吸内科","内科,呼吸内科","化脓性感染可使细菌毒素或细胞破溃产物进入肺循环。在内毒素作用下,体内释放出血管活性物质,能使毛细血管通透性增加。感染还可以转移至肺部,从而并发肺功能衰竭。 +休克、创伤者由于大量失血造成的低血容量,可致心输出量降低,同时也造成肺血流量减少。由于肺血容量的减少和源源不断地接受体循环而来的微型栓子,可堵塞肺血管床,致阻碍气体交换的进行。 +这是因为脑创伤可以激发强烈的交感神经冲动,导致显著的末梢血管收缩,随即迅速发生急性心力衰竭和肺水肿。 +ARDS是由许多原因引起的急性肺泡-毛细血管膜损伤,有些原因可直接损伤肺:如①吸入烟雾,毒气,胃内容物及溺水;②服用过量海洛因或水杨酸盐;③细菌,病毒及真菌等所致肺部感染;④脂肪,羊水及血栓等引起肺栓塞;以及⑤肺挫伤,放射线损伤与氧中毒等。有些全身性病理过程可引起肺损伤,如败血症、休克、弥散性血管内凝血、过敏反应、创伤及烧伤等,烧伤面积超过40%就可能导致Pao2明显降低,有些治疗措施也可能引起ARDS,如血液透析,体外循环,用尼龙丝去除白细胞等。 +根据病因的不同及病变特点,ARDS曾有20多个名称,如创伤后湿肺,败血症肺,休克肺,输血后肺,微血管漏出综合征,充血性肺不张,透明膜病,出现性肺综合征,僵肺综合症,进行性肺实变等。 +成人呼吸窘迫综合征的病理变化 +各种原因所致急性肺泡-毛细血管膜损害的病理变化均类似,可分为急性阶段与慢性阶段病变: +(一)急性阶段病变 +主要为广泛肺泡血管内皮和肺泡上皮损伤所致肺水肿,首先是肺间质水肿,后出现肺泡水肿,肺重可达正常值之三倍,肺泡腔内液体蛋白质含量高,甚而是血性液体,并有血细胞,巨噬细胞,细胞碎片,无定形物质,纤维蛋白条和表面活性物质的残存物,偶而可见细胞碎片和蛋白等物质在纤维蛋白网眼中形成透明膜。 +(二)慢性阶段病变 +发病数天后进入慢性阶段,病变以细胞增生为主,两周后即可出现纤维化,Ⅱ型上皮细胞增生取代了变性坏死的Ⅰ型肺泡上皮细胞,加上各种细胞的浸润使肺泡间隔增厚,肺泡腔与肺泡管内富含蛋白质的液体机化而形成纤维化。 +成人呼吸窘迫综合征的发病机制 +ARDS的病变主要是肺泡-毛细血管膜损伤引起肺水肿和继后的细胞增生和纤维化,细胞增生反应和纤维化的机制和炎症修复过程相同,故此处着重讨论急性肺损伤的机制。 +ARDS病人均有肺动脉高压,故有人强调肺微血管内高压为肺水肿的原因,但病人肺动脉楔压往往并不高,说明毛细血管压并不一定高,水肿液蛋白质含量丰富,动物实验也证明,类似ARDS的动物模型肺淋巴液流量增大,肺淋巴液中蛋白质浓度与血浆蛋白质浓度之比值大于0.7;此时,静脉注入的高分子右旋糖酐(分子量500,000)可透入肺泡液,均说明ARDS时的肺水肿主要是渗透性肺水肿,由于肺泡-毛细血管膜损伤使其通透性增高所致。 +ARDS中肺泡毛细血管膜通透性增高的机制并未完全阐明,有些原始病因能直接损伤肺泡毛细血管膜使其通透性增高,如吸入胃酸,毒气,烟熏,放射性损伤及细胞毒素作用等。大量实验表明,更主要的是继发性损伤,即通过白细胞和血小板在肺内聚集引起肺泡-血管膜损伤使其通透性增高。 +(一)中性粒细胞在ARDS发病中的作用 +ARDS病人外周血液中中性粒细胞数减少,肺活检可见肺内有中性粒细胞聚集和浸润,支气管肺泡洗出液中中性粒细胞可增加20~100倍,现在一般认为中性粒细胞在肺中聚集,激活,释放氧自由基,蛋白酶和脂质代谢产物,从而导致肺微血管膜及肺泡上皮的损伤,是ARDS肺水肿的主要发病机制。 +1、中性粒细胞在肺血管中聚集:正常人在直立体位时约有10~20%的中性粒细胞聚集在肺毛细血管床中,这是一种物理性扣留,由于一个肺泡有近千节(segment)毛细血管,每节毛细血管长1~30μm(平均8μm),直径1~15μm(平均5μm),一个血细胞从肺动脉流入肺静脉要经过100个以上的毛细血管节,中性粒细胞直径大于毛细血管口径,其形状与红细胞相比更接近球形,故变形能力较差,变形速度较慢,所以中性粒细胞易被扣留在肺毛细血管床中。由于肺毛细血管床容量较大,白细胞的扣留对肺血管的阻力和肺动脉压的影响不大,物理性扣留的中性粒细胞一般不进入肺泡腔,故正常人支气管肺泡洗出液中的细胞90~95%是巨噬细胞。 +ARDS时中性粒细胞在肺血管中的聚集是化学性粘附(adhesion),是由于趋化因子作用的结果,实验证明,中性粒细胞经趋化因子激活后与血管内皮细胞之间的亲和力显著增强,肺泡毛细血管总面积达60m2,可粘附大量中性粒细胞,以至使外周血液中白细胞数减少。 +趋化因子种类很多,主要有补体激活产物C5a,纤维蛋白降解产物(FDP),花生四烯酸代谢产物如白三烯B4(LTB4),羟花生四烯酸(HETE)和血栓素A2(AXA2),血小板活化因子(PAF),以及其他具趋化作用的蛋白质,多肽和脂质,其中研究较多的是补体的作用,在临床确诊ARDS前8小时血浆C5a往往已升高,激活的补体本身并不直接损伤肺血管内皮细胞,它是通过激活中性粒细胞起损伤作用,给出羊灌注激活的补体可导致肺水肿。如先用氮芥使粒细胞减少后再灌注激活之补体,则肺水肿的发生明显较经,激活的中性粒细胞可浸润入肺间质和进入肺泡腔,ARDS病人支气管肺泡洗出液中存在补体碎片及大量中性粒细胞,近年来发现中性粒细胞表面有一组糖蛋白,后者与粒细胞的粘附和吞噬功能有关,它们是巨噬细胞分子-1(macrophage-1,Mac-1)淋巴细胞功能相关抗原-1(lymphocyte function associated antegen-1,LFA-1),其中Mac-1与粘附功能关系最密切,正常中性粒细胞表面仅有少量Mac-1表达,在病理情况下,趋化因子的作用使中性粒细胞表面Mac-1表达量增加,促进中性粒细胞与血管内皮细胞间的粘附。 +2、中性粒细胞对肺泡-毛细血管膜的损伤:动物实验中静脉注入内毒素,空气等可复制急性肺微血管损伤的模型,用佛波豆蔻醚乙酸盐(phorbol myristate acetate,PMA)激活的中性粒细胞灌注离体肺也可使肺毛细血管通透性增高,如先用羟基脲,氮芥等使动物中性粒细胞数减少,则内毒素,空气栓子等对肺微血管的损伤明显减轻,细胞培养中发现,中性粒细胞秘须紧密粘附于内皮细胞才能使单层肺动脉内皮的通透性增高,以上说明减轻,细胞培养中发现,中性粒细胞必须紧密粘附于内皮细胞才能使单层肺动脉内皮的通透性增高,以上说明,中性粒细胞的粘附与激活在ARDS发病中具有重要作用,很可能是中性粒细胞激活时释放的氧自由基,蛋白酶,脂质代谢产物和肽类物质等造成肺泡-毛细血管膜的损伤。 +(1)氧自由基的作用:中性粒细胞被激活时,耗氧量急剧上升,比静息时增加数倍至数十倍,此时细胞膜上的NADPH氧化酶(NADPh oxidase)被激活,将还原型辅酶Ⅱ(NADPH)转变为氧化型(NADP),氧分子则获得电子形成超氧阴离子O2-,由O2-又可生成H2O2和OH,将正常中性粒细胞和其激活剂PMA一起灌注离体肺可引起肺水肿,水肿液蛋白质含量高;如将遗传性慢性肉芽肿病患者的中性粒细胞与PMA灌注则不引起肺水肿,因为慢性肉芽肿病患者的中性粒细胞缺乏NADPH氧化酶,氧自由基的生成少,另外,静脉内注射氧自由基清除剂,如超氧化物歧化酶(SOD),过氧化氢酶,过氧化物酶,二甲本硫脲等,可减轻实验动物的急性肺损伤,可见,中性粒细胞激活时通过释放氧自由基引起肺损伤。 +氧自由基损伤肺微血管内皮及肺泡上皮细胞的作用可能有以下几个方面:①作用于细胞膜和细胞器膜,使其脂质过氧化,从而损害细胞膜和细胞膜的结构和功能;②作用于酶,使之失活;③作用于α1—蛋白酶抑制物,使之失活,从而增强溶酶体释放的蛋白酶对组织的破坏作用;④作用于血浆成份,可形成一种很强的趋化物,引起更多的中性粒细胞在肺内聚集与激活,产生更多的氧自由基,由此形成阳性反馈,加重肺的损伤。 +(2)蛋白酶的作用:中性粒细胞中溶酶体含有多种中性蛋白酶和酸性蛋白酶,当中性粒细胞被激活或破坏时,释出的这些酶可引起周围蛋白质的分解和组织结构的破坏,使肺泡-毛细血管膜的通透性增高,其中研究较多的是中性粒细胞弹性蛋白酶,例如实验中发现,ARDS病人支气管肺泡洗出液中弹性蛋白酶活性很高,给动物注射内毒素或油酸复制ARDS模型时,其血浆及肺泡洗出液中弹性蛋白酶含量也增多;给动物注射中性粒细胞弹性蛋白酶可引起肺血管内皮及肺泡上皮的通透性增高;组织培养中加入弹性蛋白酶导致内皮细胞分散等,说明中性粒细胞弹性蛋白酶与ARDS中的肺损伤有关,弹性蛋白酶可降解弹性蛋白,胶原蛋白,纤维连接蛋白(fibronectin,FN)等,纤维连接蛋白在内皮细胞之间和内皮细胞与基底膜之间起“锚连”作用,纤维连接蛋白受损,则血管通透性增高。 +肝脏和肺泡巨噬细胞能合成α1-蛋白酶抑制物(α1-protease inhibitor,α1-PI),后者能抑制弹性蛋白酶,虽然ARDS病人血浆α1-PI可正常,支气管肺泡洗出液中α1-PI活性却降低,可能由于中性粒细胞产生的自由基使其氧化灭活所致,蛋白酶与蛋白酶抑制物间的失衡更加重了蛋白酶对组织的损伤,使肺泡-毛细血管膜通透性增高。 +3、脂类代谢产物的作用:内毒素等许多致病因素激活中性粒细胞,巨噬细胞,肥大细胞,内皮细胞等细胞膜上的磷脂酶A2,使膜磷脂裂解为花生四烯酸,后者通过环加氧酶途生成前列腺素,通过脂加氧酶途径生成白三烯,一般认为白三烯,TXA2,和PGF2α既可收缩肺小动脉引起肺动脉高压,也能增加肺微血管的通透性;而PGI2和PGE1则有扩张血管,降低血压,和使血管通透性降低的作用,急性肺损伤的动物及病人肺泡洗出液及血液中TXA2,PGF2α和LTs均增多,有实验证明PGI2和PGE1对急性肺损伤有一定的治疗作用,白细胞,巨噬细胞,肥大细胞和内皮细胞等激活后还可释放血小板活化因子(PAF),PAF可促使血小板聚集和TXA2合成,从而导致微血管通透性增高。 +4、蛋白类物质的作用巨噬细胞等激活后尚可释放蛋白类物质,其中较重要的有肿瘤坏死因子(TNF)及白细胞介素ⅠIL-1),人及动物在内毒素血症时血浆中TNF和IL-1增多,TNF能使肺血管通透性增高,并促使中性粒细胞在肺中聚集;IL-1剌激T淋巴细胞产生白细胞介素2(IL-2),后者也可使肺血管通透性增高。 +总之,现在一般认为,中性粒细胞巨噬细胞在肺内聚集,激活释出大量氧自由基和蛋白酶及脂类代谢产物和蛋白类,引起肺泡-毛细血管膜的损伤和通透性增高,导致肺水肿,这是ARDS的主要发病机制,虽然有报导白细胞减少的病人患败血症时也可发生急性肺损伤,用药物使动物中性粒细胞减少对注油酸引起肺损伤并无明显影响,但这些事实并不足以否定中性粒细胞的致病作用,因为外周血液中的中性粒细胞数不一定能反映肺循环中的粒细胞数,而且究竟需要多少中性粒细胞激活就足以引起急性肺损伤尚不了解,也可能正常聚集在肺血管中的中性粒细胞只有一部分被激活就足以损伤肺而导致ARDS。 +(二)凝血系统在ARDS发病中的作用 +ARDS病人肺活检及死后尸解发现,肺小动脉血栓可发生于肺充血,水肿,出血及透明膜的形成之前,ARDS病人合并有弥散性血管内凝血者,其低氧血症和肺顺应性降工远较未合并DIC者为重,中性粒细胞激活和肺组织损伤所释放的促凝物质,肺血管内皮损伤和血液停滞,可导致血小板聚集和血管内凝血形成微血栓,肺内广泛微血栓形成可能引起:①肺循环阻力增加使肺动脉压升高,未堵塞的肺血管则血液量增大和毛细血管压升高,导致压力性肺水肿;②血栓损伤血管壁和血小板释放的血管活性物质以纤维蛋白降解产物,可使血管通透性增高致渗透性肺水肿;③血小板的消耗,纤维蛋白降解产物的抗凝作用,和血管壁的损伤可引起肺内出血;④血小板释放的5-HT等介质使支气管收缩,影响肺通气,近年特别引人注目的是纤维蛋白降解产物(FDP)的作用,发现严重创伤烧伤或感染病人中,已合并ARDS者血中FDP水平比未发生ARDS者高得多,而且ARDS病情与FDP浓度有一定平行关系,将纤维蛋白碎片D(FD)注入家兔血管,可引起进行性外周血液血小板减少,肺间质内白细胞浸润,肺血管通透性增高和肺功能不全;如注入血浆白蛋白,纤维蛋白及纤维蛋白碎片E,则不出现以上病变,很可能小板上有FD特异的膜受体,后者与FD结合可激活血小板,引起血小板聚集和释放反应,另外,FD也是趋化物,能促使中性粒细胞在肺内聚集,粘附和激活,由此加重肺的损害。 +正常肺毛细血管内皮的通透性比肺泡上皮高10倍,ARDS中肺毛细血管通透性的变化早于肺泡上皮,故先发生肺间质水肿,后出现肺泡水肿,肺泡上皮的损伤使Ⅱ型上皮细胞生成的表面活性物质减少,可导致肺不张,形成功能性分流。 +在全身性病理过程如败血症,休克等,中性粒细胞粘附于血管内皮以及血管内凝血引起的组织损伤,不仅发生于肺内,也可发生于肝,肾,肠,心,内分泌器官等处。故不能把ARDS看成仅仅是肺的损伤,但肺的血流量最大,毛细血管床面积也最大,故肺受累最重,使病人主要表现为急性呼吸衰竭。 +成人呼吸窘迫综合征时肺呼吸功能变化 +ARDS所致外呼吸功能障碍以肺泡通气-血流比例失调为主,加上弥散功能障碍,表现为低氧血症性呼吸衰竭,极严重病例有总的肺泡通气量减少时可出现高碳酸血症性呼吸衰竭。 +(一)肺泡通气-血流比例失调 +由于Ⅱ型肺泡上皮细胞受损致表面活性物质的生成减少,肺泡水肿使表面活性物质被稀释和破坏,和肺泡过度通气引起的表面活性物质消耗,以致肺泡表面张力升高,肺顺应性降低,导致肺不张,由此形成功能性分流和真性分流,中性粒细胞等释出的白三烯等介质使支气管收缩,和水肿液堵塞小气道,气可造成肺通气障碍而形成功能性分流,ARDS病人分流量可达肺血流量的30%,肺血管内微血栓形成,血管活性物质引起不均匀的肺血管收缩,以及肺间质水肿对血管的压迫,不仅可增加肺血管阻力使肺动脉压升高,尚可增加死腔样通气,因此,肺泡通气-血流比例失调是病人发生呼吸衰竭最主要的原因。 +(二)弥散功能障碍 +肺间质和肺泡水肿,透明膜的形成和慢性阶段细胞的增生及肺纤维化,均可增加弥散膜的厚度,导致弥散功能障碍。 +(三)肺泡通气量减少 +ARDS时肺部病变的分布是不均的,肺顺应性降低引起的限制性通气障碍和小气道阻塞引起的阻塞性通气障碍,造成部分肺泡通气量减少,未受累或病变较轻的肺泡反而代偿性通气增强,排出过多的二氧化碳,故病人Paco2反而降低,当肺泡-毛细血管膜损伤更广泛更严重时,全肺总的肺泡通气量将减少,CO2将潴留而发生高碳酸血症,此时Pao2将进一步下降。 +肺通气障碍,Pao2降低对血管化学感受器的剌激,肺充血和肺水肿对J感觉器的剌激,导致病人呼吸窘迫,感受器(juxtapulmonary capillary receptor)位于肺泡毛细血管旁,能感受毛细血管压力剌激,肺充血,肺水肿受剌激反射性地引起呼吸加快。","呼吸困难,紫绀,心源性呼吸窘迫","胸部CT检查,呼吸肌功能测定,血浆蛋白C抗原,肺泡气-动脉血氧分压差,肺毛细血管楔压",细菌性肺炎,根据不同医院,收费标准不一致,市三甲医院约(5000——20000元),2-4月,"药物治疗,支持性治疗",85%,无特定人群,3%,无传染性,对高危的患者应严密观察,加强监护,当发现呼吸频速,PaO2降低等肺损伤表现,应早期给予呼吸支持和其它有效的预防及干预措施,防止ARDS进一步发展和重要脏器损伤。,"注射用还原型谷胱甘肽钠,注射用盐酸氨溴索,人血白蛋白,盐酸氨溴索葡萄糖注射液","人血白蛋白,注射用还原型谷胱甘肽钠","莱士人血白蛋白(人血白蛋白),卫光生物人血白蛋白(人血白蛋白),泰邦生物人血白蛋白(人血白蛋白),绿十字(中国)生物制品人血(人血白蛋白),人血白蛋白(人血白蛋白),松泰斯(注射用还原型谷胱甘肽钠),欣得生(盐酸氨溴索葡萄糖注射液),武汉生物人血白蛋白(人血白蛋白),诺健(注射用盐酸氨溴索),广春药业盐酸氨溴索葡萄糖注(盐酸氨溴索葡萄糖注射液),罗欣药业注射用盐酸氨溴索(注射用盐酸氨溴索),润阳药业盐酸氨溴索葡萄糖注(盐酸氨溴索葡萄糖注射液),博康健制药盐酸氨溴索葡萄糖(盐酸氨溴索葡萄糖注射液),德源生物人血白蛋白(人血白蛋白),六安华源制药盐酸氨溴索葡萄(盐酸氨溴索葡萄糖注射液),艾富西药业盐酸氨溴索葡萄糖(盐酸氨溴索葡萄糖注射液),山西康宝人血白蛋白(人血白蛋白),莎普爱思盐酸氨溴索葡萄糖注(盐酸氨溴索葡萄糖注射液),蜀阳药业人血白蛋白(人血白蛋白),双林生物人血白蛋白(人血白蛋白),蓉生药业人血白蛋白(人血白蛋白),金峰制药盐酸氨溴索葡萄糖注(盐酸氨溴索葡萄糖注射液),广东卫伦人血白蛋白(人血白蛋白)","莲子,生菜,山药,空心菜","啤酒,白酒,洋葱,辣椒(红、尖、干)","百合糖粥,百合粥,百合花生汤,首乌百合粥,薏米莲子粥,牛奶玉米汤,萝卜豆腐汤,瓜粒杂锦汤",否 +大量羊水吸入,胎儿在宫内或分娩过程中吸入较大量羊水称大量羊水吸入(massiveaminoticfluidaspiration),又称羊水吸入综合征(aminoticfluidaspirationsydrom)。一般指羊水未被污染,常有一过性的呼吸困难或青紫,症状轻,预后好。如肺部发生炎性反应,称为羊水吸入性肺炎。,"疾病百科,儿科,小儿内科","儿科,小儿内科","任何因素导致胎儿宫内或产时缺氧。由于低氧血症刺激胎儿呼吸中枢,出现喘息样呼吸,致羊水被吸入呼吸道,羊水吸入后很快被肺泡毛细血管吸收,羊水中的皮脂和脱落的角化上皮细胞在肺泡内可引起化学性和机械性的刺激而发生弥漫性肺炎,使气体弥散功能下降。 +异常分娩(abnormal labor)又称难产(dystocia)。其主要特征为产程进展缓慢而延长。引起异常分娩的因素包括产力、产道、胎儿及产妇精神心理因素。产程延长会增加分娩期母儿并发症,严重者可直接危及母儿生命。 +胎儿宫内窘迫是由于胎儿缺氧所引起,多数发生在临产后,但也可发生在妊娠期。胎儿宫内窘迫是胎儿围产期死亡及新生儿神经系统后遗症的常见原因,占围产儿死亡原因的首位。可分为急性胎儿窘迫和慢性胎儿窘迫。 +胎儿体重≥4000g称为巨大胎儿。通过正常产道常发生困难,发生肩性难产机会多,需手术助产,处理不当可发生软产道损伤或子宫破裂。","面色青紫,呼吸困难,口唇青紫,肺纹理增粗,出生后即有持续青紫,口唇和甲床略带青紫,气急","肺部检查,胸部透视,胸部平片,胸部CT检查",呼吸衰竭,根据不同医院,收费标准不一致,市三甲医院约(1000——5000元),1-3周,"对症治疗,药物治疗,支持性治疗",85%,好发于新生儿,0.001%,无传染性,预防的关键是预防胎儿宫内或产时缺氧,母亲定期做产前检查是非常必要的,发现胎儿有宫内窒息的征象时,应尽快结束分娩,缺氧时间越长,吸入羊水的可能和吸入羊水的量将越大,并且长时间宫内缺氧还可造成胎儿脑损伤,在孩子娩出时的瞬间应尽快插管吸出孩子口鼻,咽腔和大气管内的羊水,避免在孩子产生啼哭时将这些部位的羊水吸入更深的肺部,使病情进一步加重。产前产时妥善处理胎儿窘迫 尽量避免和减少发生吸入,胎头娩出在未出现第一次呼吸前即于挤除或用一次性吸管清除口咽,鼻粘液极为重要也是降低发病的关键,围生医,护人员通过窒息复苏处理训练合格再上岗是必要的羊水吸入性肺炎经过治疗,预后较好,绝大多数孩子都能痊愈,并且不留任何后遗症。,,,,,,,否 +单纯性肺嗜酸粒细胞浸润症,单纯性肺嗜酸粒细胞浸润症,又名吕弗琉综合征,是吕弗琉于1932年首先描述本病。单纯性肺嗜酸粒细胞浸润症特点为游走性肺部浸润伴外周血嗜酸粒细胞计数增高,肺部症状轻微,多数仅有轻咳,病程呈自限性,常于3~4周内自行痊愈。,"疾病百科,内科,呼吸内科","内科,呼吸内科","实验证明,进食蛔虫卵后,幼虫移行至肺可发生本症典型的肺部表现和嗜酸性粒细胞升高。引起本病的其他寄生虫还有钩虫、丝虫、绦虫、姜片虫、旋毛虫和阿米巴原虫等。 +药物有对氨水杨酸、阿司匹林、青霉素、硝基呋喃妥因、保泰松、氯磺丙脲、肼苯达嗪、美卡拉明(美加明)、磺胺药和甲氨蝶呤等,引起的肺泡一过性变态反应。 +本病在某些地区呈季节性流行,故推测环境抗原因素在某些地区亦为可能的病因。有时吸入花粉也可发生本病。 +病理变化主要位于肺间质,肺泡壁及终末细支气管壁,有不规则的嗜酸粒细胞浸润灶,有时肺泡内可见成堆的嗜酸粒细胞,极少累及血管。","嗜酸性粒细胞增多,咽部异物感,胸闷憋气,咯血伴发热,胸闷,乏力","痰液中细胞分类,胸部平片,痰液中寄生虫和虫卵",胆道蛔虫病,根据不同医院,收费标准不一致,市三甲医院约(3000 —— 8000元),3-6周,药物治疗,100%,无特定的人群,0.005%-0.008%,无传染性,注意饮食卫生,防止感染蛔虫、钩虫、丝虫、绦虫、姜片虫、旋毛虫和阿米巴原虫等。,"注射用盐酸头孢替安,注射用磺苄西林钠,托西酸舒他西林胶囊,头孢泊肟酯胶囊,头孢氨苄甲氧苄啶片","头孢泊肟酯胶囊,头孢氨苄甲氧苄啶片","亮博(头孢泊肟酯胶囊),白云山光华头孢氨苄甲氧苄啶(头孢氨苄甲氧苄啶片),头孢氨苄甲氧苄啶片(头孢氨苄甲氧苄啶片),锋替新(注射用盐酸头孢替安),西岳制药托西酸舒他西林胶囊(托西酸舒他西林胶囊),华瑞联合制药头孢氨苄甲氧苄(头孢氨苄甲氧苄啶片),明水药业头孢氨苄甲氧苄啶片(头孢氨苄甲氧苄啶片),注射用磺苄西林钠(注射用磺苄西林钠),圣大(张家口)头孢氨苄甲氧(头孢氨苄甲氧苄啶片),大连药业托西酸舒他西林胶囊(托西酸舒他西林胶囊),瑞阳制药注射用磺苄西林钠(注射用磺苄西林钠),注射用盐酸头孢替安(注射用盐酸头孢替安),赤峰维康托西酸舒他西林胶囊(托西酸舒他西林胶囊),彼迪药业托西酸舒他西林胶囊(托西酸舒他西林胶囊),复仙安(注射用盐酸头孢替安),哈药总厂头孢氨苄甲氧苄啶片(头孢氨苄甲氧苄啶片),云门药业头孢氨苄甲氧苄啶片(头孢氨苄甲氧苄啶片),哈药总厂注射用磺苄西林钠(注射用磺苄西林钠),萨兰欣(注射用盐酸头孢替安),搏沃欣(头孢泊肟酯胶囊),哈药总厂托西酸舒他西林胶囊(托西酸舒他西林胶囊),全星制药注射用盐酸头孢替安(注射用盐酸头孢替安),罗欣药业注射用盐酸头孢替安(注射用盐酸头孢替安)",,,,否 +大叶性肺炎,大叶性肺炎(lobarpneumonia),又名肺炎球菌肺炎,是由肺炎双球菌等细菌感染引起的呈大叶性分布的急性肺实质炎症。好发于青壮年男性和冬春季节,常见诱因有受凉、淋雨、醉酒或全身麻醉手术后、镇静剂过量等,当这些诱因使呼吸道防御功能被削弱时,细菌侵入肺泡通过变态反应使肺泡壁毛细血管通透性增强,浆液及纤维素渗出,富含蛋白的渗出物中细菌迅速繁殖,并向邻近肺组织蔓延,波及一个肺段或整个肺叶。近年来由于大量强有力抗生素的使用,典型的大叶性肺炎已较少见到。临床症状有突然寒战、高热、胸痛、咳嗽、咳铁锈色痰,部分患者有恶心、呕吐及烦躁不安、谵妄等消化系统和神经系统症状。体征有急性病容,呼吸急促,鼻翼扇动,早期肺部体征不明显或仅有呼吸音减低和胸膜摩擦音;实变期可有典型体征,如患侧呼吸运动减弱,语颤增强,叩诊浊音,听诊呼吸音减低,有湿罗音或病理性支气管呼吸音。血白细胞计数及中性粒细胞增高;典型的X线表现为肺段、叶实变。该病病程短,及时应用青霉素等抗生素治疗可痊愈。,"疾病百科,内科,呼吸内科","内科,呼吸内科","多种细菌均可引起大叶性肺炎,但绝大多数为肺炎链球菌。肺炎链球菌为革兰阳性球菌,有荚膜,其致病力是由于高分子多糖体的荚膜对组织的侵袭作用。少数为肺炎杆菌、金黄色葡萄球菌、溶血性链球菌、流感嗜血杆菌等。 +当机体受寒、过度疲劳、醉酒、感冒、糖尿病、免疫功能低下等使呼吸道防御功能被削弱,细菌侵入肺泡通过变态反应使肺泡壁毛细血管通透性增强,浆液及纤维素渗出,富含蛋白的渗出物中细菌迅速繁殖,并通过肺泡间孔或呼吸细支气管向邻近肺组织蔓延,波及一个肺段或整个肺叶。大叶间的蔓延系带菌的渗出液经叶支气管播散所致。 +大叶肺炎病变起始于局部肺泡,并迅速蔓延至一个肺段或整个大叶。临床上起病急骤,病程大约一周。常以高热、恶寒开始,继而出现胸痛、咳嗽、咳铁锈色痰、呼吸困难、并有肺实变体征及外周血白细胞计数增高等。","湿啰音,胸痛,发烧,咳铁锈色痰,急性面容,呼吸音减弱","Optochin敏感试验,小白鼠毒力试验,痰培养,肺活量体重指数,胸部平片,免疫电泳,血常规,痰液细菌涂片检查",脓胸,根据不同医院,收费标准不一致,省市三甲医院约(3000-8000元),7--10天,"青霉素等抗生素药物治疗,对症支持性治疗,并发症治疗",90%以上,多发生于青壮年男性,0.4%,无传染性,"1、注意预防上呼吸道感染,加强耐寒锻炼。 +2、避免淋雨受寒,醉酒,过劳等诱因。 +3、积极治疗原发病,如慢性心肺疾病,慢性肝炎,糖尿病和口腔疾病等,可以预防大叶性肺炎。","阿奇霉素胶囊,阿奇霉素分散片,诺氟沙星胶囊,阿奇霉素片,乳酸左氧氟沙星片","乳酸左氧氟沙星片,阿奇霉素片","宜昌长江乳酸左氧氟沙星片(乳酸左氧氟沙星片),希舒美(阿奇霉素片),维宏(阿奇霉素片),宜昌长江阿奇霉素分散片(阿奇霉素分散片),大连天宇制药阿奇霉素胶囊(阿奇霉素胶囊),兰花药业诺氟沙星胶囊(诺氟沙星胶囊),福邦药业阿奇霉素胶囊(阿奇霉素胶囊),葵花药业得菲尔公司阿奇霉素(阿奇霉素胶囊),利民制药阿奇霉素胶囊(阿奇霉素胶囊),东药阿奇霉素胶囊(阿奇霉素胶囊),浙江南洋药业阿奇霉素胶囊(阿奇霉素胶囊),江苏长江阿奇霉素胶囊(阿奇霉素胶囊),辅仁药业阿奇霉素片(阿奇霉素片),汇仁药业阿奇霉素片(阿奇霉素片),爱普森药业阿奇霉素片(阿奇霉素片),石药欧意诺氟沙星胶囊(诺氟沙星胶囊),白云山医药诺氟沙星胶囊(诺氟沙星胶囊),康美药业诺氟沙星胶囊(诺氟沙星胶囊),锦华药业诺氟沙星胶囊(诺氟沙星胶囊),北京京丰制药集团诺氟沙星胶(诺氟沙星胶囊),欣匹特(阿奇霉素分散片),海王阿奇霉素片(阿奇霉素片),安诺药业阿奇霉素分散片(阿奇霉素分散片)","栗子(熟),鲫鱼,猪肉(瘦),油菜","洋葱,辣椒(青、尖),辣椒(红、尖、干),韭菜","奶汤锅子鱼,酱豆腐汁烧猪肉,百合汤,山楂百合汤,番茄鸡蛋煎饼,凉拌番茄,番茄猪肝瘦肉汤,番茄牛肉",否 +大楼病综合征,大楼病综合征有多种表现,均因接触各种有害物质所致。好发于办公室内工作的人群,或人员密集的大楼内工作的人群。最常发生于新的密闭大楼内,这种大楼为了减少散热而不开窗,大楼内安装有加热及降温管道,这些管道由同一处发出。CO2升高是这些大楼最常见现象,是大楼病综合征的一个常见原因。患者变得焦虑,过度通气,进而发展成手足抽搐和严重的呼吸困难。,"疾病百科,其他科室,其他综合","其他科室,其他综合","高层建筑的大楼里,空气中含有危险的尘埃。这是因为吸烟或使用天然气、煤气、清洁剂、油漆、粘合剂等,不断地释放出许多种有机化学物。由于高楼人们在室内逗留时间较长,加上通风不好,就会使空气“稠化”。 +它们都在向空间发射不同能量、不同频率的电磁波,由于大楼混凝土板块的作用,电磁波便像幽灵一样,在大楼里荡来荡去,这些电磁波会影响人体固有的电流和磁波,导致心律不齐和神经衰弱。 +各种新型材料及室内塑料地板、壁纸、家具、涂料等装饰用品,常含有不同程度的有毒成分。这些物质可以通过人体呼吸道和皮肤的吸收,进入血液循环系统,影响机体的免疫力,从而导致病症发生。","紧张性头晕,紧张性头痛,间歇性头晕,鼻塞,头晕,恶心,眼睛痒,目赤,间歇性头痛","钼靶X线检查,CT检查,血常规",抑郁症,根据不同医院,收费标准不一致,市三甲医院约(1000——5000元),10天,"支持性治疗,康复治疗",90%,无特定人群,0.001%,无传染性,"大楼病综合征日常预防 +新楼建成后不宜立即搬入办公或居住,平时应注意利用自然通风,排出楼内污浊有毒气体,保持室内空气清新干净。建议长期在室内工作的人员每两小时起身活动一次,既能活动身体,又能清脑提神,增强心肺功能,同时要多喝水,还可在室内放一些绿色植物,既美化环境,调节空气湿度,还能避免干燥刺激皮肤和呼吸系统。 +大楼病综合征健康教育 +健康的室内空气质量必须由建筑师,室内设计师,大楼经营者和使用者共同来创造。大楼拥有者和公司经营者的态度尤其重要,因为员工很难从个人层面做出具体改善,所以当老板发现员工接二连三出现身体不适的情形,可别以为他们夸张了感冒病情,当有一天他们不再抱怨时,可能都已经生病在家无法继续工作了。欧洲目前的建筑概念是让摩天大楼的每个窗子都能打开,每个房间都有独立空调,每个员工都能接近一个窗子,得到充分的阳光和空气。","注射用盐酸溴己新,云南花粉片","云南花粉片,注射用盐酸溴己新","云南白药云南花粉片(云南花粉片),丰原制药注射用盐酸溴己新(注射用盐酸溴己新),普德药业注射用盐酸溴己新(注射用盐酸溴己新),海斯制药注射用盐酸溴己新(注射用盐酸溴己新),国药国瑞注射用盐酸溴己新(注射用盐酸溴己新),云南白药云南花粉片(云南花粉片),傲群(注射用盐酸溴己新),智同生物注射用盐酸溴己新(注射用盐酸溴己新),澳利达奈德注射用盐酸溴己新(注射用盐酸溴己新),一品红注射用盐酸溴己新(注射用盐酸溴己新),海鲸药业注射用盐酸溴己新(注射用盐酸溴己新),益佳清(注射用盐酸溴己新),伏枝(注射用盐酸溴己新),云南白药云南花粉片(云南花粉片),云南白药云南花粉片(云南花粉片)","圆白菜,小白菜,生菜,空心菜","洋葱,辣椒(青、尖),辣椒(红、尖、干),韭菜","生姜乌梅饮,乌梅粥,山楂乌梅饮,山楂红糖粥,山楂桑椹粥",否 +二硫化碳中毒,二硫化碳(carbondisulfide,CS2)是工业上应用广泛的化学溶剂,也用于粘胶纤维、四氯化碳,农药生产等。为无色易挥发的液体,带有芳香味,工业品有烂萝卜气味。二硫化碳中毒是指因生产中发生事故而吸入二硫化碳高浓度蒸气所致中枢神经系统损害,急性中毒时轻者酒醉状态,步态不稳,感觉异常,重者可出现兴奋,谵妄,严重时发生昏迷、抽搐,甚至呼吸中枢麻痹导致死亡。,"疾病百科,急诊科",急诊科,"发病原因: +二硫化碳的工业生产:常见用二硫化碳制粘胶纤维的化纤厂拉丝车间,以及制造玻璃纸、硫氰酸盐等化工生产中。由于二硫化碳对金属、木质及橡胶等都有较强的腐蚀作用,故生产设备、管道极易受腐蚀而发生跑、冒滴、漏或突然破裂等意外事故,导致急性中毒发生。 +无防护地使用二硫化碳:在用二硫化碳为羊毛去脂的羊毛加工业,用作衣服去渍剂的干洗业,以及用作熏蒸剂为粮食消毒、灭虫的种库、粮仓,也可因疏于防护,在通风不良环境中作业过久而吸入大量高浓度二硫化碳气体,引起急性中毒。 +制造二硫化碳的生产过程:在用硫蒸气通入燃烧的炭火以制造二硫化碳的生产过程中,如设备简陋或防护措施不周,可因吸入大量溢出的二硫化碳浓蒸气而发生急性中毒。 +二硫化碳经呼吸道进入人体,也可经皮肤和胃肠道吸收,进入体内后,10~30%仍经肺排出,70%~90%经代谢从尿排出,CS2中毒机理尚未阐明,主要有以下几种可能: +1、CS2代谢物二硫代氨基甲酸酯与维生素B6结合,致使以吡哆醛为辅酶的一些酶,如转氨酶等受抑制。 +2、二硫代氨基甲酸酯与微量元素结合,如与一些脱氢酶中锌和细胞色素氧化酶,多巴胺β-羟化酶中铜结合,使酶失去活性,干扰能量及儿茶酚胺代谢,损害神经系统,特别是锥体外系。 +3、CS2抑制单胺氧化酶活性,使脑中5-羟色胺积蓄,与中毒性精神病可能有关。 +4、CS2抑制血浆中脂蛋白酶和脂质清除因子活性,致脂蛋白和脂类代谢紊乱,β-脂蛋白可渗入动脉壁内,导致玻璃样变,动脉硬化。","昏迷,腱反射消失,呕吐,谵妄,多发性神经炎,浅感觉减退或缺失,恶心,感觉障碍","血常规,尿常规,肾功能检查,神经系统检查,眼底荧光血管造影,肌电图,脑电图检查,心肺功能运动试验(CPET)",昏迷,根据不同病情,不同医院,收费标准不一致,市三甲医院约(1000——5000元),1-2个月,"药物治疗,支持性治疗",80-85%,接触化学染料及粘胶纤维的工人,发病率约为0.0001%--0.0005%,无传染性,我国现用的车间空气中CS2最高容许浓度为10mg/m3,已有一些研究结果提示,这一卫生标准需要修订,以确保作业者的健康。对CS2作业者应给予就业体检和上岗后的定期查体,包括内科,神经科和眼科检查,必要时进行神经肌电图,血脂,心电图等检查。具有器质性神经系统疾病,各种精神病,视网膜病变,冠心病或糖尿病者,不宜从事CS2作业。,"布美他尼片,十一味金色丸,注射用布美他尼,注射用呋塞米,盐酸利多卡因注射液,注射用硫代硫酸钠,大月晶丸,仁青芒觉,注射用鼠神经生长因子,地塞米松磷酸钠注射液","布美他尼片,十一味金色丸","桂林南药布美他尼片(布美他尼片),雄巴拉曲神水十一味金色丸(十一味金色丸),西藏甘露仁青芒觉(仁青芒觉),金诃藏药大月晶丸(大月晶丸),金诃藏药仁青芒觉(仁青芒觉),苏肽生(注射用鼠神经生长因子),新峰药业盐酸利多卡因注射液(盐酸利多卡因注射液),海斯制药盐酸利多卡因注射液(盐酸利多卡因注射液),西藏甘露十一味金色丸(十一味金色丸),卓峰地塞米松磷酸钠注射液(地塞米松磷酸钠注射液),白云山天心地塞米松磷酸钠注(地塞米松磷酸钠注射液),涟水制药地塞米松磷酸钠注射(地塞米松磷酸钠注射液),金耀药业地塞米松磷酸钠注射(地塞米松磷酸钠注射液),遂成药业地塞米松磷酸钠注射(地塞米松磷酸钠注射液),恩经复(注射用鼠神经生长因子),金路捷(注射用鼠神经生长因子),新亚注射用硫代硫酸钠(注射用硫代硫酸钠),北京永康药业盐酸利多卡因注(盐酸利多卡因注射液),北京益民药业盐酸利多卡因注(盐酸利多卡因注射液),中国大冢盐酸利多卡因注射液(盐酸利多卡因注射液),盐酸利多卡因注射液(盐酸利多卡因注射液),全星制药注射用布美他尼(注射用布美他尼),皇隆制药注射用呋塞米(注射用呋塞米)","生菜,南瓜,苦瓜,空心菜","啤酒,白酒,洋葱,辣椒(红、尖、干)","小麦粥,荞麦粥,杂粮粥,蔬菜杂烩粥,花生杏仁粥,豆薯小米粥,羊腩萝卜丝粥,绿豆南瓜汤",否 +肺-胸膜阿米巴病,肺-胸膜阿米巴病是溶组织阿米巴原虫感染所致的肺及胸膜化脓性炎症,肝原性病变多发生在右下肺,血源性则多为两肺多发病变。肠外阿米巴病中,肺和胸膜阿米巴病发生率仅次于肝脏,胸部阿米巴病右侧多发且大多继发于靠近膈肌的肝阿米巴脓肿,而肝阿米巴脓肿是肠阿米巴病的晚期并发症。,"疾病百科,内科,呼吸内科","内科,呼吸内科","发病原因: +寄生于人体的阿米巴原虫有10余种,仅溶组织阿米巴原虫对人体有致病力,滋养体是原虫的寄生形式,体内以大小滋养体和包囊形式存在,大滋养体是致病型,小滋养体是滋养体与包囊的中间过渡类型,成熟包囊具有感染性,有较强的抵抗外界能力,在粪便中存活2周以上,在水中存活5周以上,是传播疾病的惟一形态,致病性阿米巴特有的编码蛋白水解酶基因,对侵犯组织能力有重要影响。 +发病机制: +阿米巴原虫感染中,90%为隐性感染,10%发生侵袭性阿米巴病。这主要取决于感染虫株的特性,也与宿主机体免疫状态,营养状况和抵抗力有关,当人吞入被包囊污染的食物或水后,因包囊有抗胃酸作用,故顺利到达小肠下段,借助于胰蛋白酶的催化作用,囊内虫体脱囊而出,分裂成小滋养体,在肠腔内定居,在结肠功能正常情况下,小滋养体停止活动,分泌囊壁形成包囊,随粪便排出,当宿主机体抵抗力下降或肠功能紊乱时,小滋养体侵入肠壁,大量增殖,转变为大滋养体,病原虫直接接触并黏附到靶细胞,吞噬,溶解组织细胞,滋养体释放水解蛋白酶引起组织溶解坏死,同时对补体有抵抗作用,黏附参与机体应答的中性粒细胞,释放更多的酶,加重组织炎症和破坏,形成脓肿。 +肺,胸腹阿米巴病90%为肝源性,可由肝脓肿穿破到胸膜和肺;经肝,膈,肺粘连处组织间隙,血管侵入肺;经肝静脉入下腔静脉至肺和胸膜,肠源性则滋养体从肠壁病灶经肠道淋巴管,胸导管入上腔静脉或直肠下静脉入下腔静脉侵入肺。","盗汗,腹泻,乏力,发热伴咳嗽、咯...","胸部平片,痰液病原体检查",阿米巴肝脓肿,根据不同医院,收费标准不一致,市三甲医院约(3000——8000元),2周--2月,"药物治疗,支持性治疗,手术治疗",80%,无特殊人群,0.01%--0.03%,无传染性,"肺-胸膜阿米巴病日常预防 +本病流行于全世界,多流行于热带和亚热带地区,但较寒冷的地区,甚至北极圈内也有阿米巴感染和流行,其感染率高低与各地环境卫生,经济状况和饮食习惯等密切相关,据估计全世界约有10%的人受染,有的地方感染率可高达50%,在我国的分布一般农村高于城市,近年来由于我国卫生状况和生活水平的提高,急性阿米巴痢疾和脓肿病例,除个别地区外,已较为少见,大多为散在分布的慢性迁延型或典型病例及带虫者。 +㈠传染源: +慢性病人,恢复期病人及健康的带虫者为本病的传染源,包囊抵抗力很强,在潮湿低温的环境中,可存活12天以上,在水内可活9~30天,但包囊对干燥,高温和化学药物的抵抗力较弱,如50℃时,短时即死亡,干燥环境中的生存时间仅数分钟,在0.2%盐酸,10%~20%食盐水以及酱油,醋等调味品中均不能长时间存活,50%酒精能迅速杀死之。 +㈡传播途径: +溶组织内阿米巴的传播方式有以下几种: +①包囊污染水源可造成该地区的暴发流行。 +②在以粪便作肥料,未洗净和未煮熟的蔬莱也是重要的传播因素。 +③包囊污染手指,食物或用具而传播。 +④蝇类及蟑螂都可接触粪便,体表携带和呕吐粪便,将包囊污染食物而成为重要传播媒介。 +㈢流行特点: +溶组织内阿米巴病发布广泛,在温带地区,该病可时有流行,而在热带及亚热带地区,其流行情况则尤为严重,在我国解放以来,各地阿米巴的感染率明显降低,如北京首都医院1973~1978年共检查了38 075例,阳性率为0.52%;福建医大1976年惠安检查216例儿童,阳性率4.63%;东北佳木期医学院报告(1980),检查市郊中学生487例,阳性率仅为0.4%;1979年在浙江乐清普查一个大除农民557例,阳性率为3.2%,其发病情况因时而异,以秋季为多,夏季次之,发病率男多于女,成年多于儿童,这可能与吞食含包囊的食物或年龄免疫有关。","甲硝唑片,甲硝唑维B6片,替硝唑片,奥硝唑片","甲硝唑片,替硝唑片","飞云岭药业甲硝唑片(甲硝唑片),丽珠制药替硝唑片(替硝唑片),亨瑞达制药甲硝唑片(甲硝唑片),环科药业甲硝唑片(甲硝唑片),鲁抗赛特替硝唑片(替硝唑片),皇象铁力蓝天甲硝唑维B6片(甲硝唑维B6片),迪沙药业甲硝唑维B6片(甲硝唑维B6片),彼迪药业替硝唑片(替硝唑片),潇然(奥硝唑片),傲宁(奥硝唑片),衡博来(奥硝唑片),太原药业甲硝唑片(甲硝唑片),汉森制药甲硝唑片(甲硝唑片),海力制药替硝唑片(替硝唑片),津华晖星替硝唑片(替硝唑片),东药替硝唑片(替硝唑片),迪诺制药替硝唑片(替硝唑片),沈阳一药替硝唑片(替硝唑片),甲硝唑片(甲硝唑片),亚宝药业甲硝唑片(甲硝唑片),津华晖星甲硝唑片(甲硝唑片),华中药业甲硝唑片(甲硝唑片),康美药业甲硝唑片(甲硝唑片)",,,,否 +肺出血-肾炎综合征,肺出血-肾炎综合征,又称抗基膜性肾小球肾炎,Goodpasture综合征或Goodpasture病,可能系病毒感染和/或吸入某些化学性物质引起。它是由抗基膜抗体导致的肾小球和肺泡壁基膜的严重损伤,临床表现为肺出血,急进性肾小球肾炎和血清抗肾小球基膜(GBM)抗体阳性三联征。多数患者病情进展迅速,预后凶险。,"疾病百科,内科,呼吸内科","内科,呼吸内科","呼吸道感染特别与流感病毒感染是本病最常见的诱因,最近研究发现获得性免疫缺陷病患者感染卡氏肺囊虫肺炎(Pneumocystis Carinii Pneumonia)后,机体易产生抗GBM抗体,Calderon等报道4例HIV感染者中3例抗Ⅳ型胶原α3链抗体(抗GBM抗体)阳性,提示卡氏肺囊虫肺炎时肺泡损害可以诱发肺出血-肾炎综合征。 +硬皮病是以局限性或弥漫性皮肤及内脏器官结缔组织纤维化、硬化及萎缩为特点的结缔组织病,其主要特点为皮肤、滑膜、骨骼肌、血管和食道出现纤维化或硬化硬皮病(scleroderma),是以局限性或弥漫性皮肤及内脏器官结缔组织纤维化、硬化及萎缩为特点的结缔组织病,其主要特点为皮肤、滑膜、骨骼肌、血管和食道出现纤维化或硬化。 +吸入可卡因 Perez等报道1例长期吸烟的患者在吸用可卡因3周以后发生了肺出血-肾炎综合征。接触汽油蒸汽羟化物,松节油及吸入各种碳氢化合物。 +发病机制 +由于某些病因使机体同时产生了抗肺泡,肾小球基底膜抗体,并由此攻击了肾小球与肺,发生Ⅱ型变态反应,至于同时向肺泡和肾小球发生免疫复合物沉积并激活补体(Ⅲ型变态反应)的发病机理,尚无确切的解释。 +1962年Steblay等人证实,肺出血-肾炎综合征的肾小球基底膜(GBM)损害是由抗GBM抗体介导,遂后大量的研究工作集中于分离和研究GBM组分,寻找抗体针对的相应抗原及表明抗原的分子结构与特征,近年来随着分子生物学及生物化学的飞速发展,人们在新发现的胶原Ⅳ的α3(Ⅳ)链中,证实α3(Ⅳ)链的NC1结构域是Goodpasture自身抗原,又称Goodpasture抗原,继而克隆了该抗原基因Co14A3,定位于第二条染色体q35~37区域。 +应用间接免疫荧光和免疫电镜技术证实,Goodpasture抗原不仅见于GBM,也分布于肾小管基膜(TBM),肺泡毛细血管基膜(ABM)及其他组织基膜(如脉络膜,角膜,晶体,视网膜血管基底膜等处),但具有致病作用的Goodpasture抗原主要分布于GBM,TBM和ABM,抗原的隐匿性造成其暴露过程的可逆性,体外可通过6mol盐酸胍或pH 3的强酸条件暴露α3NC1结构域,但体内抗原是如何暴露并产生免疫应答损伤GBM尚未完全明了,目前推测,在生理条件下Goodpasture抗原隐匿在胶原Ⅳα3NC1结构域中,各种诱发因素(毒素,病毒感染,细菌感染,肿瘤,免疫遗传因素)及内毒素等均可激活上皮,内皮及系膜细胞增殖,并释放炎性介质(IL-1,RDS,前列腺素,中性蛋白酶等),GBM等在细胞酶作用下,胶原Ⅳ高级结构解离,暴露Goodpasture抗原决定簇,刺激机体产生抗体,导致免疫损伤,由于在全身毛细血管内皮层中唯有肾小球毛细血管的内皮层有窗孔,使得抗体可以与GBM抗原直接接触而致病,而ABM只有当受到某些外界因素(如感染,吸烟,吸入汽油或有机溶剂)影响后,破坏其完整性使基底膜抗原暴露后肺部方出现病症,此即为何肾脏最易受累且受累程度与抗体滴度相一致,而肺部受累程度与抗体滴度不一致的缘故。 +本病患者HLA-DR2等抗原频率明显增高(达89%,正常对照仅32%),应用基因DNA限制性片段长度多态性分析还显示本病与HLA-DR4,HLA-DQβ链基因DQWLb和DQW3相关,表明HLA二类抗原相关的淋巴细胞在本病起一定作用,有实验发现,如果仅给受试动物抗GBM抗体虽可产生GBM线条状沉着,但不发病,只有同时输入患病动物T细胞后受试动物才发病,如此证实T细胞在本病发病机制中起重要作用,近年的研究也发现,某些细胞因子如肿瘤坏死因子,IL-1可以加重本病的发展。 +肺部病变表现为 肺丰满胀大,表面有较多出血斑,光镜下可见肺泡腔内有大量红细胞及很多含有含铁血黄素的巨噬细胞,肺泡壁呈局灶性增厚,纤维化,肺泡细胞肥大,电镜下可见肺泡基底膜增厚及断裂,内皮下有电子致密物呈斑点样沉积,而内皮细胞正常,免疫荧光检查可见毛细血管壁有IgG,C3呈连续或不连续线样沉积。 +肾脏病变可见到双肾柔软呈灰白色,表面有多数小出血斑点,光镜下多数呈新月体性肾炎的病变特征,但内皮及系膜细胞增生一般不重,可见毛细血管纤维素样坏死,晚期肾小球纤维化,肾间质可见炎症细胞浸润及间质小动脉炎,肾小管变性,萎缩和坏死,电镜下可见球囊下皮细胞增生,形成新月体,系膜基质增生,基底膜断裂,肾小球毛细血管壁一般无致密物沉积,偶见内皮下有电子致密物呈斑点样沉积,免疫荧光检查可见IgG(100%),C3(60%~70%)沿肾小球毛细血管壁呈线状沉积,部分患者远曲小管基底膜上抗体IgG阳性。 +既往认为本病征主要是由基底膜(GBM)抗体解导引起,免疫荧光检查示IgG沿肾小球基底膜呈线条状沉积,此症仅一部分可确诊为肺出血-肾炎综合征,另一部分患者临床酷似肺出血-肾炎综合征,但其免疫荧光则示IgG沿GMB呈颗粒状沉积,血中抗GBM抗体阴性,实际此部分病例系免疫复合物性肾炎(ICGN),自身免疫机理在本病起重要作用,表现为ICGN者,是由于免疫复合物沉积于肾小球及肺泡的相应部位而引起,临床上肺部病变出现于肾病变之前,肾功能多急速恶化,可于数周至数月内死亡。","肺部出血,呼吸困难,咯血,气短,发热伴咳嗽、咯...,蛋白尿","痰液常规检查,尿液镜检法,胸部平片,肾功能检查,抗肾小球基底膜抗体测定(AGBM),隐血试验与含铁血黄素检查",便血,根据不同医院,收费标准不一致,市三甲医院约(3000 —— 8000元),10-30天,"药物治疗,康复治疗,支持治疗",70%,无特殊人群,0.0001%,无传染性,肺出血-肾炎综合征可迅速致死。死亡原因常为肺出血和呼吸衰竭,在急性期常需气管插管,辅助通气和血透。随后的处理依赖于大剂量皮质类固醇的使用(甲基强的松龙每日7~15mg/kg,分次静脉注射),免疫抑制剂环磷酰胺及反复血透排除循环中抗肾小球基膜抗体。免疫抑制治疗的疗程变动较大。,"雷公藤多苷片,注射用甲泼尼龙琥珀酸钠,蒺藜药酒,甲泼尼龙片","雷公藤多苷片,甲泼尼龙片","得恩德制药雷公藤多苷片(雷公藤多苷片),复旦复华雷公藤多苷片(雷公藤多苷片),远大医药黄石飞云制药雷公藤(雷公藤多苷片),美通制药雷公藤多苷片(雷公藤多苷片),普洛康裕天然药物雷公藤多苷(雷公藤多苷片),新陇海药业雷公藤多苷片(雷公藤多苷片),贵州汉方药业雷公藤多苷片(雷公藤多苷片),尤金(甲泼尼龙片),美卓乐(甲泼尼龙片),米乐松(注射用甲泼尼龙琥珀酸钠),甲强龙(注射用甲泼尼龙琥珀酸钠),金耀药业注射用甲泼尼龙琥珀(注射用甲泼尼龙琥珀酸钠),央宗药业蒺藜药酒(蒺藜药酒),德远药业雷公藤多苷片(雷公藤多苷片),比利时辉瑞注射用甲泼尼龙琥(注射用甲泼尼龙琥珀酸钠),米乐松(注射用甲泼尼龙琥珀酸钠),重庆华邦制药注射用甲泼尼龙(注射用甲泼尼龙琥珀酸钠),金耀药业注射用甲泼尼龙琥珀(注射用甲泼尼龙琥珀酸钠),辽宁海思科注射用甲泼尼龙琥(注射用甲泼尼龙琥珀酸钠),辽宁海思科注射用甲泼尼龙琥(注射用甲泼尼龙琥珀酸钠),甲强龙(注射用甲泼尼龙琥珀酸钠),甲强龙(注射用甲泼尼龙琥珀酸钠),南光注射用甲泼尼龙琥珀酸钠(注射用甲泼尼龙琥珀酸钠)","茄子,空心菜,茭白,番茄","竹笋,辣椒(青、尖),辣椒(红、尖、干),韭菜","肉末冬瓜,肉松,五丝白菜卷,拌肚丝白菜,冬菇烧白菜,水萝卜丝拌白菜,珊瑚白菜墩,素炒小白菜",否 +肺放线菌病,"肺放线菌病(pulmonaryactinomycosis)是由厌氧的以色列放线菌感染肺部引起的慢性化脓性肉芽肿性疾病,病变以多发性脓肿和窦道形成,分泌物含有硫黄色颗粒脓液为特征,易形成纤维化。本菌为正常人口腔、龋齿,扁桃体隐窝中的常存菌,多数由于口腔卫生不良,吸入含有放线菌颗粒的分泌物而发病,也可来自血行播散或腹部病灶的直接蔓延,颈面部和胸腹部病变约占1/3。肺脏罹患放线菌感染,称为肺放线菌病。","疾病百科,内科,呼吸内科","内科,呼吸内科","放线菌常寄生于人体口腔黏膜,牙龈,扁桃体,结肠等处,当机体抵抗力下降,可因口腔分泌物吸入而侵入呼吸道,首先在支气管内引起病变,再侵入肺实质,亦可由于食管病变向纵隔蔓延,或腹部感染穿过膈肌波及胸膜和肺,在肺部引起化脓性肺炎,并经叶间隙,胸膜侵犯胸壁,肋骨,形成窦道,也可侵入血循环,引起全身播散。 +发病原因 +放线菌属原核生物,具有细菌的特征,其增殖不是孢子形成或丝状芽生,而是通过细菌分裂复制,绝大多数为厌氧菌或兼性厌氧菌,因此在无氧环境中生长最好,在组织内生长则紧密聚集在一起,肉眼可见,称为颗粒,以色列放线菌是最常见病原菌,其他如赖氏放线菌,粘放线菌等也可致病。 +发病机制 +本病的病理特征是多发性脓肿,瘘管,肉芽增生和纤维性变,病原菌入侵后,在组织内最先引起白细胞浸润,形成多发性小脓肿,脓肿穿破形成多个窦道,在脓液和窦道分泌物中可以见到硫黄颗粒,病变晚期,慢性肉芽组织增生,病变邻近组织纤维性变,病变累及胸膜,引起胸膜炎或脓胸,并可穿破胸壁形成瘘管,本病特点为破坏和增生同时进行,在病变结疤痊愈的同时,仍可向周围组织扩展。","骨膜炎,体重减轻,咯血,盗汗,乏力,低热","痰液病原体检查,胸部平片",膈下脓肿,根据不同医院,收费标准不一致,省市三甲医院约(5000——10000元),2-12月,大剂量青霉素治疗、手术治疗,96%,无特殊人群,0.002%--0.004%,无传染性,"1、注意饮食卫生,不吃变质食品。 +2、注意口腔卫生,防止感染,如拔牙后应及时用抗生素等。 +3、对病牙及扁桃体等病灶应早期治疗,以清除放线菌的发源地。","盐酸克林霉素棕榈酸酯分散片,注射用美洛西林钠舒巴坦钠,盐酸克林霉素棕榈酸酯颗粒,盐酸克林霉素胶囊","盐酸克林霉素棕榈酸酯分散片,盐酸克林霉素胶囊","一品红盐酸克林霉素棕榈酸酯(盐酸克林霉素棕榈酸酯分散片),杭州民生药业盐酸克林霉素胶(盐酸克林霉素胶囊),盐酸克林霉素胶囊(盐酸克林霉素胶囊),宜昌人福盐酸克林霉素胶囊(盐酸克林霉素胶囊),东药盐酸克林霉素胶囊(盐酸克林霉素胶囊),康普药业盐酸克林霉素胶囊(盐酸克林霉素胶囊),锦华药业盐酸克林霉素胶囊(盐酸克林霉素胶囊),仁和药业盐酸克林霉素胶囊(盐酸克林霉素胶囊),安诺药业盐酸克林霉素胶囊(盐酸克林霉素胶囊),天方药业盐酸克林霉素胶囊(盐酸克林霉素胶囊),科伦药业盐酸克林霉素胶囊(盐酸克林霉素胶囊),星斗药业盐酸克林霉素胶囊(盐酸克林霉素胶囊),苏州三药盐酸克林霉素胶囊(盐酸克林霉素胶囊),河南羚锐制药盐酸克林霉素胶(盐酸克林霉素胶囊),可尔生(盐酸克林霉素棕榈酸酯颗粒),亚太药业盐酸克林霉素胶囊(盐酸克林霉素胶囊),白云山光华盐酸克林霉素胶囊(盐酸克林霉素胶囊),台城制药盐酸克林霉素胶囊(盐酸克林霉素胶囊),新亚闵行盐酸克林霉素胶囊(盐酸克林霉素胶囊),黄河药业盐酸克林霉素胶囊(盐酸克林霉素胶囊),同济堂制药盐酸克林霉素胶囊(盐酸克林霉素胶囊),一品红盐酸克林霉素棕榈酸酯(盐酸克林霉素棕榈酸酯颗粒),开林(注射用美洛西林钠舒巴坦钠)","油菜,生菜,南瓜,空心菜","啤酒,白酒,狗肉,洋葱","番茄西米粥,番茄牛肉片,番茄羊肉汤,番茄羊肉蛋花汤,番茄皮蛋汤,百合炒芦笋,百合炖猪蹄,鲜百合烧肉",否 +肺泡蛋白沉着症,肺泡蛋白沉着症(Pulmonaryalveolarproteinosis,PAP)是一种原因未明的少见疾病。其特点是肺泡内或细支气管腔内有不可溶性富磷脂蛋白沉积。好发于青中年,男性发病约为女性的3倍。病因未明,推测与几方面因素有关:如大量粉尘吸入(铝,二氧化硅等),机体免疫功能下降(尤其婴幼儿),遗传因素,酗酒,微生物感染等。虽然启动因素尚不明确,但基本上同意发病过程为脂质代谢障碍所致。即由于机体内、外因素作用引起肺泡表面活性物质的代谢异常。病理学检查以肺泡内充满有过碘酸雪夫(PAS)染色阳性的蛋白样物质为特征,该病由Rosen于1958年首次报道。肺泡蛋白沉着症根据病因可有原发性、继发性和先天性之分。临床症状主要表现为气短、咳嗽和咳痰,典型的症状为活动后气急,以后进展为休息时也感到气急。胸部X线呈双肺弥漫性肺部浸润阴影。诊断主要根据支气管肺泡灌洗物检查或经纤支镜或剖胸活检作出病理诊断。咳出的痰经80%乙醇固定,PAS染色有15%阳性的脂质。试用蛋白溶解酶雾化吸入或间歇正压呼吸器吸入。行支气管肺灌洗术是迄今惟一被证明有效的治疗方法。支气管肺泡灌洗通过BAIL,将沉积在肺泡的表面活性物质排出,从而改善肺通气和换气功能,很多情况下仅能暂时缓解症状,需定期反复进行。,"疾病百科,内科,呼吸内科","内科,呼吸内科","所谓免疫功能低下是一种病理特征,通俗一点讲,人体免疫力就是我们的身体在面对外来的侵害时所能抵御侵害的能力。比如无处不在的细菌、顽固不化的病毒向你进攻时,你身体抵抗能力的好与坏直接决定了你是否会染病。 +饮酒超出适量饮酒或一般社交性饮酒的标准。重度饮酒往往根据超出一定的日饮酒量(如每天3标准杯)或每次饮酒量(如一次5标准杯,每周至少一次)加以确定。 +遗传一般是指亲代的性状又在下代表现的现象,但在遗传学上指遗传物质从上代传给后代的现象。 +微生物感染是指,感染了细菌、霉菌、滴虫、支原体等。 +大量粉尘吸入是指吸入铝,二氧化硅等尘埃。 +(一)发病原因 +虽然启动因素尚不明确,但基本上同意发病过程为脂质代谢障碍所致,即由于机体内,外因素作用引起肺泡表面活性物质的代谢异常,到目前为止,研究较多的有肺泡巨噬细胞活力,动物实验证明巨噬细胞吞噬粉尘后其活力明显下降,而病员灌洗液中的巨噬细胞内颗粒可使正常细胞活力下降,经支气管肺泡灌洗治疗后,其肺泡巨噬细胞活力可上升,而研究未发现Ⅱ型细胞生成蛋白增加,全身脂代谢也无异常,因此目前一般认为本病与清除能力下降有关。 +(二)发病机制 +1.肺泡蛋白沉着症的发病机制目前尚不完全清楚,有以下几种假设: +(1)表面活性物质清除障碍:电镜观察发现肺泡蛋白沉积物和全肺灌洗物在结构上与由Ⅱ型肺泡上皮细胞分泌的含有层状体的肺泡表面活性物质非常相似,提示肺泡蛋白沉积物可能与肺泡表面活性物质代谢障碍有关,目前大多数证据表明肺泡蛋白沉积物可能是由于肺泡表面活性物质清除障碍所致,而不是产生过多,正常情况下肺泡表面活性物质(SP)的产生与清除是一个复杂的动态过程,肺泡Ⅱ型上皮细胞不仅合成和分泌肺泡表面活性物质,而且还与肺泡巨噬细胞一道参与肺泡表面活性物质的清除,当某些因素如感染,药物等可使肺泡Ⅱ型细胞的功能发生改变,导致其对肺泡表面活性物质的清除能力降低,从而引发了表面活性物质在肺泡内的沉积,最近的研究还发现表面活性物质蛋白A(SP-A)不仅可调节表面活性物质的分泌而且还可调节肺泡Ⅱ型上皮细胞和肺泡巨噬细胞对肺泡表面活性物质的再摄取,其在PAP发病机制中的作用目前尚不清楚。 +(2)肺泡巨噬细胞功能缺陷:许多学者发现肺泡蛋白沉着症患者的肺泡巨噬细胞存在着化学趋化活性低,吞噬功能和吞噬溶酶体活性下降等情况,Gonzalez等报道正常人的肺泡巨噬细胞与肺泡蛋白沉着症患者的肺泡灌洗液共同培养时,正常人的肺泡巨噬细胞就会丧失吞噬能力,提示肺泡蛋白沉着症患者的肺泡灌洗液中存在着抑制肺泡巨噬细胞的因子,最新研究表明肺泡巨噬细胞功能缺陷可能与粒细胞巨噬细胞集落刺激因子(GM-CSF)不足或与GM-CSF/IL-3/IL-5受体β链缺陷有关。 +(3)继发于其他疾病:临床上有些疾病特别是血液系统恶性肿瘤可发生肺泡蛋白沉着症,如髓白血病,淋巴瘤,Fanconi贫血以及IgG型免疫球蛋白病等,虽然文献报道血液系统恶性肿瘤发生继发性肺泡蛋白沉着症的平均发病率约5.3%,但急性髓白血病患者继发该病的发生率可高达10%,与原发性肺泡蛋白沉着症不同,继发性肺泡蛋白沉着症的病变往往呈局灶型,而且症状轻微,通常不需要行支气管肺泡灌洗治疗。 +(4)吸入物的异常损伤:文献报道肺泡蛋白沉着症可能与某些理化因素和矿物粉尘吸入有关,如白消安,苯丁酸氮芥,矽尘和铝尘等,动物吸入矽尘颗粒也可引起肺泡蛋白沉着症这些都提示肺泡蛋白沉着症可能与某些理化因素和矿物粉尘吸入有关,但在人类,流行病学研究尚无直接证据表明肺泡蛋白沉着症与上述物质有关。 +(5)基因突变:肺泡表面活性物质相关蛋白B(SP-B)基因突变已被证实与先天性肺泡蛋白沉着症(CPAP)有关,目前已经证实SP-B基因至少存在2个突变位点,一个是第121位碱基C被3个碱基GAA所替代,另一个是第122位点上缺失了1个碱基T,两种基因突变均可导致肺泡表面活性物质中SP-B缺失,但先天性肺泡蛋白沉着症的临床表现差异很大,提示可能还有其他位点或新的SP基因突变参与。 +(6)GM-CSF及其受体异常:1994年Dranoff等发现在去除粒细胞巨噬细胞集落刺激因子(GM-CSF)的小鼠肺泡有蛋白样物质沉积,之后有许多学者对此进行了研究,目前已证实肺泡蛋白沉着症患者存在着细胞因子调节平衡的失调,即IL-10表达升高和GM-CSF表达减少以及GM-CSF/IL-3/IL-5受体β链缺失的情况。 +总之,肺泡蛋白沉着症的发病机制目前尚不完全清楚,上述任何一种病因均不能完全解释所有病例,需要今后进一步研究。 +2.病理表现 +(1)肉眼观察:肺大部呈实变,胸膜下可见弥漫性黄色或灰黄色小结节或小斑块,结节直径由数毫米到2cm不等,切面可见黏稠黄色液体流出,如不合并感染,胸膜表面光滑。 +(2)光镜检查:肺泡及细支气管腔内充满无形态的,过碘酸雪夫(PAS)染色阳性的富磷脂物质,肺泡间隔正常或肺泡隔数目增多,但间隔内无明显的纤维化,肺泡腔内除偶尔发现巨噬细胞外无炎症表现。 +(3)电镜检查:肺泡腔内碎片中存在着大量的层状结构,由盘绕的3层磷脂构成,其结构类似肺泡表面活性物质。","胸痛,紫绀,呼吸困难,肺泡炎症,肺泡灌洗液可见...,乏力,发热伴咳嗽、咯...","胸部CT检查,支气管镜检查,肺活检",呼吸衰竭,根据不同医院,收费标准不一致,市三甲医院约(5000——80000元),10-30天或更长,"药物治疗,支持性治疗,对症治疗",1-3%,无特殊人群,0.00001%,无传染性,"1、避免感染分支杆菌病,卡氏肺囊肿肺炎,巨细胞病毒等。 +2、注意锻炼身体,提高免疫力。",,,,,,,否 +肺曲菌病,肺曲菌病(pulmonaryaspergillosis)致病菌主要为烟曲菌,少数为黄曲菌、土曲菌、黑曲菌,棒状曲菌、构巢曲菌及花斑曲菌等。我国从1949年到1988年底陆续报告的呼吸道曲菌感染约300多例,然而近年随着广谱抗生素广泛使用,激素长期使用、肿瘤放化疗等曲霉菌感染发病率明显上升。肺部曲菌病绝大多数为继发感染,原发者较少见,也可见于少数免疫正常者。临床上一般将本病分为曲菌球、变态反应性支气管肺曲菌病(ABPA)和侵入性肺曲菌病(IPA)等三种类型。,"疾病百科,内科,呼吸内科","内科,呼吸内科","肺曲菌病(pulmonary aspergillosis)主要由烟曲菌(aspergillus fumigatus)引起。该菌寄生在上呼吸道,只有在慢性病患者机体免疫力降低时才能致病。 +空气中到处有曲菌孢子,在秋冬和阴雨季节,当储藏的谷草发热霉烂时更多。吸入曲菌孢子不一定致病,大量吸入才能引起急性气管-支气管炎或肺炎。本病常继发于肺部已有疾病,如支气管囊肿、支气管扩张、肺炎、肺脓肿等。曲菌的内毒素使组织坏死,病灶为浸润性、实变、支气管周围炎或粟粒状弥慢性病变。","咳出棕色痰栓,嗜酸性粒细胞增多,胸痛","胸部平片,痰培养,纤维支气管镜检查,胸部CT检查,痰液细菌涂片检查",过敏性鼻炎,依据病情严重程度及是否有并发症收费不同,市三甲医院约(3000——50000元),3-6月,"抗曲霉菌药物治疗,对症支持治疗,部分慢性感染如曲霉球需要手术切除治疗",70-80%,免疫低下或免疫缺陷人群,0.24%,不传染,在疑有曲菌感染的环境工作时,应作好防护工作,如戴防护口罩以免吸入大量病菌,在真菌实验室进行烟曲菌,黄曲菌,黑曲菌等菌的操作时,更要注意防止将这些病菌吸入肺部。,"阿奇霉素胶囊,阿奇霉素分散片,诺氟沙星胶囊,阿奇霉素片,乳酸左氧氟沙星片","乳酸左氧氟沙星片,阿奇霉素片","宜昌长江乳酸左氧氟沙星片(乳酸左氧氟沙星片),希舒美(阿奇霉素片),维宏(阿奇霉素片),宜昌长江阿奇霉素分散片(阿奇霉素分散片),大连天宇制药阿奇霉素胶囊(阿奇霉素胶囊),兰花药业诺氟沙星胶囊(诺氟沙星胶囊),福邦药业阿奇霉素胶囊(阿奇霉素胶囊),葵花药业得菲尔公司阿奇霉素(阿奇霉素胶囊),利民制药阿奇霉素胶囊(阿奇霉素胶囊),东药阿奇霉素胶囊(阿奇霉素胶囊),浙江南洋药业阿奇霉素胶囊(阿奇霉素胶囊),江苏长江阿奇霉素胶囊(阿奇霉素胶囊),辅仁药业阿奇霉素片(阿奇霉素片),汇仁药业阿奇霉素片(阿奇霉素片),爱普森药业阿奇霉素片(阿奇霉素片),石药欧意诺氟沙星胶囊(诺氟沙星胶囊),白云山医药诺氟沙星胶囊(诺氟沙星胶囊),康美药业诺氟沙星胶囊(诺氟沙星胶囊),锦华药业诺氟沙星胶囊(诺氟沙星胶囊),北京京丰制药集团诺氟沙星胶(诺氟沙星胶囊),欣匹特(阿奇霉素分散片),海王阿奇霉素片(阿奇霉素片),安诺药业阿奇霉素分散片(阿奇霉素分散片)","鸡蛋,鲤鱼,鲫鱼,油麦菜","啤酒,白酒,洋葱,韭菜","银耳粥,鸭梨粥,雪梨饮,川贝酿梨,北杏炖雪梨,红枣银耳粥,冰糖银耳羹,椰子银耳煲鸽汤",否 +放射性肺炎,放射性肺炎(radiationpneumonitis)系由于肺癌,乳腺癌,食管癌,恶性淋巴瘤或胸部其他恶性肿瘤经放射治疗后,在放射野内的正常肺组织受到射线损伤而引起的炎症反应。轻者无症状,炎症可自行消散,部分患者留有索条样陈旧病灶;重者肺脏发生广泛纤维化,导致呼吸功能损害,甚致呼吸衰竭。,"疾病百科,内科,呼吸内科","内科,呼吸内科","(一)发病原因 +放射性肺炎的发生,肺部损伤的严重程度与放射面积,放射量,放射速度和放射的方法均有密切关系,一般在5周内放射量阈值在25Gy的常规照射量较为安全,放射剂量在6周内20Gy极少产生放射性肺炎,在相同时间内,剂量超过40Gy,放射性肺炎发生率达100%,放射量超过60Gy,可引起严重肺损伤,放射量越大,发生率越高,肺的损伤越严重,以同样大的剂量作大面积照射治疗引起的肺组织损伤远较肺局部照射为严重,照射速度越快,越易产生肺损伤,其他影响因素如个体对放射线的敏感性,肺部的原有疾病如肺炎,慢性支气管炎,肺气肿,肺间质性疾病等或第2次放射性照射均易促进放射性肺炎的发生,甲状腺癌,咽喉部肿瘤放射性治疗,包括频繁的CT检查也可以引起肺损伤,产生放射性肺炎,老人和小孩对放射性治疗的耐受性差,化学疗法所用药物(如博来霉素)引起的肺毒性可能加重放射性肺的损害。 +(二)发病机制 +放射性肺炎的病理变化可分为急性放射性炎症改变和慢性纤维化病变,急性炎症改变多发生在放射治疗后1~2个月,亦可发生在放射治疗结束后6个月,主要表现为肺毛细血管,小动脉充血,扩张和栓塞,血管通透性增高,肺泡细胞肿胀,Ⅱ型肺泡细胞和肺泡巨噬细胞增加,淋巴管扩张和肺泡内透明膜形成,肺泡壁有淋巴细胞浸润,急性可自行消散,也可有结缔组织增生和纤维化,慢性阶段的肺组织变化为广泛肺泡纤维化,肺泡间隔增厚,肺泡萎缩,血管内壁增厚,玻璃样变和硬化,管腔狭窄或阻塞致使气体交换功能降低和肺动脉压力增高,若继发肺部感染可促进放射性肺纤维化,也是导致死亡的重要诱因。","闫铁,肺纤维化,胸痛,低热","胸部平片,肺功能检查,通气与血流灌注比值(V/Q),每分钟最大通气量(MVV),血常规",肺气肿,根据损伤范围不同治疗费用不同,不同级别医院,收费有所差别,市三甲医院约(10000——50000元),3个月,药物对症治疗为主,早期可能需要激素治疗,70%,射线敏感人群,3%,无传染性,"放射性肺炎的防治关键,在于“防”,“防”的关键在于以下三点: +(1)严格掌握放射剂量:一般在5周内放射量为2500rad的常规剂量较为安全。 +(2)控制放射野,放射野越大,发生率越高。 +(3)选择适当的照射速度,以每周剂量800-1000rad为宜,一旦发现本病,应尽早开始治疗,阻断病程的进展,如已发生广泛肺纤维化,则预后不良。","阿奇霉素胶囊,阿奇霉素分散片,诺氟沙星胶囊,阿奇霉素片,乳酸左氧氟沙星片","乳酸左氧氟沙星片,阿奇霉素片","宜昌长江乳酸左氧氟沙星片(乳酸左氧氟沙星片),希舒美(阿奇霉素片),维宏(阿奇霉素片),宜昌长江阿奇霉素分散片(阿奇霉素分散片),大连天宇制药阿奇霉素胶囊(阿奇霉素胶囊),兰花药业诺氟沙星胶囊(诺氟沙星胶囊),福邦药业阿奇霉素胶囊(阿奇霉素胶囊),葵花药业得菲尔公司阿奇霉素(阿奇霉素胶囊),利民制药阿奇霉素胶囊(阿奇霉素胶囊),东药阿奇霉素胶囊(阿奇霉素胶囊),浙江南洋药业阿奇霉素胶囊(阿奇霉素胶囊),江苏长江阿奇霉素胶囊(阿奇霉素胶囊),辅仁药业阿奇霉素片(阿奇霉素片),汇仁药业阿奇霉素片(阿奇霉素片),爱普森药业阿奇霉素片(阿奇霉素片),石药欧意诺氟沙星胶囊(诺氟沙星胶囊),白云山医药诺氟沙星胶囊(诺氟沙星胶囊),康美药业诺氟沙星胶囊(诺氟沙星胶囊),锦华药业诺氟沙星胶囊(诺氟沙星胶囊),北京京丰制药集团诺氟沙星胶(诺氟沙星胶囊),欣匹特(阿奇霉素分散片),海王阿奇霉素片(阿奇霉素片),安诺药业阿奇霉素分散片(阿奇霉素分散片)","莲子,豆浆,生菜,南瓜","白酒,洋葱,辣椒(红、尖、干),大蒜","杂粮粥,蔬菜杂烩粥,小麦粥,虾皮香芹燕麦粥,荞麦粥,花生杏仁粥,豆薯小米粥,萝卜豆腐汤",否 +肺念珠菌病,肺念珠菌病是一种常见的肺真菌病,由念球菌属(主要是白念珠菌)感染所致。本病多为继发性感染,在人体抵抗力降低的情况下发病。临床上可分为三型:(1)支气管炎型。(2)肺炎型。(3)过敏型。病原主要为白色念珠菌,其次为热带念珠菌、高里氏念珠菌和星状念珠菌。据报道,念珠菌感染占真菌感染的79%,尤其在重症监护室、灼伤和肿瘤科发病率较高。,"疾病百科,内科,呼吸内科","内科,呼吸内科","正常人皮肤,口腔,胃肠道等均有念珠菌寄生,正常情况下不致病,当人体免疫防御功能下降,寄殖于口腔,上呼吸道的念珠菌可侵入呼吸道引起内源性感染。 +院内交叉感染可致外源性感染,留置导管,黏膜溃疡等破坏黏膜完整性,也可使念珠菌侵入体内,肺可为原发性感染,也可为血源播散性念珠菌的一部分。 +饮食不洁肺也是会引发肺念珠菌病的。 +发病机制 +支气管肺念珠菌病的感染途径主要为吸入(原发),即定植于口腔和上呼吸道的念珠菌在机体防御机制削弱时吸至下呼吸道和肺泡所致,念珠菌入侵组织后转为菌丝型,大量繁殖,菌丝念珠菌有抗吞噬能力,引起白细胞浸润为主的急性炎症反应,形成溃疡,多发性微小脓肿和组织坏死,慢性感染则以肉芽肿病变和纤维组织增生为主,血源播散型则是菌丝和酵母向血管内侵入,引起双肺弥漫性损害,典型表现为坏死的肺组织和大量繁殖的念珠菌组成的出血性结节。","痰呈粘液脓性,肺部啰音","肺量计检测,胸部平片,痰液细菌涂片检查",菌血症,根据不同医院,收费标准不一致,市三甲医院约(1000-5000元),2-6周,"抗真菌治疗,对症治疗,,支持性治疗",80%,免疫力低下病人,0.005%,呼吸道传播,"1.勿滥用广谱抗生素。 +2.长期应用抗生素、糖皮质激素及免疫抑制药者,应定期查粪、尿、痰等,并仔细作体格检查,必要时定期作胸部X线检查。 +3.对必须长期应用抗生素及糖皮质激素者,可间歇预防性地给予抗真菌药物,如制霉菌素、酮康唑、氟康唑。 +4.医护人员接触病人前后应洗手,避免交叉感染。","硝酸咪康唑乳膏,盐酸特比萘芬片,酮康唑乳膏,环吡酮胺乳膏,硝酸益康唑溶液,伊曲康唑胶囊,克霉唑阴道片,氟康唑胶囊,硝酸益康唑乳膏,盐酸特比萘芬凝胶,盐酸特比萘芬溶液,联苯苄唑乳膏,转移因子口服溶液,硝酸咪康唑栓","转移因子口服溶液,克霉唑阴道片","圣泰转移因子口服溶液(转移因子口服溶液),仙琚制药克霉唑阴道片(克霉唑阴道片),运佳黄浦硝酸咪康唑乳膏(硝酸咪康唑乳膏),三维康(氟康唑胶囊),赣南海欣转移因子口服溶液(转移因子口服溶液),福建太平洋制药酮康唑乳膏(酮康唑乳膏),二天堂联苯苄唑乳膏(联苯苄唑乳膏),倍佳(盐酸特比萘芬溶液),倍佳(盐酸特比萘芬凝胶),唐山红星硝酸咪康唑乳膏(硝酸咪康唑乳膏),唐山红星硝酸益康唑溶液(硝酸益康唑溶液),衡阳紫光古汉硝酸益康唑乳膏(硝酸益康唑乳膏),纽兰药业硝酸咪康唑栓(硝酸咪康唑栓),黑龙江天龙药业联苯苄唑乳膏(联苯苄唑乳膏),斯皮仁诺(伊曲康唑胶囊),美扶(伊曲康唑胶囊),桂林华信环吡酮胺乳膏(环吡酮胺乳膏),南通中华药业硝酸咪康唑乳膏(硝酸咪康唑乳膏),吉春制药硝酸咪康唑乳膏(硝酸咪康唑乳膏),康正药业硝酸咪康唑乳膏(硝酸咪康唑乳膏),恒安药业盐酸特比萘芬片(盐酸特比萘芬片),迪沙药业克霉唑阴道片(克霉唑阴道片),五洲通药业硝酸咪康唑乳膏(硝酸咪康唑乳膏)","鸡蛋清,鸡,杏仁,核桃","啤酒,白酒,空心菜,奶油","小麦粥,荞麦粥,杂粮粥,蔬菜杂烩粥,豆薯小米粥,花生杏仁粥,冬瓜草鱼汤,三鲜冬瓜汤",否 +肺大疱,肺大疱是指由于各种原因导致肺泡腔内压力升高,肺泡壁破裂,互相融合,在肺组织形成的含气囊腔。直径超过1厘米,常发生在肺气肿基础上,一般继发于细小支气管的炎性病变,如肺炎,肺气肿和肺结核,临床上最常与肺气肿并存。发生机制与肺气肿相似但程度较重。肺大疱有先天性和后天性两种。先天性多见于小儿,因先天性支气管发育异常,黏膜皱襞呈瓣膜状,软骨发育不良,引起活瓣作用所致。后天性多见于成人、老年患者,常伴慢性支气管炎和肺气肿。目前绝大多数的肺大疱手术均可在电视胸腔镜下完成,2/3的患者术后症状明显改善。,"疾病百科,内科,呼吸内科","内科,呼吸内科","(一)发病原因 +肺大疱是由于肺泡高度膨胀,肺泡壁破裂并相互融合而形成,一般是由小支气管的活瓣性阻塞所引起,与肺气肿的形成机制相同,但程度较重,气肿的肺泡直径超过1cm,发生在肺实质内,常伴有不同的肺部疾病,如慢性支气管炎和支气管哮喘,晚期矽肺或结节病,也有些肺大疱见于肺和支气管无疾病的患者,肺大疱继发于肺炎或肺脓肿者多见于婴幼儿,有单发的也有多发的,因有炎性病变,小支气管粘膜有水肿,造成管腔部分阻塞,产生活门作用,空气能进入肺泡而不易排出,肺泡内压力增高,肺泡间隔逐渐因泡内压力增加而破裂,乃形成巨大的含气囊腔,临床上称之为肺大疱。 +继发于肺结核的则多为单发,亦无明显之肺气肿同时存在。 +继发于肺气肿者,常为多发,除大疱之外,常伴有多数小疱。 +(二)发病机制 +肺大疱的壁甚薄,由肺泡的扁平上皮细胞组成或仅为纤维性膜,可与多种肺气肿并存,常见于间隔旁侧或细叶旁肺气肿,可伴或不伴炭末沉着,分别见于煤矿工人尘肺和瘢痕组织肺气肿,肺大疱分为3种病理形态。 +Ⅰ型:多发生于中叶或舌叶,也常见于肺上叶,可能由于该部位胸腔负压大,突出于肺表面,并有一狭带与肺相连又称为狭颈肺大疱,因为支气管瘢痕组织形成的活瓣性阻塞,肺大疱体积增大系由于肺泡侧支通气和气体滞留,Ⅰ型肺大疱壁薄,常由胸膜和结缔组织形成,常规X线胸片即可发现肺大疱的存在。 +Ⅱ型:在脏层胸膜与气肿性肺组织之间,是宽基底部的表浅肺大疱位于肺表层,肺大疱腔内可见结缔组织间隔,但它不构成肺大疱的壁,可见于肺的任何部位。 +Ⅲ型:是宽基底部深位肺大疱,结构与Ⅱ型相似,但部位较深,周围均为气肿性肺组织,肺大疱可伸展至肺门,可见于任何肺叶。 +当肺大疱体积增大时,周围肺组织受压迫并引起肺脏移位,受压肺组织在X线胸片上,表现为肺大疱周围密度增高阴影,以上3型均见于慢性支气管炎,多与慢性弥漫性阻塞性肺部疾病有关,小叶中心型肺气肿不并发肺大疱,下叶肺大疱常见于有并发症的煤矿工人尘肺和融合性矽肺。","胸闷,气短,胸闷憋气,发热伴咳嗽、咯...","胸部CT检查,支气管造影,胸部平片",张力性气胸,根据不同医院,收费标准不一致,市三甲医院约(5000-10000元),2-4周,"康复治疗,手术治疗",85%,多见于吸烟人群,0.003%-0.007%,无传染性,由于肺大疱形成的原因不明确,因此任何可以预防细小支气管炎症活瓣形成的措施均可采取。如戒烟,避免受凉感冒,增强体质,预防支气管肺部感染。,,,,,,,否 +肺炎球菌肺炎,肺炎球菌肺炎是由肺炎链球菌所引起,占社区获得性肺炎中的半数以上。起病急,有寒战、高热、胸痛、咳嗽和血痰等症状。近年来由于抗菌药物的广泛应用,临床上症状轻或不典型病较为多见。肺炎球菌一般通过吸入,经上呼吸道到达肺部。它们停留在细支气管内增殖并引起炎症过程,开始在肺泡腔内产生大量蛋白质的液体,这种液体起着病菌培养介质的作用,并可帮助病菌向邻近肺泡扩散,典型的结果是导致大叶性肺炎。,"疾病百科,内科,呼吸内科","内科,呼吸内科","当呼吸道防御功能削弱,呼吸道受病毒感染,破坏支气管粘膜的完整性,易诱发细菌感染。常见于受寒、疲劳、饥饿、酒醉、麻醉、昏迷、免疫缺陷病、充血性心衰等情况。 +入侵细菌数量多、毒力强。细菌入侵后必然会遭到机体免疫力的抵抗,只有当入侵的细菌数量多、毒力强,超过机体的抵抗能力才致病。 +发病机制 +肺炎球菌一般通过吸入,经上呼吸道到达肺部。它们停留在细支气管内增殖并引起炎症过程,开始在肺泡腔内产生大量蛋白质的液体,这种液体起着病菌培养介质的作用,并可帮助病菌向邻近肺泡扩散,典型的结果是导致大叶性肺炎。 +大叶性肺炎的最初阶段是充血,特点是大量浆液性渗出物,血管扩张及细菌迅速增殖。下一阶段叫做""红色肝样变"",即实变的肺脏呈肝样外观:气腔充满多形核细胞,血管充血及红细胞外渗,因此肉眼检查呈淡红色。接着是""灰色肝样变""期,该期的纤维蛋白集聚与处于不同分解阶段的白细胞和红细胞有关,肺泡腔充满炎症渗出物。最后阶段是以渗出物吸收为特征的消散期。","痰中带血丝,咳嗽伴胸痛,胸痛,发热伴咳嗽、咯...","胸部平片,血常规",败血症,根据不同医院,收费标准不一致,市三甲医院约(2000-5000元),1个月,"药物治疗,支持性治疗",80%,无特殊人群,发病率约3-5%,呼吸道传播,"1、适度锻炼,增强免疫力。避免引起免疫力减退的情况,如:醉酒、过劳、淋雨等。 +2、接种疫苗。","氯霉素片,阿奇霉素片,阿奇霉素分散片,阿奇霉素颗粒","阿奇霉素片,阿奇霉素分散片","希舒美(阿奇霉素片),维宏(阿奇霉素片),宜昌长江阿奇霉素分散片(阿奇霉素分散片),百利药业阿奇霉素颗粒(阿奇霉素颗粒),东信药业阿奇霉素颗粒(阿奇霉素颗粒),俞氏阿奇霉素颗粒(阿奇霉素颗粒),湘江药业阿奇霉素颗粒(阿奇霉素颗粒),潜江制药阿奇霉素颗粒(阿奇霉素颗粒),海力制药阿奇霉素颗粒(阿奇霉素颗粒),北海阳光药业阿奇霉素颗粒(阿奇霉素颗粒),辅仁药业阿奇霉素片(阿奇霉素片),汇仁药业阿奇霉素片(阿奇霉素片),爱普森药业阿奇霉素片(阿奇霉素片),欣匹特(阿奇霉素分散片),海王阿奇霉素片(阿奇霉素片),安诺药业阿奇霉素分散片(阿奇霉素分散片),锦华药业氯霉素片(氯霉素片),赛乐欣(阿奇霉素分散片),齐迈星(阿奇霉素分散片),丽珠奇乐(阿奇霉素分散片),健生制药阿奇霉素分散片(阿奇霉素分散片),彼迪药业阿奇霉素分散片(阿奇霉素分散片),利君制药阿奇霉素分散片(阿奇霉素分散片)","鸡蛋,鲈鱼,鲢鱼,鲤鱼","啤酒,白酒,辣椒(红、尖、干),咖啡","小黄瓜凉拌面,黄瓜三丝汤,水萝卜拌黄瓜,黄瓜拌豆腐丝,黄瓜拌香菜,小黄瓜西瓜汁,五丝白菜卷,玉竹白菜",否 +肺气肿,肺气肿是指终末细支气管远端(呼吸细支气管,肺泡管、肺泡囊和肺泡)的气道弹性减退,过度膨胀,充气和肺容积增大或同时伴有气道壁破坏的病理状态。按其发病原因肺气肿有如下几种类型:老年性肺气肿,代偿性肺气肿,间质性肺气肿,灶性肺气肿,旁间隔性肺气肿,阻塞性肺气肿。,"疾病百科,内科,呼吸内科","内科,呼吸内科","引起慢支的各种因素如感染,吸烟,大气污染,职业性粉尘和有害气体的长期吸入,过敏等,均可引起阻塞性肺气肿。 +弹性蛋白酶及其抑制因子失衡学说。 +α1-抗胰蛋白酶缺乏和肺气肿关系的研究提示,肺气肿是由肺内的蛋白酶和抗蛋白酶含量的不平衡,使肺泡间隔破坏,大量肺气肿的动物模型支持这一假说,人类肺气肿的研究证明,弹性多肽的浓度在肺气肿的病人中增加,吸烟可增加弹性蛋白溶解活性,抑制肺的成纤维细胞的浸润,造成对弹性蛋白酶的组织敏感性增加,抑制了抗弹性蛋白酶的活性,这些发现支持吸烟使弹性蛋白酶和抗弹性蛋白酶的平衡被打破,从而造成肺的微细结构的破坏,引起肺气肿。 +发病机制 +1、肺气肿的病理改变:肺气肿是由各种原因引起的肺泡和肺泡管异常扩大和肺泡壁破坏,使肺内残气量增多,根据其受累肺泡的范围分为小叶中心型肺气肿(常位于肺尖部),全小叶型肺气肿(常在肺基底部)和远端小叶型肺气肿,全小叶型和小叶中心型肺气肿与吸烟有关,这两种类型的肺气肿常合并存在,均匀分布在肺脏的上叶或下叶,当肺气肿严重时,气管梗阻亦有所发展,反复发作的细支气管的炎症造成气管梗阻,肺间质破坏,引起气管的机械支持力丧失,使其塌陷和气管梗阻,从而引起肺内气体增多,形成气腔。 +2、肺气肿病理生理:呼吸肌肉的功能在肺气肿病人有明显的变化,其他呼吸辅助肌肉,肋间肌也不能在正常的长度-张力曲线上工作,膈肌的隆起程度减低,使其在收缩时不能形成足够的胸内负压,在膈肌变平时,收缩时向下牵拉下部胸廓,挤压肺脏,对呼吸的效果产生反向的影响,使膈肌收缩时胸廓变大引起吸气的功能转换为呼气,肺泡壁结构的破坏使肺毛细血管床减少,肺微循环的破坏使肺血管阻力增高,肺气肿病人的肺血流阻力与肺的CO弥散能力呈反向相关,所以,在肺气肿病人出现肺动脉高压之前,一定有气体交换功能的严重损害。","纵隔浊音界扩大,桶状胸,小支气管粘膜水肿,黏稠或脓性痰伴...,横膈低平,胸闷,呼气音延长,肺部啰音,呼吸音减弱","肺量计检测,残气量/肺总量比值(RV/TLC),肺容量测定,肺活量(VC),最大呼气流量-容积曲线(MEFV),深吸气量(IC),一秒用力呼出量/用力肺活量比值,心电图,无效腔气量/潮气量比值,肺泡气-动脉血氧分压差","呼吸衰竭,自发性气胸,慢性肺源性心脏病,胃溃疡",根据不同医院,收费标准不一致,市三甲医院约(10000——30000元),120天,"药物治疗,支持性治疗,手术治疗",0.5%,长期接触有机或无机粉尘,有害气体者,吸烟者,0.001%,无传染性,"1、首先是戒烟。 +2、注意保暖,避免受凉,预防感冒。 +3、改善环境卫生,做好个人劳动保护,消除及避免烟雾,粉尘和刺激性气体对呼吸道的影响。","祛痰止咳胶囊,如意定喘丸,硫酸特布他林雾化液,茶碱缓释片,氨茶碱片,噻托溴铵粉吸入剂,盐酸班布特罗胶囊,白及颗粒,氨溴特罗口服溶液,化痰平喘片,噻托溴铵粉雾剂,盐酸妥洛特罗片,茶碱缓释胶囊,盐酸班布特罗片,喘嗽宁片,硫酸特布他林片,肺气肿片,复方蛤青胶囊","噻托溴铵粉雾剂,氨茶碱片","天丁噻托溴铵粉雾剂(噻托溴铵粉雾剂),振兴氨茶碱片(氨茶碱片),埃斯玛隆(茶碱缓释胶囊),曲靖药业白及颗粒(白及颗粒),思力华(噻托溴铵粉吸入剂),帮备(盐酸班布特罗片),博利康尼(硫酸特布他林片),陕西东泰制药复方蛤青胶囊(复方蛤青胶囊),诚信制药盐酸妥洛特罗片(盐酸妥洛特罗片),吉尔吉药业喘嗽宁片(喘嗽宁片),瑞尔医药盐酸班布特罗片(盐酸班布特罗片),易坦静(氨溴特罗口服溶液),万方制药肺气肿片(肺气肿片),吉春制药祛痰止咳胶囊(祛痰止咳胶囊),龙泰制药化痰平喘片(化痰平喘片),七星山药业化痰平喘片(化痰平喘片),国医堂制药如意定喘丸(如意定喘丸),博利康尼(硫酸特布他林雾化液),石药欧意氨茶碱片(氨茶碱片),山西云鹏制药氨茶碱片(氨茶碱片),广东环球制药茶碱缓释片(茶碱缓释片),白敬宇制药氨茶碱片(氨茶碱片),湖南九典制药盐酸班布特罗胶(盐酸班布特罗胶囊)","鹿肉,鸡肝,杏仁,松子仁","海虾,带鱼,羊肉(瘦),圆白菜","糖醋草鱼,炖白鲢鱼,红烧鲢鱼,泡莲藕,凉拌莲藕,山楂糕,百合汁,百合粥",否 +肺炎杆菌肺炎,肺炎杆菌肺炎(克雷白杆菌肺炎),克雷白杆菌肺炎是由肺炎克雷白杆菌引起的急性肺部炎症,多见于老年、营养不良、慢性酒精中毒,已有慢性支气管-肺疾病和全身衰竭的患者。起病急剧,有高热,咳嗽,痰量多和胸痛。可有紫绀,气急,心悸,约半数患者有畏寒,可早期出现休克。,"疾病百科,内科,呼吸内科","内科,呼吸内科",本病的致病菌为克雷白杆菌。肺炎克雷白杆菌对人致病性较强,是重要的条件致病菌和医源性感染菌之一。,"畏寒,胸痛,气急,发热伴咳嗽、咯...","痰液细菌涂片检查,痰液细菌培养,血常规",脑疝,根据不同医院,收费标准不一致,市三甲医院约(3000 —— 8000元),7-21天,"药物治疗,支持性治疗",68%,多见于老年人,0.0002%,有传染性,"1、严格执行消毒与隔离制度这主要是针对医务人员及院内环境、器械而言,接触病人前后严格洗手、戴手套操作,定期环境及室内消毒通风,按照要求定期清洗、消毒呼吸治疗装置,定期更换机械通气及雾化器管路等,采取一整套严格的院内感染监测和预防计划。据报道,采取这一计划的医院与未采取的医院比较,院内感染率低20%。 +2、胃肠道去污治疗是欧洲常用的一种预防措施,主要是针对院内感染的易感人群,目的是去除胃肠内的菌落寄殖与生长。方法有全胃肠去污和选择性胃肠去污法,常用的为后者,它通过鼻饲或口服胃肠不吸收的多粘菌素B、妥布霉素(庆大霉素或新霉素等)及二性霉素B,连用5天,并每天系统应用头孢菌素,从口咽部及胃肠道中去除需氧菌而不降低厌氧菌的数量,其预防作用在革兰阴性杆菌方面尤为明显,据作者统计有关文献,去污组几乎无继发性肺炎克雷白杆菌的肺炎与呼吸道感染(个别为耐药株感染)。 +3、保护胃部酸性屏障主要是在预防应激性溃疡时,应用硫糖铝(ulcerlmin)类药物,它既可以防止应激性溃疡出血,又因它具有吸附胃黏膜、改变胃黏液、增加胃腔中前列腺素E2(PGE2)含量、吸收胃蛋白酶的作用,并不改变胃内酸性环境,从而有效地起到了防止溃疡及防止感染的作用。而且据文献介绍,硫糖铝尚具有内在的杀菌活性,一系列研究表明应用抗酸剂组的肺炎发生率为23%~35%,而应用硫糖铝组肺炎的发生率为10%~19%。 +4、生物预防肺炎克雷白杆菌肺炎的生物预防方法尚处于实验阶段。Held等利用自肺炎克雷白杆菌荚膜多糖(CPS)诱导产生的IgM单克隆抗体(MAb) 注射给实验动物以预防肺炎克雷白杆菌肺炎,与对照组比较,无论器官受累率、感染组织的细菌数量、肺内组织学改变等诸方面,预防组远优于对照组 (P<0.01),但这种MAb尚无阻止肺炎克雷白杆菌进入肺内的作用,而是加速感染吸收,增强肺的排菌能力。另外尚有一些类似的实验报告,但成熟的疫苗及抗体尚未应用于临床,需进一步研究。肺炎克雷白杆菌肺炎危害人类已一个多世纪,随着科学的发展,检查及治疗手段的不断完善,人类对其了解的逐步深入,相信可以进一步降低它的发病率及病死率,取得更大的进步。","氨苄西林胶囊,头孢拉定胶囊,通宣理肺丸,阿莫西林颗粒,头孢克洛颗粒,盐酸左氧氟沙星胶囊,头孢氨苄胶囊,依托红霉素片,蛤蚧定喘丸,乙酰螺旋霉素片,注射用头孢唑林钠,头孢克肟颗粒,头孢克肟分散片,氟康唑胶囊,麦迪霉素片,司帕沙星分散片,头孢丙烯分散片,蛇胆川贝液,头孢拉定分散片,乳酸左氧氟沙星片","头孢氨苄胶囊,盐酸左氧氟沙星胶囊","康裕头孢氨苄胶囊(头孢氨苄胶囊),联邦左福康盐酸左氧氟沙星胶(盐酸左氧氟沙星胶囊),阿莫仙阿莫西林颗粒(阿莫西林颗粒),联邦安必仙氨苄西林胶囊(氨苄西林胶囊),江西诚志永丰蛇胆川贝液(蛇胆川贝液),鲁抗阿莫西林颗粒(阿莫西林颗粒),广东华南依托红霉素片(依托红霉素片),孩尔欣头孢克洛颗粒(头孢克洛颗粒),银力舒(头孢丙烯分散片),达仁堂通宣理肺丸(通宣理肺丸),申优(头孢拉定分散片),康良头孢拉定胶囊(头孢拉定胶囊),安必君氨苄西林胶囊(氨苄西林胶囊),佳乐弗乳酸左氧氟沙星片(乳酸左氧氟沙星片),银诺克肺宝蛤蚧定喘丸(蛤蚧定喘丸),达力芬(头孢克肟颗粒),鲁神乙酰螺旋霉素片(乙酰螺旋霉素片),鲁抗注射用头孢唑林钠(注射用头孢唑林钠),上海新亚头孢克肟分散片(头孢克肟分散片),三维康(氟康唑胶囊),鲁抗麦迪霉素片(麦迪霉素片),珠海联邦头孢拉定胶囊(头孢拉定胶囊),朗瑞(司帕沙星分散片)","鹿肉,鸡蛋,鸡肝,杏仁","鱼腥草,洋葱,香菜,辣椒(青、尖)","番茄鸡蛋煎饼,番茄芹菜汁,番茄汁,锅塌番茄,意式番茄牛肉凉面,番茄牛肉,番茄三素,番茄苹果芝麻蜜",否 diff --git "a/notebook_tutorials/\343\200\220A\343\200\221\345\256\211\350\243\205\351\205\215\347\275\256\347\216\257\345\242\203.ipynb" "b/notebook_tutorials/\343\200\220A\343\200\221\345\256\211\350\243\205\351\205\215\347\275\256\347\216\257\345\242\203.ipynb" new file mode 100644 index 0000000..5c7cde1 --- /dev/null +++ "b/notebook_tutorials/\343\200\220A\343\200\221\345\256\211\350\243\205\351\205\215\347\275\256\347\216\257\345\242\203.ipynb" @@ -0,0 +1,134 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 安装配置环境\n", + "\n", + "[同济子豪兄](https://space.bilibili.com/1900783) 2022-6-25" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1.安装Neo4j" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 安装Neo4j Desktop" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "https://neo4j.com/download/" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 创建新Project:Medical_QA" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 创建新DBMS:medical_neo4j" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 启动DBMS,在浏览器中访问`localhost:7474`" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2.安装配置Python\n", + "\n", + "### 安装基础环境\n", + "\n", + "视频:【Windows安装配置Python】https://www.bilibili.com/video/BV1P5411W7g5?p=2\n", + "\n", + "视频:【MacOS安装配置Python】https://www.bilibili.com/video/BV1P5411W7g5?p=3\n", + "\n", + "视频:【python数据分析神器Jupyter notebook快速入门】https://www.bilibili.com/video/BV1Q4411H7fJ" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 安装第三方库" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "!pip install py2neo pyahocorasick numpy pandas -i https://pypi.tuna.tsinghua.edu.cn/simple/" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 验证安装成功" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [], + "source": [ + "# 验证安装成功\n", + "import py2neo\n", + "\n", + "# 注意,这里的用户名为neo4j全局用户名,而非DBMS或者database的名称\n", + "g = Graph('http://localhost:7474', auth=('neo4j', 'ABC123'))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git "a/notebook_tutorials/\343\200\220B\343\200\221\345\257\274\345\205\245\346\225\260\346\215\256\357\274\214\345\210\233\345\273\272\345\214\273\347\226\227\347\237\245\350\257\206\345\233\276\350\260\261.ipynb" "b/notebook_tutorials/\343\200\220B\343\200\221\345\257\274\345\205\245\346\225\260\346\215\256\357\274\214\345\210\233\345\273\272\345\214\273\347\226\227\347\237\245\350\257\206\345\233\276\350\260\261.ipynb" new file mode 100644 index 0000000..40ac3d0 --- /dev/null +++ "b/notebook_tutorials/\343\200\220B\343\200\221\345\257\274\345\205\245\346\225\260\346\215\256\357\274\214\345\210\233\345\273\272\345\214\273\347\226\227\347\237\245\350\257\206\345\233\276\350\260\261.ipynb" @@ -0,0 +1,2922 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 参考资料" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "中国科学院软件研究所 刘焕勇老师 https://github.com/liuhuanyong/QASystemOnMedicalKG" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 导入工具包" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import json\n", + "from py2neo import Graph, Node\n", + "\n", + "import pandas as pd" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 导入数据集csv文件" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_csv('medical_data.csv')" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(21, 23)" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.shape" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 实体(节点)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 实体:所有症状" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "symptoms = []\n", + "for each in df['症状']:\n", + " symptoms.extend(each.split(','))\n", + "symptoms = set(symptoms)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 所有科室" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "departments = []\n", + "for each in df['科室']:\n", + " departments.extend(each.split(','))\n", + "departments = set(departments)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 实体:所有检查" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "checks = []\n", + "for each in df['检查']:\n", + " checks.extend(each.split(','))\n", + "checks = set(checks)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 实体:所有药物" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "drugs = []\n", + "for each in df['推荐药物']:\n", + " try:\n", + " drugs.extend(each.split(','))\n", + " except:\n", + " pass\n", + "for each in df['常用药物']:\n", + " try:\n", + " drugs.extend(each.split(','))\n", + " except:\n", + " pass\n", + "drugs = set(drugs)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 实体:所有食物" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "foods = []\n", + "for each in df['可以吃']:\n", + " try:\n", + " foods.extend(each.split(','))\n", + " except:\n", + " pass\n", + "for each in df['不可以吃']:\n", + " try:\n", + " foods.extend(each.split(','))\n", + " except:\n", + " pass\n", + "for each in df['推荐吃']:\n", + " try:\n", + " foods.extend(each.split(','))\n", + " except:\n", + " pass\n", + "foods = set(foods)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 实体:所有药物厂商" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "producers = []\n", + "\n", + "for each in df['具体药物']:\n", + " try:\n", + " for each_drug in each.split(','):\n", + " producer = each_drug.split('(')[0]\n", + " producers.append(producer)\n", + " except:\n", + " pass\n", + "producers = set(producers)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 疾病字典信息" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "disease_infos = [] # 疾病信息\n", + "for idx, row in df.iterrows():\n", + " disease_infos.append(dict(row))" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "dict_keys(['疾病名称', '疾病描述', '疾病种类', '科室', '病因', '症状', '检查', '并发症', '花费', '疗程', '疗法', '治愈率', '易感人群', '感染概率', '感染途径', '预防措施', '推荐药物', '常用药物', '具体药物', '可以吃', '不可以吃', '推荐吃', '是否纳入医保'])" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dict(row).keys()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 关系(边)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "def deduplicate(rels_old):\n", + " '''关系去重函数'''\n", + " rels_new = []\n", + " for each in rels_old:\n", + " if each not in rels_new:\n", + " rels_new.append(each)\n", + " return rels_new" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 关系:疾病-检查" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "rels_check = []\n", + "for idx, row in df.iterrows():\n", + " for each in row['检查'].split(','):\n", + " rels_check.append([row['疾病名称'], each])\n", + "rels_check = deduplicate(rels_check)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[['肺泡蛋白质沉积症', '胸部CT检查'],\n", + " ['肺泡蛋白质沉积症', '肺活检'],\n", + " ['肺泡蛋白质沉积症', '支气管镜检查'],\n", + " ['百日咳', '耳、鼻、咽拭子细菌培养'],\n", + " ['百日咳', '周围血白细胞计数及分类检验'],\n", + " ['百日咳', '血常规'],\n", + " ['百日咳', '酶联免疫吸附试验'],\n", + " ['百日咳', '白细胞分类计数'],\n", + " ['苯中毒', '血常规'],\n", + " ['苯中毒', '骨髓象分析'],\n", + " ['苯中毒', '先令氏指数'],\n", + " ['喘息样支气管炎', '肺部检查'],\n", + " ['喘息样支气管炎', '肺和胸膜听诊'],\n", + " ['喘息样支气管炎', '抗链球菌型M蛋白抗体'],\n", + " ['喘息样支气管炎', '抗链球菌壁多糖抗体'],\n", + " ['喘息样支气管炎', '酶联免疫吸附试验'],\n", + " ['成人呼吸窘迫综合征', '胸部CT检查'],\n", + " ['成人呼吸窘迫综合征', '呼吸肌功能测定'],\n", + " ['成人呼吸窘迫综合征', '血浆蛋白C抗原'],\n", + " ['成人呼吸窘迫综合征', '肺泡气-动脉血氧分压差'],\n", + " ['成人呼吸窘迫综合征', '肺毛细血管楔压'],\n", + " ['大量羊水吸入', '肺部检查'],\n", + " ['大量羊水吸入', '胸部透视'],\n", + " ['大量羊水吸入', '胸部平片'],\n", + " ['大量羊水吸入', '胸部CT检查'],\n", + " ['单纯性肺嗜酸粒细胞浸润症', '痰液中细胞分类'],\n", + " ['单纯性肺嗜酸粒细胞浸润症', '胸部平片'],\n", + " ['单纯性肺嗜酸粒细胞浸润症', '痰液中寄生虫和虫卵'],\n", + " ['大叶性肺炎', 'Optochin敏感试验'],\n", + " ['大叶性肺炎', '小白鼠毒力试验'],\n", + " ['大叶性肺炎', '痰培养'],\n", + " ['大叶性肺炎', '肺活量体重指数'],\n", + " ['大叶性肺炎', '胸部平片'],\n", + " ['大叶性肺炎', '免疫电泳'],\n", + " ['大叶性肺炎', '血常规'],\n", + " ['大叶性肺炎', '痰液细菌涂片检查'],\n", + " ['大楼病综合征', '钼靶X线检查'],\n", + " ['大楼病综合征', 'CT检查'],\n", + " ['大楼病综合征', '血常规'],\n", + " ['二硫化碳中毒', '血常规'],\n", + " ['二硫化碳中毒', '尿常规'],\n", + " ['二硫化碳中毒', '肾功能检查'],\n", + " ['二硫化碳中毒', '神经系统检查'],\n", + " ['二硫化碳中毒', '眼底荧光血管造影'],\n", + " ['二硫化碳中毒', '肌电图'],\n", + " ['二硫化碳中毒', '脑电图检查'],\n", + " ['二硫化碳中毒', '心肺功能运动试验(CPET)'],\n", + " ['肺-胸膜阿米巴病', '胸部平片'],\n", + " ['肺-胸膜阿米巴病', '痰液病原体检查'],\n", + " ['肺出血-肾炎综合征', '痰液常规检查'],\n", + " ['肺出血-肾炎综合征', '尿液镜检法'],\n", + " ['肺出血-肾炎综合征', '胸部平片'],\n", + " ['肺出血-肾炎综合征', '肾功能检查'],\n", + " ['肺出血-肾炎综合征', '抗肾小球基底膜抗体测定(AGBM)'],\n", + " ['肺出血-肾炎综合征', '隐血试验与含铁血黄素检查'],\n", + " ['肺放线菌病', '痰液病原体检查'],\n", + " ['肺放线菌病', '胸部平片'],\n", + " ['肺泡蛋白沉着症', '胸部CT检查'],\n", + " ['肺泡蛋白沉着症', '支气管镜检查'],\n", + " ['肺泡蛋白沉着症', '肺活检'],\n", + " ['肺曲菌病', '胸部平片'],\n", + " ['肺曲菌病', '痰培养'],\n", + " ['肺曲菌病', '纤维支气管镜检查'],\n", + " ['肺曲菌病', '胸部CT检查'],\n", + " ['肺曲菌病', '痰液细菌涂片检查'],\n", + " ['放射性肺炎', '胸部平片'],\n", + " ['放射性肺炎', '肺功能检查'],\n", + " ['放射性肺炎', '通气与血流灌注比值(V/Q)'],\n", + " ['放射性肺炎', '每分钟最大通气量(MVV)'],\n", + " ['放射性肺炎', '血常规'],\n", + " ['肺念珠菌病', '肺量计检测'],\n", + " ['肺念珠菌病', '胸部平片'],\n", + " ['肺念珠菌病', '痰液细菌涂片检查'],\n", + " ['肺大疱', '胸部CT检查'],\n", + " ['肺大疱', '支气管造影'],\n", + " ['肺大疱', '胸部平片'],\n", + " ['肺炎球菌肺炎', '胸部平片'],\n", + " ['肺炎球菌肺炎', '血常规'],\n", + " ['肺气肿', '肺量计检测'],\n", + " ['肺气肿', '残气量/肺总量比值(RV/TLC)'],\n", + " ['肺气肿', '肺容量测定'],\n", + " ['肺气肿', '肺活量(VC)'],\n", + " ['肺气肿', '最大呼气流量-容积曲线(MEFV)'],\n", + " ['肺气肿', '深吸气量(IC)'],\n", + " ['肺气肿', '一秒用力呼出量/用力肺活量比值'],\n", + " ['肺气肿', '心电图'],\n", + " ['肺气肿', '无效腔气量/潮气量比值'],\n", + " ['肺气肿', '肺泡气-动脉血氧分压差'],\n", + " ['肺炎杆菌肺炎', '痰液细菌涂片检查'],\n", + " ['肺炎杆菌肺炎', '痰液细菌培养'],\n", + " ['肺炎杆菌肺炎', '血常规']]" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "rels_check" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 关系:疾病-症状" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "rels_symptom = []\n", + "for idx, row in df.iterrows():\n", + " for each in row['症状'].split(','):\n", + " rels_symptom.append([row['疾病名称'], each])\n", + "rels_symptom = deduplicate(rels_symptom)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[['肺泡蛋白质沉积症', '紫绀'],\n", + " ['肺泡蛋白质沉积症', '胸痛'],\n", + " ['肺泡蛋白质沉积症', '呼吸困难'],\n", + " ['肺泡蛋白质沉积症', '乏力'],\n", + " ['肺泡蛋白质沉积症', '毓卓'],\n", + " ['百日咳', '吸气时有蝉鸣音'],\n", + " ['百日咳', '痉挛性咳嗽'],\n", + " ['百日咳', '胸闷'],\n", + " ['百日咳', '肺阴虚'],\n", + " ['百日咳', '抽搐'],\n", + " ['百日咳', '低热'],\n", + " ['百日咳', '闫鹏辉'],\n", + " ['百日咳', '惊厥'],\n", + " ['苯中毒', '恶心'],\n", + " ['苯中毒', '抽搐'],\n", + " ['苯中毒', '感觉障碍'],\n", + " ['喘息样支气管炎', '耸肩喘息'],\n", + " ['喘息样支气管炎', '哮鸣音'],\n", + " ['喘息样支气管炎', '纤毛上皮细胞损伤脱落'],\n", + " ['喘息样支气管炎', '变应性咳嗽'],\n", + " ['喘息样支气管炎', '化学性支气管炎'],\n", + " ['喘息样支气管炎', '喘息'],\n", + " ['喘息样支气管炎', '冬春季的慢性咳...'],\n", + " ['喘息样支气管炎', '咳嗽伴哮鸣音'],\n", + " ['成人呼吸窘迫综合征', '呼吸困难'],\n", + " ['成人呼吸窘迫综合征', '紫绀'],\n", + " ['成人呼吸窘迫综合征', '心源性呼吸窘迫'],\n", + " ['大量羊水吸入', '面色青紫'],\n", + " ['大量羊水吸入', '呼吸困难'],\n", + " ['大量羊水吸入', '口唇青紫'],\n", + " ['大量羊水吸入', '肺纹理增粗'],\n", + " ['大量羊水吸入', '出生后即有持续青紫'],\n", + " ['大量羊水吸入', '口唇和甲床略带青紫'],\n", + " ['大量羊水吸入', '气急'],\n", + " ['单纯性肺嗜酸粒细胞浸润症', '嗜酸性粒细胞增多'],\n", + " ['单纯性肺嗜酸粒细胞浸润症', '咽部异物感'],\n", + " ['单纯性肺嗜酸粒细胞浸润症', '胸闷憋气'],\n", + " ['单纯性肺嗜酸粒细胞浸润症', '咯血伴发热'],\n", + " ['单纯性肺嗜酸粒细胞浸润症', '胸闷'],\n", + " ['单纯性肺嗜酸粒细胞浸润症', '乏力'],\n", + " ['大叶性肺炎', '湿啰音'],\n", + " ['大叶性肺炎', '胸痛'],\n", + " ['大叶性肺炎', '发烧'],\n", + " ['大叶性肺炎', '咳铁锈色痰'],\n", + " ['大叶性肺炎', '急性面容'],\n", + " ['大叶性肺炎', '呼吸音减弱'],\n", + " ['大楼病综合征', '紧张性头晕'],\n", + " ['大楼病综合征', '紧张性头痛'],\n", + " ['大楼病综合征', '间歇性头晕'],\n", + " ['大楼病综合征', '鼻塞'],\n", + " ['大楼病综合征', '头晕'],\n", + " ['大楼病综合征', '恶心'],\n", + " ['大楼病综合征', '眼睛痒'],\n", + " ['大楼病综合征', '目赤'],\n", + " ['大楼病综合征', '间歇性头痛'],\n", + " ['二硫化碳中毒', '昏迷'],\n", + " ['二硫化碳中毒', '腱反射消失'],\n", + " ['二硫化碳中毒', '呕吐'],\n", + " ['二硫化碳中毒', '谵妄'],\n", + " ['二硫化碳中毒', '多发性神经炎'],\n", + " ['二硫化碳中毒', '浅感觉减退或缺失'],\n", + " ['二硫化碳中毒', '恶心'],\n", + " ['二硫化碳中毒', '感觉障碍'],\n", + " ['肺-胸膜阿米巴病', '盗汗'],\n", + " ['肺-胸膜阿米巴病', '腹泻'],\n", + " ['肺-胸膜阿米巴病', '乏力'],\n", + " ['肺-胸膜阿米巴病', '发热伴咳嗽、咯...'],\n", + " ['肺出血-肾炎综合征', '肺部出血'],\n", + " ['肺出血-肾炎综合征', '呼吸困难'],\n", + " ['肺出血-肾炎综合征', '咯血'],\n", + " ['肺出血-肾炎综合征', '气短'],\n", + " ['肺出血-肾炎综合征', '发热伴咳嗽、咯...'],\n", + " ['肺出血-肾炎综合征', '蛋白尿'],\n", + " ['肺放线菌病', '骨膜炎'],\n", + " ['肺放线菌病', '体重减轻'],\n", + " ['肺放线菌病', '咯血'],\n", + " ['肺放线菌病', '盗汗'],\n", + " ['肺放线菌病', '乏力'],\n", + " ['肺放线菌病', '低热'],\n", + " ['肺泡蛋白沉着症', '胸痛'],\n", + " ['肺泡蛋白沉着症', '紫绀'],\n", + " ['肺泡蛋白沉着症', '呼吸困难'],\n", + " ['肺泡蛋白沉着症', '肺泡炎症'],\n", + " ['肺泡蛋白沉着症', '肺泡灌洗液可见...'],\n", + " ['肺泡蛋白沉着症', '乏力'],\n", + " ['肺泡蛋白沉着症', '发热伴咳嗽、咯...'],\n", + " ['肺曲菌病', '咳出棕色痰栓'],\n", + " ['肺曲菌病', '嗜酸性粒细胞增多'],\n", + " ['肺曲菌病', '胸痛'],\n", + " ['放射性肺炎', '闫铁'],\n", + " ['放射性肺炎', '肺纤维化'],\n", + " ['放射性肺炎', '胸痛'],\n", + " ['放射性肺炎', '低热'],\n", + " ['肺念珠菌病', '痰呈粘液脓性'],\n", + " ['肺念珠菌病', '肺部啰音'],\n", + " ['肺大疱', '胸闷'],\n", + " ['肺大疱', '气短'],\n", + " ['肺大疱', '胸闷憋气'],\n", + " ['肺大疱', '发热伴咳嗽、咯...'],\n", + " ['肺炎球菌肺炎', '痰中带血丝'],\n", + " ['肺炎球菌肺炎', '咳嗽伴胸痛'],\n", + " ['肺炎球菌肺炎', '胸痛'],\n", + " ['肺炎球菌肺炎', '发热伴咳嗽、咯...'],\n", + " ['肺气肿', '纵隔浊音界扩大'],\n", + " ['肺气肿', '桶状胸'],\n", + " ['肺气肿', '小支气管粘膜水肿'],\n", + " ['肺气肿', '黏稠或脓性痰伴...'],\n", + " ['肺气肿', '横膈低平'],\n", + " ['肺气肿', '胸闷'],\n", + " ['肺气肿', '呼气音延长'],\n", + " ['肺气肿', '肺部啰音'],\n", + " ['肺气肿', '呼吸音减弱'],\n", + " ['肺炎杆菌肺炎', '畏寒'],\n", + " ['肺炎杆菌肺炎', '胸痛'],\n", + " ['肺炎杆菌肺炎', '气急'],\n", + " ['肺炎杆菌肺炎', '发热伴咳嗽、咯...']]" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "rels_symptom" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 关系:疾病-疾病(并发症)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "rels_acompany = []\n", + "for idx, row in df.iterrows():\n", + " for each in row['并发症'].split(','):\n", + " rels_acompany.append([row['疾病名称'], each])\n", + "rels_acompany = deduplicate(rels_acompany)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[['肺泡蛋白质沉积症', '多重肺部感染'],\n", + " ['百日咳', '肺不张'],\n", + " ['苯中毒', '贫血'],\n", + " ['喘息样支气管炎', '支气管哮喘'],\n", + " ['成人呼吸窘迫综合征', '细菌性肺炎'],\n", + " ['大量羊水吸入', '呼吸衰竭'],\n", + " ['单纯性肺嗜酸粒细胞浸润症', '胆道蛔虫病'],\n", + " ['大叶性肺炎', '脓胸'],\n", + " ['大楼病综合征', '抑郁症'],\n", + " ['二硫化碳中毒', '昏迷'],\n", + " ['肺-胸膜阿米巴病', '阿米巴肝脓肿'],\n", + " ['肺出血-肾炎综合征', '便血'],\n", + " ['肺放线菌病', '膈下脓肿'],\n", + " ['肺泡蛋白沉着症', '呼吸衰竭'],\n", + " ['肺曲菌病', '过敏性鼻炎'],\n", + " ['放射性肺炎', '肺气肿'],\n", + " ['肺念珠菌病', '菌血症'],\n", + " ['肺大疱', '张力性气胸'],\n", + " ['肺炎球菌肺炎', '败血症'],\n", + " ['肺气肿', '呼吸衰竭'],\n", + " ['肺气肿', '自发性气胸'],\n", + " ['肺气肿', '慢性肺源性心脏病'],\n", + " ['肺气肿', '胃溃疡'],\n", + " ['肺炎杆菌肺炎', '脑疝']]" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "rels_acompany" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 关系:疾病-推荐药物" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [], + "source": [ + "rels_recommanddrug = []\n", + "for idx, row in df.iterrows():\n", + " try:\n", + " for each in row['推荐药物'].split(','):\n", + " rels_recommanddrug.append([row['疾病名称'], each])\n", + " except:\n", + " pass\n", + "rels_recommanddrug = deduplicate(rels_recommanddrug)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 关系:疾病-常用药物" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "rels_commonddrug = []\n", + "for idx, row in df.iterrows():\n", + " try:\n", + " for each in row['常用药物'].split(','):\n", + " rels_commonddrug.append([row['疾病名称'], each])\n", + " except:\n", + " pass\n", + "rels_commonddrug = deduplicate(rels_commonddrug)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 关系:疾病-不可以吃" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [], + "source": [ + "rels_noteat = []\n", + "for idx, row in df.iterrows():\n", + " try:\n", + " for each in row['不可以吃'].split(','):\n", + " rels_noteat.append([row['疾病名称'], each])\n", + " except:\n", + " pass\n", + "rels_noteat = deduplicate(rels_noteat)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 关系:疾病-可以吃" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [], + "source": [ + "rels_doeat = []\n", + "for idx, row in df.iterrows():\n", + " try:\n", + " for each in row['可以吃'].split(','):\n", + " rels_doeat.append([row['疾病名称'], each])\n", + " except:\n", + " pass\n", + "rels_doeat = deduplicate(rels_doeat)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 关系:疾病-推荐吃" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [], + "source": [ + "rels_recommandeat = []\n", + "for idx, row in df.iterrows():\n", + " try:\n", + " for each in row['推荐吃'].split(','):\n", + " rels_recommandeat.append([row['疾病名称'], each])\n", + " except:\n", + " pass\n", + "rels_recommandeat = deduplicate(rels_recommandeat)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 关系:药物厂商-具体药物" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "rels_drug_producer = []\n", + "for each in df['具体药物']:\n", + " try:\n", + " for each_drug in each.split(','):\n", + " producer = each_drug.split('(')[0]\n", + " drug = each_drug.split('(')[1][:-1]\n", + " rels_drug_producer.append([producer, drug])\n", + " except:\n", + " pass\n", + "rels_drug_producer = deduplicate(rels_drug_producer)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 关系:疾病-科室、小科室-大科室" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [], + "source": [ + "rels_category = [] # 关系:疾病-科室\n", + "rels_department = [] # 关系:小科室-大科室\n", + "for idx, row in df.iterrows():\n", + " if len(row['科室'].split(',')) == 1:\n", + " rels_category.append([row['疾病名称'], row['科室']])\n", + " else:\n", + " big = row['科室'].split(',')[0] # 大科室\n", + " small = row['科室'].split(',')[1] # 小科室\n", + " rels_category.append([row['疾病名称'], small])\n", + " rels_department.append([small, big])\n", + "rels_category = deduplicate(rels_category)\n", + "rels_department = deduplicate(rels_department)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[['肺泡蛋白质沉积症', '呼吸内科'],\n", + " ['百日咳', '小儿内科'],\n", + " ['苯中毒', '急诊科'],\n", + " ['喘息样支气管炎', '呼吸内科'],\n", + " ['成人呼吸窘迫综合征', '呼吸内科'],\n", + " ['大量羊水吸入', '小儿内科'],\n", + " ['单纯性肺嗜酸粒细胞浸润症', '呼吸内科'],\n", + " ['大叶性肺炎', '呼吸内科'],\n", + " ['大楼病综合征', '其他综合'],\n", + " ['二硫化碳中毒', '急诊科'],\n", + " ['肺-胸膜阿米巴病', '呼吸内科'],\n", + " ['肺出血-肾炎综合征', '呼吸内科'],\n", + " ['肺放线菌病', '呼吸内科'],\n", + " ['肺泡蛋白沉着症', '呼吸内科'],\n", + " ['肺曲菌病', '呼吸内科'],\n", + " ['放射性肺炎', '呼吸内科'],\n", + " ['肺念珠菌病', '呼吸内科'],\n", + " ['肺大疱', '呼吸内科'],\n", + " ['肺炎球菌肺炎', '呼吸内科'],\n", + " ['肺气肿', '呼吸内科'],\n", + " ['肺炎杆菌肺炎', '呼吸内科']]" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "rels_category" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[['呼吸内科', '内科'], ['小儿内科', '儿科'], ['其他综合', '其他科室']]" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "rels_department" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 连接图数据库" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [], + "source": [ + "# 注意,这里的用户名为neo4j全局用户名,而非DBMS或者database的名称\n", + "g = Graph('http://localhost:7474', auth=('neo4j', 'ABC123'))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 创建知识图谱实体(节点)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 样例代码" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [], + "source": [ + "# # Neo4j样例代码\n", + "\n", + "# 创建实体\n", + "# node = Node('Disease', name='百日咳', easy_get='多见于小儿')\n", + "# g.create(node)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "(No data)" + ], + "text/plain": [ + "(No data)" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# 删除所有实体和关系\n", + "cypher = 'MATCH (n) DETACH DELETE n'\n", + "g.run(cypher)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 创建疾病实体" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "创建疾病实体: 百日咳\n", + "创建疾病实体: 苯中毒\n", + "创建疾病实体: 喘息样支气管炎\n", + "创建疾病实体: 成人呼吸窘迫综合征\n", + "创建疾病实体: 大量羊水吸入\n", + "创建疾病实体: 单纯性肺嗜酸粒细胞浸润症\n", + "创建疾病实体: 大叶性肺炎\n", + "创建疾病实体: 大楼病综合征\n", + "创建疾病实体: 二硫化碳中毒\n", + "创建疾病实体: 肺-胸膜阿米巴病\n", + "创建疾病实体: 肺出血-肾炎综合征\n", + "创建疾病实体: 肺放线菌病\n", + "创建疾病实体: 肺泡蛋白沉着症\n", + "创建疾病实体: 肺曲菌病\n", + "创建疾病实体: 放射性肺炎\n", + "创建疾病实体: 肺念珠菌病\n", + "创建疾病实体: 肺大疱\n", + "创建疾病实体: 肺炎球菌肺炎\n", + "创建疾病实体: 肺气肿\n", + "创建疾病实体: 肺炎杆菌肺炎\n", + "共创建 20 个疾病实体\n" + ] + } + ], + "source": [ + "count = 0\n", + "for disease_dict in disease_infos:\n", + " try:\n", + " node = Node(\"Disease\",\n", + " name=disease_dict['疾病名称'],\n", + " desc=disease_dict['疾病描述'],\n", + " prevent=disease_dict['预防措施'],\n", + " cause=disease_dict['病因'],\n", + " easy_get=disease_dict['易感人群'],\n", + " cure_lasttime=disease_dict['疗程'],\n", + " cure_department=disease_dict['科室'],\n", + " cure_way=disease_dict['疗法'], \n", + " cured_prob=disease_dict['治愈率'])\n", + " g.create(node)\n", + " count += 1\n", + " print('创建疾病实体:', disease_dict['疾病名称'])\n", + " except:\n", + " pass\n", + "print('共创建 {} 个疾病实体'.format(count))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 创建药物实体" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "创建实体 噻托溴铵粉雾剂\n", + "创建实体 百咳静糖浆\n", + "创建实体 阿奇霉素分散片\n", + "创建实体 盐酸克林霉素棕榈酸酯颗粒\n", + "创建实体 地塞米松磷酸钠注射液\n", + "创建实体 氯霉素片\n", + "创建实体 噻托溴铵粉吸入剂\n", + "创建实体 盐酸妥洛特罗片\n", + "创建实体 小青龙合剂\n", + "创建实体 阿奇霉素胶囊\n", + "创建实体 盐酸克林霉素胶囊\n", + "创建实体 小青龙颗粒\n", + "创建实体 红霉素肠溶片\n", + "创建实体 阿莫西林颗粒\n", + "创建实体 盐酸特比萘芬溶液\n", + "创建实体 注射用盐酸溴己新\n", + "创建实体 头孢拉定分散片\n", + "创建实体 胸腺肽肠溶片\n", + "创建实体 注射用美洛西林钠舒巴坦钠\n", + "创建实体 仁青芒觉\n", + "创建实体 甲硝唑维B6片\n", + "创建实体 茶碱缓释胶囊\n", + "创建实体 硫酸沙丁胺醇气雾剂\n", + "创建实体 蒺藜药酒\n", + "创建实体 诺氟沙星胶囊\n", + "创建实体 司帕沙星分散片\n", + "创建实体 如意定喘丸\n", + "创建实体 二羟丙茶碱片\n", + "创建实体 氨苄西林胶囊\n", + "创建实体 注射用呋塞米\n", + "创建实体 酮康唑乳膏\n", + "创建实体 甲硝唑片\n", + "创建实体 喘嗽宁片\n", + "创建实体 枸橼酸喷托维林片\n", + "创建实体 氨溴特罗口服溶液\n", + "创建实体 伊曲康唑胶囊\n", + "创建实体 乳酸左氧氟沙星片\n", + "创建实体 注射用硫代硫酸钠\n", + "创建实体 克霉唑阴道片\n", + "创建实体 硫酸沙丁胺醇片\n", + "创建实体 穿心莲内酯片\n", + "创建实体 乙酰螺旋霉素片\n", + "创建实体 硝酸益康唑乳膏\n", + "创建实体 硫酸特布他林片\n", + "创建实体 头孢丙烯分散片\n", + "创建实体 喷托维林氯化铵糖浆\n", + "创建实体 硝酸咪康唑栓\n", + "创建实体 头孢克肟颗粒\n", + "创建实体 注射用盐酸氨溴索\n", + "创建实体 布地奈德气雾剂\n", + "创建实体 替硝唑片\n", + "创建实体 联苯苄唑乳膏\n", + "创建实体 头孢氨苄胶囊\n", + "创建实体 硝酸咪康唑乳膏\n", + "创建实体 大月晶丸\n", + "创建实体 化痰平喘片\n", + "创建实体 头孢克肟分散片\n", + "创建实体 环吡酮胺乳膏\n", + "创建实体 阿奇霉素颗粒\n", + "创建实体 肺气肿片\n", + "创建实体 氨茶碱片\n", + "创建实体 环酯红霉素片\n", + "创建实体 氟康唑胶囊\n", + "创建实体 阿奇霉素片\n", + "创建实体 茶碱缓释片\n", + "创建实体 盐酸利多卡因注射液\n", + "创建实体 注射用甲泼尼龙琥珀酸钠\n", + "创建实体 硝酸益康唑溶液\n", + "创建实体 托西酸舒他西林胶囊\n", + "创建实体 通宣理肺丸\n", + "创建实体 布美他尼片\n", + "创建实体 硫酸特布他林雾化液\n", + "创建实体 注射用布美他尼\n", + "创建实体 盐酸左氧氟沙星胶囊\n", + "创建实体 白及颗粒\n", + "创建实体 琥乙红霉素片\n", + "创建实体 盐酸班布特罗胶囊\n", + "创建实体 奥硝唑片\n", + "创建实体 复方蛤青胶囊\n", + "创建实体 盐酸班布特罗片\n", + "创建实体 头孢泊肟酯胶囊\n", + "创建实体 头孢拉定胶囊\n", + "创建实体 依托红霉素片\n", + "创建实体 甲泼尼龙片\n", + "创建实体 雷公藤多苷片\n", + "创建实体 头孢克洛颗粒\n", + "创建实体 注射用头孢唑林钠\n", + "创建实体 十一味金色丸\n", + "创建实体 注射用盐酸头孢替安\n", + "创建实体 头孢氨苄甲氧苄啶片\n", + "创建实体 麦迪霉素片\n", + "创建实体 注射用还原型谷胱甘肽钠\n", + "创建实体 蛤蚧定喘丸\n", + "创建实体 琥乙红霉素颗粒\n", + "创建实体 蛇胆川贝液\n", + "创建实体 人血白蛋白\n", + "创建实体 祛痰止咳胶囊\n", + "创建实体 盐酸氨溴索葡萄糖注射液\n", + "创建实体 盐酸特比萘芬片\n", + "创建实体 盐酸克林霉素棕榈酸酯分散片\n", + "创建实体 云南花粉片\n", + "创建实体 注射用磺苄西林钠\n", + "创建实体 盐酸特比萘芬凝胶\n", + "创建实体 转移因子口服溶液\n", + "创建实体 注射用鼠神经生长因子\n" + ] + } + ], + "source": [ + "for each in drugs:\n", + " node = Node('Drug', name=each)\n", + " g.create(node)\n", + " print('创建实体 {}'.format(each))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 创建食物实体" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "创建实体 圆白菜\n", + "创建实体 鲤鱼\n", + "创建实体 薏米莲子粥\n", + "创建实体 海蚌\n", + "创建实体 南瓜\n", + "创建实体 鸡蛋清\n", + "创建实体 糖醋草鱼\n", + "创建实体 鹿肉\n", + "创建实体 首乌百合粥\n", + "创建实体 山楂桑椹粥\n", + "创建实体 罗汉果雪耳鸡汤\n", + "创建实体 黄瓜拌豆腐丝\n", + "创建实体 酱豆腐汁烧猪肉\n", + "创建实体 羊肉(瘦)\n", + "创建实体 海虾\n", + "创建实体 猪肉(瘦)\n", + "创建实体 番茄牛肉片\n", + "创建实体 螃蟹\n", + "创建实体 生姜乌梅饮\n", + "创建实体 韭菜\n", + "创建实体 小麦粥\n", + "创建实体 银耳粥\n", + "创建实体 炖白鲢鱼\n", + "创建实体 意式番茄牛肉凉面\n", + "创建实体 素炒小白菜\n", + "创建实体 山楂糕\n", + "创建实体 番茄皮蛋汤\n", + "创建实体 薏仁党参粥\n", + "创建实体 蔬菜杂烩粥\n", + "创建实体 山楂百合汤\n", + "创建实体 海蟹\n", + "创建实体 大蒜\n", + "创建实体 鸡蛋木耳粥\n", + "创建实体 瓜粒杂锦汤\n", + "创建实体 樱桃番茄\n", + "创建实体 海螺\n", + "创建实体 萝卜豆腐汤\n", + "创建实体 赤贝\n", + "创建实体 番茄牛肉\n", + "创建实体 核桃\n", + "创建实体 党参粥\n", + "创建实体 山药\n", + "创建实体 栗子(熟)\n", + "创建实体 莲子\n", + "创建实体 鲫鱼\n", + "创建实体 香菜\n", + "创建实体 黄芪粥\n", + "创建实体 大豆\n", + "创建实体 豆薯小米粥\n", + "创建实体 排骨汤\n", + "创建实体 空心菜\n", + "创建实体 猪肉(肥瘦)\n", + "创建实体 番茄羊肉蛋花汤\n", + "创建实体 鱼腥草\n", + "创建实体 狗肉\n", + "创建实体 鸡肝\n", + "创建实体 鲢鱼\n", + "创建实体 珊瑚白菜墩\n", + "创建实体 番茄三素\n", + "创建实体 番茄西米粥\n", + "创建实体 雪梨饮\n", + "创建实体 泡莲藕\n", + "创建实体 百合花生汤\n", + "创建实体 豆浆\n", + "创建实体 绿豆南瓜汤\n", + "创建实体 乌梅粥\n", + "创建实体 生菜\n", + "创建实体 番茄羊肉汤\n", + "创建实体 奶油\n", + "创建实体 鸡\n", + "创建实体 牛奶玉米汤\n", + "创建实体 番茄苹果芝麻蜜\n", + "创建实体 小黄瓜西瓜汁\n", + "创建实体 清蒸鸡蛋羹\n", + "创建实体 鸭梨粥\n", + "创建实体 白菜蛋花粥\n", + "创建实体 凉拌莲藕\n", + "创建实体 玉竹白菜\n", + "创建实体 凉拌番茄\n", + "创建实体 山楂红糖粥\n", + "创建实体 鲈鱼\n", + "创建实体 肉松\n", + "创建实体 茭白\n", + "创建实体 山楂乌梅饮\n", + "创建实体 小白菜\n", + "创建实体 川贝酿梨\n", + "创建实体 百合炒芦笋\n", + "创建实体 拌肚丝白菜\n", + "创建实体 黄瓜拌兔丝\n", + "创建实体 油麦菜\n", + "创建实体 番茄芹菜汁\n", + "创建实体 豆腐干炒韭菜\n", + "创建实体 椰子银耳煲鸽汤\n", + "创建实体 白酒\n", + "创建实体 南瓜子仁\n", + "创建实体 啤酒\n", + "创建实体 锅塌番茄\n", + "创建实体 松子仁\n", + "创建实体 冬菇烧白菜\n", + "创建实体 紫苏粥\n", + "创建实体 肉末冬瓜\n", + "创建实体 羊腩萝卜丝粥\n", + "创建实体 洋葱\n", + "创建实体 水萝卜丝拌白菜\n", + "创建实体 竹笋\n", + "创建实体 辣椒(红、尖、干)\n", + "创建实体 北杏炖雪梨\n", + "创建实体 咖啡\n", + "创建实体 水萝卜拌黄瓜\n", + "创建实体 鲜百合烧肉\n", + "创建实体 鸡蛋\n", + "创建实体 百合汁\n", + "创建实体 杏仁\n", + "创建实体 鲜芦根粥\n", + "创建实体 红烧鲢鱼\n", + "创建实体 菊花芦根茶\n", + "创建实体 番茄\n", + "创建实体 百合炖猪蹄\n", + "创建实体 冰糖银耳羹\n", + "创建实体 番茄鸡蛋煎饼\n", + "创建实体 虾皮香芹燕麦粥\n", + "创建实体 海参(水浸)\n", + "创建实体 带鱼\n", + "创建实体 百合双耳鸡蛋羹\n", + "创建实体 苦瓜\n", + "创建实体 百合汤\n", + "创建实体 花生杏仁粥\n", + "创建实体 三鲜冬瓜汤\n", + "创建实体 茄子\n", + "创建实体 油菜\n", + "创建实体 五丝白菜卷\n", + "创建实体 百合粥\n", + "创建实体 红枣银耳粥\n", + "创建实体 杂粮粥\n", + "创建实体 辣椒(青、尖)\n", + "创建实体 生芦根粥\n", + "创建实体 荞麦粥\n", + "创建实体 小黄瓜凉拌面\n", + "创建实体 百合糖粥\n", + "创建实体 番茄猪肝瘦肉汤\n", + "创建实体 番茄汁\n", + "创建实体 黄瓜拌香菜\n", + "创建实体 冬瓜草鱼汤\n", + "创建实体 奶汤锅子鱼\n", + "创建实体 黄瓜拌皮丝\n", + "创建实体 黄瓜三丝汤\n" + ] + } + ], + "source": [ + "for each in foods:\n", + " node = Node('Food', name=each)\n", + " g.create(node)\n", + " print('创建实体 {}'.format(each))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 创建检查实体" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "创建实体 血浆蛋白C抗原\n", + "创建实体 肺功能检查\n", + "创建实体 肺量计检测\n", + "创建实体 免疫电泳\n", + "创建实体 Optochin敏感试验\n", + "创建实体 通气与血流灌注比值(V/Q)\n", + "创建实体 CT检查\n", + "创建实体 纤维支气管镜检查\n", + "创建实体 支气管镜检查\n", + "创建实体 痰液常规检查\n", + "创建实体 胸部透视\n", + "创建实体 胸部平片\n", + "创建实体 钼靶X线检查\n", + "创建实体 抗肾小球基底膜抗体测定(AGBM)\n", + "创建实体 尿液镜检法\n", + "创建实体 支气管造影\n", + "创建实体 心电图\n", + "创建实体 尿常规\n", + "创建实体 肺和胸膜听诊\n", + "创建实体 肺毛细血管楔压\n", + "创建实体 肺活量体重指数\n", + "创建实体 痰液细菌培养\n", + "创建实体 无效腔气量/潮气量比值\n", + "创建实体 深吸气量(IC)\n", + "创建实体 白细胞分类计数\n", + "创建实体 肺活检\n", + "创建实体 耳、鼻、咽拭子细菌培养\n", + "创建实体 肾功能检查\n", + "创建实体 肌电图\n", + "创建实体 血常规\n", + "创建实体 一秒用力呼出量/用力肺活量比值\n", + "创建实体 痰液中寄生虫和虫卵\n", + "创建实体 周围血白细胞计数及分类检验\n", + "创建实体 抗链球菌型M蛋白抗体\n", + "创建实体 肺部检查\n", + "创建实体 骨髓象分析\n", + "创建实体 脑电图检查\n", + "创建实体 痰液病原体检查\n", + "创建实体 隐血试验与含铁血黄素检查\n", + "创建实体 每分钟最大通气量(MVV)\n", + "创建实体 神经系统检查\n", + "创建实体 酶联免疫吸附试验\n", + "创建实体 眼底荧光血管造影\n", + "创建实体 肺泡气-动脉血氧分压差\n", + "创建实体 胸部CT检查\n", + "创建实体 呼吸肌功能测定\n", + "创建实体 残气量/肺总量比值(RV/TLC)\n", + "创建实体 痰培养\n", + "创建实体 小白鼠毒力试验\n", + "创建实体 痰液细菌涂片检查\n", + "创建实体 心肺功能运动试验(CPET)\n", + "创建实体 抗链球菌壁多糖抗体\n", + "创建实体 肺容量测定\n", + "创建实体 最大呼气流量-容积曲线(MEFV)\n", + "创建实体 痰液中细胞分类\n", + "创建实体 先令氏指数\n", + "创建实体 肺活量(VC)\n" + ] + } + ], + "source": [ + "for each in checks:\n", + " node = Node('Check', name=each)\n", + " g.create(node)\n", + " print('创建实体 {}'.format(each))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 创建科室实体" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "创建实体 内科\n", + "创建实体 小儿内科\n", + "创建实体 其他科室\n", + "创建实体 呼吸内科\n", + "创建实体 急诊科\n", + "创建实体 儿科\n", + "创建实体 其他综合\n" + ] + } + ], + "source": [ + "for each in departments:\n", + " node = Node('Department', name=each)\n", + " g.create(node)\n", + " print('创建实体 {}'.format(each))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 创建 药物厂商 实体" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "创建实体 艾富西药业盐酸氨溴索葡萄糖\n", + "创建实体 金诃藏药大月晶丸\n", + "创建实体 山西云鹏制药氨茶碱片\n", + "创建实体 佐今明百咳静糖浆\n", + "创建实体 一品红盐酸克林霉素棕榈酸酯\n", + "创建实体 美扶\n", + "创建实体 罗欣药业注射用盐酸氨溴索\n", + "创建实体 东信药业蛇胆川贝液\n", + "创建实体 央宗药业蒺藜药酒\n", + "创建实体 广东环球制药茶碱缓释片\n", + "创建实体 宜昌人福盐酸克林霉素胶囊\n", + "创建实体 盐酸克林霉素胶囊\n", + "创建实体 金诃藏药仁青芒觉\n", + "创建实体 蜀阳药业人血白蛋白\n", + "创建实体 桂林华信环吡酮胺乳膏\n", + "创建实体 苏州三药盐酸克林霉素胶囊\n", + "创建实体 平光制药红霉素肠溶片\n", + "创建实体 天津太平洋二羟丙茶碱片\n", + "创建实体 仁和堂硫酸沙丁胺醇片\n", + "创建实体 鲁抗麦迪霉素片\n", + "创建实体 太原药业甲硝唑片\n", + "创建实体 全星制药注射用盐酸头孢替安\n", + "创建实体 瑞阳制药注射用磺苄西林钠\n", + "创建实体 齐迈星\n", + "创建实体 白敬宇制药氨茶碱片\n", + "创建实体 博康健制药盐酸氨溴索葡萄糖\n", + "创建实体 欣匹特\n", + "创建实体 锦华药业盐酸克林霉素胶囊\n", + "创建实体 恒安药业盐酸特比萘芬片\n", + "创建实体 润阳药业盐酸氨溴索葡萄糖注\n", + "创建实体 海南制药厂蛇胆川贝液\n", + "创建实体 百利药业阿奇霉素颗粒\n", + "创建实体 朗瑞\n", + "创建实体 尤金\n", + "创建实体 西藏甘露仁青芒觉\n", + "创建实体 开林\n", + "创建实体 衡阳紫光古汉硝酸益康唑乳膏\n", + "创建实体 康美药业红霉素肠溶片\n", + "创建实体 双林生物人血白蛋白\n", + "创建实体 潇然\n", + "创建实体 澳利达奈德注射用盐酸溴己新\n", + "创建实体 安必君氨苄西林胶囊\n", + "创建实体 江苏长江阿奇霉素胶囊\n", + "创建实体 上海新亚头孢克肟分散片\n", + "创建实体 永定制药百咳静糖浆\n", + "创建实体 全星制药注射用布美他尼\n", + "创建实体 遂成药业地塞米松磷酸钠注射\n", + "创建实体 辽宁海思科注射用甲泼尼龙琥\n", + "创建实体 哈药总厂头孢氨苄甲氧苄啶片\n", + "创建实体 石药欧意红霉素肠溶片\n", + "创建实体 天方药业盐酸克林霉素胶囊\n", + "创建实体 唐山红星硝酸益康唑溶液\n", + "创建实体 江西诚志永丰蛇胆川贝液\n", + "创建实体 联邦左福康盐酸左氧氟沙星胶\n", + "创建实体 东药替硝唑片\n", + "创建实体 天丁噻托溴铵粉雾剂\n", + "创建实体 埃斯玛隆\n", + "创建实体 二天堂联苯苄唑乳膏\n", + "创建实体 振兴氨茶碱片\n", + "创建实体 申优\n", + "创建实体 亨瑞达制药甲硝唑片\n", + "创建实体 斯皮仁诺\n", + "创建实体 健生制药阿奇霉素分散片\n", + "创建实体 大连天宇制药阿奇霉素胶囊\n", + "创建实体 银诺克肺宝蛤蚧定喘丸\n", + "创建实体 大连药业托西酸舒他西林胶囊\n", + "创建实体 卓峰地塞米松磷酸钠注射液\n", + "创建实体 杭州民生药业盐酸克林霉素胶\n", + "创建实体 国药国瑞注射用盐酸溴己新\n", + "创建实体 丽珠制药替硝唑片\n", + "创建实体 新亚闵行盐酸克林霉素胶囊\n", + "创建实体 曲靖药业白及颗粒\n", + "创建实体 博利康尼\n", + "创建实体 德远药业雷公藤多苷片\n", + "创建实体 东新药业百咳静糖浆\n", + "创建实体 白云山天心地塞米松磷酸钠注\n", + "创建实体 海斯制药盐酸利多卡因注射液\n", + "创建实体 甲硝唑片\n", + "创建实体 康正药业硝酸咪康唑乳膏\n", + "创建实体 东信药业琥乙红霉素颗粒\n", + "创建实体 利君制药阿奇霉素分散片\n", + "创建实体 一品红注射用盐酸溴己新\n", + "创建实体 天天乐药业蛇胆川贝液\n", + "创建实体 首儿药厂小青龙颗粒\n", + "创建实体 东药阿奇霉素胶囊\n", + "创建实体 帮备\n", + "创建实体 丰原制药注射用盐酸溴己新\n", + "创建实体 星斗药业盐酸克林霉素胶囊\n", + "创建实体 赛乐欣\n", + "创建实体 台城制药盐酸克林霉素胶囊\n", + "创建实体 萨兰欣\n", + "创建实体 北海阳光药业阿奇霉素颗粒\n", + "创建实体 智同生物注射用盐酸溴己新\n", + "创建实体 海王阿奇霉素片\n", + "创建实体 鲁抗赛特替硝唑片\n", + "创建实体 泰邦生物人血白蛋白\n", + "创建实体 福建太平洋制药酮康唑乳膏\n", + "创建实体 金路捷\n", + "创建实体 倍佳\n", + "创建实体 皇隆制药注射用呋塞米\n", + "创建实体 松泰斯\n", + "创建实体 国医堂制药如意定喘丸\n", + "创建实体 罗欣药业注射用盐酸头孢替安\n", + "创建实体 海力制药替硝唑片\n", + "创建实体 五洲通药业硝酸咪康唑乳膏\n", + "创建实体 康普药业盐酸克林霉素胶囊\n", + "创建实体 宜昌长江乳酸左氧氟沙星片\n", + "创建实体 皇象铁力蓝天甲硝唑维B6片\n", + "创建实体 亚太药业盐酸克林霉素胶囊\n", + "创建实体 纽兰药业小青龙合剂\n", + "创建实体 云门药业头孢氨苄甲氧苄啶片\n", + "创建实体 葵花药业得菲尔公司阿奇霉素\n", + "创建实体 普德药业注射用盐酸溴己新\n", + "创建实体 济安堂蛇胆川贝液\n", + "创建实体 鲁神乙酰螺旋霉素片\n", + "创建实体 山西康宝人血白蛋白\n", + "创建实体 仁和药业盐酸克林霉素胶囊\n", + "创建实体 龙泰制药化痰平喘片\n", + "创建实体 晶珠藏药蛇胆川贝液\n", + "创建实体 广春药业盐酸氨溴索葡萄糖注\n", + "创建实体 迪沙药业克霉唑阴道片\n", + "创建实体 海鲸药业注射用盐酸溴己新\n", + "创建实体 希舒美\n", + "创建实体 中国大冢盐酸利多卡因注射液\n", + "创建实体 可尔生\n", + "创建实体 达力芬\n", + "创建实体 广西灵峰药业蛇胆川贝液\n", + "创建实体 桑海制药喷托维林氯化铵糖浆\n", + "创建实体 福邦药业阿奇霉素胶囊\n", + "创建实体 吉林东方制药枸橼酸喷托维林\n", + "创建实体 易坦静\n", + "创建实体 思力华\n", + "创建实体 西岳制药托西酸舒他西林胶囊\n", + "创建实体 津华晖星甲硝唑片\n", + "创建实体 复旦复华雷公藤多苷片\n", + "创建实体 黄河药业盐酸克林霉素胶囊\n", + "创建实体 环科药业甲硝唑片\n", + "创建实体 科伦药业盐酸克林霉素胶囊\n", + "创建实体 黑龙江天龙药业联苯苄唑乳膏\n", + "创建实体 甲强龙\n", + "创建实体 彼迪药业替硝唑片\n", + "创建实体 利君制药红霉素肠溶片\n", + "创建实体 美通制药雷公藤多苷片\n", + "创建实体 万方制药肺气肿片\n", + "创建实体 白云山医药琥乙红霉素片\n", + "创建实体 潜江制药阿奇霉素颗粒\n", + "创建实体 信谊布地奈德气雾剂\n", + "创建实体 西藏甘露十一味金色丸\n", + "创建实体 莎普爱思盐酸氨溴索葡萄糖注\n", + "创建实体 贵州汉方药业雷公藤多苷片\n", + "创建实体 仙琚制药克霉唑阴道片\n", + "创建实体 银力舒\n", + "创建实体 辅仁药业阿奇霉素片\n", + "创建实体 安诺药业盐酸克林霉素胶囊\n", + "创建实体 华南药业红霉素肠溶片\n", + "创建实体 新峰药业盐酸利多卡因注射液\n", + "创建实体 兰花药业诺氟沙星胶囊\n", + "创建实体 武汉生物人血白蛋白\n", + "创建实体 三维康\n", + "创建实体 华瑞联合制药头孢氨苄甲氧苄\n", + "创建实体 海力制药阿奇霉素颗粒\n", + "创建实体 涟水制药地塞米松磷酸钠注射\n", + "创建实体 纽兰药业小青龙颗粒\n", + "创建实体 丽珠奇乐\n", + "创建实体 衡博来\n", + "创建实体 阿莫仙阿莫西林颗粒\n", + "创建实体 东信药业琥乙红霉素片\n", + "创建实体 金峰制药盐酸氨溴索葡萄糖注\n", + "创建实体 佳乐弗乳酸左氧氟沙星片\n", + "创建实体 沈阳一药替硝唑片\n", + "创建实体 莱士人血白蛋白\n", + "创建实体 达仁堂通宣理肺丸\n", + "创建实体 金耀药业注射用甲泼尼龙琥珀\n", + "创建实体 圣泰转移因子口服溶液\n", + "创建实体 盐酸利多卡因注射液\n", + "创建实体 米乐松\n", + "创建实体 邦琪药业百咳静糖浆\n", + "创建实体 蓉生药业人血白蛋白\n", + "创建实体 石药欧意枸橼酸喷托维林片\n", + "创建实体 彼迪药业阿奇霉素分散片\n", + "创建实体 迪龙制药胸腺肽肠溶片\n", + "创建实体 瑞尔医药盐酸班布特罗片\n", + "创建实体 锋替新\n", + "创建实体 天津力生制药硫酸沙丁胺醇片\n", + "创建实体 恒益药业琥乙红霉素颗粒\n", + "创建实体 伏枝\n", + "创建实体 唐山红星硝酸咪康唑乳膏\n", + "创建实体 康裕头孢氨苄胶囊\n", + "创建实体 珠海联邦头孢拉定胶囊\n", + "创建实体 孩尔欣头孢克洛颗粒\n", + "创建实体 陕西东泰制药复方蛤青胶囊\n", + "创建实体 万托林\n", + "创建实体 诺健\n", + "创建实体 石药欧意诺氟沙星胶囊\n", + "创建实体 傲群\n", + "创建实体 津华晖星替硝唑片\n", + "创建实体 东信药业阿奇霉素颗粒\n", + "创建实体 盛翔制药蛇胆川贝液\n", + "创建实体 俞氏阿奇霉素颗粒\n", + "创建实体 南通中华药业硝酸咪康唑乳膏\n", + "创建实体 石药欧意氨茶碱片\n", + "创建实体 广东华南依托红霉素片\n", + "创建实体 浙江南洋药业阿奇霉素胶囊\n", + "创建实体 鲁抗注射用头孢唑林钠\n", + "创建实体 同济堂制药盐酸克林霉素胶囊\n", + "创建实体 圣大(张家口)头孢氨苄甲氧\n", + "创建实体 搏沃欣\n", + "创建实体 重庆华邦制药注射用甲泼尼龙\n", + "创建实体 美卓乐\n", + "创建实体 安诺药业阿奇霉素分散片\n", + "创建实体 纽兰药业硝酸咪康唑栓\n", + "创建实体 白云山光华头孢氨苄甲氧苄啶\n", + "创建实体 飞云岭药业甲硝唑片\n", + "创建实体 湖南九典制药盐酸班布特罗胶\n", + "创建实体 新亚注射用硫代硫酸钠\n", + "创建实体 卫光生物人血白蛋白\n", + "创建实体 哈药总厂注射用磺苄西林钠\n", + "创建实体 赣南制药喷托维林氯化铵糖浆\n", + "创建实体 新陇海药业雷公藤多苷片\n", + "创建实体 运佳黄浦硝酸咪康唑乳膏\n", + "创建实体 北京同仁堂百咳静糖浆\n", + "创建实体 宜昌长江阿奇霉素分散片\n", + "创建实体 锦华药业诺氟沙星胶囊\n", + "创建实体 白云山光华盐酸克林霉素胶囊\n", + "创建实体 联邦安必仙氨苄西林胶囊\n", + "创建实体 赤峰维康托西酸舒他西林胶囊\n", + "创建实体 北京永康药业盐酸利多卡因注\n", + "创建实体 迪沙药业甲硝唑维B6片\n", + "创建实体 奇莫欣\n", + "创建实体 得恩德制药雷公藤多苷片\n", + "创建实体 南光注射用甲泼尼龙琥珀酸钠\n", + "创建实体 北京益民药业盐酸利多卡因注\n", + "创建实体 国瑞琥乙红霉素片\n", + "创建实体 头孢氨苄甲氧苄啶片\n", + "创建实体 注射用盐酸头孢替安\n", + "创建实体 普洛康裕天然药物雷公藤多苷\n", + "创建实体 利民制药阿奇霉素胶囊\n", + "创建实体 东药盐酸克林霉素胶囊\n", + "创建实体 诚信制药盐酸妥洛特罗片\n", + "创建实体 迪瑞制药琥乙红霉素颗粒\n", + "创建实体 桂林南药布美他尼片\n", + "创建实体 亮博\n", + "创建实体 北京中新制药琥乙红霉素片\n", + "创建实体 苏肽生\n", + "创建实体 复仙安\n", + "创建实体 利君沙\n", + "创建实体 哈药总厂托西酸舒他西林胶囊\n", + "创建实体 汉森制药甲硝唑片\n", + "创建实体 欣得生\n", + "创建实体 益佳清\n", + "创建实体 绿十字\n", + "创建实体 吉春制药硝酸咪康唑乳膏\n", + "创建实体 蛇胆川贝液\n", + "创建实体 锦华药业氯霉素片\n", + "创建实体 达发新\n", + "创建实体 汇仁药业阿奇霉素片\n", + "创建实体 人血白蛋白\n", + "创建实体 傲宁\n", + "创建实体 爱普森药业阿奇霉素片\n", + "创建实体 亚宝药业甲硝唑片\n", + "创建实体 华中药业甲硝唑片\n", + "创建实体 德源生物人血白蛋白\n", + "创建实体 北京京丰制药集团诺氟沙星胶\n", + "创建实体 金耀药业地塞米松磷酸钠注射\n", + "创建实体 云南白药云南花粉片\n", + "创建实体 广东卫伦人血白蛋白\n", + "创建实体 注射用磺苄西林钠\n", + "创建实体 六安华源制药盐酸氨溴索葡萄\n", + "创建实体 北京曙光药业红霉素肠溶片\n", + "创建实体 白云山医药诺氟沙星胶囊\n", + "创建实体 赣南海欣转移因子口服溶液\n", + "创建实体 七星山药业化痰平喘片\n", + "创建实体 雄巴拉曲神水十一味金色丸\n", + "创建实体 惠普森穿心莲内酯片\n", + "创建实体 迪诺制药替硝唑片\n", + "创建实体 康美药业甲硝唑片\n", + "创建实体 旺龙药业琥乙红霉素颗粒\n", + "创建实体 彼迪药业托西酸舒他西林胶囊\n", + "创建实体 河南羚锐制药盐酸克林霉素胶\n", + "创建实体 海斯制药注射用盐酸溴己新\n", + "创建实体 康美药业诺氟沙星胶囊\n", + "创建实体 维宏\n", + "创建实体 比利时辉瑞注射用甲泼尼龙琥\n", + "创建实体 湘江药业阿奇霉素颗粒\n", + "创建实体 恩经复\n", + "创建实体 明水药业头孢氨苄甲氧苄啶片\n", + "创建实体 吉尔吉药业喘嗽宁片\n", + "创建实体 鲁抗阿莫西林颗粒\n", + "创建实体 康良头孢拉定胶囊\n", + "创建实体 利君制药琥乙红霉素片\n", + "创建实体 吉春制药祛痰止咳胶囊\n", + "创建实体 远大医药黄石飞云制药雷公藤\n" + ] + } + ], + "source": [ + "for each in producers:\n", + " node = Node('Producer', name=each)\n", + " g.create(node)\n", + " print('创建实体 {}'.format(each))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 创建 症状 实体" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "创建实体 心源性呼吸窘迫\n", + "创建实体 闫铁\n", + "创建实体 胸痛\n", + "创建实体 头晕\n", + "创建实体 肺泡灌洗液可见...\n", + "创建实体 呕吐\n", + "创建实体 口唇青紫\n", + "创建实体 恶心\n", + "创建实体 纤毛上皮细胞损伤脱落\n", + "创建实体 抽搐\n", + "创建实体 咯血伴发热\n", + "创建实体 紧张性头晕\n", + "创建实体 痉挛性咳嗽\n", + "创建实体 痰呈粘液脓性\n", + "创建实体 发烧\n", + "创建实体 肺纤维化\n", + "创建实体 昏迷\n", + "创建实体 眼睛痒\n", + "创建实体 谵妄\n", + "创建实体 目赤\n", + "创建实体 紫绀\n", + "创建实体 喘息\n", + "创建实体 急性面容\n", + "创建实体 纵隔浊音界扩大\n", + "创建实体 腹泻\n", + "创建实体 盗汗\n", + "创建实体 黏稠或脓性痰伴...\n", + "创建实体 体重减轻\n", + "创建实体 惊厥\n", + "创建实体 气急\n", + "创建实体 肺部出血\n", + "创建实体 横膈低平\n", + "创建实体 蛋白尿\n", + "创建实体 咽部异物感\n", + "创建实体 间歇性头痛\n", + "创建实体 肺部啰音\n", + "创建实体 骨膜炎\n", + "创建实体 乏力\n", + "创建实体 紧张性头痛\n", + "创建实体 嗜酸性粒细胞增多\n", + "创建实体 肺阴虚\n", + "创建实体 吸气时有蝉鸣音\n", + "创建实体 出生后即有持续青紫\n", + "创建实体 间歇性头晕\n", + "创建实体 肺泡炎症\n", + "创建实体 咳铁锈色痰\n", + "创建实体 鼻塞\n", + "创建实体 变应性咳嗽\n", + "创建实体 肺纹理增粗\n", + "创建实体 面色青紫\n", + "创建实体 低热\n", + "创建实体 哮鸣音\n", + "创建实体 桶状胸\n", + "创建实体 闫鹏辉\n", + "创建实体 痰中带血丝\n", + "创建实体 咳嗽伴胸痛\n", + "创建实体 冬春季的慢性咳...\n", + "创建实体 多发性神经炎\n", + "创建实体 呼吸困难\n", + "创建实体 小支气管粘膜水肿\n", + "创建实体 气短\n", + "创建实体 咳出棕色痰栓\n", + "创建实体 腱反射消失\n", + "创建实体 感觉障碍\n", + "创建实体 湿啰音\n", + "创建实体 毓卓\n", + "创建实体 胸闷憋气\n", + "创建实体 咯血\n", + "创建实体 发热伴咳嗽、咯...\n", + "创建实体 化学性支气管炎\n", + "创建实体 咳嗽伴哮鸣音\n", + "创建实体 呼气音延长\n", + "创建实体 胸闷\n", + "创建实体 口唇和甲床略带青紫\n", + "创建实体 浅感觉减退或缺失\n", + "创建实体 畏寒\n", + "创建实体 呼吸音减弱\n", + "创建实体 耸肩喘息\n" + ] + } + ], + "source": [ + "for each in symptoms:\n", + " node = Node('Symptom', name=each)\n", + " g.create(node)\n", + " print('创建实体 {}'.format(each))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 创建知识图谱关系(连接、边)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 样例代码" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [], + "source": [ + "# # Neo4j样例代码\n", + "\n", + "# # 删除所有实体和关系\n", + "# cypher = 'MATCH (n) DETACH DELETE n'\n", + "# g.run(cypher)" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [], + "source": [ + "# # 创建关系 样例代码\n", + "# start_node = 'Disease'\n", + "# end_node = 'Check'\n", + "# p = '百日咳'\n", + "# q = '血常规'\n", + "# rel_type = 'need_check'\n", + "# rel_name = '诊断检查'\n", + "\n", + "# # Cypher语句\n", + "# query = \"match(p:%s),(q:%s) where p.name='%s' and q.name='%s' create (p)-[rel:%s{name:'%s'}]->(q)\" % (start_node, end_node, p, q, rel_type, rel_name)\n", + "# print(query)\n", + "# g.run(query) # 运行 Cypher 语句\n" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [], + "source": [ + "def create_relationship(start_node, end_node, edges, rel_type, rel_name):\n", + " '''创建关系函数'''\n", + " for edge in edges:\n", + " p = edge[0]\n", + " q = edge[1]\n", + " # 创建关系的 Cypher 语句\n", + " query = \"match(p:%s),(q:%s) where p.name='%s' and q.name='%s' create (p)-[rel:%s{name:'%s'}]->(q)\" % (start_node, end_node, p, q, rel_type, rel_name)\n", + " try:\n", + " g.run(query) # 运行 Cypher 语句\n", + " print('创建关系 {}-{}->{}'.format(p, rel_type, q))\n", + " except Exception as e:\n", + " print(e)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 创建所有关系" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "创建关系 百日咳-recommand_eat->清蒸鸡蛋羹\n", + "创建关系 百日咳-recommand_eat->百合双耳鸡蛋羹\n", + "创建关系 百日咳-recommand_eat->排骨汤\n", + "创建关系 百日咳-recommand_eat->罗汉果雪耳鸡汤\n", + "创建关系 百日咳-recommand_eat->小黄瓜凉拌面\n", + "创建关系 百日咳-recommand_eat->黄瓜三丝汤\n", + "创建关系 百日咳-recommand_eat->黄瓜拌兔丝\n", + "创建关系 百日咳-recommand_eat->黄瓜拌皮丝\n", + "创建关系 苯中毒-recommand_eat->豆腐干炒韭菜\n", + "创建关系 苯中毒-recommand_eat->素炒小白菜\n", + "创建关系 苯中毒-recommand_eat->白菜蛋花粥\n", + "创建关系 喘息样支气管炎-recommand_eat->紫苏粥\n", + "创建关系 喘息样支气管炎-recommand_eat->菊花芦根茶\n", + "创建关系 喘息样支气管炎-recommand_eat->生芦根粥\n", + "创建关系 喘息样支气管炎-recommand_eat->鲜芦根粥\n", + "创建关系 喘息样支气管炎-recommand_eat->薏仁党参粥\n", + "创建关系 喘息样支气管炎-recommand_eat->党参粥\n", + "创建关系 喘息样支气管炎-recommand_eat->黄芪粥\n", + "创建关系 喘息样支气管炎-recommand_eat->鸡蛋木耳粥\n", + "创建关系 成人呼吸窘迫综合征-recommand_eat->百合糖粥\n", + "创建关系 成人呼吸窘迫综合征-recommand_eat->百合粥\n", + "创建关系 成人呼吸窘迫综合征-recommand_eat->百合花生汤\n", + "创建关系 成人呼吸窘迫综合征-recommand_eat->首乌百合粥\n", + "创建关系 成人呼吸窘迫综合征-recommand_eat->薏米莲子粥\n", + "创建关系 成人呼吸窘迫综合征-recommand_eat->牛奶玉米汤\n", + "创建关系 成人呼吸窘迫综合征-recommand_eat->萝卜豆腐汤\n", + "创建关系 成人呼吸窘迫综合征-recommand_eat->瓜粒杂锦汤\n", + "创建关系 大叶性肺炎-recommand_eat->奶汤锅子鱼\n", + "创建关系 大叶性肺炎-recommand_eat->酱豆腐汁烧猪肉\n", + "创建关系 大叶性肺炎-recommand_eat->百合汤\n", + "创建关系 大叶性肺炎-recommand_eat->山楂百合汤\n", + "创建关系 大叶性肺炎-recommand_eat->番茄鸡蛋煎饼\n", + "创建关系 大叶性肺炎-recommand_eat->凉拌番茄\n", + "创建关系 大叶性肺炎-recommand_eat->番茄猪肝瘦肉汤\n", + "创建关系 大叶性肺炎-recommand_eat->番茄牛肉\n", + "创建关系 大楼病综合征-recommand_eat->生姜乌梅饮\n", + "创建关系 大楼病综合征-recommand_eat->乌梅粥\n", + "创建关系 大楼病综合征-recommand_eat->山楂乌梅饮\n", + "创建关系 大楼病综合征-recommand_eat->山楂红糖粥\n", + "创建关系 大楼病综合征-recommand_eat->山楂桑椹粥\n", + "创建关系 二硫化碳中毒-recommand_eat->小麦粥\n", + "创建关系 二硫化碳中毒-recommand_eat->荞麦粥\n", + "创建关系 二硫化碳中毒-recommand_eat->杂粮粥\n", + "创建关系 二硫化碳中毒-recommand_eat->蔬菜杂烩粥\n", + "创建关系 二硫化碳中毒-recommand_eat->花生杏仁粥\n", + "创建关系 二硫化碳中毒-recommand_eat->豆薯小米粥\n", + "创建关系 二硫化碳中毒-recommand_eat->羊腩萝卜丝粥\n", + "创建关系 二硫化碳中毒-recommand_eat->绿豆南瓜汤\n", + "创建关系 肺出血-肾炎综合征-recommand_eat->肉末冬瓜\n", + "创建关系 肺出血-肾炎综合征-recommand_eat->肉松\n", + "创建关系 肺出血-肾炎综合征-recommand_eat->五丝白菜卷\n", + "创建关系 肺出血-肾炎综合征-recommand_eat->拌肚丝白菜\n", + "创建关系 肺出血-肾炎综合征-recommand_eat->冬菇烧白菜\n", + "创建关系 肺出血-肾炎综合征-recommand_eat->水萝卜丝拌白菜\n", + "创建关系 肺出血-肾炎综合征-recommand_eat->珊瑚白菜墩\n", + "创建关系 肺出血-肾炎综合征-recommand_eat->素炒小白菜\n", + "创建关系 肺放线菌病-recommand_eat->番茄西米粥\n", + "创建关系 肺放线菌病-recommand_eat->番茄牛肉片\n", + "创建关系 肺放线菌病-recommand_eat->番茄羊肉汤\n", + "创建关系 肺放线菌病-recommand_eat->番茄羊肉蛋花汤\n", + "创建关系 肺放线菌病-recommand_eat->番茄皮蛋汤\n", + "创建关系 肺放线菌病-recommand_eat->百合炒芦笋\n", + "创建关系 肺放线菌病-recommand_eat->百合炖猪蹄\n", + "创建关系 肺放线菌病-recommand_eat->鲜百合烧肉\n", + "创建关系 肺曲菌病-recommand_eat->银耳粥\n", + "创建关系 肺曲菌病-recommand_eat->鸭梨粥\n", + "创建关系 肺曲菌病-recommand_eat->雪梨饮\n", + "创建关系 肺曲菌病-recommand_eat->川贝酿梨\n", + "创建关系 肺曲菌病-recommand_eat->北杏炖雪梨\n", + "创建关系 肺曲菌病-recommand_eat->红枣银耳粥\n", + "创建关系 肺曲菌病-recommand_eat->冰糖银耳羹\n", + "创建关系 肺曲菌病-recommand_eat->椰子银耳煲鸽汤\n", + "创建关系 放射性肺炎-recommand_eat->杂粮粥\n", + "创建关系 放射性肺炎-recommand_eat->蔬菜杂烩粥\n", + "创建关系 放射性肺炎-recommand_eat->小麦粥\n", + "创建关系 放射性肺炎-recommand_eat->虾皮香芹燕麦粥\n", + "创建关系 放射性肺炎-recommand_eat->荞麦粥\n", + "创建关系 放射性肺炎-recommand_eat->花生杏仁粥\n", + "创建关系 放射性肺炎-recommand_eat->豆薯小米粥\n", + "创建关系 放射性肺炎-recommand_eat->萝卜豆腐汤\n", + "创建关系 肺念珠菌病-recommand_eat->小麦粥\n", + "创建关系 肺念珠菌病-recommand_eat->荞麦粥\n", + "创建关系 肺念珠菌病-recommand_eat->杂粮粥\n", + "创建关系 肺念珠菌病-recommand_eat->蔬菜杂烩粥\n", + "创建关系 肺念珠菌病-recommand_eat->豆薯小米粥\n", + "创建关系 肺念珠菌病-recommand_eat->花生杏仁粥\n", + "创建关系 肺念珠菌病-recommand_eat->冬瓜草鱼汤\n", + "创建关系 肺念珠菌病-recommand_eat->三鲜冬瓜汤\n", + "创建关系 肺炎球菌肺炎-recommand_eat->小黄瓜凉拌面\n", + "创建关系 肺炎球菌肺炎-recommand_eat->黄瓜三丝汤\n", + "创建关系 肺炎球菌肺炎-recommand_eat->水萝卜拌黄瓜\n", + "创建关系 肺炎球菌肺炎-recommand_eat->黄瓜拌豆腐丝\n", + "创建关系 肺炎球菌肺炎-recommand_eat->黄瓜拌香菜\n", + "创建关系 肺炎球菌肺炎-recommand_eat->小黄瓜西瓜汁\n", + "创建关系 肺炎球菌肺炎-recommand_eat->五丝白菜卷\n", + "创建关系 肺炎球菌肺炎-recommand_eat->玉竹白菜\n", + "创建关系 肺气肿-recommand_eat->糖醋草鱼\n", + "创建关系 肺气肿-recommand_eat->炖白鲢鱼\n", + "创建关系 肺气肿-recommand_eat->红烧鲢鱼\n", + "创建关系 肺气肿-recommand_eat->泡莲藕\n", + "创建关系 肺气肿-recommand_eat->凉拌莲藕\n", + "创建关系 肺气肿-recommand_eat->山楂糕\n", + "创建关系 肺气肿-recommand_eat->百合汁\n", + "创建关系 肺气肿-recommand_eat->百合粥\n", + "创建关系 肺炎杆菌肺炎-recommand_eat->番茄鸡蛋煎饼\n", + "创建关系 肺炎杆菌肺炎-recommand_eat->番茄芹菜汁\n", + "创建关系 肺炎杆菌肺炎-recommand_eat->番茄汁\n", + "创建关系 肺炎杆菌肺炎-recommand_eat->锅塌番茄\n", + "创建关系 肺炎杆菌肺炎-recommand_eat->意式番茄牛肉凉面\n", + "创建关系 肺炎杆菌肺炎-recommand_eat->番茄牛肉\n", + "创建关系 肺炎杆菌肺炎-recommand_eat->番茄三素\n", + "创建关系 肺炎杆菌肺炎-recommand_eat->番茄苹果芝麻蜜\n", + "创建关系 百日咳-no_eat->螃蟹\n", + "创建关系 百日咳-no_eat->海蟹\n", + "创建关系 百日咳-no_eat->海虾\n", + "创建关系 百日咳-no_eat->海螺\n", + "创建关系 苯中毒-no_eat->海蟹\n", + "创建关系 苯中毒-no_eat->海虾\n", + "创建关系 苯中毒-no_eat->海参(水浸)\n", + "创建关系 苯中毒-no_eat->辣椒(青、尖)\n", + "创建关系 喘息样支气管炎-no_eat->海蟹\n", + "创建关系 喘息样支气管炎-no_eat->海虾\n", + "创建关系 喘息样支气管炎-no_eat->海螺\n", + "创建关系 喘息样支气管炎-no_eat->猪肉(肥瘦)\n", + "创建关系 成人呼吸窘迫综合征-no_eat->啤酒\n", + "创建关系 成人呼吸窘迫综合征-no_eat->白酒\n", + "创建关系 成人呼吸窘迫综合征-no_eat->洋葱\n", + "创建关系 成人呼吸窘迫综合征-no_eat->辣椒(红、尖、干)\n", + "创建关系 大叶性肺炎-no_eat->洋葱\n", + "创建关系 大叶性肺炎-no_eat->辣椒(青、尖)\n", + "创建关系 大叶性肺炎-no_eat->辣椒(红、尖、干)\n", + "创建关系 大叶性肺炎-no_eat->韭菜\n", + "创建关系 大楼病综合征-no_eat->洋葱\n", + "创建关系 大楼病综合征-no_eat->辣椒(青、尖)\n", + "创建关系 大楼病综合征-no_eat->辣椒(红、尖、干)\n", + "创建关系 大楼病综合征-no_eat->韭菜\n", + "创建关系 二硫化碳中毒-no_eat->啤酒\n", + "创建关系 二硫化碳中毒-no_eat->白酒\n", + "创建关系 二硫化碳中毒-no_eat->洋葱\n", + "创建关系 二硫化碳中毒-no_eat->辣椒(红、尖、干)\n", + "创建关系 肺出血-肾炎综合征-no_eat->竹笋\n", + "创建关系 肺出血-肾炎综合征-no_eat->辣椒(青、尖)\n", + "创建关系 肺出血-肾炎综合征-no_eat->辣椒(红、尖、干)\n", + "创建关系 肺出血-肾炎综合征-no_eat->韭菜\n", + "创建关系 肺放线菌病-no_eat->啤酒\n", + "创建关系 肺放线菌病-no_eat->白酒\n", + "创建关系 肺放线菌病-no_eat->狗肉\n", + "创建关系 肺放线菌病-no_eat->洋葱\n", + "创建关系 肺曲菌病-no_eat->啤酒\n", + "创建关系 肺曲菌病-no_eat->白酒\n", + "创建关系 肺曲菌病-no_eat->洋葱\n", + "创建关系 肺曲菌病-no_eat->韭菜\n", + "创建关系 放射性肺炎-no_eat->白酒\n", + "创建关系 放射性肺炎-no_eat->洋葱\n", + "创建关系 放射性肺炎-no_eat->辣椒(红、尖、干)\n", + "创建关系 放射性肺炎-no_eat->大蒜\n", + "创建关系 肺念珠菌病-no_eat->啤酒\n", + "创建关系 肺念珠菌病-no_eat->白酒\n", + "创建关系 肺念珠菌病-no_eat->空心菜\n", + "创建关系 肺念珠菌病-no_eat->奶油\n", + "创建关系 肺炎球菌肺炎-no_eat->啤酒\n", + "创建关系 肺炎球菌肺炎-no_eat->白酒\n", + "创建关系 肺炎球菌肺炎-no_eat->辣椒(红、尖、干)\n", + "创建关系 肺炎球菌肺炎-no_eat->咖啡\n", + "创建关系 肺气肿-no_eat->海虾\n", + "创建关系 肺气肿-no_eat->带鱼\n", + "创建关系 肺气肿-no_eat->羊肉(瘦)\n", + "创建关系 肺气肿-no_eat->圆白菜\n", + "创建关系 肺炎杆菌肺炎-no_eat->鱼腥草\n", + "创建关系 肺炎杆菌肺炎-no_eat->洋葱\n", + "创建关系 肺炎杆菌肺炎-no_eat->香菜\n", + "创建关系 肺炎杆菌肺炎-no_eat->辣椒(青、尖)\n", + "创建关系 百日咳-do_eat->南瓜子仁\n", + "创建关系 百日咳-do_eat->圆白菜\n", + "创建关系 百日咳-do_eat->樱桃番茄\n", + "创建关系 百日咳-do_eat->小白菜\n", + "创建关系 苯中毒-do_eat->鸡蛋\n", + "创建关系 苯中毒-do_eat->大豆\n", + "创建关系 苯中毒-do_eat->猪肉(瘦)\n", + "创建关系 苯中毒-do_eat->樱桃番茄\n", + "创建关系 喘息样支气管炎-do_eat->鸡蛋\n", + "创建关系 喘息样支气管炎-do_eat->海蚌\n", + "创建关系 喘息样支气管炎-do_eat->赤贝\n", + "创建关系 喘息样支气管炎-do_eat->圆白菜\n", + "创建关系 成人呼吸窘迫综合征-do_eat->莲子\n", + "创建关系 成人呼吸窘迫综合征-do_eat->生菜\n", + "创建关系 成人呼吸窘迫综合征-do_eat->山药\n", + "创建关系 成人呼吸窘迫综合征-do_eat->空心菜\n", + "创建关系 大叶性肺炎-do_eat->栗子(熟)\n", + "创建关系 大叶性肺炎-do_eat->鲫鱼\n", + "创建关系 大叶性肺炎-do_eat->猪肉(瘦)\n", + "创建关系 大叶性肺炎-do_eat->油菜\n", + "创建关系 大楼病综合征-do_eat->圆白菜\n", + "创建关系 大楼病综合征-do_eat->小白菜\n", + "创建关系 大楼病综合征-do_eat->生菜\n", + "创建关系 大楼病综合征-do_eat->空心菜\n", + "创建关系 二硫化碳中毒-do_eat->生菜\n", + "创建关系 二硫化碳中毒-do_eat->南瓜\n", + "创建关系 二硫化碳中毒-do_eat->苦瓜\n", + "创建关系 二硫化碳中毒-do_eat->空心菜\n", + "创建关系 肺出血-肾炎综合征-do_eat->茄子\n", + "创建关系 肺出血-肾炎综合征-do_eat->空心菜\n", + "创建关系 肺出血-肾炎综合征-do_eat->茭白\n", + "创建关系 肺出血-肾炎综合征-do_eat->番茄\n", + "创建关系 肺放线菌病-do_eat->油菜\n", + "创建关系 肺放线菌病-do_eat->生菜\n", + "创建关系 肺放线菌病-do_eat->南瓜\n", + "创建关系 肺放线菌病-do_eat->空心菜\n", + "创建关系 肺曲菌病-do_eat->鸡蛋\n", + "创建关系 肺曲菌病-do_eat->鲤鱼\n", + "创建关系 肺曲菌病-do_eat->鲫鱼\n", + "创建关系 肺曲菌病-do_eat->油麦菜\n", + "创建关系 放射性肺炎-do_eat->莲子\n", + "创建关系 放射性肺炎-do_eat->豆浆\n", + "创建关系 放射性肺炎-do_eat->生菜\n", + "创建关系 放射性肺炎-do_eat->南瓜\n", + "创建关系 肺念珠菌病-do_eat->鸡蛋清\n", + "创建关系 肺念珠菌病-do_eat->鸡\n", + "创建关系 肺念珠菌病-do_eat->杏仁\n", + "创建关系 肺念珠菌病-do_eat->核桃\n", + "创建关系 肺炎球菌肺炎-do_eat->鸡蛋\n", + "创建关系 肺炎球菌肺炎-do_eat->鲈鱼\n", + "创建关系 肺炎球菌肺炎-do_eat->鲢鱼\n", + "创建关系 肺炎球菌肺炎-do_eat->鲤鱼\n", + "创建关系 肺气肿-do_eat->鹿肉\n", + "创建关系 肺气肿-do_eat->鸡肝\n", + "创建关系 肺气肿-do_eat->杏仁\n", + "创建关系 肺气肿-do_eat->松子仁\n", + "创建关系 肺炎杆菌肺炎-do_eat->鹿肉\n", + "创建关系 肺炎杆菌肺炎-do_eat->鸡蛋\n", + "创建关系 肺炎杆菌肺炎-do_eat->鸡肝\n", + "创建关系 肺炎杆菌肺炎-do_eat->杏仁\n", + "创建关系 呼吸内科-belongs_to->内科\n", + "创建关系 小儿内科-belongs_to->儿科\n", + "创建关系 其他综合-belongs_to->其他科室\n", + "创建关系 百日咳-common_drug->穿心莲内酯片\n", + "创建关系 百日咳-common_drug->百咳静糖浆\n", + "创建关系 苯中毒-common_drug->布美他尼片\n", + "创建关系 苯中毒-common_drug->十一味金色丸\n", + "创建关系 喘息样支气管炎-common_drug->布地奈德气雾剂\n", + "创建关系 喘息样支气管炎-common_drug->喷托维林氯化铵糖浆\n", + "创建关系 成人呼吸窘迫综合征-common_drug->人血白蛋白\n", + "创建关系 成人呼吸窘迫综合征-common_drug->注射用还原型谷胱甘肽钠\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-common_drug->头孢泊肟酯胶囊\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-common_drug->头孢氨苄甲氧苄啶片\n", + "创建关系 大叶性肺炎-common_drug->乳酸左氧氟沙星片\n", + "创建关系 大叶性肺炎-common_drug->阿奇霉素片\n", + "创建关系 大楼病综合征-common_drug->云南花粉片\n", + "创建关系 大楼病综合征-common_drug->注射用盐酸溴己新\n", + "创建关系 二硫化碳中毒-common_drug->布美他尼片\n", + "创建关系 二硫化碳中毒-common_drug->十一味金色丸\n", + "创建关系 肺-胸膜阿米巴病-common_drug->甲硝唑片\n", + "创建关系 肺-胸膜阿米巴病-common_drug->替硝唑片\n", + "创建关系 肺出血-肾炎综合征-common_drug->雷公藤多苷片\n", + "创建关系 肺出血-肾炎综合征-common_drug->甲泼尼龙片\n", + "创建关系 肺放线菌病-common_drug->盐酸克林霉素棕榈酸酯分散片\n", + "创建关系 肺放线菌病-common_drug->盐酸克林霉素胶囊\n", + "创建关系 肺曲菌病-common_drug->乳酸左氧氟沙星片\n", + "创建关系 肺曲菌病-common_drug->阿奇霉素片\n", + "创建关系 放射性肺炎-common_drug->乳酸左氧氟沙星片\n", + "创建关系 放射性肺炎-common_drug->阿奇霉素片\n", + "创建关系 肺念珠菌病-common_drug->转移因子口服溶液\n", + "创建关系 肺念珠菌病-common_drug->克霉唑阴道片\n", + "创建关系 肺炎球菌肺炎-common_drug->阿奇霉素片\n", + "创建关系 肺炎球菌肺炎-common_drug->阿奇霉素分散片\n", + "创建关系 肺气肿-common_drug->噻托溴铵粉雾剂\n", + "创建关系 肺气肿-common_drug->氨茶碱片\n", + "创建关系 肺炎杆菌肺炎-common_drug->头孢氨苄胶囊\n", + "创建关系 肺炎杆菌肺炎-common_drug->盐酸左氧氟沙星胶囊\n", + "创建关系 惠普森穿心莲内酯片-drugs_of->穿心莲内酯片\n", + "创建关系 北京同仁堂百咳静糖浆-drugs_of->百咳静糖浆\n", + "创建关系 邦琪药业百咳静糖浆-drugs_of->百咳静糖浆\n", + "创建关系 东新药业百咳静糖浆-drugs_of->百咳静糖浆\n", + "创建关系 达发新-drugs_of->环酯红霉素片\n", + "创建关系 康美药业红霉素肠溶片-drugs_of->红霉素肠溶片\n", + "创建关系 旺龙药业琥乙红霉素颗粒-drugs_of->琥乙红霉素颗粒\n", + "创建关系 白云山医药琥乙红霉素片-drugs_of->琥乙红霉素片\n", + "创建关系 国瑞琥乙红霉素片-drugs_of->琥乙红霉素片\n", + "创建关系 利君制药红霉素肠溶片-drugs_of->红霉素肠溶片\n", + "创建关系 东信药业琥乙红霉素颗粒-drugs_of->琥乙红霉素颗粒\n", + "创建关系 石药欧意红霉素肠溶片-drugs_of->红霉素肠溶片\n", + "创建关系 平光制药红霉素肠溶片-drugs_of->红霉素肠溶片\n", + "创建关系 北京曙光药业红霉素肠溶片-drugs_of->红霉素肠溶片\n", + "创建关系 迪瑞制药琥乙红霉素颗粒-drugs_of->琥乙红霉素颗粒\n", + "创建关系 永定制药百咳静糖浆-drugs_of->百咳静糖浆\n", + "创建关系 东信药业琥乙红霉素片-drugs_of->琥乙红霉素片\n", + "创建关系 利君制药琥乙红霉素片-drugs_of->琥乙红霉素片\n", + "创建关系 北京中新制药琥乙红霉素片-drugs_of->琥乙红霉素片\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "创建关系 华南药业红霉素肠溶片-drugs_of->红霉素肠溶片\n", + "创建关系 佐今明百咳静糖浆-drugs_of->百咳静糖浆\n", + "创建关系 恒益药业琥乙红霉素颗粒-drugs_of->琥乙红霉素颗粒\n", + "创建关系 利君沙-drugs_of->琥乙红霉素颗粒\n", + "创建关系 桂林南药布美他尼片-drugs_of->布美他尼片\n", + "创建关系 雄巴拉曲神水十一味金色丸-drugs_of->十一味金色丸\n", + "创建关系 西藏甘露仁青芒觉-drugs_of->仁青芒觉\n", + "创建关系 金诃藏药大月晶丸-drugs_of->大月晶丸\n", + "创建关系 金诃藏药仁青芒觉-drugs_of->仁青芒觉\n", + "创建关系 苏肽生-drugs_of->注射用鼠神经生长因子\n", + "创建关系 新峰药业盐酸利多卡因注射液-drugs_of->盐酸利多卡因注射液\n", + "创建关系 海斯制药盐酸利多卡因注射液-drugs_of->盐酸利多卡因注射液\n", + "创建关系 西藏甘露十一味金色丸-drugs_of->十一味金色丸\n", + "创建关系 卓峰地塞米松磷酸钠注射液-drugs_of->地塞米松磷酸钠注射液\n", + "创建关系 白云山天心地塞米松磷酸钠注-drugs_of->地塞米松磷酸钠注射液\n", + "创建关系 涟水制药地塞米松磷酸钠注射-drugs_of->地塞米松磷酸钠注射液\n", + "创建关系 金耀药业地塞米松磷酸钠注射-drugs_of->地塞米松磷酸钠注射液\n", + "创建关系 遂成药业地塞米松磷酸钠注射-drugs_of->地塞米松磷酸钠注射液\n", + "创建关系 恩经复-drugs_of->注射用鼠神经生长因子\n", + "创建关系 金路捷-drugs_of->注射用鼠神经生长因子\n", + "创建关系 新亚注射用硫代硫酸钠-drugs_of->注射用硫代硫酸钠\n", + "创建关系 北京永康药业盐酸利多卡因注-drugs_of->盐酸利多卡因注射液\n", + "创建关系 北京益民药业盐酸利多卡因注-drugs_of->盐酸利多卡因注射液\n", + "创建关系 中国大冢盐酸利多卡因注射液-drugs_of->盐酸利多卡因注射液\n", + "创建关系 盐酸利多卡因注射液-drugs_of->盐酸利多卡因注射液\n", + "创建关系 全星制药注射用布美他尼-drugs_of->注射用布美他尼\n", + "创建关系 皇隆制药注射用呋塞米-drugs_of->注射用呋塞米\n", + "创建关系 信谊布地奈德气雾剂-drugs_of->布地奈德气雾剂\n", + "创建关系 桑海制药喷托维林氯化铵糖浆-drugs_of->喷托维林氯化铵糖浆\n", + "创建关系 赣南制药喷托维林氯化铵糖浆-drugs_of->喷托维林氯化铵糖浆\n", + "创建关系 奇莫欣-drugs_of->胸腺肽肠溶片\n", + "创建关系 振兴氨茶碱片-drugs_of->氨茶碱片\n", + "创建关系 盛翔制药蛇胆川贝液-drugs_of->蛇胆川贝液\n", + "创建关系 蛇胆川贝液-drugs_of->蛇胆川贝液\n", + "创建关系 晶珠藏药蛇胆川贝液-drugs_of->蛇胆川贝液\n", + "创建关系 天天乐药业蛇胆川贝液-drugs_of->蛇胆川贝液\n", + "创建关系 东信药业蛇胆川贝液-drugs_of->蛇胆川贝液\n", + "创建关系 广西灵峰药业蛇胆川贝液-drugs_of->蛇胆川贝液\n", + "创建关系 吉林东方制药枸橼酸喷托维林-drugs_of->枸橼酸喷托维林片\n", + "创建关系 万托林-drugs_of->硫酸沙丁胺醇气雾剂\n", + "创建关系 天津太平洋二羟丙茶碱片-drugs_of->二羟丙茶碱片\n", + "创建关系 海南制药厂蛇胆川贝液-drugs_of->蛇胆川贝液\n", + "创建关系 首儿药厂小青龙颗粒-drugs_of->小青龙颗粒\n", + "创建关系 石药欧意枸橼酸喷托维林片-drugs_of->枸橼酸喷托维林片\n", + "创建关系 纽兰药业小青龙颗粒-drugs_of->小青龙颗粒\n", + "创建关系 纽兰药业小青龙合剂-drugs_of->小青龙合剂\n", + "创建关系 济安堂蛇胆川贝液-drugs_of->蛇胆川贝液\n", + "创建关系 迪龙制药胸腺肽肠溶片-drugs_of->胸腺肽肠溶片\n", + "创建关系 天津力生制药硫酸沙丁胺醇片-drugs_of->硫酸沙丁胺醇片\n", + "创建关系 仁和堂硫酸沙丁胺醇片-drugs_of->硫酸沙丁胺醇片\n", + "创建关系 莱士人血白蛋白-drugs_of->人血白蛋白\n", + "创建关系 卫光生物人血白蛋白-drugs_of->人血白蛋白\n", + "创建关系 泰邦生物人血白蛋白-drugs_of->人血白蛋白\n", + "创建关系 绿十字-drugs_of->中国)生物制品人\n", + "创建关系 人血白蛋白-drugs_of->人血白蛋白\n", + "创建关系 松泰斯-drugs_of->注射用还原型谷胱甘肽钠\n", + "创建关系 欣得生-drugs_of->盐酸氨溴索葡萄糖注射液\n", + "创建关系 武汉生物人血白蛋白-drugs_of->人血白蛋白\n", + "创建关系 诺健-drugs_of->注射用盐酸氨溴索\n", + "创建关系 广春药业盐酸氨溴索葡萄糖注-drugs_of->盐酸氨溴索葡萄糖注射液\n", + "创建关系 罗欣药业注射用盐酸氨溴索-drugs_of->注射用盐酸氨溴索\n", + "创建关系 润阳药业盐酸氨溴索葡萄糖注-drugs_of->盐酸氨溴索葡萄糖注射液\n", + "创建关系 博康健制药盐酸氨溴索葡萄糖-drugs_of->盐酸氨溴索葡萄糖注射液\n", + "创建关系 德源生物人血白蛋白-drugs_of->人血白蛋白\n", + "创建关系 六安华源制药盐酸氨溴索葡萄-drugs_of->盐酸氨溴索葡萄糖注射液\n", + "创建关系 艾富西药业盐酸氨溴索葡萄糖-drugs_of->盐酸氨溴索葡萄糖注射液\n", + "创建关系 山西康宝人血白蛋白-drugs_of->人血白蛋白\n", + "创建关系 莎普爱思盐酸氨溴索葡萄糖注-drugs_of->盐酸氨溴索葡萄糖注射液\n", + "创建关系 蜀阳药业人血白蛋白-drugs_of->人血白蛋白\n", + "创建关系 双林生物人血白蛋白-drugs_of->人血白蛋白\n", + "创建关系 蓉生药业人血白蛋白-drugs_of->人血白蛋白\n", + "创建关系 金峰制药盐酸氨溴索葡萄糖注-drugs_of->盐酸氨溴索葡萄糖注射液\n", + "创建关系 广东卫伦人血白蛋白-drugs_of->人血白蛋白\n", + "创建关系 亮博-drugs_of->头孢泊肟酯胶囊\n", + "创建关系 白云山光华头孢氨苄甲氧苄啶-drugs_of->头孢氨苄甲氧苄啶片\n", + "创建关系 头孢氨苄甲氧苄啶片-drugs_of->头孢氨苄甲氧苄啶片\n", + "创建关系 锋替新-drugs_of->注射用盐酸头孢替安\n", + "创建关系 西岳制药托西酸舒他西林胶囊-drugs_of->托西酸舒他西林胶囊\n", + "创建关系 华瑞联合制药头孢氨苄甲氧苄-drugs_of->头孢氨苄甲氧苄啶片\n", + "创建关系 明水药业头孢氨苄甲氧苄啶片-drugs_of->头孢氨苄甲氧苄啶片\n", + "创建关系 注射用磺苄西林钠-drugs_of->注射用磺苄西林钠\n", + "创建关系 圣大(张家口)头孢氨苄甲氧-drugs_of->头孢氨苄甲氧苄啶片\n", + "创建关系 大连药业托西酸舒他西林胶囊-drugs_of->托西酸舒他西林胶囊\n", + "创建关系 瑞阳制药注射用磺苄西林钠-drugs_of->注射用磺苄西林钠\n", + "创建关系 注射用盐酸头孢替安-drugs_of->注射用盐酸头孢替安\n", + "创建关系 赤峰维康托西酸舒他西林胶囊-drugs_of->托西酸舒他西林胶囊\n", + "创建关系 彼迪药业托西酸舒他西林胶囊-drugs_of->托西酸舒他西林胶囊\n", + "创建关系 复仙安-drugs_of->注射用盐酸头孢替安\n", + "创建关系 哈药总厂头孢氨苄甲氧苄啶片-drugs_of->头孢氨苄甲氧苄啶片\n", + "创建关系 云门药业头孢氨苄甲氧苄啶片-drugs_of->头孢氨苄甲氧苄啶片\n", + "创建关系 哈药总厂注射用磺苄西林钠-drugs_of->注射用磺苄西林钠\n", + "创建关系 萨兰欣-drugs_of->注射用盐酸头孢替安\n", + "创建关系 搏沃欣-drugs_of->头孢泊肟酯胶囊\n", + "创建关系 哈药总厂托西酸舒他西林胶囊-drugs_of->托西酸舒他西林胶囊\n", + "创建关系 全星制药注射用盐酸头孢替安-drugs_of->注射用盐酸头孢替安\n", + "创建关系 罗欣药业注射用盐酸头孢替安-drugs_of->注射用盐酸头孢替安\n", + "创建关系 宜昌长江乳酸左氧氟沙星片-drugs_of->乳酸左氧氟沙星片\n", + "创建关系 希舒美-drugs_of->阿奇霉素片\n", + "创建关系 维宏-drugs_of->阿奇霉素片\n", + "创建关系 宜昌长江阿奇霉素分散片-drugs_of->阿奇霉素分散片\n", + "创建关系 大连天宇制药阿奇霉素胶囊-drugs_of->阿奇霉素胶囊\n", + "创建关系 兰花药业诺氟沙星胶囊-drugs_of->诺氟沙星胶囊\n", + "创建关系 福邦药业阿奇霉素胶囊-drugs_of->阿奇霉素胶囊\n", + "创建关系 葵花药业得菲尔公司阿奇霉素-drugs_of->阿奇霉素胶囊\n", + "创建关系 利民制药阿奇霉素胶囊-drugs_of->阿奇霉素胶囊\n", + "创建关系 东药阿奇霉素胶囊-drugs_of->阿奇霉素胶囊\n", + "创建关系 浙江南洋药业阿奇霉素胶囊-drugs_of->阿奇霉素胶囊\n", + "创建关系 江苏长江阿奇霉素胶囊-drugs_of->阿奇霉素胶囊\n", + "创建关系 辅仁药业阿奇霉素片-drugs_of->阿奇霉素片\n", + "创建关系 汇仁药业阿奇霉素片-drugs_of->阿奇霉素片\n", + "创建关系 爱普森药业阿奇霉素片-drugs_of->阿奇霉素片\n", + "创建关系 石药欧意诺氟沙星胶囊-drugs_of->诺氟沙星胶囊\n", + "创建关系 白云山医药诺氟沙星胶囊-drugs_of->诺氟沙星胶囊\n", + "创建关系 康美药业诺氟沙星胶囊-drugs_of->诺氟沙星胶囊\n", + "创建关系 锦华药业诺氟沙星胶囊-drugs_of->诺氟沙星胶囊\n", + "创建关系 北京京丰制药集团诺氟沙星胶-drugs_of->诺氟沙星胶囊\n", + "创建关系 欣匹特-drugs_of->阿奇霉素分散片\n", + "创建关系 海王阿奇霉素片-drugs_of->阿奇霉素片\n", + "创建关系 安诺药业阿奇霉素分散片-drugs_of->阿奇霉素分散片\n", + "创建关系 云南白药云南花粉片-drugs_of->云南花粉片\n", + "创建关系 丰原制药注射用盐酸溴己新-drugs_of->注射用盐酸溴己新\n", + "创建关系 普德药业注射用盐酸溴己新-drugs_of->注射用盐酸溴己新\n", + "创建关系 海斯制药注射用盐酸溴己新-drugs_of->注射用盐酸溴己新\n", + "创建关系 国药国瑞注射用盐酸溴己新-drugs_of->注射用盐酸溴己新\n", + "创建关系 傲群-drugs_of->注射用盐酸溴己新\n", + "创建关系 智同生物注射用盐酸溴己新-drugs_of->注射用盐酸溴己新\n", + "创建关系 澳利达奈德注射用盐酸溴己新-drugs_of->注射用盐酸溴己新\n", + "创建关系 一品红注射用盐酸溴己新-drugs_of->注射用盐酸溴己新\n", + "创建关系 海鲸药业注射用盐酸溴己新-drugs_of->注射用盐酸溴己新\n", + "创建关系 益佳清-drugs_of->注射用盐酸溴己新\n", + "创建关系 伏枝-drugs_of->注射用盐酸溴己新\n", + "创建关系 飞云岭药业甲硝唑片-drugs_of->甲硝唑片\n", + "创建关系 丽珠制药替硝唑片-drugs_of->替硝唑片\n", + "创建关系 亨瑞达制药甲硝唑片-drugs_of->甲硝唑片\n", + "创建关系 环科药业甲硝唑片-drugs_of->甲硝唑片\n", + "创建关系 鲁抗赛特替硝唑片-drugs_of->替硝唑片\n", + "创建关系 皇象铁力蓝天甲硝唑维B6片-drugs_of->甲硝唑维B6片\n", + "创建关系 迪沙药业甲硝唑维B6片-drugs_of->甲硝唑维B6片\n", + "创建关系 彼迪药业替硝唑片-drugs_of->替硝唑片\n", + "创建关系 潇然-drugs_of->奥硝唑片\n", + "创建关系 傲宁-drugs_of->奥硝唑片\n", + "创建关系 衡博来-drugs_of->奥硝唑片\n", + "创建关系 太原药业甲硝唑片-drugs_of->甲硝唑片\n", + "创建关系 汉森制药甲硝唑片-drugs_of->甲硝唑片\n", + "创建关系 海力制药替硝唑片-drugs_of->替硝唑片\n", + "创建关系 津华晖星替硝唑片-drugs_of->替硝唑片\n", + "创建关系 东药替硝唑片-drugs_of->替硝唑片\n", + "创建关系 迪诺制药替硝唑片-drugs_of->替硝唑片\n", + "创建关系 沈阳一药替硝唑片-drugs_of->替硝唑片\n", + "创建关系 甲硝唑片-drugs_of->甲硝唑片\n", + "创建关系 亚宝药业甲硝唑片-drugs_of->甲硝唑片\n", + "创建关系 津华晖星甲硝唑片-drugs_of->甲硝唑片\n", + "创建关系 华中药业甲硝唑片-drugs_of->甲硝唑片\n", + "创建关系 康美药业甲硝唑片-drugs_of->甲硝唑片\n", + "创建关系 得恩德制药雷公藤多苷片-drugs_of->雷公藤多苷片\n", + "创建关系 复旦复华雷公藤多苷片-drugs_of->雷公藤多苷片\n", + "创建关系 远大医药黄石飞云制药雷公藤-drugs_of->雷公藤多苷片\n", + "创建关系 美通制药雷公藤多苷片-drugs_of->雷公藤多苷片\n", + "创建关系 普洛康裕天然药物雷公藤多苷-drugs_of->雷公藤多苷片\n", + "创建关系 新陇海药业雷公藤多苷片-drugs_of->雷公藤多苷片\n", + "创建关系 贵州汉方药业雷公藤多苷片-drugs_of->雷公藤多苷片\n", + "创建关系 尤金-drugs_of->甲泼尼龙片\n", + "创建关系 美卓乐-drugs_of->甲泼尼龙片\n", + "创建关系 米乐松-drugs_of->注射用甲泼尼龙琥珀酸钠\n", + "创建关系 甲强龙-drugs_of->注射用甲泼尼龙琥珀酸钠\n", + "创建关系 金耀药业注射用甲泼尼龙琥珀-drugs_of->注射用甲泼尼龙琥珀酸钠\n", + "创建关系 央宗药业蒺藜药酒-drugs_of->蒺藜药酒\n", + "创建关系 德远药业雷公藤多苷片-drugs_of->雷公藤多苷片\n", + "创建关系 比利时辉瑞注射用甲泼尼龙琥-drugs_of->注射用甲泼尼龙琥珀酸钠\n", + "创建关系 重庆华邦制药注射用甲泼尼龙-drugs_of->注射用甲泼尼龙琥珀酸钠\n", + "创建关系 辽宁海思科注射用甲泼尼龙琥-drugs_of->注射用甲泼尼龙琥珀酸钠\n", + "创建关系 南光注射用甲泼尼龙琥珀酸钠-drugs_of->注射用甲泼尼龙琥珀酸钠\n", + "创建关系 一品红盐酸克林霉素棕榈酸酯-drugs_of->盐酸克林霉素棕榈酸酯分散片\n", + "创建关系 杭州民生药业盐酸克林霉素胶-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 宜昌人福盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 东药盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 康普药业盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 锦华药业盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 仁和药业盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 安诺药业盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 天方药业盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 科伦药业盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 星斗药业盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 苏州三药盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 河南羚锐制药盐酸克林霉素胶-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 可尔生-drugs_of->盐酸克林霉素棕榈酸酯颗粒\n", + "创建关系 亚太药业盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 白云山光华盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 台城制药盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 新亚闵行盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 黄河药业盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 同济堂制药盐酸克林霉素胶囊-drugs_of->盐酸克林霉素胶囊\n", + "创建关系 一品红盐酸克林霉素棕榈酸酯-drugs_of->盐酸克林霉素棕榈酸酯颗粒\n", + "创建关系 开林-drugs_of->注射用美洛西林钠舒巴坦钠\n", + "创建关系 圣泰转移因子口服溶液-drugs_of->转移因子口服溶液\n", + "创建关系 仙琚制药克霉唑阴道片-drugs_of->克霉唑阴道片\n", + "创建关系 运佳黄浦硝酸咪康唑乳膏-drugs_of->硝酸咪康唑乳膏\n", + "创建关系 三维康-drugs_of->氟康唑胶囊\n", + "创建关系 赣南海欣转移因子口服溶液-drugs_of->转移因子口服溶液\n", + "创建关系 福建太平洋制药酮康唑乳膏-drugs_of->酮康唑乳膏\n", + "创建关系 二天堂联苯苄唑乳膏-drugs_of->联苯苄唑乳膏\n", + "创建关系 倍佳-drugs_of->盐酸特比萘芬溶液\n", + "创建关系 倍佳-drugs_of->盐酸特比萘芬凝胶\n", + "创建关系 唐山红星硝酸咪康唑乳膏-drugs_of->硝酸咪康唑乳膏\n", + "创建关系 唐山红星硝酸益康唑溶液-drugs_of->硝酸益康唑溶液\n", + "创建关系 衡阳紫光古汉硝酸益康唑乳膏-drugs_of->硝酸益康唑乳膏\n", + "创建关系 纽兰药业硝酸咪康唑栓-drugs_of->硝酸咪康唑栓\n", + "创建关系 黑龙江天龙药业联苯苄唑乳膏-drugs_of->联苯苄唑乳膏\n", + "创建关系 斯皮仁诺-drugs_of->伊曲康唑胶囊\n", + "创建关系 美扶-drugs_of->伊曲康唑胶囊\n", + "创建关系 桂林华信环吡酮胺乳膏-drugs_of->环吡酮胺乳膏\n", + "创建关系 南通中华药业硝酸咪康唑乳膏-drugs_of->硝酸咪康唑乳膏\n", + "创建关系 吉春制药硝酸咪康唑乳膏-drugs_of->硝酸咪康唑乳膏\n", + "创建关系 康正药业硝酸咪康唑乳膏-drugs_of->硝酸咪康唑乳膏\n", + "创建关系 恒安药业盐酸特比萘芬片-drugs_of->盐酸特比萘芬片\n", + "创建关系 迪沙药业克霉唑阴道片-drugs_of->克霉唑阴道片\n", + "创建关系 五洲通药业硝酸咪康唑乳膏-drugs_of->硝酸咪康唑乳膏\n", + "创建关系 百利药业阿奇霉素颗粒-drugs_of->阿奇霉素颗粒\n", + "创建关系 东信药业阿奇霉素颗粒-drugs_of->阿奇霉素颗粒\n", + "创建关系 俞氏阿奇霉素颗粒-drugs_of->阿奇霉素颗粒\n", + "创建关系 湘江药业阿奇霉素颗粒-drugs_of->阿奇霉素颗粒\n", + "创建关系 潜江制药阿奇霉素颗粒-drugs_of->阿奇霉素颗粒\n", + "创建关系 海力制药阿奇霉素颗粒-drugs_of->阿奇霉素颗粒\n", + "创建关系 北海阳光药业阿奇霉素颗粒-drugs_of->阿奇霉素颗粒\n", + "创建关系 锦华药业氯霉素片-drugs_of->氯霉素片\n", + "创建关系 赛乐欣-drugs_of->阿奇霉素分散片\n", + "创建关系 齐迈星-drugs_of->阿奇霉素分散片\n", + "创建关系 丽珠奇乐-drugs_of->阿奇霉素分散片\n", + "创建关系 健生制药阿奇霉素分散片-drugs_of->阿奇霉素分散片\n", + "创建关系 彼迪药业阿奇霉素分散片-drugs_of->阿奇霉素分散片\n", + "创建关系 利君制药阿奇霉素分散片-drugs_of->阿奇霉素分散片\n", + "创建关系 天丁噻托溴铵粉雾剂-drugs_of->噻托溴铵粉雾剂\n", + "创建关系 埃斯玛隆-drugs_of->茶碱缓释胶囊\n", + "创建关系 曲靖药业白及颗粒-drugs_of->白及颗粒\n", + "创建关系 思力华-drugs_of->噻托溴铵粉吸入剂\n", + "创建关系 帮备-drugs_of->盐酸班布特罗片\n", + "创建关系 博利康尼-drugs_of->硫酸特布他林片\n", + "创建关系 陕西东泰制药复方蛤青胶囊-drugs_of->复方蛤青胶囊\n", + "创建关系 诚信制药盐酸妥洛特罗片-drugs_of->盐酸妥洛特罗片\n", + "创建关系 吉尔吉药业喘嗽宁片-drugs_of->喘嗽宁片\n", + "创建关系 瑞尔医药盐酸班布特罗片-drugs_of->盐酸班布特罗片\n", + "创建关系 易坦静-drugs_of->氨溴特罗口服溶液\n", + "创建关系 万方制药肺气肿片-drugs_of->肺气肿片\n", + "创建关系 吉春制药祛痰止咳胶囊-drugs_of->祛痰止咳胶囊\n", + "创建关系 龙泰制药化痰平喘片-drugs_of->化痰平喘片\n", + "创建关系 七星山药业化痰平喘片-drugs_of->化痰平喘片\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "创建关系 国医堂制药如意定喘丸-drugs_of->如意定喘丸\n", + "创建关系 博利康尼-drugs_of->硫酸特布他林雾化液\n", + "创建关系 石药欧意氨茶碱片-drugs_of->氨茶碱片\n", + "创建关系 山西云鹏制药氨茶碱片-drugs_of->氨茶碱片\n", + "创建关系 广东环球制药茶碱缓释片-drugs_of->茶碱缓释片\n", + "创建关系 白敬宇制药氨茶碱片-drugs_of->氨茶碱片\n", + "创建关系 湖南九典制药盐酸班布特罗胶-drugs_of->盐酸班布特罗胶囊\n", + "创建关系 康裕头孢氨苄胶囊-drugs_of->头孢氨苄胶囊\n", + "创建关系 联邦左福康盐酸左氧氟沙星胶-drugs_of->盐酸左氧氟沙星胶囊\n", + "创建关系 阿莫仙阿莫西林颗粒-drugs_of->阿莫西林颗粒\n", + "创建关系 联邦安必仙氨苄西林胶囊-drugs_of->氨苄西林胶囊\n", + "创建关系 江西诚志永丰蛇胆川贝液-drugs_of->蛇胆川贝液\n", + "创建关系 鲁抗阿莫西林颗粒-drugs_of->阿莫西林颗粒\n", + "创建关系 广东华南依托红霉素片-drugs_of->依托红霉素片\n", + "创建关系 孩尔欣头孢克洛颗粒-drugs_of->头孢克洛颗粒\n", + "创建关系 银力舒-drugs_of->头孢丙烯分散片\n", + "创建关系 达仁堂通宣理肺丸-drugs_of->通宣理肺丸\n", + "创建关系 申优-drugs_of->头孢拉定分散片\n", + "创建关系 康良头孢拉定胶囊-drugs_of->头孢拉定胶囊\n", + "创建关系 安必君氨苄西林胶囊-drugs_of->氨苄西林胶囊\n", + "创建关系 佳乐弗乳酸左氧氟沙星片-drugs_of->乳酸左氧氟沙星片\n", + "创建关系 银诺克肺宝蛤蚧定喘丸-drugs_of->蛤蚧定喘丸\n", + "创建关系 达力芬-drugs_of->头孢克肟颗粒\n", + "创建关系 鲁神乙酰螺旋霉素片-drugs_of->乙酰螺旋霉素片\n", + "创建关系 鲁抗注射用头孢唑林钠-drugs_of->注射用头孢唑林钠\n", + "创建关系 上海新亚头孢克肟分散片-drugs_of->头孢克肟分散片\n", + "创建关系 鲁抗麦迪霉素片-drugs_of->麦迪霉素片\n", + "创建关系 珠海联邦头孢拉定胶囊-drugs_of->头孢拉定胶囊\n", + "创建关系 朗瑞-drugs_of->司帕沙星分散片\n", + "创建关系 百日咳-recommand_drug->琥乙红霉素片\n", + "创建关系 百日咳-recommand_drug->琥乙红霉素颗粒\n", + "创建关系 百日咳-recommand_drug->百咳静糖浆\n", + "创建关系 百日咳-recommand_drug->穿心莲内酯片\n", + "创建关系 百日咳-recommand_drug->红霉素肠溶片\n", + "创建关系 百日咳-recommand_drug->环酯红霉素片\n", + "创建关系 苯中毒-recommand_drug->布美他尼片\n", + "创建关系 苯中毒-recommand_drug->十一味金色丸\n", + "创建关系 苯中毒-recommand_drug->注射用布美他尼\n", + "创建关系 苯中毒-recommand_drug->注射用呋塞米\n", + "创建关系 苯中毒-recommand_drug->盐酸利多卡因注射液\n", + "创建关系 苯中毒-recommand_drug->注射用硫代硫酸钠\n", + "创建关系 苯中毒-recommand_drug->大月晶丸\n", + "创建关系 苯中毒-recommand_drug->仁青芒觉\n", + "创建关系 苯中毒-recommand_drug->注射用鼠神经生长因子\n", + "创建关系 苯中毒-recommand_drug->地塞米松磷酸钠注射液\n", + "创建关系 喘息样支气管炎-recommand_drug->枸橼酸喷托维林片\n", + "创建关系 喘息样支气管炎-recommand_drug->氨茶碱片\n", + "创建关系 喘息样支气管炎-recommand_drug->二羟丙茶碱片\n", + "创建关系 喘息样支气管炎-recommand_drug->胸腺肽肠溶片\n", + "创建关系 喘息样支气管炎-recommand_drug->硫酸沙丁胺醇气雾剂\n", + "创建关系 喘息样支气管炎-recommand_drug->小青龙合剂\n", + "创建关系 喘息样支气管炎-recommand_drug->硫酸沙丁胺醇片\n", + "创建关系 喘息样支气管炎-recommand_drug->蛇胆川贝液\n", + "创建关系 喘息样支气管炎-recommand_drug->小青龙颗粒\n", + "创建关系 喘息样支气管炎-recommand_drug->布地奈德气雾剂\n", + "创建关系 喘息样支气管炎-recommand_drug->喷托维林氯化铵糖浆\n", + "创建关系 成人呼吸窘迫综合征-recommand_drug->注射用还原型谷胱甘肽钠\n", + "创建关系 成人呼吸窘迫综合征-recommand_drug->注射用盐酸氨溴索\n", + "创建关系 成人呼吸窘迫综合征-recommand_drug->人血白蛋白\n", + "创建关系 成人呼吸窘迫综合征-recommand_drug->盐酸氨溴索葡萄糖注射液\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-recommand_drug->注射用盐酸头孢替安\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-recommand_drug->注射用磺苄西林钠\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-recommand_drug->托西酸舒他西林胶囊\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-recommand_drug->头孢泊肟酯胶囊\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-recommand_drug->头孢氨苄甲氧苄啶片\n", + "创建关系 大叶性肺炎-recommand_drug->阿奇霉素胶囊\n", + "创建关系 大叶性肺炎-recommand_drug->阿奇霉素分散片\n", + "创建关系 大叶性肺炎-recommand_drug->诺氟沙星胶囊\n", + "创建关系 大叶性肺炎-recommand_drug->阿奇霉素片\n", + "创建关系 大叶性肺炎-recommand_drug->乳酸左氧氟沙星片\n", + "创建关系 大楼病综合征-recommand_drug->注射用盐酸溴己新\n", + "创建关系 大楼病综合征-recommand_drug->云南花粉片\n", + "创建关系 二硫化碳中毒-recommand_drug->布美他尼片\n", + "创建关系 二硫化碳中毒-recommand_drug->十一味金色丸\n", + "创建关系 二硫化碳中毒-recommand_drug->注射用布美他尼\n", + "创建关系 二硫化碳中毒-recommand_drug->注射用呋塞米\n", + "创建关系 二硫化碳中毒-recommand_drug->盐酸利多卡因注射液\n", + "创建关系 二硫化碳中毒-recommand_drug->注射用硫代硫酸钠\n", + "创建关系 二硫化碳中毒-recommand_drug->大月晶丸\n", + "创建关系 二硫化碳中毒-recommand_drug->仁青芒觉\n", + "创建关系 二硫化碳中毒-recommand_drug->注射用鼠神经生长因子\n", + "创建关系 二硫化碳中毒-recommand_drug->地塞米松磷酸钠注射液\n", + "创建关系 肺-胸膜阿米巴病-recommand_drug->甲硝唑片\n", + "创建关系 肺-胸膜阿米巴病-recommand_drug->甲硝唑维B6片\n", + "创建关系 肺-胸膜阿米巴病-recommand_drug->替硝唑片\n", + "创建关系 肺-胸膜阿米巴病-recommand_drug->奥硝唑片\n", + "创建关系 肺出血-肾炎综合征-recommand_drug->雷公藤多苷片\n", + "创建关系 肺出血-肾炎综合征-recommand_drug->注射用甲泼尼龙琥珀酸钠\n", + "创建关系 肺出血-肾炎综合征-recommand_drug->蒺藜药酒\n", + "创建关系 肺出血-肾炎综合征-recommand_drug->甲泼尼龙片\n", + "创建关系 肺放线菌病-recommand_drug->盐酸克林霉素棕榈酸酯分散片\n", + "创建关系 肺放线菌病-recommand_drug->注射用美洛西林钠舒巴坦钠\n", + "创建关系 肺放线菌病-recommand_drug->盐酸克林霉素棕榈酸酯颗粒\n", + "创建关系 肺放线菌病-recommand_drug->盐酸克林霉素胶囊\n", + "创建关系 肺曲菌病-recommand_drug->阿奇霉素胶囊\n", + "创建关系 肺曲菌病-recommand_drug->阿奇霉素分散片\n", + "创建关系 肺曲菌病-recommand_drug->诺氟沙星胶囊\n", + "创建关系 肺曲菌病-recommand_drug->阿奇霉素片\n", + "创建关系 肺曲菌病-recommand_drug->乳酸左氧氟沙星片\n", + "创建关系 放射性肺炎-recommand_drug->阿奇霉素胶囊\n", + "创建关系 放射性肺炎-recommand_drug->阿奇霉素分散片\n", + "创建关系 放射性肺炎-recommand_drug->诺氟沙星胶囊\n", + "创建关系 放射性肺炎-recommand_drug->阿奇霉素片\n", + "创建关系 放射性肺炎-recommand_drug->乳酸左氧氟沙星片\n", + "创建关系 肺念珠菌病-recommand_drug->硝酸咪康唑乳膏\n", + "创建关系 肺念珠菌病-recommand_drug->盐酸特比萘芬片\n", + "创建关系 肺念珠菌病-recommand_drug->酮康唑乳膏\n", + "创建关系 肺念珠菌病-recommand_drug->环吡酮胺乳膏\n", + "创建关系 肺念珠菌病-recommand_drug->硝酸益康唑溶液\n", + "创建关系 肺念珠菌病-recommand_drug->伊曲康唑胶囊\n", + "创建关系 肺念珠菌病-recommand_drug->克霉唑阴道片\n", + "创建关系 肺念珠菌病-recommand_drug->氟康唑胶囊\n", + "创建关系 肺念珠菌病-recommand_drug->硝酸益康唑乳膏\n", + "创建关系 肺念珠菌病-recommand_drug->盐酸特比萘芬凝胶\n", + "创建关系 肺念珠菌病-recommand_drug->盐酸特比萘芬溶液\n", + "创建关系 肺念珠菌病-recommand_drug->联苯苄唑乳膏\n", + "创建关系 肺念珠菌病-recommand_drug->转移因子口服溶液\n", + "创建关系 肺念珠菌病-recommand_drug->硝酸咪康唑栓\n", + "创建关系 肺炎球菌肺炎-recommand_drug->氯霉素片\n", + "创建关系 肺炎球菌肺炎-recommand_drug->阿奇霉素片\n", + "创建关系 肺炎球菌肺炎-recommand_drug->阿奇霉素分散片\n", + "创建关系 肺炎球菌肺炎-recommand_drug->阿奇霉素颗粒\n", + "创建关系 肺气肿-recommand_drug->祛痰止咳胶囊\n", + "创建关系 肺气肿-recommand_drug->如意定喘丸\n", + "创建关系 肺气肿-recommand_drug->硫酸特布他林雾化液\n", + "创建关系 肺气肿-recommand_drug->茶碱缓释片\n", + "创建关系 肺气肿-recommand_drug->氨茶碱片\n", + "创建关系 肺气肿-recommand_drug->噻托溴铵粉吸入剂\n", + "创建关系 肺气肿-recommand_drug->盐酸班布特罗胶囊\n", + "创建关系 肺气肿-recommand_drug->白及颗粒\n", + "创建关系 肺气肿-recommand_drug->氨溴特罗口服溶液\n", + "创建关系 肺气肿-recommand_drug->化痰平喘片\n", + "创建关系 肺气肿-recommand_drug->噻托溴铵粉雾剂\n", + "创建关系 肺气肿-recommand_drug->盐酸妥洛特罗片\n", + "创建关系 肺气肿-recommand_drug->茶碱缓释胶囊\n", + "创建关系 肺气肿-recommand_drug->盐酸班布特罗片\n", + "创建关系 肺气肿-recommand_drug->喘嗽宁片\n", + "创建关系 肺气肿-recommand_drug->硫酸特布他林片\n", + "创建关系 肺气肿-recommand_drug->肺气肿片\n", + "创建关系 肺气肿-recommand_drug->复方蛤青胶囊\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->氨苄西林胶囊\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->头孢拉定胶囊\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->通宣理肺丸\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->阿莫西林颗粒\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->头孢克洛颗粒\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->盐酸左氧氟沙星胶囊\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->头孢氨苄胶囊\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->依托红霉素片\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->蛤蚧定喘丸\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->乙酰螺旋霉素片\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->注射用头孢唑林钠\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->头孢克肟颗粒\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->头孢克肟分散片\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->氟康唑胶囊\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->麦迪霉素片\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->司帕沙星分散片\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->头孢丙烯分散片\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->蛇胆川贝液\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->头孢拉定分散片\n", + "创建关系 肺炎杆菌肺炎-recommand_drug->乳酸左氧氟沙星片\n", + "创建关系 肺泡蛋白质沉积症-need_check->胸部CT检查\n", + "创建关系 肺泡蛋白质沉积症-need_check->肺活检\n", + "创建关系 肺泡蛋白质沉积症-need_check->支气管镜检查\n", + "创建关系 百日咳-need_check->耳、鼻、咽拭子细菌培养\n", + "创建关系 百日咳-need_check->周围血白细胞计数及分类检验\n", + "创建关系 百日咳-need_check->血常规\n", + "创建关系 百日咳-need_check->酶联免疫吸附试验\n", + "创建关系 百日咳-need_check->白细胞分类计数\n", + "创建关系 苯中毒-need_check->血常规\n", + "创建关系 苯中毒-need_check->骨髓象分析\n", + "创建关系 苯中毒-need_check->先令氏指数\n", + "创建关系 喘息样支气管炎-need_check->肺部检查\n", + "创建关系 喘息样支气管炎-need_check->肺和胸膜听诊\n", + "创建关系 喘息样支气管炎-need_check->抗链球菌型M蛋白抗体\n", + "创建关系 喘息样支气管炎-need_check->抗链球菌壁多糖抗体\n", + "创建关系 喘息样支气管炎-need_check->酶联免疫吸附试验\n", + "创建关系 成人呼吸窘迫综合征-need_check->胸部CT检查\n", + "创建关系 成人呼吸窘迫综合征-need_check->呼吸肌功能测定\n", + "创建关系 成人呼吸窘迫综合征-need_check->血浆蛋白C抗原\n", + "创建关系 成人呼吸窘迫综合征-need_check->肺泡气-动脉血氧分压差\n", + "创建关系 成人呼吸窘迫综合征-need_check->肺毛细血管楔压\n", + "创建关系 大量羊水吸入-need_check->肺部检查\n", + "创建关系 大量羊水吸入-need_check->胸部透视\n", + "创建关系 大量羊水吸入-need_check->胸部平片\n", + "创建关系 大量羊水吸入-need_check->胸部CT检查\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-need_check->痰液中细胞分类\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-need_check->胸部平片\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-need_check->痰液中寄生虫和虫卵\n", + "创建关系 大叶性肺炎-need_check->Optochin敏感试验\n", + "创建关系 大叶性肺炎-need_check->小白鼠毒力试验\n", + "创建关系 大叶性肺炎-need_check->痰培养\n", + "创建关系 大叶性肺炎-need_check->肺活量体重指数\n", + "创建关系 大叶性肺炎-need_check->胸部平片\n", + "创建关系 大叶性肺炎-need_check->免疫电泳\n", + "创建关系 大叶性肺炎-need_check->血常规\n", + "创建关系 大叶性肺炎-need_check->痰液细菌涂片检查\n", + "创建关系 大楼病综合征-need_check->钼靶X线检查\n", + "创建关系 大楼病综合征-need_check->CT检查\n", + "创建关系 大楼病综合征-need_check->血常规\n", + "创建关系 二硫化碳中毒-need_check->血常规\n", + "创建关系 二硫化碳中毒-need_check->尿常规\n", + "创建关系 二硫化碳中毒-need_check->肾功能检查\n", + "创建关系 二硫化碳中毒-need_check->神经系统检查\n", + "创建关系 二硫化碳中毒-need_check->眼底荧光血管造影\n", + "创建关系 二硫化碳中毒-need_check->肌电图\n", + "创建关系 二硫化碳中毒-need_check->脑电图检查\n", + "创建关系 二硫化碳中毒-need_check->心肺功能运动试验(CPET)\n", + "创建关系 肺-胸膜阿米巴病-need_check->胸部平片\n", + "创建关系 肺-胸膜阿米巴病-need_check->痰液病原体检查\n", + "创建关系 肺出血-肾炎综合征-need_check->痰液常规检查\n", + "创建关系 肺出血-肾炎综合征-need_check->尿液镜检法\n", + "创建关系 肺出血-肾炎综合征-need_check->胸部平片\n", + "创建关系 肺出血-肾炎综合征-need_check->肾功能检查\n", + "创建关系 肺出血-肾炎综合征-need_check->抗肾小球基底膜抗体测定(AGBM)\n", + "创建关系 肺出血-肾炎综合征-need_check->隐血试验与含铁血黄素检查\n", + "创建关系 肺放线菌病-need_check->痰液病原体检查\n", + "创建关系 肺放线菌病-need_check->胸部平片\n", + "创建关系 肺泡蛋白沉着症-need_check->胸部CT检查\n", + "创建关系 肺泡蛋白沉着症-need_check->支气管镜检查\n", + "创建关系 肺泡蛋白沉着症-need_check->肺活检\n", + "创建关系 肺曲菌病-need_check->胸部平片\n", + "创建关系 肺曲菌病-need_check->痰培养\n", + "创建关系 肺曲菌病-need_check->纤维支气管镜检查\n", + "创建关系 肺曲菌病-need_check->胸部CT检查\n", + "创建关系 肺曲菌病-need_check->痰液细菌涂片检查\n", + "创建关系 放射性肺炎-need_check->胸部平片\n", + "创建关系 放射性肺炎-need_check->肺功能检查\n", + "创建关系 放射性肺炎-need_check->通气与血流灌注比值(V/Q)\n", + "创建关系 放射性肺炎-need_check->每分钟最大通气量(MVV)\n", + "创建关系 放射性肺炎-need_check->血常规\n", + "创建关系 肺念珠菌病-need_check->肺量计检测\n", + "创建关系 肺念珠菌病-need_check->胸部平片\n", + "创建关系 肺念珠菌病-need_check->痰液细菌涂片检查\n", + "创建关系 肺大疱-need_check->胸部CT检查\n", + "创建关系 肺大疱-need_check->支气管造影\n", + "创建关系 肺大疱-need_check->胸部平片\n", + "创建关系 肺炎球菌肺炎-need_check->胸部平片\n", + "创建关系 肺炎球菌肺炎-need_check->血常规\n", + "创建关系 肺气肿-need_check->肺量计检测\n", + "创建关系 肺气肿-need_check->残气量/肺总量比值(RV/TLC)\n", + "创建关系 肺气肿-need_check->肺容量测定\n", + "创建关系 肺气肿-need_check->肺活量(VC)\n", + "创建关系 肺气肿-need_check->最大呼气流量-容积曲线(MEFV)\n", + "创建关系 肺气肿-need_check->深吸气量(IC)\n", + "创建关系 肺气肿-need_check->一秒用力呼出量/用力肺活量比值\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "创建关系 肺气肿-need_check->心电图\n", + "创建关系 肺气肿-need_check->无效腔气量/潮气量比值\n", + "创建关系 肺气肿-need_check->肺泡气-动脉血氧分压差\n", + "创建关系 肺炎杆菌肺炎-need_check->痰液细菌涂片检查\n", + "创建关系 肺炎杆菌肺炎-need_check->痰液细菌培养\n", + "创建关系 肺炎杆菌肺炎-need_check->血常规\n", + "创建关系 肺泡蛋白质沉积症-has_symptom->紫绀\n", + "创建关系 肺泡蛋白质沉积症-has_symptom->胸痛\n", + "创建关系 肺泡蛋白质沉积症-has_symptom->呼吸困难\n", + "创建关系 肺泡蛋白质沉积症-has_symptom->乏力\n", + "创建关系 肺泡蛋白质沉积症-has_symptom->毓卓\n", + "创建关系 百日咳-has_symptom->吸气时有蝉鸣音\n", + "创建关系 百日咳-has_symptom->痉挛性咳嗽\n", + "创建关系 百日咳-has_symptom->胸闷\n", + "创建关系 百日咳-has_symptom->肺阴虚\n", + "创建关系 百日咳-has_symptom->抽搐\n", + "创建关系 百日咳-has_symptom->低热\n", + "创建关系 百日咳-has_symptom->闫鹏辉\n", + "创建关系 百日咳-has_symptom->惊厥\n", + "创建关系 苯中毒-has_symptom->恶心\n", + "创建关系 苯中毒-has_symptom->抽搐\n", + "创建关系 苯中毒-has_symptom->感觉障碍\n", + "创建关系 喘息样支气管炎-has_symptom->耸肩喘息\n", + "创建关系 喘息样支气管炎-has_symptom->哮鸣音\n", + "创建关系 喘息样支气管炎-has_symptom->纤毛上皮细胞损伤脱落\n", + "创建关系 喘息样支气管炎-has_symptom->变应性咳嗽\n", + "创建关系 喘息样支气管炎-has_symptom->化学性支气管炎\n", + "创建关系 喘息样支气管炎-has_symptom->喘息\n", + "创建关系 喘息样支气管炎-has_symptom->冬春季的慢性咳...\n", + "创建关系 喘息样支气管炎-has_symptom->咳嗽伴哮鸣音\n", + "创建关系 成人呼吸窘迫综合征-has_symptom->呼吸困难\n", + "创建关系 成人呼吸窘迫综合征-has_symptom->紫绀\n", + "创建关系 成人呼吸窘迫综合征-has_symptom->心源性呼吸窘迫\n", + "创建关系 大量羊水吸入-has_symptom->面色青紫\n", + "创建关系 大量羊水吸入-has_symptom->呼吸困难\n", + "创建关系 大量羊水吸入-has_symptom->口唇青紫\n", + "创建关系 大量羊水吸入-has_symptom->肺纹理增粗\n", + "创建关系 大量羊水吸入-has_symptom->出生后即有持续青紫\n", + "创建关系 大量羊水吸入-has_symptom->口唇和甲床略带青紫\n", + "创建关系 大量羊水吸入-has_symptom->气急\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-has_symptom->嗜酸性粒细胞增多\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-has_symptom->咽部异物感\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-has_symptom->胸闷憋气\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-has_symptom->咯血伴发热\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-has_symptom->胸闷\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-has_symptom->乏力\n", + "创建关系 大叶性肺炎-has_symptom->湿啰音\n", + "创建关系 大叶性肺炎-has_symptom->胸痛\n", + "创建关系 大叶性肺炎-has_symptom->发烧\n", + "创建关系 大叶性肺炎-has_symptom->咳铁锈色痰\n", + "创建关系 大叶性肺炎-has_symptom->急性面容\n", + "创建关系 大叶性肺炎-has_symptom->呼吸音减弱\n", + "创建关系 大楼病综合征-has_symptom->紧张性头晕\n", + "创建关系 大楼病综合征-has_symptom->紧张性头痛\n", + "创建关系 大楼病综合征-has_symptom->间歇性头晕\n", + "创建关系 大楼病综合征-has_symptom->鼻塞\n", + "创建关系 大楼病综合征-has_symptom->头晕\n", + "创建关系 大楼病综合征-has_symptom->恶心\n", + "创建关系 大楼病综合征-has_symptom->眼睛痒\n", + "创建关系 大楼病综合征-has_symptom->目赤\n", + "创建关系 大楼病综合征-has_symptom->间歇性头痛\n", + "创建关系 二硫化碳中毒-has_symptom->昏迷\n", + "创建关系 二硫化碳中毒-has_symptom->腱反射消失\n", + "创建关系 二硫化碳中毒-has_symptom->呕吐\n", + "创建关系 二硫化碳中毒-has_symptom->谵妄\n", + "创建关系 二硫化碳中毒-has_symptom->多发性神经炎\n", + "创建关系 二硫化碳中毒-has_symptom->浅感觉减退或缺失\n", + "创建关系 二硫化碳中毒-has_symptom->恶心\n", + "创建关系 二硫化碳中毒-has_symptom->感觉障碍\n", + "创建关系 肺-胸膜阿米巴病-has_symptom->盗汗\n", + "创建关系 肺-胸膜阿米巴病-has_symptom->腹泻\n", + "创建关系 肺-胸膜阿米巴病-has_symptom->乏力\n", + "创建关系 肺-胸膜阿米巴病-has_symptom->发热伴咳嗽、咯...\n", + "创建关系 肺出血-肾炎综合征-has_symptom->肺部出血\n", + "创建关系 肺出血-肾炎综合征-has_symptom->呼吸困难\n", + "创建关系 肺出血-肾炎综合征-has_symptom->咯血\n", + "创建关系 肺出血-肾炎综合征-has_symptom->气短\n", + "创建关系 肺出血-肾炎综合征-has_symptom->发热伴咳嗽、咯...\n", + "创建关系 肺出血-肾炎综合征-has_symptom->蛋白尿\n", + "创建关系 肺放线菌病-has_symptom->骨膜炎\n", + "创建关系 肺放线菌病-has_symptom->体重减轻\n", + "创建关系 肺放线菌病-has_symptom->咯血\n", + "创建关系 肺放线菌病-has_symptom->盗汗\n", + "创建关系 肺放线菌病-has_symptom->乏力\n", + "创建关系 肺放线菌病-has_symptom->低热\n", + "创建关系 肺泡蛋白沉着症-has_symptom->胸痛\n", + "创建关系 肺泡蛋白沉着症-has_symptom->紫绀\n", + "创建关系 肺泡蛋白沉着症-has_symptom->呼吸困难\n", + "创建关系 肺泡蛋白沉着症-has_symptom->肺泡炎症\n", + "创建关系 肺泡蛋白沉着症-has_symptom->肺泡灌洗液可见...\n", + "创建关系 肺泡蛋白沉着症-has_symptom->乏力\n", + "创建关系 肺泡蛋白沉着症-has_symptom->发热伴咳嗽、咯...\n", + "创建关系 肺曲菌病-has_symptom->咳出棕色痰栓\n", + "创建关系 肺曲菌病-has_symptom->嗜酸性粒细胞增多\n", + "创建关系 肺曲菌病-has_symptom->胸痛\n", + "创建关系 放射性肺炎-has_symptom->闫铁\n", + "创建关系 放射性肺炎-has_symptom->肺纤维化\n", + "创建关系 放射性肺炎-has_symptom->胸痛\n", + "创建关系 放射性肺炎-has_symptom->低热\n", + "创建关系 肺念珠菌病-has_symptom->痰呈粘液脓性\n", + "创建关系 肺念珠菌病-has_symptom->肺部啰音\n", + "创建关系 肺大疱-has_symptom->胸闷\n", + "创建关系 肺大疱-has_symptom->气短\n", + "创建关系 肺大疱-has_symptom->胸闷憋气\n", + "创建关系 肺大疱-has_symptom->发热伴咳嗽、咯...\n", + "创建关系 肺炎球菌肺炎-has_symptom->痰中带血丝\n", + "创建关系 肺炎球菌肺炎-has_symptom->咳嗽伴胸痛\n", + "创建关系 肺炎球菌肺炎-has_symptom->胸痛\n", + "创建关系 肺炎球菌肺炎-has_symptom->发热伴咳嗽、咯...\n", + "创建关系 肺气肿-has_symptom->纵隔浊音界扩大\n", + "创建关系 肺气肿-has_symptom->桶状胸\n", + "创建关系 肺气肿-has_symptom->小支气管粘膜水肿\n", + "创建关系 肺气肿-has_symptom->黏稠或脓性痰伴...\n", + "创建关系 肺气肿-has_symptom->横膈低平\n", + "创建关系 肺气肿-has_symptom->胸闷\n", + "创建关系 肺气肿-has_symptom->呼气音延长\n", + "创建关系 肺气肿-has_symptom->肺部啰音\n", + "创建关系 肺气肿-has_symptom->呼吸音减弱\n", + "创建关系 肺炎杆菌肺炎-has_symptom->畏寒\n", + "创建关系 肺炎杆菌肺炎-has_symptom->胸痛\n", + "创建关系 肺炎杆菌肺炎-has_symptom->气急\n", + "创建关系 肺炎杆菌肺炎-has_symptom->发热伴咳嗽、咯...\n", + "创建关系 肺泡蛋白质沉积症-acompany_with->多重肺部感染\n", + "创建关系 百日咳-acompany_with->肺不张\n", + "创建关系 苯中毒-acompany_with->贫血\n", + "创建关系 喘息样支气管炎-acompany_with->支气管哮喘\n", + "创建关系 成人呼吸窘迫综合征-acompany_with->细菌性肺炎\n", + "创建关系 大量羊水吸入-acompany_with->呼吸衰竭\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-acompany_with->胆道蛔虫病\n", + "创建关系 大叶性肺炎-acompany_with->脓胸\n", + "创建关系 大楼病综合征-acompany_with->抑郁症\n", + "创建关系 二硫化碳中毒-acompany_with->昏迷\n", + "创建关系 肺-胸膜阿米巴病-acompany_with->阿米巴肝脓肿\n", + "创建关系 肺出血-肾炎综合征-acompany_with->便血\n", + "创建关系 肺放线菌病-acompany_with->膈下脓肿\n", + "创建关系 肺泡蛋白沉着症-acompany_with->呼吸衰竭\n", + "创建关系 肺曲菌病-acompany_with->过敏性鼻炎\n", + "创建关系 放射性肺炎-acompany_with->肺气肿\n", + "创建关系 肺念珠菌病-acompany_with->菌血症\n", + "创建关系 肺大疱-acompany_with->张力性气胸\n", + "创建关系 肺炎球菌肺炎-acompany_with->败血症\n", + "创建关系 肺气肿-acompany_with->呼吸衰竭\n", + "创建关系 肺气肿-acompany_with->自发性气胸\n", + "创建关系 肺气肿-acompany_with->慢性肺源性心脏病\n", + "创建关系 肺气肿-acompany_with->胃溃疡\n", + "创建关系 肺炎杆菌肺炎-acompany_with->脑疝\n", + "创建关系 肺泡蛋白质沉积症-belongs_to->呼吸内科\n", + "创建关系 百日咳-belongs_to->小儿内科\n", + "创建关系 苯中毒-belongs_to->急诊科\n", + "创建关系 喘息样支气管炎-belongs_to->呼吸内科\n", + "创建关系 成人呼吸窘迫综合征-belongs_to->呼吸内科\n", + "创建关系 大量羊水吸入-belongs_to->小儿内科\n", + "创建关系 单纯性肺嗜酸粒细胞浸润症-belongs_to->呼吸内科\n", + "创建关系 大叶性肺炎-belongs_to->呼吸内科\n", + "创建关系 大楼病综合征-belongs_to->其他综合\n", + "创建关系 二硫化碳中毒-belongs_to->急诊科\n", + "创建关系 肺-胸膜阿米巴病-belongs_to->呼吸内科\n", + "创建关系 肺出血-肾炎综合征-belongs_to->呼吸内科\n", + "创建关系 肺放线菌病-belongs_to->呼吸内科\n", + "创建关系 肺泡蛋白沉着症-belongs_to->呼吸内科\n", + "创建关系 肺曲菌病-belongs_to->呼吸内科\n", + "创建关系 放射性肺炎-belongs_to->呼吸内科\n", + "创建关系 肺念珠菌病-belongs_to->呼吸内科\n", + "创建关系 肺大疱-belongs_to->呼吸内科\n", + "创建关系 肺炎球菌肺炎-belongs_to->呼吸内科\n", + "创建关系 肺气肿-belongs_to->呼吸内科\n", + "创建关系 肺炎杆菌肺炎-belongs_to->呼吸内科\n" + ] + } + ], + "source": [ + "create_relationship('Disease', 'Food', rels_recommandeat, 'recommand_eat', '推荐食谱')\n", + "create_relationship('Disease', 'Food', rels_noteat, 'no_eat', '忌吃')\n", + "create_relationship('Disease', 'Food', rels_doeat, 'do_eat', '宜吃')\n", + "create_relationship('Department', 'Department', rels_department, 'belongs_to', '属于')\n", + "create_relationship('Disease', 'Drug', rels_commonddrug, 'common_drug', '常用药品')\n", + "create_relationship('Producer', 'Drug', rels_drug_producer, 'drugs_of', '生产药品')\n", + "create_relationship('Disease', 'Drug', rels_recommanddrug, 'recommand_drug', '好评药品')\n", + "create_relationship('Disease', 'Check', rels_check, 'need_check', '诊断检查')\n", + "create_relationship('Disease', 'Symptom', rels_symptom, 'has_symptom', '症状')\n", + "create_relationship('Disease', 'Disease', rels_acompany, 'acompany_with', '并发症')\n", + "create_relationship('Disease', 'Department', rels_category, 'belongs_to', '所属科室')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git "a/notebook_tutorials/\343\200\220C\343\200\221\346\216\242\347\264\242\347\237\245\350\257\206\345\233\276\350\260\261.ipynb" "b/notebook_tutorials/\343\200\220C\343\200\221\346\216\242\347\264\242\347\237\245\350\257\206\345\233\276\350\260\261.ipynb" new file mode 100644 index 0000000..5f649ea --- /dev/null +++ "b/notebook_tutorials/\343\200\220C\343\200\221\346\216\242\347\264\242\347\237\245\350\257\206\345\233\276\350\260\261.ipynb" @@ -0,0 +1,106 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Neo4j可视化\n", + "\n", + "可设置`Initial Node Display`为`800`,可视化全部节点\n", + "\n", + "设置节点颜色、大小" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## GraphXR三维知识图谱可视化\n", + "\n", + "https://app.graphxr.cn/" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Cypher 图数据库查询语句\n", + "\n", + "查看所有节点\n", + "\n", + "```\n", + "MATCH (n) RETURN n\n", + "```\n", + "\n", + "可视化知识图谱元数据图(Ontology)\n", + "```\n", + "CALL db.schema.visualization()\n", + "```\n", + "\n", + "\n", + "百日咳 和 血常规 的关系\n", + "```\n", + "MATCH (p:Disease {name:'百日咳'})-[]->(q:Check {name:'血常规'}) RETURN p,q\n", + "```\n", + "\n", + "所有疾病和对应的检查\n", + "```\n", + "MATCH (p:Disease)-[r:need_check]->(q:Check) RETURN p,q\n", + "```\n", + "\n", + "删除所有节点\n", + "```\n", + "MATCH (n) DETACH DELETE n\n", + "```" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 图数据挖掘\n", + "\n", + "Graph Apps --> Graph Apps Gallery --> Graph Data Science Playground-->安装\n", + "\n", + "节点重要性:Page Rank\n", + "\n", + "社群发现:Louvain\n", + "\n", + "图嵌入:Node2Vec" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git "a/notebook_tutorials/\343\200\220D\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272\345\256\214\346\225\264demo\344\275\223\351\252\214.ipynb" "b/notebook_tutorials/\343\200\220D\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272\345\256\214\346\225\264demo\344\275\223\351\252\214.ipynb" new file mode 100644 index 0000000..b9ccf6e --- /dev/null +++ "b/notebook_tutorials/\343\200\220D\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272\345\256\214\346\225\264demo\344\275\223\351\252\214.ipynb" @@ -0,0 +1,758 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## answer_search.py" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "from py2neo import Graph\n", + "\n", + "class AnswerSearcher:\n", + " def __init__(self):\n", + " # self.g = Graph(\"http://localhost:7474\", username=\"neo4j\", password=\"tangyudiadid0\")\n", + " self.g = Graph(\"http://localhost:7474\", auth=(\"neo4j\", \"111695\"))\n", + " self.num_limit = 20\n", + "\n", + " '''执行cypher查询,并返回相应结果'''\n", + " def search_main(self, sqls):\n", + " final_answers = []\n", + " for sql_ in sqls:\n", + " question_type = sql_['question_type']\n", + " queries = sql_['sql']\n", + " answers = []\n", + " for query in queries:\n", + " ress = self.g.run(query).data()\n", + " answers += ress\n", + " final_answer = self.answer_prettify(question_type, answers)\n", + " if final_answer:\n", + " final_answers.append(final_answer)\n", + " return final_answers\n", + "\n", + " '''根据对应的qustion_type,调用相应的回复模板'''\n", + " def answer_prettify(self, question_type, answers):\n", + " final_answer = []\n", + " if not answers:\n", + " return ''\n", + " if question_type == 'disease_symptom':\n", + " desc = [i['n.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}的症状包括:{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'symptom_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '症状{0}可能染上的疾病有:{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'disease_cause':\n", + " desc = [i['m.cause'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}可能的成因有:{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'disease_prevent':\n", + " desc = [i['m.prevent'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}的预防措施包括:{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'disease_lasttime':\n", + " desc = [i['m.cure_lasttime'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}治疗可能持续的周期为:{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'disease_cureway':\n", + " desc = [';'.join(i['m.cure_way']) for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}可以尝试如下治疗:{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'disease_cureprob':\n", + " desc = [i['m.cured_prob'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}治愈的概率为(仅供参考):{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'disease_easyget':\n", + " desc = [i['m.easy_get'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + "\n", + " final_answer = '{0}的易感人群包括:{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'disease_desc':\n", + " desc = [i['m.desc'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0},熟悉一下:{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'disease_acompany':\n", + " desc1 = [i['n.name'] for i in answers]\n", + " desc2 = [i['m.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " desc = [i for i in desc1 + desc2 if i != subject]\n", + " final_answer = '{0}的症状包括:{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'disease_not_food':\n", + " desc = [i['n.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}忌食的食物包括有:{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'disease_do_food':\n", + " do_desc = [i['n.name'] for i in answers if i['r.name'] == '宜吃']\n", + " recommand_desc = [i['n.name'] for i in answers if i['r.name'] == '推荐食谱']\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}宜食的食物包括有:{1}\\n推荐食谱包括有:{2}'.format(subject, ';'.join(list(set(do_desc))[:self.num_limit]), ';'.join(list(set(recommand_desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'food_not_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '患有{0}的人最好不要吃{1}'.format(';'.join(list(set(desc))[:self.num_limit]), subject)\n", + "\n", + " elif question_type == 'food_do_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '患有{0}的人建议多试试{1}'.format(';'.join(list(set(desc))[:self.num_limit]), subject)\n", + "\n", + " elif question_type == 'disease_drug':\n", + " desc = [i['n.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}通常的使用的药品包括:{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'drug_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '{0}主治的疾病有{1},可以试试'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'disease_check':\n", + " desc = [i['n.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}通常可以通过以下方式检查出来:{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'check_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '通常可以通过{0}检查出来的疾病有{1}'.format(subject, ';'.join(list(set(desc))[:self.num_limit]))\n", + "\n", + " return final_answer\n", + "\n", + "searcher = AnswerSearcher()\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## question_parser.py" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "class QuestionPaser:\n", + "\n", + " '''构建实体节点'''\n", + " def build_entitydict(self, args):\n", + " entity_dict = {}\n", + " for arg, types in args.items():\n", + " for type in types:\n", + " if type not in entity_dict:\n", + " entity_dict[type] = [arg]\n", + " else:\n", + " entity_dict[type].append(arg)\n", + "\n", + " return entity_dict\n", + "\n", + " '''解析主函数'''\n", + " def parser_main(self, res_classify):\n", + " args = res_classify['args']\n", + " entity_dict = self.build_entitydict(args)\n", + " question_types = res_classify['question_types']\n", + " sqls = []\n", + " for question_type in question_types:\n", + " sql_ = {}\n", + " sql_['question_type'] = question_type\n", + " sql = []\n", + " if question_type == 'disease_symptom':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + " elif question_type == 'symptom_disease':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('symptom'))\n", + "\n", + " elif question_type == 'disease_cause':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + " elif question_type == 'disease_acompany':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + " elif question_type == 'disease_not_food':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + " elif question_type == 'disease_do_food':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + " elif question_type == 'food_not_disease':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('food'))\n", + "\n", + " elif question_type == 'food_do_disease':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('food'))\n", + "\n", + " elif question_type == 'disease_drug':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + " elif question_type == 'drug_disease':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('drug'))\n", + "\n", + " elif question_type == 'disease_check':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + " elif question_type == 'check_disease':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('check'))\n", + "\n", + " elif question_type == 'disease_prevent':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + " elif question_type == 'disease_lasttime':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + " elif question_type == 'disease_cureway':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + " elif question_type == 'disease_cureprob':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + " elif question_type == 'disease_easyget':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + " elif question_type == 'disease_desc':\n", + " sql = self.sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + " if sql:\n", + " sql_['sql'] = sql\n", + "\n", + " sqls.append(sql_)\n", + "\n", + " return sqls\n", + "\n", + " '''针对不同的问题,分开进行处理'''\n", + " def sql_transfer(self, question_type, entities):\n", + " if not entities:\n", + " return []\n", + "\n", + " # 查询语句\n", + " sql = []\n", + " # 查询疾病的原因\n", + " if question_type == 'disease_cause':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.cause\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的防御措施\n", + " elif question_type == 'disease_prevent':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.prevent\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的持续时间\n", + " elif question_type == 'disease_lasttime':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.cure_lasttime\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的治愈概率\n", + " elif question_type == 'disease_cureprob':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.cured_prob\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的治疗方式\n", + " elif question_type == 'disease_cureway':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.cure_way\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的易发人群\n", + " elif question_type == 'disease_easyget':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.easy_get\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的相关介绍\n", + " elif question_type == 'disease_desc':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.desc\".format(i) for i in entities]\n", + "\n", + " # 查询疾病有哪些症状\n", + " elif question_type == 'disease_symptom':\n", + " sql = [\"MATCH (m:Disease)-[r:has_symptom]->(n:Symptom) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + "\n", + " # 查询症状会导致哪些疾病\n", + " elif question_type == 'symptom_disease':\n", + " sql = [\"MATCH (m:Disease)-[r:has_symptom]->(n:Symptom) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的并发症\n", + " elif question_type == 'disease_acompany':\n", + " sql1 = [\"MATCH (m:Disease)-[r:acompany_with]->(n:Disease) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql2 = [\"MATCH (m:Disease)-[r:acompany_with]->(n:Disease) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql = sql1 + sql2\n", + " # 查询疾病的忌口\n", + " elif question_type == 'disease_not_food':\n", + " sql = [\"MATCH (m:Disease)-[r:no_eat]->(n:Food) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + "\n", + " # 查询疾病建议吃的东西\n", + " elif question_type == 'disease_do_food':\n", + " sql1 = [\"MATCH (m:Disease)-[r:do_eat]->(n:Food) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql2 = [\"MATCH (m:Disease)-[r:recommand_eat]->(n:Food) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql = sql1 + sql2\n", + "\n", + " # 已知忌口查疾病\n", + " elif question_type == 'food_not_disease':\n", + " sql = [\"MATCH (m:Disease)-[r:no_eat]->(n:Food) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + "\n", + " # 已知推荐查疾病\n", + " elif question_type == 'food_do_disease':\n", + " sql1 = [\"MATCH (m:Disease)-[r:do_eat]->(n:Food) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql2 = [\"MATCH (m:Disease)-[r:recommand_eat]->(n:Food) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql = sql1 + sql2\n", + "\n", + " # 查询疾病常用药品-药品别名记得扩充\n", + " elif question_type == 'disease_drug':\n", + " sql1 = [\"MATCH (m:Disease)-[r:common_drug]->(n:Drug) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql2 = [\"MATCH (m:Disease)-[r:recommand_drug]->(n:Drug) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql = sql1 + sql2\n", + "\n", + " # 已知药品查询能够治疗的疾病\n", + " elif question_type == 'drug_disease':\n", + " sql1 = [\"MATCH (m:Disease)-[r:common_drug]->(n:Drug) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql2 = [\"MATCH (m:Disease)-[r:recommand_drug]->(n:Drug) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql = sql1 + sql2\n", + " # 查询疾病应该进行的检查\n", + " elif question_type == 'disease_check':\n", + " sql = [\"MATCH (m:Disease)-[r:need_check]->(n:Check) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + "\n", + " # 已知检查查询疾病\n", + " elif question_type == 'check_disease':\n", + " sql = [\"MATCH (m:Disease)-[r:need_check]->(n:Check) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + "\n", + " return sql" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## question_classifier.py" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import ahocorasick\n", + "\n", + "class QuestionClassifier:\n", + " def __init__(self):\n", + " # cur_dir = '/'.join(os.path.abspath(__file__).split('/')[:-1])\n", + " cur_dir = os.getcwd()\n", + " # 特征词路径\n", + " self.disease_path = os.path.join(cur_dir, 'dict/disease.txt')\n", + " self.department_path = os.path.join(cur_dir, 'dict/department.txt')\n", + " self.check_path = os.path.join(cur_dir, 'dict/check.txt')\n", + " self.drug_path = os.path.join(cur_dir, 'dict/drug.txt')\n", + " self.food_path = os.path.join(cur_dir, 'dict/food.txt')\n", + " self.producer_path = os.path.join(cur_dir, 'dict/producer.txt')\n", + " self.symptom_path = os.path.join(cur_dir, 'dict/symptom.txt')\n", + " self.deny_path = os.path.join(cur_dir, 'dict/deny.txt')\n", + " # 加载特征词\n", + " self.disease_wds= [i.strip() for i in open(self.disease_path,encoding=\"utf-8\") if i.strip()]#encoding=\"utf-8\"\n", + " self.department_wds= [i.strip() for i in open(self.department_path,encoding=\"utf-8\") if i.strip()]\n", + " self.check_wds= [i.strip() for i in open(self.check_path,encoding=\"utf-8\") if i.strip()]\n", + " self.drug_wds= [i.strip() for i in open(self.drug_path,encoding=\"utf-8\") if i.strip()]\n", + " self.food_wds= [i.strip() for i in open(self.food_path,encoding=\"utf-8\") if i.strip()]\n", + " self.producer_wds= [i.strip() for i in open(self.producer_path,encoding=\"utf-8\") if i.strip()]\n", + " self.symptom_wds= [i.strip() for i in open(self.symptom_path,encoding=\"utf-8\") if i.strip()]\n", + " self.region_words = set(self.department_wds + self.disease_wds + self.check_wds + self.drug_wds + self.food_wds + self.producer_wds + self.symptom_wds)\n", + " self.deny_words = [i.strip() for i in open(self.deny_path,encoding=\"utf-8\") if i.strip()]\n", + " # 构造领域actree\n", + " self.region_tree = self.build_actree(list(self.region_words))\n", + " # 构建词典\n", + " self.wdtype_dict = self.build_wdtype_dict()\n", + " # 问句疑问词\n", + " self.symptom_qwds = ['症状', '表征', '现象', '症候', '表现']\n", + " self.cause_qwds = ['原因','成因', '为什么', '怎么会', '怎样才', '咋样才', '怎样会', '如何会', '为啥', '为何', '如何才会', '怎么才会', '会导致', '会造成']\n", + " self.acompany_qwds = ['并发症', '并发', '一起发生', '一并发生', '一起出现', '一并出现', '一同发生', '一同出现', '伴随发生', '伴随', '共现']\n", + " self.food_qwds = ['饮食', '饮用', '吃', '食', '伙食', '膳食', '喝', '菜' ,'忌口', '补品', '保健品', '食谱', '菜谱', '食用', '食物','补品']\n", + " self.drug_qwds = ['药', '药品', '用药', '胶囊', '口服液', '炎片']\n", + " self.prevent_qwds = ['预防', '防范', '抵制', '抵御', '防止','躲避','逃避','避开','免得','逃开','避开','避掉','躲开','躲掉','绕开',\n", + " '怎样才能不', '怎么才能不', '咋样才能不','咋才能不', '如何才能不',\n", + " '怎样才不', '怎么才不', '咋样才不','咋才不', '如何才不',\n", + " '怎样才可以不', '怎么才可以不', '咋样才可以不', '咋才可以不', '如何可以不',\n", + " '怎样才可不', '怎么才可不', '咋样才可不', '咋才可不', '如何可不']\n", + " self.lasttime_qwds = ['周期', '多久', '多长时间', '多少时间', '几天', '几年', '多少天', '多少小时', '几个小时', '多少年']\n", + " self.cureway_qwds = ['怎么治疗', '如何医治', '怎么医治', '怎么治', '怎么医', '如何治', '医治方式', '疗法', '咋治', '怎么办', '咋办', '咋治']\n", + " self.cureprob_qwds = ['多大概率能治好', '多大几率能治好', '治好希望大么', '几率', '几成', '比例', '可能性', '能治', '可治', '可以治', '可以医']\n", + " self.easyget_qwds = ['易感人群', '容易感染', '易发人群', '什么人', '哪些人', '感染', '染上', '得上']\n", + " self.check_qwds = ['检查', '检查项目', '查出', '检查', '测出', '试出']\n", + " self.belong_qwds = ['属于什么科', '属于', '什么科', '科室']\n", + " self.cure_qwds = ['治疗什么', '治啥', '治疗啥', '医治啥', '治愈啥', '主治啥', '主治什么', '有什么用', '有何用', '用处', '用途',\n", + " '有什么好处', '有什么益处', '有何益处', '用来', '用来做啥', '用来作甚', '需要', '要']\n", + "\n", + " print('model init finished ......')\n", + "\n", + " return\n", + "\n", + " '''分类主函数'''\n", + " def classify(self, question):\n", + " data = {}\n", + " medical_dict = self.check_medical(question)\n", + " if not medical_dict:\n", + " return {}\n", + " data['args'] = medical_dict\n", + " #收集问句当中所涉及到的实体类型\n", + " types = []\n", + " for type_ in medical_dict.values():\n", + " types += type_\n", + " question_type = 'others'\n", + "\n", + " question_types = []\n", + "\n", + " # 症状\n", + " if self.check_words(self.symptom_qwds, question) and ('disease' in types):\n", + " question_type = 'disease_symptom'\n", + " question_types.append(question_type)\n", + "\n", + " if self.check_words(self.symptom_qwds, question) and ('symptom' in types):\n", + " question_type = 'symptom_disease'\n", + " question_types.append(question_type)\n", + "\n", + " # 原因\n", + " if self.check_words(self.cause_qwds, question) and ('disease' in types):\n", + " question_type = 'disease_cause'\n", + " question_types.append(question_type)\n", + " # 并发症\n", + " if self.check_words(self.acompany_qwds, question) and ('disease' in types):\n", + " question_type = 'disease_acompany'\n", + " question_types.append(question_type)\n", + "\n", + " # 推荐食品\n", + " if self.check_words(self.food_qwds, question) and 'disease' in types:\n", + " deny_status = self.check_words(self.deny_words, question)\n", + " if deny_status:\n", + " question_type = 'disease_not_food'\n", + " else:\n", + " question_type = 'disease_do_food'\n", + " question_types.append(question_type)\n", + "\n", + " #已知食物找疾病\n", + " if self.check_words(self.food_qwds+self.cure_qwds, question) and 'food' in types:\n", + " deny_status = self.check_words(self.deny_words, question)\n", + " if deny_status:\n", + " question_type = 'food_not_disease'\n", + " else:\n", + " question_type = 'food_do_disease'\n", + " question_types.append(question_type)\n", + "\n", + " # 推荐药品\n", + " if self.check_words(self.drug_qwds, question) and 'disease' in types:\n", + " question_type = 'disease_drug'\n", + " question_types.append(question_type)\n", + "\n", + " # 药品治啥病\n", + " if self.check_words(self.cure_qwds, question) and 'drug' in types:\n", + " question_type = 'drug_disease'\n", + " question_types.append(question_type)\n", + "\n", + " # 疾病接受检查项目\n", + " if self.check_words(self.check_qwds, question) and 'disease' in types:\n", + " question_type = 'disease_check'\n", + " question_types.append(question_type)\n", + "\n", + " # 已知检查项目查相应疾病\n", + " if self.check_words(self.check_qwds+self.cure_qwds, question) and 'check' in types:\n", + " question_type = 'check_disease'\n", + " question_types.append(question_type)\n", + "\n", + " # 症状防御\n", + " if self.check_words(self.prevent_qwds, question) and 'disease' in types:\n", + " question_type = 'disease_prevent'\n", + " question_types.append(question_type)\n", + "\n", + " # 疾病医疗周期\n", + " if self.check_words(self.lasttime_qwds, question) and 'disease' in types:\n", + " question_type = 'disease_lasttime'\n", + " question_types.append(question_type)\n", + "\n", + " # 疾病治疗方式\n", + " if self.check_words(self.cureway_qwds, question) and 'disease' in types:\n", + " question_type = 'disease_cureway'\n", + " question_types.append(question_type)\n", + "\n", + " # 疾病治愈可能性\n", + " if self.check_words(self.cureprob_qwds, question) and 'disease' in types:\n", + " question_type = 'disease_cureprob'\n", + " question_types.append(question_type)\n", + "\n", + " # 疾病易感染人群\n", + " if self.check_words(self.easyget_qwds, question) and 'disease' in types :\n", + " question_type = 'disease_easyget'\n", + " question_types.append(question_type)\n", + "\n", + " # 若没有查到相关的外部查询信息,那么则将该疾病的描述信息返回\n", + " if question_types == [] and 'disease' in types:\n", + " question_types = ['disease_desc']\n", + "\n", + " # 若没有查到相关的外部查询信息,那么则将该疾病的描述信息返回\n", + " if question_types == [] and 'symptom' in types:\n", + " question_types = ['symptom_disease']\n", + "\n", + " # 将多个分类结果进行合并处理,组装成一个字典\n", + " data['question_types'] = question_types\n", + "\n", + " return data\n", + "\n", + " '''构造词对应的类型'''\n", + " def build_wdtype_dict(self):\n", + " wd_dict = dict()\n", + " for wd in self.region_words:\n", + " wd_dict[wd] = []\n", + " if wd in self.disease_wds:\n", + " wd_dict[wd].append('disease')\n", + " if wd in self.department_wds:\n", + " wd_dict[wd].append('department')\n", + " if wd in self.check_wds:\n", + " wd_dict[wd].append('check')\n", + " if wd in self.drug_wds:\n", + " wd_dict[wd].append('drug')\n", + " if wd in self.food_wds:\n", + " wd_dict[wd].append('food')\n", + " if wd in self.symptom_wds:\n", + " wd_dict[wd].append('symptom')\n", + " if wd in self.producer_wds:\n", + " wd_dict[wd].append('producer')\n", + " return wd_dict\n", + "\n", + " '''构造actree,加速过滤'''\n", + " def build_actree(self, wordlist):\n", + " actree = ahocorasick.Automaton()\n", + " for index, word in enumerate(wordlist):\n", + " actree.add_word(word, (index, word))\n", + " actree.make_automaton()\n", + " return actree\n", + "\n", + " '''问句过滤'''\n", + " def check_medical(self, question):\n", + " region_wds = []\n", + " for i in self.region_tree.iter(question):\n", + " wd = i[1][1]\n", + " region_wds.append(wd)\n", + " stop_wds = []\n", + " for wd1 in region_wds:\n", + " for wd2 in region_wds:\n", + " if wd1 in wd2 and wd1 != wd2:\n", + " stop_wds.append(wd1)\n", + " final_wds = [i for i in region_wds if i not in stop_wds]\n", + " final_dict = {i:self.wdtype_dict.get(i) for i in final_wds}\n", + "\n", + " return final_dict\n", + "\n", + " '''基于特征词进行分类'''\n", + " def check_words(self, wds, sent):\n", + " for wd in wds:\n", + " if wd in sent:\n", + " return True\n", + " return False" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "os.chdir('QAMedicalKG')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 实例化辅助函数" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "model init finished ......\n" + ] + } + ], + "source": [ + "classifier = QuestionClassifier()\n", + "\n", + "parser = QuestionPaser()\n", + "\n", + "searcher = AnswerSearcher()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 输入问题" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "question = '肺气肿不能吃什么'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 从问题中提取实体和关系" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "res_classify = classifier.classify(question)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'args': {'肺气肿': ['disease']}, 'question_types': ['disease_not_food']}" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "res_classify" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 问题解析-生成Cypher查询语句" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "res_cypher = parser.parser_main(res_classify)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'question_type': 'disease_not_food',\n", + " 'sql': [\"MATCH (m:Disease)-[r:no_eat]->(n:Food) where m.name = '肺气肿' return m.name, r.name, n.name\"]}]" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "res_cypher" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 生成回答" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "final_answers = searcher.search_main(res_cypher)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['肺气肿忌食的食物包括有:带鱼;圆白菜;海虾;羊肉(瘦)']" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "final_answers" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git "a/notebook_tutorials/\343\200\220E\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272-\346\217\220\345\217\226\351\227\256\351\242\230\347\233\270\345\205\263\345\256\236\344\275\223\345\222\214\345\205\263\347\263\273.ipynb" "b/notebook_tutorials/\343\200\220E\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272-\346\217\220\345\217\226\351\227\256\351\242\230\347\233\270\345\205\263\345\256\236\344\275\223\345\222\214\345\205\263\347\263\273.ipynb" new file mode 100644 index 0000000..6a61a4f --- /dev/null +++ "b/notebook_tutorials/\343\200\220E\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272-\346\217\220\345\217\226\351\227\256\351\242\230\347\233\270\345\205\263\345\256\236\344\275\223\345\222\214\345\205\263\347\263\273.ipynb" @@ -0,0 +1,1676 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 问答机器人-从问题中提取相关实体和关系\n", + "\n", + "[同济子豪兄](https://space.bilibili.com/1900783) 2022-6-25" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 导入工具包" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import ahocorasick\n", + "from tqdm import tqdm" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 进入主目录" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "os.chdir('QAMedicalKG')" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "cur_dir = os.getcwd()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 载入所有特征词" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "# 特征词txt文件路径\n", + "disease_path = os.path.join(cur_dir, 'dict/disease.txt')\n", + "department_path = os.path.join(cur_dir, 'dict/department.txt')\n", + "check_path = os.path.join(cur_dir, 'dict/check.txt')\n", + "drug_path = os.path.join(cur_dir, 'dict/drug.txt')\n", + "food_path = os.path.join(cur_dir, 'dict/food.txt')\n", + "producer_path = os.path.join(cur_dir, 'dict/producer.txt')\n", + "symptom_path = os.path.join(cur_dir, 'dict/symptom.txt')\n", + "deny_path = os.path.join(cur_dir, 'dict/deny.txt')" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "# 加载特征词\n", + "disease_wds = [i.strip() for i in open(disease_path,encoding=\"utf-8\") if i.strip()]\n", + "department_wds = [i.strip() for i in open(department_path,encoding=\"utf-8\") if i.strip()]\n", + "check_wds = [i.strip() for i in open(check_path,encoding=\"utf-8\") if i.strip()]\n", + "drug_wds = [i.strip() for i in open(drug_path,encoding=\"utf-8\") if i.strip()]\n", + "food_wds = [i.strip() for i in open(food_path,encoding=\"utf-8\") if i.strip()]\n", + "producer_wds = [i.strip() for i in open(producer_path,encoding=\"utf-8\") if i.strip()]\n", + "symptom_wds = [i.strip() for i in open(symptom_path,encoding=\"utf-8\") if i.strip()]\n", + "region_words = set(disease_wds + department_wds + check_wds + drug_wds + food_wds + producer_wds + symptom_wds)\n", + "deny_words = [i.strip() for i in open(deny_path,encoding=\"utf-8\") if i.strip()]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 所有实体对应的类型" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "100%|██████████| 43430/43430 [00:19<00:00, 2280.73it/s]\n" + ] + } + ], + "source": [ + "wdtype_dict = dict()\n", + "for word in tqdm(region_words):\n", + " wdtype_dict[word] = []\n", + " if word in disease_wds:\n", + " wdtype_dict[word].append('disease')\n", + " if word in department_wds:\n", + " wdtype_dict[word].append('department')\n", + " if word in check_wds:\n", + " wdtype_dict[word].append('check')\n", + " if word in drug_wds:\n", + " wdtype_dict[word].append('drug')\n", + " if word in food_wds:\n", + " wdtype_dict[word].append('food')\n", + " if word in symptom_wds:\n", + " wdtype_dict[word].append('symptom')\n", + " if word in producer_wds:\n", + " wdtype_dict[word].append('producer')" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'宜昌人福复方磺胺甲噁唑片': ['producer'],\n", + " '鱼香青豆': ['food'],\n", + " '卡铂注射液': ['drug'],\n", + " '拔牙后出血不止': ['symptom'],\n", + " '吉林海外狼疮丸': ['producer'],\n", + " '大连美罗小儿盐酸赖氨酸颗粒': ['producer'],\n", + " '肺毛霉病': ['disease'],\n", + " '小儿遗传性果糖不耐受': ['disease'],\n", + " '小儿止咳糖浆': ['drug'],\n", + " '五果冰糖羹': ['food'],\n", + " '大同星宇星火右旋糖酐20葡': ['producer'],\n", + " '先强药业注射用盐酸甲氯芬酯': ['producer'],\n", + " '小儿严重急性呼吸综合征': ['disease'],\n", + " '淋病性关节炎': ['disease'],\n", + " '白大衣高血压': ['disease'],\n", + " '武汉普生注射用盐酸克林霉素': ['producer'],\n", + " '哥台': ['producer'],\n", + " '右下腹可触及柔...': ['symptom'],\n", + " '四川绿叶宝光利肝隆片': ['producer'],\n", + " '协一力利鲁唑片': ['producer'],\n", + " '卫算苏': ['producer'],\n", + " '红烧牛肚': ['food'],\n", + " '江西赣南海欣转移因子口服溶': ['producer'],\n", + " '牛黄解毒丸': ['drug'],\n", + " '溃疡分枝杆菌感染': ['disease'],\n", + " '胺试验': ['check'],\n", + " '胃内异物': ['disease'],\n", + " '拔丝土豆': ['food'],\n", + " '禾丰盐酸洛贝林注射液': ['producer'],\n", + " '重酒石酸卡巴拉汀胶囊': ['drug'],\n", + " '台城制药西咪替丁片': ['producer'],\n", + " '可谱妥': ['producer'],\n", + " '厌氧菌肺炎': ['disease'],\n", + " '行为无计划性': ['symptom'],\n", + " '华青红霉素眼膏': ['producer'],\n", + " '西南药业盐酸苯海拉明注射液': ['producer'],\n", + " '循环血浆量': ['check'],\n", + " '吉贝尔药业醋酸甲萘氢醌片': ['producer'],\n", + " '南京白敬宇醋酸甲萘氢醌片': ['producer'],\n", + " '康圣堂藿香正气水': ['producer'],\n", + " '江苏万高产妇安颗粒': ['producer'],\n", + " '孔圣堂制药杞菊地黄丸': ['producer'],\n", + " '奔豚气': ['disease'],\n", + " '获得性免疫缺陷综合征视网膜病变': ['disease'],\n", + " '慢性乳头状溃疡性脓皮病': ['disease'],\n", + " '庆瑞金荞麦片': ['producer'],\n", + " '四叠体受压': ['symptom'],\n", + " '利莎林阿莫西林分散片': ['producer'],\n", + " '碑林金嗓散结丸': ['producer'],\n", + " '常州制药卡托普利片': ['producer'],\n", + " '鼾症': ['disease'],\n", + " '九旭药业盐酸布比卡因注射液': ['producer'],\n", + " '炖猪腰': ['food'],\n", + " '脉络膜脱离型视网膜脱离': ['disease'],\n", + " '新生儿少吃': ['symptom'],\n", + " '卡托普利片': ['drug'],\n", + " '手指歪斜': ['symptom'],\n", + " '顽固性头痛': ['symptom'],\n", + " '盲肠阿米巴肉芽肿': ['disease', 'symptom'],\n", + " '北京同仁堂润肌皮肤膏': ['producer'],\n", + " '豆皮饭': ['food'],\n", + " '蛋麦糊': ['food'],\n", + " '婴儿睡觉不踏实': ['symptom'],\n", + " '彼迪药业托西酸舒他西林胶囊': ['producer'],\n", + " '腹部透视': ['check'],\n", + " '瑞尔医药盐酸班布特罗片': ['producer'],\n", + " '蜜汁山楂': ['food'],\n", + " '桂林兴达硫酸锌片': ['producer'],\n", + " '表皮全层坏死及...': ['symptom'],\n", + " '明日制药过氧化氢溶液': ['producer'],\n", + " '猪肉大葱蒸饺': ['food'],\n", + " '康惠制药积雪苷霜软膏': ['producer'],\n", + " '山东信谊硝酸甘油片': ['producer'],\n", + " '小儿狂犬病': ['disease'],\n", + " '蘑菇瘦肉汤': ['food'],\n", + " '天津金耀奋乃静注射液': ['producer'],\n", + " '坐骨神经盆腔出口狭窄症': ['disease'],\n", + " '依静': ['producer'],\n", + " '下腹部压痛': ['symptom'],\n", + " '江苏恩华氯氮平片': ['producer'],\n", + " '甘肃兰药依托泊苷注射液': ['producer'],\n", + " '硫酸氢氯吡格雷片': ['drug'],\n", + " '喉疾灵片': ['drug'],\n", + " '小儿戈谢病': ['disease'],\n", + " '肾盂内压测定': ['check'],\n", + " '肝外胆管结石': ['symptom'],\n", + " '康定金珠小金丸': ['producer'],\n", + " '浅表性皮肤脂肪瘤痣': ['disease'],\n", + " '口腔难愈的白色片状物': ['symptom'],\n", + " '凉拌木耳菜': ['food'],\n", + " '立庆': ['producer'],\n", + " '信谊醋酸地塞米松片': ['producer'],\n", + " '颈静脉检查': ['check'],\n", + " '君碧莎消癌平片': ['producer'],\n", + " '鲜蚕豆紫菜汤': ['food'],\n", + " '浙江莎普爱思氟康唑滴眼液': ['producer'],\n", + " '联环药业盐酸多西环素片': ['producer'],\n", + " '水晶菠萝': ['food'],\n", + " '仙琚制药克霉唑倍他米松乳膏': ['producer'],\n", + " '心脉安片': ['drug'],\n", + " '咽炎': ['disease'],\n", + " '陕西京西肌苷注射液': ['producer'],\n", + " '海参笋肉丝汤': ['food'],\n", + " '珠蛋白生成障碍性贫血视网膜病变': ['disease'],\n", + " '尿道口疼': ['symptom'],\n", + " '抗胃壁细胞抗体(APCA)': ['check'],\n", + " '芜湖张恒春香砂养胃丸': ['producer'],\n", + " '海鲸药业维生素A软胶囊': ['producer'],\n", + " '信谊金朱甲硫酸新斯的明注射': ['producer'],\n", + " '人福成田药业对乙酰氨基酚栓': ['producer'],\n", + " '东信氟康唑片': ['producer'],\n", + " '商建磊': ['symptom'],\n", + " '粪便中查见虫卵...': ['symptom'],\n", + " '尺压试验': ['check'],\n", + " '肱骨髁间骨折': ['disease'],\n", + " '华北制药两性霉素B阴道泡腾': ['producer'],\n", + " '高度近视': ['disease'],\n", + " '充血性脾肿大': ['disease'],\n", + " '恒诚制药结石通片': ['producer'],\n", + " '促肾上腺皮质激素(ACTH)兴奋试验': ['check'],\n", + " '胆道支架引流(ERBD)': ['check'],\n", + " '八珍益母丸': ['drug'],\n", + " '角膜烧伤': ['symptom'],\n", + " '干贝': ['food'],\n", + " '爱普森药业阿奇霉素片': ['producer'],\n", + " '脊髓前中央动脉缺血症候群': ['disease'],\n", + " '联环药业达那唑胶囊': ['producer'],\n", + " '小儿七星茶颗粒': ['drug'],\n", + " '直接胆红素与总胆红素比值': ['check'],\n", + " '豆腐炖猪蹄': ['food'],\n", + " 'SP': ['drug'],\n", + " '尿黑素': ['check'],\n", + " '毛囊瘤': ['disease'],\n", + " 'Zieve综合征': ['disease'],\n", + " '强酸类中毒': ['disease'],\n", + " '渴络欣胶囊': ['drug'],\n", + " '广西恒拓罗汉果止咳糖浆': ['producer'],\n", + " '重庆希尔安黄柏胶囊': ['producer'],\n", + " '反社会人格障碍(病态人格)': ['disease'],\n", + " '眼压计测量法': ['check'],\n", + " '先天性腹壁肌肉发育不良': ['disease'],\n", + " '重庆药友高三尖杉酯碱注射液': ['producer'],\n", + " '舌静脉曲张': ['disease'],\n", + " '注射用盐酸氨溴索': ['drug'],\n", + " '硼酸软膏': ['drug'],\n", + " '云中山活血通脉胶囊': ['producer'],\n", + " '脚趾痛风': ['symptom'],\n", + " '白云峰双氯芬酸钠肠溶片': ['producer'],\n", + " '反复发作右肺感染': ['symptom'],\n", + " '福元药业阿昔洛韦乳膏': ['producer'],\n", + " '颅骨透照试验': ['check'],\n", + " '肢端肥大症性心肌病': ['disease'],\n", + " '持续性头晕': ['symptom'],\n", + " '足跟步行': ['symptom'],\n", + " '缩宫素激惹试验': ['check'],\n", + " '挤压伤': ['symptom'],\n", + " '虫卵计数法': ['check'],\n", + " '膝关节半月板损伤': ['disease'],\n", + " '圣华金归洗液': ['producer'],\n", + " '华北制药注射用硫酸链霉素': ['producer'],\n", + " '替加氟片': ['drug'],\n", + " '口甜': ['symptom'],\n", + " '小儿新变异型克罗伊茨费尔特-雅各布病': ['disease'],\n", + " '吉春制药胎宝胶囊': ['producer'],\n", + " '皮肤科': ['department'],\n", + " '绿豆沙': ['food'],\n", + " '南国药业复方愈创木酚磺酸钾': ['producer'],\n", + " '颐海药业大黄蛰虫丸': ['producer'],\n", + " '片吸虫病': ['disease'],\n", + " '天津和治药业集团消癌平片': ['producer'],\n", + " '小儿慢性胃炎': ['disease'],\n", + " '急性化脓性腱鞘炎': ['disease'],\n", + " '白细胞介素4(iL-4)': ['check'],\n", + " '硫酸沙丁胺醇片': ['drug'],\n", + " '清汤全家福': ['food'],\n", + " '四川明欣丁酸氢化可的松乳膏': ['producer'],\n", + " '脾肾阳虚': ['symptom'],\n", + " '黄体功能不全性不孕': ['disease'],\n", + " '东乐制药盐酸黄酮哌酯片': ['producer'],\n", + " '颈短': ['symptom'],\n", + " '天津金虹胜利氧氟沙星片': ['producer'],\n", + " '急性特发性心包炎': ['disease'],\n", + " '信谊螺内酯片': ['producer'],\n", + " '普华克胜双氯芬酸钠滴眼液': ['producer'],\n", + " '迪沙药业格列吡嗪片': ['producer'],\n", + " '华润紫竹药业扑米酮片': ['producer'],\n", + " '国瑞琥乙红霉素片': ['producer'],\n", + " '酿枇杷': ['food'],\n", + " '间质性膀胱炎': ['disease'],\n", + " '北京双鹤药业泼尼松龙片': ['producer'],\n", + " '枸杞子炒猪肝': ['food'],\n", + " '河北爱尔海泰盐酸纳洛酮注射': ['producer'],\n", + " '中气不足': ['disease'],\n", + " '跟腱断裂': ['disease'],\n", + " '脉络膜炎': ['disease'],\n", + " '盆腔MRI检查': ['check'],\n", + " '肾小球滤过率下降': ['symptom'],\n", + " 'Pancoast综合征': ['disease'],\n", + " '间歇性跛行': ['symptom'],\n", + " '盐酸溴己新片': ['drug'],\n", + " '结核性苔藓': ['disease'],\n", + " '乳头发炎': ['symptom'],\n", + " '山西临汾盐酸苯海索片': ['producer'],\n", + " '性施虐癖': ['symptom'],\n", + " '海胆刺伤及海胆肉芽肿': ['disease'],\n", + " '皮肤颌口虫病': ['disease'],\n", + " '银朵兰维药百癣夏塔热片': ['producer'],\n", + " '桔汁白菜': ['food'],\n", + " '人蠕形螨病': ['disease'],\n", + " '炒金针菇': ['food'],\n", + " '天圣药业葡萄糖注射液': ['producer'],\n", + " '局部麻醉药中毒': ['disease'],\n", + " '鱼鳞病片': ['drug'],\n", + " '九连山药业安胎丸': ['producer'],\n", + " '单发脑梗死性痴呆': ['disease'],\n", + " '坏死性脉管炎': ['disease'],\n", + " '结节性硬化症': ['disease'],\n", + " '上海中西磷酸伯氨喹片': ['producer'],\n", + " '尿液肉眼检查': ['check'],\n", + " '捷凝': ['producer'],\n", + " '鳖甲炖鸽': ['food'],\n", + " '固肠止泻丸': ['drug'],\n", + " '泛发性红色斑块': ['symptom'],\n", + " '盐酸金刚乙胺口服溶液': ['drug'],\n", + " '牛黄上清片': ['drug'],\n", + " '顽固性肥胖': ['symptom'],\n", + " '膈肌麻痹': ['disease'],\n", + " '依折麦布片': ['drug'],\n", + " '注射用达卡巴嗪': ['drug'],\n", + " '黄疸性肝炎': ['disease'],\n", + " '琦宁复方倍氯米松樟脑乳膏': ['producer'],\n", + " '放射过敏原吸附试验(RAST)': ['check'],\n", + " '紫荆花药业苦参碱氯化钠注射': ['producer'],\n", + " '小儿青盲': ['symptom'],\n", + " '口唇发黄': ['symptom'],\n", + " '畅维禧': ['producer'],\n", + " '先天性膝关节脱位': ['disease'],\n", + " '海山药业普拉洛芬滴眼液': ['producer'],\n", + " '白扁豆粥': ['food'],\n", + " '潜江制药葡萄糖注射液': ['producer'],\n", + " '眼睑湿疹': ['disease'],\n", + " '丰海复方尿囊素片': ['producer'],\n", + " '颈部血管损伤': ['disease'],\n", + " '岳嗣凤': ['symptom'],\n", + " '凉拌海蜇': ['food'],\n", + " '双颌前突': ['disease'],\n", + " '老年人肺脓肿': ['disease'],\n", + " '室性并行心律及室性并行心律性心动过速': ['disease'],\n", + " '支气管舒张试验': ['check'],\n", + " '肉末南瓜': ['food'],\n", + " '葵花药业依托红霉素颗粒': ['producer'],\n", + " '金泽冠心胶囊': ['drug'],\n", + " '国药国瑞注射用克林霉素磷酸': ['producer'],\n", + " '芹菜炒蛋': ['food'],\n", + " '湖南康尔佳宁心宝胶囊': ['producer'],\n", + " '华润双鹤鱼肝油酸钠注射液': ['producer'],\n", + " '西南药业异烟肼片': ['producer'],\n", + " '依托红霉素颗粒': ['drug'],\n", + " '肾实质性高血压': ['disease'],\n", + " '陕西君寿堂接骨续筋片': ['producer'],\n", + " '白玉红油豆腐': ['food'],\n", + " '德源药业甲钴胺胶囊': ['producer'],\n", + " '川贝清肺糖浆': ['drug'],\n", + " '甲沟炎和甲下脓肿': ['disease'],\n", + " '青红萝卜猪脚蚝豉汤': ['food'],\n", + " '运动性疲劳': ['symptom'],\n", + " '冠状动脉异位起源': ['disease'],\n", + " 'Ⅰ型超敏反应性疾病': ['disease'],\n", + " '羰基镍中毒': ['disease'],\n", + " '婴儿厌食': ['symptom'],\n", + " '九芝堂足光散': ['producer'],\n", + " '鲜藕素排骨': ['food'],\n", + " '下腰部疼痛': ['symptom'],\n", + " '麦克马瑞试验': ['check'],\n", + " '成都第一吡喹酮片': ['producer'],\n", + " '顽固性疼痛': ['symptom'],\n", + " '足底脱皮': ['symptom'],\n", + " '陕西白云灵仙跌打片': ['producer'],\n", + " '先天性二尖瓣畸形': ['disease'],\n", + " '前臂旋转痛': ['symptom'],\n", + " '硝酸布康唑阴道乳膏': ['drug'],\n", + " '硬脑膜下血肿': ['disease'],\n", + " '鼻肿瘤': ['disease'],\n", + " '踝部凹陷性水肿': ['symptom'],\n", + " '手掌疤痕畸形': ['symptom'],\n", + " '提腿试验': ['check'],\n", + " '消炎退热颗粒': ['drug'],\n", + " '风秘': ['disease'],\n", + " '石药集团注射用头孢呋辛钠': ['producer'],\n", + " '安徽东盛吡喹酮片': ['producer'],\n", + " '小儿肺泡性蛋白沉积症': ['disease'],\n", + " '泽兰红枣茶': ['food'],\n", + " '妊娠合并动脉导管未闭': ['disease'],\n", + " '胎痣': ['symptom'],\n", + " '剥脱性皮炎': ['disease', 'symptom'],\n", + " '尿道与阴茎结核': ['disease'],\n", + " '丹鹿通督片': ['drug'],\n", + " '石药集团江西金芙蓉药业甘草': ['producer'],\n", + " '乳腺小叶增生': ['symptom'],\n", + " '尿总氮': ['check'],\n", + " '尿游离皮质醇(UFC)': ['check'],\n", + " '仁济制药布洛芬片': ['producer'],\n", + " '梅毒确诊试验': ['check'],\n", + " '新生儿脐炎': ['disease'],\n", + " '消脂番茄木耳豆腐汤': ['food'],\n", + " '拌荠菜': ['food'],\n", + " '银诺克清胰利胆颗粒': ['producer'],\n", + " '山东威高维生素E软胶囊': ['producer'],\n", + " '耳廓软骨膜炎': ['disease'],\n", + " '白云山制药总厂三磷酸腺苷二': ['producer'],\n", + " '糖醋红柿子椒': ['food'],\n", + " '万辉双鹤四维他胶囊': ['producer'],\n", + " '风寒感冒': ['disease'],\n", + " '结核性肠系膜淋巴结炎': ['disease'],\n", + " '糖醋三文鱼': ['food'],\n", + " '脾胃舒丸': ['drug'],\n", + " '番茄洋葱芹菜汁': ['food'],\n", + " '海凌依': ['producer'],\n", + " '美大康利巴韦林片': ['producer'],\n", + " '上肢水肿': ['symptom'],\n", + " '烯丙雌醇片': ['drug'],\n", + " '葡萄球菌食物中毒': ['disease'],\n", + " '外伤性脑膜炎': ['disease'],\n", + " '百合熟地鸡蛋汤': ['food'],\n", + " '直肠膨出': ['disease'],\n", + " '湖南九典制药金刚藤咀嚼片': ['producer'],\n", + " '津华晖星维生素B1片': ['producer'],\n", + " '康惠制药宁神灵颗粒': ['producer'],\n", + " '瘀血头痛': ['disease'],\n", + " '五香芹菜豆': ['food'],\n", + " '东康药业复方磺胺甲噁唑片': ['producer'],\n", + " '天津力生制药奋乃静片': ['producer'],\n", + " '小儿唐氏综合征': ['disease'],\n", + " '兰药药业硬脂酸红霉素片': ['producer'],\n", + " '益馨康麝香抗栓胶囊': ['producer'],\n", + " '踝膝关节积液': ['symptom'],\n", + " '山西汾河硝苯地平片': ['producer'],\n", + " '脱水': ['disease', 'symptom'],\n", + " '胆胃康胶囊': ['drug'],\n", + " '热带性出汗不良': ['disease'],\n", + " '山药桂圆炖甲鱼': ['food'],\n", + " '单纯性寰枢椎脱位': ['disease'],\n", + " '远大医药肾上腺色腙片': ['producer'],\n", + " '肝窦扩张': ['symptom'],\n", + " '指甲呈扇形': ['symptom'],\n", + " '盐酸阿普林定片': ['drug'],\n", + " '尿5-羟吲哚乙酸': ['check'],\n", + " '武汉中联枸橼酸铋钾颗粒': ['producer'],\n", + " '老年人酒精性心脏病': ['disease'],\n", + " '国药国瑞注射用盐酸丁咯地尔': ['producer'],\n", + " '新华制药醋酸可的松片': ['producer'],\n", + " '腹壁血栓性静脉炎': ['disease'],\n", + " '肩胛带肌肉萎缩': ['symptom'],\n", + " '里急后重': ['symptom'],\n", + " '肩胛放射性疼痛': ['symptom'],\n", + " '河北京京过氧化氢溶液': ['producer'],\n", + " '脉率增快': ['symptom'],\n", + " '小儿肠系膜淋巴结结核': ['disease'],\n", + " '枸橼酸莫沙必利分散片': ['drug'],\n", + " '耳闷': ['symptom'],\n", + " '山东鲁抗头孢氨苄胶囊': ['producer'],\n", + " '复方青黛片': ['drug'],\n", + " '人福药业注射用硝普钠': ['producer'],\n", + " '尿黑酸': ['symptom'],\n", + " '北京益民氯氮平片': ['producer'],\n", + " '牛肉煎包': ['food'],\n", + " '北京顺鑫祥云盐酸胺碘酮片': ['producer'],\n", + " '科瑞德盐酸替扎尼定片': ['producer'],\n", + " '香菇拌豆角': ['food'],\n", + " '甲状腺血流显像': ['check'],\n", + " '镇痛剂肾病': ['disease'],\n", + " '丹毒丝菌病': ['disease'],\n", + " '酊剂': ['drug'],\n", + " '前列腺快感': ['symptom'],\n", + " '盐酸奥洛他定胶囊': ['drug'],\n", + " '注射用盐酸多西环素': ['drug'],\n", + " '非典': ['disease'],\n", + " '中性胰岛素注射液': ['drug', 'producer'],\n", + " '肺和胸膜叩诊': ['check'],\n", + " '小儿牛黄散': ['drug'],\n", + " '新百药业注射用胸腺肽': ['producer'],\n", + " '稽留热': ['symptom'],\n", + " '顿呛': ['disease'],\n", + " '鲫鱼菠菜豆腐汤': ['food'],\n", + " '缩泉胶囊': ['drug'],\n", + " '手套或短袜子式...': ['symptom'],\n", + " '西安汉丰盐酸妥洛特罗片': ['producer'],\n", + " '脉络膜缺损': ['disease'],\n", + " '凤凰白云山药业十全大补膏': ['producer'],\n", + " '国润制药维生素B12片': ['producer'],\n", + " '大峻除脂生发片': ['producer'],\n", + " '小儿先天性肾上腺皮质增生症': ['disease'],\n", + " '石药桂利嗪片': ['producer'],\n", + " '海王金象中药五子衍宗丸': ['producer'],\n", + " '朝阳德远雷公藤多苷片': ['producer'],\n", + " '云芝肝泰颗粒': ['drug'],\n", + " '江西红星口服五维葡萄糖': ['producer'],\n", + " '西南药业氟尿嘧啶注射液': ['producer'],\n", + " '万邦德贞芪扶正颗粒': ['producer'],\n", + " '口干': ['symptom'],\n", + " '西安安健盐酸左旋咪唑片': ['producer'],\n", + " '北京中新药业二维葡醛内酯片': ['producer'],\n", + " '慢性附睾炎': ['disease'],\n", + " '单纯疱疹病毒性巩膜炎': ['disease'],\n", + " '北京中新维生素B2片': ['producer'],\n", + " '通宣理肺丸': ['drug'],\n", + " '虾米拌圆白菜': ['food'],\n", + " '山东鲁抗替硝唑片': ['producer'],\n", + " '男型骨盆': ['symptom'],\n", + " '淀粉样变病和淀粉样关节病': ['disease'],\n", + " '虾仁': ['food'],\n", + " '北京同仁堂养阴清肺丸': ['producer'],\n", + " '膀胱颈挛缩': ['disease'],\n", + " '惠州九惠轻身消胖丸': ['producer'],\n", + " '嗅神经检查': ['check'],\n", + " '同德药业利多卡因氯己定气雾': ['producer'],\n", + " '重庆希尔安蒲公英颗粒': ['producer'],\n", + " '甲状腺功能异常伴发的精神障碍': ['disease'],\n", + " '小儿肠旋转不良': ['disease'],\n", + " '心阴虚': ['disease'],\n", + " '总甲状腺素': ['check'],\n", + " '达维邦': ['producer'],\n", + " '抗内膜抗体阳性': ['symptom'],\n", + " '湖南德康消癌平片': ['producer'],\n", + " '肺蛔虫病': ['disease'],\n", + " '跨海生化双氯芬酸钠肠溶片': ['producer'],\n", + " '温州海鹤小儿肠胃康颗粒': ['producer'],\n", + " '喉部堵塞感': ['symptom'],\n", + " '太康海恩甲硝唑片': ['producer'],\n", + " '失用步态': ['symptom'],\n", + " '肺动脉发育不全': ['disease'],\n", + " '中山市恒生药业银黄颗粒': ['producer'],\n", + " '黄色肉芽肿性肾盂肾炎': ['disease'],\n", + " '蜂窝肺': ['symptom'],\n", + " '西南药业维生素B2注射液': ['producer'],\n", + " '氯氮平片': ['drug'],\n", + " '随意运动检查': ['check'],\n", + " '哈药总厂富马酸亚铁颗粒': ['producer'],\n", + " '北京同仁堂小儿健脾丸': ['producer'],\n", + " '白果鸡汤': ['food'],\n", + " '精血不足': ['symptom'],\n", + " '清炒茼蒿菜': ['food'],\n", + " '小儿急性肠系膜淋巴结炎': ['disease'],\n", + " '皮蛋芦笋汤': ['food'],\n", + " '广州白云山星群复方锌铁钙颗': ['producer'],\n", + " '天宇奥森维生素E软胶囊': ['producer'],\n", + " '海王福药阿苯达唑胶囊': ['producer'],\n", + " '快乐伙伴三维制霉素栓': ['producer'],\n", + " '科洛曲片': ['drug'],\n", + " '抗流行性出血热IgM抗体': ['check'],\n", + " '皇象铁力蓝天羧甲司坦片': ['producer'],\n", + " '利群药业依托红霉素片': ['producer'],\n", + " '端坐呼吸': ['symptom'],\n", + " '盐酸舍曲林胶囊': ['drug'],\n", + " '老年人病态窦房结综合征': ['disease'],\n", + " '宛西制药归脾丸': ['producer'],\n", + " '微丝蚴(Mf)': ['check'],\n", + " '石家庄御生堂归脾丸': ['producer'],\n", + " '角膜异物': ['symptom'],\n", + " '复方鱼肝油氧化锌软膏': ['drug'],\n", + " '血栓弹力图': ['check'],\n", + " '正元盛邦蓼参胶囊': ['producer'],\n", + " '百思特新血宝胶囊': ['producer'],\n", + " '泌乳素(PRL)分泌抑制试验': ['check'],\n", + " '抗红细胞抗体': ['check'],\n", + " '荸荠猪肚粥': ['food'],\n", + " '活宁': ['producer'],\n", + " '排毒养颜胶囊': ['drug'],\n", + " '朗致集团硫酸庆大霉素注射液': ['producer'],\n", + " '山药羊奶羹': ['food'],\n", + " '四川迪菲特药业胆舒软胶囊': ['producer'],\n", + " '下肢湿性坏疽': ['symptom'],\n", + " '诺尔玛苯磺酸氨氯地平片': ['producer'],\n", + " '膀胱咳': ['disease'],\n", + " '肺泡蛋白沉着症': ['disease'],\n", + " '上海华源苯丙氨酯片': ['producer'],\n", + " '远程制药抗妇炎胶囊': ['producer'],\n", + " '亚急性坏死性脊髓炎': ['disease'],\n", + " '退变性关节病': ['disease'],\n", + " '黄石奇灵麝香壮骨膏': ['producer'],\n", + " '眼眶静脉性血管瘤': ['disease'],\n", + " '颈椎单侧及双侧小关节脱位': ['disease'],\n", + " '豹纹状眼底': ['symptom'],\n", + " '腋毛毛干上有微小结节': ['symptom'],\n", + " '甲磺酸阿米三嗪萝巴新片': ['drug', 'producer'],\n", + " '尿素': ['check'],\n", + " '武汉钧安酮洛芬肠溶胶囊': ['producer'],\n", + " '安国药业生发丸': ['producer'],\n", + " '唐山利康尿素维E乳膏': ['producer'],\n", + " '脑电波的改变': ['symptom'],\n", + " '保定金钟疤痕止痒软化膏': ['producer'],\n", + " '威海华新强力碘溶液': ['producer'],\n", + " '云南白药健胃消食片': ['producer'],\n", + " '部分凝血活酶时间': ['check'],\n", + " '爱络': ['producer'],\n", + " '川大华西醋酸甲萘氢醌片': ['producer'],\n", + " '包头中药鼻炎宁颗粒': ['producer'],\n", + " '血清无机磷': ['check'],\n", + " '京舒阿托伐他汀钙分散片': ['producer'],\n", + " '欣苗琥乙红霉素颗粒': ['producer'],\n", + " '宁兰欣': ['producer'],\n", + " '威尔曼制药注射用头孢呋辛钠': ['producer'],\n", + " '顺铂注射液': ['drug', 'producer'],\n", + " '金胃泰胶囊': ['drug'],\n", + " '虚寒体质': ['symptom'],\n", + " '苹果酱': ['food'],\n", + " '江苏振国依托泊苷注射液': ['producer'],\n", + " '科田药业环吡酮胺乳膏': ['producer'],\n", + " '纤维蛋白肽Bβ15~42': ['check'],\n", + " '博恩特药业注射用醋酸亮丙瑞': ['producer'],\n", + " '葱油苦瓜': ['food'],\n", + " '活血首乌参': ['food'],\n", + " '香菇粥': ['food'],\n", + " '鼻子颜色苍白': ['symptom'],\n", + " '肠外结核': ['symptom'],\n", + " '万生力乐盐酸帕罗西汀片': ['producer'],\n", + " '上海新亚复方磺胺甲噁唑片': ['producer'],\n", + " '碑林药业金嗓散结片': ['producer'],\n", + " '天泰降糖舒片': ['producer'],\n", + " '普元除湿止痒洗液': ['producer'],\n", + " '金砂五淋丸': ['drug'],\n", + " '体位性震颤': ['symptom'],\n", + " '皮肤弹性检查': ['check'],\n", + " '复方吡拉西坦脑蛋白水解物片': ['drug'],\n", + " '回音必孕康口服液': ['producer'],\n", + " '浙江普洛康川贝清肺糖浆': ['producer'],\n", + " '偏振光显微镜检查': ['check'],\n", + " '宫颈糜烂': ['disease'],\n", + " '老年女性膀胱颈梗阻': ['disease'],\n", + " '陕西诚信盐酸妥洛特罗片': ['producer'],\n", + " '杞子南枣煲鸡蛋': ['food'],\n", + " '拇指不明原因疼痛': ['symptom'],\n", + " '无名指半月甲呈粉红色': ['symptom'],\n", + " '哈密瓜百合汤': ['food'],\n", + " '凉拌四季豆': ['food'],\n", + " '病毒性心肌炎': ['disease'],\n", + " '翠衣番茄豆腐汤': ['food'],\n", + " '百利金转移因子口服溶液': ['producer'],\n", + " '椰子饺': ['food'],\n", + " '眉下垂或位置低': ['symptom'],\n", + " '淋菌性结膜炎': ['disease'],\n", + " '固肾安胎丸': ['drug'],\n", + " '湖北绿金子胃膜素胶囊': ['producer'],\n", + " '麻仁鸽蛋': ['food'],\n", + " '成都蓉生人血白蛋白': ['producer'],\n", + " '鱼香鸡爪': ['food'],\n", + " '周期性内斜视': ['disease'],\n", + " '水母皮炎': ['disease'],\n", + " '妇炎康软胶囊': ['drug'],\n", + " '脐周肿胀': ['symptom'],\n", + " '眼压突然迅速升高': ['symptom'],\n", + " '瑞奥奥美拉唑肠溶片': ['producer'],\n", + " '舌咬伤': ['symptom'],\n", + " '海参蒸饺': ['food'],\n", + " '复方谷氨酰胺肠溶胶囊': ['drug'],\n", + " '芒果拼盘': ['food'],\n", + " '尿频伴尿急和尿痛': ['symptom'],\n", + " '脂蛋白a(Lp-a)': ['check'],\n", + " '尿道结节': ['symptom'],\n", + " '麦芽糖': ['food'],\n", + " '舒视明氨碘肽滴眼液': ['producer'],\n", + " '鲫鱼粥': ['food'],\n", + " '颌下间隙感染': ['disease'],\n", + " '克痒敏醑': ['drug'],\n", + " '脱肛': ['symptom'],\n", + " '麦芙欣': ['producer'],\n", + " '电脑失写症': ['symptom'],\n", + " '海口奇力注射用阿洛西林钠': ['producer'],\n", + " '遂成药业葡萄糖注射液': ['producer'],\n", + " '盐酸二甲双胍片': ['drug'],\n", + " '淋巴细胞性垂体炎': ['disease'],\n", + " '浙江维康固元胶囊': ['producer'],\n", + " '乙肝表面抗体(...': ['symptom'],\n", + " '不典型增生': ['symptom'],\n", + " '火腿海参木耳排骨汤': ['food'],\n", + " '百合鸡蛋黄汤': ['food'],\n", + " '芝麻黑豆粥': ['food'],\n", + " '新安药业盐酸吗啉胍片': ['producer'],\n", + " '香脆银鱼': ['food'],\n", + " '盐酸吗啉胍滴眼液': ['drug'],\n", + " '信谊天平炔诺酮片': ['producer'],\n", + " '胚胎发育供血不足': ['symptom'],\n", + " '鼻咽部MRI检查': ['check'],\n", + " '肝苏软胶囊': ['drug'],\n", + " '河南神农药业清开灵注射液': ['producer'],\n", + " '河北健宁碘酊': ['producer'],\n", + " '顽固性心功能不全': ['symptom'],\n", + " '息贲': ['disease'],\n", + " '陕西渭南华仁藻酸双酯钠片': ['producer'],\n", + " '荸荠鸡翅': ['food'],\n", + " '珊瑚癣净': ['drug'],\n", + " '恶心与呕吐': ['symptom'],\n", + " '肌张力过高': ['symptom'],\n", + " '北京同仁堂芎菊上清丸': ['producer'],\n", + " '艾瑞得安': ['producer'],\n", + " '山西云鹏维生素B2片': ['producer'],\n", + " '美德止血祛瘀明目片': ['producer'],\n", + " '特异性心肌病': ['disease'],\n", + " '贵州安康制药安胎丸': ['producer'],\n", + " '三明天泰硫软膏': ['producer'],\n", + " '乳房或乳头未发育': ['symptom'],\n", + " '羊水栓塞': ['disease'],\n", + " '中度精神发育迟滞': ['symptom'],\n", + " '菊花鲈鱼块': ['food'],\n", + " '恶性高血压视网膜病变': ['disease'],\n", + " '卵泡囊肿': ['disease', 'symptom'],\n", + " '合肥利民制药氧氟沙星滴眼液': ['producer'],\n", + " '维生素K1注射液': ['drug', 'producer'],\n", + " '尿蛋白': ['symptom'],\n", + " '达力新': ['producer'],\n", + " '气臌': ['disease'],\n", + " '巨幼细胞性贫血': ['disease'],\n", + " '丛状血管瘤': ['disease'],\n", + " '小儿止泻灵颗粒': ['drug'],\n", + " '银鱼火锅': ['food'],\n", + " '锦华药业氯霉素片': ['producer'],\n", + " '苍耳子辛夷花芥菜汤': ['food'],\n", + " '广西灵峰妇康宁片': ['producer'],\n", + " '四川并殖吸虫病': ['disease'],\n", + " '红细胞膜磷脂': ['check'],\n", + " '山东明仁福瑞达盐酸硫必利片': ['producer'],\n", + " '循环免疫复合物': ['check'],\n", + " '通化兴华苯妥英钠片': ['producer'],\n", + " '山东威高葡萄糖氯化钠注射液': ['producer'],\n", + " '生长激素分泌过少': ['symptom'],\n", + " '胆舒软胶囊': ['drug'],\n", + " '胫骨粗隆肿胀': ['symptom'],\n", + " '四川大冢谷维素片': ['producer'],\n", + " '足菌肿': ['disease'],\n", + " '苦瓜豆浆汁': ['food'],\n", + " '999茵栀黄口服液': ['producer'],\n", + " '角膜知觉减少': ['symptom'],\n", + " '淋巴结疼痛': ['symptom'],\n", + " '乐普药业司帕沙星片': ['producer'],\n", + " '西岳制药托西酸舒他西林胶囊': ['producer'],\n", + " '奇比特': ['producer'],\n", + " '天泰药业止痛化癥胶囊': ['producer'],\n", + " '长圣药业乌洛托品溶液': ['producer'],\n", + " '芪枣颗粒': ['drug'],\n", + " '泰素': ['producer'],\n", + " '外阴烧灼刺激感': ['symptom'],\n", + " '广西冠峰陈香露白露片': ['producer'],\n", + " '萝卜干饺': ['food'],\n", + " '无效腔气量/潮气量比值': ['check'],\n", + " '肠炎宁片': ['drug'],\n", + " '赛克同': ['producer'],\n", + " '三高症': ['disease'],\n", + " '恶性黑色素瘤': ['disease'],\n", + " '天圣制药舒肝和胃丸': ['producer'],\n", + " '菠菜拌豆干': ['food'],\n", + " '钧安制药葡萄糖酸锌片': ['producer'],\n", + " '华润双鹤药业醋酸甲萘氢醌片': ['producer'],\n", + " '足底和足背浮肿': ['symptom'],\n", + " '流行性出血热病毒抗体': ['check'],\n", + " '内分泌性高血压': ['disease'],\n", + " '胆胀': ['disease'],\n", + " '枸杞子乌肉鸡汤': ['food'],\n", + " '江苏鹏鹞马来酸氯苯那敏片': ['producer'],\n", + " '黄栀花药业血府逐瘀丸': ['producer'],\n", + " '国药集团武汉中联四药药业三': ['producer'],\n", + " '小儿波-杰综合征': ['disease'],\n", + " '尿道的条索状肿块': ['symptom'],\n", + " '灯盏花素片': ['drug'],\n", + " '蒜茸野菊花': ['food'],\n", + " '卵磷脂片': ['drug'],\n", + " '硝苯地平片': ['drug'],\n", + " '牙齿缝隙大': ['symptom'],\n", + " '吉祥药业盐酸海索那林片': ['producer'],\n", + " '难产': ['disease'],\n", + " '太极集团复方鱼腥草片': ['producer'],\n", + " '华意甲硝唑片': ['producer'],\n", + " '胎心不规则': ['symptom'],\n", + " '鲁平盐酸胺碘酮片': ['producer'],\n", + " '右室肥厚': ['symptom'],\n", + " '东维力': ['producer'],\n", + " '广东博洲药业头孢特仑新戊酯': ['producer'],\n", + " '路德药业小儿肺炎散': ['producer'],\n", + " '山药炒鱼片': ['food'],\n", + " '江西科伦托吡卡胺滴眼液': ['producer'],\n", + " '眉豆煲猪胰汤': ['food'],\n", + " '广东逢春补中益气丸': ['producer'],\n", + " '巴特日七味丸': ['drug'],\n", + " '吉林华港制药盐酸二氧丙嗪颗': ['producer'],\n", + " '米非司酮胶囊': ['drug'],\n", + " '炝泥胡菜': ['food'],\n", + " '东药硝苯地平片': ['producer'],\n", + " '洛正筋骨痛消丸': ['producer'],\n", + " '遂成药业替硝唑胶囊': ['producer'],\n", + " '布美他尼注射液': ['drug'],\n", + " '咽喉干燥及灼热感': ['symptom'],\n", + " '齐都药业尼麦角林片': ['producer'],\n", + " '肾脓肿': ['disease', 'symptom'],\n", + " '小儿维生素D缺乏性手足搐搦症': ['disease'],\n", + " '早产视网膜病变筛查': ['check'],\n", + " '尿羟脯氨酸': ['check'],\n", + " '青春期肥胖': ['symptom'],\n", + " '海王福药溴丙胺太林片': ['producer'],\n", + " '复发性多软骨炎': ['disease'],\n", + " '河北长天果糖二磷酸钙片': ['producer'],\n", + " '中间细胞(MID)': ['check'],\n", + " '云药盐酸可乐定片': ['producer'],\n", + " '吉通药业冠脉宁片': ['producer'],\n", + " '南建广': ['symptom'],\n", + " '西瓜番茄汁': ['food'],\n", + " '自恋': ['symptom'],\n", + " '巴红': ['producer'],\n", + " '上海黄海制药氯化钾缓释片': ['producer'],\n", + " '嘉通芪芳气血颗粒': ['producer'],\n", + " '小儿原发性免疫缺陷病': ['disease'],\n", + " '当归首乌鸡肉汤': ['food'],\n", + " '骨血管内皮细胞瘤': ['disease'],\n", + " '敖东延吉贞芪扶正颗粒': ['producer'],\n", + " '烩鸡翅': ['food'],\n", + " '小儿无菌性脑膜炎综合征': ['disease'],\n", + " '胸部滴水声': ['check'],\n", + " '眉间皱纹': ['symptom'],\n", + " '羊肉炖柿子': ['food'],\n", + " '华润双鹤药业核黄素磷酸钠注': ['producer'],\n", + " '奥邦甘露聚糖肽口服溶液': ['producer'],\n", + " '翔通药业硼酸软膏': ['producer'],\n", + " '西安方兴谷丙甘氨酸胶囊': ['producer'],\n", + " '恒健新霉素氟轻松乳膏': ['producer'],\n", + " '药都制药跌打丸': ['producer'],\n", + " '永寿制药消癌平片': ['producer'],\n", + " '哈尔滨凯程人工牛黄甲硝唑胶': ['producer'],\n", + " '惠松硅炭银片': ['producer'],\n", + " '糖尿病肾病': ['disease'],\n", + " '脑脊液生长抑素': ['check'],\n", + " '胎膜早破': ['disease', 'symptom'],\n", + " '晨骨刺宁片': ['producer'],\n", + " '特发性嗜酸性粒细胞增多综合征': ['disease'],\n", + " '富马酸依美斯汀滴眼液': ['drug'],\n", + " '吉林华港制药头孢羟氨苄甲氧': ['producer'],\n", + " '康人痔速宁片': ['producer'],\n", + " '间质性肺炎': ['disease'],\n", + " '石药唐威补肾强身片': ['producer'],\n", + " '瞳孔中能见到白色反光': ['symptom'],\n", + " '间接免疫荧光试验': ['check'],\n", + " '小儿急性中毒性脑病': ['disease'],\n", + " '神经伤': ['symptom'],\n", + " '第一生化胰岛素注射液': ['producer'],\n", + " '精子稀少': ['symptom'],\n", + " '活力源片': ['drug'],\n", + " '仙河药业妇炎舒片': ['producer'],\n", + " '白云山明兴盐酸肾上腺素注射': ['producer'],\n", + " '天宏药业苯扎贝特片': ['producer'],\n", + " '小儿硬皮病': ['disease'],\n", + " '豆浆': ['food'],\n", + " '偻附': ['disease'],\n", + " '辽宁金丹加味逍遥丸': ['producer'],\n", + " '地道药业独一味软胶囊': ['producer'],\n", + " '悦康普欣阿德福韦酯片': ['producer'],\n", + " '硝酸咪康唑乳膏': ['drug'],\n", + " '洛各单酒石酸罗格列酮片': ['producer'],\n", + " '全宇制药西咪替丁片': ['producer'],\n", + " '圣鲁制药环磷腺苷葡胺注射液': ['producer'],\n", + " '帅孚': ['producer'],\n", + " '金岛制药磺胺嘧啶片': ['producer'],\n", + " '肾外梗阻': ['symptom'],\n", + " '迪康长江制药盐酸肾上腺素注': ['producer'],\n", + " '肝上皮样血管内皮细胞瘤': ['disease'],\n", + " '同仁堂八味锡类散': ['producer'],\n", + " '北京中新药业甲巯咪唑片': ['producer'],\n", + " '形美复方珍珠暗疮胶囊': ['producer'],\n", + " '鲁抗大地药业排毒清脂胶囊': ['producer'],\n", + " '咖喱牛肉蒸饺': ['food'],\n", + " '康普药业盐酸左氧氟沙星胶囊': ['producer'],\n", + " '四边孔处的局限压痛': ['symptom'],\n", + " '合肥久联己烯雌酚片': ['producer'],\n", + " '氨碘肽滴眼液': ['drug'],\n", + " '甘蔗萝卜汤': ['food'],\n", + " '赤豆牛肉汤': ['food'],\n", + " '复达欣': ['producer'],\n", + " '廖元和堂生精胶囊': ['producer'],\n", + " '急性腹泻': ['disease'],\n", + " '双鲸药业维生素A软胶囊': ['producer'],\n", + " '武汉中联三维制霉素栓': ['producer'],\n", + " '酸碱灼伤': ['disease'],\n", + " '豆腐鸡血瘦肉汤': ['food'],\n", + " '通辽东北六复方磺胺甲噁唑片': ['producer'],\n", + " '职业性痤疮': ['disease'],\n", + " '上海上药信谊药厂乙酰唑胺片': ['producer'],\n", + " '奥托康制药硫唑嘌呤片': ['producer'],\n", + " '亚邦强生药业吡喹酮片': ['producer'],\n", + " '茯苓清蒸桂鱼': ['food'],\n", + " '云南傣药维生素B2注射液': ['producer'],\n", + " '闭塞性血栓性脉管炎': ['disease'],\n", + " '惠氏制药公司西罗莫司片': ['producer'],\n", + " '时珍康氧化锌软膏': ['producer'],\n", + " '肺力咳胶囊': ['drug'],\n", + " '主动脉夹层': ['disease'],\n", + " '九洋药业卡马西平胶囊': ['producer'],\n", + " '月经期长痘': ['symptom'],\n", + " '骨刺宁片': ['drug'],\n", + " '亚宝药业曲克芦丁片': ['producer'],\n", + " '胡庆余堂胃复春片': ['producer'],\n", + " '临汾健民复合维生素B片': ['producer'],\n", + " '气性坏疽': ['disease'],\n", + " '维宏': ['producer'],\n", + " '水萝卜片汤': ['food'],\n", + " '疝气': ['disease'],\n", + " '泪膜破裂时间': ['check'],\n", + " '汕头金石枸橼酸铋钾颗粒': ['producer'],\n", + " '广东罗浮山白鹤消炎利胆片': ['producer'],\n", + " '山西振东诺氟沙星胶囊': ['producer'],\n", + " '臂痛': ['symptom'],\n", + " '浙江万晟硝苯地平片': ['producer'],\n", + " '损伤性休克': ['disease'],\n", + " '睾丸疼痛': ['symptom'],\n", + " '红烧鳝鱼': ['food'],\n", + " '天朗制药盐酸洛美沙星滴眼液': ['producer'],\n", + " '生精片': ['drug'],\n", + " '十二指肠憩室': ['disease'],\n", + " '肛门短时间阵发性钝痛': ['symptom'],\n", + " '帽状腱膜下脓肿': ['disease'],\n", + " '耳丝拌凉粉': ['food'],\n", + " '腹水': ['disease', 'symptom'],\n", + " '肝包虫囊肿': ['disease'],\n", + " '干眼': ['disease'],\n", + " '藻酸双酯钠片': ['drug'],\n", + " '带状疱疹性角膜炎': ['disease'],\n", + " '脑动脉盗血综合征': ['disease'],\n", + " '放射性心脏损害': ['disease'],\n", + " '格林生物硬脂酸红霉素片': ['producer'],\n", + " '集佳调经促孕丸': ['producer'],\n", + " '粪柱变形变细': ['symptom'],\n", + " '河南羚锐制药盐酸克林霉素胶': ['producer'],\n", + " '智力减低': ['symptom'],\n", + " '静脉注射肾盂摄影检查': ['check'],\n", + " '头孢克肟胶囊': ['drug'],\n", + " '炭疽': ['disease'],\n", + " '莱阳司邦得制药盐酸金刚烷胺': ['producer'],\n", + " '誉隆亚东药业接骨续筋片': ['producer'],\n", + " '尿道炎': ['disease'],\n", + " '青岛双鲸维生素E软胶囊': ['producer'],\n", + " '通化茂祥司莫司汀胶囊': ['producer'],\n", + " '云片银耳汤': ['food'],\n", + " '黑龙江金九维生素E皇浆口服': ['producer'],\n", + " '湖北华世通潜龙注射用单磷酸': ['producer'],\n", + " '陕西京西维生素B6注射液': ['producer'],\n", + " '牙齿异常': ['symptom'],\n", + " '乐普药业注射用头孢他啶': ['producer'],\n", + " '牛肚粥': ['food'],\n", + " '瘦肉燕窝汤': ['food'],\n", + " '钼': ['check'],\n", + " '鲫鱼': ['food'],\n", + " '汇莱药业保和丸': ['producer'],\n", + " '睡眠呼吸暂停综合征': ['disease'],\n", + " '成都药业四环素片': ['producer'],\n", + " '利民制药盐酸左氧氟沙星注射': ['producer'],\n", + " '山东鲁抗硫酸锌片': ['producer'],\n", + " '创灼膏': ['drug'],\n", + " '仁盛制药参芪首乌补汁': ['producer'],\n", + " '阿利新蓝染色': ['check'],\n", + " '华润双鹤氨甲环酸片': ['producer'],\n", + " '泰华堂祛风止痒口服液': ['producer'],\n", + " '湖北康沁膦甲酸钠氯化钠注射': ['producer'],\n", + " '颈椎分节异常': ['symptom'],\n", + " '红细胞增多症眼底': ['disease'],\n", + " '维必朗氯氮平口腔崩解片': ['producer'],\n", + " '注射用硫酸长春新碱': ['drug', 'producer'],\n", + " '致死性家族性失眠症': ['disease'],\n", + " '5'-核苷酸酶': ['check'],\n", + " '黑龙江诺捷制药乳酸菌素片': ['producer'],\n", + " '精神障碍': ['disease', 'symptom'],\n", + " '幻味': ['symptom'],\n", + " '良性脑瘤': ['disease'],\n", + " '白敬宇制药奋乃静片': ['producer'],\n", + " '浙江巨泰灭菌结晶磺胺': ['producer'],\n", + " '上海新亚注射用丝裂霉素': ['producer'],\n", + " '代树芳': ['symptom'],\n", + " '掌骨指数及指骨...': ['symptom'],\n", + " '天原药业利肝隆片': ['producer'],\n", + " '老年人急性淋巴细胞白血病': ['disease'],\n", + " '腹壁间疝': ['disease'],\n", + " '小儿金葡菌性烫伤样皮肤综合征': ['disease'],\n", + " '黄河药业熊去氧胆酸片': ['producer'],\n", + " '玫卢玫芦消痤膏': ['producer'],\n", + " '应激性溃疡': ['disease'],\n", + " '奶汁白菜条': ['food'],\n", + " '手部血管损伤': ['disease'],\n", + " '正大天晴泽桂癃爽胶囊': ['producer'],\n", + " '肺热咳嗽': ['disease'],\n", + " '紫菜豆腐羹': ['food'],\n", + " '吉林长源辛芳鼻炎胶囊': ['producer'],\n", + " '江苏吴中苏州制药西洛他唑片': ['producer'],\n", + " '双耳汤': ['food'],\n", + " '源瑞制药聚甲酚磺醛栓': ['producer'],\n", + " '新疆华世丹维生素E胶丸': ['producer'],\n", + " '九惠制药毛冬青胶囊': ['producer'],\n", + " '吉林恒和维康枸橼酸钾颗粒': ['producer'],\n", + " '重复膀胱': ['disease'],\n", + " '今方药业散结片': ['producer'],\n", + " '苏中药业甘露聚糖肽注射液': ['producer'],\n", + " '江西药都樟树木香顺气丸': ['producer'],\n", + " '分水岭区脑梗死': ['disease'],\n", + " '仙河药业刺五加脑灵胶囊': ['producer'],\n", + " '仁和堂五氟利多片': ['producer'],\n", + " '外科检查': ['check'],\n", + " '陕西华龙制药轻身减肥片': ['producer'],\n", + " '喉外伤': ['disease'],\n", + " '克拉霉素分散片': ['drug', 'producer'],\n", + " '注射用头孢呋辛钠': ['drug', 'producer'],\n", + " '大连华立金港三磷酸腺苷二钠': ['producer'],\n", + " '结肠血管畸形': ['disease'],\n", + " '大白菜饺': ['food'],\n", + " '海力制药盐酸左氧氟沙星片': ['producer'],\n", + " '脉络膜凹陷': ['symptom'],\n", + " '毛母质瘤': ['disease'],\n", + " '并指(趾)畸形检查': ['check'],\n", + " '沈阳东新宁心宝胶囊': ['producer'],\n", + " '看东西有重影': ['symptom'],\n", + " '肢体不自主震颤': ['symptom'],\n", + " '陕西盘龙康尔心胶囊': ['producer'],\n", + " '威凡': ['producer'],\n", + " '补体结合试验': ['check'],\n", + " '皇象铁力蓝天维生素E烟酸酯': ['producer'],\n", + " '牙龈炎': ['disease'],\n", + " '明水药业注射用头孢唑林钠': ['producer'],\n", + " '皮肤病': ['disease'],\n", + " '妊娠期急性肾功能衰竭': ['disease'],\n", + " '枸橼酸莫沙必利片': ['drug'],\n", + " '安徽万森维D2磷酸氢钙片': ['producer'],\n", + " '蒲地蓝消炎口服液': ['drug', 'producer'],\n", + " '金陵南京金陵脉络宁口服液': ['producer'],\n", + " '华北制药注射用青霉素钠': ['producer'],\n", + " '茴香': ['food'],\n", + " '一过性心尖部收...': ['symptom'],\n", + " '兴隆希力丹参酮胶囊': ['producer'],\n", + " '正大丰海盐酸多西环素片': ['producer'],\n", + " '顽固性呃逆': ['symptom'],\n", + " '钩虫皮炎': ['disease'],\n", + " '安生新霉素氟轻松乳膏': ['producer'],\n", + " '脊椎结核后突畸形': ['disease'],\n", + " '肺病': ['disease'],\n", + " '大株红景天片': ['drug'],\n", + " '柠檬鹌鹑': ['food'],\n", + " '广州白云山天心酒石酸美托洛': ['producer'],\n", + " '小儿丘疹性肢皮炎综合征': ['disease'],\n", + " '仁和堂药业吡拉西坦片': ['producer'],\n", + " '午夜一片法地塞米松抑制试验': ['check'],\n", + " '四川远大蜀阳人血白蛋白': ['producer'],\n", + " '浙江亚东制药阿莫西林胶囊': ['producer'],\n", + " '老年人多器官功能衰竭': ['disease'],\n", + " '苏州壹药注射用盐酸氨溴索': ['producer'],\n", + " '足畸形': ['symptom'],\n", + " '海绵体血管瘤': ['disease'],\n", + " '盐酸布比卡因注射液': ['drug'],\n", + " '小米面发糕': ['food'],\n", + " '芋头煮肉丸': ['food'],\n", + " '遂成药业红霉素软膏': ['producer'],\n", + " '胸、腰椎椎体单纯性、楔形压缩骨折': ['disease'],\n", + " '咳嗽': ['disease', 'symptom'],\n", + " '康必得药业复方醋酸氯己定喷': ['producer'],\n", + " '贵州汉方依托泊苷注射液': ['producer'],\n", + " '钒': ['check'],\n", + " '天津中新健步壮骨丸': ['producer'],\n", + " '立业制药诺氟沙星滴眼液': ['producer'],\n", + " '苄达赖氨酸滴眼液': ['drug'],\n", + " '正瑞': ['producer'],\n", + " '颈部潮红': ['symptom'],\n", + " '成都锦华吡嗪酰胺片': ['producer'],\n", + " '两眼上视障碍': ['symptom'],\n", + " '天津太平洋丙酸倍氯米松乳膏': ['producer'],\n", + " '骨刺丸': ['drug'],\n", + " '砂仁甘草蒸鲫鱼': ['food'],\n", + " '胸主动脉瘤': ['disease'],\n", + " '腰部酸胀及无力': ['symptom'],\n", + " '白塞综合征': ['disease'],\n", + " '北京益民药业盐酸氯丙嗪片': ['producer'],\n", + " '小儿爱德华兹综合征': ['disease'],\n", + " '溃平宁颗粒': ['drug'],\n", + " '猪肉炒山楂': ['food'],\n", + " '牡丹江灵泰藻酸双酯钠片': ['producer'],\n", + " '江苏九旭鸦胆子油乳注射液': ['producer'],\n", + " '山东方明酒石酸美托洛尔注射': ['producer'],\n", + " '安神补脑液': ['drug'],\n", + " '心理性性功能障碍': ['symptom'],\n", + " '江苏神华宁心宝胶囊': ['producer'],\n", + " '白果(鲜)': ['food'],\n", + " '阴道炎': ['disease'],\n", + " '抗淋巴细胞抗体(ALA)': ['check'],\n", + " '成都湔江积雪苷片': ['producer'],\n", + " '结肠黑变': ['symptom'],\n", + " '吉春止痒消炎水': ['producer'],\n", + " '易亨制药双氯芬酸钠缓释胶囊': ['producer'],\n", + " '依科制药石淋通颗粒': ['producer'],\n", + " '石药欧意尼群地平片': ['producer'],\n", + " '陕西关爱甲硝唑氯己定洗剂': ['producer'],\n", + " '乐家老铺参梅养胃颗粒': ['producer'],\n", + " '辅仁药业盐酸多沙普仑注射液': ['producer'],\n", + " '未分化脊柱关节病': ['disease'],\n", + " '蘑菇炒芦笋': ['food'],\n", + " '妊娠期胸痛': ['symptom'],\n", + " '上海信谊氧氟沙星滴耳液': ['producer'],\n", + " '黑豆': ['food'],\n", + " '星鲨制药颠茄片': ['producer'],\n", + " '肺泡癌': ['disease'],\n", + " '乐仁堂茴香橘核丸': ['producer'],\n", + " '注射用哌拉西林钠他唑巴坦钠': ['drug'],\n", + " ...}" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "wdtype_dict" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 构造AC自动机,加速实体提取" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "当知识图谱规模过大时,使用AC自动机算法,从问题中提取知识图谱中的实体,而不是用原生python的字符串方法。\n", + "\n", + "扩展阅读:https://zhuanlan.zhihu.com/p/158767004" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "'''构造AC自动机,加速过滤'''\n", + "def build_actree(wordlist):\n", + " actree = ahocorasick.Automaton()\n", + " for index, word in enumerate(wordlist):\n", + " actree.add_word(word, (index, word))\n", + " actree.make_automaton()\n", + " return actree" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "# 构造AC自动机\n", + "region_tree = build_actree(list(region_words))" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "region_tree" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "'血常规' in region_tree" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(12026, '血常规')" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "region_tree.get('血常规')" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "'学习' in region_tree" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "ename": "KeyError", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mregion_tree\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'学习'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mKeyError\u001b[0m: " + ] + } + ], + "source": [ + "region_tree.get('学习')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 任务一:提取问题相关实体及其类别" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [], + "source": [ + "question = '肺气肿和百日咳要做血常规吗'" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(2, (16220, '肺气肿'))\n", + "(6, (21279, '百日咳'))\n", + "(11, (12026, '血常规'))\n", + "['肺气肿', '百日咳', '血常规']\n" + ] + } + ], + "source": [ + "question_entity = []\n", + "for each in region_tree.iter(question):\n", + " print(each)\n", + " entity = each[1][1]\n", + " question_entity.append(entity)\n", + "print(question_entity)" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": {}, + "outputs": [], + "source": [ + "# stop_wds = []\n", + "# # 排除字符串子串\n", + "# for wd1 in region_wds:\n", + "# for wd2 in region_wds:\n", + "# if wd1 in wd2 and wd1 != wd2:\n", + "# stop_wds.append(wd1)\n", + "# print(stop_wds)\n", + "# final_wds = [each for each in region_wds if each not in stop_wds]\n", + "# final_wds" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [], + "source": [ + "question_entity_dict = {each:wdtype_dict[each] for each in question_entity}" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'肺气肿': ['disease'], '百日咳': ['disease'], '血常规': ['check']}" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "question_entity_dict" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [], + "source": [ + "output = {}\n", + "output['args'] = question_entity_dict" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 任务一完成" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 任务二:提取问题相关的待查询关系" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 问题中涉及的实体类别" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "types = []\n", + "for each in question_entity_dict.values():\n", + " types.extend(each)" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['disease', 'disease', 'check']" + ] + }, + "execution_count": 25, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "types" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 不同提问意图的疑问词" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "symptom_qwds = ['症状', '表征', '现象', '症候', '表现']\n", + "cause_qwds = ['原因','成因', '为什么', '怎么会', '怎样才', '咋样才', '怎样会', '如何会', '为啥', '为何', '如何才会', '怎么才会', '会导致', '会造成']\n", + "acompany_qwds = ['并发症', '并发', '一起发生', '一并发生', '一起出现', '一并出现', '一同发生', '一同出现', '伴随发生', '伴随', '共现']\n", + "food_qwds = ['饮食', '饮用', '吃', '食', '伙食', '膳食', '喝', '菜' ,'忌口', '补品', '保健品', '食谱', '菜谱', '食用', '食物','补品']\n", + "drug_qwds = ['药', '药品', '用药', '胶囊', '口服液', '炎片']\n", + "prevent_qwds = ['预防', '防范', '抵制', '抵御', '防止','躲避','逃避','避开','免得','逃开','避开','避掉','躲开','躲掉','绕开',\n", + " '怎样才能不', '怎么才能不', '咋样才能不','咋才能不', '如何才能不',\n", + " '怎样才不', '怎么才不', '咋样才不','咋才不', '如何才不',\n", + " '怎样才可以不', '怎么才可以不', '咋样才可以不', '咋才可以不', '如何可以不',\n", + " '怎样才可不', '怎么才可不', '咋样才可不', '咋才可不', '如何可不']\n", + "lasttime_qwds = ['周期', '多久', '多长时间', '多少时间', '几天', '几年', '多少天', '多少小时', '几个小时', '多少年']\n", + "cureway_qwds = ['怎么治疗', '如何医治', '怎么医治', '怎么治', '怎么医', '如何治', '医治方式', '疗法', '咋治', '怎么办', '咋办', '咋治']\n", + "cureprob_qwds = ['多大概率能治好', '多大几率能治好', '治好希望大么', '几率', '几成', '比例', '可能性', '能治', '可治', '可以治', '可以医']\n", + "easyget_qwds = ['易感人群', '容易感染', '易发人群', '什么人', '哪些人', '感染', '染上', '得上']\n", + "check_qwds = ['检查', '检查项目', '查出', '检查', '测出', '试出']\n", + "belong_qwds = ['属于什么科', '属于', '什么科', '科室']\n", + "cure_qwds = ['治疗什么', '治啥', '治疗啥', '医治啥', '治愈啥', '主治啥', '主治什么', '有什么用', '有何用', '用处', '用途', '有什么好处', '有什么益处', '有何益处', '用来', '用来做啥', '用来作甚', '需要', '要']" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [], + "source": [ + "def check_words(words, question):\n", + " # 疑问词是否出现在提问中\n", + " for word in words:\n", + " if word in question:\n", + " # print(word + ' 出现在提问中')\n", + " return True\n", + " return False" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [], + "source": [ + "# question_type = 'others'\n", + "question_types = []\n", + "\n", + "# 疾病-症状\n", + "if check_words(symptom_qwds, question) and ('disease' in types):\n", + " question_type = 'disease_symptom'\n", + " question_types.append(question_type)\n", + " \n", + "# 症状-疾病\n", + "if check_words(symptom_qwds, question) and ('symptom' in types):\n", + " question_type = 'symptom_disease'\n", + " question_types.append(question_type)\n", + " \n", + "# 疾病-病因\n", + "if check_words(cause_qwds, question) and ('disease' in types):\n", + " question_type = 'disease_cause'\n", + " question_types.append(question_type)\n", + "\n", + "# 疾病-并发症\n", + "if check_words(acompany_qwds, question) and ('disease' in types):\n", + " question_type = 'disease_acompany'\n", + " question_types.append(question_type)\n", + "\n", + "# 疾病-可以吃/不可以吃\n", + "if check_words(food_qwds, question) and 'disease' in types:\n", + " deny_status = check_words(deny_words, question)\n", + " if deny_status:\n", + " question_type = 'disease_not_food'\n", + " else:\n", + " question_type = 'disease_do_food'\n", + " question_types.append(question_type)\n", + " \n", + "# 可以吃/不可以吃-疾病\n", + "if check_words(food_qwds+cure_qwds, question) and 'food' in types:\n", + " deny_status = check_words(deny_words, question)\n", + " if deny_status:\n", + " question_type = 'food_not_disease'\n", + " else:\n", + " question_type = 'food_do_disease'\n", + " question_types.append(question_type)\n", + " \n", + "# 疾病-药物\n", + "if check_words(drug_qwds, question) and 'disease' in types:\n", + " question_type = 'disease_drug'\n", + " question_types.append(question_type)\n", + " \n", + "# 药物-疾病\n", + "if check_words(cure_qwds, question) and 'drug' in types:\n", + " question_type = 'drug_disease'\n", + " question_types.append(question_type)\n", + " \n", + "# 疾病-检查\n", + "if check_words(check_qwds, question) and 'disease' in types:\n", + " question_type = 'disease_check'\n", + " question_types.append(question_type)\n", + " \n", + "# 检查-疾病\n", + "if check_words(check_qwds+cure_qwds, question) and 'check' in types:\n", + " question_type = 'check_disease'\n", + " question_types.append(question_type)\n", + " \n", + "# 疾病-预防措施\n", + "if check_words(prevent_qwds, question) and 'disease' in types:\n", + " question_type = 'disease_prevent'\n", + " question_types.append(question_type)\n", + " \n", + "# 疾病-疗程\n", + "if check_words(lasttime_qwds, question) and 'disease' in types:\n", + " question_type = 'disease_lasttime'\n", + " question_types.append(question_type)\n", + "\n", + "# 疾病-疗法\n", + "if check_words(cureway_qwds, question) and 'disease' in types:\n", + " question_type = 'disease_cureway'\n", + " question_types.append(question_type)\n", + "\n", + "# 疾病-治愈率\n", + "if check_words(cureprob_qwds, question) and 'disease' in types:\n", + " question_type = 'disease_cureprob'\n", + " question_types.append(question_type)\n", + "\n", + "# 疾病-易感人群\n", + "if check_words(easyget_qwds, question) and 'disease' in types :\n", + " question_type = 'disease_easyget'\n", + " question_types.append(question_type)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['check_disease']" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "question_types" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [], + "source": [ + "# 若没有查到相关的外部查询信息,那么则将该疾病的描述信息返回\n", + "if question_types == [] and 'disease' in types:\n", + " question_types = ['disease_desc']\n", + "\n", + "# 若没有查到相关的外部查询信息,那么则将该疾病的描述信息返回\n", + "if question_types == [] and 'symptom' in types:\n", + " question_types = ['symptom_disease']\n", + "\n", + "# 将多个分类结果进行合并处理,组装成一个字典\n", + "output['question_types'] = question_types" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'args': {'肺气肿': ['disease'], '百日咳': ['disease'], '血常规': ['check']},\n", + " 'question_types': ['check_disease']}" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "output" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git "a/notebook_tutorials/\343\200\220F\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272-\347\224\237\346\210\220Cypher\346\237\245\350\257\242\350\257\255\345\217\245.ipynb" "b/notebook_tutorials/\343\200\220F\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272-\347\224\237\346\210\220Cypher\346\237\245\350\257\242\350\257\255\345\217\245.ipynb" new file mode 100644 index 0000000..dec13ca --- /dev/null +++ "b/notebook_tutorials/\343\200\220F\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272-\347\224\237\346\210\220Cypher\346\237\245\350\257\242\350\257\255\345\217\245.ipynb" @@ -0,0 +1,458 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 上一个代码的输出" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [], + "source": [ + "output_pre = {'args': {'肺气肿': ['disease'], '百日咳': ['disease'], '血常规': ['check']}, 'question_types': ['check_disease']}" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'args': {'肺气肿': ['disease'], '百日咳': ['disease'], '血常规': ['check']},\n", + " 'question_types': ['check_disease']}" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "output_pre" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [], + "source": [ + "args = output_pre['args']" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [], + "source": [ + "entity_dict = {}\n", + "for arg, types in args.items():\n", + " for type in types:\n", + " if type not in entity_dict:\n", + " entity_dict[type] = [arg]\n", + " else:\n", + " entity_dict[type].append(arg)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'disease': ['肺气肿', '百日咳'], 'check': ['血常规']}" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "entity_dict" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [], + "source": [ + "question_types = output_pre['question_types']" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['check_disease']" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "question_types" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'check_disease'" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "question_type" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "sqls = []" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [], + "source": [ + "def sql_transfer(question_type, entities):\n", + " '''\n", + " 不同的提问意图,对应不同关系的cypher查询语句\n", + " '''\n", + " \n", + " if not entities:\n", + " return []\n", + "\n", + " # 查询语句\n", + " sql = []\n", + " # 查询疾病的病因\n", + " if question_type == 'disease_cause':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.cause\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的预防措施\n", + " elif question_type == 'disease_prevent':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.prevent\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的疗程\n", + " elif question_type == 'disease_lasttime':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.cure_lasttime\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的治愈率\n", + " elif question_type == 'disease_cureprob':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.cured_prob\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的疗法\n", + " elif question_type == 'disease_cureway':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.cure_way\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的易感人群\n", + " elif question_type == 'disease_easyget':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.easy_get\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的描述\n", + " elif question_type == 'disease_desc':\n", + " sql = [\"MATCH (m:Disease) where m.name = '{0}' return m.name, m.desc\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的症状\n", + " elif question_type == 'disease_symptom':\n", + " sql = [\"MATCH (m:Disease)-[r:has_symptom]->(n:Symptom) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + "\n", + " # 查询症状对应的疾病\n", + " elif question_type == 'symptom_disease':\n", + " sql = [\"MATCH (m:Disease)-[r:has_symptom]->(n:Symptom) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + "\n", + " # 查询疾病的并发症\n", + " elif question_type == 'disease_acompany':\n", + " sql1 = [\"MATCH (m:Disease)-[r:acompany_with]->(n:Disease) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql2 = [\"MATCH (m:Disease)-[r:acompany_with]->(n:Disease) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql = sql1 + sql2\n", + " # 查询疾病的忌口\n", + " elif question_type == 'disease_not_food':\n", + " sql = [\"MATCH (m:Disease)-[r:no_eat]->(n:Food) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + "\n", + " # 查询疾病建议吃的东西\n", + " elif question_type == 'disease_do_food':\n", + " sql1 = [\"MATCH (m:Disease)-[r:do_eat]->(n:Food) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql2 = [\"MATCH (m:Disease)-[r:recommand_eat]->(n:Food) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql = sql1 + sql2\n", + "\n", + " # 已知忌口查疾病\n", + " elif question_type == 'food_not_disease':\n", + " sql = [\"MATCH (m:Disease)-[r:no_eat]->(n:Food) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + "\n", + " # 已知推荐查疾病\n", + " elif question_type == 'food_do_disease':\n", + " sql1 = [\"MATCH (m:Disease)-[r:do_eat]->(n:Food) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql2 = [\"MATCH (m:Disease)-[r:recommand_eat]->(n:Food) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql = sql1 + sql2\n", + "\n", + " # 查询疾病常用药品-药品别名记得扩充\n", + " elif question_type == 'disease_drug':\n", + " sql1 = [\"MATCH (m:Disease)-[r:common_drug]->(n:Drug) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql2 = [\"MATCH (m:Disease)-[r:recommand_drug]->(n:Drug) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql = sql1 + sql2\n", + "\n", + " # 已知药品查询能够治疗的疾病\n", + " elif question_type == 'drug_disease':\n", + " sql1 = [\"MATCH (m:Disease)-[r:common_drug]->(n:Drug) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql2 = [\"MATCH (m:Disease)-[r:recommand_drug]->(n:Drug) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + " sql = sql1 + sql2\n", + " # 查询疾病应该做的检查\n", + " elif question_type == 'disease_check':\n", + " sql = [\"MATCH (m:Disease)-[r:need_check]->(n:Check) where m.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + "\n", + " # 已知检查查询疾病\n", + " elif question_type == 'check_disease':\n", + " sql = [\"MATCH (m:Disease)-[r:need_check]->(n:Check) where n.name = '{0}' return m.name, r.name, n.name\".format(i) for i in entities]\n", + "\n", + " return sql" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[\"MATCH (m:Disease)-[r:need_check]->(n:Check) where n.name = '肺气肿' return m.name, r.name, n.name\",\n", + " \"MATCH (m:Disease)-[r:need_check]->(n:Check) where n.name = '百日咳' return m.name, r.name, n.name\"]" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sql_transfer('check_disease', ['肺气肿', '百日咳'])" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [], + "source": [ + "sqls = []\n", + "for question_type in question_types:\n", + " sql_ = {}\n", + " sql_['question_type'] = question_type\n", + " sql_['sql'] = sql_transfer(question_type, entity_dict.get(question_type.split('_')[0]))\n", + " sqls.append(sql_)" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'question_type': 'check_disease',\n", + " 'sql': [\"MATCH (m:Disease)-[r:need_check]->(n:Check) where n.name = '血常规' return m.name, r.name, n.name\"]}]" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sqls" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'check_disease'" + ] + }, + "execution_count": 47, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "question_type" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "# for question_type in question_types:\n", + "# sql_ = {}\n", + "# sql_['question_type'] = question_type\n", + "# sql = []\n", + "# if question_type == 'disease_symptom':\n", + "# sql = sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + "# elif question_type == 'symptom_disease':\n", + "# sql = sql_transfer(question_type, entity_dict.get('symptom'))\n", + "\n", + "# elif question_type == 'disease_cause':\n", + "# sql = sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + "# elif question_type == 'disease_acompany':\n", + "# sql = sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + "# elif question_type == 'disease_not_food':\n", + "# sql = sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + "# elif question_type == 'disease_do_food':\n", + "# sql = sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + "# elif question_type == 'food_not_disease':\n", + "# sql = sql_transfer(question_type, entity_dict.get('food'))\n", + "\n", + "# elif question_type == 'food_do_disease':\n", + "# sql = sql_transfer(question_type, entity_dict.get('food'))\n", + "\n", + "# elif question_type == 'disease_drug':\n", + "# sql = sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + "# elif question_type == 'drug_disease':\n", + "# sql = sql_transfer(question_type, entity_dict.get('drug'))\n", + "\n", + "# elif question_type == 'disease_check':\n", + "# sql = sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + "# elif question_type == 'check_disease':\n", + "# sql = sql_transfer(question_type, entity_dict.get('check'))\n", + "\n", + "# elif question_type == 'disease_prevent':\n", + "# sql = sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + "# elif question_type == 'disease_lasttime':\n", + "# sql = sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + "# elif question_type == 'disease_cureway':\n", + "# sql = sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + "# elif question_type == 'disease_cureprob':\n", + "# sql = sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + "# elif question_type == 'disease_easyget':\n", + "# sql = sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + "# elif question_type == 'disease_desc':\n", + "# sql = sql_transfer(question_type, entity_dict.get('disease'))\n", + "\n", + "# if sql:\n", + "# sql_['sql'] = sql\n", + "\n", + "# sqls.append(sql_)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'question_type': 'check_disease',\n", + " 'sql': [\"MATCH (m:Disease)-[r:need_check]->(n:Check) where n.name = '血常规' return m.name, r.name, n.name\"]}]" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sqls" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'question_type': 'check_disease',\n", + " 'sql': [\"MATCH (m:Disease)-[r:need_check]->(n:Check) where n.name = '血常规' return m.name, r.name, n.name\"]}]" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sqls" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git "a/notebook_tutorials/\343\200\220G\343\200\221\346\237\245\350\257\242\345\233\276\346\225\260\346\215\256\345\272\223\357\274\214\347\224\237\346\210\220\345\233\236\347\255\224.ipynb" "b/notebook_tutorials/\343\200\220G\343\200\221\346\237\245\350\257\242\345\233\276\346\225\260\346\215\256\345\272\223\357\274\214\347\224\237\346\210\220\345\233\236\347\255\224.ipynb" new file mode 100644 index 0000000..7412507 --- /dev/null +++ "b/notebook_tutorials/\343\200\220G\343\200\221\346\237\245\350\257\242\345\233\276\346\225\260\346\215\256\345\272\223\357\274\214\347\224\237\346\210\220\345\233\236\347\255\224.ipynb" @@ -0,0 +1,287 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 上一个代码的输出" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "sqls = [{'question_type': 'check_disease', 'sql': [\"MATCH (m:Disease)-[r:need_check]->(n:Check) where n.name = '血常规' return m.name, r.name, n.name\"]}]" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "from py2neo import Graph" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 连接图数据库" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "g = Graph(\"http://localhost:7474\", auth=(\"neo4j\", \"111695\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "num_limit = 20" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "final_answers = []" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'question_type': 'check_disease',\n", + " 'sql': [\"MATCH (m:Disease)-[r:need_check]->(n:Check) where n.name = '血常规' return m.name, r.name, n.name\"]}]" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sqls" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "'''根据对应的qustion_type,调用相应的回复模板'''\n", + "def answer_prettify(question_type, answers):\n", + " final_answer = []\n", + " if not answers:\n", + " return ''\n", + " if question_type == 'disease_symptom':\n", + " desc = [i['n.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}的症状包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'symptom_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '症状{0}可能染上的疾病有:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_cause':\n", + " desc = [i['m.cause'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}可能的成因有:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_prevent':\n", + " desc = [i['m.prevent'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}的预防措施包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_lasttime':\n", + " desc = [i['m.cure_lasttime'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}治疗可能持续的周期为:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_cureway':\n", + " desc = [';'.join(i['m.cure_way']) for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}可以尝试如下治疗:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_cureprob':\n", + " desc = [i['m.cured_prob'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}治愈的概率为(仅供参考):{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_easyget':\n", + " desc = [i['m.easy_get'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + "\n", + " final_answer = '{0}的易感人群包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_desc':\n", + " desc = [i['m.desc'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0},熟悉一下:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_acompany':\n", + " desc1 = [i['n.name'] for i in answers]\n", + " desc2 = [i['m.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " desc = [i for i in desc1 + desc2 if i != subject]\n", + " final_answer = '{0}的症状包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_not_food':\n", + " desc = [i['n.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}忌食的食物包括有:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_do_food':\n", + " do_desc = [i['n.name'] for i in answers if i['r.name'] == '宜吃']\n", + " recommand_desc = [i['n.name'] for i in answers if i['r.name'] == '推荐食谱']\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}宜食的食物包括有:{1}\\n推荐食谱包括有:{2}'.format(subject, ';'.join(list(set(do_desc))[:num_limit]), ';'.join(list(set(recommand_desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'food_not_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '患有{0}的人最好不要吃{1}'.format(';'.join(list(set(desc))[:num_limit]), subject)\n", + "\n", + " elif question_type == 'food_do_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '患有{0}的人建议多试试{1}'.format(';'.join(list(set(desc))[:num_limit]), subject)\n", + "\n", + " elif question_type == 'disease_drug':\n", + " desc = [i['n.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}通常的使用的药品包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'drug_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '{0}主治的疾病有{1},可以试试'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_check':\n", + " desc = [i['n.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}通常可以通过以下方式检查出来:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'check_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '通常可以通过{0}检查出来的疾病有{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " return final_answer" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "for sql_ in sqls:\n", + " question_type = sql_['question_type']\n", + " queries = sql_['sql']\n", + " answers = []\n", + " \n", + " \n", + " for query in queries: # 运行每一条cypher查询语句\n", + " ress = g.run(query).data()\n", + " answers += ress\n", + " final_answer = answer_prettify(question_type, answers)\n", + " if final_answer:\n", + " final_answers.append(final_answer)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'m.name': '肺炎杆菌肺炎', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '大叶性肺炎', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '二硫化碳中毒', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '百日咳', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '放射性肺炎', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '苯中毒', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '大楼病综合征', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '肺炎球菌肺炎', 'r.name': '诊断检查', 'n.name': '血常规'}]" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ress" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'通常可以通过血常规检查出来的疾病有二硫化碳中毒;大楼病综合征;肺炎杆菌肺炎;大叶性肺炎;苯中毒;放射性肺炎;肺炎球菌肺炎;百日咳'" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "final_answer" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git "a/notebook_tutorials/\343\200\220Y\343\200\221\346\234\252\346\235\245\345\261\225\346\234\233.ipynb" "b/notebook_tutorials/\343\200\220Y\343\200\221\346\234\252\346\235\245\345\261\225\346\234\233.ipynb" new file mode 100644 index 0000000..f77eadc --- /dev/null +++ "b/notebook_tutorials/\343\200\220Y\343\200\221\346\234\252\346\235\245\345\261\225\346\234\233.ipynb" @@ -0,0 +1,46 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "本案例只查询“单跳”关系,可以回答“胸闷可能是什么疾病”,但没法回答“胸闷应该去看哪个科室”或“胸闷应该做哪些检查”\n", + "\n", + "本案例仅仅是对问题进行模板规则匹配和关键词提取,没有用到自然语言处理和深度学习领域最前沿的“命名实体识别”、“情感分析”、“关系抽取”、“语义匹配”等技术。例如,如果把问题从“胸闷吃点什么好”换成“前胸有一点点堵吃点什么好”,则无法匹配。\n", + "\n", + "\n", + "本案例没有用到图神经网络、图嵌入、图数据挖掘等前沿的人工智能和知识图谱技术。\n", + "\n", + "本案例的数据仅是小规模的demo数据,如果有百万级节点和关系,将问答系统部署在服务器上,对外发布web应用,则对云数据库的数据存储与查询、分布式、多线程、高并发、容灾备份、弹性扩容等有更高的挑战。" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git "a/notebook_tutorials/\343\200\220Z\343\200\221\346\225\264\347\220\206\346\225\260\346\215\256-json\350\275\254csv.ipynb" "b/notebook_tutorials/\343\200\220Z\343\200\221\346\225\264\347\220\206\346\225\260\346\215\256-json\350\275\254csv.ipynb" new file mode 100644 index 0000000..1da840a --- /dev/null +++ "b/notebook_tutorials/\343\200\220Z\343\200\221\346\225\264\347\220\206\346\225\260\346\215\256-json\350\275\254csv.ipynb" @@ -0,0 +1,323 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 导入json文件" + ] + }, + { + "cell_type": "code", + "execution_count": 180, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import json\n", + "from tqdm import tqdm\n", + "df = pd.DataFrame()\n", + "data_path = 'QAMedicalKG/data/medical3.json'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## json转dataframe" + ] + }, + { + "cell_type": "code", + "execution_count": 181, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "21it [00:00, 194.84it/s]\n" + ] + } + ], + "source": [ + "p_feature = ['category', 'cure_department', 'symptom','check', 'acompany','cure_way','recommand_drug' , 'common_drug', 'drug_detail', 'do_eat','not_eat', 'recommand_eat']\n", + "\n", + "for data in tqdm(open(data_path, encoding='utf8')):\n", + " temp_data = json.loads(data)\n", + " for each in p_feature:\n", + " try:\n", + " temp_data[each] = ','.join(temp_data[each])\n", + " except:\n", + " pass\n", + " \n", + " df = df.append(temp_data, ignore_index=True)\n", + "del df['_id']\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 调整列名和顺序" + ] + }, + { + "cell_type": "code", + "execution_count": 182, + "metadata": {}, + "outputs": [], + "source": [ + "orders = ['name', 'desc', 'category', 'cure_department', 'cause', 'symptom', 'check', 'acompany', 'cost_money',\n", + " 'cure_lasttime', 'cure_way', 'cured_prob', 'easy_get',\n", + " 'get_prob', 'get_way', 'prevent',\n", + " 'recommand_drug' , 'common_drug', 'drug_detail', 'do_eat',\n", + " 'not_eat', 'recommand_eat', 'yibao_status']\n", + "df = df[orders]\n", + "orders_cn = ['疾病名称','疾病描述','疾病种类','科室','病因','症状','检查','并发症','花费','疗程','疗法','治愈率','易感人群','感染概率','感染途径','预防措施','推荐药物','常用药物','具体药物','可以吃','不可以吃','推荐吃','是否纳入医保']\n", + "df.columns = orders_cn" + ] + }, + { + "cell_type": "code", + "execution_count": 183, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
疾病名称疾病描述疾病种类科室病因症状检查并发症花费疗程...感染概率感染途径预防措施推荐药物常用药物具体药物可以吃不可以吃推荐吃是否纳入医保
0肺泡蛋白质沉积症肺泡蛋白质沉积症(简称PAP),又称Rosen-Castle-man-Liebow综合征,是...疾病百科,内科,呼吸内科内科,呼吸内科病因未明,推测与几方面因素有关:如大量粉尘吸入(铝,二氧化硅等),机体免疫功能下降(尤其婴幼...紫绀,胸痛,呼吸困难,乏力,毓卓胸部CT检查,肺活检,支气管镜检查多重肺部感染根据不同医院,收费标准不一致,省市三甲医院约( 8000——15000 元)约3个月...0.00002%无传染性1、避免感染分支杆菌病,卡氏肺囊肿肺炎,巨细胞病毒等。\\n2、注意锻炼身体,提高免疫力。NaNNaNNaNNaN
1百日咳百日咳(pertussis,whoopingcough)是由百日咳杆菌所致的急性呼吸道传染病...疾病百科,儿科,小儿内科儿科,小儿内科(一)发病原因\\n病原菌是鲍特菌属(Bordetella)中的百日咳鲍特菌(B.pertus...吸气时有蝉鸣音,痉挛性咳嗽,胸闷,肺阴虚,抽搐,低热,闫鹏辉,惊厥耳、鼻、咽拭子细菌培养,周围血白细胞计数及分类检验,血常规,酶联免疫吸附试验,白细胞分类计数肺不张根据不同医院,收费标准不一致,市三甲医院约(1000-4000元)1-2个月...0.5%呼吸道传播1、控制传染源:在流行季节,若有前驱症状应及早抗生素治疗。\\n2、切断传播途径:由于百日咳杆...琥乙红霉素片,琥乙红霉素颗粒,百咳静糖浆,穿心莲内酯片,红霉素肠溶片,环酯红霉素片穿心莲内酯片,百咳静糖浆惠普森穿心莲内酯片(穿心莲内酯片),北京同仁堂百咳静糖浆(百咳静糖浆),邦琪药业百咳静糖浆(...南瓜子仁,圆白菜,樱桃番茄,小白菜螃蟹,海蟹,海虾,海螺清蒸鸡蛋羹,百合双耳鸡蛋羹,排骨汤,罗汉果雪耳鸡汤,小黄瓜凉拌面,黄瓜三丝汤,黄瓜拌兔丝,黄...
\n", + "

2 rows × 23 columns

\n", + "
" + ], + "text/plain": [ + " 疾病名称 疾病描述 疾病种类 \\\n", + "0 肺泡蛋白质沉积症 肺泡蛋白质沉积症(简称PAP),又称Rosen-Castle-man-Liebow综合征,是... 疾病百科,内科,呼吸内科 \n", + "1 百日咳 百日咳(pertussis,whoopingcough)是由百日咳杆菌所致的急性呼吸道传染病... 疾病百科,儿科,小儿内科 \n", + "\n", + " 科室 病因 \\\n", + "0 内科,呼吸内科 病因未明,推测与几方面因素有关:如大量粉尘吸入(铝,二氧化硅等),机体免疫功能下降(尤其婴幼... \n", + "1 儿科,小儿内科 (一)发病原因\\n病原菌是鲍特菌属(Bordetella)中的百日咳鲍特菌(B.pertus... \n", + "\n", + " 症状 \\\n", + "0 紫绀,胸痛,呼吸困难,乏力,毓卓 \n", + "1 吸气时有蝉鸣音,痉挛性咳嗽,胸闷,肺阴虚,抽搐,低热,闫鹏辉,惊厥 \n", + "\n", + " 检查 并发症 \\\n", + "0 胸部CT检查,肺活检,支气管镜检查 多重肺部感染 \n", + "1 耳、鼻、咽拭子细菌培养,周围血白细胞计数及分类检验,血常规,酶联免疫吸附试验,白细胞分类计数 肺不张 \n", + "\n", + " 花费 疗程 ... 感染概率 感染途径 \\\n", + "0 根据不同医院,收费标准不一致,省市三甲医院约( 8000——15000 元) 约3个月 ... 0.00002% 无传染性 \n", + "1 根据不同医院,收费标准不一致,市三甲医院约(1000-4000元) 1-2个月 ... 0.5% 呼吸道传播 \n", + "\n", + " 预防措施 \\\n", + "0 1、避免感染分支杆菌病,卡氏肺囊肿肺炎,巨细胞病毒等。\\n2、注意锻炼身体,提高免疫力。 \n", + "1 1、控制传染源:在流行季节,若有前驱症状应及早抗生素治疗。\\n2、切断传播途径:由于百日咳杆... \n", + "\n", + " 推荐药物 常用药物 \\\n", + "0 NaN \n", + "1 琥乙红霉素片,琥乙红霉素颗粒,百咳静糖浆,穿心莲内酯片,红霉素肠溶片,环酯红霉素片 穿心莲内酯片,百咳静糖浆 \n", + "\n", + " 具体药物 可以吃 \\\n", + "0 NaN \n", + "1 惠普森穿心莲内酯片(穿心莲内酯片),北京同仁堂百咳静糖浆(百咳静糖浆),邦琪药业百咳静糖浆(... 南瓜子仁,圆白菜,樱桃番茄,小白菜 \n", + "\n", + " 不可以吃 推荐吃 是否纳入医保 \n", + "0 NaN NaN 否 \n", + "1 螃蟹,海蟹,海虾,海螺 清蒸鸡蛋羹,百合双耳鸡蛋羹,排骨汤,罗汉果雪耳鸡汤,小黄瓜凉拌面,黄瓜三丝汤,黄瓜拌兔丝,黄... 否 \n", + "\n", + "[2 rows x 23 columns]" + ] + }, + "execution_count": 183, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.head(2)" + ] + }, + { + "cell_type": "code", + "execution_count": 184, + "metadata": { + "scrolled": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "疾病名称 百日咳\n", + "疾病描述 百日咳(pertussis,whoopingcough)是由百日咳杆菌所致的急性呼吸道传染病...\n", + "疾病种类 疾病百科,儿科,小儿内科\n", + "科室 儿科,小儿内科\n", + "病因 (一)发病原因\\n病原菌是鲍特菌属(Bordetella)中的百日咳鲍特菌(B.pertus...\n", + "症状 吸气时有蝉鸣音,痉挛性咳嗽,胸闷,肺阴虚,抽搐,低热,闫鹏辉,惊厥\n", + "检查 耳、鼻、咽拭子细菌培养,周围血白细胞计数及分类检验,血常规,酶联免疫吸附试验,白细胞分类计数\n", + "并发症 肺不张\n", + "花费 根据不同医院,收费标准不一致,市三甲医院约(1000-4000元)\n", + "疗程 1-2个月\n", + "疗法 药物治疗,支持性治疗\n", + "治愈率 98%\n", + "易感人群 多见于小儿\n", + "感染概率 0.5%\n", + "感染途径 呼吸道传播\n", + "预防措施 1、控制传染源:在流行季节,若有前驱症状应及早抗生素治疗。\\n2、切断传播途径:由于百日咳杆...\n", + "推荐药物 琥乙红霉素片,琥乙红霉素颗粒,百咳静糖浆,穿心莲内酯片,红霉素肠溶片,环酯红霉素片\n", + "常用药物 穿心莲内酯片,百咳静糖浆\n", + "具体药物 惠普森穿心莲内酯片(穿心莲内酯片),北京同仁堂百咳静糖浆(百咳静糖浆),邦琪药业百咳静糖浆(...\n", + "可以吃 南瓜子仁,圆白菜,樱桃番茄,小白菜\n", + "不可以吃 螃蟹,海蟹,海虾,海螺\n", + "推荐吃 清蒸鸡蛋羹,百合双耳鸡蛋羹,排骨汤,罗汉果雪耳鸡汤,小黄瓜凉拌面,黄瓜三丝汤,黄瓜拌兔丝,黄...\n", + "是否纳入医保 否\n", + "Name: 1, dtype: object" + ] + }, + "execution_count": 184, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.iloc[1]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 导出csv文件" + ] + }, + { + "cell_type": "code", + "execution_count": 185, + "metadata": {}, + "outputs": [], + "source": [ + "df.to_csv('medical_data.csv', index=False)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} From 46f4cab66ee618eb698d36e2be16a95d457a2829 Mon Sep 17 00:00:00 2001 From: Tommy in Tongji <36354458+TommyZihao@users.noreply.github.com> Date: Sun, 26 Jun 2022 10:39:38 +0800 Subject: [PATCH 3/5] =?UTF-8?q?Delete=20=E3=80=90G=E3=80=91=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=9B=BE=E6=95=B0=E6=8D=AE=E5=BA=93=EF=BC=8C=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=9B=9E=E7=AD=94.ipynb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...346\210\220\345\233\236\347\255\224.ipynb" | 287 ------------------ 1 file changed, 287 deletions(-) delete mode 100644 "notebook_tutorials/\343\200\220G\343\200\221\346\237\245\350\257\242\345\233\276\346\225\260\346\215\256\345\272\223\357\274\214\347\224\237\346\210\220\345\233\236\347\255\224.ipynb" diff --git "a/notebook_tutorials/\343\200\220G\343\200\221\346\237\245\350\257\242\345\233\276\346\225\260\346\215\256\345\272\223\357\274\214\347\224\237\346\210\220\345\233\236\347\255\224.ipynb" "b/notebook_tutorials/\343\200\220G\343\200\221\346\237\245\350\257\242\345\233\276\346\225\260\346\215\256\345\272\223\357\274\214\347\224\237\346\210\220\345\233\236\347\255\224.ipynb" deleted file mode 100644 index 7412507..0000000 --- "a/notebook_tutorials/\343\200\220G\343\200\221\346\237\245\350\257\242\345\233\276\346\225\260\346\215\256\345\272\223\357\274\214\347\224\237\346\210\220\345\233\236\347\255\224.ipynb" +++ /dev/null @@ -1,287 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 上一个代码的输出" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [], - "source": [ - "sqls = [{'question_type': 'check_disease', 'sql': [\"MATCH (m:Disease)-[r:need_check]->(n:Check) where n.name = '血常规' return m.name, r.name, n.name\"]}]" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "from py2neo import Graph" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 连接图数据库" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "g = Graph(\"http://localhost:7474\", auth=(\"neo4j\", \"111695\"))" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [], - "source": [ - "num_limit = 20" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [], - "source": [ - "final_answers = []" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[{'question_type': 'check_disease',\n", - " 'sql': [\"MATCH (m:Disease)-[r:need_check]->(n:Check) where n.name = '血常规' return m.name, r.name, n.name\"]}]" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "sqls" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": {}, - "outputs": [], - "source": [ - "'''根据对应的qustion_type,调用相应的回复模板'''\n", - "def answer_prettify(question_type, answers):\n", - " final_answer = []\n", - " if not answers:\n", - " return ''\n", - " if question_type == 'disease_symptom':\n", - " desc = [i['n.name'] for i in answers]\n", - " subject = answers[0]['m.name']\n", - " final_answer = '{0}的症状包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'symptom_disease':\n", - " desc = [i['m.name'] for i in answers]\n", - " subject = answers[0]['n.name']\n", - " final_answer = '症状{0}可能染上的疾病有:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'disease_cause':\n", - " desc = [i['m.cause'] for i in answers]\n", - " subject = answers[0]['m.name']\n", - " final_answer = '{0}可能的成因有:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'disease_prevent':\n", - " desc = [i['m.prevent'] for i in answers]\n", - " subject = answers[0]['m.name']\n", - " final_answer = '{0}的预防措施包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'disease_lasttime':\n", - " desc = [i['m.cure_lasttime'] for i in answers]\n", - " subject = answers[0]['m.name']\n", - " final_answer = '{0}治疗可能持续的周期为:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'disease_cureway':\n", - " desc = [';'.join(i['m.cure_way']) for i in answers]\n", - " subject = answers[0]['m.name']\n", - " final_answer = '{0}可以尝试如下治疗:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'disease_cureprob':\n", - " desc = [i['m.cured_prob'] for i in answers]\n", - " subject = answers[0]['m.name']\n", - " final_answer = '{0}治愈的概率为(仅供参考):{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'disease_easyget':\n", - " desc = [i['m.easy_get'] for i in answers]\n", - " subject = answers[0]['m.name']\n", - "\n", - " final_answer = '{0}的易感人群包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'disease_desc':\n", - " desc = [i['m.desc'] for i in answers]\n", - " subject = answers[0]['m.name']\n", - " final_answer = '{0},熟悉一下:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'disease_acompany':\n", - " desc1 = [i['n.name'] for i in answers]\n", - " desc2 = [i['m.name'] for i in answers]\n", - " subject = answers[0]['m.name']\n", - " desc = [i for i in desc1 + desc2 if i != subject]\n", - " final_answer = '{0}的症状包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'disease_not_food':\n", - " desc = [i['n.name'] for i in answers]\n", - " subject = answers[0]['m.name']\n", - " final_answer = '{0}忌食的食物包括有:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'disease_do_food':\n", - " do_desc = [i['n.name'] for i in answers if i['r.name'] == '宜吃']\n", - " recommand_desc = [i['n.name'] for i in answers if i['r.name'] == '推荐食谱']\n", - " subject = answers[0]['m.name']\n", - " final_answer = '{0}宜食的食物包括有:{1}\\n推荐食谱包括有:{2}'.format(subject, ';'.join(list(set(do_desc))[:num_limit]), ';'.join(list(set(recommand_desc))[:self.num_limit]))\n", - "\n", - " elif question_type == 'food_not_disease':\n", - " desc = [i['m.name'] for i in answers]\n", - " subject = answers[0]['n.name']\n", - " final_answer = '患有{0}的人最好不要吃{1}'.format(';'.join(list(set(desc))[:num_limit]), subject)\n", - "\n", - " elif question_type == 'food_do_disease':\n", - " desc = [i['m.name'] for i in answers]\n", - " subject = answers[0]['n.name']\n", - " final_answer = '患有{0}的人建议多试试{1}'.format(';'.join(list(set(desc))[:num_limit]), subject)\n", - "\n", - " elif question_type == 'disease_drug':\n", - " desc = [i['n.name'] for i in answers]\n", - " subject = answers[0]['m.name']\n", - " final_answer = '{0}通常的使用的药品包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'drug_disease':\n", - " desc = [i['m.name'] for i in answers]\n", - " subject = answers[0]['n.name']\n", - " final_answer = '{0}主治的疾病有{1},可以试试'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'disease_check':\n", - " desc = [i['n.name'] for i in answers]\n", - " subject = answers[0]['m.name']\n", - " final_answer = '{0}通常可以通过以下方式检查出来:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " elif question_type == 'check_disease':\n", - " desc = [i['m.name'] for i in answers]\n", - " subject = answers[0]['n.name']\n", - " final_answer = '通常可以通过{0}检查出来的疾病有{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", - "\n", - " return final_answer" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": {}, - "outputs": [], - "source": [ - "for sql_ in sqls:\n", - " question_type = sql_['question_type']\n", - " queries = sql_['sql']\n", - " answers = []\n", - " \n", - " \n", - " for query in queries: # 运行每一条cypher查询语句\n", - " ress = g.run(query).data()\n", - " answers += ress\n", - " final_answer = answer_prettify(question_type, answers)\n", - " if final_answer:\n", - " final_answers.append(final_answer)" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[{'m.name': '肺炎杆菌肺炎', 'r.name': '诊断检查', 'n.name': '血常规'},\n", - " {'m.name': '大叶性肺炎', 'r.name': '诊断检查', 'n.name': '血常规'},\n", - " {'m.name': '二硫化碳中毒', 'r.name': '诊断检查', 'n.name': '血常规'},\n", - " {'m.name': '百日咳', 'r.name': '诊断检查', 'n.name': '血常规'},\n", - " {'m.name': '放射性肺炎', 'r.name': '诊断检查', 'n.name': '血常规'},\n", - " {'m.name': '苯中毒', 'r.name': '诊断检查', 'n.name': '血常规'},\n", - " {'m.name': '大楼病综合征', 'r.name': '诊断检查', 'n.name': '血常规'},\n", - " {'m.name': '肺炎球菌肺炎', 'r.name': '诊断检查', 'n.name': '血常规'}]" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "ress" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'通常可以通过血常规检查出来的疾病有二硫化碳中毒;大楼病综合征;肺炎杆菌肺炎;大叶性肺炎;苯中毒;放射性肺炎;肺炎球菌肺炎;百日咳'" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "final_answer" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.2" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} From 96991cd644576726ae03165c7e36edf964136201 Mon Sep 17 00:00:00 2001 From: Tommy in Tongji <36354458+TommyZihao@users.noreply.github.com> Date: Sun, 26 Jun 2022 10:39:50 +0800 Subject: [PATCH 4/5] =?UTF-8?q?Delete=20=E3=80=90Z=E3=80=91=E6=95=B4?= =?UTF-8?q?=E7=90=86=E6=95=B0=E6=8D=AE-json=E8=BD=ACcsv.ipynb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...260\346\215\256-json\350\275\254csv.ipynb" | 323 ------------------ 1 file changed, 323 deletions(-) delete mode 100644 "notebook_tutorials/\343\200\220Z\343\200\221\346\225\264\347\220\206\346\225\260\346\215\256-json\350\275\254csv.ipynb" diff --git "a/notebook_tutorials/\343\200\220Z\343\200\221\346\225\264\347\220\206\346\225\260\346\215\256-json\350\275\254csv.ipynb" "b/notebook_tutorials/\343\200\220Z\343\200\221\346\225\264\347\220\206\346\225\260\346\215\256-json\350\275\254csv.ipynb" deleted file mode 100644 index 1da840a..0000000 --- "a/notebook_tutorials/\343\200\220Z\343\200\221\346\225\264\347\220\206\346\225\260\346\215\256-json\350\275\254csv.ipynb" +++ /dev/null @@ -1,323 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 导入json文件" - ] - }, - { - "cell_type": "code", - "execution_count": 180, - "metadata": {}, - "outputs": [], - "source": [ - "import pandas as pd\n", - "import json\n", - "from tqdm import tqdm\n", - "df = pd.DataFrame()\n", - "data_path = 'QAMedicalKG/data/medical3.json'" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## json转dataframe" - ] - }, - { - "cell_type": "code", - "execution_count": 181, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "21it [00:00, 194.84it/s]\n" - ] - } - ], - "source": [ - "p_feature = ['category', 'cure_department', 'symptom','check', 'acompany','cure_way','recommand_drug' , 'common_drug', 'drug_detail', 'do_eat','not_eat', 'recommand_eat']\n", - "\n", - "for data in tqdm(open(data_path, encoding='utf8')):\n", - " temp_data = json.loads(data)\n", - " for each in p_feature:\n", - " try:\n", - " temp_data[each] = ','.join(temp_data[each])\n", - " except:\n", - " pass\n", - " \n", - " df = df.append(temp_data, ignore_index=True)\n", - "del df['_id']\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 调整列名和顺序" - ] - }, - { - "cell_type": "code", - "execution_count": 182, - "metadata": {}, - "outputs": [], - "source": [ - "orders = ['name', 'desc', 'category', 'cure_department', 'cause', 'symptom', 'check', 'acompany', 'cost_money',\n", - " 'cure_lasttime', 'cure_way', 'cured_prob', 'easy_get',\n", - " 'get_prob', 'get_way', 'prevent',\n", - " 'recommand_drug' , 'common_drug', 'drug_detail', 'do_eat',\n", - " 'not_eat', 'recommand_eat', 'yibao_status']\n", - "df = df[orders]\n", - "orders_cn = ['疾病名称','疾病描述','疾病种类','科室','病因','症状','检查','并发症','花费','疗程','疗法','治愈率','易感人群','感染概率','感染途径','预防措施','推荐药物','常用药物','具体药物','可以吃','不可以吃','推荐吃','是否纳入医保']\n", - "df.columns = orders_cn" - ] - }, - { - "cell_type": "code", - "execution_count": 183, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
疾病名称疾病描述疾病种类科室病因症状检查并发症花费疗程...感染概率感染途径预防措施推荐药物常用药物具体药物可以吃不可以吃推荐吃是否纳入医保
0肺泡蛋白质沉积症肺泡蛋白质沉积症(简称PAP),又称Rosen-Castle-man-Liebow综合征,是...疾病百科,内科,呼吸内科内科,呼吸内科病因未明,推测与几方面因素有关:如大量粉尘吸入(铝,二氧化硅等),机体免疫功能下降(尤其婴幼...紫绀,胸痛,呼吸困难,乏力,毓卓胸部CT检查,肺活检,支气管镜检查多重肺部感染根据不同医院,收费标准不一致,省市三甲医院约( 8000——15000 元)约3个月...0.00002%无传染性1、避免感染分支杆菌病,卡氏肺囊肿肺炎,巨细胞病毒等。\\n2、注意锻炼身体,提高免疫力。NaNNaNNaNNaN
1百日咳百日咳(pertussis,whoopingcough)是由百日咳杆菌所致的急性呼吸道传染病...疾病百科,儿科,小儿内科儿科,小儿内科(一)发病原因\\n病原菌是鲍特菌属(Bordetella)中的百日咳鲍特菌(B.pertus...吸气时有蝉鸣音,痉挛性咳嗽,胸闷,肺阴虚,抽搐,低热,闫鹏辉,惊厥耳、鼻、咽拭子细菌培养,周围血白细胞计数及分类检验,血常规,酶联免疫吸附试验,白细胞分类计数肺不张根据不同医院,收费标准不一致,市三甲医院约(1000-4000元)1-2个月...0.5%呼吸道传播1、控制传染源:在流行季节,若有前驱症状应及早抗生素治疗。\\n2、切断传播途径:由于百日咳杆...琥乙红霉素片,琥乙红霉素颗粒,百咳静糖浆,穿心莲内酯片,红霉素肠溶片,环酯红霉素片穿心莲内酯片,百咳静糖浆惠普森穿心莲内酯片(穿心莲内酯片),北京同仁堂百咳静糖浆(百咳静糖浆),邦琪药业百咳静糖浆(...南瓜子仁,圆白菜,樱桃番茄,小白菜螃蟹,海蟹,海虾,海螺清蒸鸡蛋羹,百合双耳鸡蛋羹,排骨汤,罗汉果雪耳鸡汤,小黄瓜凉拌面,黄瓜三丝汤,黄瓜拌兔丝,黄...
\n", - "

2 rows × 23 columns

\n", - "
" - ], - "text/plain": [ - " 疾病名称 疾病描述 疾病种类 \\\n", - "0 肺泡蛋白质沉积症 肺泡蛋白质沉积症(简称PAP),又称Rosen-Castle-man-Liebow综合征,是... 疾病百科,内科,呼吸内科 \n", - "1 百日咳 百日咳(pertussis,whoopingcough)是由百日咳杆菌所致的急性呼吸道传染病... 疾病百科,儿科,小儿内科 \n", - "\n", - " 科室 病因 \\\n", - "0 内科,呼吸内科 病因未明,推测与几方面因素有关:如大量粉尘吸入(铝,二氧化硅等),机体免疫功能下降(尤其婴幼... \n", - "1 儿科,小儿内科 (一)发病原因\\n病原菌是鲍特菌属(Bordetella)中的百日咳鲍特菌(B.pertus... \n", - "\n", - " 症状 \\\n", - "0 紫绀,胸痛,呼吸困难,乏力,毓卓 \n", - "1 吸气时有蝉鸣音,痉挛性咳嗽,胸闷,肺阴虚,抽搐,低热,闫鹏辉,惊厥 \n", - "\n", - " 检查 并发症 \\\n", - "0 胸部CT检查,肺活检,支气管镜检查 多重肺部感染 \n", - "1 耳、鼻、咽拭子细菌培养,周围血白细胞计数及分类检验,血常规,酶联免疫吸附试验,白细胞分类计数 肺不张 \n", - "\n", - " 花费 疗程 ... 感染概率 感染途径 \\\n", - "0 根据不同医院,收费标准不一致,省市三甲医院约( 8000——15000 元) 约3个月 ... 0.00002% 无传染性 \n", - "1 根据不同医院,收费标准不一致,市三甲医院约(1000-4000元) 1-2个月 ... 0.5% 呼吸道传播 \n", - "\n", - " 预防措施 \\\n", - "0 1、避免感染分支杆菌病,卡氏肺囊肿肺炎,巨细胞病毒等。\\n2、注意锻炼身体,提高免疫力。 \n", - "1 1、控制传染源:在流行季节,若有前驱症状应及早抗生素治疗。\\n2、切断传播途径:由于百日咳杆... \n", - "\n", - " 推荐药物 常用药物 \\\n", - "0 NaN \n", - "1 琥乙红霉素片,琥乙红霉素颗粒,百咳静糖浆,穿心莲内酯片,红霉素肠溶片,环酯红霉素片 穿心莲内酯片,百咳静糖浆 \n", - "\n", - " 具体药物 可以吃 \\\n", - "0 NaN \n", - "1 惠普森穿心莲内酯片(穿心莲内酯片),北京同仁堂百咳静糖浆(百咳静糖浆),邦琪药业百咳静糖浆(... 南瓜子仁,圆白菜,樱桃番茄,小白菜 \n", - "\n", - " 不可以吃 推荐吃 是否纳入医保 \n", - "0 NaN NaN 否 \n", - "1 螃蟹,海蟹,海虾,海螺 清蒸鸡蛋羹,百合双耳鸡蛋羹,排骨汤,罗汉果雪耳鸡汤,小黄瓜凉拌面,黄瓜三丝汤,黄瓜拌兔丝,黄... 否 \n", - "\n", - "[2 rows x 23 columns]" - ] - }, - "execution_count": 183, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df.head(2)" - ] - }, - { - "cell_type": "code", - "execution_count": 184, - "metadata": { - "scrolled": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "疾病名称 百日咳\n", - "疾病描述 百日咳(pertussis,whoopingcough)是由百日咳杆菌所致的急性呼吸道传染病...\n", - "疾病种类 疾病百科,儿科,小儿内科\n", - "科室 儿科,小儿内科\n", - "病因 (一)发病原因\\n病原菌是鲍特菌属(Bordetella)中的百日咳鲍特菌(B.pertus...\n", - "症状 吸气时有蝉鸣音,痉挛性咳嗽,胸闷,肺阴虚,抽搐,低热,闫鹏辉,惊厥\n", - "检查 耳、鼻、咽拭子细菌培养,周围血白细胞计数及分类检验,血常规,酶联免疫吸附试验,白细胞分类计数\n", - "并发症 肺不张\n", - "花费 根据不同医院,收费标准不一致,市三甲医院约(1000-4000元)\n", - "疗程 1-2个月\n", - "疗法 药物治疗,支持性治疗\n", - "治愈率 98%\n", - "易感人群 多见于小儿\n", - "感染概率 0.5%\n", - "感染途径 呼吸道传播\n", - "预防措施 1、控制传染源:在流行季节,若有前驱症状应及早抗生素治疗。\\n2、切断传播途径:由于百日咳杆...\n", - "推荐药物 琥乙红霉素片,琥乙红霉素颗粒,百咳静糖浆,穿心莲内酯片,红霉素肠溶片,环酯红霉素片\n", - "常用药物 穿心莲内酯片,百咳静糖浆\n", - "具体药物 惠普森穿心莲内酯片(穿心莲内酯片),北京同仁堂百咳静糖浆(百咳静糖浆),邦琪药业百咳静糖浆(...\n", - "可以吃 南瓜子仁,圆白菜,樱桃番茄,小白菜\n", - "不可以吃 螃蟹,海蟹,海虾,海螺\n", - "推荐吃 清蒸鸡蛋羹,百合双耳鸡蛋羹,排骨汤,罗汉果雪耳鸡汤,小黄瓜凉拌面,黄瓜三丝汤,黄瓜拌兔丝,黄...\n", - "是否纳入医保 否\n", - "Name: 1, dtype: object" - ] - }, - "execution_count": 184, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df.iloc[1]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 导出csv文件" - ] - }, - { - "cell_type": "code", - "execution_count": 185, - "metadata": {}, - "outputs": [], - "source": [ - "df.to_csv('medical_data.csv', index=False)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.2" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} From 3f64288ea2fc780cc4b4d3ca710a06ad4b82fa00 Mon Sep 17 00:00:00 2001 From: Tommy in Tongji <36354458+TommyZihao@users.noreply.github.com> Date: Sun, 26 Jun 2022 10:40:08 +0800 Subject: [PATCH 5/5] Add files via upload --- ...346\210\220\345\233\236\347\255\224.ipynb" | 287 ++++++++++++++++ ...260\346\215\256-json\350\275\254csv.ipynb" | 323 ++++++++++++++++++ 2 files changed, 610 insertions(+) create mode 100644 "notebook_tutorials/\343\200\220G\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272-\346\237\245\350\257\242\345\233\276\346\225\260\346\215\256\345\272\223\357\274\214\347\224\237\346\210\220\345\233\236\347\255\224.ipynb" create mode 100644 "notebook_tutorials/\343\200\220Z\343\200\221\351\231\204\345\275\225\357\274\232\346\225\264\347\220\206\346\225\260\346\215\256-json\350\275\254csv.ipynb" diff --git "a/notebook_tutorials/\343\200\220G\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272-\346\237\245\350\257\242\345\233\276\346\225\260\346\215\256\345\272\223\357\274\214\347\224\237\346\210\220\345\233\236\347\255\224.ipynb" "b/notebook_tutorials/\343\200\220G\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272-\346\237\245\350\257\242\345\233\276\346\225\260\346\215\256\345\272\223\357\274\214\347\224\237\346\210\220\345\233\236\347\255\224.ipynb" new file mode 100644 index 0000000..7412507 --- /dev/null +++ "b/notebook_tutorials/\343\200\220G\343\200\221\351\227\256\347\255\224\346\234\272\345\231\250\344\272\272-\346\237\245\350\257\242\345\233\276\346\225\260\346\215\256\345\272\223\357\274\214\347\224\237\346\210\220\345\233\236\347\255\224.ipynb" @@ -0,0 +1,287 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 上一个代码的输出" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "sqls = [{'question_type': 'check_disease', 'sql': [\"MATCH (m:Disease)-[r:need_check]->(n:Check) where n.name = '血常规' return m.name, r.name, n.name\"]}]" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "from py2neo import Graph" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 连接图数据库" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "g = Graph(\"http://localhost:7474\", auth=(\"neo4j\", \"111695\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "num_limit = 20" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "final_answers = []" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'question_type': 'check_disease',\n", + " 'sql': [\"MATCH (m:Disease)-[r:need_check]->(n:Check) where n.name = '血常规' return m.name, r.name, n.name\"]}]" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sqls" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "'''根据对应的qustion_type,调用相应的回复模板'''\n", + "def answer_prettify(question_type, answers):\n", + " final_answer = []\n", + " if not answers:\n", + " return ''\n", + " if question_type == 'disease_symptom':\n", + " desc = [i['n.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}的症状包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'symptom_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '症状{0}可能染上的疾病有:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_cause':\n", + " desc = [i['m.cause'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}可能的成因有:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_prevent':\n", + " desc = [i['m.prevent'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}的预防措施包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_lasttime':\n", + " desc = [i['m.cure_lasttime'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}治疗可能持续的周期为:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_cureway':\n", + " desc = [';'.join(i['m.cure_way']) for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}可以尝试如下治疗:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_cureprob':\n", + " desc = [i['m.cured_prob'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}治愈的概率为(仅供参考):{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_easyget':\n", + " desc = [i['m.easy_get'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + "\n", + " final_answer = '{0}的易感人群包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_desc':\n", + " desc = [i['m.desc'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0},熟悉一下:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_acompany':\n", + " desc1 = [i['n.name'] for i in answers]\n", + " desc2 = [i['m.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " desc = [i for i in desc1 + desc2 if i != subject]\n", + " final_answer = '{0}的症状包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_not_food':\n", + " desc = [i['n.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}忌食的食物包括有:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_do_food':\n", + " do_desc = [i['n.name'] for i in answers if i['r.name'] == '宜吃']\n", + " recommand_desc = [i['n.name'] for i in answers if i['r.name'] == '推荐食谱']\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}宜食的食物包括有:{1}\\n推荐食谱包括有:{2}'.format(subject, ';'.join(list(set(do_desc))[:num_limit]), ';'.join(list(set(recommand_desc))[:self.num_limit]))\n", + "\n", + " elif question_type == 'food_not_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '患有{0}的人最好不要吃{1}'.format(';'.join(list(set(desc))[:num_limit]), subject)\n", + "\n", + " elif question_type == 'food_do_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '患有{0}的人建议多试试{1}'.format(';'.join(list(set(desc))[:num_limit]), subject)\n", + "\n", + " elif question_type == 'disease_drug':\n", + " desc = [i['n.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}通常的使用的药品包括:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'drug_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '{0}主治的疾病有{1},可以试试'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'disease_check':\n", + " desc = [i['n.name'] for i in answers]\n", + " subject = answers[0]['m.name']\n", + " final_answer = '{0}通常可以通过以下方式检查出来:{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " elif question_type == 'check_disease':\n", + " desc = [i['m.name'] for i in answers]\n", + " subject = answers[0]['n.name']\n", + " final_answer = '通常可以通过{0}检查出来的疾病有{1}'.format(subject, ';'.join(list(set(desc))[:num_limit]))\n", + "\n", + " return final_answer" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "for sql_ in sqls:\n", + " question_type = sql_['question_type']\n", + " queries = sql_['sql']\n", + " answers = []\n", + " \n", + " \n", + " for query in queries: # 运行每一条cypher查询语句\n", + " ress = g.run(query).data()\n", + " answers += ress\n", + " final_answer = answer_prettify(question_type, answers)\n", + " if final_answer:\n", + " final_answers.append(final_answer)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'m.name': '肺炎杆菌肺炎', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '大叶性肺炎', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '二硫化碳中毒', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '百日咳', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '放射性肺炎', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '苯中毒', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '大楼病综合征', 'r.name': '诊断检查', 'n.name': '血常规'},\n", + " {'m.name': '肺炎球菌肺炎', 'r.name': '诊断检查', 'n.name': '血常规'}]" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ress" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'通常可以通过血常规检查出来的疾病有二硫化碳中毒;大楼病综合征;肺炎杆菌肺炎;大叶性肺炎;苯中毒;放射性肺炎;肺炎球菌肺炎;百日咳'" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "final_answer" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git "a/notebook_tutorials/\343\200\220Z\343\200\221\351\231\204\345\275\225\357\274\232\346\225\264\347\220\206\346\225\260\346\215\256-json\350\275\254csv.ipynb" "b/notebook_tutorials/\343\200\220Z\343\200\221\351\231\204\345\275\225\357\274\232\346\225\264\347\220\206\346\225\260\346\215\256-json\350\275\254csv.ipynb" new file mode 100644 index 0000000..1da840a --- /dev/null +++ "b/notebook_tutorials/\343\200\220Z\343\200\221\351\231\204\345\275\225\357\274\232\346\225\264\347\220\206\346\225\260\346\215\256-json\350\275\254csv.ipynb" @@ -0,0 +1,323 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 导入json文件" + ] + }, + { + "cell_type": "code", + "execution_count": 180, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import json\n", + "from tqdm import tqdm\n", + "df = pd.DataFrame()\n", + "data_path = 'QAMedicalKG/data/medical3.json'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## json转dataframe" + ] + }, + { + "cell_type": "code", + "execution_count": 181, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "21it [00:00, 194.84it/s]\n" + ] + } + ], + "source": [ + "p_feature = ['category', 'cure_department', 'symptom','check', 'acompany','cure_way','recommand_drug' , 'common_drug', 'drug_detail', 'do_eat','not_eat', 'recommand_eat']\n", + "\n", + "for data in tqdm(open(data_path, encoding='utf8')):\n", + " temp_data = json.loads(data)\n", + " for each in p_feature:\n", + " try:\n", + " temp_data[each] = ','.join(temp_data[each])\n", + " except:\n", + " pass\n", + " \n", + " df = df.append(temp_data, ignore_index=True)\n", + "del df['_id']\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 调整列名和顺序" + ] + }, + { + "cell_type": "code", + "execution_count": 182, + "metadata": {}, + "outputs": [], + "source": [ + "orders = ['name', 'desc', 'category', 'cure_department', 'cause', 'symptom', 'check', 'acompany', 'cost_money',\n", + " 'cure_lasttime', 'cure_way', 'cured_prob', 'easy_get',\n", + " 'get_prob', 'get_way', 'prevent',\n", + " 'recommand_drug' , 'common_drug', 'drug_detail', 'do_eat',\n", + " 'not_eat', 'recommand_eat', 'yibao_status']\n", + "df = df[orders]\n", + "orders_cn = ['疾病名称','疾病描述','疾病种类','科室','病因','症状','检查','并发症','花费','疗程','疗法','治愈率','易感人群','感染概率','感染途径','预防措施','推荐药物','常用药物','具体药物','可以吃','不可以吃','推荐吃','是否纳入医保']\n", + "df.columns = orders_cn" + ] + }, + { + "cell_type": "code", + "execution_count": 183, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
疾病名称疾病描述疾病种类科室病因症状检查并发症花费疗程...感染概率感染途径预防措施推荐药物常用药物具体药物可以吃不可以吃推荐吃是否纳入医保
0肺泡蛋白质沉积症肺泡蛋白质沉积症(简称PAP),又称Rosen-Castle-man-Liebow综合征,是...疾病百科,内科,呼吸内科内科,呼吸内科病因未明,推测与几方面因素有关:如大量粉尘吸入(铝,二氧化硅等),机体免疫功能下降(尤其婴幼...紫绀,胸痛,呼吸困难,乏力,毓卓胸部CT检查,肺活检,支气管镜检查多重肺部感染根据不同医院,收费标准不一致,省市三甲医院约( 8000——15000 元)约3个月...0.00002%无传染性1、避免感染分支杆菌病,卡氏肺囊肿肺炎,巨细胞病毒等。\\n2、注意锻炼身体,提高免疫力。NaNNaNNaNNaN
1百日咳百日咳(pertussis,whoopingcough)是由百日咳杆菌所致的急性呼吸道传染病...疾病百科,儿科,小儿内科儿科,小儿内科(一)发病原因\\n病原菌是鲍特菌属(Bordetella)中的百日咳鲍特菌(B.pertus...吸气时有蝉鸣音,痉挛性咳嗽,胸闷,肺阴虚,抽搐,低热,闫鹏辉,惊厥耳、鼻、咽拭子细菌培养,周围血白细胞计数及分类检验,血常规,酶联免疫吸附试验,白细胞分类计数肺不张根据不同医院,收费标准不一致,市三甲医院约(1000-4000元)1-2个月...0.5%呼吸道传播1、控制传染源:在流行季节,若有前驱症状应及早抗生素治疗。\\n2、切断传播途径:由于百日咳杆...琥乙红霉素片,琥乙红霉素颗粒,百咳静糖浆,穿心莲内酯片,红霉素肠溶片,环酯红霉素片穿心莲内酯片,百咳静糖浆惠普森穿心莲内酯片(穿心莲内酯片),北京同仁堂百咳静糖浆(百咳静糖浆),邦琪药业百咳静糖浆(...南瓜子仁,圆白菜,樱桃番茄,小白菜螃蟹,海蟹,海虾,海螺清蒸鸡蛋羹,百合双耳鸡蛋羹,排骨汤,罗汉果雪耳鸡汤,小黄瓜凉拌面,黄瓜三丝汤,黄瓜拌兔丝,黄...
\n", + "

2 rows × 23 columns

\n", + "
" + ], + "text/plain": [ + " 疾病名称 疾病描述 疾病种类 \\\n", + "0 肺泡蛋白质沉积症 肺泡蛋白质沉积症(简称PAP),又称Rosen-Castle-man-Liebow综合征,是... 疾病百科,内科,呼吸内科 \n", + "1 百日咳 百日咳(pertussis,whoopingcough)是由百日咳杆菌所致的急性呼吸道传染病... 疾病百科,儿科,小儿内科 \n", + "\n", + " 科室 病因 \\\n", + "0 内科,呼吸内科 病因未明,推测与几方面因素有关:如大量粉尘吸入(铝,二氧化硅等),机体免疫功能下降(尤其婴幼... \n", + "1 儿科,小儿内科 (一)发病原因\\n病原菌是鲍特菌属(Bordetella)中的百日咳鲍特菌(B.pertus... \n", + "\n", + " 症状 \\\n", + "0 紫绀,胸痛,呼吸困难,乏力,毓卓 \n", + "1 吸气时有蝉鸣音,痉挛性咳嗽,胸闷,肺阴虚,抽搐,低热,闫鹏辉,惊厥 \n", + "\n", + " 检查 并发症 \\\n", + "0 胸部CT检查,肺活检,支气管镜检查 多重肺部感染 \n", + "1 耳、鼻、咽拭子细菌培养,周围血白细胞计数及分类检验,血常规,酶联免疫吸附试验,白细胞分类计数 肺不张 \n", + "\n", + " 花费 疗程 ... 感染概率 感染途径 \\\n", + "0 根据不同医院,收费标准不一致,省市三甲医院约( 8000——15000 元) 约3个月 ... 0.00002% 无传染性 \n", + "1 根据不同医院,收费标准不一致,市三甲医院约(1000-4000元) 1-2个月 ... 0.5% 呼吸道传播 \n", + "\n", + " 预防措施 \\\n", + "0 1、避免感染分支杆菌病,卡氏肺囊肿肺炎,巨细胞病毒等。\\n2、注意锻炼身体,提高免疫力。 \n", + "1 1、控制传染源:在流行季节,若有前驱症状应及早抗生素治疗。\\n2、切断传播途径:由于百日咳杆... \n", + "\n", + " 推荐药物 常用药物 \\\n", + "0 NaN \n", + "1 琥乙红霉素片,琥乙红霉素颗粒,百咳静糖浆,穿心莲内酯片,红霉素肠溶片,环酯红霉素片 穿心莲内酯片,百咳静糖浆 \n", + "\n", + " 具体药物 可以吃 \\\n", + "0 NaN \n", + "1 惠普森穿心莲内酯片(穿心莲内酯片),北京同仁堂百咳静糖浆(百咳静糖浆),邦琪药业百咳静糖浆(... 南瓜子仁,圆白菜,樱桃番茄,小白菜 \n", + "\n", + " 不可以吃 推荐吃 是否纳入医保 \n", + "0 NaN NaN 否 \n", + "1 螃蟹,海蟹,海虾,海螺 清蒸鸡蛋羹,百合双耳鸡蛋羹,排骨汤,罗汉果雪耳鸡汤,小黄瓜凉拌面,黄瓜三丝汤,黄瓜拌兔丝,黄... 否 \n", + "\n", + "[2 rows x 23 columns]" + ] + }, + "execution_count": 183, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.head(2)" + ] + }, + { + "cell_type": "code", + "execution_count": 184, + "metadata": { + "scrolled": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "疾病名称 百日咳\n", + "疾病描述 百日咳(pertussis,whoopingcough)是由百日咳杆菌所致的急性呼吸道传染病...\n", + "疾病种类 疾病百科,儿科,小儿内科\n", + "科室 儿科,小儿内科\n", + "病因 (一)发病原因\\n病原菌是鲍特菌属(Bordetella)中的百日咳鲍特菌(B.pertus...\n", + "症状 吸气时有蝉鸣音,痉挛性咳嗽,胸闷,肺阴虚,抽搐,低热,闫鹏辉,惊厥\n", + "检查 耳、鼻、咽拭子细菌培养,周围血白细胞计数及分类检验,血常规,酶联免疫吸附试验,白细胞分类计数\n", + "并发症 肺不张\n", + "花费 根据不同医院,收费标准不一致,市三甲医院约(1000-4000元)\n", + "疗程 1-2个月\n", + "疗法 药物治疗,支持性治疗\n", + "治愈率 98%\n", + "易感人群 多见于小儿\n", + "感染概率 0.5%\n", + "感染途径 呼吸道传播\n", + "预防措施 1、控制传染源:在流行季节,若有前驱症状应及早抗生素治疗。\\n2、切断传播途径:由于百日咳杆...\n", + "推荐药物 琥乙红霉素片,琥乙红霉素颗粒,百咳静糖浆,穿心莲内酯片,红霉素肠溶片,环酯红霉素片\n", + "常用药物 穿心莲内酯片,百咳静糖浆\n", + "具体药物 惠普森穿心莲内酯片(穿心莲内酯片),北京同仁堂百咳静糖浆(百咳静糖浆),邦琪药业百咳静糖浆(...\n", + "可以吃 南瓜子仁,圆白菜,樱桃番茄,小白菜\n", + "不可以吃 螃蟹,海蟹,海虾,海螺\n", + "推荐吃 清蒸鸡蛋羹,百合双耳鸡蛋羹,排骨汤,罗汉果雪耳鸡汤,小黄瓜凉拌面,黄瓜三丝汤,黄瓜拌兔丝,黄...\n", + "是否纳入医保 否\n", + "Name: 1, dtype: object" + ] + }, + "execution_count": 184, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.iloc[1]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 导出csv文件" + ] + }, + { + "cell_type": "code", + "execution_count": 185, + "metadata": {}, + "outputs": [], + "source": [ + "df.to_csv('medical_data.csv', index=False)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +}