lgy hace 3 semanas
padre
commit
4d081a3f1a

+ 9 - 1
server/application/api/dao/xz/XzDao.php

@@ -3,6 +3,7 @@
 namespace app\api\dao\xz;
 use app\api\actions\ZskkCache;
 use app\api\dao\ZskkDefaultDao;
+use app\api\model\exam\ExamModel;
 use app\api\model\monitor\MonitorexamModel;
 use app\api\model\xz\XzModel;
 
@@ -17,11 +18,13 @@ class XzDao extends ZskkDefaultDao {
     protected $flag = true;
     protected $logName = "XzDao";
     protected  $xz = null;
+    protected  $exam = null;
     protected  $monitorexamModel = null;
-    public function __construct(XzModel $xzModel,MonitorexamModel $monitorexamModel)
+    public function __construct(XzModel $xzModel,MonitorexamModel $monitorexamModel,ExamModel $examModel)
     {
         parent::__construct();
         $this->xz = $xzModel;
+        $this->exam = $examModel;
         $this->monitorexamModel = $monitorexamModel;
     }
 
@@ -133,6 +136,11 @@ class XzDao extends ZskkDefaultDao {
         return $id;
     }
 
+    public function checkExam($where)
+    {
+        return $this->exam->where($where)->order('createdAt desc')->find();
+    }
+
     public function getWaterLog($examId,$insId)
     {
         $id = $this->xz->getWaterLog($examId,$insId);

+ 5 - 0
server/application/api/servies/butt/ButtService.php

@@ -2235,6 +2235,10 @@ class ButtService extends ZskkDefaultService {
         {
             $where = ['studyuid'=>$arr['studyuid'],'institution_id'=>$arr['institution_id']];
             $exam = $this->butt->getExam($where,'*');
+            if(empty($exam))
+            {
+                $exam = $this->butt->getExam(['accession_num'=>$arr['accession_num'],'institution_id'=>$arr['institution_id']],'*');
+            }
         }
         if(empty($exam))
         {
@@ -2286,6 +2290,7 @@ class ButtService extends ZskkDefaultService {
         $arr['body_part'] = $data['C']['CF'];
         $arr['exam_datetime'] = date('Ymd',strtotime($data['C']['CI']));
         $arr['studyuid'] = $data['C']['CM'];
+        $arr['accession_num'] = $data['C']['CN'];
         $arr['exam_status'] = 3;
         return $arr;
     }

+ 1 - 0
server/application/api/servies/link/LinkService.php

@@ -279,6 +279,7 @@ class LinkService extends ZskkDefaultService {
                     'MPI'=>$v['accession_num'],
                     'NAME'=>$v['name'],
                     'PATIENTNAME'=>$v['name'],
+                    'AGE'=>$v['age']
                 ];
                 $report = $this->linkDao->getReportData(['exam_id'=>$v['id']]);
                 $info = [];

+ 4 - 0
server/application/api/servies/xz/XzService.php

@@ -295,6 +295,10 @@ class XzService extends ZskkDefaultService {
         if(empty($exam))
         {
             $exam = $this->xz->checkIsSet($params['study_id'],$params['studyuid'],$params['institution_id']);
+            if(empty($exam))
+            {
+                $exam = $this->xz->checkExam(['accession_num'=>$params['accession_num'],'institution_id'=>$params['institution_id']]);
+            }
         }
         if($params['institution_id'] == '71900004')
         {