NeojApibak.php 122 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596
  1. <?php
  2. namespace app\controller;
  3. require_once app()->getRootPath().'vendor/autoload.php';
  4. use Neoxygen\NeoClient\ClientBuilder;
  5. use think\facade\Request;
  6. use app\model\ClinicalTrial;
  7. use app\model\ClinicalPathway;
  8. class NeojApi extends CommonTwoController
  9. {
  10. // 菜单栏
  11. public function index()
  12. {
  13. $departmentLevel1 = [
  14. ['departmentLevel1' => '内科']
  15. ];
  16. $list = [];
  17. foreach ($departmentLevel1 as $key => $value) {
  18. $list[$key]['departmentLevel1'] = $value['departmentLevel1'];
  19. $query1 = "match(n:SickNess{departmentLevel1 : "."'".$value["departmentLevel1"]."'"."}) return distinct n.departmentLevel2 as departmentLevel2";
  20. $qdata1 = $this->getAboutInfo($query1);
  21. foreach ($qdata1 as $key1 => $value1) {
  22. $qdata1[$key1]['tag'] = 'sickness';
  23. }
  24. $list[$key]['departmentLevel2']['name'] = $qdata1;
  25. }
  26. $departmentLevel = [
  27. [
  28. 'departmentLevel1' => '神经内科' ,
  29. ],
  30. [
  31. 'departmentLevel1' => '感染内科' ,
  32. ],
  33. [
  34. 'departmentLevel1' => '心血管内科' ,
  35. ],
  36. [
  37. 'departmentLevel1' => '肾内科' ,
  38. ],
  39. [
  40. 'departmentLevel1' => '呼吸科' ,
  41. ],
  42. [
  43. 'departmentLevel1' => '血液科' ,
  44. ],
  45. ];
  46. $listt = [];
  47. foreach ($departmentLevel as $key => $value) {
  48. $listt[$key]['departmentLevel1'] = $value['departmentLevel1'];
  49. $query11 = "match(n:Disease{departmentLevel1 : "."'".$value["departmentLevel1"]."'"."}) return distinct n.departmentLevel2 as departmentLevel2";
  50. $qqdata1 = $this->getAboutInfo($query11);
  51. foreach ($qqdata1 as $key11 => $value11) {
  52. $qqdata1[$key11]['tag'] = 'disease';
  53. }
  54. $listt[$key]['departmentLevel2']['name'] = $qqdata1;
  55. }
  56. // 中医疾病
  57. $query1 = "match(n:SickNess) where n.department is not null return distinct n.department as departmentLevel2";
  58. $data = $this->getAboutInfo($query1 , 'zy');
  59. unset($data[20]);
  60. unset($data[5]);
  61. $listzy[0]['departmentLevel1']['name'] = '中医科室';
  62. $listzy[0]['departmentLevel2']['name'] = $data;
  63. $lists = [
  64. ['knowledge_base_name' => '西医知识库'],
  65. ['knowledge_base_name' => '中医知识库'],
  66. ];
  67. foreach ($lists as $k => $v)
  68. {
  69. // 西医知识库
  70. $lists[0]['subordinate'] = [
  71. ['name' => '疾病'] ,
  72. ['name' => '症状体征' , 'tag' => 'symptom'],
  73. ['name' => '药品' , 'tag' => 'medicine'],
  74. ['name' => '检查' , 'tag' => 'inspection'],
  75. ];
  76. // 中医知识库
  77. $lists[1]['subordinate'] = [
  78. ['name' => '疾病' , 'tag' => 'zysickness'] ,
  79. ['name' => '中成药' , 'tag' => 'zcy'] ,
  80. ['name' => '经络' , 'tag' => 'jl'] ,
  81. ['name' => '中药' , 'tag' => 'zy'] ,
  82. ['name' => '中医药膳' , 'tag' => 'ys'] ,
  83. ['name' => '方剂' , 'tag' => 'fj'] ,
  84. ['name' => '体质' , 'tag' => 'tz'] ,
  85. ['name' => '穴位' , 'tag' => 'xw']
  86. ];
  87. }
  88. // 中医疾病科室
  89. $zysicknessQuery = "match(n:SickNess) return distinct n.department as departmentLevel2";
  90. $zydeparment = $this->getAboutInfo($zysicknessQuery , 'zy');
  91. foreach ($zydeparment as $zyk => $zyvalue)
  92. {
  93. $zydeparment[$zyk]['tag'] = 'zysickness';
  94. $zydquery = "match(n:SickNess {department:"."'".$zyvalue['departmentLevel2']."'"."}) return distinct n.name as name";
  95. $datazyd = $this->getAboutInfo($zydquery , 'zy');
  96. foreach ($datazyd as $zydk => $zydv) {
  97. $datazyd[$zydk]['tag'] = 'zysickness';
  98. }
  99. $zydeparment[$zyk]['subordinate'] = $datazyd;
  100. unset($zydeparment[20]);
  101. unset($zydeparment[21]);
  102. }
  103. foreach ($lists as $kk => $v)
  104. {
  105. $lists[0]['subordinate'][0]['subordinate'] = [['name' => '西医科普疾病'] , ['name' => '西医科室疾病']];
  106. }
  107. // 获取中成药分类
  108. $cnquery = "match(n:CnPatentMedicine) where n.classification is not null return distinct n.classification as name";
  109. $cndata = $this->getAboutInfo($cnquery , 'zy');
  110. foreach ($cndata as $cnkey => $cnvalue)
  111. {
  112. $cndata[$cnkey]['tag'] = 'zcy';
  113. }
  114. // 获取经络分类
  115. $cnjlquery = "match(n:ChannelCollateral) where n.name is not null return distinct n.name as name";
  116. $cnjldata = $this->getAboutInfo($cnjlquery , 'zy');
  117. foreach ($cnjldata as $cnjlkey => $cnvalue)
  118. {
  119. $cnjldata[$cnjlkey]['tag'] = 'jl';
  120. }
  121. foreach ($lists as $kkk => $vvv)
  122. {
  123. $lists[0]['subordinate'][0]['subordinate'][0]['department'] = $list;
  124. $lists[0]['subordinate'][0]['subordinate'][1]['department'] = $listt;
  125. $lists[1]['subordinate'][0]['subordinate'][0]['name'] = '中医科室疾病';
  126. $lists[1]['subordinate'][0]['subordinate'][1]['name'] = '中医ICD10疾病';
  127. $lists[1]['subordinate'][0]['subordinate'][0]['department'] = $zydeparment;
  128. $lists[1]['subordinate'][0]['subordinate'][1]['department'] = $this->getIcdSickness();
  129. $lists[1]['subordinate'][1]['subordinate'] = $cndata;
  130. $lists[1]['subordinate'][2]['subordinate'] = $cnjldata; // 经络
  131. }
  132. return $this->_json_succ($lists);
  133. }
  134. // 中医icd分类
  135. public function getIcdSickness()
  136. {
  137. $query = "match(n:Thing) where n.level1 is not null return distinct n.level1 as level";
  138. $data = $this->getAboutInfo($query , 'zy');
  139. foreach ($data as $key => $value) {
  140. $query1 = "match(n:Thing {level1:"."'".$value["level"]."'"."}) return distinct n.level2 as level2";
  141. $data1 = $this->getAboutInfo($query1 , 'zy');
  142. $data[$key]['subordinate'] = $data1;
  143. foreach ($data1 as $kk => $vv) {
  144. $vv['level2'] = substr($vv['level2'] , 0 , 3);
  145. $query2 = "MATCH (n:SickNess) where n.ICD10 =~'.*".$vv["level2"].".*' and n.ICD10 is not null return distinct n.ICD10 as name order by n.ICD10 asc limit 10";
  146. $data2 = $this->getAboutInfo($query2 , 'zy');
  147. foreach ($data2 as $k => $v) {
  148. $data2[$k]['tag'] = 'icd10';
  149. $data2[$k]['name'] = $v['name'];
  150. }
  151. $data[$key]['subordinate'][$kk]['subordinate'] = $data2;
  152. }
  153. }
  154. return $data;
  155. }
  156. // 中医知识库列表
  157. public function getZyList()
  158. {
  159. if(!$this->checkIslogin()) return $this->_json_error('请登录后查看!');
  160. $tag = Request::param('tag');
  161. $pn = Request::param('pn') ?? 1;
  162. $limit = ($pn - 1) * 30;
  163. switch ($tag) {
  164. case 'zysickness':
  165. $query = "match(n:SickNess) return n skip $limit limit 20";
  166. $data = $this->getAboutInfo($query , 'zy');
  167. $data = array_column($data , 'n');
  168. $query_count = "match(n:SickNess) return count(n) as count";
  169. $count = $this->getTotalCount($query_count , 'zy');
  170. $list = [];
  171. foreach ($data as $key => $value) {
  172. $list[$key]['name'] = $value['dialecticalName'];
  173. $list[$key]['symptom'] = ['name' => '症见' , 'text' => $value['symptom'] ?? '' , 'active' => true];
  174. $list[$key]['tongueCondition'] = ['name' => '舌象' , 'text' => $value['tongueCondition'] ?? '' , 'active' => false];
  175. $list[$key]['apparatus'] = ['name' => '发病部位' , 'text' => $value['apparatus'] ?? '' , 'active' => false];
  176. $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
  177. $list[$key]['pulseCondition'] = ['name' => '脉象' , 'text' => $value['pulseCondition'] ?? '' , 'active' => false];
  178. $list[$key]['dietTherapy'] = ['name' => '饮食疗法' , 'text' => $value['dietTherapy'] ?? '' , 'active' => false];
  179. $list[$key]['department'] = ['name' => '科室' , 'text' => $value['department'] ?? '' , 'active' => false];
  180. $list[$key]['acupuncturePoints'] = ['name' => '针灸穴位' , 'text' => $value['acupuncturePoints'] ?? '' , 'active' => false];
  181. $list[$key]['dialecticalName'] = ['name' => '辩证法名' , 'text' => $value['dialecticalName'] ?? '' , 'active' => false];
  182. }
  183. break;
  184. case 'zy':
  185. $query = "match(n:CnMedicinalCrop) return n skip $limit limit 20";
  186. $data = $this->getAboutInfo($query , 'zy');
  187. $data = array_column($data , 'n');
  188. $query_count = "match(n:CnMedicinalCrop) return count(n) as count";
  189. $count = $this->getTotalCount($query_count , 'zy');
  190. $list = [];
  191. foreach ($data as $key => $value) {
  192. $list[$key]['name'] = $value['name'];
  193. $list[$key]['toxicity'] = ['name' => '毒性' , 'text' => $value['toxicity'] ?? '' , 'active' => true];
  194. $list[$key]['indications'] = ['name' => '功能主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
  195. $list[$key]['source'] = ['name' => '来源' , 'text' => $value['source'] ?? '' , 'active' => false];
  196. $list[$key]['medicineProperty'] = ['name' => '药性' , 'text' => $value['medicineProperty'] ?? '' , 'active' => false];
  197. $list[$key]['includedIn'] = ['name' => '收录于' , 'text' => $value['includedIn'] ?? '' , 'active' => false];
  198. $list[$key]['pharmacology'] = ['name' => '药理作用' , 'text' => $value['pharmacology '] ?? '' , 'active' => false];
  199. $list[$key]['kgid'] = ['name' => 'kgid' , 'text' => $value['kgid'] ?? '' , 'active' => false];
  200. }
  201. break;
  202. case 'zcy':
  203. $query = "match(n:CnPatentMedicine) return n skip $limit limit 20";
  204. $data = $this->getAboutInfo($query , 'zy');
  205. $data = array_column($data , 'n');
  206. $query_count = "match(n:CnPatentMedicine) return count(n) as count";
  207. $count = $this->getTotalCount($query_count , 'zy');
  208. $list = [];
  209. foreach ($data as $key => $value) {
  210. $list[$key]['name'] = $value['name'];
  211. $list[$key]['classification'] = ['name' => '实体值' , 'text' => $value['classification'] ?? '' , 'active' => true];
  212. $list[$key]['efficacy'] = ['name' => '功效' , 'text' => $value['efficacy'] ?? '' , 'active' => false];
  213. $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
  214. $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
  215. }
  216. break;
  217. case 'ys':
  218. $query = "match(n:TonicDiet) return n skip $limit limit 20";
  219. $data = $this->getAboutInfo($query , 'zy');
  220. $data = array_column($data , 'n');
  221. $query_count = "match(n:TonicDiet) return count(n) as count";
  222. $count = $this->getTotalCount($query_count , 'zy');
  223. $list = [];
  224. foreach ($data as $key => $value) {
  225. $list[$key]['name'] = $value['name'];
  226. $list[$key]['composition'] = ['name' => '药膳组成' , 'text' => $value['composition'] ?? '' , 'active' => true];
  227. }
  228. break;
  229. case 'fj':
  230. $query = "match(n:Prescription) return n skip $limit limit 20";
  231. $data = $this->getAboutInfo($query , 'zy');
  232. $data = array_column($data , 'n');
  233. $query_count = "match(n:Prescription) return count(n) as count";
  234. $count = $this->getTotalCount($query_count , 'zy');
  235. $list = [];
  236. foreach ($data as $key => $value) {
  237. $list[$key]['name'] = $value['name'];
  238. $list[$key]['composition'] = ['name' => '方剂组成' , 'text' => $value['composition'] ?? '' , 'active' => true];
  239. $list[$key]['medicinalCrop'] = ['name' => '中药' , 'text' => $value['medicinalCrop'] ?? '' , 'active' => false];
  240. $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
  241. $list[$key]['solution'] = ['name' => '方法/解法' , 'text' => $value['solution'] ?? '' , 'active' => false];
  242. $list[$key]['usageDosage'] = ['name' => '用法用量' , 'text' => $value['usageDosage'] ?? '' , 'active' => false];
  243. $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
  244. }
  245. break;
  246. case 'tz':
  247. $query = "match(n:Constitution) return n skip $limit limit 20";
  248. $data = $this->getAboutInfo($query , 'zy');
  249. $data = array_column($data , 'n');
  250. $query_count = "match(n:Constitution) return count(n) as count";
  251. $count = $this->getTotalCount($query_count , 'zy');
  252. $list = [];
  253. foreach ($data as $key => $value) {
  254. $list[$key]['name'] = $value['name'];
  255. $list[$key]['overallFeature'] = ['name' => '总体特征' , 'text' => $value['overallFeature'] ?? '' , 'active' => true];
  256. $list[$key]['psychologicalFeature'] = ['name' => '心理特征' , 'text' => $value['medicinalCrop'] ?? '' , 'active' => false];
  257. $list[$key]['commonPerformance'] = ['name' => '常见表现' , 'text' => $value['indications'] ?? '' , 'active' => false];
  258. $list[$key]['tendency'] = ['name' => '发病倾向' , 'text' => $value['tendency'] ?? '' , 'active' => false];
  259. $list[$key]['exercise'] = ['name' => '体育锻炼' , 'text' => $value['exercise'] ?? '' , 'active' => false];
  260. $list[$key]['meridianHealth'] = ['name' => '经络保健' , 'text' => $value['meridianHealth'] ?? '' , 'active' => false];
  261. $list[$key]['medicineRegimen'] = ['name' => '药物养生' , 'text' => $value['medicineRegimen'] ?? '' , 'active' => false];
  262. $list[$key]['dietTherapy'] = ['name' => '宜食疗' , 'text' => $value['medicineRegimen'] ?? '' , 'active' => false];
  263. $list[$key]['notEat'] = ['name' => '不宜吃' , 'text' => $value['medicineRegimen'] ?? '' , 'active' => false];
  264. }
  265. break;
  266. case 'xw':
  267. $query = "match(n:Acupoint) return n skip $limit limit 20";
  268. $data = $this->getAboutInfo($query , 'zy');
  269. $data = array_column($data , 'n');
  270. $query_count = "match(n:Acupoint) return count(n) as count";
  271. $count = $this->getTotalCount($query_count , 'zy');
  272. $list = [];
  273. foreach ($data as $key => $value) {
  274. $list[$key]['name'] = $value['name'];
  275. $list[$key]['location'] = ['name' => '定位' , 'text' => $value['location'] ?? '' , 'active' => true];
  276. $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
  277. $list[$key]['compatibility'] = ['name' => '配伍' , 'text' => $value['compatibility'] ?? '' , 'active' => false];
  278. $list[$key]['acupuncture'] = ['name' => '针灸法' , 'text' => $value['acupuncture'] ?? '' , 'active' => false];
  279. $list[$key]['notions'] = ['name' => '附注' , 'text' => $value['notions'] ?? '' , 'active' => false];
  280. }
  281. break;
  282. }
  283. return $this->_json_succ(['list' => $list , 'count' => $count]);
  284. }
  285. // 获取左侧栏目下拉信息
  286. public function getSickNessByDpm()
  287. {
  288. //if(!$this->checkIslogin()) return $this->_json_error('请登录后查看!');
  289. $department = Request::param('department') ?? '';
  290. $pn = Request::param('pn') ?? 1;
  291. $pagesize = 20;
  292. $limit = ($pn - 1) * $pagesize;
  293. $tag = Request::param('tag') ?? 'sickness'; // sickness 科普 disease 医疗
  294. $list = [];
  295. switch ($tag)
  296. {
  297. case "sickness":
  298. $query = "match(n:SickNess{departmentLevel2 : "."'".$department."'"."}) return
  299. n.name as name , n.complicationsOverview as complicationsOverview , n.pathogenesis as pathogenesis ,
  300. n.treatmenCommonSense as treatmenCommonSense , n.inspection as inspection , n.symptom as symptom , n.diagnostiCtriage as diagnostiCtriage
  301. skip $limit limit 20";
  302. // $query = "match(n:SickNess{departmentLevel2 : "."'".$department."'"."}) return n skip $limit limit 30";
  303. $sickess = $this->getAboutInfo($query);
  304. $query_count = "match(n:SickNess{departmentLevel2 : "."'".$department."'"."}) return count(n) as count";
  305. $count = $this->getTotalCount($query_count);
  306. foreach ($sickess as $key => $value) {
  307. $list[$key]['sickness_name'] = $value['name'];
  308. $list[$key]['symptom'] = ['name' => '临床表现' , 'text' => $value['symptom'] ?? '' , 'active' => true];
  309. $list[$key]['pathogenesis'] = ['name' => '病因' , 'text' => $value['pathogenesis'] ?? '' , 'active' => false];
  310. $list[$key]['complicationsOverview'] = ['name' => '并发症' , 'text' => $value['complicationsOverview'] ?? '' , 'active' => false];
  311. $list[$key]['inspection'] = ['name' => '辅助检查' , 'text' => $value['inspection'] ?? '', 'active' => false];
  312. $list[$key]['treatmenCommonSense'] = ['name' => '治疗' , 'text' => $value['treatmenCommonSense'] ?? '' , 'active' => false];
  313. $list[$key]['diagnostiCtriage'] = ['name' => '诊断' , 'text' => $value['diagnostiCtriage'] ?? '', 'active' => false];
  314. }
  315. break;
  316. case "disease":
  317. $query = "match(n:Disease{departmentLevel2 : "."'".$department."'"."}) return n.name as name,
  318. n.clinicalFeature as clinicalFeature , n.pathogenesis as pathogenesis , n.complicationsOverview as complicationsOverview ,
  319. n.auxiliaryExamination as auxiliaryExamination , n.treatment as treatment , n.diagnosis as diagnosis
  320. skip $limit limit 20";
  321. $sickess = $this->getAboutInfo($query);
  322. $query_count = "match(n:Disease) where n.departmentLevel2 =~'.*".$department.".*' return count(n) as count";
  323. $count = $this->getTotalCount($query_count);
  324. foreach ($sickess as $key => $value) {
  325. $list[$key]['sickness_name'] = $value['name'];
  326. $list[$key]['symptom'] = ['name' => '临床表现' , 'text' => $value['clinicalFeature'] ?? '', 'active' => true];
  327. $list[$key]['pathogenesis'] = ['name' => '病因' , 'text' => $value['pathogenesis'] ?? '', 'active' => false];
  328. $list[$key]['complicationsOverview'] = ['name' => '并发症' , 'text' => $value['complicationsOverview'] ?? '' , 'active' => false];
  329. $list[$key]['inspection'] = ['name' => '辅助检查' , 'text' => $value['auxiliaryExamination'] ?? '' , 'active' => false];
  330. $list[$key]['treatmenCommonSense'] = ['name' => '治疗' , 'text' => $value['treatment'] ?? '', 'active' => false];
  331. $list[$key]['diagnostiCtriage'] = ['name' => '诊断' , 'text' => $value['diagnosis'] ?? '', 'active' => false];
  332. }
  333. break;
  334. case "medicine":
  335. $query = "match(n:MedicineProduction) return
  336. n.name as name , n.pinyin as pinyin , n.usageDosage as usageDosage ,
  337. n.notes as notes , n.periodValidity as periodValidity ,
  338. n.indication as indication , n.storage as storage , n.character as character ,
  339. n.approvalNumber as approvalNumber ,
  340. n.productionEnterprise as productionEnterprise , n.relateSick as relateSick , n.untowardEffect as untowardEffect ,
  341. n.majorConstituent as majorConstituent
  342. skip $limit limit 20";
  343. $data = $this->getAboutInfo($query);
  344. $query_count = "match(n:MedicineProduction) return count(n) as count";
  345. $count = $this->getTotalCount($query_count);
  346. foreach ($data as $key => $value) {
  347. $list[$key]['sickness_name'] = $value['name'];
  348. $list[$key]['pinyi'] = ['name' => '汉语拼音' , 'text' => $value['pinyin'] , 'active' => false];
  349. $list[$key]['usageDosage'] = ['name' => '用法用量' , 'text' => $value['usageDosage'] , 'active' => false];
  350. $list[$key]['notes'] = ['name' => '注意事项' , 'text' => $value['notes'] , 'active' => false];
  351. $list[$key]['periodValidity'] = ['name' => '有效期' , 'text' => $value['periodValidity'], 'active' => false];
  352. $list[$key]['indication'] = ['name' => '适应症' , 'text' => $value['indication'], 'active' => false];
  353. $list[$key]['storage'] = ['name' => '贮藏' , 'text' => $value['storage'], 'active' => false];
  354. $list[$key]['character'] = ['name' => '性状' , 'text' => $value['character'], 'active' => false];
  355. $list[$key]['approvalNumber'] = ['name' => '批准号' , 'text' => $value['approvalNumber'], 'active' => false];
  356. $list[$key]['productionEnterprise'] = ['name' => '生产企业' , 'text' => $value['productionEnterprise'], 'active' => false];
  357. $list[$key]['relateSick'] = ['name' => '相关疾病' , 'text' => $value['relateSick'], 'active' => false];
  358. $list[$key]['untowardEffect'] = ['name' => '不良反应' , 'text' => $value['untowardEffect'], 'active' => false];
  359. $list[$key]['majorConstituent'] = ['name' => '主要成分' , 'text' => $value['majorConstituent'], 'active' => true];
  360. }
  361. break;
  362. case "inspection":
  363. $query = "match (n:Inspection) return
  364. n.name as name , n.annotation as annotation , n.principle as principle , n.normalValue as normalValue ,
  365. n.clinicalSignificance as clinicalSignificance , n.reagent as reagent , n.operation as operation
  366. skip $limit limit 20";
  367. $data = $this->getAboutInfo($query);
  368. $query_count = "match (n:Inspection) return count(n) as count";
  369. $count = $this->getTotalCount($query_count);
  370. foreach ($data as $key => $value) {
  371. $list[$key]['sickness_name'] = $value['name'];
  372. $list[$key]['annotation'] = ['name' => '附注' , 'text' => $value['annotation'] ?? '' , 'active' => true];
  373. $list[$key]['principle'] = ['name' => '根源' , 'text' => $value['principle'] ?? '' , 'active' => false];
  374. $list[$key]['normalValue'] = ['name' => '正常值' , 'text' => $value['normalValue'] ?? '' , 'active' => false];
  375. $list[$key]['clinicalSignificance'] = ['name' => '临床意义' , 'text' => $value['clinicalSignificance'] ?? '' , 'active' => false];
  376. $list[$key]['reagent'] = ['name' => '试剂' , 'text' => $value['reagent'] ?? '' , 'active' => false];
  377. $list[$key]['operation'] = ['name' => '操作方法' , 'text' => $value['operation'] ?? '' , 'active' => false];
  378. }
  379. break;
  380. case "zysickness":
  381. $query = "match (n:SickNess {name:"."'".$department."'"."}) return n skip $limit limit 20";
  382. $data = $this->getAboutInfo($query , 'zy');
  383. $data = array_column($data , 'n');
  384. $query_count = "match (n:SickNess {name:"."'".$department."'"."}) return count(n) as count";
  385. $count = $this->getTotalCount($query_count , 'zy');
  386. foreach ($data as $key => $value) {
  387. $list[$key]['sickness_name'] = $value['dialecticalName'];
  388. //$list[$key]['name'] = ['name' => '疾病名称' , 'text' => $value['name'] ?? '' , 'active' => false];
  389. $list[$key]['symptom'] = ['name' => '症见' , 'text' => $value['symptom'] ?? '' , 'active' => true];
  390. $list[$key]['apparatus'] = ['name' => '发病部位' , 'text' => $value['apparatus'] ?? '' , 'active' => false];
  391. $list[$key]['dialecticalName'] = ['name' => '证型' , 'text' => $value['dialecticalName'] ?? '' , 'active' => false];
  392. $list[$key]['tongueCondition'] = ['name' => '舌象' , 'text' => $value['tongueCondition'] ?? '' , 'active' => false];
  393. $list[$key]['pulseCondition'] = ['name' => '脉象' , 'text' => $value['pulseCondition'] ?? '' , 'active' => false];
  394. $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
  395. $list[$key]['therapeuticMethod'] = ['name' => '治法原则' , 'text' => $value['therapeuticMethod'] ?? '' , 'active' => false];
  396. $list[$key]['cnPatentMedicine'] = ['name' => '中成药' , 'text' => $value['cnPatentMedicine'] ?? '' , 'active' => false];
  397. $list[$key]['dietTherapy'] = ['name' => '中医食疗法' , 'text' => $value['dietTherapy'] ?? '' , 'active' => false];
  398. $list[$key]['tonicDiet'] = ['name' => '中医药膳' , 'text' => $value['tonicDiet'] ?? '' , 'active' => false];
  399. $list[$key]['acupuncturePoints'] = ['name' => '针灸穴位' , 'text' => $value['acupuncturePoints'] ?? '' , 'active' => false];
  400. $list[$key]['kgid'] = ['name' => 'kgid' , 'text' => $value['kgid'] ?? '' , 'active' => false];
  401. }
  402. break;
  403. case "icd10":
  404. $query = "match (n:SickNess {ICD10:"."'".$department."'"."}) return n skip $limit limit 20";
  405. $data = $this->getAboutInfo($query , 'zy');
  406. $data = array_column($data , 'n');
  407. $query_count = "match (n:SickNess {name:"."'".$department."'"."}) return count(n) as count";
  408. $count = $this->getTotalCount($query_count , 'zy');
  409. foreach ($data as $key => $value) {
  410. $list[$key]['sickness_name'] = $value['dialecticalName'];
  411. //$list[$key]['name'] = ['name' => '疾病名称' , 'text' => $value['name'] ?? '' , 'active' => false];
  412. $list[$key]['symptom'] = ['name' => '症见' , 'text' => $value['symptom'] ?? '' , 'active' => true];
  413. $list[$key]['apparatus'] = ['name' => '发病部位' , 'text' => $value['apparatus'] ?? '' , 'active' => false];
  414. $list[$key]['dialecticalName'] = ['name' => '证型' , 'text' => $value['dialecticalName'] ?? '' , 'active' => false];
  415. $list[$key]['tongueCondition'] = ['name' => '舌象' , 'text' => $value['tongueCondition'] ?? '' , 'active' => false];
  416. $list[$key]['pulseCondition'] = ['name' => '脉象' , 'text' => $value['pulseCondition'] ?? '' , 'active' => false];
  417. $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
  418. $list[$key]['therapeuticMethod'] = ['name' => '治法原则' , 'text' => $value['therapeuticMethod'] ?? '' , 'active' => false];
  419. $list[$key]['cnPatentMedicine'] = ['name' => '中成药' , 'text' => $value['cnPatentMedicine'] ?? '' , 'active' => false];
  420. $list[$key]['dietTherapy'] = ['name' => '中医食疗法' , 'text' => $value['dietTherapy'] ?? '' , 'active' => false];
  421. $list[$key]['tonicDiet'] = ['name' => '中医药膳' , 'text' => $value['tonicDiet'] ?? '' , 'active' => false];
  422. $list[$key]['acupuncturePoints'] = ['name' => '针灸穴位' , 'text' => $value['acupuncturePoints'] ?? '' , 'active' => false];
  423. $list[$key]['kgid'] = ['name' => 'kgid' , 'text' => $value['kgid'] ?? '' , 'active' => false];
  424. }
  425. break;
  426. case "zcy":
  427. $query = "match(n:CnPatentMedicine {classification:"."'".$department."'"."}) return n skip $limit limit 20";
  428. $data = $this->getAboutInfo($query , 'zy');
  429. $data = array_column($data , 'n');
  430. $query_count = "match(n:CnPatentMedicine {classification:"."'".$department."'"."}) return count(n) as count";
  431. $count = $this->getTotalCount($query_count , 'zy');
  432. $list = [];
  433. foreach ($data as $key => $value) {
  434. $list[$key]['name'] = $value['name'];
  435. $list[$key]['classification'] = ['name' => '实体值' , 'text' => $value['classification'] ?? '' , 'active' => true];
  436. $list[$key]['efficacy'] = ['name' => '功效' , 'text' => $value['efficacy'] ?? '' , 'active' => false];
  437. $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
  438. $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
  439. }
  440. break;
  441. case "jl":
  442. $query = "match(n:ChannelCollateral {name:"."'".$department."'"."}) return n skip $limit limit 20";
  443. $data = $this->getAboutInfo($query , 'zy');
  444. $data = array_column($data , 'n');
  445. $query_count = "match(n:ChannelCollateral {name:"."'".$department."'"."}) return count(n) as count";
  446. $count = $this->getTotalCount($query_count , 'zy');
  447. $list = [];
  448. foreach ($data as $key => $value)
  449. {
  450. $list[$key]['name'] = $value['name'];
  451. $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['aponeuroticSystem'] ?? '' , 'active' => true];
  452. $list[$key]['channelSymptom'] = ['name' => '经脉循行及其病候' , 'text' => $value['channelSymptom'] ?? '' , 'active' => false];
  453. $list[$key]['collateralSymptom'] = ['name' => '络脉循行及其病候' , 'text' => $value['collateralSymptom'] ?? '' , 'active' => false];
  454. $list[$key]['divergentMeridian'] = ['name' => '经别循行' , 'text' => $value['divergentMeridian'] ?? '' , 'active' => false];
  455. $list[$key]['aponeuroticSystem'] = ['name' => '经筋循行及其病候' , 'text' => $value['aponeuroticSystem'] ?? '' , 'active' => false];
  456. $list[$key]['clinicalFeature'] = ['name' => '经络症状主要临床表现' , 'text' => $value['clinicalFeature'] ?? '' , 'active' => false];
  457. $list[$key]['mechanismAnalysis'] = ['name' => '经络病机分析' , 'text' => $value['mechanismAnalysis'] ?? '' , 'active' => false];
  458. $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
  459. $list[$key]['kgid'] = ['name' => 'kgid' , 'text' => $value['kgid'] ?? '' , 'active' => false];
  460. }
  461. break;
  462. case "symptom":
  463. $query = "match(n:Thing)-[r:LinkLocation]-(m:Symptom) where n.name="."'".$department."'"." return m skip $limit limit $pagesize";
  464. $data = $this->getAboutInfo($query);
  465. $data = array_column($data , 'm');
  466. $query_count = "match(n:Thing)-[r:LinkLocation]-(m:Symptom) where n.name="."'".$department."'"." return count(m) as count";
  467. $count = $this->getTotalCount($query_count);
  468. $list = [];
  469. foreach ($data as $key => $value)
  470. {
  471. $list[$key]['sickness_name'] = $value['name'];
  472. $list[$key]['identify'] = ['name' => '识别' , 'text' => $value['identify'] ?? '' , 'active' => true];
  473. $list[$key]['abstract'] = ['name' => '摘要' , 'text' => $value['abstract'] ?? '' , 'active' => false];
  474. $list[$key]['precaution'] = ['name' => '预防措施' , 'text' => $value['precaution'] ?? '' , 'active' => false];
  475. $list[$key]['inspection'] = ['name' => '检查' , 'text' => $value['inspection'] ?? '' , 'active' => false];
  476. $list[$key]['etiology'] = ['name' => '病理' , 'text' => $value['etiology'] ?? '' , 'active' => false];
  477. $list[$key]['department'] = ['name' => '科室' , 'text' => $value['department'] ?? '' , 'active' => false];
  478. }
  479. break;
  480. case "identify":
  481. $query = "match (n:Disease) where n.antidiastole is not null return
  482. n.name as name , n.antidiastole as antidiastole
  483. skip $limit limit 20";
  484. $data = $this->getAboutInfo($query);
  485. $query_count = "match (n:Disease) return count(n) as count";
  486. $count = $this->getTotalCount($query_count);
  487. foreach ($data as $key => $value) {
  488. $list[$key]['sickness_name'] = $value['name'];
  489. $list[$key]['antidiastole'] = ['name' => '鉴别诊断' , 'text' => $value['antidiastole'] ?? '' , 'active' => true];
  490. }
  491. break;
  492. case "clinicalPathway":
  493. $like = Request::param('like_name') ?? '';
  494. if($like) {
  495. $ClinicalPathway = ClinicalPathway::where("clinical_pathway" , "like" , "%$like%" )->limit($limit , $pagesize)->select();
  496. $count = ClinicalPathway::where("clinical_pathway" , "like" , "%$like%" )->count();
  497. } else {
  498. $ClinicalPathway = ClinicalPathway::limit($limit , $pagesize)->select();
  499. $count = ClinicalPathway::count();
  500. }
  501. foreach ($ClinicalPathway as $key => $value) {
  502. $ClinicalPathway[$key]['file'] = $this->checkDocPdfIsExist('https://zskweb.jiankangche.cn/lcfiles/pdf2/lcpdf/lc/'.$value['clinical_pathway'].'.pdf');
  503. }
  504. return $this->_json_succ(['list' => $ClinicalPathway , 'count' => $count]);
  505. break;
  506. case "clinicTrial":
  507. $like = Request::param('like_name') ?? '';
  508. if($like) {
  509. $ClinicalTrial = ClinicalTrial::where("drug_name" , "like" , "%$like%" )
  510. ->whereOr("adaptation_disease" , "like" , "%$like%" )
  511. ->whereOr("experimental_popular_topic" , "like" , "%$like%" )
  512. ->limit($limit , $pagesize)->select();
  513. $count = ClinicalTrial::where("drug_name" , "like" , "%$like%" )->count();
  514. } else {
  515. $ClinicalTrial = ClinicalTrial::limit($limit , $pagesize)->select();
  516. $count = ClinicalTrial::count();
  517. }
  518. foreach ($ClinicalTrial as $key => $value) {
  519. $ClinicalTrial[$key]['file'] = $this->checkDocPdfIsExist('https://zskweb.jiankangche.cn/lcfiles/pdf2/docs/'.$value['register_number'].'.pdf');
  520. }
  521. return $this->_json_succ(['list' => $ClinicalTrial , 'count' => $count]);
  522. break;
  523. default:
  524. return $this->_json_error('请求有误!');
  525. break;
  526. }
  527. return $this->_json_succ(['list' => $list , 'count' => $count]);
  528. }
  529. private function checkDocPdfIsExist($url)
  530. {
  531. $check = get_headers($url);
  532. if(strstr($check[0] , '200')) {
  533. return $url;
  534. }
  535. return "";
  536. }
  537. private function getSicknessComplication($name , $tag)
  538. {
  539. $querydisease = "match p = (n:Disease)-[r:DiseaseComplication]->(m:Thing) where n.name= "."'".$name."'"." return p";
  540. $querysickness = "match p = (n:SickNess)-[r:SicknessComplication]->(m:Thing) where n.name= "."'".$name."'"." return p";
  541. $query = $tag == 'sickness' ? $querysickness : $querydisease;
  542. $result = $this->getComplication($query);
  543. if(!empty($result)) {
  544. foreach ($result as $key => $value) {
  545. if($name == $value['properties']) {
  546. unset($result[$key]);
  547. }
  548. }
  549. $complications = array_column($result , 'properties') ?? '';
  550. return ['name' => $complications , 'tag' => $tag];
  551. } else {
  552. return $complications = [];
  553. }
  554. }
  555. private function getZyRelationship($kgid , $tag)
  556. {
  557. $name = $kgid ?? '4d839135f8627092b95602acf6dbb5237fadab9419bc88f2199ad7fe2d90ae31';
  558. switch ($tag) {
  559. case "fj":
  560. $query = "match p = (n:SickNess)-[r:LinkPrescription]->(m:Thing) where n.kgid= "."'".$name."'"." return p";
  561. break;
  562. case "ys":
  563. $query = "match p = (n:SickNess)-[r:LinkTonicDiet]->(m:Thing) where n.kgid= "."'".$name."'"." return p";
  564. break;
  565. case "zcy":
  566. $query = "match p = (n:SickNess)-[r:LinkCnPatentMedicine]->(m:Thing) where n.kgid= "."'".$name."'"." return p";
  567. break;
  568. }
  569. $result = $this->getComplication($query , 'zy');
  570. $arr = array_column($result , 'properties') ?? '';
  571. if(empty($arr)) {
  572. return '';
  573. }
  574. return ['name' => $arr , 'tag' => $tag];
  575. }
  576. // 详情
  577. public function sickNessDetail()
  578. {
  579. //if(!$this->checkIslogin()) return $this->_json_error('请登录后查看!');
  580. $sickness = Request::param('sickness');
  581. $tag = Request::param('tag') ?? 'sickness';
  582. switch ($tag)
  583. {
  584. case "sickness":
  585. $query = "match(n:SickNess{name:"."'".$sickness."'"."})-[r:LInkeMedicineSickness]-(m:Medicine) return m.name as name limit 10";
  586. $medicine = $this->getAboutInfo($query);
  587. if($medicine) {
  588. $medicine = array_column($medicine , 'name');
  589. //$medicine = join(',' , $medicine);
  590. $medicine = ['name' => $medicine , 'tag' => 'medicine'];
  591. }
  592. $query_1 = "match(n:SickNess{name : "."'".$sickness."'"."}) return n";
  593. $info = array_column($this->getAboutInfo($query_1) , 'n');
  594. $data = [
  595. 'sickness_name' => ['name' => '名称' , 'text' => $info[0]['name'] ??''],
  596. 'alias' => ['name' => '疾病别名' , 'text' => $info[0]['alias'] ?? ''],
  597. 'ICD10' => ['name' => 'ICD10' , 'text' => $info[0]['ICD10'] ?? ''],
  598. 'department' => ['name' => '疾病类别' , 'text' => $info[0]['department'] ?? ''],
  599. 'complication' => ['name' => '并发症' , 'text' => $this->getSicknessComplication($sickness , 'sickness') ?? ''],
  600. 'medicine' => ['name' => '相关药品' , 'text' => $medicine ?? ''] ,
  601. 'introduction' => ['name' => '疾病概述' , 'text' => $info[0]['introduction'] ?? ''],
  602. 'epidemiology' => ['name' => '流行病学' , 'text' => $info[0]['epidemiology'] ?? ''],
  603. 'suitableFood' => ['name' => '宜吃食物' , 'text' => $info[0]['suitableFood'] ?? ''],
  604. 'notEat' => ['name' => '忌吃食物' , 'text' => $info[0]['notEat'] ?? ''],
  605. 'diagnostiCtriage' => ['name' => '诊断鉴别' , 'text' => $info[0]['diagnostiCtriage'] ?? ''],
  606. 'precaution' => ['name' => '预防' , 'text' => $info[0]['precaution'] ?? ''],
  607. 'nursingInfo' => ['name' => '护理信息' , 'text' => $info[0]['nursingInfo'] ?? ''],
  608. 'warmPrompt' => ['name' => '温馨提示' , 'text' => $info[0]['warmPrompt'] ?? ''],
  609. 'recommendedRecipe' => ['name' => '推荐食谱' , 'text' => $info[0]['recommendedRecipe'] ?? ''],
  610. 'treatmentOverview' => ['name' => '治疗概述' , 'text' => $info[0]['treatmentOverview'] ?? ''],
  611. 'inspection' => ['name' => '检查' , 'text' => $info[0]['inspection'] ?? ''],
  612. 'treatmenCommonSense' => ['name' => '治疗常识' , 'text' => $info[0]['treatmenCommonSense'] ?? ''],
  613. 'pathogenesis' => ['name' => '病因' , 'text' => $info[0]['pathogenesis'] ?? ''],
  614. 'basicKnowledgel' => ['name' => '基本常识' , 'text' => $info[0]['basicKnowledgel'] ?? ''],
  615. 'dietHealth' => ['name' => '饮食保健' , 'text' => $info[0]['dietHealth'] ?? ''],
  616. 'symptom' => ['name' => '证型' , 'text' => $info[0]['symptom'] ?? ''],
  617. 'complicationsOverview' => ['name' => '并发症概述', 'text' => $info[0]['complicationsOverview'] ?? ''],
  618. 'treatmentInfo' => ['name' => '治疗信息' , 'text' => $info[0]['treatmentInfo'] ?? ''],
  619. ];
  620. break;
  621. case "disease":
  622. $query = "match(n:Disease{name : "."'".$sickness."'"."}) return n";
  623. $info = array_column($this->getAboutInfo($query) , 'n');
  624. $query1 = "match(n:Thing)-[r:LinkMedicineDisease]-(m:Disease {name:"."'".$sickness."'"."}) return n.name as name limit 10";
  625. $medicine = $this->getAboutInfo($query1) ?? '';
  626. if($medicine) {
  627. $medicine = array_column($medicine , 'name');
  628. $medicine = ['name' => $medicine , 'tag' => 'medicine'];
  629. }
  630. $query2 = "match (n:Disease)-[r:LinkInspection]-(m:Thing) where n.name= "."'".$sickness."'"." return m.name as name limit 10";
  631. $inspection = $this->getAboutInfo($query2) ?? '';
  632. if($inspection) {
  633. $inspection = array_column($inspection , 'name');
  634. $inspection = ['name' => $inspection , 'tag' => 'inspection'];
  635. }
  636. $data = [
  637. 'sickness_name' => ['name' => '名称' , 'text' => $info[0]['name'] ??''],
  638. 'alias' => ['name' => '疾病别名' , 'text' => $info[0]['alias'] ?? ''],
  639. 'icd' => ['name' => 'ICD号' , 'text' => $info[0]['icd'] ?? ''],
  640. 'department' => ['name' => '疾病类别' , 'text' => $info[0]['department'] ?? ''],
  641. 'complication' => ['name' => '并发症' , 'text' => $this->getSicknessComplication($sickness , 'disease') ?? ''],
  642. 'epidemiology' => ['name' => '流行病学' , 'text' => $info[0]['epidemiology'] ?? ''],
  643. 'nameEn' => ['name' => '英文名称' , 'text' => $info[0]['nameEn'] ?? ''],
  644. 'sickOverview' => ['name' => '疾病概述' , 'text' => $info[0]['sickOverview'] ?? ''],
  645. 'clinicalFeature' => ['name' => '临床表现' , 'text' => $info[0]['clinicalFeature'] ?? ''],
  646. 'diagnosis' => ['name' => '诊断' , 'text' => $info[0]['diagnosis'] ?? ''],
  647. 'treatment' => ['name' => '治疗' , 'text' => $info[0]['treatment'] ?? ''],
  648. 'regularMedication' => ['name' => '相关药品' , 'text' => $medicine ?? []],
  649. 'pathogenesis' => ['name' => '发病机制' , 'text' => $info[0]['pathogenesis'] ?? ''],
  650. 'inspection' => ['name' => '相关检查' , 'text' => $inspection ?? []],
  651. 'laboratoryInspection' => ['name' => '实验室检查' , 'text' => $info[0]['laboratoryInspection'] ?? ''],
  652. 'etiology' => ['name' => '病因' , 'text' => $info[0]['etiology'] ?? ''],
  653. 'auxiliaryExamination' => ['name' => '其他辅助检查' , 'text' => $info[0]['auxiliaryExamination'] ?? ''],
  654. 'prognosis' => ['name' => '预后' , 'text' => $info[0]['prognosis'] ?? ''],
  655. 'complicationsOverview' => ['name' => '并发症概述' , 'text' => $info[0]['complicationsOverview'] ?? ''],
  656. 'precaution' => ['name' => '预防' , 'text' => $info[0]['precaution'] ?? ''],
  657. ];
  658. break;
  659. case "medicine":
  660. $query = "match(n:MedicineProduction {name : "."'".$sickness."'"."}) return n";
  661. $data = array_column($this->getAboutInfo($query) , 'n');
  662. $data = [
  663. 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ??''],
  664. 'pinyi' => ['name' => '汉语拼音' , 'text' => $data[0]['pinyin'] ?? ''],
  665. 'oldUse' => ['name' => '老人用药' , 'text' => $data[0]['oldUse'] ?? ''],
  666. 'chilldUse' => ['name' => '儿童用药' , 'text' => $data[0]['chilldUse'] ?? ''],
  667. 'medicinePregnant' => ['name' => '孕妇及哺乳期妇女用药' , 'text' => $data[0]['medicinePregnant'] ?? ''],
  668. 'usageDosage' => ['name' => '用法用量' , 'text' => $data[0]['usageDosage'] ?? ''],
  669. 'notes' => ['name' => '注意事项' , 'text' => $data[0]['notes'] ?? ''],
  670. 'periodValidity' => ['name' => '有效期' , 'text' => $data[0]['periodValidity'] ?? ''],
  671. 'indication' => ['name' => '适应症' , 'text' => $data[0]['indication'] ?? ''],
  672. 'storage' => ['name' => '贮藏' , 'text' => $data[0]['storage'] ?? ''],
  673. 'character' => ['name' => '性状' , 'text' => $data[0]['character'] ?? ''],
  674. 'contraindication' => ['name' => '禁忌' , 'text' => $data[0]['contraindication'] ?? ''],
  675. 'pharmacologyToxicology'=> ['name' => '药理毒理' , 'text' => $data[0]['pharmacologyToxicology'] ?? ''],
  676. 'specification' => ['name' => '规格' , 'text' => $data[0]['specification'] ?? ''],
  677. 'approvalNumber' => ['name' => '批准号' , 'text' => $data[0]['approvalNumber'] ?? ''],
  678. 'productionEnterprise' => ['name' => '生产企业' , 'text' => $data[0]['productionEnterprise'] ?? ''],
  679. 'relateSick' => ['name' => '相关疾病' , 'text' => $data[0]['relateSick'] ?? ''],
  680. 'untowardEffect' => ['name' => '不良反应' , 'text' => $data[0]['untowardEffect'] ?? ''],
  681. 'majorConstituent' => ['name' => '主要成分' , 'text' => $data[0]['majorConstituent'] ?? ''],
  682. ];
  683. break;
  684. case "inspection":
  685. $query = "match (n:Inspection {name : "."'".$sickness."'"."}) return n";
  686. $data = array_column($this->getAboutInfo($query) , 'n');
  687. $data = [
  688. 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
  689. 'overview' => ['name' => '概述' , 'text' => $data[0]['overview'] ?? ''],
  690. 'annotation' => ['name' => '附注' , 'text' => $data[0]['annotation'] ?? ''],
  691. 'principle' => ['name' => '原理' , 'text' => $data[0]['principle'] ?? ''],
  692. 'normalValue' => ['name' => '正常值' , 'text' => $data[0]['normalValue'] ?? ''],
  693. 'clinicalSignificance' => ['name' => '临床意义' , 'text' => $data[0]['clinicalSignificance'] ?? ''],
  694. 'reagent' => ['name' => '试剂' , 'text' => $data[0]['reagent'] ?? ''],
  695. 'operation' => ['name' => '操作方法' , 'text' => $data[0]['operation'] ?? ''],
  696. ];
  697. break;
  698. case "zysickness":
  699. case "icd10":
  700. $query = "match(n:SickNess {kgid:"."'".$sickness."'"."}) return n";
  701. $data = $this->getAboutInfo($query , 'zy');
  702. $data = array_column($data , 'n');
  703. $data = [
  704. 'dialecticalName' => ['name' => '证型' , 'text' => $data[0]['dialecticalName'] ?? ''],
  705. 'ICD10' => ['name' => 'ICD10' , 'text' => $data[0]['ICD10'] ?? ''],
  706. 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
  707. 'fj' => ['name' => '方剂' , 'text' => $this->getZyRelationship($data[0]['kgid'] , 'fj') ?? ''],
  708. 'ys' => ['name' => '药膳' , 'text' => $this->getZyRelationship($data[0]['kgid'] , 'ys') ?? ''],
  709. 'zcy' => ['name' => '中成药' , 'text' => $this->getZyRelationship($data[0]['kgid'] , 'zcy') ?? ''],
  710. 'tongueCondition' => ['name' => '舌象' , 'text' => $data[0]['tongueCondition'] ?? ''],
  711. 'apparatus' => ['name' => '发病部位' , 'text' => $data[0]['apparatus'] ?? ''],
  712. 'source' => ['name' => '数据来源' , 'text' => $data[0]['source'] ?? ''],
  713. 'pulseCondition' => ['name' => '脉象' , 'text' => $data[0]['pulseCondition'] ?? ''],
  714. 'dietTherapy' => ['name' => '饮食疗法' , 'text' => $data[0]['dietTherapy'] ?? ''],
  715. 'symptom' => ['name' => '症见' , 'text' => $data[0]['symptom'] ?? ''],
  716. 'department' => ['name' => '科室' , 'text' => $data[0]['department'] ?? ''],
  717. 'acupuncturePoints' => ['name' => '针灸穴位' , 'text' => $data[0]['acupuncturePoints'] ?? ''],
  718. 'therapeuticMethod' => ['name' => '治疗方法' , 'text' => $data[0]['therapeuticMethod'] ?? ''],
  719. 'kgid' => ['name' => 'kgid' , 'text' => $data[0]['kgid'] ?? ''],
  720. ];
  721. break;
  722. case "zy":
  723. // 中药详情
  724. $query = "match(n:CnMedicinalCrop {kgid:"."'".$sickness."'"."}) return n";
  725. $data = $this->getAboutInfo($query , 'zy');
  726. $data = array_column($data , 'n');
  727. $data = [
  728. 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
  729. 'toxicity' => ['name' => '毒性' , 'text' => $data[0]['toxicity'] ?? ''],
  730. 'indications' => ['name' => '功能主治' , 'text' => $data[0]['indications'] ?? ''],
  731. 'source' => ['name' => '来源' , 'text' => $data[0]['source'] ?? ''],
  732. 'medicineProperty' => ['name' => '药理作用' , 'text' => $data[0]['medicineProperty'] ?? ''],
  733. 'includedIn' => ['name' => '收录于' , 'text' => $data[0]['includedIn'] ?? ''],
  734. 'kgid' => ['name' => 'kgid' , 'text' => $data[0]['kgid'] ?? ''],
  735. ];
  736. break;
  737. case "zcy":
  738. $query = "match(n:CnPatentMedicine {name:"."'".$sickness."'"."}) return n";
  739. $data = $this->getAboutInfo($query , 'zy');
  740. $data = array_column($data , 'n');
  741. $data = [
  742. 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
  743. 'classification' => ['name' => '分类' , 'text' => $data[0]['classification'] ?? ''],
  744. 'efficacy' => ['name' => '功效' , 'text' => $data[0]['efficacy'] ?? ''],
  745. 'indications' => ['name' => '主治' , 'text' => $data[0]['indications'] ?? ''],
  746. 'source' => ['name' => '数据来源' , 'text' => $data[0]['source'] ?? ''],
  747. ];
  748. break;
  749. case "fj":
  750. $query = "match(n:Prescription {name:"."'".$sickness."'"."}) return n";
  751. $data = $this->getAboutInfo($query , 'zy');
  752. $data = array_column($data , 'n');
  753. $data = [
  754. 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
  755. 'composition' => ['name' => '方剂组成' , 'text' => $data[0]['composition'] ?? ''],
  756. 'medicinalCrop' => ['name' => '中药' , 'text' => $data[0]['medicinalCrop'] ?? ''],
  757. 'indications' => ['name' => '主治' , 'text' => $data[0]['indications'] ?? ''],
  758. 'solution' => ['name' => '方法/解法' , 'text' => $data[0]['solution'] ?? ''],
  759. 'usageDosage' => ['name' => '用法用量' , 'text' => $data[0]['usageDosage'] ?? ''],
  760. 'source' => ['name' => '数据来源' , 'text' => $data[0]['source'] ?? ''],
  761. ];
  762. break;
  763. case "ys":
  764. // 中医药膳
  765. $query = "match(n:TonicDiet {name:"."'".$sickness."'"."}) return n";
  766. $data = $this->getAboutInfo($query , 'zy');
  767. $data = array_column($data , 'n');
  768. // 获取药膳对应疾病 LinkTonicDiet
  769. $query1 = "match(n:Thing{name:"."'".$sickness."'"."})-[r:LinkTonicDiet]-(m:SickNess) return m.name as name , m.kgid as kgid limit 10";
  770. $getSicknessByLinkTonicDiet = $this->getAboutInfo($query1 , 'zy');
  771. foreach ($getSicknessByLinkTonicDiet as $key => $value) {
  772. $getSicknessByLinkTonicDiet[$key]['name'] = $getSicknessByLinkTonicDiet[$key]['name'].'-'. $getSicknessByLinkTonicDiet[$key]['kgid'];
  773. }
  774. if($getSicknessByLinkTonicDiet) {
  775. $sickNesss = array_column($getSicknessByLinkTonicDiet , 'name');
  776. foreach ($sickNesss as $k => $v) {
  777. $array = explode('-' , $v);
  778. $sickNessses[] = ['name' => $array[0] , 'kgid' => $array[1]];
  779. }
  780. $sickNesss = ['name' => $sickNessses , 'tag' => 'zysickness'];
  781. } else {
  782. $sickNesss = [];
  783. }
  784. $data = [
  785. 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
  786. 'composition' => ['name' => '药膳组成' , 'text' => $data[0]['composition'] ?? ''],
  787. 'sickness' => ['name' => '疾病' , 'text' => $sickNesss]
  788. ];
  789. break;
  790. case 'tz':
  791. $query = "match(n:Constitution {name:"."'".$sickness."'"."}) return n";
  792. $data = $this->getAboutInfo($query , 'zy');
  793. $data = array_column($data , 'n');
  794. $data = [
  795. 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
  796. 'overallFeature' => ['name' => '总体特征' , 'text' => $data[0]['overallFeature'] ?? ''],
  797. 'psychologicalFeature' => ['name' => '心理特征' , 'text' => $data[0]['psychologicalFeature'] ?? ''],
  798. 'commonPerformance' => ['name' => '常见表现' , 'text' => $data[0]['commonPerformance'] ?? ''],
  799. 'tendency' => ['name' => '发病倾向' , 'text' => $data[0]['tendency'] ?? ''],
  800. 'exercise' => ['name' => '体育锻炼' , 'text' => $data[0]['exercise'] ?? ''],
  801. 'meridianHealth' => ['name' => '经络保健' , 'text' => $data[0]['meridianHealth'] ?? ''],
  802. 'medicineRegimen' => ['name' => '药物养生' , 'text' => $data[0]['medicineRegimen'] ?? ''],
  803. 'dietTherapy' => ['name' => '宜食疗' , 'text' => $data[0]['dietTherapy'] ?? ''],
  804. 'notEat' => ['name' => '不宜吃' , 'text' => $data[0]['notEat'] ?? ''],
  805. ];
  806. break;
  807. case 'jl':
  808. $query = "match(n:ChannelCollateral {kgid:"."'".$sickness."'"."}) return n";
  809. $data = $this->getAboutInfo($query , 'zy');
  810. $data = array_column($data , 'n');
  811. $data = [
  812. 'sickness_name' => ['name' => '经络' , 'text' => $data[0]['name'] ?? ''],
  813. 'indications' => ['name' => '主治' , 'text' => $data[0]['indications'] ?? ''],
  814. 'channelSymptom' => ['name' => '经脉循行及其病候' , 'text' => $data[0]['channelSymptom'] ?? ''],
  815. 'collateralSymptom' => ['name' => '络脉循行及其病候' , 'text' => $data[0]['collateralSymptom'] ?? ''],
  816. 'divergentMeridian' => ['name' => '经别循行' , 'text' => $data[0]['divergentMeridian'] ?? ''],
  817. 'aponeuroticSystem' => ['name' => '经筋循行及其病候' , 'text' => $data[0]['aponeuroticSystem'] ?? ''],
  818. 'clinicalFeature' => ['name' => '经络症状主要临床表现', 'text' => $data[0]['clinicalFeature'] ?? ''],
  819. 'mechanismAnalysis' => ['name' => '经络病机分析' , 'text' => $data[0]['mechanismAnalysis'] ?? ''],
  820. 'source' => ['name' => '数据来源' , 'text' => $data[0]['source'] ?? ''],
  821. ];
  822. break;
  823. case 'xw':
  824. $query = "match(n:Acupoint {name:"."'".$sickness."'"."}) return n";
  825. $data = $this->getAboutInfo($query , 'zy');
  826. $data = array_column($data , 'n');
  827. $data = [
  828. 'sickness_name' => ['name' => '穴位' , 'text' => $data[0]['name'] ?? ''],
  829. 'location' => ['name' => '定位' , 'text' => $data[0]['location'] ?? ''],
  830. 'indications' => ['name' => '主治' , 'text' => $data[0]['indications'] ?? ''],
  831. 'compatibility' => ['name' => '配伍' , 'text' => $data[0]['compatibility'] ?? ''],
  832. 'acupuncture' => ['name' => '针灸法' , 'text' => $data[0]['acupuncture'] ?? ''],
  833. 'notions' => ['name' => '附注' , 'text' => $data[0]['notions'] ?? ''],
  834. ];
  835. break;
  836. case "symptom":
  837. $query = "match(n:Symptom {name:"."'".$sickness."'"."}) return n";
  838. $data = $this->getAboutInfo($query);
  839. $data = array_column($data , 'n');
  840. // 医疗症状关系
  841. $query1 = "match(n:Thing)-[r:LinkDiseaseSymptom]-(m:Disease) where n.name="."'".$sickness."'"." return m.name as name";
  842. $data2 = $this->getAboutInfo($query1) ?? '';
  843. if($data2) {
  844. $diseaseSymptoms = array_column($data2 , 'name');
  845. $diseaseSymptoms = ['name' => $diseaseSymptoms , 'tag' => 'disease'];
  846. }
  847. $data = [
  848. 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
  849. 'identify' => ['name' => '识别' , 'text' => $data[0]['identify'] ?? ''],
  850. 'abstract' => ['name' => '摘要' , 'text' => $data[0]['abstract'] ?? ''],
  851. 'precaution' => ['name' => '预防措施' , 'text' => $data[0]['precaution'] ?? ''],
  852. 'inspection' => ['name' => '检查' , 'text' => $data[0]['inspection'] ?? ''],
  853. 'diseaseSymptoms' => ['name' => '症状疾病' , 'text' => $diseaseSymptoms ?? []],
  854. 'etiology' => ['name' => '病理' , 'text' => $data[0]['etiology'] ?? ''],
  855. 'department' => ['name' => '科室' , 'text' => $data[0]['department'] ?? ''],
  856. ];
  857. break;
  858. }
  859. return $this->_json_succ($data);
  860. }
  861. // 详情图谱
  862. public function detailGraph()
  863. {
  864. //if(!$this->checkIslogin()) return $this->_json_error('请登录后查看!');
  865. $tag = Request::param('tag') ?? 'disease';
  866. $name = Request::param('name') ?? '肠道革兰阴性杆菌脑膜炎';
  867. switch ($tag)
  868. {
  869. case 'disease':
  870. $query = "match p = (n:Disease)-[r:DiseaseComplication]-(m:Thing) where n.name= "."'".$name."'"." return p";
  871. $query1 = "match p1 = (n:Disease)-[r:LinkMedicineDisease]-(m:Thing) where n.name= "."'".$name."'"." return p1";
  872. $query2 = "match p2 = (n:Disease)-[r:LinkInspection]-(m:Thing) where n.name= "."'".$name."'"." return p2";
  873. $data = $this->getXyR($query , $query1 , $query2);
  874. $list = [];
  875. foreach ($data as $key => $value) {
  876. $list['icd'] = ['name' => 'ICD' , 'text' => $data[$key]['start']['properties']['icd'] ?? ''];
  877. $list['name'] = ['name' => '名称' , 'text' => $data[$key]['start']['properties']['name'] ?? ''];
  878. $list['alias'] = ['name' => '疾病别名' , 'text' => $data[$key]['start']['properties']['alias'] ?? ''];
  879. $list['department'] = ['name' => '疾病类别' , 'text' => $data[$key]['start']['properties']['department'] ?? ''];
  880. $list['complication'] = ['name' => '并发症' , 'text' => $data[$key]['start']['properties']['complication'] ?? ''];
  881. $list['epidemiology'] = ['name' => '流行病学' , 'text' => $data[$key]['start']['properties']['epidemiology'] ?? ''];
  882. $list['nameEn'] = ['name' => '英文名称' , 'text' => $data[$key]['start']['properties']['nameEn'] ?? ''];
  883. $list['sickOverview'] = ['name' => '疾病概述' , 'text' => $data[$key]['start']['properties']['sickOverview'] ?? ''];
  884. $list['clinicalFeature'] = ['name' => '临床表现' , 'text' => $data[$key]['start']['properties']['clinicalFeature'] ?? ''];
  885. $list['diagnosis'] = ['name' => '诊断' , 'text' => $data[$key]['start']['properties']['diagnosis'] ?? ''];
  886. $list['treatment'] = ['name' => '治疗' , 'text' => $data[$key]['start']['properties']['treatment'] ?? ''];
  887. $list['regularMedication'] = ['name' => '相关药品' , 'text' => $data[$key]['start']['properties']['regularMedication'] ?? ''];
  888. $list['pathogenesis'] = ['name' => '发病机制' , 'text' => $data[$key]['start']['properties']['pathogenesis'] ?? ''];
  889. $list['inspection'] = ['name' => '相关检查' , 'text' => $data[$key]['start']['properties']['inspection'] ?? ''];
  890. $list['laboratoryInspection'] = ['name' => '实验室检查' , 'text' => $data[$key]['start']['properties']['laboratoryInspection'] ?? ''];
  891. $list['etiology'] = ['name' => '病因' , 'text' => $data[$key]['start']['properties']['etiology'] ?? ''];
  892. $list['auxiliaryExamination'] = ['name' => '其他辅助检查' , 'text' => $data[$key]['start']['properties']['auxiliaryExamination'] ?? ''];
  893. $list['prognosis'] = ['name' => '预后' , 'text' => $data[$key]['start']['properties']['prognosis'] ?? ''];
  894. $list['complicationsOverview'] = ['name' => '并发症概述' , 'text' => $data[$key]['start']['properties']['complicationsOverview'] ?? ''];
  895. $list['precaution'] = ['name' => '预防' , 'text' => $data[$key]['start']['properties']['precaution'] ?? ''];
  896. $data[$key]['start']['properties'] = $list;
  897. $data[$key]['start']['tag'] = $tag;
  898. if($value['relationship']['type'] == 'DISEASECOMPLICATION') {
  899. $listEnd = [
  900. 'name' => ['name' => '疾病名称' , 'text' => $data[$key]['end']['properties']['name']],
  901. ];
  902. $data[$key]['end']['properties'] = $listEnd;
  903. $data[$key]['end']['tag'] = $tag;
  904. }
  905. if($value['relationship']['type'] == 'LINKMEDICINEDISEASE') {
  906. $listEnd = [
  907. 'name' => ['name' => '名称' , 'text' =>$data[$key]['end']['properties']['name'] ?? ''],
  908. 'pinyi' => ['name' => '汉语拼音' , 'text' =>$data[$key]['end']['properties']['pinyin'] ?? ''],
  909. 'oldUse' => ['name' => '老人用药' , 'text' =>$data[$key]['end']['properties']['oldUse'] ?? ''],
  910. 'chilldUse' => ['name' => '儿童用药' , 'text' =>$data[$key]['end']['properties']['chilldUse'] ?? ''],
  911. 'medicinePregnant' => ['name' => '孕妇及哺乳期妇女用药' , 'text' =>$data[$key]['end']['properties']['medicinePregnant'] ?? ''],
  912. 'usageDosage' => ['name' => '用法用量' , 'text' =>$data[$key]['end']['properties']['usageDosage'] ?? ''],
  913. 'notes' => ['name' => '注意事项' , 'text' =>$data[$key]['end']['properties']['notes'] ?? ''],
  914. 'periodValidity' => ['name' => '有效期' , 'text' =>$data[$key]['end']['properties']['periodValidity'] ?? ''],
  915. 'indication' => ['name' => '适应症' , 'text' =>$data[$key]['end']['properties']['indication'] ?? ''],
  916. 'storage' => ['name' => '贮藏' , 'text' =>$data[$key]['end']['properties']['storage'] ?? ''],
  917. 'character' => ['name' => '性状' , 'text' =>$data[$key]['end']['properties']['character'] ?? ''],
  918. 'contraindication' => ['name' => '禁忌' , 'text' =>$data[$key]['end']['properties']['contraindication'] ?? ''],
  919. 'pharmacologyToxicology'=> ['name' => '药理毒理' , 'text' =>$data[$key]['end']['properties']['pharmacologyToxicology'] ?? ''],
  920. 'specification' => ['name' => '规格' , 'text' =>$data[$key]['end']['properties']['specification'] ?? ''],
  921. 'approvalNumber' => ['name' => '批准号' , 'text' =>$data[$key]['end']['properties']['approvalNumber'] ?? ''],
  922. 'productionEnterprise' => ['name' => '生产企业' , 'text' =>$data[$key]['end']['properties']['productionEnterprise'] ?? ''],
  923. 'relateSick' => ['name' => '相关疾病' , 'text' =>$data[$key]['end']['properties']['relateSick'] ?? ''],
  924. 'untowardEffect' => ['name' => '不良反应' , 'text' =>$data[$key]['end']['properties']['untowardEffect'] ?? ''],
  925. 'majorConstituent' => ['name' => '主要成分' , 'text' =>$data[$key]['end']['properties']['majorConstituent'] ?? ''],
  926. ];
  927. $data[$key]['end']['properties'] = $listEnd;
  928. $data[$key]['end']['tag'] = 'medicine';
  929. }
  930. if($value['relationship']['type'] == 'LINKINSPECTION') {
  931. $listEnd = [
  932. 'name' => ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''],
  933. 'overview' => ['name' => '概述' , 'text' => $data[$key]['end']['properties']['overview'] ?? ''],
  934. 'annotation' => ['name' => '附注' , 'text' => $data[$key]['end']['properties']['annotation'] ?? ''],
  935. 'principle' => ['name' => '原理' , 'text' => $data[$key]['end']['properties']['principle'] ?? ''],
  936. 'normalValue' => ['name' => '正常值' , 'text' => $data[$key]['end']['properties']['normalValue'] ?? ''],
  937. 'clinicalSignificance' => ['name' => '临床意义' , 'text' => $data[$key]['end']['properties']['clinicalSignificance'] ?? ''],
  938. 'reagent' => ['name' => '试剂' , 'text' => $data[$key]['end']['properties']['reagent'] ?? ''],
  939. 'operation' => ['name' => '操作方法' , 'text' => $data[$key]['end']['properties']['operation'] ?? ''],
  940. ];
  941. $data[$key]['end']['properties'] = $listEnd;
  942. $data[$key]['end']['tag'] = 'inspection';
  943. }
  944. }
  945. break;
  946. case 'sickness':
  947. $query = "match p = (n:SickNess)-[r:SicknessComplication]-(m:Thing) where n.name= "."'".$name."'"." return p";
  948. $query1 = "match p1 = (n:SickNess)-[r:LInkeMedicineSickness]-(m:Thing) where n.name= "."'".$name."'"." return p1";
  949. $data = $this->getXyR($query , $query1);
  950. $list = [];
  951. foreach ($data as $key => $value) {
  952. $list['ICD10'] = ['name' => 'ICD10' , 'text' => $data[$key]['start']['properties']['ICD10'] ?? ''];
  953. $list['name'] = ['name' => '名称' , 'text' => $data[$key]['start']['properties']['name'] ?? ''];
  954. $list['alias'] = ['name' => '疾病别名' , 'text' => $data[$key]['start']['properties']['alias'] ?? ''];
  955. $list['department'] = ['name' => '疾病类别' , 'text' => $data[$key]['start']['properties']['department'] ?? ''];
  956. $list['complication'] = ['name' => '并发症' , 'text' => $data[$key]['start']['properties']['complication'] ?? ''];
  957. $list['introduction'] = ['name' => '疾病概述' , 'text' => $data[$key]['start']['properties']['introduction'] ?? ''];
  958. $list['epidemiology'] = ['name' => '流行病学' , 'text' => $data[$key]['start']['properties']['epidemiology'] ?? ''];
  959. $list['suitableFood'] = ['name' => '宜吃食物' , 'text' => $data[$key]['start']['properties']['suitableFood'] ?? ''];
  960. $list['notEat'] = ['name' => '忌吃食物' , 'text' => $data[$key]['start']['properties']['notEat'] ?? ''];
  961. $list['diagnostiCtriage'] = ['name' => '诊断鉴别' , 'text' => $data[$key]['start']['properties']['diagnostiCtriage'] ?? ''];
  962. $list['precaution'] = ['name' => '预防' , 'text' => $data[$key]['start']['properties']['precaution'] ?? ''];
  963. $list['nursingInfo'] = ['name' => '护理信息' , 'text' => $data[$key]['start']['properties']['nursingInfo'] ?? ''];
  964. $list['warmPrompt'] = ['name' => '温馨提示' , 'text' => $data[$key]['start']['properties']['warmPrompt'] ?? ''];
  965. $list['recommendedRecipe'] = ['name' => '推荐食谱' , 'text' => $data[$key]['start']['properties']['recommendedRecipe'] ?? ''];
  966. $list['treatmentOverview'] = ['name' => '治疗概述' , 'text' => $data[$key]['start']['properties']['treatmentOverview'] ?? ''];
  967. $list['inspection'] = ['name' => '检查' , 'text' => $data[$key]['start']['properties']['inspection'] ?? ''];
  968. $list['treatmenCommonSense'] = ['name' => '治疗常识' , 'text' => $data[$key]['start']['properties']['treatmenCommonSense'] ?? ''];
  969. $list['pathogenesis'] = ['name' => '病因' , 'text' => $data[$key]['start']['properties']['pathogenesis'] ?? ''];
  970. $list['basicKnowledgel'] = ['name' => '基本常识' , 'text' => $data[$key]['start']['properties']['basicKnowledgel'] ?? ''];
  971. $list['dietHealth'] = ['name' => '饮食保健' , 'text' => $data[$key]['start']['properties']['dietHealth'] ?? ''];
  972. $list['symptom'] = ['name' => '检查' , 'text' => $data[$key]['start']['properties']['symptom'] ?? ''];
  973. $list['complicationsOverview'] = ['name' => '并发症概述' , 'text' => $data[$key]['start']['properties']['complicationsOverview'] ?? ''];
  974. $list['treatmentInfo'] = ['name' => '治疗信息' , 'text' => $data[$key]['start']['properties']['treatmentInfo'] ?? ''];
  975. $data[$key]['start']['properties'] = $list;
  976. $data[$key]['start']['tag'] = $tag;
  977. if($data[$key]['relationship']['type'] == 'SICKNESSCOMPLICATION') {
  978. $listEnd['name'] = ['name' => '疾病名称' , 'text' => $data[$key]['end']['properties']['name']];
  979. $data[$key]['end']['properties'] = $listEnd;
  980. $data[$key]['end']['tag'] = $tag;
  981. }
  982. if($data[$key]['relationship']['type'] == 'LINKEMEDICINESICKNESS') {
  983. $listEnd = [
  984. 'name' => ['name' => '名称' , 'text' =>$data[$key]['end']['properties']['name'] ?? ''],
  985. 'pinyi' => ['name' => '汉语拼音' , 'text' =>$data[$key]['end']['properties']['pinyin'] ?? ''],
  986. 'oldUse' => ['name' => '老人用药' , 'text' =>$data[$key]['end']['properties']['oldUse'] ?? ''],
  987. 'chilldUse' => ['name' => '儿童用药' , 'text' =>$data[$key]['end']['properties']['chilldUse'] ?? ''],
  988. 'medicinePregnant' => ['name' => '孕妇及哺乳期妇女用药' , 'text' =>$data[$key]['end']['properties']['medicinePregnant'] ?? ''],
  989. 'usageDosage' => ['name' => '用法用量' , 'text' =>$data[$key]['end']['properties']['usageDosage'] ?? ''],
  990. 'notes' => ['name' => '注意事项' , 'text' =>$data[$key]['end']['properties']['notes'] ?? ''],
  991. 'periodValidity' => ['name' => '有效期' , 'text' =>$data[$key]['end']['properties']['periodValidity'] ?? ''],
  992. 'indication' => ['name' => '适应症' , 'text' =>$data[$key]['end']['properties']['indication'] ?? ''],
  993. 'storage' => ['name' => '贮藏' , 'text' =>$data[$key]['end']['properties']['storage'] ?? ''],
  994. 'character' => ['name' => '性状' , 'text' =>$data[$key]['end']['properties']['character'] ?? ''],
  995. 'contraindication' => ['name' => '禁忌' , 'text' =>$data[$key]['end']['properties']['contraindication'] ?? ''],
  996. 'pharmacologyToxicology'=> ['name' => '药理毒理' , 'text' =>$data[$key]['end']['properties']['pharmacologyToxicology'] ?? ''],
  997. 'specification' => ['name' => '规格' , 'text' =>$data[$key]['end']['properties']['specification'] ?? ''],
  998. 'approvalNumber' => ['name' => '批准号' , 'text' =>$data[$key]['end']['properties']['approvalNumber'] ?? ''],
  999. 'productionEnterprise' => ['name' => '生产企业' , 'text' =>$data[$key]['end']['properties']['productionEnterprise'] ?? ''],
  1000. 'relateSick' => ['name' => '相关疾病' , 'text' =>$data[$key]['end']['properties']['relateSick'] ?? ''],
  1001. 'untowardEffect' => ['name' => '不良反应' , 'text' =>$data[$key]['end']['properties']['untowardEffect'] ?? ''],
  1002. 'majorConstituent' => ['name' => '主要成分' , 'text' =>$data[$key]['end']['properties']['majorConstituent'] ?? ''],
  1003. ];
  1004. $data[$key]['end']['properties'] = $listEnd;
  1005. $data[$key]['end']['tag'] = 'medicine';
  1006. }
  1007. }
  1008. break;
  1009. case 'zysickness':
  1010. case 'icd10':
  1011. $query = "match p = (n:SickNess)-[r:LinkCnPatentMedicine]-(m:Thing) where n.kgid= "."'".$name."'"." return p";
  1012. $query1 = "match p1 = (n:SickNess)-[r:LinkConstitution]-(m:Thing) where n.kgid= "."'".$name."'"." return p1";
  1013. $query2 = "match p2 = (n:SickNess)-[r:LinkPrescription]-(m:Thing) where n.kgid= "."'".$name."'"." return p2";
  1014. $query3 = "match p3 = (n:SickNess)-[r:LinkTonicDiet]-(m:Thing) where n.kgid= "."'".$name."'"." return p3";
  1015. $data = $this->getZyR($query , $query1 , $query2 , $query3);
  1016. $list = [];
  1017. foreach ($data as $key => $value) {
  1018. $list['ICD10'] = ['name' => 'ICD10' , 'text' => $data[$key]['start']['properties']['ICD10'] ?? ''];
  1019. $list['name'] = ['name' => '名称' , 'text' => $data[$key]['start']['properties']['name'] ?? ''];
  1020. $list['tongueCondition'] = ['name' => '舌象' , 'text' => $data[$key]['start']['properties']['tongueCondition'] ?? ''];
  1021. $list['apparatus'] = ['name' => '发病部位' , 'text' => $data[$key]['start']['properties']['apparatus'] ?? ''];
  1022. $list['source'] = ['name' => '数据来源' , 'text' => $data[$key]['start']['properties']['source'] ?? ''];
  1023. $list['pulseCondition'] = ['name' => '脉象' , 'text' => $data[$key]['start']['properties']['pulseCondition'] ?? ''];
  1024. $list['dietTherapy'] = ['name' => '饮食疗法' , 'text' => $data[$key]['start']['properties']['dietTherapy'] ?? ''];
  1025. $list['symptom'] = ['name' => '症见' , 'text' => $data[$key]['start']['properties']['symptom'] ?? ''];
  1026. $list['department'] = ['name' => '科室' , 'text' => $data[$key]['start']['properties']['department'] ?? ''];
  1027. $list['acupuncturePoints'] = ['name' => '针灸穴位' , 'text' => $data[$key]['start']['properties']['acupuncturePoints'] ?? ''];
  1028. $list['dialecticalName'] = ['name' => '证型' , 'text' => $data[$key]['start']['properties']['dialecticalName'] ?? ''];
  1029. $list['therapeuticMethod'] = ['name' => '治疗方法' , 'text' => $data[$key]['start']['properties']['therapeuticMethod'] ?? ''];
  1030. $data[$key]['start']['properties'] = $list;
  1031. // 中成药关系
  1032. if($value['relationship']['type'] == 'LINKCNPATENTMEDICINE') {
  1033. $listEnd = [
  1034. 'name' => ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''],
  1035. 'classification' => ['name' => '分类' , 'text' => $data[$key]['end']['properties']['classification'] ?? ''],
  1036. 'efficacy' => ['name' => '功效' , 'text' => $data[$key]['end']['properties']['efficacy'] ?? ''],
  1037. 'indications' => ['name' => '主治' , 'text' => $data[$key]['end']['properties']['indications'] ?? ''],
  1038. 'source' => ['name' => '数据来源' , 'text' => $data[$key]['end']['properties']['source'] ?? ''],
  1039. ];
  1040. $data[$key]['end']['properties'] = $listEnd;
  1041. $data[$key]['end']['tag'] = 'zcy';
  1042. }
  1043. // 方剂关系
  1044. if($value['relationship']['type'] == 'LINKPRESCRIPTION') {
  1045. $listEnd = [
  1046. 'name' => ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''],
  1047. 'composition' => ['name' => '方剂组成' , 'text' => $data[$key]['end']['properties']['composition'] ?? ''],
  1048. 'medicinalCrop' => ['name' => '中药' , 'text' => $data[$key]['end']['properties']['medicinalCrop'] ?? ''],
  1049. 'indications' => ['name' => '主治' , 'text' => $data[$key]['end']['properties']['indications'] ?? ''],
  1050. 'solution' => ['name' => '方法/解法' , 'text' => $data[$key]['end']['properties']['solution'] ?? ''],
  1051. 'usageDosage' => ['name' => '用法用量' , 'text' => $data[$key]['end']['properties']['usageDosage'] ?? ''],
  1052. 'source' => ['name' => '数据来源' , 'text' => $data[$key]['end']['properties']['source'] ?? ''],
  1053. ];
  1054. $data[$key]['end']['properties'] = $listEnd;
  1055. $data[$key]['end']['tag'] = 'fj';
  1056. }
  1057. // 药膳关系
  1058. if($value['relationship']['type'] == 'LINKTONICDIET') {
  1059. $listEnd = [
  1060. 'name' => ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''],
  1061. 'composition' => ['name' => '药膳组成' , 'text' => $data[$key]['end']['properties']['composition'] ?? ''],
  1062. ];
  1063. $data[$key]['end']['properties'] = $listEnd;
  1064. $data[$key]['end']['tag'] = 'ys';
  1065. }
  1066. // 体质关系LinkConstitution
  1067. if($value['relationship']['type'] == 'LINKCONSTITUTION') {
  1068. $listEnd = [
  1069. 'name' => ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''],
  1070. 'overallFeature' => ['name' => '总体特征' , 'text' => $data[$key]['end']['properties']['overallFeature'] ?? ''],
  1071. 'psychologicalFeature' => ['name' => '心理特征' , 'text' => $data[$key]['end']['properties']['psychologicalFeature'] ?? ''],
  1072. 'commonPerformance' => ['name' => '常见表现' , 'text' => $data[$key]['end']['properties']['commonPerformance'] ?? ''],
  1073. 'tendency' => ['name' => '发病倾向' , 'text' => $data[$key]['end']['properties']['tendency'] ?? ''],
  1074. 'exercise' => ['name' => '体育锻炼' , 'text' => $data[$key]['end']['properties']['exercise'] ?? ''],
  1075. 'meridianHealth' => ['name' => '经络保健' , 'text' => $data[$key]['end']['properties']['meridianHealth'] ?? ''],
  1076. 'medicineRegimen' => ['name' => '药物养生' , 'text' => $data[$key]['end']['properties']['medicineRegimen'] ?? ''],
  1077. 'dietTherapy' => ['name' => '宜食疗' , 'text' => $data[$key]['end']['properties']['dietTherapy'] ?? ''],
  1078. 'notEat' => ['name' => '不宜吃' , 'text' => $data[$key]['end']['properties']['notEat'] ?? ''],
  1079. ];
  1080. $data[$key]['end']['properties'] = $listEnd;
  1081. $data[$key]['end']['tag'] = 'tj';
  1082. }
  1083. }
  1084. break;
  1085. case 'zy':
  1086. // 中药详情图谱
  1087. $query = "match(n:CnMedicinalCrop {kgid:"."'".$name."'"."}) return n";
  1088. $data = $this->getSingle($query , 'zy');
  1089. $data1['name'] = ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''];
  1090. $data1['toxicity'] = ['name' => '毒性' , 'text' => $data[0]['start']['properties']['toxicity'] ?? ''];
  1091. $data1['indications'] = ['name' => '功能主治' , 'text' => $data[0]['start']['properties']['indications'] ?? ''];
  1092. $data1['source'] = ['name' => '来源' , 'text' => $data[0]['start']['properties']['source'] ?? ''];
  1093. $data1['pharmacology'] = ['name' => '药理作用' , 'text' => $data[0]['start']['properties']['pharmacology'] ?? ''];
  1094. $data1['includedIn'] = ['name' => '收录于' , 'text' => $data[0]['start']['properties']['includedIn'] ?? ''];
  1095. $data[0]['start']['properties'] = $data1;
  1096. $data[0]['start']['tag'] = 'zy';
  1097. break;
  1098. case 'medicine':
  1099. $query = "match(n:MedicineProduction {name:"."'".$name."'"."}) return n";
  1100. $data = $this->getSingle($query);
  1101. $data1 = [
  1102. 'name' => ['name' => '名称' , 'text' =>$data[0]['start']['properties']['name'] ?? ''],
  1103. 'pinyi' => ['name' => '汉语拼音' , 'text' =>$data[0]['start']['properties']['pinyin'] ?? ''],
  1104. 'oldUse' => ['name' => '老人用药' , 'text' =>$data[0]['start']['properties']['oldUse'] ?? ''],
  1105. 'chilldUse' => ['name' => '儿童用药' , 'text' =>$data[0]['start']['properties']['chilldUse'] ?? ''],
  1106. 'medicinePregnant' => ['name' => '孕妇及哺乳期妇女用药' , 'text' =>$data[0]['start']['properties']['medicinePregnant'] ?? ''],
  1107. 'usageDosage' => ['name' => '用法用量' , 'text' =>$data[0]['start']['properties']['usageDosage'] ?? ''],
  1108. 'notes' => ['name' => '注意事项' , 'text' =>$data[0]['start']['properties']['notes'] ?? ''],
  1109. 'periodValidity' => ['name' => '有效期' , 'text' =>$data[0]['start']['properties']['periodValidity'] ?? ''],
  1110. 'indication' => ['name' => '适应症' , 'text' =>$data[0]['start']['properties']['indication'] ?? ''],
  1111. 'storage' => ['name' => '贮藏' , 'text' =>$data[0]['start']['properties']['storage'] ?? ''],
  1112. 'character' => ['name' => '性状' , 'text' =>$data[0]['start']['properties']['character'] ?? ''],
  1113. 'contraindication' => ['name' => '禁忌' , 'text' =>$data[0]['start']['properties']['contraindication'] ?? ''],
  1114. 'pharmacologyToxicology'=> ['name' => '药理毒理' , 'text' =>$data[0]['start']['properties']['pharmacologyToxicology'] ?? ''],
  1115. 'specification' => ['name' => '规格' , 'text' =>$data[0]['start']['properties']['specification'] ?? ''],
  1116. 'approvalNumber' => ['name' => '批准号' , 'text' =>$data[0]['start']['properties']['approvalNumber'] ?? ''],
  1117. 'productionEnterprise' => ['name' => '生产企业' , 'text' =>$data[0]['start']['properties']['productionEnterprise'] ?? ''],
  1118. 'relateSick' => ['name' => '相关疾病' , 'text' =>$data[0]['start']['properties']['relateSick'] ?? ''],
  1119. 'untowardEffect' => ['name' => '不良反应' , 'text' =>$data[0]['start']['properties']['untowardEffect'] ?? ''],
  1120. 'majorConstituent' => ['name' => '主要成分' , 'text' =>$data[0]['start']['properties']['majorConstituent'] ?? ''],
  1121. ];
  1122. $data[0]['start']['properties'] = $data1;
  1123. $data[0]['start']['tag'] = $tag;
  1124. break;
  1125. case 'inspection':
  1126. $query = "match(n:Inspection {name:"."'".$name."'"."}) return n";
  1127. $data = $this->getSingle($query);
  1128. $data1 = [
  1129. 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
  1130. 'overview' => ['name' => '概述' , 'text' => $data[0]['start']['properties']['overview'] ?? ''],
  1131. 'annotation' => ['name' => '附注' , 'text' => $data[0]['start']['properties']['annotation'] ?? ''],
  1132. 'principle' => ['name' => '原理' , 'text' => $data[0]['start']['properties']['principle'] ?? ''],
  1133. 'normalValue' => ['name' => '正常值' , 'text' => $data[0]['start']['properties']['normalValue'] ?? ''],
  1134. 'clinicalSignificance' => ['name' => '临床表现' , 'text' => $data[0]['start']['properties']['clinicalSignificance'] ?? ''],
  1135. 'reagent' => ['name' => '试剂' , 'text' => $data[0]['start']['properties']['reagent'] ?? ''],
  1136. 'operation' => ['name' => '操作方法' , 'text' => $data[0]['start']['properties']['operation'] ?? ''],
  1137. ];
  1138. $data[0]['start']['properties'] = $data1;
  1139. $data[0]['start']['tag'] = $tag;
  1140. break;
  1141. case 'zcy':
  1142. $query = "match(n:CnPatentMedicine {name:"."'".$name."'"."}) return n";
  1143. $data = $this->getSingle($query , 'zy');
  1144. $data1 = [
  1145. 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
  1146. 'classification' => ['name' => '分类' , 'text' => $data[0]['start']['properties']['classification'] ?? ''],
  1147. 'efficacy' => ['name' => '功效' , 'text' => $data[0]['start']['properties']['efficacy'] ?? ''],
  1148. 'indications' => ['name' => '主治' , 'text' => $data[0]['start']['properties']['indications'] ?? ''],
  1149. 'source' => ['name' => '数据来源' , 'text' => $data[0]['start']['properties']['source'] ?? ''],
  1150. ];
  1151. $data[0]['start']['properties'] = $data1;
  1152. $data[0]['start']['tag'] = $tag;
  1153. break;
  1154. case 'ys':
  1155. // 中医药膳 [LinkTonicDiet 药膳关系 ]
  1156. $query = "match p = (n:SickNess)-[r:LinkTonicDiet]-(m:Thing) where m.name= "."'".$name."'"." return p";
  1157. $data = $this->getZyR($query , '' , '' , '');
  1158. $dataTwo = $data;
  1159. $list = [];
  1160. foreach ($data as $key => $value) {
  1161. $list['name'] = ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''];
  1162. $list['composition'] = ['name' => '药膳组成' , 'text' => $data[$key]['end']['properties']['composition'] ?? ''];
  1163. $listEnd['ICD10'] = ['name' => 'ICD10' , 'text' => $data[$key]['start']['properties']['ICD10'] ?? ''];
  1164. $listEnd['name'] = ['name' => '名称' , 'text' => $data[$key]['start']['properties']['name'] ?? ''];
  1165. $listEnd['tongueCondition'] = ['name' => '舌象' , 'text' => $data[$key]['start']['properties']['tongueCondition'] ?? ''];
  1166. $listEnd['apparatus'] = ['name' => '发病部位' , 'text' => $data[$key]['start']['properties']['apparatus'] ?? ''];
  1167. $listEnd['source'] = ['name' => '数据来源' , 'text' => $data[$key]['start']['properties']['source'] ?? ''];
  1168. $listEnd['pulseCondition'] = ['name' => '脉象' , 'text' => $data[$key]['start']['properties']['pulseCondition'] ?? ''];
  1169. $listEnd['dietTherapy'] = ['name' => '饮食疗法' , 'text' => $data[$key]['start']['properties']['dietTherapy'] ?? ''];
  1170. $listEnd['symptom'] = ['name' => '症见' , 'text' => $data[$key]['start']['properties']['symptom'] ?? ''];
  1171. $listEnd['department'] = ['name' => '科室' , 'text' => $data[$key]['start']['properties']['department'] ?? ''];
  1172. $listEnd['acupuncturePoints'] = ['name' => '针灸穴位' , 'text' => $data[$key]['start']['properties']['acupuncturePoints'] ?? ''];
  1173. $listEnd['dialecticalName'] = ['name' => '证型' , 'text' => $data[$key]['start']['properties']['dialecticalName'] ?? ''];
  1174. $listEnd['therapeuticMethod'] = ['name' => '治疗方法' , 'text' => $data[$key]['start']['properties']['therapeuticMethod'] ?? ''];
  1175. $listEnd['kgid'] = ['name' => 'kgid' , 'text' => $data[$key]['start']['properties']['kgid'] ?? ''];
  1176. // 调换id
  1177. $startIdentity = $data[$key]['end']['identity'];
  1178. $endIdentity = $data[$key]['start']['identity'];
  1179. $data[$key]['start']['properties'] = $list;
  1180. $data[$key]['start']['tag'] = $tag;
  1181. $data[$key]['start']['identity'] = $startIdentity;
  1182. $data[$key]['end']['properties'] = $listEnd;
  1183. $data[$key]['end']['tag'] = 'zysickness';
  1184. $data[$key]['end']['identity'] = $endIdentity;
  1185. }
  1186. break;
  1187. case 'fj':
  1188. $query = "match(n:Prescription {name:"."'".$name."'"."}) return n";
  1189. $data = $this->getSingle($query , 'zy');
  1190. $data1 = [
  1191. 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
  1192. 'composition' => ['name' => '方剂组成' , 'text' => $data[0]['start']['properties']['composition'] ?? ''],
  1193. 'medicinalCrop' => ['name' => '中药' , 'text' => $data[0]['start']['properties']['medicinalCrop'] ?? ''],
  1194. 'indications' => ['name' => '主治' , 'text' => $data[0]['start']['properties']['indications'] ?? ''],
  1195. 'solution' => ['name' => '方法/解法' , 'text' => $data[0]['start']['properties']['solution'] ?? ''],
  1196. 'usageDosage' => ['name' => '用法用量' , 'text' => $data[0]['start']['properties']['usageDosage'] ?? ''],
  1197. 'source' => ['name' => '数据来源' , 'text' => $data[0]['start']['properties']['source'] ?? ''],
  1198. ];
  1199. $data[0]['start']['properties'] = $data1;
  1200. $data[0]['start']['tag'] = $tag;
  1201. break;
  1202. case 'tz':
  1203. $query = "match(n:Constitution {name:"."'".$name."'"."}) return n";
  1204. $data = $this->getSingle($query , 'zy');
  1205. $data1 = [
  1206. 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
  1207. 'overallFeature' => ['name' => '总体特征' , 'text' => $data[0]['start']['properties']['overallFeature'] ?? ''],
  1208. 'psychologicalFeature' => ['name' => '心理特征' , 'text' => $data[0]['start']['properties']['psychologicalFeature'] ?? ''],
  1209. 'commonPerformance' => ['name' => '常见表现' , 'text' => $data[0]['start']['properties']['commonPerformance'] ?? ''],
  1210. 'tendency' => ['name' => '发病倾向' , 'text' => $data[0]['start']['properties']['tendency'] ?? ''],
  1211. 'exercise' => ['name' => '体育锻炼' , 'text' => $data[0]['start']['properties']['exercise'] ?? ''],
  1212. 'meridianHealth' => ['name' => '经络保健' , 'text' => $data[0]['start']['properties']['meridianHealth'] ?? ''],
  1213. 'medicineRegimen' => ['name' => '药物养生' , 'text' => $data[0]['start']['properties']['medicineRegimen'] ?? ''],
  1214. 'dietTherapy' => ['name' => '宜食疗' , 'text' => $data[0]['start']['properties']['dietTherapy'] ?? ''],
  1215. 'notEat' => ['name' => '不宜吃' , 'text' => $data[0]['start']['properties']['notEat'] ?? ''],
  1216. ];
  1217. $data[0]['start']['properties'] = $data1;
  1218. $data[0]['start']['tag'] = $tag;
  1219. break;
  1220. case 'xw':
  1221. $query = "match(n:Acupoint {name:"."'".$name."'"."}) return n";
  1222. $data = $this->getSingle($query , 'zy');
  1223. $data1 = [
  1224. 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
  1225. 'location' => ['name' => '定位' , 'text' => $data[0]['start']['properties']['location'] ?? ''],
  1226. 'indications' => ['name' => '主治' , 'text' => $data[0]['start']['properties']['indications'] ?? ''],
  1227. 'compatibility' => ['name' => '配伍' , 'text' => $data[0]['start']['properties']['compatibility'] ?? ''],
  1228. 'acupuncture' => ['name' => '针灸法' , 'text' => $data[0]['start']['properties']['acupuncture'] ?? ''],
  1229. 'notions' => ['name' => '附注' , 'text' => $data[0]['start']['properties']['notions'] ?? ''],
  1230. ];
  1231. $data[0]['start']['properties'] = $data1;
  1232. $data[0]['start']['tag'] = $tag;
  1233. break;
  1234. case 'jl':
  1235. $query = "match(n:ChannelCollateral {kgid:"."'".$name."'"."}) return n";
  1236. $data = $this->getSingle($query , 'zy');
  1237. $data1 = [
  1238. 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
  1239. 'indications' => ['name' => '主治' , 'text' => $data[0]['start']['properties']['indications'] ?? ''],
  1240. 'channelSymptom' => ['name' => '经脉循行及其病候' , 'text' => $data[0]['start']['properties']['channelSymptom'] ?? ''],
  1241. 'collateralSymptom' => ['name' => '络脉循行及其病候' , 'text' => $data[0]['start']['properties']['collateralSymptom'] ?? ''],
  1242. 'divergentMeridian' => ['name' => '经别循行' , 'text' => $data[0]['start']['properties']['divergentMeridian'] ?? ''],
  1243. 'aponeuroticSystem' => ['name' => '经筋循行及其病候' , 'text' => $data[0]['start']['properties']['aponeuroticSystem'] ?? ''],
  1244. 'clinicalFeature' => ['name' => '经络症状主要临床表现' , 'text' => $data[0]['start']['properties']['clinicalFeature'] ?? ''],
  1245. 'mechanismAnalysis' => ['name' => '经络病机分析' , 'text' => $data[0]['start']['properties']['mechanismAnalysis'] ?? ''],
  1246. 'source' => ['name' => '数据来源' , 'text' => $data[0]['start']['properties']['source'] ?? ''],
  1247. ];
  1248. $data[0]['start']['properties'] = $data1;
  1249. $data[0]['start']['tag'] = $tag;
  1250. break;
  1251. case 'symptom':
  1252. $query = "match p = (n:Thing)-[r:LinkDiseaseSymptom]-(m:Disease) where n.name= "."'".$name."'"." return p";
  1253. $data = $this->getXyR($query);
  1254. if(empty($data)) {
  1255. $query = "match(n:Symptom {name:"."'".$name."'"."}) return n";
  1256. $data = $this->getSingle($query);
  1257. $data1 = [
  1258. 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
  1259. 'indications' => ['name' => '主治' , 'text' => $data[0]['start']['properties']['indications'] ?? ''],
  1260. 'channelSymptom' => ['name' => '经脉循行及其病候' , 'text' => $data[0]['start']['properties']['channelSymptom'] ?? ''],
  1261. 'collateralSymptom' => ['name' => '络脉循行及其病候' , 'text' => $data[0]['start']['properties']['collateralSymptom'] ?? ''],
  1262. 'divergentMeridian' => ['name' => '经别循行' , 'text' => $data[0]['start']['properties']['divergentMeridian'] ?? ''],
  1263. 'aponeuroticSystem' => ['name' => '经筋循行及其病候' , 'text' => $data[0]['start']['properties']['aponeuroticSystem'] ?? ''],
  1264. 'clinicalFeature' => ['name' => '经络症状主要临床表现' , 'text' => $data[0]['start']['properties']['clinicalFeature'] ?? ''],
  1265. 'mechanismAnalysis' => ['name' => '经络病机分析' , 'text' => $data[0]['start']['properties']['mechanismAnalysis'] ?? ''],
  1266. 'source' => ['name' => '数据来源' , 'text' => $data[0]['start']['properties']['source'] ?? ''],
  1267. ];
  1268. $data[0]['start']['properties'] = $data1;
  1269. $data[0]['start']['tag'] = $tag;
  1270. } else {
  1271. foreach ($data as $key => $value)
  1272. {
  1273. $data[$key]['start'] = $value['end'];
  1274. $data[$key]['end'] = $value['start'];
  1275. $data[$key]['relationship']['start'] = $value['relationship']['end'];
  1276. $data[$key]['relationship']['end'] = $value['relationship']['start'];
  1277. $list['name'] = ['name' => '名称' , 'text' => $data[$key]['start']['properties']['name'] ?? ''];
  1278. $list['identify'] = ['name' => '识别' , 'text' => $data[$key]['start']['properties']['identify'] ?? ''];
  1279. $list['abstract'] = ['name' => '摘要' , 'text' => $data[$key]['start']['properties']['abstract'] ?? ''];
  1280. $list['precaution'] = ['name' => '预防措施' , 'text' => $data[$key]['start']['properties']['precaution'] ?? ''];
  1281. $list['inspection'] = ['name' => '检查' , 'text' => $data[$key]['start']['properties']['inspection'] ?? ''];
  1282. $list['etiology'] = ['name' => '病理' , 'text' => $data[$key]['start']['properties']['etiology'] ?? ''];
  1283. $list['department'] = ['name' => '科室' , 'text' => $data[$key]['start']['properties']['department'] ?? ''];
  1284. $data[$key]['start']['properties'] = $list;
  1285. $data[$key]['start']['tag'] = 'symptom';
  1286. $listEnd['name'] = ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''];
  1287. $data[$key]['end']['properties'] = $listEnd;
  1288. }
  1289. }
  1290. break;
  1291. }
  1292. return $this->_json_succ($data);
  1293. }
  1294. // 搜索
  1295. public function search()
  1296. {
  1297. //if(!$this->checkIslogin()) return $this->_json_error('请登录后查看!');
  1298. $tag = Request::param('tag') ?? 'sickness';
  1299. $search = Request::param('search') ?? '';
  1300. $pn = Request::param('pn') ?? 1;
  1301. $pagesize = 20;
  1302. $limit = ($pn - 1) * $pagesize;
  1303. if(!$tag || !$search) {
  1304. return $this->_json_error('请求参数有误!');
  1305. }
  1306. switch ($tag) {
  1307. case "disease":
  1308. $query = "match(n:Disease) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
  1309. $info = $this->getAboutInfo($query);
  1310. $info = array_column($info , 'n');
  1311. $list = [];
  1312. foreach ($info as $key => $value) {
  1313. $list[$key]['sickness_name'] = $value['name'];
  1314. $list[$key]['symptom'] = ['name' => '临床表现' , 'text' => $value['clinicalFeature'] ?? '' , 'active' => true];
  1315. $list[$key]['pathogenesis'] = ['name' => '病因' , 'text' => $value['pathogenesis'] ?? '' , 'active' => false];
  1316. $list[$key]['complicationsOverview'] = ['name' => '并发症' , 'text' => $value['complicationsOverview'] ?? '' , 'active' => false];
  1317. $list[$key]['inspection'] = ['name' => '辅助检查' , 'text' => $value['auxiliaryExamination'] ?? '' , 'active' => false];
  1318. $list[$key]['treatmenCommonSense'] = ['name' => '治疗' , 'text' => $value['treatment'] ?? '' , 'active' => false];
  1319. $list[$key]['diagnostiCtriage'] = ['name' => '诊断' , 'text' => $value['diagnosis'] ?? '' , 'active' => false];
  1320. }
  1321. break;
  1322. case "medicine":
  1323. $query = "match(n:MedicineProduction) where n.name =~'.*".$search.".*' return
  1324. n.name as name , n.pinyin as pinyin , n.usageDosage as usageDosage ,
  1325. n.notes as notes , n.periodValidity as periodValidity ,
  1326. n.indication as indication , n.storage as storage , n.character as character ,
  1327. n.approvalNumber as approvalNumber ,
  1328. n.productionEnterprise as productionEnterprise , n.relateSick as relateSick ,
  1329. n.untowardEffect as untowardEffect , n.majorConstituent as majorConstituent
  1330. skip $limit limit 20";
  1331. $data = $this->getAboutInfo($query);
  1332. $list = [];
  1333. foreach ($data as $key => $value) {
  1334. $list[$key]['sickness_name'] = $value['name'];
  1335. $list[$key]['pinyi'] = ['name' => '汉语拼音' , 'text' => $value['pinyin'] , 'active' => false];
  1336. $list[$key]['usageDosage'] = ['name' => '用法用量' , 'text' => $value['usageDosage'] , 'active' => false];
  1337. $list[$key]['notes'] = ['name' => '注意事项' , 'text' => $value['notes'] , 'active' => false];
  1338. $list[$key]['periodValidity'] = ['name' => '有效期' , 'text' => $value['periodValidity'], 'active' => false];
  1339. $list[$key]['indication'] = ['name' => '适应症' , 'text' => $value['indication'], 'active' => false];
  1340. $list[$key]['storage'] = ['name' => '贮藏' , 'text' => $value['storage'], 'active' => false];
  1341. $list[$key]['character'] = ['name' => '性状' , 'text' => $value['character'], 'active' => false];
  1342. $list[$key]['approvalNumber'] = ['name' => '批准号' , 'text' => $value['approvalNumber'], 'active' => false];
  1343. $list[$key]['productionEnterprise'] = ['name' => '生产企业' , 'text' => $value['productionEnterprise'], 'active' => false];
  1344. $list[$key]['relateSick'] = ['name' => '相关疾病' , 'text' => $value['relateSick'], 'active' => false];
  1345. $list[$key]['untowardEffect'] = ['name' => '不良反应' , 'text' => $value['untowardEffect'], 'active' => false];
  1346. $list[$key]['majorConstituent'] = ['name' => '主要成分' , 'text' => $value['majorConstituent'], 'active' => true];
  1347. }
  1348. break;
  1349. case "sickness":
  1350. $query = "match(n:SickNess) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
  1351. $info = $this->getAboutInfo($query);
  1352. $info = array_column($info , 'n');
  1353. $list = [];
  1354. foreach ($info as $key => $value) {
  1355. $list[$key]['sickness_name'] = $value['name'];
  1356. $list[$key]['symptom'] = ['name' => '临床表现' , 'text' => $value['symptom'] ?? '' , 'active' => true];
  1357. $list[$key]['pathogenesis'] = ['name' => '病因' , 'text' => $value['pathogenesis'] ?? '' , 'active' => false];
  1358. $list[$key]['complicationsOverview'] = ['name' => '并发症' , 'text' => $value['complicationsOverview'] ?? '' , 'active' => false];
  1359. $list[$key]['inspection'] = ['name' => '辅助检查' , 'text' => $value['inspection'] ?? '' , 'active' => false];
  1360. $list[$key]['treatmenCommonSense'] = ['name' => '治疗' , 'text' => $value['treatmenCommonSense'] ??'' , 'active' => false];
  1361. $list[$key]['diagnostiCtriage'] = ['name' => '诊断' , 'text' => $value['diagnostiCtriage'] ?? '' , 'active' => false];
  1362. }
  1363. break;
  1364. case "inspection":
  1365. $query = "match(n:Inspection) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
  1366. $data = $this->getAboutInfo($query);
  1367. $info = array_column($data , 'n');
  1368. foreach ($info as $key => $value) {
  1369. $list[$key]['sickness_name'] = $value['name'];
  1370. $list[$key]['annotation'] = ['name' => '附注' , 'text' => $value['annotation'] ?? '', 'active' => true];
  1371. $list[$key]['principle'] = ['name' => '根源' , 'text' => $value['principle'] ?? '', 'active' => false];
  1372. $list[$key]['normalValue'] = ['name' => '正常值' , 'text' => $value['normalValue'] ?? '', 'active' => false];
  1373. $list[$key]['clinicalSignificance'] = ['name' => '临床意义' , 'text' => $value['clinicalSignificance'] ?? '', 'active' => false];
  1374. $list[$key]['reagent'] = ['name' => '试剂' , 'text' => $value['reagent'] ?? '', 'active' => false];
  1375. $list[$key]['operation'] = ['name' => '操作方法' , 'text' => $value['operation'] ?? '', 'active' => false];
  1376. }
  1377. break;
  1378. case 'zysickness':
  1379. $query = "match(n:SickNess) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
  1380. $data = $this->getAboutInfo($query , 'zy');
  1381. $data = array_column($data , 'n');
  1382. $list = [];
  1383. foreach ($data as $key => $value) {
  1384. $list[$key]['name'] = $value['name'];
  1385. $list[$key]['tongueCondition'] = ['name' => '舌象' , 'text' => $value['tongueCondition'] ?? '' , 'active' => true];
  1386. $list[$key]['apparatus'] = ['name' => '发病部位' , 'text' => $value['apparatus'] ?? '' , 'active' => false];
  1387. $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
  1388. $list[$key]['pulseCondition'] = ['name' => '脉象' , 'text' => $value['pulseCondition'] ?? '' , 'active' => false];
  1389. $list[$key]['dietTherapy'] = ['name' => '饮食疗法' , 'text' => $value['dietTherapy'] ?? '' , 'active' => false];
  1390. $list[$key]['symptom'] = ['name' => '症见' , 'text' => $value['symptom'] ?? '' , 'active' => false];
  1391. $list[$key]['department'] = ['name' => '科室' , 'text' => $value['department'] ?? '' , 'active' => false];
  1392. $list[$key]['acupuncturePoints'] = ['name' => '针灸穴位' , 'text' => $value['acupuncturePoints'] ?? '' , 'active' => false];
  1393. $list[$key]['dialecticalName'] = ['name' => '辩证法名' , 'text' => $value['dialecticalName'] ?? '' , 'active' => false];
  1394. }
  1395. break;
  1396. case 'zy':
  1397. $query = "match(n:CnMedicinalCrop) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
  1398. $data = $this->getAboutInfo($query , 'zy');
  1399. $data = array_column($data , 'n');
  1400. $list = [];
  1401. foreach ($data as $key => $value) {
  1402. $list[$key]['name'] = $value['name'];
  1403. $list[$key]['toxicity'] = ['name' => '毒性' , 'text' => $value['toxicity'] ?? '' , 'active' => true];
  1404. $list[$key]['indications'] = ['name' => '适应症' , 'text' => $value['indications'] ?? '' , 'active' => false];
  1405. $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
  1406. $list[$key]['medicineProperty'] = ['name' => '医药物业' , 'text' => $value['medicineProperty'] ?? '' , 'active' => false];
  1407. $list[$key]['includedIn'] = ['name' => '包括在' , 'text' => $value['includedIn'] ?? '' , 'active' => false];
  1408. $list[$key]['pharmacology'] = ['name' => '药理' , 'text' => $value['pharmacology '] ?? '' , 'active' => false];
  1409. }
  1410. break;
  1411. case 'zcy':
  1412. $query = "match(n:CnPatentMedicine) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
  1413. $data = $this->getAboutInfo($query , 'zy');
  1414. $data = array_column($data , 'n');
  1415. $list = [];
  1416. foreach ($data as $key => $value) {
  1417. $list[$key]['name'] = $value['name'];
  1418. $list[$key]['classification'] = ['name' => '实体值' , 'text' => $value['classification'] ?? '' , 'active' => true];
  1419. $list[$key]['efficacy'] = ['name' => '功效' , 'text' => $value['efficacy'] ?? '' , 'active' => false];
  1420. $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
  1421. $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
  1422. }
  1423. break;
  1424. case 'fj':
  1425. $query = "match(n:Prescription) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
  1426. $data = $this->getAboutInfo($query , 'zy');
  1427. $data = array_column($data , 'n');
  1428. $list = [];
  1429. foreach ($data as $key => $value) {
  1430. $list[$key]['name'] = $value['name'];
  1431. $list[$key]['composition'] = ['name' => '方剂组成' , 'text' => $value['composition'] ?? '' , 'active' => true];
  1432. $list[$key]['medicinalCrop'] = ['name' => '中药' , 'text' => $value['medicinalCrop'] ?? '' , 'active' => false];
  1433. $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
  1434. $list[$key]['solution'] = ['name' => '方法/解法' , 'text' => $value['solution'] ?? '' , 'active' => false];
  1435. $list[$key]['usageDosage'] = ['name' => '用法用量' , 'text' => $value['usageDosage'] ?? '' , 'active' => false];
  1436. $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
  1437. }
  1438. break;
  1439. case 'ys':
  1440. $query = "match(n:TonicDiet) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
  1441. $data = $this->getAboutInfo($query , 'zy');
  1442. $data = array_column($data , 'n');
  1443. $list = [];
  1444. foreach ($data as $key => $value) {
  1445. $list[$key]['name'] = $value['name'];
  1446. $list[$key]['composition'] = ['name' => '药膳组成' , 'text' => $value['composition'] ?? '' , 'active' => true];
  1447. }
  1448. break;
  1449. case 'jl':
  1450. $query = "match(n:ChannelCollateral) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
  1451. $data = $this->getAboutInfo($query , 'zy');
  1452. $data = array_column($data , 'n');
  1453. $list = [];
  1454. foreach ($data as $key => $value) {
  1455. $list[$key]['name'] = $value['name'];
  1456. $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['aponeuroticSystem'] ?? '' , 'active' => true];
  1457. $list[$key]['channelSymptom'] = ['name' => '经脉循行及其病候' , 'text' => $value['channelSymptom'] ?? '' , 'active' => false];
  1458. $list[$key]['collateralSymptom'] = ['name' => '络脉循行及其病候' , 'text' => $value['collateralSymptom'] ?? '' , 'active' => false];
  1459. $list[$key]['divergentMeridian'] = ['name' => '经别循行' , 'text' => $value['divergentMeridian'] ?? '' , 'active' => false];
  1460. $list[$key]['aponeuroticSystem'] = ['name' => '经筋循行及其病候' , 'text' => $value['aponeuroticSystem'] ?? '' , 'active' => false];
  1461. $list[$key]['clinicalFeature'] = ['name' => '经络症状主要临床表现' , 'text' => $value['clinicalFeature'] ?? '' , 'active' => false];
  1462. $list[$key]['mechanismAnalysis'] = ['name' => '经络病机分析' , 'text' => $value['mechanismAnalysis'] ?? '' , 'active' => false];
  1463. $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
  1464. $list[$key]['kgid'] = ['name' => 'kgid' , 'text' => $value['kgid'] ?? '' , 'active' => false];
  1465. }
  1466. break;
  1467. case 'xw':
  1468. $query = "match(n:Acupoint) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
  1469. $data = $this->getAboutInfo($query , 'zy');
  1470. $data = array_column($data , 'n');
  1471. $list = [];
  1472. foreach ($data as $key => $value) {
  1473. $list[$key]['name'] = $value['name'];
  1474. $list[$key]['location'] = ['name' => '定位' , 'text' => $value['location'] ?? '' , 'active' => true];
  1475. $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
  1476. $list[$key]['compatibility'] = ['name' => '配伍' , 'text' => $value['compatibility'] ?? '' , 'active' => false];
  1477. $list[$key]['acupuncture'] = ['name' => '针灸法' , 'text' => $value['acupuncture'] ?? '' , 'active' => false];
  1478. $list[$key]['notions'] = ['name' => '附注' , 'text' => $value['notions'] ?? '' , 'active' => false];
  1479. }
  1480. break;
  1481. case 'symptom':
  1482. $query = "match(n:Symptom) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
  1483. $data = $this->getAboutInfo($query);
  1484. $data = array_column($data , 'n');
  1485. $list = [];
  1486. foreach ($data as $key => $value) {
  1487. $list[$key]['sickness_name'] = $value['name'];
  1488. $list[$key]['identify'] = ['name' => '识别' , 'text' => $value['identify'] ?? '' , 'active' => true];
  1489. $list[$key]['abstract'] = ['name' => '摘要' , 'text' => $value['abstract'] ?? '' , 'active' => false];
  1490. $list[$key]['precaution'] = ['name' => '预防措施' , 'text' => $value['precaution'] ?? '' , 'active' => false];
  1491. $list[$key]['inspection'] = ['name' => '检查' , 'text' => $value['inspection'] ?? '' , 'active' => false];
  1492. $list[$key]['etiology'] = ['name' => '病理' , 'text' => $value['etiology'] ?? '' , 'active' => false];
  1493. $list[$key]['department'] = ['name' => '科室' , 'text' => $value['department'] ?? '' , 'active' => false];
  1494. }
  1495. break;
  1496. case "identify":
  1497. $query = "match(n:Disease) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
  1498. $data = $this->getAboutInfo($query);
  1499. $data = array_column($data , 'n');
  1500. $list = [];
  1501. foreach ($data as $key => $value) {
  1502. $list[$key]['sickness_name'] = $value['name'];
  1503. $list[$key]['antidiastole'] = ['name' => '鉴别诊断' , 'text' => $value['antidiastole'] ?? '' , 'active' => true];
  1504. }
  1505. break;
  1506. }
  1507. return $this->_json_succ($list);
  1508. }
  1509. }