|
@@ -90,6 +90,7 @@ class Cdss extends CommonTwoController
|
|
|
*/
|
|
|
public function getSymptomAboutDisease($values, $age, $sex, $tag = 'symptom', $page = 1, $pagesize = 1000): array
|
|
|
{
|
|
|
+ $aboutDiseases = [];
|
|
|
switch ($tag) {
|
|
|
case 'symptom':
|
|
|
/**
|
|
@@ -98,30 +99,55 @@ class Cdss extends CommonTwoController
|
|
|
*/
|
|
|
if (stripos($values, ',') !== false) {
|
|
|
$symptoms = explode(',', $values);
|
|
|
- $query = CdssXyDisease::where('1=1');
|
|
|
- // 使用AND连接多个症状条件
|
|
|
- foreach ($symptoms as $symptom) {
|
|
|
- $query = $query->where('clinicalFeature', 'like', '%' . $symptom . '%');
|
|
|
+
|
|
|
+ $symptomData = Symptom::field('disease')->where('1=1')->whereIn('name',$symptoms)->select()->toArray();
|
|
|
+
|
|
|
+ if(!empty($symptomData)){
|
|
|
+ $whereIn = [];
|
|
|
+ foreach ($symptomData as $key => $val) {
|
|
|
+ if(!empty($val) && $val != ''){
|
|
|
+ $whereIn = array_merge($whereIn,explode('||',$val['disease']));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $aboutDiseases = CdssXyDisease::whereIn('name',$whereIn)->limit(200)->select()->toArray();
|
|
|
}
|
|
|
- $aboutDiseases = $query->limit(200)->select()->toArray();
|
|
|
+ if(empty($aboutDiseases)) {
|
|
|
|
|
|
- if(empty($aboutDiseases)){
|
|
|
$query = CdssXyDisease::where('1=1');
|
|
|
// 使用AND连接多个症状条件
|
|
|
- foreach ($symptoms as $key => $symptom) {
|
|
|
- if($key == 0){
|
|
|
- $query->where('clinicalFeature', 'like', '%' . $symptom . '%');
|
|
|
- }else {
|
|
|
- $query = $query->whereOr('clinicalFeature', 'like', '%' . $symptom . '%');
|
|
|
- }
|
|
|
+ foreach ($symptoms as $symptom) {
|
|
|
+ $query = $query->where('clinicalFeature', 'like', '%' . $symptom . '%');
|
|
|
}
|
|
|
$aboutDiseases = $query->limit(200)->select()->toArray();
|
|
|
+
|
|
|
+ if (empty($aboutDiseases)) {
|
|
|
+ $query = CdssXyDisease::where('1=1');
|
|
|
+ // 使用AND连接多个症状条件
|
|
|
+ foreach ($symptoms as $key => $symptom) {
|
|
|
+ if ($key == 0) {
|
|
|
+ $query->where('clinicalFeature', 'like', '%' . $symptom . '%');
|
|
|
+ } else {
|
|
|
+ $query = $query->whereOr('clinicalFeature', 'like', '%' . $symptom . '%');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $aboutDiseases = $query->limit(200)->select()->toArray();
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
- $aboutDiseases = CdssXyDisease::whereLike('clinicalFeature', '%' . $values . '%')
|
|
|
- ->limit(200)
|
|
|
- ->select()
|
|
|
- ->toArray();
|
|
|
+ $symptomData = Symptom::where('1=1')->where('name',$values)->value('disease');
|
|
|
+ if(!empty($symptomData)){
|
|
|
+ $whereIn = [];
|
|
|
+ if(!empty($symptomData) && $symptomData != ''){
|
|
|
+ $whereIn = array_merge($whereIn,explode('||',$symptomData));
|
|
|
+ }
|
|
|
+ $aboutDiseases = CdssXyDisease::whereIn('name',$whereIn)->limit(200)->select()->toArray();
|
|
|
+ }
|
|
|
+ if(empty($aboutDiseases)) {
|
|
|
+ $aboutDiseases = CdssXyDisease::whereLike('clinicalFeature', '%' . $values . '%')
|
|
|
+ ->limit(200)
|
|
|
+ ->select()
|
|
|
+ ->toArray();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -883,7 +909,7 @@ class Cdss extends CommonTwoController
|
|
|
public function getMedicalKnowledgeByKeyword(): Json
|
|
|
{
|
|
|
//限制时间访问
|
|
|
- $expirationTime = strtotime("2026-01-01 00:00:00");
|
|
|
+ $expirationTime = strtotime("2026-06-01 00:00:00");
|
|
|
$currentTimestamp = time();
|
|
|
|
|
|
if ($currentTimestamp > $expirationTime) {
|
|
@@ -1769,6 +1795,7 @@ class Cdss extends CommonTwoController
|
|
|
$tag = $params['tag'] ?? 'Disease';
|
|
|
$value = $params['name'] ?? '';
|
|
|
$id = $params['id'] ?? '';
|
|
|
+ $is_web = $params['is_web'] ?? 0;
|
|
|
//对接东华加的字段
|
|
|
$donghua_name = $params['donghua_name'] ?? '';
|
|
|
//中联字段
|
|
@@ -2008,7 +2035,7 @@ class Cdss extends CommonTwoController
|
|
|
unset($detail['format']);
|
|
|
}
|
|
|
|
|
|
- if ($tag == 'Inspection' || $tag = 'MedicineProduction') {
|
|
|
+ if ($tag == 'Inspection' || ($tag == 'MedicineProduction' && $is_web)) {
|
|
|
$a[] = $detail;
|
|
|
$detail = $a;
|
|
|
}
|