<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\facade\Route;

// ----------------------------- 注册 | 登录 ----------------------------------
Route::rule('jmjk/register', 'Login/register');
Route::rule('jmjk/login', 'Login/index')->allowCrossDomain();
Route::rule('jmjk/send-email', 'login/sendEmail');
Route::rule('jmjk/forget-password', 'login/forgetPassword');
Route::rule('jmjk/zsk/index', 'NeojApi/index');
Route::rule('v/test', 'Index/index');


Route::group(function () {

    // ----------------------- Neo4j Knowledge [中医知识库 | 西医知识库] -----------------------
    //Route::rule('jmjk/zsk/index' 			    	, 'NeojApi/index');
    Route::rule('jmjk/zsk/search', 'NeojApi/search');
    Route::rule('jmjk/zsk/department/SickNess', 'NeojApi/getListByDepartment');
    Route::rule('jmjk/zsk/detail', 'NeojApi/detail');
    Route::rule('jmjk/zsk/graph', 'NeojApi/graph');
    Route::rule('jmjk/zsk/getZyList', 'NeojApi/getZyList');


    // -------------------------- 文献|指南 ------------------------
    Route::rule('jmjk/zsk/doc/index', 'Document/index');
    Route::rule('jmjk/zsk/doc/detail', 'Document/detail');
    Route::rule('jmjk/zsk/author/detail', 'Document/authorDetail');
    Route::rule('jmjk/zsk/doc/hots', 'Document/getHotList');
    Route::rule('jmjk/zsk/author/graph', 'Document/authorGraph');


    // ----------------------------- 视频 -------------------------
    Route::rule('jmjk/video', 'Video/index');
    Route::rule('jmjk/record_pv', 'Video/recordPv');


    // ----------------------------- 问答 -------------------------
    Route::rule('jmjk/zsk/qw', 'NeojApi/qw');


    // ----------------------------- cdss -------------------------
    Route::rule('jmjk/cdss', 'cdss/index');
    Route::rule('jmjk/about_result', 'cdss/getInspectionOrMedicineByDisease');
    Route::rule('jmjk/many_select', 'cdss/manySelectOptionList');
    Route::rule('jmjk/symptom/search', 'cdss/getSymptomBykeyword');
    Route::rule('jmjk/advisory/submit', 'cdss/storeUserSubmitAdvisory');
    Route::rule('jmjk/get_user_advisory', 'cdss/getUserAdvisory');
    Route::rule('jmjk/diagnosis', 'cdss/getDiagnosisField');
    Route::rule('jmjk/get_icd', 'cdss/getIcdByDiagnosis');
    Route::rule('jmjk/get_diseases', 'cdss/getDiseaseByKeyword');
    // 获取中医疾病相关信息
    Route::rule('jmjk/zh_about_result', 'Cdss/getZhInspectionOrMedicineByDisease');


    // ------------------------------ 知识库新版 -----------------------------
    //Route::rule('jmjk/index'                            , 'zsk/index');

    Route::rule('jmjk/department/exist/diseases/letters', 'zsk/getDepartmentExistDiseasesLetter');
    Route::rule('jmjk/letter/search', 'zsk/getDiseaseNameByFirstLetter');
    Route::rule('jmjk/labels', 'zsk/getLabels');

    // ----------------------------- 图像库 ------------------------------

    //Route::rule('jmjk/images'                           , 'zsk/documentImages');
    Route::rule('jmjk/image-detail', 'zsk/documentImagesDetail');
    Route::rule('jmjk/case-reports', 'zsk/documentCaseReports');

    // ---------------------------- 指南脑图 ｜ 结构化 ｜ 药物靶点 ---------------------------

    //Route::rule('jmjk/guide-mindMap-zh'                  , 'zsk/getmindMapZhList');
    Route::rule('jmjk/guide-structure', 'zsk/getGuideStructureList');
    Route::rule('jmjk/medicine-target-spot', 'zsk/getOmicsList');

    // Route::rule('jmjk/question-answer' , 'QuestionAnswer/index');
    //    Route::rule('jmjk/question-list'   , 'QuestionAnswer/questionList');
//Route::rule('jmjk/question-detail' , 'QuestionAnswer/questionDetail');


})->allowCrossDomain();
//->middleware(\app\middleware\CheckJwtToken::class);


