Graph.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace app\controller;
  3. use app\model\XySickNess;
  4. use think\facade\Request;
  5. class Graph extends CommonTwoController
  6. {
  7. public function index()
  8. {
  9. $tag = Request::param('tag') ?? '';
  10. $name = Request::param('name') ?? '';
  11. if( ! $tag || ! $name) {
  12. return $this->_json_error('请求参数有误!');
  13. }
  14. switch($tag)
  15. {
  16. case "SickNess":
  17. $xySickNess = XySickNess::where('name' , $name)->find();
  18. $aboutMedicine = $xySickNess->
  19. $data = [
  20. 'sickness_name' => ['name' => '名称' , 'text' => $xySickNess['name'] ??''],
  21. 'alias' => ['name' => '疾病别名' , 'text' => $xySickNess['alias'] ?? ''],
  22. 'ICD10' => ['name' => 'ICD10' , 'text' => $xySickNess['ICD10'] ?? ''],
  23. 'department' => ['name' => '疾病类别' , 'text' => $xySickNess['department'] ?? ''],
  24. //'complication' => ['name' => '并发症' , 'text' => $this->getSicknessComplication($sickness , 'sickness') ?? ''],
  25. //'medicine' => ['name' => '相关药品' , 'text' => $medicine ?? ''] ,
  26. 'introduction' => ['name' => '疾病概述' , 'text' => $xySickNess['introduction'] ?? ''],
  27. 'epidemiology' => ['name' => '流行病学' , 'text' => $xySickNess['epidemiology'] ?? ''],
  28. 'suitableFood' => ['name' => '宜吃食物' , 'text' => $xySickNess['suitableFood'] ?? ''],
  29. 'notEat' => ['name' => '忌吃食物' , 'text' => $xySickNess['notEat'] ?? ''],
  30. 'diagnostiCtriage' => ['name' => '诊断鉴别' , 'text' => $xySickNess['diagnostiCtriage'] ?? ''],
  31. 'precaution' => ['name' => '预防' , 'text' => $xySickNess['precaution'] ?? ''],
  32. 'nursingInfo' => ['name' => '护理信息' , 'text' => $xySickNess['nursingInfo'] ?? ''],
  33. 'warmPrompt' => ['name' => '温馨提示' , 'text' => $xySickNess['warmPrompt'] ?? ''],
  34. 'recommendedRecipe' => ['name' => '推荐食谱' , 'text' => $xySickNess['recommendedRecipe'] ?? ''],
  35. 'treatmentOverview' => ['name' => '治疗概述' , 'text' => $xySickNess['treatmentOverview'] ?? ''],
  36. 'inspection' => ['name' => '检查' , 'text' => $xySickNess['inspection'] ?? ''],
  37. 'treatmenCommonSense' => ['name' => '治疗常识' , 'text' => $xySickNess['treatmenCommonSense'] ?? ''],
  38. 'pathogenesis' => ['name' => '病因' , 'text' => $xySickNess['pathogenesis'] ?? ''],
  39. 'basicKnowledgel' => ['name' => '基本常识' , 'text' => $xySickNess['basicKnowledgel'] ?? ''],
  40. 'dietHealth' => ['name' => '饮食保健' , 'text' => $xySickNess['dietHealth'] ?? ''],
  41. 'symptom' => ['name' => '证型' , 'text' => $xySickNess['symptom'] ?? ''],
  42. 'complicationsOverview' => ['name' => '并发症概述', 'text' => $xySickNess['complicationsOverview'] ?? ''],
  43. 'treatmentInfo' => ['name' => '治疗信息' , 'text' => $xySickNess['treatmentInfo'] ?? '']
  44. ];
  45. break;
  46. }
  47. }
  48. }