123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596 |
- <?php
- namespace app\controller;
- require_once app()->getRootPath().'vendor/autoload.php';
- use Neoxygen\NeoClient\ClientBuilder;
- use think\facade\Request;
- use app\model\ClinicalTrial;
- use app\model\ClinicalPathway;
- class NeojApi extends CommonTwoController
- {
- // 菜单栏
- public function index()
- {
- $departmentLevel1 = [
- ['departmentLevel1' => '内科']
- ];
- $list = [];
- foreach ($departmentLevel1 as $key => $value) {
- $list[$key]['departmentLevel1'] = $value['departmentLevel1'];
- $query1 = "match(n:SickNess{departmentLevel1 : "."'".$value["departmentLevel1"]."'"."}) return distinct n.departmentLevel2 as departmentLevel2";
- $qdata1 = $this->getAboutInfo($query1);
- foreach ($qdata1 as $key1 => $value1) {
- $qdata1[$key1]['tag'] = 'sickness';
- }
- $list[$key]['departmentLevel2']['name'] = $qdata1;
- }
- $departmentLevel = [
- [
- 'departmentLevel1' => '神经内科' ,
- ],
- [
- 'departmentLevel1' => '感染内科' ,
- ],
- [
- 'departmentLevel1' => '心血管内科' ,
- ],
- [
- 'departmentLevel1' => '肾内科' ,
- ],
- [
- 'departmentLevel1' => '呼吸科' ,
- ],
- [
- 'departmentLevel1' => '血液科' ,
- ],
- ];
- $listt = [];
- foreach ($departmentLevel as $key => $value) {
- $listt[$key]['departmentLevel1'] = $value['departmentLevel1'];
- $query11 = "match(n:Disease{departmentLevel1 : "."'".$value["departmentLevel1"]."'"."}) return distinct n.departmentLevel2 as departmentLevel2";
- $qqdata1 = $this->getAboutInfo($query11);
- foreach ($qqdata1 as $key11 => $value11) {
- $qqdata1[$key11]['tag'] = 'disease';
- }
- $listt[$key]['departmentLevel2']['name'] = $qqdata1;
- }
- // 中医疾病
- $query1 = "match(n:SickNess) where n.department is not null return distinct n.department as departmentLevel2";
- $data = $this->getAboutInfo($query1 , 'zy');
- unset($data[20]);
- unset($data[5]);
- $listzy[0]['departmentLevel1']['name'] = '中医科室';
- $listzy[0]['departmentLevel2']['name'] = $data;
- $lists = [
- ['knowledge_base_name' => '西医知识库'],
- ['knowledge_base_name' => '中医知识库'],
- ];
- foreach ($lists as $k => $v)
- {
- // 西医知识库
- $lists[0]['subordinate'] = [
- ['name' => '疾病'] ,
- ['name' => '症状体征' , 'tag' => 'symptom'],
- ['name' => '药品' , 'tag' => 'medicine'],
- ['name' => '检查' , 'tag' => 'inspection'],
- ];
- // 中医知识库
- $lists[1]['subordinate'] = [
- ['name' => '疾病' , 'tag' => 'zysickness'] ,
- ['name' => '中成药' , 'tag' => 'zcy'] ,
- ['name' => '经络' , 'tag' => 'jl'] ,
- ['name' => '中药' , 'tag' => 'zy'] ,
- ['name' => '中医药膳' , 'tag' => 'ys'] ,
- ['name' => '方剂' , 'tag' => 'fj'] ,
- ['name' => '体质' , 'tag' => 'tz'] ,
- ['name' => '穴位' , 'tag' => 'xw']
- ];
- }
- // 中医疾病科室
- $zysicknessQuery = "match(n:SickNess) return distinct n.department as departmentLevel2";
- $zydeparment = $this->getAboutInfo($zysicknessQuery , 'zy');
- foreach ($zydeparment as $zyk => $zyvalue)
- {
- $zydeparment[$zyk]['tag'] = 'zysickness';
- $zydquery = "match(n:SickNess {department:"."'".$zyvalue['departmentLevel2']."'"."}) return distinct n.name as name";
- $datazyd = $this->getAboutInfo($zydquery , 'zy');
- foreach ($datazyd as $zydk => $zydv) {
- $datazyd[$zydk]['tag'] = 'zysickness';
- }
- $zydeparment[$zyk]['subordinate'] = $datazyd;
- unset($zydeparment[20]);
- unset($zydeparment[21]);
- }
- foreach ($lists as $kk => $v)
- {
- $lists[0]['subordinate'][0]['subordinate'] = [['name' => '西医科普疾病'] , ['name' => '西医科室疾病']];
- }
- // 获取中成药分类
- $cnquery = "match(n:CnPatentMedicine) where n.classification is not null return distinct n.classification as name";
- $cndata = $this->getAboutInfo($cnquery , 'zy');
- foreach ($cndata as $cnkey => $cnvalue)
- {
- $cndata[$cnkey]['tag'] = 'zcy';
- }
- // 获取经络分类
- $cnjlquery = "match(n:ChannelCollateral) where n.name is not null return distinct n.name as name";
- $cnjldata = $this->getAboutInfo($cnjlquery , 'zy');
- foreach ($cnjldata as $cnjlkey => $cnvalue)
- {
- $cnjldata[$cnjlkey]['tag'] = 'jl';
- }
- foreach ($lists as $kkk => $vvv)
- {
- $lists[0]['subordinate'][0]['subordinate'][0]['department'] = $list;
- $lists[0]['subordinate'][0]['subordinate'][1]['department'] = $listt;
- $lists[1]['subordinate'][0]['subordinate'][0]['name'] = '中医科室疾病';
- $lists[1]['subordinate'][0]['subordinate'][1]['name'] = '中医ICD10疾病';
- $lists[1]['subordinate'][0]['subordinate'][0]['department'] = $zydeparment;
- $lists[1]['subordinate'][0]['subordinate'][1]['department'] = $this->getIcdSickness();
- $lists[1]['subordinate'][1]['subordinate'] = $cndata;
- $lists[1]['subordinate'][2]['subordinate'] = $cnjldata; // 经络
- }
- return $this->_json_succ($lists);
- }
- // 中医icd分类
- public function getIcdSickness()
- {
- $query = "match(n:Thing) where n.level1 is not null return distinct n.level1 as level";
- $data = $this->getAboutInfo($query , 'zy');
- foreach ($data as $key => $value) {
- $query1 = "match(n:Thing {level1:"."'".$value["level"]."'"."}) return distinct n.level2 as level2";
- $data1 = $this->getAboutInfo($query1 , 'zy');
- $data[$key]['subordinate'] = $data1;
- foreach ($data1 as $kk => $vv) {
- $vv['level2'] = substr($vv['level2'] , 0 , 3);
- $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";
- $data2 = $this->getAboutInfo($query2 , 'zy');
- foreach ($data2 as $k => $v) {
- $data2[$k]['tag'] = 'icd10';
- $data2[$k]['name'] = $v['name'];
- }
- $data[$key]['subordinate'][$kk]['subordinate'] = $data2;
- }
- }
- return $data;
- }
- // 中医知识库列表
- public function getZyList()
- {
- if(!$this->checkIslogin()) return $this->_json_error('请登录后查看!');
- $tag = Request::param('tag');
- $pn = Request::param('pn') ?? 1;
- $limit = ($pn - 1) * 30;
- switch ($tag) {
- case 'zysickness':
- $query = "match(n:SickNess) return n skip $limit limit 20";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $query_count = "match(n:SickNess) return count(n) as count";
- $count = $this->getTotalCount($query_count , 'zy');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['dialecticalName'];
- $list[$key]['symptom'] = ['name' => '症见' , 'text' => $value['symptom'] ?? '' , 'active' => true];
- $list[$key]['tongueCondition'] = ['name' => '舌象' , 'text' => $value['tongueCondition'] ?? '' , 'active' => false];
- $list[$key]['apparatus'] = ['name' => '发病部位' , 'text' => $value['apparatus'] ?? '' , 'active' => false];
- $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
- $list[$key]['pulseCondition'] = ['name' => '脉象' , 'text' => $value['pulseCondition'] ?? '' , 'active' => false];
- $list[$key]['dietTherapy'] = ['name' => '饮食疗法' , 'text' => $value['dietTherapy'] ?? '' , 'active' => false];
- $list[$key]['department'] = ['name' => '科室' , 'text' => $value['department'] ?? '' , 'active' => false];
- $list[$key]['acupuncturePoints'] = ['name' => '针灸穴位' , 'text' => $value['acupuncturePoints'] ?? '' , 'active' => false];
- $list[$key]['dialecticalName'] = ['name' => '辩证法名' , 'text' => $value['dialecticalName'] ?? '' , 'active' => false];
- }
- break;
- case 'zy':
- $query = "match(n:CnMedicinalCrop) return n skip $limit limit 20";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $query_count = "match(n:CnMedicinalCrop) return count(n) as count";
- $count = $this->getTotalCount($query_count , 'zy');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['toxicity'] = ['name' => '毒性' , 'text' => $value['toxicity'] ?? '' , 'active' => true];
- $list[$key]['indications'] = ['name' => '功能主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
- $list[$key]['source'] = ['name' => '来源' , 'text' => $value['source'] ?? '' , 'active' => false];
- $list[$key]['medicineProperty'] = ['name' => '药性' , 'text' => $value['medicineProperty'] ?? '' , 'active' => false];
- $list[$key]['includedIn'] = ['name' => '收录于' , 'text' => $value['includedIn'] ?? '' , 'active' => false];
- $list[$key]['pharmacology'] = ['name' => '药理作用' , 'text' => $value['pharmacology '] ?? '' , 'active' => false];
- $list[$key]['kgid'] = ['name' => 'kgid' , 'text' => $value['kgid'] ?? '' , 'active' => false];
- }
- break;
- case 'zcy':
- $query = "match(n:CnPatentMedicine) return n skip $limit limit 20";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $query_count = "match(n:CnPatentMedicine) return count(n) as count";
- $count = $this->getTotalCount($query_count , 'zy');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['classification'] = ['name' => '实体值' , 'text' => $value['classification'] ?? '' , 'active' => true];
- $list[$key]['efficacy'] = ['name' => '功效' , 'text' => $value['efficacy'] ?? '' , 'active' => false];
- $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
- $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
- }
- break;
- case 'ys':
- $query = "match(n:TonicDiet) return n skip $limit limit 20";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $query_count = "match(n:TonicDiet) return count(n) as count";
- $count = $this->getTotalCount($query_count , 'zy');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['composition'] = ['name' => '药膳组成' , 'text' => $value['composition'] ?? '' , 'active' => true];
- }
- break;
- case 'fj':
- $query = "match(n:Prescription) return n skip $limit limit 20";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $query_count = "match(n:Prescription) return count(n) as count";
- $count = $this->getTotalCount($query_count , 'zy');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['composition'] = ['name' => '方剂组成' , 'text' => $value['composition'] ?? '' , 'active' => true];
- $list[$key]['medicinalCrop'] = ['name' => '中药' , 'text' => $value['medicinalCrop'] ?? '' , 'active' => false];
- $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
- $list[$key]['solution'] = ['name' => '方法/解法' , 'text' => $value['solution'] ?? '' , 'active' => false];
- $list[$key]['usageDosage'] = ['name' => '用法用量' , 'text' => $value['usageDosage'] ?? '' , 'active' => false];
- $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
- }
- break;
- case 'tz':
- $query = "match(n:Constitution) return n skip $limit limit 20";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $query_count = "match(n:Constitution) return count(n) as count";
- $count = $this->getTotalCount($query_count , 'zy');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['overallFeature'] = ['name' => '总体特征' , 'text' => $value['overallFeature'] ?? '' , 'active' => true];
- $list[$key]['psychologicalFeature'] = ['name' => '心理特征' , 'text' => $value['medicinalCrop'] ?? '' , 'active' => false];
- $list[$key]['commonPerformance'] = ['name' => '常见表现' , 'text' => $value['indications'] ?? '' , 'active' => false];
- $list[$key]['tendency'] = ['name' => '发病倾向' , 'text' => $value['tendency'] ?? '' , 'active' => false];
- $list[$key]['exercise'] = ['name' => '体育锻炼' , 'text' => $value['exercise'] ?? '' , 'active' => false];
- $list[$key]['meridianHealth'] = ['name' => '经络保健' , 'text' => $value['meridianHealth'] ?? '' , 'active' => false];
- $list[$key]['medicineRegimen'] = ['name' => '药物养生' , 'text' => $value['medicineRegimen'] ?? '' , 'active' => false];
- $list[$key]['dietTherapy'] = ['name' => '宜食疗' , 'text' => $value['medicineRegimen'] ?? '' , 'active' => false];
- $list[$key]['notEat'] = ['name' => '不宜吃' , 'text' => $value['medicineRegimen'] ?? '' , 'active' => false];
- }
- break;
- case 'xw':
- $query = "match(n:Acupoint) return n skip $limit limit 20";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $query_count = "match(n:Acupoint) return count(n) as count";
- $count = $this->getTotalCount($query_count , 'zy');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['location'] = ['name' => '定位' , 'text' => $value['location'] ?? '' , 'active' => true];
- $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
- $list[$key]['compatibility'] = ['name' => '配伍' , 'text' => $value['compatibility'] ?? '' , 'active' => false];
- $list[$key]['acupuncture'] = ['name' => '针灸法' , 'text' => $value['acupuncture'] ?? '' , 'active' => false];
- $list[$key]['notions'] = ['name' => '附注' , 'text' => $value['notions'] ?? '' , 'active' => false];
- }
- break;
- }
- return $this->_json_succ(['list' => $list , 'count' => $count]);
- }
- // 获取左侧栏目下拉信息
- public function getSickNessByDpm()
- {
- //if(!$this->checkIslogin()) return $this->_json_error('请登录后查看!');
- $department = Request::param('department') ?? '';
- $pn = Request::param('pn') ?? 1;
- $pagesize = 20;
- $limit = ($pn - 1) * $pagesize;
- $tag = Request::param('tag') ?? 'sickness'; // sickness 科普 disease 医疗
- $list = [];
- switch ($tag)
- {
- case "sickness":
- $query = "match(n:SickNess{departmentLevel2 : "."'".$department."'"."}) return
- n.name as name , n.complicationsOverview as complicationsOverview , n.pathogenesis as pathogenesis ,
- n.treatmenCommonSense as treatmenCommonSense , n.inspection as inspection , n.symptom as symptom , n.diagnostiCtriage as diagnostiCtriage
- skip $limit limit 20";
- // $query = "match(n:SickNess{departmentLevel2 : "."'".$department."'"."}) return n skip $limit limit 30";
- $sickess = $this->getAboutInfo($query);
- $query_count = "match(n:SickNess{departmentLevel2 : "."'".$department."'"."}) return count(n) as count";
- $count = $this->getTotalCount($query_count);
- foreach ($sickess as $key => $value) {
- $list[$key]['sickness_name'] = $value['name'];
- $list[$key]['symptom'] = ['name' => '临床表现' , 'text' => $value['symptom'] ?? '' , 'active' => true];
- $list[$key]['pathogenesis'] = ['name' => '病因' , 'text' => $value['pathogenesis'] ?? '' , 'active' => false];
- $list[$key]['complicationsOverview'] = ['name' => '并发症' , 'text' => $value['complicationsOverview'] ?? '' , 'active' => false];
- $list[$key]['inspection'] = ['name' => '辅助检查' , 'text' => $value['inspection'] ?? '', 'active' => false];
- $list[$key]['treatmenCommonSense'] = ['name' => '治疗' , 'text' => $value['treatmenCommonSense'] ?? '' , 'active' => false];
- $list[$key]['diagnostiCtriage'] = ['name' => '诊断' , 'text' => $value['diagnostiCtriage'] ?? '', 'active' => false];
- }
- break;
- case "disease":
- $query = "match(n:Disease{departmentLevel2 : "."'".$department."'"."}) return n.name as name,
- n.clinicalFeature as clinicalFeature , n.pathogenesis as pathogenesis , n.complicationsOverview as complicationsOverview ,
- n.auxiliaryExamination as auxiliaryExamination , n.treatment as treatment , n.diagnosis as diagnosis
- skip $limit limit 20";
- $sickess = $this->getAboutInfo($query);
- $query_count = "match(n:Disease) where n.departmentLevel2 =~'.*".$department.".*' return count(n) as count";
- $count = $this->getTotalCount($query_count);
- foreach ($sickess as $key => $value) {
- $list[$key]['sickness_name'] = $value['name'];
- $list[$key]['symptom'] = ['name' => '临床表现' , 'text' => $value['clinicalFeature'] ?? '', 'active' => true];
- $list[$key]['pathogenesis'] = ['name' => '病因' , 'text' => $value['pathogenesis'] ?? '', 'active' => false];
- $list[$key]['complicationsOverview'] = ['name' => '并发症' , 'text' => $value['complicationsOverview'] ?? '' , 'active' => false];
- $list[$key]['inspection'] = ['name' => '辅助检查' , 'text' => $value['auxiliaryExamination'] ?? '' , 'active' => false];
- $list[$key]['treatmenCommonSense'] = ['name' => '治疗' , 'text' => $value['treatment'] ?? '', 'active' => false];
- $list[$key]['diagnostiCtriage'] = ['name' => '诊断' , 'text' => $value['diagnosis'] ?? '', 'active' => false];
- }
- break;
- case "medicine":
- $query = "match(n:MedicineProduction) return
- n.name as name , n.pinyin as pinyin , n.usageDosage as usageDosage ,
- n.notes as notes , n.periodValidity as periodValidity ,
- n.indication as indication , n.storage as storage , n.character as character ,
- n.approvalNumber as approvalNumber ,
- n.productionEnterprise as productionEnterprise , n.relateSick as relateSick , n.untowardEffect as untowardEffect ,
- n.majorConstituent as majorConstituent
- skip $limit limit 20";
- $data = $this->getAboutInfo($query);
- $query_count = "match(n:MedicineProduction) return count(n) as count";
- $count = $this->getTotalCount($query_count);
- foreach ($data as $key => $value) {
- $list[$key]['sickness_name'] = $value['name'];
- $list[$key]['pinyi'] = ['name' => '汉语拼音' , 'text' => $value['pinyin'] , 'active' => false];
- $list[$key]['usageDosage'] = ['name' => '用法用量' , 'text' => $value['usageDosage'] , 'active' => false];
- $list[$key]['notes'] = ['name' => '注意事项' , 'text' => $value['notes'] , 'active' => false];
- $list[$key]['periodValidity'] = ['name' => '有效期' , 'text' => $value['periodValidity'], 'active' => false];
- $list[$key]['indication'] = ['name' => '适应症' , 'text' => $value['indication'], 'active' => false];
- $list[$key]['storage'] = ['name' => '贮藏' , 'text' => $value['storage'], 'active' => false];
- $list[$key]['character'] = ['name' => '性状' , 'text' => $value['character'], 'active' => false];
- $list[$key]['approvalNumber'] = ['name' => '批准号' , 'text' => $value['approvalNumber'], 'active' => false];
- $list[$key]['productionEnterprise'] = ['name' => '生产企业' , 'text' => $value['productionEnterprise'], 'active' => false];
- $list[$key]['relateSick'] = ['name' => '相关疾病' , 'text' => $value['relateSick'], 'active' => false];
- $list[$key]['untowardEffect'] = ['name' => '不良反应' , 'text' => $value['untowardEffect'], 'active' => false];
- $list[$key]['majorConstituent'] = ['name' => '主要成分' , 'text' => $value['majorConstituent'], 'active' => true];
- }
- break;
- case "inspection":
- $query = "match (n:Inspection) return
- n.name as name , n.annotation as annotation , n.principle as principle , n.normalValue as normalValue ,
- n.clinicalSignificance as clinicalSignificance , n.reagent as reagent , n.operation as operation
- skip $limit limit 20";
- $data = $this->getAboutInfo($query);
- $query_count = "match (n:Inspection) return count(n) as count";
- $count = $this->getTotalCount($query_count);
- foreach ($data as $key => $value) {
- $list[$key]['sickness_name'] = $value['name'];
- $list[$key]['annotation'] = ['name' => '附注' , 'text' => $value['annotation'] ?? '' , 'active' => true];
- $list[$key]['principle'] = ['name' => '根源' , 'text' => $value['principle'] ?? '' , 'active' => false];
- $list[$key]['normalValue'] = ['name' => '正常值' , 'text' => $value['normalValue'] ?? '' , 'active' => false];
- $list[$key]['clinicalSignificance'] = ['name' => '临床意义' , 'text' => $value['clinicalSignificance'] ?? '' , 'active' => false];
- $list[$key]['reagent'] = ['name' => '试剂' , 'text' => $value['reagent'] ?? '' , 'active' => false];
- $list[$key]['operation'] = ['name' => '操作方法' , 'text' => $value['operation'] ?? '' , 'active' => false];
- }
- break;
- case "zysickness":
- $query = "match (n:SickNess {name:"."'".$department."'"."}) return n skip $limit limit 20";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $query_count = "match (n:SickNess {name:"."'".$department."'"."}) return count(n) as count";
- $count = $this->getTotalCount($query_count , 'zy');
- foreach ($data as $key => $value) {
- $list[$key]['sickness_name'] = $value['dialecticalName'];
- //$list[$key]['name'] = ['name' => '疾病名称' , 'text' => $value['name'] ?? '' , 'active' => false];
- $list[$key]['symptom'] = ['name' => '症见' , 'text' => $value['symptom'] ?? '' , 'active' => true];
- $list[$key]['apparatus'] = ['name' => '发病部位' , 'text' => $value['apparatus'] ?? '' , 'active' => false];
- $list[$key]['dialecticalName'] = ['name' => '证型' , 'text' => $value['dialecticalName'] ?? '' , 'active' => false];
- $list[$key]['tongueCondition'] = ['name' => '舌象' , 'text' => $value['tongueCondition'] ?? '' , 'active' => false];
- $list[$key]['pulseCondition'] = ['name' => '脉象' , 'text' => $value['pulseCondition'] ?? '' , 'active' => false];
- $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
- $list[$key]['therapeuticMethod'] = ['name' => '治法原则' , 'text' => $value['therapeuticMethod'] ?? '' , 'active' => false];
- $list[$key]['cnPatentMedicine'] = ['name' => '中成药' , 'text' => $value['cnPatentMedicine'] ?? '' , 'active' => false];
- $list[$key]['dietTherapy'] = ['name' => '中医食疗法' , 'text' => $value['dietTherapy'] ?? '' , 'active' => false];
- $list[$key]['tonicDiet'] = ['name' => '中医药膳' , 'text' => $value['tonicDiet'] ?? '' , 'active' => false];
- $list[$key]['acupuncturePoints'] = ['name' => '针灸穴位' , 'text' => $value['acupuncturePoints'] ?? '' , 'active' => false];
- $list[$key]['kgid'] = ['name' => 'kgid' , 'text' => $value['kgid'] ?? '' , 'active' => false];
- }
- break;
- case "icd10":
- $query = "match (n:SickNess {ICD10:"."'".$department."'"."}) return n skip $limit limit 20";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $query_count = "match (n:SickNess {name:"."'".$department."'"."}) return count(n) as count";
- $count = $this->getTotalCount($query_count , 'zy');
- foreach ($data as $key => $value) {
- $list[$key]['sickness_name'] = $value['dialecticalName'];
- //$list[$key]['name'] = ['name' => '疾病名称' , 'text' => $value['name'] ?? '' , 'active' => false];
- $list[$key]['symptom'] = ['name' => '症见' , 'text' => $value['symptom'] ?? '' , 'active' => true];
- $list[$key]['apparatus'] = ['name' => '发病部位' , 'text' => $value['apparatus'] ?? '' , 'active' => false];
- $list[$key]['dialecticalName'] = ['name' => '证型' , 'text' => $value['dialecticalName'] ?? '' , 'active' => false];
- $list[$key]['tongueCondition'] = ['name' => '舌象' , 'text' => $value['tongueCondition'] ?? '' , 'active' => false];
- $list[$key]['pulseCondition'] = ['name' => '脉象' , 'text' => $value['pulseCondition'] ?? '' , 'active' => false];
- $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
- $list[$key]['therapeuticMethod'] = ['name' => '治法原则' , 'text' => $value['therapeuticMethod'] ?? '' , 'active' => false];
- $list[$key]['cnPatentMedicine'] = ['name' => '中成药' , 'text' => $value['cnPatentMedicine'] ?? '' , 'active' => false];
- $list[$key]['dietTherapy'] = ['name' => '中医食疗法' , 'text' => $value['dietTherapy'] ?? '' , 'active' => false];
- $list[$key]['tonicDiet'] = ['name' => '中医药膳' , 'text' => $value['tonicDiet'] ?? '' , 'active' => false];
- $list[$key]['acupuncturePoints'] = ['name' => '针灸穴位' , 'text' => $value['acupuncturePoints'] ?? '' , 'active' => false];
- $list[$key]['kgid'] = ['name' => 'kgid' , 'text' => $value['kgid'] ?? '' , 'active' => false];
- }
- break;
- case "zcy":
- $query = "match(n:CnPatentMedicine {classification:"."'".$department."'"."}) return n skip $limit limit 20";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $query_count = "match(n:CnPatentMedicine {classification:"."'".$department."'"."}) return count(n) as count";
- $count = $this->getTotalCount($query_count , 'zy');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['classification'] = ['name' => '实体值' , 'text' => $value['classification'] ?? '' , 'active' => true];
- $list[$key]['efficacy'] = ['name' => '功效' , 'text' => $value['efficacy'] ?? '' , 'active' => false];
- $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
- $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
- }
- break;
- case "jl":
- $query = "match(n:ChannelCollateral {name:"."'".$department."'"."}) return n skip $limit limit 20";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $query_count = "match(n:ChannelCollateral {name:"."'".$department."'"."}) return count(n) as count";
- $count = $this->getTotalCount($query_count , 'zy');
- $list = [];
- foreach ($data as $key => $value)
- {
- $list[$key]['name'] = $value['name'];
- $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['aponeuroticSystem'] ?? '' , 'active' => true];
- $list[$key]['channelSymptom'] = ['name' => '经脉循行及其病候' , 'text' => $value['channelSymptom'] ?? '' , 'active' => false];
- $list[$key]['collateralSymptom'] = ['name' => '络脉循行及其病候' , 'text' => $value['collateralSymptom'] ?? '' , 'active' => false];
- $list[$key]['divergentMeridian'] = ['name' => '经别循行' , 'text' => $value['divergentMeridian'] ?? '' , 'active' => false];
- $list[$key]['aponeuroticSystem'] = ['name' => '经筋循行及其病候' , 'text' => $value['aponeuroticSystem'] ?? '' , 'active' => false];
- $list[$key]['clinicalFeature'] = ['name' => '经络症状主要临床表现' , 'text' => $value['clinicalFeature'] ?? '' , 'active' => false];
- $list[$key]['mechanismAnalysis'] = ['name' => '经络病机分析' , 'text' => $value['mechanismAnalysis'] ?? '' , 'active' => false];
- $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
- $list[$key]['kgid'] = ['name' => 'kgid' , 'text' => $value['kgid'] ?? '' , 'active' => false];
- }
- break;
- case "symptom":
- $query = "match(n:Thing)-[r:LinkLocation]-(m:Symptom) where n.name="."'".$department."'"." return m skip $limit limit $pagesize";
- $data = $this->getAboutInfo($query);
- $data = array_column($data , 'm');
- $query_count = "match(n:Thing)-[r:LinkLocation]-(m:Symptom) where n.name="."'".$department."'"." return count(m) as count";
- $count = $this->getTotalCount($query_count);
- $list = [];
- foreach ($data as $key => $value)
- {
- $list[$key]['sickness_name'] = $value['name'];
- $list[$key]['identify'] = ['name' => '识别' , 'text' => $value['identify'] ?? '' , 'active' => true];
- $list[$key]['abstract'] = ['name' => '摘要' , 'text' => $value['abstract'] ?? '' , 'active' => false];
- $list[$key]['precaution'] = ['name' => '预防措施' , 'text' => $value['precaution'] ?? '' , 'active' => false];
- $list[$key]['inspection'] = ['name' => '检查' , 'text' => $value['inspection'] ?? '' , 'active' => false];
- $list[$key]['etiology'] = ['name' => '病理' , 'text' => $value['etiology'] ?? '' , 'active' => false];
- $list[$key]['department'] = ['name' => '科室' , 'text' => $value['department'] ?? '' , 'active' => false];
- }
- break;
- case "identify":
- $query = "match (n:Disease) where n.antidiastole is not null return
- n.name as name , n.antidiastole as antidiastole
- skip $limit limit 20";
- $data = $this->getAboutInfo($query);
- $query_count = "match (n:Disease) return count(n) as count";
- $count = $this->getTotalCount($query_count);
- foreach ($data as $key => $value) {
- $list[$key]['sickness_name'] = $value['name'];
- $list[$key]['antidiastole'] = ['name' => '鉴别诊断' , 'text' => $value['antidiastole'] ?? '' , 'active' => true];
- }
- break;
- case "clinicalPathway":
- $like = Request::param('like_name') ?? '';
- if($like) {
- $ClinicalPathway = ClinicalPathway::where("clinical_pathway" , "like" , "%$like%" )->limit($limit , $pagesize)->select();
- $count = ClinicalPathway::where("clinical_pathway" , "like" , "%$like%" )->count();
- } else {
- $ClinicalPathway = ClinicalPathway::limit($limit , $pagesize)->select();
- $count = ClinicalPathway::count();
- }
- foreach ($ClinicalPathway as $key => $value) {
- $ClinicalPathway[$key]['file'] = $this->checkDocPdfIsExist('https://zskweb.jiankangche.cn/lcfiles/pdf2/lcpdf/lc/'.$value['clinical_pathway'].'.pdf');
- }
- return $this->_json_succ(['list' => $ClinicalPathway , 'count' => $count]);
- break;
- case "clinicTrial":
- $like = Request::param('like_name') ?? '';
- if($like) {
- $ClinicalTrial = ClinicalTrial::where("drug_name" , "like" , "%$like%" )
- ->whereOr("adaptation_disease" , "like" , "%$like%" )
- ->whereOr("experimental_popular_topic" , "like" , "%$like%" )
- ->limit($limit , $pagesize)->select();
- $count = ClinicalTrial::where("drug_name" , "like" , "%$like%" )->count();
- } else {
- $ClinicalTrial = ClinicalTrial::limit($limit , $pagesize)->select();
- $count = ClinicalTrial::count();
- }
- foreach ($ClinicalTrial as $key => $value) {
- $ClinicalTrial[$key]['file'] = $this->checkDocPdfIsExist('https://zskweb.jiankangche.cn/lcfiles/pdf2/docs/'.$value['register_number'].'.pdf');
- }
- return $this->_json_succ(['list' => $ClinicalTrial , 'count' => $count]);
- break;
- default:
- return $this->_json_error('请求有误!');
- break;
- }
- return $this->_json_succ(['list' => $list , 'count' => $count]);
- }
- private function checkDocPdfIsExist($url)
- {
- $check = get_headers($url);
- if(strstr($check[0] , '200')) {
- return $url;
- }
- return "";
- }
- private function getSicknessComplication($name , $tag)
- {
- $querydisease = "match p = (n:Disease)-[r:DiseaseComplication]->(m:Thing) where n.name= "."'".$name."'"." return p";
- $querysickness = "match p = (n:SickNess)-[r:SicknessComplication]->(m:Thing) where n.name= "."'".$name."'"." return p";
- $query = $tag == 'sickness' ? $querysickness : $querydisease;
- $result = $this->getComplication($query);
- if(!empty($result)) {
- foreach ($result as $key => $value) {
- if($name == $value['properties']) {
- unset($result[$key]);
- }
- }
- $complications = array_column($result , 'properties') ?? '';
- return ['name' => $complications , 'tag' => $tag];
- } else {
- return $complications = [];
- }
- }
- private function getZyRelationship($kgid , $tag)
- {
- $name = $kgid ?? '4d839135f8627092b95602acf6dbb5237fadab9419bc88f2199ad7fe2d90ae31';
- switch ($tag) {
- case "fj":
- $query = "match p = (n:SickNess)-[r:LinkPrescription]->(m:Thing) where n.kgid= "."'".$name."'"." return p";
- break;
- case "ys":
- $query = "match p = (n:SickNess)-[r:LinkTonicDiet]->(m:Thing) where n.kgid= "."'".$name."'"." return p";
- break;
- case "zcy":
- $query = "match p = (n:SickNess)-[r:LinkCnPatentMedicine]->(m:Thing) where n.kgid= "."'".$name."'"." return p";
- break;
- }
- $result = $this->getComplication($query , 'zy');
- $arr = array_column($result , 'properties') ?? '';
- if(empty($arr)) {
- return '';
- }
- return ['name' => $arr , 'tag' => $tag];
- }
- // 详情
- public function sickNessDetail()
- {
- //if(!$this->checkIslogin()) return $this->_json_error('请登录后查看!');
- $sickness = Request::param('sickness');
- $tag = Request::param('tag') ?? 'sickness';
- switch ($tag)
- {
- case "sickness":
- $query = "match(n:SickNess{name:"."'".$sickness."'"."})-[r:LInkeMedicineSickness]-(m:Medicine) return m.name as name limit 10";
- $medicine = $this->getAboutInfo($query);
- if($medicine) {
- $medicine = array_column($medicine , 'name');
- //$medicine = join(',' , $medicine);
- $medicine = ['name' => $medicine , 'tag' => 'medicine'];
- }
- $query_1 = "match(n:SickNess{name : "."'".$sickness."'"."}) return n";
- $info = array_column($this->getAboutInfo($query_1) , 'n');
- $data = [
- 'sickness_name' => ['name' => '名称' , 'text' => $info[0]['name'] ??''],
- 'alias' => ['name' => '疾病别名' , 'text' => $info[0]['alias'] ?? ''],
- 'ICD10' => ['name' => 'ICD10' , 'text' => $info[0]['ICD10'] ?? ''],
- 'department' => ['name' => '疾病类别' , 'text' => $info[0]['department'] ?? ''],
- 'complication' => ['name' => '并发症' , 'text' => $this->getSicknessComplication($sickness , 'sickness') ?? ''],
- 'medicine' => ['name' => '相关药品' , 'text' => $medicine ?? ''] ,
- 'introduction' => ['name' => '疾病概述' , 'text' => $info[0]['introduction'] ?? ''],
- 'epidemiology' => ['name' => '流行病学' , 'text' => $info[0]['epidemiology'] ?? ''],
- 'suitableFood' => ['name' => '宜吃食物' , 'text' => $info[0]['suitableFood'] ?? ''],
- 'notEat' => ['name' => '忌吃食物' , 'text' => $info[0]['notEat'] ?? ''],
- 'diagnostiCtriage' => ['name' => '诊断鉴别' , 'text' => $info[0]['diagnostiCtriage'] ?? ''],
- 'precaution' => ['name' => '预防' , 'text' => $info[0]['precaution'] ?? ''],
- 'nursingInfo' => ['name' => '护理信息' , 'text' => $info[0]['nursingInfo'] ?? ''],
- 'warmPrompt' => ['name' => '温馨提示' , 'text' => $info[0]['warmPrompt'] ?? ''],
- 'recommendedRecipe' => ['name' => '推荐食谱' , 'text' => $info[0]['recommendedRecipe'] ?? ''],
- 'treatmentOverview' => ['name' => '治疗概述' , 'text' => $info[0]['treatmentOverview'] ?? ''],
- 'inspection' => ['name' => '检查' , 'text' => $info[0]['inspection'] ?? ''],
- 'treatmenCommonSense' => ['name' => '治疗常识' , 'text' => $info[0]['treatmenCommonSense'] ?? ''],
- 'pathogenesis' => ['name' => '病因' , 'text' => $info[0]['pathogenesis'] ?? ''],
- 'basicKnowledgel' => ['name' => '基本常识' , 'text' => $info[0]['basicKnowledgel'] ?? ''],
- 'dietHealth' => ['name' => '饮食保健' , 'text' => $info[0]['dietHealth'] ?? ''],
- 'symptom' => ['name' => '证型' , 'text' => $info[0]['symptom'] ?? ''],
- 'complicationsOverview' => ['name' => '并发症概述', 'text' => $info[0]['complicationsOverview'] ?? ''],
- 'treatmentInfo' => ['name' => '治疗信息' , 'text' => $info[0]['treatmentInfo'] ?? ''],
- ];
- break;
- case "disease":
- $query = "match(n:Disease{name : "."'".$sickness."'"."}) return n";
- $info = array_column($this->getAboutInfo($query) , 'n');
- $query1 = "match(n:Thing)-[r:LinkMedicineDisease]-(m:Disease {name:"."'".$sickness."'"."}) return n.name as name limit 10";
- $medicine = $this->getAboutInfo($query1) ?? '';
- if($medicine) {
- $medicine = array_column($medicine , 'name');
- $medicine = ['name' => $medicine , 'tag' => 'medicine'];
- }
- $query2 = "match (n:Disease)-[r:LinkInspection]-(m:Thing) where n.name= "."'".$sickness."'"." return m.name as name limit 10";
- $inspection = $this->getAboutInfo($query2) ?? '';
- if($inspection) {
- $inspection = array_column($inspection , 'name');
- $inspection = ['name' => $inspection , 'tag' => 'inspection'];
- }
- $data = [
- 'sickness_name' => ['name' => '名称' , 'text' => $info[0]['name'] ??''],
- 'alias' => ['name' => '疾病别名' , 'text' => $info[0]['alias'] ?? ''],
- 'icd' => ['name' => 'ICD号' , 'text' => $info[0]['icd'] ?? ''],
- 'department' => ['name' => '疾病类别' , 'text' => $info[0]['department'] ?? ''],
- 'complication' => ['name' => '并发症' , 'text' => $this->getSicknessComplication($sickness , 'disease') ?? ''],
- 'epidemiology' => ['name' => '流行病学' , 'text' => $info[0]['epidemiology'] ?? ''],
- 'nameEn' => ['name' => '英文名称' , 'text' => $info[0]['nameEn'] ?? ''],
- 'sickOverview' => ['name' => '疾病概述' , 'text' => $info[0]['sickOverview'] ?? ''],
- 'clinicalFeature' => ['name' => '临床表现' , 'text' => $info[0]['clinicalFeature'] ?? ''],
- 'diagnosis' => ['name' => '诊断' , 'text' => $info[0]['diagnosis'] ?? ''],
- 'treatment' => ['name' => '治疗' , 'text' => $info[0]['treatment'] ?? ''],
- 'regularMedication' => ['name' => '相关药品' , 'text' => $medicine ?? []],
- 'pathogenesis' => ['name' => '发病机制' , 'text' => $info[0]['pathogenesis'] ?? ''],
- 'inspection' => ['name' => '相关检查' , 'text' => $inspection ?? []],
- 'laboratoryInspection' => ['name' => '实验室检查' , 'text' => $info[0]['laboratoryInspection'] ?? ''],
- 'etiology' => ['name' => '病因' , 'text' => $info[0]['etiology'] ?? ''],
- 'auxiliaryExamination' => ['name' => '其他辅助检查' , 'text' => $info[0]['auxiliaryExamination'] ?? ''],
- 'prognosis' => ['name' => '预后' , 'text' => $info[0]['prognosis'] ?? ''],
- 'complicationsOverview' => ['name' => '并发症概述' , 'text' => $info[0]['complicationsOverview'] ?? ''],
- 'precaution' => ['name' => '预防' , 'text' => $info[0]['precaution'] ?? ''],
- ];
- break;
- case "medicine":
- $query = "match(n:MedicineProduction {name : "."'".$sickness."'"."}) return n";
- $data = array_column($this->getAboutInfo($query) , 'n');
- $data = [
- 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ??''],
- 'pinyi' => ['name' => '汉语拼音' , 'text' => $data[0]['pinyin'] ?? ''],
- 'oldUse' => ['name' => '老人用药' , 'text' => $data[0]['oldUse'] ?? ''],
- 'chilldUse' => ['name' => '儿童用药' , 'text' => $data[0]['chilldUse'] ?? ''],
- 'medicinePregnant' => ['name' => '孕妇及哺乳期妇女用药' , 'text' => $data[0]['medicinePregnant'] ?? ''],
- 'usageDosage' => ['name' => '用法用量' , 'text' => $data[0]['usageDosage'] ?? ''],
- 'notes' => ['name' => '注意事项' , 'text' => $data[0]['notes'] ?? ''],
- 'periodValidity' => ['name' => '有效期' , 'text' => $data[0]['periodValidity'] ?? ''],
- 'indication' => ['name' => '适应症' , 'text' => $data[0]['indication'] ?? ''],
- 'storage' => ['name' => '贮藏' , 'text' => $data[0]['storage'] ?? ''],
- 'character' => ['name' => '性状' , 'text' => $data[0]['character'] ?? ''],
- 'contraindication' => ['name' => '禁忌' , 'text' => $data[0]['contraindication'] ?? ''],
- 'pharmacologyToxicology'=> ['name' => '药理毒理' , 'text' => $data[0]['pharmacologyToxicology'] ?? ''],
- 'specification' => ['name' => '规格' , 'text' => $data[0]['specification'] ?? ''],
- 'approvalNumber' => ['name' => '批准号' , 'text' => $data[0]['approvalNumber'] ?? ''],
- 'productionEnterprise' => ['name' => '生产企业' , 'text' => $data[0]['productionEnterprise'] ?? ''],
- 'relateSick' => ['name' => '相关疾病' , 'text' => $data[0]['relateSick'] ?? ''],
- 'untowardEffect' => ['name' => '不良反应' , 'text' => $data[0]['untowardEffect'] ?? ''],
- 'majorConstituent' => ['name' => '主要成分' , 'text' => $data[0]['majorConstituent'] ?? ''],
- ];
- break;
- case "inspection":
- $query = "match (n:Inspection {name : "."'".$sickness."'"."}) return n";
- $data = array_column($this->getAboutInfo($query) , 'n');
- $data = [
- 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
- 'overview' => ['name' => '概述' , 'text' => $data[0]['overview'] ?? ''],
- 'annotation' => ['name' => '附注' , 'text' => $data[0]['annotation'] ?? ''],
- 'principle' => ['name' => '原理' , 'text' => $data[0]['principle'] ?? ''],
- 'normalValue' => ['name' => '正常值' , 'text' => $data[0]['normalValue'] ?? ''],
- 'clinicalSignificance' => ['name' => '临床意义' , 'text' => $data[0]['clinicalSignificance'] ?? ''],
- 'reagent' => ['name' => '试剂' , 'text' => $data[0]['reagent'] ?? ''],
- 'operation' => ['name' => '操作方法' , 'text' => $data[0]['operation'] ?? ''],
- ];
- break;
- case "zysickness":
- case "icd10":
- $query = "match(n:SickNess {kgid:"."'".$sickness."'"."}) return n";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $data = [
- 'dialecticalName' => ['name' => '证型' , 'text' => $data[0]['dialecticalName'] ?? ''],
- 'ICD10' => ['name' => 'ICD10' , 'text' => $data[0]['ICD10'] ?? ''],
- 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
- 'fj' => ['name' => '方剂' , 'text' => $this->getZyRelationship($data[0]['kgid'] , 'fj') ?? ''],
- 'ys' => ['name' => '药膳' , 'text' => $this->getZyRelationship($data[0]['kgid'] , 'ys') ?? ''],
- 'zcy' => ['name' => '中成药' , 'text' => $this->getZyRelationship($data[0]['kgid'] , 'zcy') ?? ''],
- 'tongueCondition' => ['name' => '舌象' , 'text' => $data[0]['tongueCondition'] ?? ''],
- 'apparatus' => ['name' => '发病部位' , 'text' => $data[0]['apparatus'] ?? ''],
- 'source' => ['name' => '数据来源' , 'text' => $data[0]['source'] ?? ''],
- 'pulseCondition' => ['name' => '脉象' , 'text' => $data[0]['pulseCondition'] ?? ''],
- 'dietTherapy' => ['name' => '饮食疗法' , 'text' => $data[0]['dietTherapy'] ?? ''],
- 'symptom' => ['name' => '症见' , 'text' => $data[0]['symptom'] ?? ''],
- 'department' => ['name' => '科室' , 'text' => $data[0]['department'] ?? ''],
- 'acupuncturePoints' => ['name' => '针灸穴位' , 'text' => $data[0]['acupuncturePoints'] ?? ''],
- 'therapeuticMethod' => ['name' => '治疗方法' , 'text' => $data[0]['therapeuticMethod'] ?? ''],
- 'kgid' => ['name' => 'kgid' , 'text' => $data[0]['kgid'] ?? ''],
- ];
- break;
- case "zy":
- // 中药详情
- $query = "match(n:CnMedicinalCrop {kgid:"."'".$sickness."'"."}) return n";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $data = [
- 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
- 'toxicity' => ['name' => '毒性' , 'text' => $data[0]['toxicity'] ?? ''],
- 'indications' => ['name' => '功能主治' , 'text' => $data[0]['indications'] ?? ''],
- 'source' => ['name' => '来源' , 'text' => $data[0]['source'] ?? ''],
- 'medicineProperty' => ['name' => '药理作用' , 'text' => $data[0]['medicineProperty'] ?? ''],
- 'includedIn' => ['name' => '收录于' , 'text' => $data[0]['includedIn'] ?? ''],
- 'kgid' => ['name' => 'kgid' , 'text' => $data[0]['kgid'] ?? ''],
- ];
- break;
- case "zcy":
- $query = "match(n:CnPatentMedicine {name:"."'".$sickness."'"."}) return n";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $data = [
- 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
- 'classification' => ['name' => '分类' , 'text' => $data[0]['classification'] ?? ''],
- 'efficacy' => ['name' => '功效' , 'text' => $data[0]['efficacy'] ?? ''],
- 'indications' => ['name' => '主治' , 'text' => $data[0]['indications'] ?? ''],
- 'source' => ['name' => '数据来源' , 'text' => $data[0]['source'] ?? ''],
- ];
- break;
- case "fj":
- $query = "match(n:Prescription {name:"."'".$sickness."'"."}) return n";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $data = [
- 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
- 'composition' => ['name' => '方剂组成' , 'text' => $data[0]['composition'] ?? ''],
- 'medicinalCrop' => ['name' => '中药' , 'text' => $data[0]['medicinalCrop'] ?? ''],
- 'indications' => ['name' => '主治' , 'text' => $data[0]['indications'] ?? ''],
- 'solution' => ['name' => '方法/解法' , 'text' => $data[0]['solution'] ?? ''],
- 'usageDosage' => ['name' => '用法用量' , 'text' => $data[0]['usageDosage'] ?? ''],
- 'source' => ['name' => '数据来源' , 'text' => $data[0]['source'] ?? ''],
- ];
- break;
- case "ys":
- // 中医药膳
- $query = "match(n:TonicDiet {name:"."'".$sickness."'"."}) return n";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- // 获取药膳对应疾病 LinkTonicDiet
- $query1 = "match(n:Thing{name:"."'".$sickness."'"."})-[r:LinkTonicDiet]-(m:SickNess) return m.name as name , m.kgid as kgid limit 10";
- $getSicknessByLinkTonicDiet = $this->getAboutInfo($query1 , 'zy');
- foreach ($getSicknessByLinkTonicDiet as $key => $value) {
- $getSicknessByLinkTonicDiet[$key]['name'] = $getSicknessByLinkTonicDiet[$key]['name'].'-'. $getSicknessByLinkTonicDiet[$key]['kgid'];
- }
- if($getSicknessByLinkTonicDiet) {
- $sickNesss = array_column($getSicknessByLinkTonicDiet , 'name');
- foreach ($sickNesss as $k => $v) {
- $array = explode('-' , $v);
- $sickNessses[] = ['name' => $array[0] , 'kgid' => $array[1]];
- }
- $sickNesss = ['name' => $sickNessses , 'tag' => 'zysickness'];
- } else {
- $sickNesss = [];
- }
- $data = [
- 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
- 'composition' => ['name' => '药膳组成' , 'text' => $data[0]['composition'] ?? ''],
- 'sickness' => ['name' => '疾病' , 'text' => $sickNesss]
- ];
- break;
- case 'tz':
- $query = "match(n:Constitution {name:"."'".$sickness."'"."}) return n";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $data = [
- 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
- 'overallFeature' => ['name' => '总体特征' , 'text' => $data[0]['overallFeature'] ?? ''],
- 'psychologicalFeature' => ['name' => '心理特征' , 'text' => $data[0]['psychologicalFeature'] ?? ''],
- 'commonPerformance' => ['name' => '常见表现' , 'text' => $data[0]['commonPerformance'] ?? ''],
- 'tendency' => ['name' => '发病倾向' , 'text' => $data[0]['tendency'] ?? ''],
- 'exercise' => ['name' => '体育锻炼' , 'text' => $data[0]['exercise'] ?? ''],
- 'meridianHealth' => ['name' => '经络保健' , 'text' => $data[0]['meridianHealth'] ?? ''],
- 'medicineRegimen' => ['name' => '药物养生' , 'text' => $data[0]['medicineRegimen'] ?? ''],
- 'dietTherapy' => ['name' => '宜食疗' , 'text' => $data[0]['dietTherapy'] ?? ''],
- 'notEat' => ['name' => '不宜吃' , 'text' => $data[0]['notEat'] ?? ''],
- ];
- break;
- case 'jl':
- $query = "match(n:ChannelCollateral {kgid:"."'".$sickness."'"."}) return n";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $data = [
- 'sickness_name' => ['name' => '经络' , 'text' => $data[0]['name'] ?? ''],
- 'indications' => ['name' => '主治' , 'text' => $data[0]['indications'] ?? ''],
- 'channelSymptom' => ['name' => '经脉循行及其病候' , 'text' => $data[0]['channelSymptom'] ?? ''],
- 'collateralSymptom' => ['name' => '络脉循行及其病候' , 'text' => $data[0]['collateralSymptom'] ?? ''],
- 'divergentMeridian' => ['name' => '经别循行' , 'text' => $data[0]['divergentMeridian'] ?? ''],
- 'aponeuroticSystem' => ['name' => '经筋循行及其病候' , 'text' => $data[0]['aponeuroticSystem'] ?? ''],
- 'clinicalFeature' => ['name' => '经络症状主要临床表现', 'text' => $data[0]['clinicalFeature'] ?? ''],
- 'mechanismAnalysis' => ['name' => '经络病机分析' , 'text' => $data[0]['mechanismAnalysis'] ?? ''],
- 'source' => ['name' => '数据来源' , 'text' => $data[0]['source'] ?? ''],
- ];
- break;
- case 'xw':
- $query = "match(n:Acupoint {name:"."'".$sickness."'"."}) return n";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $data = [
- 'sickness_name' => ['name' => '穴位' , 'text' => $data[0]['name'] ?? ''],
- 'location' => ['name' => '定位' , 'text' => $data[0]['location'] ?? ''],
- 'indications' => ['name' => '主治' , 'text' => $data[0]['indications'] ?? ''],
- 'compatibility' => ['name' => '配伍' , 'text' => $data[0]['compatibility'] ?? ''],
- 'acupuncture' => ['name' => '针灸法' , 'text' => $data[0]['acupuncture'] ?? ''],
- 'notions' => ['name' => '附注' , 'text' => $data[0]['notions'] ?? ''],
- ];
- break;
- case "symptom":
- $query = "match(n:Symptom {name:"."'".$sickness."'"."}) return n";
- $data = $this->getAboutInfo($query);
- $data = array_column($data , 'n');
- // 医疗症状关系
- $query1 = "match(n:Thing)-[r:LinkDiseaseSymptom]-(m:Disease) where n.name="."'".$sickness."'"." return m.name as name";
- $data2 = $this->getAboutInfo($query1) ?? '';
- if($data2) {
- $diseaseSymptoms = array_column($data2 , 'name');
- $diseaseSymptoms = ['name' => $diseaseSymptoms , 'tag' => 'disease'];
- }
- $data = [
- 'sickness_name' => ['name' => '名称' , 'text' => $data[0]['name'] ?? ''],
- 'identify' => ['name' => '识别' , 'text' => $data[0]['identify'] ?? ''],
- 'abstract' => ['name' => '摘要' , 'text' => $data[0]['abstract'] ?? ''],
- 'precaution' => ['name' => '预防措施' , 'text' => $data[0]['precaution'] ?? ''],
- 'inspection' => ['name' => '检查' , 'text' => $data[0]['inspection'] ?? ''],
- 'diseaseSymptoms' => ['name' => '症状疾病' , 'text' => $diseaseSymptoms ?? []],
- 'etiology' => ['name' => '病理' , 'text' => $data[0]['etiology'] ?? ''],
- 'department' => ['name' => '科室' , 'text' => $data[0]['department'] ?? ''],
- ];
- break;
- }
- return $this->_json_succ($data);
- }
- // 详情图谱
- public function detailGraph()
- {
- //if(!$this->checkIslogin()) return $this->_json_error('请登录后查看!');
- $tag = Request::param('tag') ?? 'disease';
- $name = Request::param('name') ?? '肠道革兰阴性杆菌脑膜炎';
- switch ($tag)
- {
- case 'disease':
- $query = "match p = (n:Disease)-[r:DiseaseComplication]-(m:Thing) where n.name= "."'".$name."'"." return p";
- $query1 = "match p1 = (n:Disease)-[r:LinkMedicineDisease]-(m:Thing) where n.name= "."'".$name."'"." return p1";
- $query2 = "match p2 = (n:Disease)-[r:LinkInspection]-(m:Thing) where n.name= "."'".$name."'"." return p2";
- $data = $this->getXyR($query , $query1 , $query2);
- $list = [];
- foreach ($data as $key => $value) {
- $list['icd'] = ['name' => 'ICD' , 'text' => $data[$key]['start']['properties']['icd'] ?? ''];
- $list['name'] = ['name' => '名称' , 'text' => $data[$key]['start']['properties']['name'] ?? ''];
- $list['alias'] = ['name' => '疾病别名' , 'text' => $data[$key]['start']['properties']['alias'] ?? ''];
- $list['department'] = ['name' => '疾病类别' , 'text' => $data[$key]['start']['properties']['department'] ?? ''];
- $list['complication'] = ['name' => '并发症' , 'text' => $data[$key]['start']['properties']['complication'] ?? ''];
- $list['epidemiology'] = ['name' => '流行病学' , 'text' => $data[$key]['start']['properties']['epidemiology'] ?? ''];
- $list['nameEn'] = ['name' => '英文名称' , 'text' => $data[$key]['start']['properties']['nameEn'] ?? ''];
- $list['sickOverview'] = ['name' => '疾病概述' , 'text' => $data[$key]['start']['properties']['sickOverview'] ?? ''];
- $list['clinicalFeature'] = ['name' => '临床表现' , 'text' => $data[$key]['start']['properties']['clinicalFeature'] ?? ''];
- $list['diagnosis'] = ['name' => '诊断' , 'text' => $data[$key]['start']['properties']['diagnosis'] ?? ''];
- $list['treatment'] = ['name' => '治疗' , 'text' => $data[$key]['start']['properties']['treatment'] ?? ''];
- $list['regularMedication'] = ['name' => '相关药品' , 'text' => $data[$key]['start']['properties']['regularMedication'] ?? ''];
- $list['pathogenesis'] = ['name' => '发病机制' , 'text' => $data[$key]['start']['properties']['pathogenesis'] ?? ''];
- $list['inspection'] = ['name' => '相关检查' , 'text' => $data[$key]['start']['properties']['inspection'] ?? ''];
- $list['laboratoryInspection'] = ['name' => '实验室检查' , 'text' => $data[$key]['start']['properties']['laboratoryInspection'] ?? ''];
- $list['etiology'] = ['name' => '病因' , 'text' => $data[$key]['start']['properties']['etiology'] ?? ''];
- $list['auxiliaryExamination'] = ['name' => '其他辅助检查' , 'text' => $data[$key]['start']['properties']['auxiliaryExamination'] ?? ''];
- $list['prognosis'] = ['name' => '预后' , 'text' => $data[$key]['start']['properties']['prognosis'] ?? ''];
- $list['complicationsOverview'] = ['name' => '并发症概述' , 'text' => $data[$key]['start']['properties']['complicationsOverview'] ?? ''];
- $list['precaution'] = ['name' => '预防' , 'text' => $data[$key]['start']['properties']['precaution'] ?? ''];
- $data[$key]['start']['properties'] = $list;
- $data[$key]['start']['tag'] = $tag;
- if($value['relationship']['type'] == 'DISEASECOMPLICATION') {
- $listEnd = [
- 'name' => ['name' => '疾病名称' , 'text' => $data[$key]['end']['properties']['name']],
- ];
- $data[$key]['end']['properties'] = $listEnd;
- $data[$key]['end']['tag'] = $tag;
- }
- if($value['relationship']['type'] == 'LINKMEDICINEDISEASE') {
- $listEnd = [
- 'name' => ['name' => '名称' , 'text' =>$data[$key]['end']['properties']['name'] ?? ''],
- 'pinyi' => ['name' => '汉语拼音' , 'text' =>$data[$key]['end']['properties']['pinyin'] ?? ''],
- 'oldUse' => ['name' => '老人用药' , 'text' =>$data[$key]['end']['properties']['oldUse'] ?? ''],
- 'chilldUse' => ['name' => '儿童用药' , 'text' =>$data[$key]['end']['properties']['chilldUse'] ?? ''],
- 'medicinePregnant' => ['name' => '孕妇及哺乳期妇女用药' , 'text' =>$data[$key]['end']['properties']['medicinePregnant'] ?? ''],
- 'usageDosage' => ['name' => '用法用量' , 'text' =>$data[$key]['end']['properties']['usageDosage'] ?? ''],
- 'notes' => ['name' => '注意事项' , 'text' =>$data[$key]['end']['properties']['notes'] ?? ''],
- 'periodValidity' => ['name' => '有效期' , 'text' =>$data[$key]['end']['properties']['periodValidity'] ?? ''],
- 'indication' => ['name' => '适应症' , 'text' =>$data[$key]['end']['properties']['indication'] ?? ''],
- 'storage' => ['name' => '贮藏' , 'text' =>$data[$key]['end']['properties']['storage'] ?? ''],
- 'character' => ['name' => '性状' , 'text' =>$data[$key]['end']['properties']['character'] ?? ''],
- 'contraindication' => ['name' => '禁忌' , 'text' =>$data[$key]['end']['properties']['contraindication'] ?? ''],
- 'pharmacologyToxicology'=> ['name' => '药理毒理' , 'text' =>$data[$key]['end']['properties']['pharmacologyToxicology'] ?? ''],
- 'specification' => ['name' => '规格' , 'text' =>$data[$key]['end']['properties']['specification'] ?? ''],
- 'approvalNumber' => ['name' => '批准号' , 'text' =>$data[$key]['end']['properties']['approvalNumber'] ?? ''],
- 'productionEnterprise' => ['name' => '生产企业' , 'text' =>$data[$key]['end']['properties']['productionEnterprise'] ?? ''],
- 'relateSick' => ['name' => '相关疾病' , 'text' =>$data[$key]['end']['properties']['relateSick'] ?? ''],
- 'untowardEffect' => ['name' => '不良反应' , 'text' =>$data[$key]['end']['properties']['untowardEffect'] ?? ''],
- 'majorConstituent' => ['name' => '主要成分' , 'text' =>$data[$key]['end']['properties']['majorConstituent'] ?? ''],
- ];
- $data[$key]['end']['properties'] = $listEnd;
- $data[$key]['end']['tag'] = 'medicine';
- }
- if($value['relationship']['type'] == 'LINKINSPECTION') {
- $listEnd = [
- 'name' => ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''],
- 'overview' => ['name' => '概述' , 'text' => $data[$key]['end']['properties']['overview'] ?? ''],
- 'annotation' => ['name' => '附注' , 'text' => $data[$key]['end']['properties']['annotation'] ?? ''],
- 'principle' => ['name' => '原理' , 'text' => $data[$key]['end']['properties']['principle'] ?? ''],
- 'normalValue' => ['name' => '正常值' , 'text' => $data[$key]['end']['properties']['normalValue'] ?? ''],
- 'clinicalSignificance' => ['name' => '临床意义' , 'text' => $data[$key]['end']['properties']['clinicalSignificance'] ?? ''],
- 'reagent' => ['name' => '试剂' , 'text' => $data[$key]['end']['properties']['reagent'] ?? ''],
- 'operation' => ['name' => '操作方法' , 'text' => $data[$key]['end']['properties']['operation'] ?? ''],
- ];
- $data[$key]['end']['properties'] = $listEnd;
- $data[$key]['end']['tag'] = 'inspection';
- }
- }
- break;
- case 'sickness':
- $query = "match p = (n:SickNess)-[r:SicknessComplication]-(m:Thing) where n.name= "."'".$name."'"." return p";
- $query1 = "match p1 = (n:SickNess)-[r:LInkeMedicineSickness]-(m:Thing) where n.name= "."'".$name."'"." return p1";
- $data = $this->getXyR($query , $query1);
- $list = [];
- foreach ($data as $key => $value) {
- $list['ICD10'] = ['name' => 'ICD10' , 'text' => $data[$key]['start']['properties']['ICD10'] ?? ''];
- $list['name'] = ['name' => '名称' , 'text' => $data[$key]['start']['properties']['name'] ?? ''];
- $list['alias'] = ['name' => '疾病别名' , 'text' => $data[$key]['start']['properties']['alias'] ?? ''];
- $list['department'] = ['name' => '疾病类别' , 'text' => $data[$key]['start']['properties']['department'] ?? ''];
- $list['complication'] = ['name' => '并发症' , 'text' => $data[$key]['start']['properties']['complication'] ?? ''];
- $list['introduction'] = ['name' => '疾病概述' , 'text' => $data[$key]['start']['properties']['introduction'] ?? ''];
- $list['epidemiology'] = ['name' => '流行病学' , 'text' => $data[$key]['start']['properties']['epidemiology'] ?? ''];
- $list['suitableFood'] = ['name' => '宜吃食物' , 'text' => $data[$key]['start']['properties']['suitableFood'] ?? ''];
- $list['notEat'] = ['name' => '忌吃食物' , 'text' => $data[$key]['start']['properties']['notEat'] ?? ''];
- $list['diagnostiCtriage'] = ['name' => '诊断鉴别' , 'text' => $data[$key]['start']['properties']['diagnostiCtriage'] ?? ''];
- $list['precaution'] = ['name' => '预防' , 'text' => $data[$key]['start']['properties']['precaution'] ?? ''];
- $list['nursingInfo'] = ['name' => '护理信息' , 'text' => $data[$key]['start']['properties']['nursingInfo'] ?? ''];
- $list['warmPrompt'] = ['name' => '温馨提示' , 'text' => $data[$key]['start']['properties']['warmPrompt'] ?? ''];
- $list['recommendedRecipe'] = ['name' => '推荐食谱' , 'text' => $data[$key]['start']['properties']['recommendedRecipe'] ?? ''];
- $list['treatmentOverview'] = ['name' => '治疗概述' , 'text' => $data[$key]['start']['properties']['treatmentOverview'] ?? ''];
- $list['inspection'] = ['name' => '检查' , 'text' => $data[$key]['start']['properties']['inspection'] ?? ''];
- $list['treatmenCommonSense'] = ['name' => '治疗常识' , 'text' => $data[$key]['start']['properties']['treatmenCommonSense'] ?? ''];
- $list['pathogenesis'] = ['name' => '病因' , 'text' => $data[$key]['start']['properties']['pathogenesis'] ?? ''];
- $list['basicKnowledgel'] = ['name' => '基本常识' , 'text' => $data[$key]['start']['properties']['basicKnowledgel'] ?? ''];
- $list['dietHealth'] = ['name' => '饮食保健' , 'text' => $data[$key]['start']['properties']['dietHealth'] ?? ''];
- $list['symptom'] = ['name' => '检查' , 'text' => $data[$key]['start']['properties']['symptom'] ?? ''];
- $list['complicationsOverview'] = ['name' => '并发症概述' , 'text' => $data[$key]['start']['properties']['complicationsOverview'] ?? ''];
- $list['treatmentInfo'] = ['name' => '治疗信息' , 'text' => $data[$key]['start']['properties']['treatmentInfo'] ?? ''];
- $data[$key]['start']['properties'] = $list;
- $data[$key]['start']['tag'] = $tag;
- if($data[$key]['relationship']['type'] == 'SICKNESSCOMPLICATION') {
- $listEnd['name'] = ['name' => '疾病名称' , 'text' => $data[$key]['end']['properties']['name']];
- $data[$key]['end']['properties'] = $listEnd;
- $data[$key]['end']['tag'] = $tag;
- }
- if($data[$key]['relationship']['type'] == 'LINKEMEDICINESICKNESS') {
- $listEnd = [
- 'name' => ['name' => '名称' , 'text' =>$data[$key]['end']['properties']['name'] ?? ''],
- 'pinyi' => ['name' => '汉语拼音' , 'text' =>$data[$key]['end']['properties']['pinyin'] ?? ''],
- 'oldUse' => ['name' => '老人用药' , 'text' =>$data[$key]['end']['properties']['oldUse'] ?? ''],
- 'chilldUse' => ['name' => '儿童用药' , 'text' =>$data[$key]['end']['properties']['chilldUse'] ?? ''],
- 'medicinePregnant' => ['name' => '孕妇及哺乳期妇女用药' , 'text' =>$data[$key]['end']['properties']['medicinePregnant'] ?? ''],
- 'usageDosage' => ['name' => '用法用量' , 'text' =>$data[$key]['end']['properties']['usageDosage'] ?? ''],
- 'notes' => ['name' => '注意事项' , 'text' =>$data[$key]['end']['properties']['notes'] ?? ''],
- 'periodValidity' => ['name' => '有效期' , 'text' =>$data[$key]['end']['properties']['periodValidity'] ?? ''],
- 'indication' => ['name' => '适应症' , 'text' =>$data[$key]['end']['properties']['indication'] ?? ''],
- 'storage' => ['name' => '贮藏' , 'text' =>$data[$key]['end']['properties']['storage'] ?? ''],
- 'character' => ['name' => '性状' , 'text' =>$data[$key]['end']['properties']['character'] ?? ''],
- 'contraindication' => ['name' => '禁忌' , 'text' =>$data[$key]['end']['properties']['contraindication'] ?? ''],
- 'pharmacologyToxicology'=> ['name' => '药理毒理' , 'text' =>$data[$key]['end']['properties']['pharmacologyToxicology'] ?? ''],
- 'specification' => ['name' => '规格' , 'text' =>$data[$key]['end']['properties']['specification'] ?? ''],
- 'approvalNumber' => ['name' => '批准号' , 'text' =>$data[$key]['end']['properties']['approvalNumber'] ?? ''],
- 'productionEnterprise' => ['name' => '生产企业' , 'text' =>$data[$key]['end']['properties']['productionEnterprise'] ?? ''],
- 'relateSick' => ['name' => '相关疾病' , 'text' =>$data[$key]['end']['properties']['relateSick'] ?? ''],
- 'untowardEffect' => ['name' => '不良反应' , 'text' =>$data[$key]['end']['properties']['untowardEffect'] ?? ''],
- 'majorConstituent' => ['name' => '主要成分' , 'text' =>$data[$key]['end']['properties']['majorConstituent'] ?? ''],
- ];
- $data[$key]['end']['properties'] = $listEnd;
- $data[$key]['end']['tag'] = 'medicine';
- }
- }
- break;
- case 'zysickness':
- case 'icd10':
- $query = "match p = (n:SickNess)-[r:LinkCnPatentMedicine]-(m:Thing) where n.kgid= "."'".$name."'"." return p";
- $query1 = "match p1 = (n:SickNess)-[r:LinkConstitution]-(m:Thing) where n.kgid= "."'".$name."'"." return p1";
- $query2 = "match p2 = (n:SickNess)-[r:LinkPrescription]-(m:Thing) where n.kgid= "."'".$name."'"." return p2";
- $query3 = "match p3 = (n:SickNess)-[r:LinkTonicDiet]-(m:Thing) where n.kgid= "."'".$name."'"." return p3";
- $data = $this->getZyR($query , $query1 , $query2 , $query3);
- $list = [];
- foreach ($data as $key => $value) {
- $list['ICD10'] = ['name' => 'ICD10' , 'text' => $data[$key]['start']['properties']['ICD10'] ?? ''];
- $list['name'] = ['name' => '名称' , 'text' => $data[$key]['start']['properties']['name'] ?? ''];
- $list['tongueCondition'] = ['name' => '舌象' , 'text' => $data[$key]['start']['properties']['tongueCondition'] ?? ''];
- $list['apparatus'] = ['name' => '发病部位' , 'text' => $data[$key]['start']['properties']['apparatus'] ?? ''];
- $list['source'] = ['name' => '数据来源' , 'text' => $data[$key]['start']['properties']['source'] ?? ''];
- $list['pulseCondition'] = ['name' => '脉象' , 'text' => $data[$key]['start']['properties']['pulseCondition'] ?? ''];
- $list['dietTherapy'] = ['name' => '饮食疗法' , 'text' => $data[$key]['start']['properties']['dietTherapy'] ?? ''];
- $list['symptom'] = ['name' => '症见' , 'text' => $data[$key]['start']['properties']['symptom'] ?? ''];
- $list['department'] = ['name' => '科室' , 'text' => $data[$key]['start']['properties']['department'] ?? ''];
- $list['acupuncturePoints'] = ['name' => '针灸穴位' , 'text' => $data[$key]['start']['properties']['acupuncturePoints'] ?? ''];
- $list['dialecticalName'] = ['name' => '证型' , 'text' => $data[$key]['start']['properties']['dialecticalName'] ?? ''];
- $list['therapeuticMethod'] = ['name' => '治疗方法' , 'text' => $data[$key]['start']['properties']['therapeuticMethod'] ?? ''];
- $data[$key]['start']['properties'] = $list;
- // 中成药关系
- if($value['relationship']['type'] == 'LINKCNPATENTMEDICINE') {
- $listEnd = [
- 'name' => ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''],
- 'classification' => ['name' => '分类' , 'text' => $data[$key]['end']['properties']['classification'] ?? ''],
- 'efficacy' => ['name' => '功效' , 'text' => $data[$key]['end']['properties']['efficacy'] ?? ''],
- 'indications' => ['name' => '主治' , 'text' => $data[$key]['end']['properties']['indications'] ?? ''],
- 'source' => ['name' => '数据来源' , 'text' => $data[$key]['end']['properties']['source'] ?? ''],
- ];
- $data[$key]['end']['properties'] = $listEnd;
- $data[$key]['end']['tag'] = 'zcy';
- }
- // 方剂关系
- if($value['relationship']['type'] == 'LINKPRESCRIPTION') {
- $listEnd = [
- 'name' => ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''],
- 'composition' => ['name' => '方剂组成' , 'text' => $data[$key]['end']['properties']['composition'] ?? ''],
- 'medicinalCrop' => ['name' => '中药' , 'text' => $data[$key]['end']['properties']['medicinalCrop'] ?? ''],
- 'indications' => ['name' => '主治' , 'text' => $data[$key]['end']['properties']['indications'] ?? ''],
- 'solution' => ['name' => '方法/解法' , 'text' => $data[$key]['end']['properties']['solution'] ?? ''],
- 'usageDosage' => ['name' => '用法用量' , 'text' => $data[$key]['end']['properties']['usageDosage'] ?? ''],
- 'source' => ['name' => '数据来源' , 'text' => $data[$key]['end']['properties']['source'] ?? ''],
- ];
- $data[$key]['end']['properties'] = $listEnd;
- $data[$key]['end']['tag'] = 'fj';
- }
- // 药膳关系
- if($value['relationship']['type'] == 'LINKTONICDIET') {
- $listEnd = [
- 'name' => ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''],
- 'composition' => ['name' => '药膳组成' , 'text' => $data[$key]['end']['properties']['composition'] ?? ''],
- ];
- $data[$key]['end']['properties'] = $listEnd;
- $data[$key]['end']['tag'] = 'ys';
- }
- // 体质关系LinkConstitution
- if($value['relationship']['type'] == 'LINKCONSTITUTION') {
- $listEnd = [
- 'name' => ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''],
- 'overallFeature' => ['name' => '总体特征' , 'text' => $data[$key]['end']['properties']['overallFeature'] ?? ''],
- 'psychologicalFeature' => ['name' => '心理特征' , 'text' => $data[$key]['end']['properties']['psychologicalFeature'] ?? ''],
- 'commonPerformance' => ['name' => '常见表现' , 'text' => $data[$key]['end']['properties']['commonPerformance'] ?? ''],
- 'tendency' => ['name' => '发病倾向' , 'text' => $data[$key]['end']['properties']['tendency'] ?? ''],
- 'exercise' => ['name' => '体育锻炼' , 'text' => $data[$key]['end']['properties']['exercise'] ?? ''],
- 'meridianHealth' => ['name' => '经络保健' , 'text' => $data[$key]['end']['properties']['meridianHealth'] ?? ''],
- 'medicineRegimen' => ['name' => '药物养生' , 'text' => $data[$key]['end']['properties']['medicineRegimen'] ?? ''],
- 'dietTherapy' => ['name' => '宜食疗' , 'text' => $data[$key]['end']['properties']['dietTherapy'] ?? ''],
- 'notEat' => ['name' => '不宜吃' , 'text' => $data[$key]['end']['properties']['notEat'] ?? ''],
- ];
- $data[$key]['end']['properties'] = $listEnd;
- $data[$key]['end']['tag'] = 'tj';
- }
- }
- break;
- case 'zy':
- // 中药详情图谱
- $query = "match(n:CnMedicinalCrop {kgid:"."'".$name."'"."}) return n";
- $data = $this->getSingle($query , 'zy');
- $data1['name'] = ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''];
- $data1['toxicity'] = ['name' => '毒性' , 'text' => $data[0]['start']['properties']['toxicity'] ?? ''];
- $data1['indications'] = ['name' => '功能主治' , 'text' => $data[0]['start']['properties']['indications'] ?? ''];
- $data1['source'] = ['name' => '来源' , 'text' => $data[0]['start']['properties']['source'] ?? ''];
- $data1['pharmacology'] = ['name' => '药理作用' , 'text' => $data[0]['start']['properties']['pharmacology'] ?? ''];
- $data1['includedIn'] = ['name' => '收录于' , 'text' => $data[0]['start']['properties']['includedIn'] ?? ''];
- $data[0]['start']['properties'] = $data1;
- $data[0]['start']['tag'] = 'zy';
- break;
- case 'medicine':
- $query = "match(n:MedicineProduction {name:"."'".$name."'"."}) return n";
- $data = $this->getSingle($query);
- $data1 = [
- 'name' => ['name' => '名称' , 'text' =>$data[0]['start']['properties']['name'] ?? ''],
- 'pinyi' => ['name' => '汉语拼音' , 'text' =>$data[0]['start']['properties']['pinyin'] ?? ''],
- 'oldUse' => ['name' => '老人用药' , 'text' =>$data[0]['start']['properties']['oldUse'] ?? ''],
- 'chilldUse' => ['name' => '儿童用药' , 'text' =>$data[0]['start']['properties']['chilldUse'] ?? ''],
- 'medicinePregnant' => ['name' => '孕妇及哺乳期妇女用药' , 'text' =>$data[0]['start']['properties']['medicinePregnant'] ?? ''],
- 'usageDosage' => ['name' => '用法用量' , 'text' =>$data[0]['start']['properties']['usageDosage'] ?? ''],
- 'notes' => ['name' => '注意事项' , 'text' =>$data[0]['start']['properties']['notes'] ?? ''],
- 'periodValidity' => ['name' => '有效期' , 'text' =>$data[0]['start']['properties']['periodValidity'] ?? ''],
- 'indication' => ['name' => '适应症' , 'text' =>$data[0]['start']['properties']['indication'] ?? ''],
- 'storage' => ['name' => '贮藏' , 'text' =>$data[0]['start']['properties']['storage'] ?? ''],
- 'character' => ['name' => '性状' , 'text' =>$data[0]['start']['properties']['character'] ?? ''],
- 'contraindication' => ['name' => '禁忌' , 'text' =>$data[0]['start']['properties']['contraindication'] ?? ''],
- 'pharmacologyToxicology'=> ['name' => '药理毒理' , 'text' =>$data[0]['start']['properties']['pharmacologyToxicology'] ?? ''],
- 'specification' => ['name' => '规格' , 'text' =>$data[0]['start']['properties']['specification'] ?? ''],
- 'approvalNumber' => ['name' => '批准号' , 'text' =>$data[0]['start']['properties']['approvalNumber'] ?? ''],
- 'productionEnterprise' => ['name' => '生产企业' , 'text' =>$data[0]['start']['properties']['productionEnterprise'] ?? ''],
- 'relateSick' => ['name' => '相关疾病' , 'text' =>$data[0]['start']['properties']['relateSick'] ?? ''],
- 'untowardEffect' => ['name' => '不良反应' , 'text' =>$data[0]['start']['properties']['untowardEffect'] ?? ''],
- 'majorConstituent' => ['name' => '主要成分' , 'text' =>$data[0]['start']['properties']['majorConstituent'] ?? ''],
- ];
- $data[0]['start']['properties'] = $data1;
- $data[0]['start']['tag'] = $tag;
- break;
- case 'inspection':
- $query = "match(n:Inspection {name:"."'".$name."'"."}) return n";
- $data = $this->getSingle($query);
- $data1 = [
- 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
- 'overview' => ['name' => '概述' , 'text' => $data[0]['start']['properties']['overview'] ?? ''],
- 'annotation' => ['name' => '附注' , 'text' => $data[0]['start']['properties']['annotation'] ?? ''],
- 'principle' => ['name' => '原理' , 'text' => $data[0]['start']['properties']['principle'] ?? ''],
- 'normalValue' => ['name' => '正常值' , 'text' => $data[0]['start']['properties']['normalValue'] ?? ''],
- 'clinicalSignificance' => ['name' => '临床表现' , 'text' => $data[0]['start']['properties']['clinicalSignificance'] ?? ''],
- 'reagent' => ['name' => '试剂' , 'text' => $data[0]['start']['properties']['reagent'] ?? ''],
- 'operation' => ['name' => '操作方法' , 'text' => $data[0]['start']['properties']['operation'] ?? ''],
- ];
- $data[0]['start']['properties'] = $data1;
- $data[0]['start']['tag'] = $tag;
- break;
- case 'zcy':
- $query = "match(n:CnPatentMedicine {name:"."'".$name."'"."}) return n";
- $data = $this->getSingle($query , 'zy');
- $data1 = [
- 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
- 'classification' => ['name' => '分类' , 'text' => $data[0]['start']['properties']['classification'] ?? ''],
- 'efficacy' => ['name' => '功效' , 'text' => $data[0]['start']['properties']['efficacy'] ?? ''],
- 'indications' => ['name' => '主治' , 'text' => $data[0]['start']['properties']['indications'] ?? ''],
- 'source' => ['name' => '数据来源' , 'text' => $data[0]['start']['properties']['source'] ?? ''],
- ];
- $data[0]['start']['properties'] = $data1;
- $data[0]['start']['tag'] = $tag;
- break;
- case 'ys':
- // 中医药膳 [LinkTonicDiet 药膳关系 ]
- $query = "match p = (n:SickNess)-[r:LinkTonicDiet]-(m:Thing) where m.name= "."'".$name."'"." return p";
- $data = $this->getZyR($query , '' , '' , '');
- $dataTwo = $data;
- $list = [];
- foreach ($data as $key => $value) {
- $list['name'] = ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''];
- $list['composition'] = ['name' => '药膳组成' , 'text' => $data[$key]['end']['properties']['composition'] ?? ''];
- $listEnd['ICD10'] = ['name' => 'ICD10' , 'text' => $data[$key]['start']['properties']['ICD10'] ?? ''];
- $listEnd['name'] = ['name' => '名称' , 'text' => $data[$key]['start']['properties']['name'] ?? ''];
- $listEnd['tongueCondition'] = ['name' => '舌象' , 'text' => $data[$key]['start']['properties']['tongueCondition'] ?? ''];
- $listEnd['apparatus'] = ['name' => '发病部位' , 'text' => $data[$key]['start']['properties']['apparatus'] ?? ''];
- $listEnd['source'] = ['name' => '数据来源' , 'text' => $data[$key]['start']['properties']['source'] ?? ''];
- $listEnd['pulseCondition'] = ['name' => '脉象' , 'text' => $data[$key]['start']['properties']['pulseCondition'] ?? ''];
- $listEnd['dietTherapy'] = ['name' => '饮食疗法' , 'text' => $data[$key]['start']['properties']['dietTherapy'] ?? ''];
- $listEnd['symptom'] = ['name' => '症见' , 'text' => $data[$key]['start']['properties']['symptom'] ?? ''];
- $listEnd['department'] = ['name' => '科室' , 'text' => $data[$key]['start']['properties']['department'] ?? ''];
- $listEnd['acupuncturePoints'] = ['name' => '针灸穴位' , 'text' => $data[$key]['start']['properties']['acupuncturePoints'] ?? ''];
- $listEnd['dialecticalName'] = ['name' => '证型' , 'text' => $data[$key]['start']['properties']['dialecticalName'] ?? ''];
- $listEnd['therapeuticMethod'] = ['name' => '治疗方法' , 'text' => $data[$key]['start']['properties']['therapeuticMethod'] ?? ''];
- $listEnd['kgid'] = ['name' => 'kgid' , 'text' => $data[$key]['start']['properties']['kgid'] ?? ''];
- // 调换id
- $startIdentity = $data[$key]['end']['identity'];
- $endIdentity = $data[$key]['start']['identity'];
- $data[$key]['start']['properties'] = $list;
- $data[$key]['start']['tag'] = $tag;
- $data[$key]['start']['identity'] = $startIdentity;
- $data[$key]['end']['properties'] = $listEnd;
- $data[$key]['end']['tag'] = 'zysickness';
- $data[$key]['end']['identity'] = $endIdentity;
- }
- break;
- case 'fj':
- $query = "match(n:Prescription {name:"."'".$name."'"."}) return n";
- $data = $this->getSingle($query , 'zy');
- $data1 = [
- 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
- 'composition' => ['name' => '方剂组成' , 'text' => $data[0]['start']['properties']['composition'] ?? ''],
- 'medicinalCrop' => ['name' => '中药' , 'text' => $data[0]['start']['properties']['medicinalCrop'] ?? ''],
- 'indications' => ['name' => '主治' , 'text' => $data[0]['start']['properties']['indications'] ?? ''],
- 'solution' => ['name' => '方法/解法' , 'text' => $data[0]['start']['properties']['solution'] ?? ''],
- 'usageDosage' => ['name' => '用法用量' , 'text' => $data[0]['start']['properties']['usageDosage'] ?? ''],
- 'source' => ['name' => '数据来源' , 'text' => $data[0]['start']['properties']['source'] ?? ''],
- ];
- $data[0]['start']['properties'] = $data1;
- $data[0]['start']['tag'] = $tag;
- break;
- case 'tz':
- $query = "match(n:Constitution {name:"."'".$name."'"."}) return n";
- $data = $this->getSingle($query , 'zy');
- $data1 = [
- 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
- 'overallFeature' => ['name' => '总体特征' , 'text' => $data[0]['start']['properties']['overallFeature'] ?? ''],
- 'psychologicalFeature' => ['name' => '心理特征' , 'text' => $data[0]['start']['properties']['psychologicalFeature'] ?? ''],
- 'commonPerformance' => ['name' => '常见表现' , 'text' => $data[0]['start']['properties']['commonPerformance'] ?? ''],
- 'tendency' => ['name' => '发病倾向' , 'text' => $data[0]['start']['properties']['tendency'] ?? ''],
- 'exercise' => ['name' => '体育锻炼' , 'text' => $data[0]['start']['properties']['exercise'] ?? ''],
- 'meridianHealth' => ['name' => '经络保健' , 'text' => $data[0]['start']['properties']['meridianHealth'] ?? ''],
- 'medicineRegimen' => ['name' => '药物养生' , 'text' => $data[0]['start']['properties']['medicineRegimen'] ?? ''],
- 'dietTherapy' => ['name' => '宜食疗' , 'text' => $data[0]['start']['properties']['dietTherapy'] ?? ''],
- 'notEat' => ['name' => '不宜吃' , 'text' => $data[0]['start']['properties']['notEat'] ?? ''],
- ];
- $data[0]['start']['properties'] = $data1;
- $data[0]['start']['tag'] = $tag;
- break;
- case 'xw':
- $query = "match(n:Acupoint {name:"."'".$name."'"."}) return n";
- $data = $this->getSingle($query , 'zy');
- $data1 = [
- 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
- 'location' => ['name' => '定位' , 'text' => $data[0]['start']['properties']['location'] ?? ''],
- 'indications' => ['name' => '主治' , 'text' => $data[0]['start']['properties']['indications'] ?? ''],
- 'compatibility' => ['name' => '配伍' , 'text' => $data[0]['start']['properties']['compatibility'] ?? ''],
- 'acupuncture' => ['name' => '针灸法' , 'text' => $data[0]['start']['properties']['acupuncture'] ?? ''],
- 'notions' => ['name' => '附注' , 'text' => $data[0]['start']['properties']['notions'] ?? ''],
- ];
- $data[0]['start']['properties'] = $data1;
- $data[0]['start']['tag'] = $tag;
- break;
- case 'jl':
- $query = "match(n:ChannelCollateral {kgid:"."'".$name."'"."}) return n";
- $data = $this->getSingle($query , 'zy');
- $data1 = [
- 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
- 'indications' => ['name' => '主治' , 'text' => $data[0]['start']['properties']['indications'] ?? ''],
- 'channelSymptom' => ['name' => '经脉循行及其病候' , 'text' => $data[0]['start']['properties']['channelSymptom'] ?? ''],
- 'collateralSymptom' => ['name' => '络脉循行及其病候' , 'text' => $data[0]['start']['properties']['collateralSymptom'] ?? ''],
- 'divergentMeridian' => ['name' => '经别循行' , 'text' => $data[0]['start']['properties']['divergentMeridian'] ?? ''],
- 'aponeuroticSystem' => ['name' => '经筋循行及其病候' , 'text' => $data[0]['start']['properties']['aponeuroticSystem'] ?? ''],
- 'clinicalFeature' => ['name' => '经络症状主要临床表现' , 'text' => $data[0]['start']['properties']['clinicalFeature'] ?? ''],
- 'mechanismAnalysis' => ['name' => '经络病机分析' , 'text' => $data[0]['start']['properties']['mechanismAnalysis'] ?? ''],
- 'source' => ['name' => '数据来源' , 'text' => $data[0]['start']['properties']['source'] ?? ''],
- ];
- $data[0]['start']['properties'] = $data1;
- $data[0]['start']['tag'] = $tag;
- break;
- case 'symptom':
- $query = "match p = (n:Thing)-[r:LinkDiseaseSymptom]-(m:Disease) where n.name= "."'".$name."'"." return p";
- $data = $this->getXyR($query);
- if(empty($data)) {
- $query = "match(n:Symptom {name:"."'".$name."'"."}) return n";
- $data = $this->getSingle($query);
- $data1 = [
- 'name' => ['name' => '名称' , 'text' => $data[0]['start']['properties']['name'] ?? ''],
- 'indications' => ['name' => '主治' , 'text' => $data[0]['start']['properties']['indications'] ?? ''],
- 'channelSymptom' => ['name' => '经脉循行及其病候' , 'text' => $data[0]['start']['properties']['channelSymptom'] ?? ''],
- 'collateralSymptom' => ['name' => '络脉循行及其病候' , 'text' => $data[0]['start']['properties']['collateralSymptom'] ?? ''],
- 'divergentMeridian' => ['name' => '经别循行' , 'text' => $data[0]['start']['properties']['divergentMeridian'] ?? ''],
- 'aponeuroticSystem' => ['name' => '经筋循行及其病候' , 'text' => $data[0]['start']['properties']['aponeuroticSystem'] ?? ''],
- 'clinicalFeature' => ['name' => '经络症状主要临床表现' , 'text' => $data[0]['start']['properties']['clinicalFeature'] ?? ''],
- 'mechanismAnalysis' => ['name' => '经络病机分析' , 'text' => $data[0]['start']['properties']['mechanismAnalysis'] ?? ''],
- 'source' => ['name' => '数据来源' , 'text' => $data[0]['start']['properties']['source'] ?? ''],
- ];
- $data[0]['start']['properties'] = $data1;
- $data[0]['start']['tag'] = $tag;
- } else {
- foreach ($data as $key => $value)
- {
- $data[$key]['start'] = $value['end'];
- $data[$key]['end'] = $value['start'];
- $data[$key]['relationship']['start'] = $value['relationship']['end'];
- $data[$key]['relationship']['end'] = $value['relationship']['start'];
- $list['name'] = ['name' => '名称' , 'text' => $data[$key]['start']['properties']['name'] ?? ''];
- $list['identify'] = ['name' => '识别' , 'text' => $data[$key]['start']['properties']['identify'] ?? ''];
- $list['abstract'] = ['name' => '摘要' , 'text' => $data[$key]['start']['properties']['abstract'] ?? ''];
- $list['precaution'] = ['name' => '预防措施' , 'text' => $data[$key]['start']['properties']['precaution'] ?? ''];
- $list['inspection'] = ['name' => '检查' , 'text' => $data[$key]['start']['properties']['inspection'] ?? ''];
- $list['etiology'] = ['name' => '病理' , 'text' => $data[$key]['start']['properties']['etiology'] ?? ''];
- $list['department'] = ['name' => '科室' , 'text' => $data[$key]['start']['properties']['department'] ?? ''];
- $data[$key]['start']['properties'] = $list;
- $data[$key]['start']['tag'] = 'symptom';
- $listEnd['name'] = ['name' => '名称' , 'text' => $data[$key]['end']['properties']['name'] ?? ''];
- $data[$key]['end']['properties'] = $listEnd;
- }
- }
- break;
- }
- return $this->_json_succ($data);
- }
- // 搜索
- public function search()
- {
- //if(!$this->checkIslogin()) return $this->_json_error('请登录后查看!');
- $tag = Request::param('tag') ?? 'sickness';
- $search = Request::param('search') ?? '';
- $pn = Request::param('pn') ?? 1;
- $pagesize = 20;
- $limit = ($pn - 1) * $pagesize;
- if(!$tag || !$search) {
- return $this->_json_error('请求参数有误!');
- }
- switch ($tag) {
- case "disease":
- $query = "match(n:Disease) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
- $info = $this->getAboutInfo($query);
- $info = array_column($info , 'n');
- $list = [];
- foreach ($info as $key => $value) {
- $list[$key]['sickness_name'] = $value['name'];
- $list[$key]['symptom'] = ['name' => '临床表现' , 'text' => $value['clinicalFeature'] ?? '' , 'active' => true];
- $list[$key]['pathogenesis'] = ['name' => '病因' , 'text' => $value['pathogenesis'] ?? '' , 'active' => false];
- $list[$key]['complicationsOverview'] = ['name' => '并发症' , 'text' => $value['complicationsOverview'] ?? '' , 'active' => false];
- $list[$key]['inspection'] = ['name' => '辅助检查' , 'text' => $value['auxiliaryExamination'] ?? '' , 'active' => false];
- $list[$key]['treatmenCommonSense'] = ['name' => '治疗' , 'text' => $value['treatment'] ?? '' , 'active' => false];
- $list[$key]['diagnostiCtriage'] = ['name' => '诊断' , 'text' => $value['diagnosis'] ?? '' , 'active' => false];
- }
- break;
- case "medicine":
- $query = "match(n:MedicineProduction) where n.name =~'.*".$search.".*' return
- n.name as name , n.pinyin as pinyin , n.usageDosage as usageDosage ,
- n.notes as notes , n.periodValidity as periodValidity ,
- n.indication as indication , n.storage as storage , n.character as character ,
- n.approvalNumber as approvalNumber ,
- n.productionEnterprise as productionEnterprise , n.relateSick as relateSick ,
- n.untowardEffect as untowardEffect , n.majorConstituent as majorConstituent
- skip $limit limit 20";
- $data = $this->getAboutInfo($query);
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['sickness_name'] = $value['name'];
- $list[$key]['pinyi'] = ['name' => '汉语拼音' , 'text' => $value['pinyin'] , 'active' => false];
- $list[$key]['usageDosage'] = ['name' => '用法用量' , 'text' => $value['usageDosage'] , 'active' => false];
- $list[$key]['notes'] = ['name' => '注意事项' , 'text' => $value['notes'] , 'active' => false];
- $list[$key]['periodValidity'] = ['name' => '有效期' , 'text' => $value['periodValidity'], 'active' => false];
- $list[$key]['indication'] = ['name' => '适应症' , 'text' => $value['indication'], 'active' => false];
- $list[$key]['storage'] = ['name' => '贮藏' , 'text' => $value['storage'], 'active' => false];
- $list[$key]['character'] = ['name' => '性状' , 'text' => $value['character'], 'active' => false];
- $list[$key]['approvalNumber'] = ['name' => '批准号' , 'text' => $value['approvalNumber'], 'active' => false];
- $list[$key]['productionEnterprise'] = ['name' => '生产企业' , 'text' => $value['productionEnterprise'], 'active' => false];
- $list[$key]['relateSick'] = ['name' => '相关疾病' , 'text' => $value['relateSick'], 'active' => false];
- $list[$key]['untowardEffect'] = ['name' => '不良反应' , 'text' => $value['untowardEffect'], 'active' => false];
- $list[$key]['majorConstituent'] = ['name' => '主要成分' , 'text' => $value['majorConstituent'], 'active' => true];
- }
- break;
- case "sickness":
- $query = "match(n:SickNess) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
- $info = $this->getAboutInfo($query);
- $info = array_column($info , 'n');
- $list = [];
- foreach ($info as $key => $value) {
- $list[$key]['sickness_name'] = $value['name'];
- $list[$key]['symptom'] = ['name' => '临床表现' , 'text' => $value['symptom'] ?? '' , 'active' => true];
- $list[$key]['pathogenesis'] = ['name' => '病因' , 'text' => $value['pathogenesis'] ?? '' , 'active' => false];
- $list[$key]['complicationsOverview'] = ['name' => '并发症' , 'text' => $value['complicationsOverview'] ?? '' , 'active' => false];
- $list[$key]['inspection'] = ['name' => '辅助检查' , 'text' => $value['inspection'] ?? '' , 'active' => false];
- $list[$key]['treatmenCommonSense'] = ['name' => '治疗' , 'text' => $value['treatmenCommonSense'] ??'' , 'active' => false];
- $list[$key]['diagnostiCtriage'] = ['name' => '诊断' , 'text' => $value['diagnostiCtriage'] ?? '' , 'active' => false];
- }
- break;
- case "inspection":
- $query = "match(n:Inspection) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
- $data = $this->getAboutInfo($query);
- $info = array_column($data , 'n');
- foreach ($info as $key => $value) {
- $list[$key]['sickness_name'] = $value['name'];
- $list[$key]['annotation'] = ['name' => '附注' , 'text' => $value['annotation'] ?? '', 'active' => true];
- $list[$key]['principle'] = ['name' => '根源' , 'text' => $value['principle'] ?? '', 'active' => false];
- $list[$key]['normalValue'] = ['name' => '正常值' , 'text' => $value['normalValue'] ?? '', 'active' => false];
- $list[$key]['clinicalSignificance'] = ['name' => '临床意义' , 'text' => $value['clinicalSignificance'] ?? '', 'active' => false];
- $list[$key]['reagent'] = ['name' => '试剂' , 'text' => $value['reagent'] ?? '', 'active' => false];
- $list[$key]['operation'] = ['name' => '操作方法' , 'text' => $value['operation'] ?? '', 'active' => false];
- }
- break;
- case 'zysickness':
- $query = "match(n:SickNess) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['tongueCondition'] = ['name' => '舌象' , 'text' => $value['tongueCondition'] ?? '' , 'active' => true];
- $list[$key]['apparatus'] = ['name' => '发病部位' , 'text' => $value['apparatus'] ?? '' , 'active' => false];
- $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
- $list[$key]['pulseCondition'] = ['name' => '脉象' , 'text' => $value['pulseCondition'] ?? '' , 'active' => false];
- $list[$key]['dietTherapy'] = ['name' => '饮食疗法' , 'text' => $value['dietTherapy'] ?? '' , 'active' => false];
- $list[$key]['symptom'] = ['name' => '症见' , 'text' => $value['symptom'] ?? '' , 'active' => false];
- $list[$key]['department'] = ['name' => '科室' , 'text' => $value['department'] ?? '' , 'active' => false];
- $list[$key]['acupuncturePoints'] = ['name' => '针灸穴位' , 'text' => $value['acupuncturePoints'] ?? '' , 'active' => false];
- $list[$key]['dialecticalName'] = ['name' => '辩证法名' , 'text' => $value['dialecticalName'] ?? '' , 'active' => false];
- }
- break;
- case 'zy':
- $query = "match(n:CnMedicinalCrop) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['toxicity'] = ['name' => '毒性' , 'text' => $value['toxicity'] ?? '' , 'active' => true];
- $list[$key]['indications'] = ['name' => '适应症' , 'text' => $value['indications'] ?? '' , 'active' => false];
- $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
- $list[$key]['medicineProperty'] = ['name' => '医药物业' , 'text' => $value['medicineProperty'] ?? '' , 'active' => false];
- $list[$key]['includedIn'] = ['name' => '包括在' , 'text' => $value['includedIn'] ?? '' , 'active' => false];
- $list[$key]['pharmacology'] = ['name' => '药理' , 'text' => $value['pharmacology '] ?? '' , 'active' => false];
- }
- break;
- case 'zcy':
- $query = "match(n:CnPatentMedicine) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['classification'] = ['name' => '实体值' , 'text' => $value['classification'] ?? '' , 'active' => true];
- $list[$key]['efficacy'] = ['name' => '功效' , 'text' => $value['efficacy'] ?? '' , 'active' => false];
- $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
- $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
- }
- break;
- case 'fj':
- $query = "match(n:Prescription) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['composition'] = ['name' => '方剂组成' , 'text' => $value['composition'] ?? '' , 'active' => true];
- $list[$key]['medicinalCrop'] = ['name' => '中药' , 'text' => $value['medicinalCrop'] ?? '' , 'active' => false];
- $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
- $list[$key]['solution'] = ['name' => '方法/解法' , 'text' => $value['solution'] ?? '' , 'active' => false];
- $list[$key]['usageDosage'] = ['name' => '用法用量' , 'text' => $value['usageDosage'] ?? '' , 'active' => false];
- $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
- }
- break;
- case 'ys':
- $query = "match(n:TonicDiet) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['composition'] = ['name' => '药膳组成' , 'text' => $value['composition'] ?? '' , 'active' => true];
- }
- break;
- case 'jl':
- $query = "match(n:ChannelCollateral) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['aponeuroticSystem'] ?? '' , 'active' => true];
- $list[$key]['channelSymptom'] = ['name' => '经脉循行及其病候' , 'text' => $value['channelSymptom'] ?? '' , 'active' => false];
- $list[$key]['collateralSymptom'] = ['name' => '络脉循行及其病候' , 'text' => $value['collateralSymptom'] ?? '' , 'active' => false];
- $list[$key]['divergentMeridian'] = ['name' => '经别循行' , 'text' => $value['divergentMeridian'] ?? '' , 'active' => false];
- $list[$key]['aponeuroticSystem'] = ['name' => '经筋循行及其病候' , 'text' => $value['aponeuroticSystem'] ?? '' , 'active' => false];
- $list[$key]['clinicalFeature'] = ['name' => '经络症状主要临床表现' , 'text' => $value['clinicalFeature'] ?? '' , 'active' => false];
- $list[$key]['mechanismAnalysis'] = ['name' => '经络病机分析' , 'text' => $value['mechanismAnalysis'] ?? '' , 'active' => false];
- $list[$key]['source'] = ['name' => '数据来源' , 'text' => $value['source'] ?? '' , 'active' => false];
- $list[$key]['kgid'] = ['name' => 'kgid' , 'text' => $value['kgid'] ?? '' , 'active' => false];
- }
- break;
- case 'xw':
- $query = "match(n:Acupoint) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
- $data = $this->getAboutInfo($query , 'zy');
- $data = array_column($data , 'n');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['name'] = $value['name'];
- $list[$key]['location'] = ['name' => '定位' , 'text' => $value['location'] ?? '' , 'active' => true];
- $list[$key]['indications'] = ['name' => '主治' , 'text' => $value['indications'] ?? '' , 'active' => false];
- $list[$key]['compatibility'] = ['name' => '配伍' , 'text' => $value['compatibility'] ?? '' , 'active' => false];
- $list[$key]['acupuncture'] = ['name' => '针灸法' , 'text' => $value['acupuncture'] ?? '' , 'active' => false];
- $list[$key]['notions'] = ['name' => '附注' , 'text' => $value['notions'] ?? '' , 'active' => false];
- }
- break;
- case 'symptom':
- $query = "match(n:Symptom) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
- $data = $this->getAboutInfo($query);
- $data = array_column($data , 'n');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['sickness_name'] = $value['name'];
- $list[$key]['identify'] = ['name' => '识别' , 'text' => $value['identify'] ?? '' , 'active' => true];
- $list[$key]['abstract'] = ['name' => '摘要' , 'text' => $value['abstract'] ?? '' , 'active' => false];
- $list[$key]['precaution'] = ['name' => '预防措施' , 'text' => $value['precaution'] ?? '' , 'active' => false];
- $list[$key]['inspection'] = ['name' => '检查' , 'text' => $value['inspection'] ?? '' , 'active' => false];
- $list[$key]['etiology'] = ['name' => '病理' , 'text' => $value['etiology'] ?? '' , 'active' => false];
- $list[$key]['department'] = ['name' => '科室' , 'text' => $value['department'] ?? '' , 'active' => false];
- }
- break;
- case "identify":
- $query = "match(n:Disease) where n.name =~'.*".$search.".*' return n skip $limit limit $pagesize";
- $data = $this->getAboutInfo($query);
- $data = array_column($data , 'n');
- $list = [];
- foreach ($data as $key => $value) {
- $list[$key]['sickness_name'] = $value['name'];
- $list[$key]['antidiastole'] = ['name' => '鉴别诊断' , 'text' => $value['antidiastole'] ?? '' , 'active' => true];
- }
- break;
- }
- return $this->_json_succ($list);
- }
- }
|