/**
 * 个人信息
 */
Route::rule('jmjk/profile', 'login/profile');
Route::rule('jmjk/images', 'zsk/documentImages');


/**
 * 智能问答机器人
 */
Route::rule('jmjk/question-answer', 'QuestionAnswer/index');
Route::rule('jmjk/question-list', 'QuestionAnswer/questionList');
Route::rule('jmjk/question-detail', 'QuestionAnswer/questionDetail');

/**
 * 智能问答chatgpt
 */
Route::rule('jmjk/chatgpt-answer', 'Chatgpt/getAnswerByChatgpt');
Route::rule('jmjk/chatgpt-recharge-list', 'Chatgpt/chatgptNumList');
Route::rule('jmjk/wxnotify', 'Wxnotify/notify');
Route::rule('jmjk/wxpay', 'Chatgpt/generateOrder');
Route::rule('jmjk/order-detail', 'Chatgpt/orderDetail');
Route::rule('jmjk/chatgpt-num', 'Chatgpt/user');
Route::rule('jmjk/bind-invite-code', 'Chatgpt/inviteCode');           // 邀请
Route::rule('jmjk/bind-history-list', 'Chatgpt/historyList');

/**
 * 对外接口（症状匹配临床表现）
 */
Route::rule('jmjk/match-clinicalFeature', 'Cdss/matchClinicalFeature');



// ------------------------------- 外部访问 ------------------------------------
Route::rule('api/zsk/detail', 'XyZskOther/getZskDetail');              // 外部接口访问


// ------------------------------- 知识库（mysql版） ---------------------------------
Route::rule('jmjk/new/detail', 'Cdss/detail');           // 检索详情
Route::rule('jmjk/new/detail-multiple', 'Cdss/detailmultiple');
Route::rule('jmjk/new/get-clinical-trial', 'Cdss/getClinicalTrial'); // 临床试验检索
Route::rule('jmjk/new/get-interact', 'Cdss/getInteract'); // 药物相互作用
Route::rule('jmjk/get-xyzztz', 'Cdss/getXyzztz'); // 症状体征

Route::rule('jmjk/guide-mindMap-zh', 'zsk/getMindMapZhList');
Route::rule('jmjk/index', 'zsk/index');
Route::rule('jmjk/get-symptom', 'cdss/getSymptomByClinicalFeature');


// ----------------------------------- 医院项目 ------------------------------
Route::rule('jmjk/search-label', 'zskjsy/searchLable');
Route::rule('jmjk/guide-detail', 'zskjsy/guideDetail');
Route::rule('jmjk/get_medical_knowledge', 'cdss/getMedicalKnowledgeByKeyword');       // 医学知识查询
Route::rule('jmjk/about_results', 'cdss/getInspection');   // 医疗疾病推断
Route::rule('jmjk/get_department', 'cdss/getDepartment');       // 获取医疗疾病科室
Route::rule('jmjk/get_departments', 'cdss/getDepartments');       // 获取各标签科室
Route::rule('jmjk/detail', 'zsk/detail');
Route::rule('jmjk/property/detail', 'zsk/propertyDetail');
Route::rule('jmjk/image-type', 'zsk/imageType');
Route::rule('jmjk/image-type-list', 'zsk/imageTypeList');
Route::rule('jmjk/sms-send', 'login/smsSend');


/**
 * 诊疗指南数据录入
 */
Route::rule('jmjk/add-guide', 'zsk/addGuide');
Route::rule('jmjk/add-keyword', 'zsk/addGuideKeyword');
Route::rule('jmjk/add-dse', 'zsk/addDise');



