123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <?php
- namespace app\api\model\butt;
- use app\api\model\api\ApiModel;
- use app\api\model\doctor\DoctorModel;
- use app\api\model\exam\ExamModel;
- use app\api\model\institution\InstitutionModel;
- use app\api\model\patient\PatientModel;
- use app\api\model\report\ReportModel;
- use app\api\model\ZskkDefaultModel;
- use think\facade\Log;
- use app\api\model\studies\StudiesModel;
- class XzModel extends ZskkDefaultModel {
- protected $table= 'xz';
- protected $logName = "XzModel";
- public function insertXz($data)
- {
- $info = $this->insert($data);
- return $info;
- }
- public function checkXz($where)
- {
- $data = $this->where($where)->find();
- return $data;
- }
- public function insertStudies($data)
- {
- $info = StudiesModel::insert($data);
- return $info;
- }
- public function insertPatient($data)
- {
- $info = PatientModel::insert($data);
- return $info;
- }
- public function insertExam($data)
- {
- $info = ExamModel::insert($data);
- return $info;
- }
- public function updateStatus($where,$status)
- {
- $info = $this->where($where)
- ->update(['exam_status'=>$status]);
- return $info;
- }
- public function getXzData($id)
- {
- $info = $this->where('exam_id',$id)
- ->find();
- return $info;
- }
- public function getReport($id)
- {
- $info = ReportModel::where('exam_id',$id)
- ->where('type',1)
- ->find();
- return $info;
- }
- public function getDoctorName($id)
- {
- $name = DoctorModel::where('id',$id)->value('realname');
- return $name;
- }
- public function updateStudies($id,$examId)
- {
- StudiesModel::where('id',$id)->update(['exam_id'=>$examId]);
- }
- public function updateXz($where,$updateXz)
- {
- $this->where($where)->update($updateXz);
- }
- public function getUid($id)
- {
- $uid = StudiesModel::where('exam_id',$id)->value('studyuid');
- return $uid;
- }
- public function getAccession($id)
- {
- $info = ExamModel::where('id',$id)->value('accession_num');
- return $info;
- }
- public function check($studyId)
- {
- $id = ExamModel::where('study_id',$studyId)->find();
- return $id;
- }
- public function updateExam($data,$id)
- {
- $info = ExamModel::where('id',$id)->update($data);
- return $info;
- }
- public function checkDoctor($name)
- {
- $id = DoctorModel::where('realname',$name)->value('id');
- return $id;
- }
- public function getApi($id)
- {
- $apiIds = InstitutionModel::where('id',$id)->value('api_ids');
- return $apiIds;
- }
- public function getInterface($ids)
- {
- $info = ApiModel::whereIn('id',$ids)->select();
- return $info;
- }
- }
|