国产精品1024永久观看,大尺度欧美暖暖视频在线观看,亚洲宅男精品一区在线观看,欧美日韩一区二区三区视频,2021中文字幕在线观看

  • <option id="fbvk0"></option>
    1. <rt id="fbvk0"><tr id="fbvk0"></tr></rt>
      <center id="fbvk0"><optgroup id="fbvk0"></optgroup></center>
      <center id="fbvk0"></center>

      <li id="fbvk0"><abbr id="fbvk0"><dl id="fbvk0"></dl></abbr></li>

      運(yùn)行于手持智能設(shè)備上的臨床醫(yī)學(xué)智能輔助診斷系統(tǒng)的制作方法

      文檔序號(hào):6554607閱讀:553來(lái)源:國(guó)知局

      專利名稱::運(yùn)行于手持智能設(shè)備上的臨床醫(yī)學(xué)智能輔助診斷系統(tǒng)的制作方法第一章
      技術(shù)領(lǐng)域
      本系統(tǒng)是臨床醫(yī)學(xué)和軟件工程相結(jié)合的產(chǎn)物。具體說(shuō)來(lái),本系統(tǒng)首先組織各臨床學(xué)科的專家進(jìn)行討論,組織材料,按照系統(tǒng)要求把個(gè)癥狀組織為層次結(jié)構(gòu),對(duì)給出疾病列表中的每種疾病進(jìn)行打分,評(píng)出其出現(xiàn)的可能性。然后把這些信息用軟件工程的方法整合在一起,形成一套系統(tǒng)軟件,并發(fā)行于手持式智能段備上,供醫(yī)生隨時(shí)查詢使用。第二章
      背景技術(shù)
      :涉及臨床醫(yī)學(xué)和軟件工程●臨床醫(yī)學(xué)首先是臨床醫(yī)學(xué)只是,各種疾病的癥狀、病因、資料、診斷、用藥;病原學(xué)知識(shí);實(shí)驗(yàn)室檢查知識(shí);藥品的藥理、毒理、用法和劑量?!褴浖こ讨悄茉O(shè)備系統(tǒng)軟件開(kāi)發(fā)、源代碼管理、版本控制、軟件加密、智能升級(jí)、軟件發(fā)行、培訓(xùn)、服務(wù)第三章
      發(fā)明內(nèi)容1、軟件特點(diǎn)本項(xiàng)目通過(guò)PDA(掌上電腦)這種便捷的平臺(tái)為醫(yī)生提供一種方便的、功能強(qiáng)大的智能診斷工具。醫(yī)生只需根據(jù)病人的主訴,用輸入筆在PDA上輸入癥狀,系統(tǒng)即可在瞬間把每種癥狀所對(duì)應(yīng)的疾病列出來(lái),同時(shí)列出這些癥狀對(duì)疾病貢獻(xiàn)(百分比)。當(dāng)輸入一定數(shù)量的癥狀后,診斷結(jié)論建議即可給出(少量的疾病列表),最終結(jié)論由醫(yī)生做出。對(duì)做出的結(jié)論可繼續(xù)獲得相應(yīng)的治療方法、相關(guān)藥物。還可進(jìn)一步獲得有關(guān)病源學(xué)、藥物、實(shí)驗(yàn)室結(jié)果方面的信息。另外,用戶也可選擇一組癥狀進(jìn)行直接查詢,系統(tǒng)將給出與這些癥狀有關(guān)的所有疾病列表。同時(shí)本系統(tǒng)還將是一本實(shí)用醫(yī)學(xué)手冊(cè)大全,在任何時(shí)候醫(yī)生都可以隨時(shí)查閱任意病癥的相關(guān)信息發(fā)病癥狀、體征、實(shí)驗(yàn)室檢查結(jié)果、治療手段、相關(guān)藥品、病源學(xué)的相關(guān)理論。另外,對(duì)于剛剛從事醫(yī)療工作的年輕人,他們剛剛走出校門,各方面的經(jīng)驗(yàn)都非常欠缺。通過(guò)本系統(tǒng)的使用,可以幫助他們?cè)诙唐趦?nèi)迅速獲得有價(jià)值的信息。這對(duì)他們的成長(zhǎng)是很有意義的。針對(duì)上述情況,本系統(tǒng)能在病情—病癥—治療之間迅速鎖定相關(guān)信息、數(shù)據(jù),協(xié)助醫(yī)生迅速做出正確的結(jié)論,有效的避免誤診、漏診(中國(guó)的誤診率高居不下的原因是傳統(tǒng)醫(yī)學(xué)依然沒(méi)有真正利用現(xiàn)代高科技手段進(jìn)行輔助而造成的)。同時(shí)也是一本翔實(shí)的醫(yī)學(xué)文獻(xiàn)、資料、數(shù)據(jù)大全,因此也是醫(yī)生平時(shí)的好助手。2、系統(tǒng)功能特點(diǎn)●根據(jù)癥狀、體征及實(shí)驗(yàn)室結(jié)果,給出最有可能的一些診斷結(jié)論?!癜Y狀對(duì)疾病貢獻(xiàn)(百分比)●可查詢每一種疾病的一般知識(shí)、臨床表現(xiàn)特點(diǎn)、鑒別診斷、診斷依據(jù)、主要的實(shí)驗(yàn)室檢查及其結(jié)果意義、治療用藥、劑量及用法?!窨刹樵兠恳环N藥物的適應(yīng)癥、用法、劑量、不良反應(yīng)、注意事項(xiàng)及與其它藥物的相互作用等。●可查詢病原學(xué)的各種信息●可查詢實(shí)驗(yàn)室結(jié)果的各種信息●上述幾類信息若有關(guān)聯(lián)的信息,相互之間可以交叉查詢?!裣到y(tǒng)每月進(jìn)行更新?!癖鞠到y(tǒng)是運(yùn)行在PDA、智能手機(jī)等便攜式掌上設(shè)備平臺(tái)之上的。3、同類產(chǎn)品之比較目前國(guó)內(nèi)尚無(wú)同類產(chǎn)品美國(guó)目前已有兩家公司有類似產(chǎn)品,他們的主要功能是●根據(jù)用戶輸入的關(guān)鍵字,可以查到某種疾病,進(jìn)而可以得到該疾病的臨床表現(xiàn)、癥狀、治療方法、實(shí)驗(yàn)室檢查、用藥●根據(jù)用戶輸入的關(guān)鍵字,可以查到實(shí)驗(yàn)室結(jié)果●基本上是一個(gè)專業(yè)醫(yī)學(xué)字典。●由于都是剛剛投放市場(chǎng),全是英文版。我們的特點(diǎn)●根據(jù)病人主訴,在癥狀體征逐步輸入的過(guò)程中逐漸把相關(guān)的疾病羅列出來(lái)●病人敘述的癥狀越多,羅列的疾病越少●各癥狀對(duì)疾病的貢獻(xiàn)以數(shù)字的形式給出(由相關(guān)專家討論決定)●醫(yī)生可根據(jù)羅列出的疾病,結(jié)合實(shí)驗(yàn)室檢查、檢驗(yàn),最后作診斷結(jié)論●根據(jù)輸入的關(guān)鍵字查詢疾病、實(shí)驗(yàn)室結(jié)果、病原學(xué)、藥品,進(jìn)而得到相應(yīng)的詳細(xì)內(nèi)容。在查詢這一點(diǎn)上,和國(guó)外同類產(chǎn)品是相同的。但是我們?cè)黾恿瞬≡瓕W(xué)、藥品?!裼捎谟兴幤返膬?nèi)容,產(chǎn)品將來(lái)將成為處方藥的廣告平臺(tái)。(目標(biāo)用戶是臨床醫(yī)生)?!裣茸鲋形陌妫^而出英文版等外語(yǔ)版本。●網(wǎng)上數(shù)據(jù)更新、升級(jí)。4、軟件原理本系統(tǒng)首先組織醫(yī)學(xué)專家(著名醫(yī)院的科主任、名流大學(xué)的教授、研究員)對(duì)疾病、藥物、病原學(xué)、實(shí)驗(yàn)室結(jié)果進(jìn)行論證,并以科學(xué)的邏輯關(guān)系把上述數(shù)據(jù)組織起來(lái),然后通過(guò)軟件的形式加以實(shí)現(xiàn),并運(yùn)行在PDA(掌上電腦、智能終端)上。便于系統(tǒng)迅速找到所需結(jié)果。通過(guò)本系統(tǒng)的使用,臨床大夫可以養(yǎng)成良好的臨床思維習(xí)慣,減少或避免漏診和誤診。當(dāng)在臨床醫(yī)生這一專業(yè)領(lǐng)域基本普及后,本系統(tǒng)將面向大眾提供醫(yī)療咨詢。普通人群可以通過(guò)本系統(tǒng)獲得四方面的信息服務(wù)1)輸入自我感覺(jué)的癥狀(可能的話可以輸入在醫(yī)院的實(shí)驗(yàn)室檢查結(jié)果),可以獲得對(duì)自身不適的大概認(rèn)識(shí)(大概是什么病)。2)對(duì)醫(yī)院已作出的診斷結(jié)論,可以獲得該疾病的癥狀、治療、用藥、病原學(xué)、實(shí)驗(yàn)室結(jié)果,從而有效地避免醫(yī)患之間的信息不對(duì)稱。3)通過(guò)用藥一節(jié)的內(nèi)容可以獲得藥品的藥效、毒理、計(jì)量、用法以及生產(chǎn)廠家的信息(甚至藥品的價(jià)格),從而有效地避免醫(yī)生亂開(kāi)藥。4)通過(guò)實(shí)驗(yàn)室檢查一節(jié)可以獲得該疾病所必須實(shí)施的檢查,從而避免醫(yī)生亂開(kāi)檢查項(xiàng)目。5)面向大眾提供醫(yī)療信息咨詢將不再局限于智能終端設(shè)備,而是將充分利用互聯(lián)網(wǎng)、無(wú)線網(wǎng)絡(luò)(尤其是3G網(wǎng))。因此,本產(chǎn)品首先在后臺(tái)維護(hù)一個(gè)龐大的數(shù)據(jù),并以有效的結(jié)構(gòu)組織起來(lái)。這個(gè)數(shù)據(jù)又分為臺(tái)式機(jī)版本以及智能型設(shè)備版本。兩個(gè)版本的結(jié)構(gòu)、內(nèi)容是一致的,但是各自適用于對(duì)應(yīng)平臺(tái)。臺(tái)式機(jī)版本主要為維護(hù)(添加、刪除、整理數(shù)據(jù)間關(guān)系)之用。智能型版本為最終發(fā)行版本,運(yùn)行于用戶的智能型設(shè)備上。數(shù)據(jù)分為癥狀、疾病、藥物、病原學(xué)、實(shí)驗(yàn)室結(jié)果。其中●癥狀包括人類已知疾病表現(xiàn)出來(lái)的所有癥狀。為使系統(tǒng)運(yùn)行便利,系統(tǒng)又為其追加了“頂級(jí)癥狀”屬性。所謂“頂級(jí)癥狀”就是指那些容易被患者所感知、容易被檢測(cè)出來(lái)、容易被醫(yī)生所想到的癥狀,并且絕大多數(shù)可以不需要關(guān)聯(lián)其他癥狀即可出現(xiàn)。而“非頂級(jí)癥狀”則需要在關(guān)聯(lián)癥狀出現(xiàn)后才能發(fā)生。如此設(shè)置可以讓系統(tǒng)在前幾級(jí)界面顯示的數(shù)據(jù)量少,方便使用。癥狀還擁有“編碼”屬性,采用國(guó)際標(biāo)準(zhǔn)統(tǒng)一編碼?!窦膊“Q及屬性信息。疾病屬性包括一般情況、臨床表現(xiàn)、診斷要點(diǎn)、鑒別診斷、治療、實(shí)驗(yàn)室檢查。其中治療包含有藥物的用法及劑量?!袼幬锇Q、適應(yīng)癥、禁忌癥、不良反應(yīng)。其中適應(yīng)癥里包含藥物的用法及劑量?!癫≡瓕W(xué)包括名稱、一般性狀、所致疾病類型、檢測(cè)方法。●實(shí)驗(yàn)室結(jié)果包括名稱、正常值范圍、臨床意義?!袼帍S這是廣告內(nèi)容。藥物信息和藥廠的產(chǎn)品是關(guān)聯(lián)的,即通過(guò)藥品名稱可以查出藥廠名稱,進(jìn)而得到藥品的某種對(duì)應(yīng)商品名?!癜Y狀間關(guān)系不同疾病對(duì)應(yīng)不同癥狀,同一疾病的癥狀間是有前后、主次關(guān)系的。這使得我們可以從癥狀的關(guān)系中得出診斷結(jié)論。這實(shí)質(zhì)上就是臨床思維。如圖1所示。如果病人出現(xiàn)黃疸,那么接下來(lái)就要判斷是否有肝腫大;若有肝腫大,則要判斷肝腫大的程度;若為輕度或中度,則要判斷有無(wú)發(fā)熱腹痛或肝壓病;若無(wú)腹痛或肝壓病,則要判斷有無(wú)膽囊腫大;若無(wú)膽囊腫大,則要判斷有無(wú)皮膚色素沉著;若無(wú)皮膚色素沉著,則要判斷有無(wú)水腫或腹水;至此,所謂的臨床思維中的癥狀判斷就已結(jié)束。系統(tǒng)可以給出診斷結(jié)論。至于是何種結(jié)論,在下一組數(shù)據(jù)設(shè)置里給出??梢钥闯?,癥狀間的關(guān)系是一種典型的多叉樹(shù)結(jié)構(gòu)。因此系統(tǒng)數(shù)據(jù)里將包含大量的這種多叉樹(shù)關(guān)系,進(jìn)而對(duì)它的操作將大量涉及遞歸運(yùn)算。5、運(yùn)行流程圖.運(yùn)行分為PDA本機(jī)運(yùn)行操作以及升級(jí)。升級(jí)流程圖見(jiàn)圖2本機(jī)運(yùn)行分為診斷和查詢?cè)\斷流程圖見(jiàn)圖3說(shuō)明進(jìn)入該畫(huà)面,系統(tǒng)列出所有癥狀供用戶選擇;當(dāng)用戶選擇某癥狀后,系統(tǒng)列出兩類信息與該癥狀有關(guān)的疾病以及出現(xiàn)該癥狀后患者還會(huì)出現(xiàn)的癥狀;繼續(xù)選擇,到某一定程度,系統(tǒng)將只列出疾病,預(yù)示著以上癥狀的發(fā)生,患者所患的疾病只能是這幾種了。提醒醫(yī)生從中作選擇并下結(jié)論。其中有些疾病醫(yī)生可能想不到,而系統(tǒng)給列出來(lái),這就避免了漏診。診斷結(jié)論醫(yī)生可以進(jìn)一步根據(jù)實(shí)驗(yàn)室結(jié)果、鑒別診斷、臨床表現(xiàn)、診斷要點(diǎn)等作診斷結(jié)論。同時(shí)系統(tǒng)對(duì)所選擇的癥狀,對(duì)其中某疾病的貢獻(xiàn)給出百分比數(shù)字,有效地減少了誤診。關(guān)聯(lián)信息在疾病一般情況里可以關(guān)聯(lián)查看相應(yīng)的病原學(xué)內(nèi)容;診斷要點(diǎn)里可以查到實(shí)驗(yàn)室結(jié)果相應(yīng)項(xiàng)目的內(nèi)容。鑒別診斷里可以關(guān)聯(lián)到其他疾病的內(nèi)容;治療可以關(guān)聯(lián)查出對(duì)應(yīng)藥物的內(nèi)容,如劑量、用法。查詢流程分幾部分●根據(jù)癥狀直接查尋疾病說(shuō)明癥狀列表中選擇一組癥狀,點(diǎn)擊查尋按鈕后系統(tǒng)自動(dòng)把所有包含這些癥狀的疾病列出來(lái)。見(jiàn)圖4?!窦膊⌒畔⒉樵冋f(shuō)明在疾病查詢界面,用戶輸入關(guān)鍵字,如肝炎,這可以查詢疾病名稱包含該關(guān)鍵字的所有疾病,進(jìn)而可以得到某疾病的相關(guān)信息??梢阅:樵?。關(guān)聯(lián)信息和診斷操作里的關(guān)聯(lián)方法、內(nèi)容是一樣的。見(jiàn)圖5?!袼幬锊樵冋f(shuō)明查詢?cè)硗?,根?jù)生產(chǎn)廠可以關(guān)聯(lián)出廣告。見(jiàn)圖6?!癫≡瓕W(xué)查詢說(shuō)明查詢?cè)硗?。●?shí)驗(yàn)室結(jié)果查詢查詢?cè)硗?。?jiàn)圖7。6、舉例運(yùn)行運(yùn)行流程見(jiàn)圖8。第四章具體實(shí)施例方式根據(jù)上述系統(tǒng)原理及數(shù)據(jù)結(jié)構(gòu),系統(tǒng)實(shí)現(xiàn)方法分為臺(tái)式機(jī)版本數(shù)據(jù)生成、智能型版本數(shù)據(jù)生成、智能設(shè)備上用戶程序開(kāi)發(fā)、安裝程序以及發(fā)行程序五個(gè)部分?!衽_(tái)式機(jī)版本數(shù)據(jù)這是系統(tǒng)數(shù)據(jù)的源頭。專家論證后的結(jié)果首先在這個(gè)模塊里維護(hù)進(jìn)系統(tǒng)中,后序的功能模塊才能開(kāi)始工作。由于是運(yùn)行于臺(tái)式機(jī)上的,臺(tái)式機(jī)上的成熟商業(yè)軟件也可加以充分利用。主要是后臺(tái)數(shù)據(jù)的保存以及前臺(tái)數(shù)據(jù)的操作。本系統(tǒng)后臺(tái)數(shù)據(jù)利用現(xiàn)成的商業(yè)軟件如Caché、Oracle、SyBase或MSSQLServer。目前采用MSSQLServer,主要是為智能終端設(shè)備準(zhǔn)備數(shù)據(jù)。未來(lái)若通過(guò)互聯(lián)網(wǎng)、3G網(wǎng)絡(luò)提供醫(yī)療信息咨詢時(shí),將優(yōu)先考慮大型商業(yè)數(shù)據(jù)庫(kù)(Caché、Oracle、SyBase)。●臺(tái)式機(jī)版本數(shù)據(jù)的前臺(tái)操作界面采用主流開(kāi)發(fā)工具進(jìn)行,如Delphi、MSVisualC++、Powerbuilder、Java等??紤]到未來(lái)網(wǎng)絡(luò)的發(fā)展,本系統(tǒng)目前使用MSVisualStudio.Net進(jìn)行開(kāi)發(fā)?!裰悄苄桶姹緮?shù)據(jù)生成智能型設(shè)備由于CPU及操作系統(tǒng)的不同,運(yùn)行其中的數(shù)據(jù)庫(kù)系統(tǒng)不盡相同,因此本模塊主要是完成從臺(tái)式機(jī)數(shù)據(jù)庫(kù)到各種不同智能型設(shè)備數(shù)據(jù)庫(kù)的自動(dòng)轉(zhuǎn)換。這樣就把基本數(shù)據(jù)的準(zhǔn)備和發(fā)行的目標(biāo)數(shù)據(jù)分離開(kāi)來(lái)。兩部分工作因此可以同步分頭進(jìn)行。智能型版本數(shù)據(jù)生成有兩條技術(shù)路線數(shù)據(jù)同步以及網(wǎng)絡(luò)數(shù)據(jù)傳輸。數(shù)據(jù)同步依據(jù)數(shù)據(jù)庫(kù)系統(tǒng)的數(shù)據(jù)同步原理,由系統(tǒng)使用的數(shù)據(jù)庫(kù)系統(tǒng)自動(dòng)進(jìn)行同步。同步成功后,智能設(shè)備上的數(shù)據(jù)將和臺(tái)式機(jī)的數(shù)據(jù)在結(jié)構(gòu)和內(nèi)容上保持一致。這個(gè)技術(shù)路線適合于MSSQLServer和MSSQLServerCE之間的數(shù)據(jù)同步。網(wǎng)絡(luò)數(shù)據(jù)傳輸適用于那些不具備自動(dòng)同步的系統(tǒng)。通過(guò)臺(tái)式機(jī)和智能設(shè)備之間的網(wǎng)絡(luò)傳輸來(lái)傳遞數(shù)據(jù)的結(jié)構(gòu)和數(shù)據(jù)。●我們使用網(wǎng)絡(luò)數(shù)據(jù)傳輸,因?yàn)檫@種方式可以靈活控制傳輸?shù)臄?shù)據(jù)的多少。●智能設(shè)備用戶程序包括運(yùn)行程序、安裝程序、發(fā)行程序?!襁\(yùn)行程序運(yùn)行程序在智能設(shè)備上調(diào)用后臺(tái)數(shù)據(jù)庫(kù),根據(jù)用戶的操作顯示相關(guān)信息。采用MSVisualStudio.Net進(jìn)行開(kāi)發(fā)。包括診斷模塊、疾病模塊、藥物模塊、病原學(xué)模塊、實(shí)驗(yàn)室檢查模塊。●4裝程序智能設(shè)備上的程序是通過(guò)在臺(tái)式機(jī)上運(yùn)行安裝程序,由它來(lái)把程序及數(shù)據(jù)文件傳遞到智能設(shè)備上的。安裝程序應(yīng)具備判斷智能設(shè)備類型的功能。另外系統(tǒng)的升級(jí)也是通過(guò)安裝程序進(jìn)行的。為方便系統(tǒng)的升級(jí),升級(jí)功能將提供單獨(dú)的安裝程序?!癜l(fā)行程序系統(tǒng)的發(fā)行有幾種可能用戶自己安裝,這可以使用安裝程序進(jìn)行;統(tǒng)一安裝后連帶智能設(shè)備一同提供給用戶??梢詥蝹€(gè)處理也可批量處理。單個(gè)處理實(shí)際上可以由安裝程序完成,發(fā)行量小時(shí)可以。發(fā)行量大時(shí)必須使用批量方式。通過(guò)和智能設(shè)備廠家合作,在參加安裝智能設(shè)備操作系統(tǒng)時(shí)把本系統(tǒng)作為操作系統(tǒng)的一個(gè)組成部分一并安裝。1、臺(tái)式機(jī)版本數(shù)據(jù)的具體實(shí)現(xiàn)步驟及系統(tǒng)關(guān)鍵結(jié)構(gòu)、核心代碼臺(tái)式機(jī)版本數(shù)據(jù)的生成分為后臺(tái)數(shù)據(jù)及前端程序兩部分,兩者通過(guò)網(wǎng)絡(luò)相連接。后臺(tái)數(shù)據(jù)運(yùn)行在中央服務(wù)器上,通過(guò)MSSQLServer進(jìn)行管理。如圖9所示這種結(jié)構(gòu)是一種分布式結(jié)構(gòu),可是實(shí)現(xiàn)多人同時(shí)協(xié)同工作每個(gè)人在各自工作站上運(yùn)行數(shù)據(jù)管理程序,數(shù)據(jù)集中在服務(wù)器上保存。后臺(tái)數(shù)據(jù)庫(kù)結(jié)構(gòu)如下IFEXISTS(SELECTnameFROMmaster.dbo.sysdatabasesWHEREname=N’PDA’)DROPDATABASE[PDA]CREATEDATABASE[PDA]ON(NAME=N’PDA_Data’,F(xiàn)ILENAME=N’c:\ProgramFiles\MicrosoftSQLServer\MSSQL\daya\PDA_Data.MDF’,SIZE=2.FILEGROWTH=10%)LOGON(NAME=N’PDA_Log’,F(xiàn)ILENAME=N’c:\ProgramFiles\MiccrosoftSQLServer\MSSQL\data\PDA_Log.LDF’,SIZE=3,F(xiàn)ILEGROWTH=10%)COLLATEChinese_PRC_CI_ASexecsp_dboptionN’PDA’,N’autoclose’,N’false’execsp_dboptionN’PDA’,N’bulkcopy’,N’false’execsp_dboptionNP’DA’,N’N’trunc.log’,N’false’execsp_dboptionN’PDA’,N’tompagedetection’,N’true’execsp_dboptionN’PDA’,N’readonly’,N’false’execsp_dboptionN’PDA’,N’dbouse’,N’false’execsp_dboptionN’PDA’,N’single’,N’false’execsp_dboptionN’PDA’,N’autoshrink’,N’false’execsp_dboptionN’PDA’,N’ANSInulldefault’,N’false’execsp_dboptionN’PDA’,N’recursivetriggers’,N’false’execsp_dboptionN’PDA’,N’ANSInulls’,N’false’exec3p_dboptionN’PDA’,N’concatnullyieldsnull’,N’false’execsp_dboptionN’PDA’,N’cursorcloseoncommit’,N’false’execsp_dboptionN’PDA’,N’defaulttolocalcursor’,N’false’execsp_dboptionN’PDA’,N’quotedidentifier’,N’false’execsp_dboptionN’PDA’,N’ANSlwamingd’,N’false’execsp_dboptionN’PDA’,N’autocreatestatistics’,N’true’execsp_dboptionN’PDA’,N’autoupdatestatistics’,N’true’if((@@microsoftversion/power(2,24)=8)and(@@microsoftversion&amp;0xffff>=724))or((@@microsoftversion/power(2,24)=7)and(@@microsoftversion&amp;oxffff>=1082)))execsp_dboptionNPDA’,N’dbchaining’,N’false’use[PDA]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[VIEW1]’)andOBJECTPROPERTY(id,N’IsView’)=1)dropview[dbo].[VIEW1]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_advertisement]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_advertisement]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_char_index]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_char_index]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_developer]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_developer]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_diagnosis]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_diagnosis]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_disease]’)andOBJECTPROPERTY(id.N’IsUserTable’)=1)droptable[dbo].[tb_disease]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_disease_basic]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_disease_basic]ifexisrs(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_disease_symptom]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_disease_symptom]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_eighth_child]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_eighth_child]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_fifth_child]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_fifth_child]ifexists(select*fromdbo.syobjectswhereid=object_id(N’[dbo].[tb_first_child]’)andOBJECTPROPERTY(idN’IsUserTable’)=1)droptable[dbo].[tb_first_child]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_flag_table]’)audOBJECTPROPERTY(id,N’IsUserTabIe’)=1)droptabIe[dbo].[tb_flag_table]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_fourth_child]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_fourth_child]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_medication]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_medication]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_medication_detail]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_medication_detail]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_nineth_child]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_nineth_child]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_physic]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_physic]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_root]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_root]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_second_child]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_second_child]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_seventh_child]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_seventh_child]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_sixth_child]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_sixth_child]ifexists(seleclt*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_symptom]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_symptom]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_symptom_contribute]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_symptom_contribute]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_symptom_vs_disease]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_symptom_vs_disease]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_tenth_child]’)andOBJECTPROPERTY(idN’IsUserTable’)=1)droptable[dbo].[tb_tenth_child]ifexists(select*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_third_child]’)andOBJECTPROPERTY(idN’IsUserTable’)=1)droptable[dbo].[tb_third_child]ifexists(delect*fromdbo.sysobjectswhereid=object_id(N’[dbo].[tb_treatment]’)andOBJECTPROPERTY(id,N’IsUserTable’)=1)droptable[dbo].[tb_treatment]CREATETABLE[dbo].[tb_advertisement]([f_id][int]NULL,[f_advertisement][varchar](2000)COLLATEChinese_PRC_CI_ASNOTNULL)ON[PRIMARY]//廣告表,用于保存廣告內(nèi)容CREATETABLE[dbo].[tb_char_index]([f_char][char](4)COLLATEChinese_PRC_CI_ASNULL,[f_index][char](1)COLLATEChinese_PRC_CI_ASNULL)ON[PRIMARY]//漢字編碼表,用于產(chǎn)生拼音碼CREATETABLE[dbo].[tb_developer]([f_developer_id][int]NOTNULL,[f_name][varchar](20)COLLATEChinese_PRC_CI_ASNOTNULL,[f_org][varchar](50)COLLATEChinese_PRC_CI_ASNULL,[f_resume][varchar](255)COLLATEChinese_PRC_CI_ASNULL)ON[PRIMARY]//系統(tǒng)開(kāi)發(fā)人員列表CREATETABLE[dbo].[tb_diagnosis]([f_id][int]IDENTITY(1,1)NOTNULL,[f_disease_id][int]NULL,[f_diagnosis][varchar](2000)COLLATEChinese_PRC_CI_ASNOTNULL)ON[PRIMARY]//診斷表,存儲(chǔ)某疾病的診斷信息,其中f_disease_id對(duì)應(yīng)某疾病的編碼,f_diagnosis對(duì)應(yīng)診斷內(nèi)容CREATETABLE[dbo].[tb_disease]([f_disease_id][int]NOTNULL,[f_disease_name][varchar](200)COLLATEChinese_PRC_CI_ASNOTNULL,[varcbar](6)COLLATEChinese_PRC_CI_ASNULL)ON[PRIMARY]//疾病表,儲(chǔ)存疾病名稱以及編碼,f_spell是拼音碼,用于快速查找某疾病CREATETABLE[dbo].[tb_disease_basic]([f_id][int]IDENTITY(1,1)NOTNULL,[f_disease_id][int]NOTNULL,[f_disease_basic][varchar](2000)COLLATEChinese_PRC_CI_ASNOTNULL)ON[PRIMARY]//疾病基本信息,其中f_disease_id對(duì)應(yīng)某疾病的編碼,f_disease_basic對(duì)應(yīng)基本信息CREATETABLE[dbo].[tb_disesse_symptom]([f_id][int]IDENTITY(1,1)NOTNULL,[f_disease_id][int]NULL,[f_disease_symptom][varchar](2000)COLLATEChinese_PRC_CI_ASNOTNULL)ON[PRIMARY]//疾病的詳細(xì)癥狀,,其中f_disease_id對(duì)應(yīng)某疾病的編碼,f_disease_symptom對(duì)應(yīng)癥狀CREATETABLE[dbo].[tb_eighth_child]([f_parent_id][int]NOTNULL,[f_me_id][int]NOTNULL,[f_node_flag][int]NOTNULL,[f_parent_node][int]NOTNULL)ON[PRIMAARY]//第八層癥狀關(guān)系表CREATETABLE[dbo].[tb_fifth_child]([f_parent_id][int]NOTNULL,[f_me_id][int]NOTNULL,[f_node_flag][int]NOTNULL,[f_parent_node][int]NOTNULL)ON[PRIMARY]//第五層癥狀關(guān)系表CREATETABLE[dbo].[tb_first_child]([f_parent_id][int]NOTNULL,[f_me_id][int]NOTNULL,[f_node_flag][int]NOTNULL,[f_parent_node][int]NOTNULL)ON[PRIMARY]//第三層癥狀關(guān)系表CREATETABLE[dbo].[tb_flag_table]([f_node_id][int]NOTNULL,[f_disease_id][int]NOTNULL,[f_symptom_id][int]NOTNULL,[f_end_node_flag][int]NOTNULL,[f_developer_id][int]NOTNULL)ON[PRIMARY]//標(biāo)志表用以記錄各層次節(jié)點(diǎn)的編號(hào)、疾病的編號(hào)、癥狀的編號(hào)、末端節(jié)點(diǎn)的編號(hào)、開(kāi)發(fā)人員的編號(hào),以保證各類信息編號(hào)的唯一性CREATETABLE[dbo].[tb_fourth_child]([f_parent_id][int]NOTNULL,[f_me_id][int]NOTNULL,[f_node_flag][int]NOTNULL,[f_parent_node][int]NOTNULL)ON[PRIMARY]//第四層癥狀關(guān)系表CREATETABLE[dbo].[tb_medication]([f_medication_id][int]IDENTITY(1,1)NOTNULL,[f_medication_name][varchar](200)COLLATEChinese_PRC_CI_ASNULL)ON[PRIMARY]//藥品表,記錄藥品的名稱CREATETABLE[dbo].[tb_medication_detail]([f_medication_id][int]NULL,[f_medication_detail][varchar](255)COLLATEChinese_PRC_CI_ASNOTNULL)ON[PRIMARY]//藥品詳細(xì)內(nèi)容表,記錄藥品的詳細(xì)內(nèi)容CREATETABLE[dbo].[tb_nineth_child]([f_parent_id][int]NOTNULL,[f_me_id][int]NOTNULL,[f_node_flag][int]NOTNULL,[f_parent_node][int]NOTNULL)ON[PRIMARY]//第九層癥狀關(guān)系表CREATETABLE[dbo].[tb_physic]([f_id][int]IDENTITY(1,1)NOTNULL,[f_disease_id][int]NULL,[f_physic][varchar](2000)COLLATEChinese_PRC_CI_ASNOTNULL)ON[PRIMARY]//疾病病因表CREATETABLE[dbo].[tb_root]([f_root_id][int]NULL,[f_node_flag][int]NOTNULL)ON[PRIMARY]//第頂層癥狀關(guān)系表CREATETABLE[dbo].[tb_second_child]([f_parent_id][int]NOTNULL,[f_me_id][int]NOTNULL,[f_node_flag][int]NOTNULL,[f_parent_node][int]NOTNULL)ON[PRIMARY]//第二層癥狀關(guān)系表CREATETABLE[dbo].[tb_seventh_child]([f_parent_id][int]NOTNULL,[f_me_id][int]NOTNULL,[f_node_ag][int]NOTNULL,[f_parent_node][int]NOTNULL)ON[PRIMARY]//第七層癥狀關(guān)系表CREATETABLE[dbo].[tb_sixth_child]([f_parant_id][int]NOTNULL,[f_me_id][int]NOTNULL,[f_node_flag][int]NOTNULL,[f_parent_node][int]NOTNULL)ON[PRIMARY]//第六層癥狀關(guān)系表CREATETABLE[dbo].[tb_symptom]([f_symptom_id][int]NOTNULL,[f_symptom_name][varhar](200)COLLATEChinese_PRC_CI_ASNOTNULL,[f_spell][varchar](6)COLLATEChinese_PRC_CI_ASNULL,[f_root_flag][char](1)COLLATEChinese_PRC_CI_ASNULL)ON[PRIMARY]//癥狀表,記錄單個(gè)癥狀CREATETABLE[dbo].[tb_symptom_contribute]([f_node_flag][int]NULL,[f_disease_id][int]NULL,[f_contribute][int]NULL)ON[PRIMARY]//癥狀對(duì)疾病的貢獻(xiàn)CREATETABLE[dbo].[tb_symptom_vs_disease]([f_node_flag][int]NOTNULL,[f_Disease_id][int]NULL,[f_symptom_id][int]NULL)ON[PRIMARY]//癥狀疾病間的關(guān)系CREATETABLE[dbo].[tb_tenth_child]([f_parent_id][int]NOTNULL,[f_me_id][int]NOTNULL,[f_node_flag][int]NOTNULL,[f_parent_node][int]NOTNULL)ON[PRIMARY]//第十層癥狀關(guān)系表CREATETABLE[dbo].[tb_third_child]([f_parent_id][int]NOTNULL,[f_me_ind][int]NOTNULL,[f_node_flag][int]NOTNULL,[f_parent_node][int]NOTNULL)ON[PRIMARY]//第三層癥狀關(guān)系表CREATETABLE[dbo].[tb_treatment]([f_id][int]IDENTITY(1,1)NOTNULL,[f_disease_id][int]NULL,[f_treatment][varchar](2000)COLLATEChinese_PRC_CI_ASNOTNULL)ON[PRIMARY]//疾病的治療方法表2、各表之間的關(guān)系及操作代碼和界面2.1、程序初始化,數(shù)據(jù)庫(kù)連接程序開(kāi)始運(yùn)行時(shí)首先做必要的初始化工作,完成數(shù)據(jù)庫(kù)的連接設(shè)置。代碼如下privatevoidSymptom_RelationShip_Load(objectsender,System.EventArgse){Stringpda_ini;StreamReadersr=newStreamReader(″pda.ini″);pda_ini=sr.ReadLine();sr.Close();cnn=newSystem.Data.SqlClient.SqlConnection();cnn.ConnectionString=pda_ini;cnn.Open();cmd=newSystem.Data.SqlClient.SqlCommand(″selectf_symptom_id,f_symptom_namefromtb_symptom″,cnn);dtr=cmd.ExecuteReader();total_Symptom_Number=0;while(dtr.Read()==true)total_Symptom_Number++;dtr.Close();Total_Symptom_Id_lis=newstring[total_Symptom_Number];Totsl_Symptom_Name_lis=newstring[total_Symptom_Number];dtr=cmd.ExecuteReader();inti=0;while(dtr.Read()==true){Total_symptom_Id_lis[i]=dtr.GetValue(0).ToString();Total_Symptom_Name_lis[i]=dtr.GetValue(1).ToString();i++;}dtr.Close();sqlConnectionl.ConnectionString=pda_ini;data_Set_Symptom.Clear();sqlDataAdapter1.Fill(data_Set_Symptom,″tb_symptom″);dataSet_Symptom_Right.Clear();sqlDataAdapter2.Fill(dataSet_Symptom_Right,″tb_symptom″);}2.2癥狀表及癥狀之間的關(guān)系,如圖10所示系統(tǒng)首先維護(hù)癥狀表,包括癥狀名稱、是否是根節(jié)點(diǎn)以及拼音碼。根節(jié)點(diǎn)的意義前面已經(jīng)闡述,拼音碼用于以后快速在軟件中查找定位某癥狀。圖11為操作界面。在下方輸入框中輸入癥狀,點(diǎn)擊保存即可輸入新癥狀。位于其上的輸入框?yàn)楦驴?,選中的癥狀可以在此更新。在左側(cè)輸入框輸入拼音,可以快速找到某癥狀,如輸入h,系統(tǒng)將顯示所有名稱第一個(gè)漢字的拼音包含h的癥狀。保存癥狀的代碼如下privatevoidbutton2_Click(objectsender,System.EventArgse)if(textBox1.Text==″″)return;StringSymptom_id;cmd.CommandText=″select*fromtb_symptomwheref_symptom_name=_+textBox1.Text+″_;dtr=cmd.ExecuteReader();if(dtr.Read()=true)dtr.Close();MessageBox.Show(″系統(tǒng)已經(jīng)包括該癥狀″);textBox1.Text=″″;return;elsedtr.Close();cmd.CommandText=″selectf_symptom_idfromtb_flag_table″;dtr=cmd.ExecuteReader();dtr.Read();Symptom_id=dtr.GetValue(0).ToString();dtr.Close();cmd.CommandText=″updatetb_flag_tablesetf_symptom_id=f_symptom_id+1″;cmd.ExecuteNonQuery();cmd.CommandText=″insertintotb_symptom(f_symptom_id,f_symptom_name)values(_+Symptom_id+_,_+textBox1.Text+_)″;cmd.ExecuteNonQuery();cmd.Dispose();data_Set_Symptom.Clear();sqlDataAdapter_symptom.Fill(data_Set_Symptom,″tb_symptom″);dataGrid_Symptom.SetDataBinding(data_Set_Symptom,″tb_symptom″);textBox1.Text=″″;textBox1.Focus();更新癥狀的代碼如下privatevoidbutton1_Click_1(objectsender,System.EventArgse){if(selected_symptom_id==″″){MessageBox.Show(″請(qǐng)先選擇某一癥狀″);return;}cmd.CommandText=″updatetb_symptomsetf_symptom_name=_+textBox2.Text+_wheref_symptom_id=_+selected_symptom_id+″_;cmd.ExecuteNonQuery();data_Set_Symptom.Clear();sqlDataAdapter_symptom.Fill(data_Set_Symptom,″tb_symptom″);dataGrid_Symptom.SetDataBinding(data_Set_Symptom,″tb_symptom″);selected_symptom_id=″″;textBox2.Text=″″;}拼音碼的產(chǎn)生代碼如下(使用MicrosoftVisualBasic6.0)癥狀的頂級(jí)節(jié)點(diǎn)屬性操作界面見(jiàn)圖12,操作代碼是privatevoidbuttonl_Click(objectsender,System.EventArgse){stringsymptom_name,symptom_id;inti;for(i=0;i<checkedListBox1.Items.Count;i++){symptom_name=checkedListBox1.Items[i].ToString();cmd.CommandText=″selectf_symptom_idfromtb_symptomwheref_symptom_name=_+symptom_name+″_;dtr=cmd.ExecuteReader();dtr.Read();symptom_id=dtr.GetValue(0).ToString();dtr.Close();if(checkedListBox1.GetItemChecked(i))cmd.CommandText=″updatetb_symptomsetf_root_flag=′R′wheref_symptom_id=_+symptom_id+″_;elsecmd.CommandText=″updatetb_symptomsetf_root_flag=′C′wheref_symptom_id=_+symptom_id+″_;cmd.ExecuteNonQuery();}MessageBox.Show(″OK″);}癥狀間關(guān)系的維護(hù)界面見(jiàn)圖13。左右兩側(cè)為系統(tǒng)所有癥狀列表,點(diǎn)擊選擇左側(cè)列表,被選中的癥狀作為頂級(jí)癥狀,顯示在中部的關(guān)系圖中。若該頂級(jí)癥狀的下級(jí)關(guān)系已經(jīng)存在則顯示在中部,不然作為中部關(guān)系圖的根節(jié)點(diǎn)顯示,等待下級(jí)關(guān)系的輸入。如圖13所示,關(guān)系圖是典型的樹(shù)狀結(jié)構(gòu)。在中部點(diǎn)擊選中某一節(jié)點(diǎn),然后在右側(cè)列表中雙擊某癥狀,則該癥狀將作為選中節(jié)點(diǎn)的子癥狀添加到樹(shù)狀結(jié)構(gòu)圖中。在中部下方的輸入框可以輸入拼音碼,以便快速找到某癥狀?!氨4妗?、“刪除”對(duì)操作結(jié)果做保存或刪除操作。點(diǎn)擊左側(cè)列表,系統(tǒng)后臺(tái)的操作代碼如下PrivateSubFormal_PY_Click()Dimconn_strconn_str=″Provider=MSDASQL.1;Password=1234;PersistSecurityInfo=True;UserID=sa;DataSource=PDA;InitialCatalog=PDA″DimcnnAsADODB.ConnectionDimcontent,Sqlstr,iDimrec_PYAsADODB.RecordsetDimrec_ItemAsADODB.RecordsetDimrec_testAsADODB.RecordsetDimnumberAsInteger,equip_name,equip_style,equip_IDDimmanufacturer,Tyle_ID,Response,tmp_char,ch,num,PY_IndexSetcnn=NewADODB.Connectioncnn.Openconn_strSqlstr=″select*FROMtb_symptom″Setrec_Item=NewADODB.Recordsetrec_Item.CursorType=adOpenKeysetrec_Item.LockType=adLockOptimisticrec_Item.OpenSqlstr,cnn,adOpenDynamic,adLockPessimisticDoUntilrec_Item.EOFtmp_char=rec_Item(″f_symptom_name″)PY_Index=″″Fori=1ToLen(tmp_char)ch=Mid(tmp_char,i,1)num=Asc(ch)Ifnum>0ThenIfch&lt;&gt;″*″Andch&lt;&gt;″(″Andch&lt;&gt;″)″Andch&lt;&gt;″+″Andch&lt;&gt;″-″AndNotIsNumeric(ch)Andch&lt;&gt;″/″Andch&lt;&gt;″.″ThenPY_Index=PY_Index+chEndIfElseIfch&lt;&gt;″(″Andch&lt;&gt;″)″ThenSqlstr=″select*FROMtb_Char_Indexwheref_Char=’″&amp;ch&amp;″’″Setrec_PY=NewADODB.Recordsetrec_PY.CursorType=adOpenKeysetrec_PY.LockType=adLockOptimisticrec_PY.OpenSqlstr,cnn,adOpenDynamic,adLockPessimisticIfNotrec_PY.EOFThenPY_Index=PY_Index+rec_PY(″f_Index″)EndIfEndIfNextIfLen(PY_Index)>6Thenrec_Item!f_Spell=UCase(Left(PY_Index,6))Elserec_Item!f_Spell=UCase(PY_Index)EndIfrec_Item.MoveNextLooprec_Item.MoveFirstrec_Item.UpdateResponse=MsgBox(″生成完畢,退出?″,vbYesNo)IfResponse=vbYesThenSetrec_Item=NothingSetrec_PY=NothingUnloadMeElseSetrec_Item=NothingSetrec_PY=NothingEndIfEndSubprivatevoiddataGrid_Left_Click(objectsender,System.EventArgse){Stringparent_id,root_node_flag;System.Windows.Forms.DataGridCellselectedCell=dataGrid_Left.CurrentCell;objectselectedItem=dataGrid_Left[selectedCell.RowNumber,0];StringcellValue=Convert.ToString(selectedItem);Relationship_Tree.TopNode.Nodes.Clear();TreeNodenewNode=newTreeNode(cellValue);Relationship_Tree.TopNode.Nodes.Add(newNode);selectedItem=dataGrid_Left[selectedCell.RowNumber,1];parent_id=Convert.ToString(selectedItem);cmd.CommandText=″selectf_node_flagfromtb_rootwheref_root_id=’″+parent_id+″’″;dtr=cmd.ExecuteReader();if(dtr.Read()==true)//therehadbeenaddedbefore{root_node_flag=dtr.GetValue(0).ToString();dtr.Close();Recursion_Add_Node(newNode,parent_id,root_node_flag,1);}elsedtr.Close();Relationship_Tree.ExpandAll();}privatevoidRecursion_Add_Node(TreeNodeparent_node,stringparent_id,stringparent_flag,intlevel){String[]me_id;String[]me_name;String[]me_node_flag;inttotal_me,i;switch(level){case1cmd.CommandText=″selectf_me_id,f_node_flagfromtb_first_childwheref_parent_node=_+parent_flag+″_;break;case2cmd.CommandText=″selectf_me_id,f_node_flagfromtb_second_childwheref_parent_node=_+parent_flag+″_;break;case3cmd.CommandText=″selectf_me_id,f_node_flagfromtb_third_childwheref_parent_node=_+parent_flag+″_;break;case4cmd.CommandText=″selectf_me_id,f_node_flagfromtb_fourth_childwheref_parent_node=_+parent_flag+″_;break;case5cmd.CommandText=″selectf_me_id,f_node_flagfromtb_fifth_childwheref_parent_node=_+parent_flag+″_;break;case6cmd.CommandText=″selectf_me_id,f_node_flagfromtb_sixth_childwheref_parent_node=_+parent_flag+″_;break;case7cmd.CommandText=″selectf_me_id,f_node_flagfromtb_seventh_childwheref_parent_node=_+parent_flag+″_;break;case8cmd.CommandText=″selectf_me_id,f_node_flagfromtb_eighth_childwheref_parent_node=_+parent_flag+″_;break;case9cmd.CommandText=″selectf_me_id,f_node_flagfromtb_nineth_childwheref_parent_node=_+parent_flag+″_;break;case10cmd.CommandText=″selectf_me_id,f_node_flagfromtb_tenth_childwheref_parent_node=_+parent_flag+″_;break;defaultreturn;}dtr=cmd.ExecuteReader();total_me=0;while(dtr.Read()==true)total_me++;if(total_me==0){dtr.Close();return;//nochild}else{me_id=newstring[total_me];me_name=newstring[total_me];me_node_flag=newstring[total_me];dtr.Close();dtr=cmd.ExecuteReader();i=0;while(dtr.Read()==true){me_id[i]=dtr.GetValue(0).ToStrig();me_node_flag[i]=dtr.GetValue(1).ToString();i++;}dtr.Close();for(i=0;i<total_me;i++){cmd.CommandText=″selectf_symptom_namefromtb_symptomwheref_symptom_id=_+me_id[i]+″_;dtr=cmd.ExecuteReader();dtr.Read();me_name[i]=dtr.GetValue(0).ToString();dtr.Close();}for(i=0;i<total_me;i++){parent_node.Nodes.Add(newTreeNode(me_name[i]));}i=0;foreach(TreeNodetninparent_node.Nodes){Recursion_Add_Node(tn,me_id[i],me_node_flag[i],level+1);i++;}}}雙擊右側(cè)列表,后臺(tái)代碼如下privatevoiddataGrid_Right_DoubleClick(objectsender,System.EventArgse){System.Windows.Forms.DataGridCellselectedCell=dataGrid_Right.CurrentCell;objectselectedItem=dataGrid_Right[selectedCell.RowNumber,0];StringcellValue=Convert.ToString(selectedItem);TreeNodenewNode=newTreeNode(cellValue);Relationship_Tree.SelectedNode.Nodes.Add(newNode);}保存按鈕的后臺(tái)操作代碼是privatevoidbutton1_Click(objectsender,System.EventArgse){MessageBoxButtonsbuttons=MessageBoxButtons.YesNo;DialogResultresult;Stringroot_node_flag,root_name,parent_id;result=MessageBox.Show(this,″上述信息設(shè)置正確嗎?″,″系統(tǒng)提示″,buttons,MessageBoxlcon.Question,MessageBoxDefaultButton.Buttonl);if(result==DialogResult.No)return;Relationship_Tree.ExpandAll();root_name=Relationship_Tree.TopNode.FirstNode.Text;dtr.Close();cmd.CommandText=″selectf_symptom_idfromtb_symptomwheref_symptom_name=_+root_name+″_;dtr=cmd.ExecuteReader();dtr.Read();parent_id=dtr.GetValue(0).ToString();dtr.Close();cmd.CommandText=″selectf_node_flagfromtb_rootwheref_root_id=_+parent_id+″_;dtr=cmd.ExecuteReader();if(dtr.Read()?。絫rue){dtr.Close();cmd.CommandText=″selectf_node_idfromtb_flag_table″;dtr=cmd.ExecuteReader();dtr.Read();root_node_flag=dtr.GetValue(0).ToString();dtr.Close();cmd.CommandText=″updatetb_flag_tablesetf_node_id=f_node_id+1″;cmd.ExecuteNonQuery();cmd.CommandText=″insertintotb_root(f_root_id,f_node_flag)values(_+parent_id+_,_+root_node_flag+_)″;cmd.ExecuteNonQuery();Save_Symptom_RelationShip_recursion(Relationship_Tree.TopNode.FirstNode,parent_id,root_node_flag,1);}else{rootnode_flag=dtr.GetValue(0).ToString();dtr.Close();Save_Symptom_RelationShip_recursion(Relationship_Tree.TopNode.FirstNode,parent_id,root_node_flag,1);}}privatevoidSave_Symptom_RelationShip_recursion(TreeNodemy_node,stringparent_id,stringroot_node_flag,intlevel){stringme_node_flag,me_id;foreach(TreeNodetninmy_node.Nodes){cmd.CommandText=″selectf_node_idfromtb_flag_table″;dtr=cmd.ExecuteReader();dtr.Read();me_node_flag=dtr.GetValue(0).ToString();dtr.Close();cmd.CommandText=″updatetb_flag_tablesetf_node_id=f_node_id+1″;cmd.ExecuteNonQuery();cmd.CommandText=″selectf_symptom_idfromtb_symptomwheref_symptom_name=_+tn.Text+″_;dtr=cmd.ExecuteReader();dtr.Read();me_id=dtr.GetValue(0).ToString();dtr.Close();Write2DataBase(parent_id,me_id,root_node_flag,me_node_flag,level);Save_Symptom_RelationShip_recursion(tn,me_id,me_node_flag,level+1);}}刪除按鈕的代碼如下privatevoidbutton2_Click(objectsender,System.EventArgse){MessageBoxButtonsbuttons=MessageBoxButtons.YesNo;DialogResultresult;Stringroot_node_flag,root_name,parent_id;result=MessageBox.Show(this,″確實(shí)要全部刪除這些對(duì)應(yīng)關(guān)系嗎?″,″系統(tǒng)提示″,buttons,MessageBoxIcon.Question,MessageBoxDefaultButton.Buttonl);if(result==DialogResult.No)return;root_name=Relationship_Tree.TopNode.FirstNode.Text;dtr.Close();cmd.CommandText=″selectf_symptom_idfromtb_symptomwheref_symptom_name=_+root_name+″_;dtr=cmd.ExecuteReader();dtr.Read();parent_id=dtr.GetValue(0).ToString();dtr.Close();cmd.CommandText=″selectf_node_flagfromtb_rootwheref_root_id=_+parent_id+″_;dtr=cmd.ExecuteReader();dtr.Read();root_node_flag=dtr.GetValue(0).ToString();dtr.Close();Delete_All_Nodes_recursion(Relationship_Tree.TopNode.FirstNode,parent_id,root_node_flag,1);Relationship_Tree.TopNode.Nodes.Clear();Relationship_Tree.ExpandAll();}privatevoidDelete_All_Nodes_recursion(TreeNodemy_node,stringparent_id,stringroot_node_flag,intlevel){stringme_node_flag,me_id;foreach(TreeNodetninmy_node.Nodes){cmd.CommandText=″selectf_symptom_idfromtb_symptomwheref_symptom_name=_+tn.Text+″_;dtr=cmd.ExecuteReader();dtr.Read();me_id=dtr.GetValue(0).ToString();dtr.Close();switch(level){case1cmd.CommandText=″selectf_node_flagfromtb_first_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case2cmd.CommandText=″selectf_node_flagfromtb_second_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case3cmd.CommandText=″selectf_node_flagfromtb_third_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case4cmd.CommandText=″selectf_node_flagfromtb_fourth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case5cmd.CommandText=″selectf_node_flagfromtb_fifth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case6cmd.CommandText=″selectf_node_flagfromtb_sixth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case7cmd.CommandText=″selectf_node_flagfromtb_seventh_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case8cmd.CommandText=″selectf_node_flagfromtb_eighth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case9cmd.CommandText=″selectf_node_flagfromtb_nineth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case10cmd.CommandText=″selectf_node_flagfromtb_tenth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;defaultreturn;}dtr=cmd.ExecuteReader();dtr.Read();me_node_flag=dtr.GetValue(0).ToString();dtr.Close();Delete_All_Nodes_recursion(tn,me_id,me_node_flag,level+1);switch(level){case1cmd.CommandText=″deletefromtb_first_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id″_;break;case2cmd.CommandText=″deletefromtb_second_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case3cmd.CommandText=″deletefromtb_third_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case4cmd.CommandText=″deletefromtb_fourth_childwheref_parentnode=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case5cmd.CommandText=″deletefromtb_fifth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case6cmd.CommandText=″deletefromtb_sixth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case7cmd.CommandText=″deletefromtb_seventh_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case8cmd.CommandText=″deletefromtb_eighth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case9cmd.CommandText=″deletefromtb_nineth_childwheref_parent_node=_+rootnode_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;case10cmd.CommandText=″deletefromtb_tenth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+_andf_me_id=_+me_id+″_;break;defaultreturn;}cmd.ExecuteNonQuery();}}兩個(gè)拼音碼輸入框?qū)?yīng)的后臺(tái)代碼是privatevoidtextBox1_TextChanged(objectsender,System.EventArgse){data_Set_Symptom.Clear();sqlDataAdapterl.SelectCommand.CommandText=″SELECTf_symptom_nameAS癥狀名稱,f_symptom_idAS癥狀編碼FROMtb_symptomwheref_spelllike_+textBox1.Text+″%′ORDERBYf_symptom_name″;sqlDataAdapterl.Fill(data_Set_Symptom,″tb_symptom″);}privatevoidtextBox2_TextChanged(objectsender,System.EventArgse){dataSet_Symptom_Right.Clear();sqlDataAdapter2.SelectCommand.CommandText=″SELECTf_symptom_nameAS癥狀名稱,f_symptom_idAS癥狀編碼FROMtb_symptomwheref_spelllike_+textBox2.Text+″%′ORDERBYf_symptom_name″;sqlDataAdapter2.Fill(dataSet_Symptom_Right,″tb_symptom″);}2.3、癥狀與疾病的關(guān)系,如圖14所示。在上一節(jié)把癥狀間的關(guān)系維護(hù)好,根據(jù)癥狀的層次關(guān)系,到它們樹(shù)狀關(guān)系的末端,實(shí)際上就可以確定是哪些疾病了即通過(guò)確定一定的癥狀后可以做出診斷結(jié)論,這和實(shí)際的臨床診斷是一致的。因?yàn)楸鞠到y(tǒng)的癥狀間關(guān)系是經(jīng)過(guò)專家論證的,因此通過(guò)本系統(tǒng)的使用可以令使用者在面對(duì)具體癥狀時(shí)可以知道下一步該如何進(jìn)行,進(jìn)而養(yǎng)成良好的臨床思維習(xí)慣,而不至于胡思亂想,無(wú)處下手。癥狀和疾病的對(duì)應(yīng)關(guān)系就在這里設(shè)置,同時(shí)設(shè)置的還有疾病出現(xiàn)的可能性(百分比)。窗口分為四個(gè)部分,從左至右,分別是癥狀列表、癥狀間關(guān)系圖、癥狀所對(duì)應(yīng)疾病以及所有疾病列表。點(diǎn)擊左側(cè)癥狀列表,該癥狀作為頂級(jí)癥狀,它所包含的癥狀間關(guān)系以樹(shù)型方式列在中間。雙擊樹(shù)形結(jié)構(gòu)的末端節(jié)點(diǎn)(只能、必須是末端節(jié)點(diǎn)),表示選中該節(jié)點(diǎn),然后從最右側(cè)疾病列表中找到所對(duì)應(yīng)的疾病,雙擊,及可添加進(jìn)來(lái)。添加進(jìn)來(lái)的疾病列在疾病列表左側(cè)的列表框中。該列表框的下方是該疾病出現(xiàn)百分比的輸入框,可以直接輸入。完成輸入后按下“保存”按鈕,數(shù)據(jù)即被保存。另外兩個(gè)輸入框適用于拼音碼輸入的。點(diǎn)擊左側(cè)癥狀列表所對(duì)應(yīng)的代碼是privatevoiddataGridl_Click(objectsender,System.EventArgse){Stringparent_id,root_node_flag;System.Windows.Forms.DataGridCellselectedCell=dataGrid_Symptom.CurrentCell;objectselectedItem=dataGrid_Symptom[selectedCell.RowNumber,0];StringcellValue=Convert.ToString(selectedltem);global_node_amount=0;TreeNodenewNode=newTreeNode(cellValue);Symptom_Disease_Tree.TopNode.Nodes.Clear();Symptom_Disease_Tree.TopNode.Nodes.Add(newNode);cmd.CommandText=″selectf_symptom_idfromtb_symptomwheref_symptom_name=_+cellValue+″_;dtr=cmd.ExecuteReader();dtr.Read();parent_id=dtr.GetValue(0).ToString();dtr.Close();cmd.CommandText=″selectf_node_flagfromtb_rootwheref_root_id=_+parent_id+″_;dtr=cmd.ExecuteReader();if(dtr.Read()?。絫rue){dtr.Close();return;}root_node_flag=dtr.GetValue(0).ToString();dtr.Close();Global_Node[global_node_amount]=newNode;Global_Node_Flag[global_node_amount]=root_node_flag;global_node_amount++;Generate_Tree_List_recursion(newNode,parent_id,root_node_flag,1);Symptom_Disease_Tree.TopNode.ExpandAll();}privatevoidGenerate_Tree_List_recursion(TreeNodemy_node,stringparent_id,stringroot_node_flag,intlevel){string[]me_id;sgtring[]me_name;string[]me_node_flag;TreeNode[]child_node;inti,total_me;switch(level){case1cmd.CommandText=″select*fromtb_first_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+″_;break;case2cmd.CommandText=″select*fromtb_second_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+″_;break;case3cmd.CommandText=″select*fromtb_third_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+″_;break;case4cmd.CommandText=″select*fromtb_fourth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+″_;break;case5cmd.CommandText=″select*fromtb_fifth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+″_;break;case6cmd.CommandText=″select*fromtb_sixth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+″_;break;case7cmd.CommandText=″select*fromtb_seventh_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+″_;break;case8cmd.CommandText=″select*fromtb_eighth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+″_;break;case9cmd.CommandText=″select*fromtb_nineth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+″_;break;case10cmd.CommandText=″select*fromtb_tenth_childwheref_parent_node=_+root_node_flag+_andf_parent_id=_+parent_id+″_;break;defaultreturn;}dtr=cmd.ExecuteReader();i=0;while(dtr.Read()==true)i++;dtr.Close();if(i==0)return;//nomorechildnodetotal_me=i;me_id=newstring[total_me];me_name=newstring[total_me];me_node_flag=newstring[total_me];child_node=newTreeNode[total_me];dtr=cmd.ExecuteReader();i=0;while(dtr.Read()==true){me_id[i]=dtr.GetValue(1).ToString();me_node_flag[i]=dtr.GetValue(2).ToString();i++;}dtr.Close();for(i=0;i<total_me;i++){cmd.CommandText=″selectf_symptom_namefromtb_symptomwheref_symptom_id=_+me_id[i]+″_;dtr=cmd.ExecuteReader();dtr.Read();me_name[i]=dtr.GetValue(0).ToString();dtr.Close();}for(i=0;i<total_me;i++){child_node[i]=newTreeNode(me_name[i]);Global_Node[global_node_amount]=child_node[i];Global_Node_Flag[global_node_amount]=me_node_flag[i];global_node_amount++;my_node.Nodes.Add(child_node[i]);}for(i=0;i<total_me;i++){Generate_Tree_List_recursion(child_node[i],me_id[i],me_node_flag[i],level+1);}}雙擊樹(shù)形結(jié)構(gòu)的末端節(jié)點(diǎn)對(duì)應(yīng)的代碼是privatevoidSymptom_Disease_Tree_DoubleClick(objectsender,System.EyentArgse){inti,total_disease;string[]disease_id;listBox1.Items.Clear();TreeNodemy_node=Symptom_Disease_Tree.SelectedNode;i=0;while(Global_Node[i]!=my_node&amp;&amp;i<global_node_amount)i++;if(i==global_node_amount)return;cmd.CommandText=″selectf_disease_idfromtb_symptom_vs_diseasewheref_node_flag=_+Global_Node_Flag[i]+″_;dtr=cmd.ExecuteReader();i=0;while(dtr.Read()==true)i++;dtr.Close();total_disease=i;disease_id=newstring[i];dtr=cmd.ExecuteReader();i=0;while(dtr.Read()==true){disease_id[i]=dtr.GetValue(0).ToString();i++;}dtr.Close();for(i=0;i<total_disease;i++){cmd.CommandText=″selectf_disease_namefromtb_diseasewheref_disease_id=_+disease_id[i]+″_;dtr=cmd.ExecuteReader();if(dtr.Read()==true)listBox1.Items.Add(dtr.GetValue(0).ToString());dtr.Close();}}雙擊右側(cè)疾病列表對(duì)應(yīng)的代碼是privatevoiddataGrid2_DoubleClick(objectsender,System.EventArgse){inti;TreeNodemy_node=Symptom_Disease_Tree.SelectedNode;if(my_node==null)retum;i=0;while(my_node?。紾lobal_Node[i]&amp;&amp;i<global_node_amount)i++;if(i==global_node_amount){MessageBox.Show(″系統(tǒng)提示″,″所選節(jié)點(diǎn)不對(duì),請(qǐng)重新選擇!″);return;}System.Windows.Forms.DataGridCellselectedCell=dataGrid2.CurrentCell;objectselectedItem=dataGrid2[selectedCell.RowNumber,0];StringcellValue=Convert.ToString(selectedItem);listBox1.Items.Add(cellValue);}疾病百分比輸入框輸入時(shí)對(duì)應(yīng)代碼是privatevoidtextBox3_TextChanged(objectsender,System.EventArgse){if(textBox3.Text==″″)contribute[listBox1.SelectedIndex]=0;elsecontribute[listBox1.SelectedIndex]=Convert.ToInt32(textBox3.Text);}保存按鈕對(duì)應(yīng)的代碼是privatevoidbuttonl_Click(objectsendef,System.EventArgse){inti,cur_pos;stringdisease_id,disease_name;TreeNodemy_node=Symptom_Disease_Tree.SelectedNode;i=0;while(Global_Node[i]?。絤y_node&amp;&amp;i<global_node_amount)i++;if(i==global_node_amount)return;cur_pos=i;cmd.CommandText=″deletefromtb_symptom_vs_diseasewheref_node_flag=_+Global_Node_Flag[cur_pos]+″_;cmd.ExecuteNonQuery();for(i=0;i<listBox1.Items.Count;i++){disease_name=listBox1.Items[i]ToString();cmd.CommandText=″selectf_disease_idfromtb_diseasewheref_disease_name=_+disease_name+″_;dtr=cmd.ExecuteReader();dtr.Read();disease_id=dtr.GetValue(0).ToString();dtr.Close();cmd.CommandText=″insertintotb_symptom_vs_disease(f_disease_id,f_node_flag,f_symptom_id)values(_+disease_id+_,_+Global_Node_Flag[cur_pos]+_′0′)″;cmd.ExecuteNonQuery();if(contribute[i]>0){cmd.CommandText=″deletefromtb_symptom_contributewheref_node_flag=_+Global_Node_Flag[cur_pos].ToString()+_andf_diseaseid=_+disease_id+″_;cmd.ExecuteNonQuery();cmd.CommandText=″insertintotb_symptom_contribute(f_disease_id,f_node_flag,f_contribute)values(_+disease_id+_,_+Global_Node_Flag[cur_pos]+_,_+contribute[i].ToString()+_)″;cmd.ExecuteNonQuery();textBox3.Text=″″;}}}其中Contribute變量用于記錄各疾病的百分比數(shù)值。2.4、疾病信息維護(hù)疾病信息維護(hù)包括疾病名稱以及疾病詳細(xì)信息維護(hù)。疾病名稱維護(hù)和癥狀名稱維護(hù)類似,原理是一樣的,只不過(guò)在后臺(tái)操作的是疾病名稱表,前端顯示的也是疾病名稱表。如圖15所示(疾病對(duì)應(yīng)拼音碼的產(chǎn)生和癥狀是一樣的)后臺(tái)代碼是privatevoidbutton2_Click(objectsender,System.EventArgse){if(textBox1.Text==″″)return;StringDisease_id;cmd.CommandText=″select*fromtb_diseasewheref_disease_name=_+textBox1.Text+″_;dtr=cmd.ExecuteReader();if(dtr.Read()==true){dtr.Close();MessageBox.Show(″系統(tǒng)已經(jīng)包括該疾病″);textBox1.Text=″″;return;}elsedtr.Close();cmd.CommandText=″selectf_disease_idfromtb_flag_table″;dtr=cmd.ExecuteReader();dtr.Read();Disease_id=dtr.GetValue(0).ToString();dtr.Close();cmd.CommandText=″updatetb_flag_tablesetf_disease_id=f_diseasr_id+1″;cmd.ExecuteNonQuery();cmd.CommandText=″insertintotb_disease(f_disease_id,f_disease_name)values(_+Disease_id+_,_+textBox1.Text+_)″;cmd.ExecuteNonQuery();cmd.Dispose();dataSet_DiSease.Clear();sqlDataAdapterl.Fill(dataSet_DiSease,″tb_disease″);dataGrid_Disease.SetDataBinding(dataSet_DiSease,″tb_disease″);textBox1.Text=″″;textBox1.Focus();}privatevoiddataGrid_Disease_DoubleClick(objectsender,System.EventArgse){System.Windows.Forms.DataGriddatagrid=(System.Windows.Forms.DataGrid)sender;System.Windows.Forms.DataGridCellselectedCell=datagrid.CurrentCell;objectselectedItem=datagrid[selectedCell.RowNumber,1];MessageBoxButtonsbuttons=MessageBoxButtons.YesNo;DialogResultresult;result=MessageBox.Show(this,″確實(shí)要?jiǎng)h除″+datagrid[selectedCell.RowNumber,0]+″嗎?″,″系統(tǒng)提示″,buttons,MessageBoxlcon.Question,MessageBoxDefaultButton.Buttonl,MessageBoxOptions.RightAlign);if(result==DialogResult.No)return;StringcellValue=Convert.ToString(selectedItem);cmd.CommandText=″deletefromtb_Diseasewheref_Disease_id=_+cellValue+″_;cmd.ExecuteNonQuery();cmd.Dispose();dataSet_DiSease.Clear();sqlDataAdapterl.Fill(dataSet_DiSease,″tb_disease″);dataGrid_Disease.SetDataBinding(dataSet_DiSease,″tb_disease″);}privatevoiddataGrid_Disease_Click(objectsender,System.EventArgse){System.Windows.Forms.DataGriddatagrid=(System.Windows.Forms.DataGrid)sender;System.Windows.Forms.DataGridCellselectedCell=datagrid.CurrentCell;objectselectedItem=datagrid[selectedCell.RowNumber,1];selected_disease_id=Convert.ToString(selectedItem);selectedItem=datagrid[selectedCell.RowNumber,0];textBox2.Text=Convert.ToString(selectedItem);}privatevoidbuttonl_Click_1(objectsender,System.EventArgse){if(selected_disease_id==″″){MessageBox.Show(″請(qǐng)先選擇某一疾病″);return;}cmd.CommandText=″updatetb_diseasesetf_disease_name=_+textBox2.Text+_wheref_disease_id=_+selected_disease_id+″_;cmd.ExecuteNonQuery();dataSet_DiSease.Clear();sqlDataAdapterl.Fill(dataSet_DiSease,″tb_disease″);dataGrid_Disease.SetDataBinding(dataSet_DiSease,″tb_disease″);selected_disease_id=″″;}privatevoidtextBox3_TextChanged(objectsender,System.EventArgse){dataSet_DiSease.Clear();sqlDataAdapterl.SelectCommand.CommandText=″SELECTf_disease_nameAS疾病名稱,f_disease_idAS編碼FROMtb_diseasewheref_spelllike_+textBox3.Text+″%′ORDERBYf_disease_name″;sqlDataAdapterl.Fill(dataSet_DiSease,″tb_disease″);}2.5、疾病詳細(xì)信息,如圖16所示。分為基本知識(shí)、病因、診斷、癥狀、治療,其中治療信息里包含有藥物用法和劑量。后臺(tái)代碼是2.6、系統(tǒng)開(kāi)發(fā)團(tuán)隊(duì),界面如圖17所示,詳細(xì)記錄系統(tǒng)開(kāi)發(fā)團(tuán)隊(duì)的情況。2.7、藥品、實(shí)驗(yàn)室檢查、廣告信息維護(hù)這三類信息只需要在資料收集完整后輸入系統(tǒng)即可,程序操作原理都是一致的,不再詳細(xì)描述。這里只給出結(jié)構(gòu)及關(guān)系,如圖18所示。3、智能型版本數(shù)據(jù)生成實(shí)際上是一段運(yùn)行中智能型設(shè)備上的程序。通過(guò)網(wǎng)絡(luò)連接到臺(tái)式機(jī),下載數(shù)據(jù),同時(shí)生成智能型設(shè)備數(shù)據(jù)。目前本系統(tǒng)以MsSQLServerCE(但不限于)作為智能型設(shè)備的數(shù)據(jù)引擎。代碼如下privatevoidbutton_Delete_Click(objectsender,System.EventArgse){if(radio_basic.Checked==true){cmd.CommandText=″deletefromtb_disease_basicwheref_id=_+Global_Detail_Id+″_;cmd.ExecuteNonQuery();}if(radio_Physis.Checked==true){cmd.CommandText=″deletefromtb_physicwheref_id=_+Global_Detail_Id+″_;cmd.ExecuteNonQuery();}if(radio_Symptom.Checked==true){cmd.CommandText=″deletefromtb_disease_symptomwheref_id=_+Global_Detail_Id+″_;cmd.ExecuteNonQuery();}if(radio_Diagnosis.Checked==true){cmd.CommandText=″deletefromtb_diagnosiswheref_id=_+Global_Detail_Id+″_;cmd.ExecuteNonQuery();}if(radio_Treatment.Checked==true){cmd.CommandText=″deletefromtb_treatmentwheref_id=_+Global_Detail_Id+″_;cmd.ExecuteNonQuery();}radio_basic.Checked=true;cmd.CommandText=″selectf_disease_basic,f_idfromtb_disease_basicwheref_disease_id=_+Global_Disease_Id+″_;dtr=cmd.ExecuteReader();listBox1.Items.Clear();dtr.Read();textBox1.Text=dtr.GetValue(0).ToString();listBox1.Items.Add(dtr.GetValue(0).ToString());Global_Detail_Id=dtr.GetValue(1).ToString();while(dtr.Read()==true)listBox1.Items.Add(dtr.GetValue(0).ToString());dtr.Close();}privatevoidbutton_Save_Click(objectsender,System.EventArgse){if(textBox1.Text==″″)return;Stringstr=textBox1.Text;if(radio_basic.Checked==true){cmd.CommandText=″selectf_idfromtb_disease_basicwheref_disease_id=_+Global_Detail_Id+″_;dtr=cmd.ExecuteReader();if(dtr.Read()==true){dtr.Close();cmd.CommandText=″updatetb_disease_basicsetf_disease_basic=_+str+_wheref_id=_+Global_Detail_Id+″_;cmd.ExecuteNonQuery();}else{dtr.Close();cmd.CommandText=″insertintotb_disease_basic(f_disease_id,f_disease_basic)values(_+Global_Disease_Id+_,_+str+_)″;cmd.ExecuteNonQuery();}dtr.Close();}if(radio_Physis.Checked==true){cmd.CommandText=″selectf_idfromtb_physicwheref_id=_+Global_Detail_Id+″_;dtr=cmd.ExecuteReader();if(dtr.Read()==true){dtr.Close();cmd.CommandText=″updatetb_physicsetf_physic=_+str+_wheref_id=_+Global_Detail_Id+″_;cmd.ExecuteNonQuery();}else{dtr.Close();cmd.CommandText=″insertintotb_physic(f_disease_id,f_physic)values(_+Global_Disease_Id+_,_+str+_)″;cmd.ExecuteNonQuery();}dtr.Close();}if(radio_Symptom.Checked==true){cmd.CommandText=″selectf_idfromtb_disease_symptomwheref_id=_+Global_Detail_Id+″_;dtr=cmd.ExecuteReader();if(dtr.Read()==true){dtr.Close();cmd.CommandText=″updatetb_disease_symptomsetf_disease_symptom=_+str+_wheref_id=_+Global_Detail_Id+″_;cmd.ExecuteNonQuery();}else{dtr.Close();cmd.CommandText=″insertintotb_disease_symptom(f_disease_id,f_disease_symptom)values(_+Global_Disease_Id+_,_+str+_)″;cmd.ExecuteNonQuery();}dtr.Close();}if(radio_Diagnosis.Checked==true){cmd.CommandText=″selectf_idfromtb_diagnosiswheref_id=_+Global_Detail_Id+″_;dtr=cmd.ExecuteReader();if(dtr.Read()==true){dtr.Close();cmd.CommandText==″updatetb_diagnosissetf_diagnosis=_+str+_wheref_id=_+Global_Detsail_Id+″_;cmd.ExecuteNonQuery();}else{dtr.Close();cmd.CommandText=″insertintotb_diagnosis(f_disease_id,f_diagnosis)values(_+Global_Disease_Id+_,_+str+_)″;cmd.ExecuteNonQuery();}dtr.Close();}if(radio_Treatment.Checked==true){cmd.CommandText=″selectf_idfromtb_treatmentwheref_id=_+Global_Detail_Id+″″;dtr=cmd.ExecuteReader();if(dtr.Read()==true){dtr.Close();cmd.CommandText=″updatetb_treatmentsetf_treatment==_+str+_wheref_id=_+Global_Detail_Id+″_;cmd.ExecuteNonQuery();}else{dtr.Close();cmd.CommandText=″insertintotb_treatment(f_disease_id,f_treatment)values(_+Global_Disease_Id+_,_+str+_)″;cmd.ExecuteNonQuery();}dtr.Close();}radio_basic.Checked=true;cmd.CommandText=″selectf_disease_basic,f_idfromtb_disease_basicwheref_disease_id=_+Global_Disease_Id+″_;dtr=cmd.ExecuteReader();listBox1.Items.Clear();dtr.Read();textBox1.Text=dtr.GetValue(0).ToString();listBox1.Items.Add(dtr.GetValue(0).ToString());Global_Detail_Id=dtr.GetValue(1).ToString();while(dtr.Read()==ue)listBox1.Items.Add(dtr.GetValue(0).ToString());dtr.Close();}privatevoidlistBox1_SelectedIndexChanged(objectsender,System.EventArgse){stringdetail_name;detail_name=listBox1.Items[listBox1.SelectedIndex].ToString();if(radio_basic.Checked==true){cmd.CommandText=″selectf_idfromtb_disease_basicwheref_disease_basic=_+detail_name+″_;}if(radio_Physis.Checked==true){cmd.CommandText=″selectf_idfromtb_physicwheref_physic=_+detail_name+″_;}if(radio_Symptom.Checked==true){cmd.CommandText=″selectf_idfromtb_diagnosiswheref_diagnosis=_+detail_name+″_;}if(radio_Diagnosis.Checked==true){cmd.CommandText=″selectf_idfromtb_disease_symptomwheref_diseasesymptom=_+detail_name+″_;}if(radio_Treatment.Checked==true){cmd.CommandText=″selectf_idfromtb_treatmentwheref_treatment=_+detail_name+″_;}dtr=cmd.ExecuteReader();dtr.Read();Global_Disease_Id=dtr.GetValue(0).ToString();dtr.Close();}privatevoidbuttonl_Click(objectsender,System.EventArgse){System.Data.SqlClient.SqlConnectioncnn;System.Data.SqlClient.SqlCommandcmd;System.Data.SqlClient.SqlDataReaderdtr;System.Dara.SqlServerCe.SqlCeConnectioncecnn;System.Data.SqlServerCe.SqlCeCommandcecmd;System.Data.SqlServerCe.SqlCeEnginedbEngine;Stringremote_cnnstr,local_cnnstr,strFile,cmd_str;StreamReadersr=newStreamReader(@″\programfiles\TransferData2PDA\pda.ini″);remote_cnnstr=sr.ReadLine();sr.Close();strFile=@″\programfiles\TransferData2PDA\pda.SDF″;local_canstr=″DataSource=″+@″\programfiles\TransferData2PDA\pda.SDF″;if(File.Exists(strFile))File.Delete(strFile);dbEngine=newSqlCeEngine();dbEngine.LocalConneotionString=local_cnnstr;try{dbEngine.CreateDatabase();}catch(SqlCeExceptionexSQL){MessageBox.Show(″Unabletocreatedatabaseat″+strFile+″Reason;″+exSQL.Errors.Message);}finally{dbEngine.Dispose();}cnn=newSqlConnection();cnn.ConnectionString=remote_cnnstr;cnn.Open();cmd=newSqlCommand(″″,cnn);cecnn=newSqlCeConnection();cecnn.ConnectionString=local_cnnstr;cecnn.Open();cecmd=newSqlCeCommand(″″,cecnn);cecmd.CommandText=″CREATETABLEtb_advertisement(f_idint,f_advertisementnvarchar(255))″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_disease(f_disease_idint,f_disease_namenvarchar(200),f_spellnvarchar(6))″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_disease_basic(f_idint,f_disease_idint,f_disease_basicnvarchar(255))″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_physic(f_idint,f_disease_idint,f_physicnvarchar(255))″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_diagnosis(f_idint,f_disease_idint,f_diagnosisnvarchar(255))″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_disease_symptom(f_idint,f_disease_idint,f_disease_symptomnvarchar(255))″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_treatment(f_idint,f_disease_idint,f_treatmentnvarchar(255))″;cecmd.ExecuteNonQuery();ceemd.CommandText=″CREATETABLEtb_root(f_root_idint,f_node_flagint)″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_symptom(f_symptom_idint,f_symptom_namenvarchar(200),f_spellnvarchar(50),f_root_flagnchar(1))″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_symptom_vs_disease(f_node_flagint,f_Disease_idint,f_symptom_idint)″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_developer(f_developer_idint,f_namenvarchar(20),f_orgnvarchar(50),f_resumenvarchar(255))″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_first_child(f_parent_idint,f_me_idint,f_node_flagint,f_parent_nodeint)″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_second_child(f_parent_idint,f_me_idint,f_node_flagint,f_parent_nodeint)″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_third_child(f_parent_idint,f_me_idint,f_node_flagint,f_parent_nodeint)″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_fourth_child(f_parent_idint,f_me_idint,f_node_flagint,f_parent_nodeint)″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_fifth_child(f_parent_idint,f_me_idint,f_node_flagint,f_parent_nodeint)″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_sixth_child(f_parent_idint,f_me_idint,f_node_flagint,f_parent_nodeint)″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_seventh_child(f_parent_idint,f_me_idint,f_node_flagint,f_parent_nodeint)″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_eighth_child(f_parent_idint,f_me_idint,f_node_flagint,f_parent_nodeint)″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_nineth_child(f_parent_idint,f_me_idint,f_node_flagint,f_parent_nodeint)″;cecmd.ExecuteNonQuery();cecmd.CommandText=″CREATETABLEtb_tenth_child(f_parent_idint,f_me_idint,f_node_flagint,f_parent_nodeint)″;cecmd.ExecuteNonQuery();cmd.CommandText=″select*fromtb_symptom″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmdstr=″insertintotb_symptom(f_symptom_id,f_symptom_name,f_spell,f_root_flag)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_,_+dtr.GetValue(3).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_disease″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_disease(f_disease_id,f_disease_name,f_spell)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_symptom_vs_disease″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_srt=″insertintotb_symptom_vs_disease(f_node_flag,f_Disease_id,f_symptom_id)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_diagnosis″;dtr=cmd.ExecuteReader();while(dtr.Read()==true){cmd_str=″insertintotb_diagnosis(f_id,f_disease_id,f_diagnosis)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_disease_basic″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_disease_basic(f_id,f_disease_id,f_disease_basic)″;cmdstr+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_disease_symptom″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_disease_symptom(f_id,f_disease_id,f_disease_symptom)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_physic″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_physic(f_id,f_disease_id,f_physic)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_treatment″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_treatment(f_id,f_discase_id,f_treatment)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_root″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_root(f_root_id,f_node_flag)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_)″;ceemd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_developer″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_developer(f_developer_id,f_name,f_org,f_resume)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_,_+dtr.GetValue(3).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_first_child″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_first_child(f_parent_id,f_me_id,f_node_flag,f_parent_node)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_,_+dtr.GetValue(3).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_second_child″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_second_child(f_parent_id,f_me_id,f_node_flag,f_parent_node)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_,_+dtr.GetValue(3).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_third_child″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_third_child(f_parent_id,f_me_id,f_node_flag,f_parent_node)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_,_+dtr.GetValue(3).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_fourth_child″;dtr=cmd.ExecuteReader();while(dtrRead()){cmd_str=″insertintotb_fourth_child(f_parent_id,f_me_id,f_node_flag,f_parent_node)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_,_+dtr.GetValue(3).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_fifth_child″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_fifth_child(f_parent_id,f_me_id,f_node_flag,f_parent_node)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_,_+dtr.GetValue(3).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_sixth_child″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_sixth_child(f_parent_id,f_me_id,f_node_flag,f_parent_node)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_,_+dtr.GetValue(3).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_seventh_child″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_seventh_child(f_parent_id,f_me_id,f_node_flag,f_parent_node)″;cmdstr+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_,_+dtr.GetValue(3).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_eighth_child″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_eighth_child(f_parent_id,f_me_id,f_node_flag,f_parent_node)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_,_+dtr.GetValue(3).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_nineth_child″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_nineth_child(f_parent_id,f_me_id,f_node_flag,f_parent_node)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_,_+dtr.GetValue(3).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();cmd.CommandText=″select*fromtb_tenth_child″;dtr=cmd.ExecuteReader();while(dtr.Read()){cmd_str=″insertintotb_tenth_child(f_parent_id,f_me_id,f_node_flag,f_parent_node)″;cmd_str+=″values(_+dtr.GetValue(0).ToString()+_,_+dtr.GetValue(1).ToString()+_,_+dtr.GetValue(2).ToString()+_,_+dtr.GetValue(3).ToString()+_)″;cecmd.CommandText=cmd_str;;cecmd.ExecuteNonQuery();}dtr.Close();MessageBox.Show(″Allsuccess!″);cecmd.Dispose();cnn.Close();cecnn.Close();}4、能設(shè)備用戶運(yùn)行程序智能設(shè)備上運(yùn)行的程序?yàn)楸鞠到y(tǒng)最終發(fā)行給用戶的程序,也就是用戶使用的軟件。正式發(fā)行時(shí)會(huì)隨著目標(biāo)設(shè)備的不同以及系統(tǒng)發(fā)行的不同版本而有所不同,因此在本文檔中將不給出主程序界面圖形示例,僅就原理以及核心代碼做詳細(xì)說(shuō)明。在智能設(shè)備(如PDA、智能手機(jī))上運(yùn)行的數(shù)據(jù)庫(kù)系統(tǒng)(目前使用MSSQLServerCE,但不限于)同時(shí)只能有一個(gè)數(shù)據(jù)庫(kù)聯(lián)接,因此必須十分小心管理數(shù)據(jù)庫(kù)的聯(lián)接。在打開(kāi)不同窗口時(shí),需先把已存在的數(shù)據(jù)庫(kù)聯(lián)接斷開(kāi),然后才能使用新的聯(lián)接。如下列代碼所示privatevoidmenuItem5_Click(objectsender,System.EventArgse){cnn.Close();cnn.Dispose();cmd.Dispose();Medicationmy=newMedication();my.Show();}privatevoidmenuItem7_Click(objectsender,System.EventArgse){cnn.Close();cnn.Dispose();cmd.Dispose();Pathogenymy=newPathogeny();my.Show();}privatevoidmenuItem6_Click(objectsender,System.EventArgse){cnn.Close();cnn.Dispose();cmd.Dispose();Laboratorymy=newLaboratory();my.Show();}同時(shí)在任何使用數(shù)據(jù)庫(kù)之前,需判斷數(shù)據(jù)庫(kù)的聯(lián)接是否有效,若無(wú)效需重新聯(lián)接。如下所示if(cnn.State==ConnectionState.Closed){cnn.ConnectionString=local_cnnstr;cnn.Open();cmd=newSqlCeCommand(″selectf_disease_idfromtb_diseasewheref_disease_name=_+Disease_Name+″_,cnn);}elsecmd.CommandText=″selectf_disease_idfromtb_diseasewheref_disease_name=_+Disease_Name+″_;4.1智能診斷模塊系統(tǒng)包括智能診斷模塊、疾病模塊、藥品模塊、病原學(xué)模塊、實(shí)驗(yàn)室檢查模塊、系統(tǒng)說(shuō)明模塊。系統(tǒng)啟動(dòng)后缺省進(jìn)入智能診斷模塊。為此,系統(tǒng)首先定義一些全局變量,做初始化操作,然后等待用戶的操作輸入。代碼如下privateSystem.Data.SqlServerCe.SqlCeConnectioncnn;privateSystem.Data.SqlServerCe.SqlCeCommandcmd;privateSystem.Data.SqlServerCe.SqlCeDataReaderdtr;privateStringlocal_cnnstr;privateintCurrent_Level,Total_Level;privateNavigation_Indicator[]navigation_indicator;privateboolIf_Disease_List;privatestringSelected_Parent_Name;privatestringSelected_Parent_Id;privatestringSelected_Parent_Node_Flag;privatestringSelecting_Node_Flag;privatestring[]CLicked_Name_List;privateintTimer_Indicator;privatevoidForm1_Load(objectsender,System.EventArgse){local_cnnstr=″DataSource=″+@″\programfiles\SmartDoctor\pda.SDF″;cnn=newSqlCeConnection();cnn.ConnectionString=local_cnnstr;cnn.Open();cmd=newSqlCeCommand(″selectf_symptom_namefromtb_symptomwheref_root_flag=′R′″,cnn);dtr=emd.ExecuteReader();while(dtr.Read()){listBox_Symptom.Items.Add(dtr.GetValue(0).ToString());}dtr.Close();navigation_indicator=newNavigation_Indicator[11];CLicked_Name_List=newstring[11];Current_Level=0;Total_Level=0;for(inti=0;i<11;i++){navigation_indicator[i].me_id=0;navigation_indicator[i].node_flag=0;nayigation_indicator[i].parent_id=0;navigation_indicator[i].parent_node=0;CLicked_Name_List[i]=″″;}If_Disease_List=false;Timer_Indicator=0;}其中l(wèi)istBox_Symptom組件用于顯示所有頂級(jí)癥狀,用戶可以鼠標(biāo)點(diǎn)擊某個(gè)癥狀,或者在上方的輸入框中輸入拼音碼,快速在眾多癥狀中篩選所需癥狀。當(dāng)用戶選中某一癥狀后,系統(tǒng)立即列出該頂級(jí)癥狀對(duì)應(yīng)的一級(jí)子節(jié)點(diǎn)癥狀,同時(shí)列出所有包含該頂級(jí)癥狀的疾病。這實(shí)際上對(duì)應(yīng)醫(yī)生在診斷時(shí),病人說(shuō)出一個(gè)癥狀,醫(yī)生應(yīng)當(dāng)立即想到下一個(gè)(或幾個(gè))應(yīng)當(dāng)出現(xiàn)的癥狀,并且聯(lián)想出疾病來(lái)。在選擇過(guò)程中有疾病列出,或選擇的最后階段只列出疾病。無(wú)論那種情況,只要點(diǎn)擊選擇疾病,系統(tǒng)自動(dòng)跳轉(zhuǎn)到顯示該疾病的窗口界面。后臺(tái)代碼是privatevoidlistBox_Symptom_SelectedIndexChanged(objectsender,System.EventArgse){if(Total_Level>10)return;//therarenomoredatatobeprocessedif(cnn.State==ConnectionState.Closed){cnn.ConnectionString=local_cnnstr;cnn.Open();cmd=newSqlCeCommand(″″,cnn);}ListBoxobj=(ListBox)sender;stringcur_symptom_name=obj.SelectedItem.ToString();stringme_id,me_node_flag;if(Total_Level==0){cmd.CommandText=″selectf_symptom_idfromtb_symptomwheref_symptom_name=_+cur_symptom_name+″_;dtr=cmd.ExecuteReader();dtr.Read();me_id=dtr.GetValue(0).ToString();dtr.Close();cmd.CommandText=″selectf_node_flagfromtb_rootwheref_root_id=_+me_id+″_;dtr=cmd.ExecuteReader();if(dtr.Read()){me_node_flag=dtr.GetValue(0).ToString());dtr.Close();FontmyFont=newFont(″宋體″,12,System.Drawing.FontStyle.Regular);listBox_Symptom.Font=myFont;List_All_Children_recursion(me_node_flag,1);navigation_indicator[Current_Level].me_id=Convert.ToInt32(me_id);navigation_indicator[Current_Level].node_flag=Convert.ToInt32(me_node_flag);CLicked_Name_List[Current_Level]=cur_symptom_name;Current_Level++;Total_Level++;Selected_Parent_Name=cur_symptom_name;Selected_Parent_Id=me_id;Selected_Parent_Node_Flag=me_node_flag;Selecting_Node_Flag=me_node_flag;listBox_Disease.Items.Clear();List_All_Diseases_For_This_Node(me_node_flag,Current_Level-1);listBox_Symptom.Size=newSize(240,134);listBox_Disease.Visible=true;}}else{if(!If_Disease_List)//listsymptom{cmd.CommandText=″selectf_symptom_idfromtb_symptomwheref_symptom_name=_+cur_symptom_name+″_;dtr=cmd.ExecuteReader();dtr.Read();me_id=dtr.GetValue(0).ToString();dtr.Close();Set_Cmd_Text_recursion(navigation_indicator[Current_Level-1].me_id,navigation_indicator[Current_Level-1].node_flag,me_id,Current_Level);dtr=cmd.ExecuteReader();if(dtr.Read()){me_node_flag=dtr.GetValue(0).ToString();dtr.Close();List_All_Children_recursion(me_node_flag,Current_Level+1);navigation_indicator[Current_Level].me_id=Convert.ToInt32(me_id);navigation_indicator[Current_Level].node_flag=Convert.ToInt32(me_node_flag);CLicked_Name_List[Current_Level]=cur_symptom_name;if(Current_Level==Total_Level)Total_Level++;Current_Level++;me_node_flag=me_node_flag;listBox_Disease.Items.Clear();List_All_Diseases_For_This_Node(me_node_flag,Current_Level-1);}}else//thislistcontentarealldisease{cnn.Close();cnn.Dispose();cmd.Dispose();Selected_Diseasemy_disease=newSelected_Disease(cur_symptom_name);my_disease.Show();}}}privatevoidList_All_Children_recursion(stringparent_node,intlevel){string[]me_id;inti,total_me;if(cnn.State==ConnectionState.Closed){cnn.ConnectionString=local_cnnstr;cnn.Open();cmd=newSqlCeCommand(″″cnn);}switch(level){case1cmd.CommandText=″selectf_me_id,f_node_flagfromtb_first_childwheref_parent_node=_+parent_node+″_;break;case2cmd.CommandText=″selectf_me_id,f_node_flagfromtb_second_childwheref_parentnode=_+parent_node+″_;break;case3cmd.CommandText=″selectf_me_id,f_node_flagfromtb_third_childwheref_parent_node=_+parent_node+″_;break;case4cmd.CommandText=″selectf_me_id,f_node_flagfromtb_fourth_childwheref_parent_node=_+parent_node+″_;break;case5cmd.CommandText=″selectf_me_id,f_node_flagfromtb_fifth_childwheref_parent_node=_+parent_node+″_;break;case6cmd.CommandText=″selectf_me_id,f_node_flagfromtb_sixth_childwheref_parent_node=_+parent_node+″_;break;case7cmd.CommandText=″selectf_me_id,f_node_flagfromtb_seventh_childwheref_parent_node=_+parent_node+″_;break;case8cmd.CommandText=″selectf_me_id,f_node_flagfromtb_eighth_childwheref_parent_node=_+parent_node+″_;break;case9cmd.CommandText=″selectf_me_id,f_node_flagfromtb_nineth_childwheref_parent_node=_+parent_node+″_;break;case10cmd.CommandText=″selectf_me_id,f_node_flagfromtb_tenth_childwheref_parent_node=_+parent_node+″_;break;defaultcmd.CommandText=″selectf_me_id,f_node_flagfromtb_first_childwheref_parent_node=-1_;break;//forcetoreturnnull,indicatetherwillbedisease}dtr=cmd.ExecuteReader();total_me=0;while(dtr.Read())total_me++;dtr.Close();if(total_me>0)//thefollowinglistaresymptoms{me_id=newstring[total_me];dtr=cmd.ExecuteReader();for(i=0;i<total_me;i++){dtr.Read();me_id[i]=dtr.GetValue(0).ToString();}dtr.Close();listBox_Symptom.Items.Clear();for(i=0;i<total_me;i++){cmd.CommandText=″selectf_symptom_namefromtb_symptomwheref_symptom_id=_+me_id[i]+″_;dtr=cmd.ExecuteReader();dtr.Read();listBox_Symptom.Items.Add(dtr.GetValue(0).ToString());dtr.Close();}}else//listarediseases{If_Disease_List=true;cmd.CommandText=″selecta.f_disease_namefromtb_diseasea,tb_symptom_vs_diseasebwherea.f_disease_id=b.f_disease_idandb.f_node_flag=_+parent_node+″_;dtr=cmd.ExecuteReader();listBox_Symptom.Items.Clear();while(dtr.Read()){listBox_Symptom.Items.Add(dtr.GetValue(0).ToString());}dtr.Close();listBox_Symptom.Size=newSize(240,232);listBox_Disease.Visible=false;}}privatevoidSet_Cmd_Text_recursion(intparent_id,intparent_node,stringme_id,intlevel){if(cnn.State==ConnectionState.Closed){cnn.ConnectionString=local_cnnstr;cnn.Open();cmd=newSqlCeCommand(″″,cnn);}switch(level){case1cmd.CommandText=″selectf_node_flagfromtb_first_childwheref_parent_id=_+parent_id.ToString()+_andf_parent_node=_+parent_node.ToString()+_andf_me_id=_+me_id+″_;break;case2cmd.CommandText=″selectf_node_flagfromtb_second_childwheref_parent_id=_+parent_id.ToString()+_andf_parent_node=_+parent_node.ToString()+_andf_me_id=_+me_id+″_;break;case3cmd.CommandText=″selectf_node_flagfromtb_third_childwheref_parent_id=_+parent_id.ToString()+_andf_parent_node=_+parent_node.ToString()+_andf_me_id=_+me_id+″_;break;case4cmd.CommandText=″selectf_node_flagfromtb_fourth_childwheref_parent_id=_+parent_id.ToString()+_andf_parent_node=_+parent_node.ToString()+_andf_me_id=_+me_id+″_;break;case5cmd.CommandText=″selectf_node_flagfromtb_fifth_childwheref_parent_id=_+parent_id.ToString()+_andf_parent_node=_+parent_node.ToString()+_andf_me_id=_+me_id+″_;break;case6cmd.CommandText=″selectf_node_flagfromtb_sixth_childwheref_parent_id=_+parent_id.ToString()+_andf_parent_node=_+parent_node.ToString()+_andf_me_id=_+me_id+″_;break;case7cmd.CommandText=″selectf_node_flagfromtb_seventh_childwheref_parent_id=_+parent_id.ToString()+_andf_parent_node=_+parent_node.ToString()+_andf_me_id=_+me_id+″″;break;case8cmd.CommandText=″selectf_node_flagfromtb_eighth_childwheref_parent_id=_+parent_id.ToString()+_andf_parentnode=_+parent_node.ToString()+_andf_me_id=_+me_id+″_;break;case9cmd.CommandText=″selectf_node_flagfromtb_nineth_childwheref_parent_id=_+parent_id.ToString()+_andf_parent_node=_+parent_node.ToString()+_andf_me_id=_+me_id+″_;break;case10cmd.CommandText=″selectf_node_flagfromtb_tenth_childwheref_parent_id=_+parent_id.ToString()+_andf_parent_node=_+parent_node.ToString()+_andf_me_id=_+me_id+″_;break;defaultcmd.CommandText=″selectf_node_flagfromtb_first_childwheref_parent_node=-1_;break;//forcetoreturnnull,indicatetherwillbedisease}}privatevoidList_All_Diseases_For_This_Node(stringnode_flag,intlevel){string[]my_child_node;inti,my_child_total_nodes;switch(level){case0cmd.CommandText=″selectc.f_disease_namefromtb_roota,tb_symptom_vs_diseaseb,tb_diseasecwherea.f_node_flag=b.f_node_flagandb.f_diseaise_id=c.f_disease_idanda.f_node_flag=_+node_flag+″_;break;case1cmd.CommandText=″selectc.f_disease_namefromtb_first_childa,tb_symptom_vs_diseaseb,tb_diseasecwherea.f_node_flag=b.f_node_flagandb.f_disease_id=c.f_disease_idanda.f_node_flag=_+node_flag+″_;break;case2cmd.CommandText=″selectc.f_disease_namefromtb_second_childa,tb_symptom_vs_diseaseb,tb_diseasecwherea.f_node_flag=b.f_node_flagandb.f_disease_id=c.f_disease_idanda.f_nodeflag=_+node_flag+″_;break;case3cmd.CommandText=″selectc.f_disease_namefromtb_third_childa,tb_symptom_vs_diseaseb,tb_diseasecwherea.f_node_flag=b.f_node_flagandb.f_disease_id=c.f_disease_idanda.f_node_flag=_+node_flag+″_;break;case4cmd.CommandText=″selectc.f_disease_namefromtb_fourth_childa,tb_symptom_vs_diseaseb,tb_diseasecwherea.f_node_flag=b.f_node_flagandb.f_disease_id=c.f_disease_idanda.f_node_flag=_+node_flag+″_;break;case5cmd.CommandText=″selectc.f_disease_namefromtb_fifth_childa,tb_symptom_vs_diseaseb,tb_diseasecwherea.f_node_flag=b.f_node_flagandb.f_disease_id=c.f_disease_idanda.f_node_flag=_+node_flag+″_;break;case6cmd.CommandText=″selectc.f_disease_namefromtb_sixth_childa,tb_symptom_vs_diseaseb,tb_diseasecwherea.f_node_flag=b.f_node_flagandb.f_disease_id=c.f_disease_idanda.f_node_flag=_+node_flag+″_;break;case7cmd.CommandText=″selectc.f_disease_namefromtb_seventh_childa,tb_symptom_vs_diseaseb,tb_diseasecwherea.f_node_flag=b.f_node_flagandb.f_disease_id=c.f_disease_idanda.f_node_flag=_+node_flag+″_;break;case8cmd.CommandText=″selectc.f_disease_namefromtb_eighth_childa,tb_symptom_vs_diseaseb,tb_diseasecwherea.f_node_flag=b.f_node_flagandb.f_disease_id=c.f_disease_idanda.f_node_flag=_+node_flag+″_;break;case9cmd.CommandText=″selectc.f_disease_namefromtb_nineth_childa,tb_symptom_vs_diseaseb,tb_diseasecwherea.f_node_flag=b.f_node_flagandb.f_disease_id=c.f_disease_idanda.fnode_flag=_+node_flag+″_;break;case10cmd.CommandText=″selectc.f_disease_namefromtb_tenth_childa,tb_symptom_vs_diseaseb,tb_diseasecwherea.f_node_flag=b.f_node_flagandb.f_disease_id=c.f_disease_idanda.f_node_flag=_+node_flag+″_;break;defaultcmd.CommandText=″selectc.f_disease_namefromtb_first_childa,tb_symptom_vs_diseaseb,tb_diseasecwherea.f_node_flag=b.f_node_flagandb.f_disease_id=c.f_diseasre_idanda.f_node_flag=_+node_flag+″_;break;//forcetoreturnnull,indicatetherwillbedisease}dtr=cmd.ExecuteReader();while(dtr.Read())listBox_Disease.Items.Add(dtr.GetValue(0).ToString());dtr.Close();switch(level+1){case1cmd.CommandText=″selectf_node_flagfromtb_first_childwheref_parent_node=_+node_flag+″_;break;case2cmd.CommandText=″selectf_node_flagfromtb_second_childwheref_parent_node=_+node_flag+″_;break;case3cmd.CommandText=″selectf_node_flagfromtb_third_childwheref_parent_node=_+node_flag+″_;break;case4cmd.CommandText=″selectf_node_flagfromtb_fourth_childwheref_parent_node=_+node_flag+″_;break;case5cmd.CommandText=″selectf_node_flagfromtb_fifth_childwheref_parent_node=_+node_flag+″_;break;case6cmd.CommandText=″selectf_node_flagfromtb_sixth_childwheref_parent_node=_+node_flag+″_;break;case7cmd.CommandText=″selectf_node_flagfromtb_seventh_childwheref_parent_node=_+node_flag+″_;break;case8cmd.CommandText=″selectf_node_flagfromtb_eighth_childwheref_parent_node=_+node_flag+″_;break;case9cmd.CommandText=″selectf_node_flagfromtb_nineth_childwheref_parent_node=_+node_flag+″_;break;case10cmd.CommandText=″selectf_node_flagfromtb_tenth_childwheref_parent_node=_+node_flag+″_;break;defaultcmd.CommandText=″selectf_node_flag_fromtb_first_childwheref_parent_node=-1_;break;//forcetoreturnnull,indicatetherwillbedisease}dtr=cmd.ExecuteReader();my_child_total_nodes=0;while(dtr.Read())my_child_total_nodes++;dtr.Close();if(my_child_total_nodes==0)return;my_child_node=newstring[my_child_total_nodes];dtr=cmd.ExecuteReader();i=0;while(dtr.Read()){my_child_node[i]=dtr.GetValue(0).ToString();i++;}dtr.Close();for(i=0;i<my_child_total_nodes;i++)List_All_Diseases_For_This_Node(my_child_node[i],level+1);}輸入拼音碼后,系統(tǒng)的后臺(tái)動(dòng)作對(duì)應(yīng)代碼如下(以后涉及拼音碼的的操作均類似,不再一一列出)privatevoidtextBox_Spell_TextChanged(objectsender,System.EventArgse){if(cnn.State==ConnectionState.Closed){cnn.ConnectionString=local_cnnstr;cnn.Open();}if(Total_Level==0){cmd.CommandText=″selectf_symptom_namefromtb_symptomwheref_root_flag=′R′andf_spelllike_+textBox_Spell.Text+″%′orf_symptom_namelike_+textBox_Spell.Text+″%_;dtr=cmd.ExecuteReader();listBox_Symptom.Items.Clear();while(dtr.Read()){listBox_Symptom.Items.Add(dtr.GetValue(0).ToString());}dtr.Close();}}當(dāng)次級(jí)癥狀出現(xiàn)后,若醫(yī)生還不能確定診斷結(jié)論,他可以繼續(xù)選擇癥狀,系統(tǒng)繼續(xù)顯示下一級(jí)癥狀,疾病列表的內(nèi)容因癥狀的增多而減少。當(dāng)醫(yī)生選擇到最后一級(jí)癥狀時(shí),系統(tǒng)將只列對(duì)應(yīng)疾病,這些疾病出現(xiàn)的百分比一并列出。在選擇的過(guò)程中,醫(yī)生隨時(shí)可以退回到上一級(jí)或返回本級(jí)以及直接退回到頂級(jí)癥狀,代碼如下privatevoidtoolBar1_ButtonClick(objectsender,System.Windows.Forms.ToolBarButtonClickEventArgse){stringgrand_node_flag;FontmyFont;inti;if(cnn.State==ConnectionState.Closed){cnn.ConnectionString=local_cnnstr;cnn.Open();cmd=newSqlCeCommand(″″,cnn);}switch(toolBarl.Buttons.IndexOf(e.Button)){case0://returntothetopmostlevelif(Current_Level==0){Current_Level=0;Total_Level=0;If_Disease_List=false;myFont=newFont(″宋體″,9,System.Drawing.FontStyle.Regular);listBox_Symptom.Font=myFont;Selected_Parent_Name=″″;Selected_Parent_Id=″″;Selected_Parent_Node_Flag=″″;statusBarl.Text=″″;for(i=0;i<Current_Level;i++)CLicked_Name_List[i]=″″;listBox_Disease.Items.Ciear();listBox_Symptom.Size=newSize(240,232);listBox_Disease.Visible=false;break;}cmd.CommandText=″selectf_symptom_namefromtb_symptom″;dtr=cmd.ExecuteReade();listBox_Symptom.Items.Clear();while(dtr.Read()){listBox_Symptom.Items.Add(dtr.GetValue(0).ToString());}dtr.Close();If_Disease_List=fatse;Current_Level=0;Total_Level=0;myFont=newFont(″宋體″,9,System.Drawing.FontStyle.Regular);listBox_Symptom.Font=myFont;Selected_Parent_Name=″″;Selected_Parent_Id=″_;Selected_Parent_Node_Flag=″″;statusBarl.Text=″″;for(i=0;i<Current_Level;i++)CLicked_Name_List[i]=″″;listBox_Disease.Items.Clear();listBox_Symptom.Size=newSize(240,232);listBox_Disease.Visible=false;break;case1://returntoformerlevelIf_Disease_List=false;if(Current_Level==0){Current_Level=0;Total_Level=0;myFont=newFont(″宋體″,9,System.Drawing.FontStyle.Regular);listBox_Symptom.Font=myFont;Selected_Parent_Name=″″;Selected_Parent_Id=″″;Selected_Parent_Node_Flag=″″;statusBarl.Text=″″;for(i=0;i<Current_Level;i++)CLicked_Name_List[i]=″″;listBox_Disease.Items.Clear();listBox_Symptom.Size=newSize(240,232);listBox_Disease.Visible=false;break;}elseif(Current_Level<=1)//directlyreturntotopmostlevel{cmd.CommandText=″selectf_symptom_namefromtb_symptom″;dtr=cmd.ExecuteReader();listBox_Symptom.Items.Clear();while(dtr.Read()){listBox_Symptom.Items.Add(dtr.GetValue(0).ToString());}dtrClose();Current_Level=0;Total_Level=0;listBox_Disease.Items.Clear();listBox_Symptom.Size=newSize(240,232);listBox_Disease.Visible=false;}else{grand_node_fiag=Convert.ToString(navigation_indicator[Current_Level-2].node_flag);List_All_Children_recursion(grand_node_flag,Current_Level-1);Current_Level--;listBox_Disease.Items.Clear();List_All_Diseases_For_This_Node(navigation_indicator[Current_Level].node_flag.ToString(),Current_Level);listBox_Symptom.Size=newSize(240,134);listBox_Disease.Visible=true;}break;case2://gotonextlevelif(Current_Level<Total_Level){grand_node_fiag=Convert.ToString(navigation_indicator[Current_Level].node_flag);List_All_Children_recursion(grand_node_fiag,Current_Level+1);Current_Level++;listBox_Disease.Items.Clear();List_All_Diseases_For_This_Node(nayigation_indicator[Current_Level].node_flag.ToString(),Current_Level);}break;case3cnn.Close();cnn.Dispose();cmd.Dispose();View_Search_Routormy_routor=newView_Search_Routor(Selected_Parent_Name,Selected_Parent_Id,Selected_Parent_Node_Flag,Selecting_Node_Flag);my_routor.Show();break;}}在選擇的過(guò)程中,系統(tǒng)在下方狀態(tài)條上隨時(shí)顯示用戶所選擇的癥狀列表,從頂級(jí)到當(dāng)前級(jí)別滾動(dòng)顯示。代碼如下privatevoidtimerl_Tick(objectsender,System.EventArgse){stringtmp_str;intstrLength;tmp_str=″″;for(inti=0;i<Current_Level;i++)tmp_str=″*″+CLieked_Name_List[i];strLength=tmp_str.Length;if(Timer_Indicator>strLength)Timer_Indicator=0;statusBarl.Text=tnp_str.Substring(Timer_Indicator);Timer_Indicator++;}若用戶選擇某疾病,則系統(tǒng)自動(dòng)進(jìn)入該疾病信息顯示窗口,在該窗口系統(tǒng)缺省顯示該疾病的基本信息,然后根據(jù)用戶選擇顯示該疾病的病因、診斷方法、癥狀以及治療方法。代碼如下privatevoidSelected_Disease_Load(objectsender,System.EventArgse){stringdisease_id;local_cnnstr=″DataSource=″+@″\programfiles\SmartDoctor\pda.SDF″;cnn=newSqlCeConnection();cnn.ConnectionString=local_cnnstr;cnn.Open();try{cmd=newSqlCeCommand(″selectf_disease_idfromtb_diseasewheref_disease_name=_+Disease_Name+″_,cnn);}catch(SqlCeExceptionexSQL){MessageBox.Show(exSQL.Errors.Message);}dtr=cmd.ExecuteReader();dtr.Read();disease_id=dtr.GetValue(0).ToString();dtr.Close();cmd.CommandText=″selectf_disease_basicfromtb_disease_basicwheref_disease_id=_+disease_id+″_;dtr=cmd.ExecuteReader();textBox1.Text=″″;while(dtr.Read())textBox1.Text+=textBox1.Text+dtr.GetValue(0).ToString();dtr.Close();comboBox1.SelectedIndex=0;labell.Text=Disease_Name;}privatevoidcomboBox1_SelectedIndexChanged(objectsender,System.EventArgse){stringdisease_id;if(cnn.State==ConnectionState.Closed){cnn.ConnectionString=local_cnnstr;cnn.Open();cmd=newSqlCeCommand(″selectf_disease_idfromtb_diseasewheref_disease_name=_+Disease_Name+″_,cnn);}elsecmd.CommandText=″selectf_disease_idfromtb_diseasewheref_disease_name=_+Disease_Name+″_;dtr=cmd.ExecuteReader();dtr.Read();disease_id=dtr.GetValue(0).ToString();dtr.Close();switch(comboBox1.SelectedIndex){case0cmd.CommandText=″selectf_disease_basicfromtb_disease_basicwheref_disease_id=_+disease_id+″_;break;case1cmd.CommandText=″selectf_physicfromtb_physicwheref_disease_id=_+disease_id+″_;break;case2cmd.CommandText=″selectf_diagnosisfromtb_diagnosiswheref_disease_id=_+disease_id+″_;break;case3cmd.CommandText=″selectf_disease_symptomfromtb_disease_symptomwheref_disease_id=_+disease_id+″_;break;case4cmd.CommandText=″selectf_treatmentfromtb_treatmentwheref_disease_id=_+disease_id+″_;break;defaultreturn;}dtr=cmd.ExecuteReader();textBox1.Text=″″;while(dtr.Read())textBox1.Text+=textBox1.Text+dtr.GetValue(0).ToString();dtr.Close();}對(duì)于選擇到末端癥狀節(jié)所列出的疾病以及百分比,用戶可以修改這些信息。用戶可以修改百分比的具體數(shù)值,也可以刪除某疾病。這樣就把用戶(醫(yī)生)自己的醫(yī)療實(shí)踐經(jīng)驗(yàn)集成進(jìn)來(lái),體現(xiàn)了系統(tǒng)的自學(xué)習(xí)功能。如果用戶用心維護(hù)這些數(shù)據(jù),最終運(yùn)行于該用戶智能設(shè)備上的系統(tǒng)將完全體現(xiàn)該用戶的醫(yī)療技術(shù)水平,并且按照他的實(shí)踐經(jīng)驗(yàn)具備相當(dāng)?shù)拇_定性結(jié)果。后臺(tái)自學(xué)習(xí)的代碼如下4.2疾病模塊系統(tǒng)可以根據(jù)用戶在系統(tǒng)菜單的選擇而直接進(jìn)入疾病信息窗口。在這里所有的疾病都可查看,而不像上節(jié)所講的只能查看所選定的疾病。為快速找到某個(gè)疾病,用戶可以在上方的拼音碼輸入框里輸入拼音碼來(lái)快速查找。同樣的,系統(tǒng)缺省顯示該疾病的基本信息,然后根據(jù)用戶選擇顯示該疾病的病因、診斷方法、癥狀以及治療方法。代碼如下privatevoidDisease_System_Load(objectsender,System.EventArgse){stringdisease_name,disease_id;local_cnnstr=″DataSource=″+@″\programfiles\SmartDoctor\pda.SDF″;cnn=newSqlCeConnection();cnn.ConnectionString=local_cnnstr;cnn.Open();try{cmd=newSqlCeCommand(″selectf_disease_namefromtb_diseaseorderbyf_disease_name″,cnn);}catch(SqlCeExceptionexSQL){MessageBox.Show(exSQL.Errors.Message);}comboBox_Disease.Items.Clear();dtr=cmd.ExecuteReader();while(dtr.Read())comboBox_Disease.Items.Add(dtr.GetValue(0).ToString());dtr.Close();comboBox_Disease.SelectedIndex=0;disease_name=comboBox_Disease.Items.ToString();cmd.CommandText=″selectf_disease_idfromtb_diseasewheref_disease_name=_+disease_name+″_;dtr=cmd.ExecuteReader();dtr.Read();disease_id=dtr.GetValue(0).ToString();dtr.Close();cmd.CommandText=″selectf_disease_basicfromtb_disease_basicwheref_disease_id=_+disease_id+″_;dtr=cmd.ExecuteReader();if(dtr.Read())textBox2.Text=dtr.GetValue(0).ToString();dtr.Close();comboBox2.SelectedIndex=0;}privatevoidtextBox1_TextChanged(objectsender,System.EventArgse){stringdisease_name,disease_id;if(cnn.State==ConnectionState.Closed){cnn.ConnectionString=local_cnnstr;cnn.Open();cmd=newSqlCeCommand(″selectf_disease_namefromtb_diseasewheref_spelllike_+textBox1.Text+″%′orf_disease_namelike_+textBox1.Text+″%_,cnn);}elsecmd.CommandText=″selectf_disease_namefromtb_diseasewheref_spelllike_+textBox1.Text+″%′orf_disease_namelike_+textBox1.Text+″%_;dtr=cmd.ExecuteReader();comboBox_Disease.Items.Clear();while(dtr.Read())comboBox_Disease.Items.Add(dtr.GetValue(0).ToString());dtr.Close();if(comboBox_Disease.Items.Count>0){comboBox_Disease.SelectedIndex=0;disease_name=comboBox_Disease.Items.ToString();cmd.CommandText=″selectf_disease_idfromtb_diseasewheref_disease_name=_+disease_name+″_;dtr=cmd.ExecuteReader();dtr.Read();disease_id=dtr.GetValue(0).ToString();dtr.Close();cmd.CommandText=″selectf_disease_basicfromtb_disease_basicwheref_disease_id=_+disease_id+″_;dtr=cmd.ExecuteReader();if(dtr.Read())textBox2.Text=dtr.GetValue(0).ToString();dtr.Close();}}privatevoidDisease_System_Closed(objectsender,System.EventArgse){cnn.Close();cnn.Dispose();cmd.Dispose();}privatevoidDisease_System_LostFocus(objectsender,System.EventArgse){cnn.Close();cnn.Dispose();cmd.Dispose();}privatevoidtextBox1_LostFocus(objectsender,System.EventArhse){inputPanel1.Enabled=false;}privatevoidtextBox1_GotFocus(objectsender,System.EventArgse){inputPanel1.Enabled=true;}privatevoidcomboBox2_SelectedIndexChanged(objectsender,System.EventArgse){stringdisease_name,disease_id;disease_name=comboBox_Disease.Items[comboBox_Disease.SelectedIndex].ToString();if(cnn.State==ConnectionState.Closed){cnn.ConnectionString=local_cnnstr;cnn.Open();cmd=newSqlCeCommand(″selectf_disease_idfromtb_diseasewheref_disease_name=_+disease_name+″_cnn);}elsecmd.CommandText=″selectf_disease_idfromtb_diseasewheref_disease_name=_+disease_name+″_;dtr=cmd.ExecuteReader();dtr.Read();disease_id=dtr.GetValue(0).ToString();dtr.Close();switch(comboBox2.SelectedIndex){case0cmd.CommandText=″selectf_disease_basicfromtb_disease_basicwheref_disease_id=_+disease_id+″_;break;case1cmd.CommandText=″selectf_physicfromtb_physicwheref_disease_id=_+disease_id+″_;break;case2cmd.CommandText=″selectf_diagnosisfromtb_diagnosiswheref_disease_id=_+disease_id+″_;break;case3cmd.CommandText=″selectf_disease_symptomfromtb_disease_symptomwheref_disease_id=_+disease_id+″_;break;case4cmd.CommandText=″selectf_treatmentfromtb_treatmentwheref_disease_id=_+disease_id+″_;break;defaultreturn;}dtr=cmd.ExecuteReader();textBox2.Text=″″;while(dtr.Read())textBox2.Text+=textBox2.Text+dtr.GetValue(0).ToStrinh();dtr.Close();}4.3藥品、病原學(xué)、實(shí)驗(yàn)室檢查、廣告這幾類信息和疾病的處理方法是一樣的,所不同的只是后臺(tái)數(shù)據(jù)庫(kù)表的不同,代碼是非常類似的。這里是列出它們分別對(duì)應(yīng)的數(shù)據(jù)庫(kù)表●藥品tb_medication,tb_medication_detail●病原學(xué)tb_physic●實(shí)驗(yàn)室檢查tb_laboratory●廣告tb_advertisement5系統(tǒng)說(shuō)明對(duì)應(yīng)系統(tǒng)菜單“關(guān)于系統(tǒng)”,詳細(xì)列出參與本系統(tǒng)開(kāi)發(fā)的醫(yī)學(xué)專家,同時(shí)就產(chǎn)品版權(quán)問(wèn)題做聲明。代碼如下privatevoidAbout_Load(objectsender,System.EventArgse){local_cnnstr=″DataSource=″+@″\programfiles\SmartDoctor\pda.SDF″;cnn=newSqlCeConnection();cnn.ConnectionString=local_cnnstr;cnn.Open();try{cmd=newSqlCeCommand(″select*fromtb_developer″,cnn);}catch(SqlCeExceptionexSQL){MessageBox.Show(exSQL.Errors.Message);}dtr=cmd.ExecuteReader();while(dtr.Read()){textBox1.Text+=dtr.GetValue(1).ToString()+″\x0d″+″\x0a″;textBox1.Text+=dtr.GetValue(2).ToString()+″\x0d″+″\x0a″;textBox1.Text+=dtr.GetValue(3).ToString()+″\x0d″+″\x0a″;}dtr.Close();}privatevoidAbout_Closing(objectsender,System.ComponentModel.CancelEventArgse){cnn.Close();cmd.Dispose();}privatevoidAbout_LostFocus(objectsender,System.EventArgse){cnn.Close();cmd.Dispose();}4.5安裝程序、發(fā)行程序采用標(biāo)準(zhǔn)軟件工程方法,不屬于產(chǎn)品的一部分,任何一種產(chǎn)品都采用相同的方式進(jìn)行,在此不再贅述。6升級(jí)程序系統(tǒng)升級(jí)分為兩個(gè)部分系統(tǒng)程序的升級(jí)和數(shù)據(jù)的升級(jí)。用戶在升級(jí)時(shí)升級(jí)程序會(huì)自動(dòng)提示用戶升級(jí)的形式?!裣到y(tǒng)程序升級(jí)這是系統(tǒng)功能、用戶界面、使用(操作)方式的升級(jí)。用戶只下在升級(jí)模塊,運(yùn)行它即可?!駭?shù)據(jù)升級(jí)醫(yī)學(xué)是門不斷發(fā)展的科學(xué),疾病的病因、治療、診斷、藥品、實(shí)驗(yàn)室檢查等會(huì)不斷的發(fā)展,因此本系統(tǒng)后臺(tái)數(shù)據(jù)也要不斷升級(jí)以反映這種變化。在數(shù)據(jù)升級(jí)時(shí)系統(tǒng)會(huì)充分考慮用戶(醫(yī)生)自己對(duì)數(shù)據(jù)的修改(系統(tǒng)的自學(xué)習(xí)功能),這些數(shù)據(jù)是指那些疾病出現(xiàn)的百分比以及在癥狀樹(shù)型關(guān)系末端節(jié)點(diǎn)所對(duì)應(yīng)的疾病。升級(jí)一開(kāi)始系統(tǒng)就提示用戶選擇是完全覆蓋現(xiàn)有數(shù)據(jù)還是保留現(xiàn)有數(shù)據(jù)。若保留現(xiàn)有數(shù)據(jù),則系統(tǒng)遇到這些數(shù)據(jù)時(shí)將不作修改。若選擇覆蓋,則用升級(jí)數(shù)據(jù)替換現(xiàn)有數(shù)據(jù),同時(shí)把用戶修改的數(shù)據(jù)以文本文件的形式保存以備參考。程序運(yùn)行流程如圖19所示。權(quán)利要求1.本系統(tǒng)是一種運(yùn)行于手持智能設(shè)備的臨床醫(yī)學(xué)智能輔助診斷系統(tǒng)軟件,根據(jù)患者癥狀間的層次關(guān)系查詢得到對(duì)應(yīng)的癥狀列表,同時(shí)給出疾病出現(xiàn)的可能性(百分比)。還把癥狀、疾病、病原學(xué)、實(shí)驗(yàn)室檢查、藥物、藥廠建立了交叉對(duì)應(yīng)關(guān)系,相互之間都有關(guān)聯(lián)。2.根據(jù)權(quán)利要求1所述的軟件系統(tǒng),癥狀間的關(guān)系將以層次型的樹(shù)狀關(guān)系給出。當(dāng)患者主述或檢查出某癥狀后,系統(tǒng)能自動(dòng)給出該癥狀關(guān)聯(lián)的下一級(jí)癥狀,從而提示醫(yī)生作進(jìn)一步檢查或判斷。3.根據(jù)權(quán)利要求1所述的軟件系統(tǒng),當(dāng)經(jīng)過(guò)幾級(jí)的癥狀判斷或檢查后,系統(tǒng)給出疾病列表,提示醫(yī)生在這些疾病中選擇,從而做出最終診斷結(jié)論。(本系統(tǒng)不作診斷結(jié)論)。4.根據(jù)權(quán)利要求1所述的軟件系統(tǒng),疾病列出后還要列出該疾病出現(xiàn)的可能性,以百分比的數(shù)值形式給出。表征患者出現(xiàn)這些癥狀時(shí)某中疾病出現(xiàn)的可能性,輔助醫(yī)生作最后的診斷結(jié)論。5.根據(jù)權(quán)利要求1所述的軟件,本系統(tǒng)建立癥狀、疾病、病原學(xué)、實(shí)驗(yàn)室檢查、藥物、藥廠之間的交叉對(duì)應(yīng)關(guān)系。即從癥狀可以查出疾病信息;從疾病可以查出癥狀、病原學(xué)、藥物、藥廠、實(shí)驗(yàn)室檢查的信息;從病原學(xué)可以查出癥狀、疾病、藥物、藥廠信息;從藥物可以查出疾病、病原學(xué)、藥廠信息;從藥廠可以查出藥物信息;6.根據(jù)權(quán)利要求1所述的軟件,本系統(tǒng)運(yùn)行于手持智能設(shè)備上,這些設(shè)備包括但不限于PDA、智能手機(jī)等。全文摘要本系統(tǒng)是一種運(yùn)行于手持智能設(shè)備的臨床醫(yī)學(xué)智能輔助診斷系統(tǒng)軟件針對(duì)大量的漏診和誤診現(xiàn)象,本系統(tǒng)以癥狀為線索,以層次型的樹(shù)狀關(guān)系給出癥狀間的關(guān)系。根據(jù)某癥狀系統(tǒng)能自動(dòng)給出該癥狀關(guān)聯(lián)的下一級(jí)癥狀,從而提示醫(yī)生作進(jìn)一步檢查或判斷。當(dāng)經(jīng)過(guò)兒級(jí)的癥狀判斷或檢查后,系統(tǒng)給出疾病列表,提示醫(yī)生在這些疾病中選擇,從而做出最終診斷結(jié)論。疾病列出后還要列出該疾病出現(xiàn)的可能性,以百分比的數(shù)值形式給出。表征患者出現(xiàn)這些癥狀時(shí)某中疾病出現(xiàn)的可能性,輔助醫(yī)生作最后的診斷結(jié)論。針對(duì)海量醫(yī)學(xué)知識(shí),本系統(tǒng)把癥狀、疾病、病原學(xué)、實(shí)驗(yàn)室檢查、藥品有效地組織在一起,相互可以交叉查詢,方便醫(yī)生查詢?nèi)我庑畔?。通過(guò)藥品和藥廠的交叉聯(lián)接關(guān)系,本系統(tǒng)成為一個(gè)藥品尤其是處方藥的廣告平臺(tái)。文檔編號(hào)G06Q90/00GK101023884SQ20061000816公開(kāi)日2007年8月29日申請(qǐng)日期2006年2月23日優(yōu)先權(quán)日2006年2月23日發(fā)明者曾爭(zhēng),馮金輝申請(qǐng)人:曾爭(zhēng),馮金輝
      網(wǎng)友詢問(wèn)留言 已有0條留言
      • 還沒(méi)有人留言評(píng)論。精彩留言會(huì)獲得點(diǎn)贊!
      1