// ----------------------------- Es 索引 --------------------------------
Route::rule('jmjk/es-create', 'EsIndex/create');
Route::rule('jmjk/es-del', 'EsIndex/delete');
Route::rule('jmjk/es-batch-update', 'EsIndex/batchUpdate');
Route::rule('jmjk/es-multi-add', 'EsIndex/newAuthorVTwoMultiAdd');
Route::rule('jmjk/es-add-doc', 'EsIndex/addDoc');
Route::rule('jmjk/es-add-album', 'EsIndex/addAlbum');
Route::rule('jmjk/es-add-doc-wf', 'EsDocument/addDocWf');


// ------------------------------ Es 科研探索 ----------------------------
Route::rule('jmjk/test', 'EsDocument/test');
Route::rule('jmjk/search-tip', 'EsDocument/searchTip');
Route::rule('jmjk/set-language', 'EsDocument/setLanguage');



// ------------------------------ 文献首页  ------------------------------
Route::rule('jmjk/es-test', 'EsDocument/test');
Route::rule('jmjk/es-index', 'EsDocument/index');
Route::rule('jmjk/es-detail', 'EsDocument/esDocumentDetail');
Route::rule('jmjk/doc-search', 'EsDocument/conditionFilter');
Route::rule('jmjk/es-history', 'EsDocument/history');
Route::rule('jmjk/doc-recommend', 'EsDocument/getDocumentByTag');
Route::rule('jmjk/set-fielddata', 'EsDocument/setFieldData');
Route::rule('jmjk/es-collection', 'EsDocument/docCollection');
Route::rule('jmjk/es-my-collection', 'EsDocument/myCollectionList');
Route::rule('jmjk/es-collection-tags', 'EsDocument/docCollectionTags');
Route::rule('jmjk/es-random-doc', 'EsDocument/randomDoc');
Route::rule('jmjk/es-clear-history', 'EsDocument/clear');
Route::rule('jmjk/es-recommend-disease', 'EsDocument/searchRecommendDisease');
Route::rule('jmjk/es-single-recommend-disease', 'EsDocument/singleSearchRecommendDisease');



// ------------------------------ 学科分析  ------------------------------
Route::rule('jmjk/es-department-index', 'EsDepartment/index');
Route::rule('jmjk/es-search-diseases', 'EsDepartment/searchDisease');
Route::rule('jmjk/es-diseases', 'EsDepartment/getDiseaseByDepartment');
Route::rule('jmjk/es-all-document', 'EsDepartment/allDocument');


// ------------------------------ 学者分析  ------------------------------
Route::rule('jmjk/es-author-index', 'EsAuthor/index');
Route::rule('jmjk/es-author-search', 'EsAuthor/search');
Route::rule('jmjk/es-author-detail', 'EsAuthor/getAuthorDetailByName');
Route::rule('jmjk/es-representative-author', 'EsAuthor/representativeAuthor');
Route::rule('jmjk/es-get-organization', 'EsAuthor/getOrganization');
Route::rule('jmjk/es-get-select-organization', 'EsAuthor/getSelectOrgs');

Route::rule('jmjk/es-doc-refresh-author', 'EsDocument/refreshAuthors');



// ------------------------------ 期刊分析  ------------------------------
Route::rule('jmjk/es-album-index', 'EsAlbum/index');
Route::rule('jmjk/es-album-newindex', 'EsAlbum/newindex');
Route::rule('jmjk/es-album-detail', 'EsAlbum/albumDetail');
Route::rule('jmjk/album-recommend', 'EsDocument/getAlbumByTag');
Route::rule('jmjk/album-count-detail', 'EsDocument/albumCountDetail');


// ------------------------------ 机构分析  ------------------------------
Route::rule('jmjk/es-organization-detail', 'EsOrganization/detail');
//Route::rule('jmjk/es-get-organization'      , 'EsOrganization/getOrganizationByTitle');


// ------------------------------ 相关推荐  ------------------------------
Route::rule('jmjk/es-relation-recommend', 'EsDocument/relationRecommend');



