体检报告本地存储,未完成

wenjuan
yanzai 1 year ago
parent 363f332708
commit b79baa2518

@ -0,0 +1,92 @@
<?php
namespace App\Http\Controllers\API\Admin\Yewu;
use App\Http\Controllers\API\PEISApiController;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class ReportController extends Controller
{
public function ReportInfo()
{
$type = "la"; //la拉取 //tui 推送
$hospital_id = request('hospital_id');
$id_number = request('id_number');
$reports_detail_list = [];
$peis = new PEISApiController();
if ($type == 'la') {
$person = DB::table('web_user_person')->where(['id_number' => $id_number, 'is_del' => 0])->first();
if (!$person) return \Yz::echoError1('体检人不存在');
$data = [
'电话号码' => "",
'证件号码' => $id_number,
'体检号' => ""
];
$reports = $peis::Post('体检报告查询', $hospital_id, $data);
if (count($reports['data']) > 0) {
$reports_detail_list = $reports['data'];
}
}
//获取到报告列表后
foreach ($reports_detail_list as $key => $reports_detail) {
$data = [
'电话号码' => "",
'证件号码' => "",
'体检号' => $reports_detail['体检号']
];
$res = $peis::Post('体检报告查询', $hospital_id, $data);
$res = $res['data'][0];
//根据体检号查询获取id万一不小心有多个相同的体检号 所以返回数组正常就1个
$report_l1_records_ids=DB::table('report_l1_records')->where(['体检号'=>$res['体检号']])->pluck('id')->toArray();
//查找对应的收费项目列表 获取id数组
$report_l2_items_ids=DB::table('report_l2_items')->whereIn('reprort_l1_id',$report_l1_records_ids)->pluck('id')->toArray();
//查找 基础项目列表 删除
$report_l3_base_items_del=DB::table('report_l3_base_items')->whereIn('report_l2_id',$report_l2_items_ids)->delete();
//删除report_l2_items表数据
DB::table('report_l2_items')->whereIn('id',$report_l2_items_ids)->delete();
//删除report_l1_records表数据
DB::table('report_l1_records')->whereIn('id',$report_l1_records_ids)->delete();
//删除完后,进行添加
$r_data = [
"体检类型" => isset($res['体检类型'])?$res['体检类型']:null,
"查询密码" => isset($res['查询密码'])?$res['查询密码']:null,
"审核时间" => isset($res['审核时间'])?$res['审核时间']:null,
"总检医生" => isset($res['总检医生'])?$res['总检医生']:null,
"总检结论" => isset($res['总检结论'])?$res['总检结论']:null,
"总检建议" => isset($res['总检建议'])?$res['总检建议']:null,
"病种列表" => isset($res['病种列表'])?json_encode($res['病种列表'],JSON_UNESCAPED_UNICODE):null,
"报告文件列表" => isset($res['报告文件列表'])?json_encode($res['报告文件列表'],JSON_UNESCAPED_UNICODE):null,
"卡号" => $res['卡号'],
"证件类型" => $res['证件类型'],
"证件号码" => $res['证件号码'],
"地址" => $res['地址'],
"电话号码" => $res['电话号码'],
"婚姻状态" => $res['婚姻状态'],
"单位名称" => $res['单位名称'],
"批次Id" => $res['批次Id'],
"批次名称" => $res['批次名称'],
"部门名称" => $res['部门名称'],
"分组名称" => $res['分组名称'],
"体检号" => $res['体检号'],
"姓名" => $res['姓名'],
"性别" => $res['性别'],
"出生日期" => $res['出生日期'],
"登记时间" => $res['登记时间'],
"检前签到时间" => $res['检前签到时间'],
"体检状态" => $res['体检状态'],
"报告日期" => $res['报告日期'],
"套餐名称" => $res['套餐名称'],
"团检" => $res['团检'],
"支持下载报告文件" => $res['支持下载报告文件'],
];
$insert_report_l1_records=DB::table('report_l1_records')->insert($r_data);
if($res['体检状态']=='报告已出'){
}
}
}
}

@ -0,0 +1,13 @@
<?php
namespace App\Http\Controllers\API\H5;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Http\Controllers\API\PEISApiController;
use Illuminate\Support\Facades\DB;
class ReportController extends Controller
{
}

@ -27,6 +27,7 @@ class PEISApiController extends Controller
$api['团检预约'] = "{$url}/PEISCommon/UnitAppointment/{$code}";
$api['团检预约查询'] = "{$url}/PEISCommon/QueryUnitAppointment/{$code}";
$api['团检预约取消'] = "{$url}/PEISCommon/CancelUnitAppointment/{$code}";
$api['体检报告查询'] = "{$url}/PEISCommon/QueryExamReport/{$code}";
return $api["{$url_code}"] ?? $url_code;

@ -92,6 +92,7 @@ Route::group(['middleware' => ['checktoken', 'log'], 'prefix' => 'v1'], function
Route::post('admin/UpdateCombo', 'App\Http\Controllers\API\Admin\YeWu\ComboController@UpdateCombo')->middleware('log');
Route::post('admin/UpdateItem','App\Http\Controllers\API\Admin\YeWu\ItemController@UpdateItem')->middleware('log');
Route::post('admin/ReportInfo','App\Http\Controllers\API\Admin\YeWu\ReportController@ReportInfo')->middleware('log');
Route::group(['middleware' => ['log'], 'prefix' => 'v1'], function () { //路由分组

Loading…
Cancel
Save