123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433 |
- <?php
- namespace app\inter\controller;
- use app\common\library\UUIDs;
- use think\Cache;
- use think\Controller;
- use think\Db;
- use think\Log;
- // select count(*) from remote_application ra left join remote_order ro on ro.id = (select id from remote_order rot where rot.application_id = ra.id order by timestamp desc limit 1) where ra.remote_institution_id='09b4765b26ba8b7c' and (report_status = '4' or report_status = '6' or report_status = '7' or report_status = '8' or report_status = '9') and (ra.remote_doctor_id='b5bed8f973852c22' or ra.remote_doctor_id = '') and (ro.status is null or ro.status = 2 or ro.status = 3)
- // select is_urgent, report_status, req_date_time from remote_application ra left join remote_order ro on ro.id = (select id from remote_order rot where rot.application_id = ra.id order by timestamp desc limit 1) where ra.remote_institution_id='09b4765b26ba8b7c' and (report_status = '4' or report_status = '6' or report_status = '7' or report_status = '8' or report_status = '9') and (ra.remote_doctor_id='b5bed8f973852c22' or ra.remote_doctor_id = '') and (ro.status is null or ro.status = 2 or ro.status = 3) order by (ra.is_urgent = '1' and ra.report_status = '4') desc, (ra.is_urgent = '1' and ra.report_status = '6') desc, (ra.is_urgent = '1' and ra.report_status = '7'), ra.req_date_time desc limit 20
- class Reciveremote extends Base
- {
- /**
- * 远程申请列表
- *
- * @ApiTitle (远程申请列表)
- * @ApiSummary (远程申请列表)
- * @ApiSector (远程诊断)
- * @ApiMethod (POST)
- * @ApiRoute (/inter/reciveremote/index)
- * @ApiHeaders (name="sign", type="string", required=true, description="请求头-校验key")
- * @ApiHeaders (name="nonce", type="string", required=true, description="请求头-随机数")
- * @ApiHeaders (name="timestamp", type=string, required=true, description="请求头-时间戳s")
- * @ApiParams (name="sessionid", type="string", required=true, description="参数json字符串")
- * @ApiParams (name="param", type="string", required=true, description="参数json字符串")
- * @ApiParams (name="page", type="string", required=true, description="当前页")
- * @ApiParams (name="num", type="string", required=true, description="每页显示条数")
- * @ApiParams (name="param[patient_num]", type="string", sample="", description="预约登记exams表id值<选填>")
- * @ApiParams (name="param[exam_class]", type="string", sample="", description="检查类<选填>")
- * @ApiParams (name="param[name]", type="string", sample="", description="患者姓名<选填>")
- * @ApiParams (name="param[applicationtime]", type="string", sample="", description="申请时间<选填>")
- * @ApiParams (name="param[is_urgent]", type="string", sample="", description="是否急诊<选填>")
- * @ApiParams (name="param[report_result]", type="string", sample="", description="检查结果<选填>")
- * @ApiParams (name="param[exam_status]", type="string", sample="", description="检查状态<选填>")
- * @ApiReturnParams (name="status", type="integer", required=true, sample="0", description="返回码 fail 失败 ok成功"))
- * @ApiReturnParams (name="code", type="integer", required=true, sample="0", description="返回状态码")
- * @ApiReturnParams (name="info", type="string", required=true, sample="返回成功", description="返回信息")
- * @ApiReturnParams (name="sessionid", type="object", sample="{}", description="缓存的数据key")
- * @ApiReturnParams (name="count", type="object", sample="{}", description="总条数")
- * @ApiReturn (data="
- {
- 'status': ok,
- 'code': '0000',
- 'sessionid': 'a17z7a7a8f9g9rh9d89jio',
- 'info' : ''
- 'count' : '110'
- }
- *")
- **/
- // public function index()
- // {
- // try{
- // log::record('---------工作列表--------');
- // log::record($_REQUEST);
- // $sessionid = $_REQUEST['sessionid'];
- // $doctor = Cache::get($sessionid);
- // log::record($doctor);
- // $app_info = DB::table('remote_application')->where('remote_institution_id', $doctor['institution_id'])->select();
- // foreach ($app_info as $k => $v) {
- // $exam_id = $v['exam_id'];
- // $report = DB::table('report')->where('exam_id', $exam_id)->where('remote_application_id',$v['id'])->find();
- // if (!$report) {
- // $data = array();
- // $data['id'] = UUIDs::uuid16();
- // $data['exam_id'] = $exam_id;
- // $data['remote_application_id'] = $v['id'];
- // $data['type'] = 2;
- // $data['createdAt'] = date('Y-m-d H:i:s',time());
- // DB::table('report')->insert($data);
- // }
- // }
- // $where = '';
- // if(isset($_REQUEST['param'])){
- // $param = $_REQUEST['param'];
- // foreach ($param as $k => $v) {
- // switch ($k) {
- // case 'patient_num':
- // $where .= " and e." . $k . "='" . $v . "' ";
- // break;
- // case 'exam_class' :
- // if(empty($v)){
- // break;
- // }
- // $ex = implode('\',\'',$v);
- // $where .= " and e.exam_class in ('".$ex."')";
- // break;
- // case 'name':
- // $where .= " and p.name like '".$v."%' ";
- // break;
- // case 'applicationtime':
- // if(empty($v)){
- // break;
- // }
- // $where .= " and ra.req_date_time between '$v[0]' and '$v[1]'";
- // break;
- // case 'is_urgent':
- // if($v == 0){
- // break;
- // }
- // $where .= " and ra.is_urgent=".$v;
- // break;
- // case 'report_result':
- // if($v == 2){
- // $where .= " and r.report_result=2";
- // }elseif($v == 1){
- // $where .= " and r.report_result=1";
- // }{
- // break;
- // }
- // break;
- // case 'exam_status':
- // if($v != 10){
- // $where .= " and ra.report_status=".$v;
- // }
- // break;
- // }
- // }
- // }
- // $doc_class = DB::table('doctor_class')->where('doctor_id',$doctor['id'])->value('doctor_class');
- // if(strpos('8',$doc_class) !== false){
- // $dwhere = ' or ra.report_status=7 ';
- // }else{
- // $dwhere = '';
- // }
- // log::record($where);
- // $page = $_REQUEST['page'];
- // $num = $_REQUEST['num'];
- // $fnum = ($page-1)*$num;
- // $limit = " limit ".$fnum.",".$num;
- // /*if(empty($where)){
- // $dclass = DB::table('doctor_class')->where('doctor_id',$doctor['id'])->cache(300)->field('doctor_class')->find();
- // if(empty($dclass['doctor_class'])){
- // $dclass['doctor_class'] = 0;
- // }
- // log::record($dclass);
- // $sql1 = "SELECT e.exam_status,e.exam_class,e.body_part,e.device,e.exam_sub_class,e.exam_datetime,p.name,p.sex,p.temp_patient_id,p.age,ra.*,r.report_doctor_id,r.report_datetime,r.report_result,e.id from exams as e,remote_application as ra,patient_infos as p,report as r where ra.exam_id=e.id and e.patient_id=p.id and r.exam_id=e.id and ra.remote_institution_id='" . $doctor['institution_id'] . "' and ra.is_urgent=1 and e.exam_status in (".$dclass['doctor_class'].")";
- // $sql2 = "SELECT e.exam_status,e.exam_class,e.body_part,e.device,e.exam_sub_class,e.exam_datetime,p.name,p.sex,p.temp_patient_id,p.age,ra.*,r.report_doctor_id,r.report_datetime,r.report_result,e.id from exams as e,remote_application as ra,patient_infos as p,report as r where ra.exam_id=e.id and e.patient_id=p.id and r.exam_id=e.id and ra.remote_institution_id='" . $doctor['institution_id'] . "' and ra.is_urgent=0 and e.exam_status in (".$dclass['doctor_class'].")";
- // $sql3 = "SELECT e.exam_status,e.exam_class,e.body_part,e.device,e.exam_sub_class,e.exam_datetime,p.name,p.sex,p.temp_patient_id,p.age,ra.*,r.report_doctor_id,r.report_datetime,r.report_result,e.id from exams as e,remote_application as ra,patient_infos as p,report as r where ra.exam_id=e.id and e.patient_id=p.id and r.exam_id=e.id and ra.remote_institution_id='" . $doctor['institution_id'] . "'and e.exam_status not in (".$dclass['doctor_class'].")";
- // $sql = '('.$sql1.') union ('.$sql2.') union ('.$sql3.')'.$limit; //ra.report_status,6,7,8,4,9,5,12
- // }else{*/
- // $sql = "SELECT e.id,e.severe,e.exam_status,e.exam_class,e.exam_sub_class,e.body_part,e.device,e.exam_datetime,p.name,p.sex,p.temp_patient_id,p.age,ra.id as ra_id,ra.*,r.id as report_id,r.report_doctor_id,r.report_datetime,r.report_result,e.id from exams as e,remote_application as ra,patient_infos as p,report as r where (ra.remote_doctor_id='".$doctor['id']."' or ra.remote_doctor_id=''".$dwhere.") and ra.exam_id=e.id and e.patient_id=p.id and r.exam_id=e.id and r.remote_application_id=ra.id and ra.report_status !='' and ra.remote_institution_id='" . $doctor['institution_id']."'".$where." order by req_date_time desc,ra.is_urgent desc,ra.req_date_time desc".$limit;
- // // }
- // log::record($sql);
- // $list = DB::query($sql);
- // $csql = "SELECT count(1) from exams as e,remote_application as ra,patient_infos as p,report as r where (ra.remote_doctor_id='".$doctor['id']."' or ra.remote_doctor_id=''".$dwhere.") and r.remote_application_id=ra.id and ra.exam_id=e.id and ra.report_status !='' and e.patient_id=p.id and r.exam_id=e.id and ra.remote_institution_id='" . $doctor['institution_id']."'".$where;
- // $count = DB::query($csql);
- // foreach ($list as $k => $v) {
- // $cache_key = $doctor['id'].'_'.$v['id'];
- // if(Cache::get($cache_key)){
- // $list[$k]['status'] = 1;
- // }else{
- // $list[$k]['status'] = 0;
- // }
- // //申请医院
- // $local_institution = DB::table('institution')->where('id',$v['local_institution_id'])->cache(300)->field('name')->find();
- // $list[$k]['local_institution_name'] = $local_institution['name'];
- // //检查类型
- // $check_class = DB::table('constant')->where('id',$v['exam_class'])->cache(300)->field('constant_value as name')->find();
- // $list[$k]['class_name'] = $check_class['name'];
- // //检查子类
- // $subclass_name = DB::table('exam_subclass')->where('id',$v['exam_sub_class'])->cache(300)->field('name')->find();
- // $list[$k]['subclass_name'] = $subclass_name['name'];
- // //检查部位
- // $body_part = DB::table('bodypart')->where('id',$v['body_part'])->cache(300)->field('name')->find();
- // $list[$k]['body_name'] = $body_part['name'];
- // //检查设备
- // $device = DB::table('device')->where('id',$v['device'])->cache(300)->field('name')->find();
- // $list[$k]['device_name'] = $device['name'];
- // //报告医生
- // $report_doctor = DB::table('doctors')->where('id',$v['report_doctor_id'])->field('realname')->find();
- // $list[$k]['report_doctor_id'] = $report_doctor['realname'];
- // $list[$k]['datetime'] = $v['req_date_time'];
- // $list[$k]['rdatetime'] = $v['report_datetime'];
- // }
- // return json_encode(['status'=>'ok','code'=>'0000','count'=>$count[0]['count(1)'],'info'=>$list,'sessionid'=>$sessionid]);
- // }catch(\Exception $e){
- // return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
- // }
- // $remote_institution_id = '09b4765b26ba8b7c';
- // $remote_doctor_id = 'b5bed8f973852c22';
- // $filed = 'ra.id as ra_id, ra.anamnesis, ra.application_desc, ra.attachment, ra.clin_diag, ra.clin_symp, ra.createdAt, ra.exam_id, ra.family_ill, ra.illness_desc, ra.is_urgent, ra.local_institution_id, ra.marrital, ra.phys_sign, ra.remark, ra.remote_doctor_id, ra.remote_institution_id, ra.report_status, ra.req_date_time, ra.req_doctor_id, ra.status, e.body_part, e.exam_class, e.device, e.exam_datetime, e.id as exam_id, e.exam_status, e.exam_sub_class, e.id, e.severe, e.patient_id, r.report_datetime as rdatetime, r.report_datetime, r.report_doctor_id, r.id as report_id, r.report_result, pi.age, pi.name, pi.sex, i.name as local_institution_name';
- // $table = 'remote_application ra left join remote_order ro on ro.id = (select id from remote_order rot where rot.application_id = ra.id order by timestamp desc limit 1) left join exams e on ra.exam_id = e.id left join report r on ra.id = r.remote_application_id left join patient_infos pi on e.patient_id = pi.id left join institution i on ra.local_institution_id = i.id';
- // $where1 = "ra.remote_institution_id=:remote_institution_id";
- // $where2 = "(ra.report_status = '4' or report_status = '6' or report_status = '7' or report_status = '8' or report_status = '9')";
- // $where3 = "(ra.remote_doctor_id= :remote_doctor_id or ra.remote_doctor_id = '')";
- // $where4 = "(ro.status is null or ro.status = 2 or ro.status = 3)";
- // $order = "(ra.is_urgent = '1' and ra.report_status = '4') desc, (ra.is_urgent = '1' and ra.report_status = '6') desc, (ra.is_urgent = '1' and ra.report_status = '7'), ra.req_date_time desc";
- // $limit = ":start :number";
- // $where = $where1.$where2.$where3.$where4;
- // $sql = "select ".$filed." from ".$table." where ".$where." order by ".$order." limit ".$limit;
- // $options = [
- // "remote_institution_id" => $remote_institution_id,
- // "remote_doctor_id" => $remote_doctor_id,
- // "start" => 0,
- // "number" => 20
- // ];
- // DB::execute($sql, $options);
- // // $db->execute(SQLServerHelp::SET_LIS_DEPARTEMT_SQL,$departemt);
- // }
- // }
- public function index()
- {
- try{
- log::record('---------工作列表--------');
- log::record($_REQUEST);
- $sessionid = $_REQUEST['sessionid'];
- $doctor = Cache::get($sessionid);
- log::record($doctor);
- $remote_institution_id = $doctor['institution_id'];
- $remote_doctor_id = $doctor['id'];
- $page = $_REQUEST['page'];
- $num = $_REQUEST['num'];
- $doc_class = DB::table('doctor_class')->where('doctor_id',$doctor['id'])->value('doctor_class');
- // Log::record('医生id');
- // Log::record($remote_doctor_id);
- // Log::record(strpos('8', $doc_class));
- if(strpos($doc_class, '8') !== false){
- $where2 = "((`ra`.`report_status` = '7' or `ra`.`report_status` = '8' or `ra`.`report_status` = '9') or ((`ra`.`report_status` = '4' or `ra`.`report_status` = '6') and (`ra`.`remote_doctor_id`= ? or `ra`.`remote_doctor_id` = '')))";
- } else {
- $where2 = "(`ra`.`report_status` = '4' or `ra`.`report_status` = '6' or `ra`.`report_status` = '7' or `ra`.`report_status` = '8' or `ra`.`report_status` = '9') and (`ra`.`remote_doctor_id`= ? or `ra`.`remote_doctor_id` = '')";
- }
- $filed = "`d`.`realname` as `report_doctor_id`, `ra`.`id` as `ra_id`, `ra`.`anamnesis`, `ra`.`application_desc`, `ra`.`attachment`, `ra`.`clin_diag`, `ra`.`clin_symp`, `ra`.`createdAt`, `ra`.`exam_id`, `ra`.`family_ill`, `ra`.`illness_desc`, `ra`.`is_urgent`, `ra`.`local_institution_id`, `ra`.`marrital`, `ra`.`phys_sign`, `ra`.`remark`, `ra`.`remote_doctor_id`, `ra`.`remote_institution_id`, `ra`.`report_status`, `ra`.`req_date_time`, `ra`.`req_doctor_id`, `ra`.`status`, `e`.`body_part`, `e`.`exam_class`, `e`.`exam_class` as `class_name`, `e`.`device`, `e`.`exam_datetime`, `e`.`id` as `exam_id`, `e`.`exam_status`, `e`.`exam_sub_class`, `e`.`id`, `e`.`severe`, `e`.`patient_id`, `r`.`report_datetime` as `rdatetime`, `r`.`report_datetime`, `r`.`report_doctor_id` as `r_report_doctor_id`, `r`.`id` as `report_id`, `r`.`report_result`, `pi`.`age`, `pi`.`name`, `pi`.`sex`, `pi`.`temp_patient_id`, `i`.`name` as `local_institution_name`";
- $table = "`remote_application` `ra` left join `remote_order` `ro` on `ro`.`id` = (select `id` from `remote_order` `rot` where `rot`.`application_id` = `ra`.`id` order by `timestamp` desc limit 1) left join `exams` `e` on `ra`.`exam_id` = `e`.`id` left join `report` `r` on `ra`.`id` = `r`.`remote_application_id` left join `patient_infos` `pi` on `e`.`patient_id` = `pi`.`id` left join `institution` `i` on `ra`.`local_institution_id` = `i`.`id` left join `doctors` `d` on `r`.`report_doctor_id` = `d`.`id`";
- $where1 = "`ra`.`remote_institution_id` = ?";
- $where3 = "(`ro`.`status` is null or `ro`.`status` = 2 or `ro`.`status` = 3)";
- $order = "(`ra`.`is_urgent` = '1' and `ra`.`report_status` = '4') desc, (`ra`.`is_urgent` = '1' and `ra`.`report_status` = '6') desc, (`ra`.`is_urgent` = '1' and `ra`.`report_status` = '7'), `ra`.`req_date_time` desc";
- $limit = "?, ?";
- $options = [
- $remote_institution_id,$remote_doctor_id
- ];
- $queryWhere = "";
- if(isset($_REQUEST['param'])){
- $param = $_REQUEST['param'];
- foreach ($param as $k => $v) {
- switch ($k) {
- case 'patient_num':
- $queryWhere.= " and `e`.`patient_num` like ?";
- $options[] = '%'.$v.'%';
- break;
- case 'exam_class' :
- if(empty($v)){
- break;
- }
- $length = sizeof($v);
- if($length === 1) {
- $queryWhere.= " and `e`.`exam_class` = ?";
- $options[] = $v[0];
- break;
- }
- $index = 1;
- $queryWhere.= " and (`e`.`exam_class` = ?";
- $options[] = $v[0];
- while($index < $length) {
- $queryWhere.= " or `e`.`exam_class` = ?";
- $options[] = $v[$index];
- $index++;
- }
- $queryWhere.= ')';
- // $queryWhere.= " and `e`.`exam_class` in ?";
- // $ex = implode("or `e`.`exam_class` = ", $v);
- // $val = "('".$ex."')";
- // // $where .= " and e.exam_class in ('".$ex."')";
- // $options[] = $val;
- // var_dump($val);
- break;
- case 'name':
- $queryWhere.= " and `pi`.`name` like ?";
- $options[] = '%'.$v.'%';
- break;
- case 'applicationtime':
- if(empty($v)){
- break;
- }
- $queryWhere.= " and `ra`.`req_date_time` between ? and ?";
- $options[] = $v[0];
- $options[] = $v[1];
- break;
- case 'is_urgent':
- if($v == 0){
- break;
- }
- $queryWhere.= " and `ra`.`is_urgent` = ?";
- $options[] = $v[0];
- break;
- case 'report_result':
- if($v == 1 || $v == 2) {
- $queryWhere.= " and `r`.`report_result` = ?";
- $options[] = $v[0];
- }
- break;
- case 'exam_status':
- if($v != 10){
- $queryWhere.= " and `ra`.`report_status` = ?";
- $options[] = $v[0];
- }
- break;
- }
- }
- }
- $where = $where1." and ".$where2." and ".$where3.$queryWhere.'and e.status=1' ;
- $listSql = "select ".$filed." from ".$table." where ".$where." order by ".$order." limit ".$limit;
- $countSql = "select count(*) as count from ".$table." where ".$where;
- log::record("----countSql----");
- log::record($countSql);
- log::record("----countSql----");
- log::record("---countSql-options----");
- log::record($options);
- log::record("---countSql-options----");
- $count = DB::query($countSql, $options);
- // var_dump($count);
- $options[] = ($page - 1) * $num;
- $options[] = $num;
- log::record("----sql----");
- log::record($listSql);
- log::record("----sql----");
- log::record("----options----");
- log::record($options);
- log::record("----options----");
- $list = DB::query($listSql, $options);
- foreach($list as $v) {
- if(empty($v['report_id'])) {
- $data = array();
- $data['id'] = UUIDs::uuid16();
- $data['exam_id'] = $v['exam_id'];
- $data['remote_application_id'] = $v['ra_id'];
- $data['type'] = 2;
- $data['createdAt'] = date('Y-m-d H:i:s',time());
- DB::table('report')->insert($data);
- $v['report_id'] = $data['id'];
- }
- }
- // var_dump($res);
- return json_encode(['status'=>'ok','code'=>'0000','count'=>$count[0]['count'],'info'=>$list,'sessionid'=>$sessionid]);
- } catch(\Exception $e) {
- return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
- }
- }
- // select
- // ra.id as ra_id, ra.anamnesis, ra.application_desc, ra.attachment, ra.clin_diag, ra.clin_symp, ra.createdAt, ra.exam_id, ra.family_ill, ra.illness_desc, ra.is_urgent, ra.local_institution_id, ra.marrital, ra.phys_sign, ra.remark, ra.remote_doctor_id, ra.remote_institution_id, ra.report_status, ra.req_date_time, ra.req_doctor_id, ra.status,
- // e.body_part, e.exam_class, e.device, e.exam_datetime, e.id as exam_id, e.exam_status, e.exam_sub_class, e.id, e.severe, e.patient_id,
- // r.report_datetime as rdatetime, r.report_datetime, r.report_doctor_id, r.id as report_id, r.report_result,
- // pi.age, pi.name, pi.sex,
- // i.name as local_institution_name
- // from
- // remote_application ra
- // left join
- // remote_order ro
- // on
- // ro.id = (
- // select
- // id
- // from
- // remote_order rot
- // where
- // rot.application_id = ra.id
- // order by timestamp desc limit 1
- // )
- // left join
- // exams e
- // on
- // ra.exam_id = e.id
- // left join
- // report r
- // on
- // ra.id = r.remote_application_id
- // left join
- // patient_infos pi
- // on
- // e.patient_id = pi.id
- // left join
- // institution i
- // on
- // ra.local_institution_id = i.id
- // where
- // ra.remote_institution_id='09b4765b26ba8b7c'
- // and
- // (report_status = '4' or report_status = '6' or report_status = '7' or report_status = '8' or report_status = '9')
- // and
- // (ra.remote_doctor_id='b5bed8f973852c22' or ra.remote_doctor_id = '')
- // and
- // (ro.status is null or ro.status = 2 or ro.status = 3)
- // order by
- // (ra.is_urgent = '1' and ra.report_status = '4') desc,
- // (ra.is_urgent = '1' and ra.report_status = '6') desc,
- // (ra.is_urgent = '1' and ra.report_status = '7'),
- // ra.req_date_time desc
- // -- 4、申请 5、驳回 6、接收、7、初步报告 8、审核报告 9、确认、
- //接受 3
- /*public function accept(){
- $sessionid = $_REQUEST['sessionid'];
- $doctor = Cache::get($sessionid);
- $id = $_REQUEST['id'];
- DB::table('exams')->where('id',$id)->update(['exam_status'=>6]);
- DB::table('report')->where('exam_id',$id)->update(['report_doctor_id',$doctor['id']]);
- return json_encode(['status'=>'ok','code'=>'0000','msg'=>'已接受']);
- }
- //驳回 7
- public function reject(){
- // $sessionid = $_REQUEST['sessionid'];
- // $doctor = Cache::get($sessionid);
- $id = $_REQUEST['id'];
- DB::table('exams')->where('id',$id)->update(['exam_status'=>5]);
- return json_encode(['status'=>'ok','code'=>'0000','msg'=>'已驳回']);
- }
- //确认 5
- public function confirm(){
- $sessionid = $_REQUEST['sessionid'];
- $doctor = Cache::get($sessionid);
- $id = $_REQUEST['id'];
- DB::table('exams')->where('id',$id)->update(['exam_status'=>9]);
- DB::table('report')->where('exam_id',$id)->update(['confirm_doctor_id'=>$doctor['id'],'confirm_datetime'=>date('Y-m-d H:i:s')]);
- return json_encode(['status'=>'ok','code'=>'0000','msg'=>'已确认']);
- }
- // 审核
- public function examine(){
- $id = $_REQUEST['id'];
- DB::table('exams')->where('id',$id)->update(['exam_status'=>8]);
- return json_encode(['status'=>'ok','code'=>'0000','msg'=>'已审核']);
- }*/
- }
|