// ------------------------------ 翻译 -------------------------------
Route::rule('jmjk/translate', 'Translate/index');



// --------------------------- 以下供后台数据展示调用 --------------------------
Route::rule('neo4j/search', 'Neo4j/select');
Route::rule('neo4j/index', 'Neo4j/index');
Route::rule('neo4j/detail', 'Neo4j/singleNode');
Route::rule('neo4j/getlabels', 'Neo4j/getLableById');
Route::rule('neo4j/create_node', 'Neo4j/createLabel');
Route::rule('neo4j/setNode', 'Neo4j/setNodeById');
Route::rule('neo4j/add', 'Neo4j/insertDataIntoEs');


// -------------------------- - Admin ----------------------------
//Route::rule('jmjk/index'    	, 'Index/category');
//Route::rule('jmjk/getIllness'	, 'Index/getAllIllnessByPid');
//Route::rule('jmjk/singleIllness', 'Index/singleIllness');



//-------------------------- - OCR ----------------------------
Route::rule('jmjk/submit', 'Ocr/submit')->allowCrossDomain();
Route::rule('api/jmjk/ocr-xinlijiankang', 'Baidu/ocr');  //心理健康ocr

//-------------------------- - 临沂导诊 ----------------------------
Route::post('jmjk/getConfig', 'Guidance/getConfig');
Route::post('jmjk/getSymptom', 'Guidance/getSymptom');
Route::post('jmjk/getGuidance', 'Guidance/getGuidance');
Route::post('jmjk/evaluate', 'Guidance/evaluate');
//-------------------------- - 滨州导诊 ----------------------------
Route::post('jmjk/getBzmptomList', 'GuidanceBz/getBzmptomList');
Route::post('jmjk/getGuidanceBz', 'GuidanceBz/getGuidanceBz');
Route::post('jmjk/evaluate', 'GuidanceBz/evaluate');
//-------------------------- - 首页质控 ----------------------------
Route::post('jmjk/getQcConfig', 'QualityControl/getConfig');
Route::post('jmjk/getQcList', 'QualityControl/getQcList');
Route::post('jmjk/getQcInfo', 'QualityControl/getInfo');

//-------------------------- - NLP ----------------------------
Route::post('jmjk/nlpSubmit', 'Nlp/submit');

// 医嘱审核
Route::rule('jmjk/yzEamine', 'QualityControl/yzEamine');

// 患者辅助诊疗
Route::rule('jmjk/save_patient_auxiliary_info', 'PatientAuxiliary/savePatientAuxiliaryInfo');

// 获取患者辅助诊疗信息
Route::rule('jmjk/get_patient_auxiliary_info', 'PatientAuxiliary/getPatientAuxiliaryInfo');



// ------------------------------ 医学计算器 ------------------------------

// 扩展功能路由（更具体的路由放在前面）
Route::get('jmjk/medical-calculators/:id/questions', 'MedicalCalculatorApiController/getQuestions') // 获取问题
    ->pattern(['id' => '\d+']);
Route::post('jmjk/medical-calculators/:id/calculate', 'MedicalCalculatorApiController/calculate')   // 计算
    ->pattern(['id' => '\d+']);

// 带ID的路由
Route::get('jmjk/medical-calculators/:id', 'MedicalCalculatorApiController/show')                 // 详情
    ->pattern(['id' => '\d+']);
Route::put('jmjk/medical-calculators/:id', 'MedicalCalculatorApiController/update')               // 更新
    ->pattern(['id' => '\d+']);
Route::delete('jmjk/medical-calculators/:id', 'MedicalCalculatorApiController/destroy')           // 删除
    ->pattern(['id' => '\d+']);

// 基础路由（最通用的放在最后）
Route::get('jmjk/medical-calculators', 'MedicalCalculatorApiController/index');                    // 列表
Route::post('jmjk/medical-calculators', 'MedicalCalculatorApiController/create');                  // 创建
    



