fix: 修改检查模块BUG

medical
Rmiku 2 months ago
parent 03e6e10048
commit d131a3702a
  1. 10
      app/Http/Logics/Report/InspectLogic.php
  2. 90
      app/Http/Resources/Report/Inspect/DetailsResource.php
  3. 4
      app/Http/Resources/Report/Inspect/ListsResource.php
  4. 2
      app/Services/HisHttp/Client.php

@ -67,8 +67,8 @@ class InspectLogic
throw new GeneralException($response['msg'] ?? '找不到该就诊卡!', Response::HTTP_SERVICE_UNAVAILABLE); throw new GeneralException($response['msg'] ?? '找不到该就诊卡!', Response::HTTP_SERVICE_UNAVAILABLE);
} }
Redis::setex($this->getInspectReportListsKey($this->open_id, $patient_info['patient_id']), 3600, json_encode($response['data'], JSON_UNESCAPED_UNICODE)); Redis::setex($this->getInspectReportListsKey($this->open_id, $patient_info['patient_id']), 3600, json_encode($response['response'], JSON_UNESCAPED_UNICODE));
return $response['data']; return $response['response'];
} }
/** /**
@ -91,9 +91,9 @@ class InspectLogic
$lists = json_decode($lists, true); $lists = json_decode($lists, true);
$info = []; $info = [];
foreach ($lists as $k => $v) { foreach ($lists['body'] as $v) {
if ($serial_no === $v['sourceId']) { if ($serial_no === $v['sourceId']) {
$info = []; $info = $v;
break; break;
} }
} }
@ -138,6 +138,6 @@ class InspectLogic
throw new GeneralException($response['msg'] ?? '找不到该就诊卡!', Response::HTTP_SERVICE_UNAVAILABLE); throw new GeneralException($response['msg'] ?? '找不到该就诊卡!', Response::HTTP_SERVICE_UNAVAILABLE);
} }
return $response['data']; return $response['response'];
} }
} }

@ -18,55 +18,47 @@ class DetailsResource extends JsonResource
return []; return [];
} }
$lists = []; $info = [
foreach ($this->resource['response']['body'] as $k => $v) { 'clinic_no' => $this->resource['clinicNo'],
// 过滤掉诊断为接口调用正常的第一条数据 'serial_no' => $this->resource['sourceId'],
if ($v['diagnose'] === '医院接口调用正常') { 'source_form' => $this->resource['sourceFrom'],
continue; 'dept_id' => $this->resource['dept']['localCode'],
} 'dept_name' => $this->resource['dept']['localText'],
'doctor_id' => $this->resource['doctor']['localText'],
'doctor_name' => $this->resource['doctor']['localText'],
'exam_type' => $this->resource['examMethod'],
'exam_name' => $this->resource['examName'],
'exam_purpose' => $this->resource['examPurpose'],
'diagnose' => $this->resource['diagnose'],
'exam_view' => $this->resource['examView'],
'diagnose_opinion' =>$this->resource['diagnoseOpinion'],
'created_time' => $this->resource['createDt'],
'check_time' => $this->resource['checkDt'],
'report_time' => $this->resource['reportDt'],
'comment' => $this->resource['comment'] ?: '',
// 患者信息
'patient_name' => $this->resource['patient']['name'],
'patient_gender' => (int)$this->resource['patient']['sex'],
'patient_birthday' => $this->resource['patient']['dob'],
// 冗余信息
'org_id' => $this->resource['org']['localCode'],
'org_name' => $this->resource['org']['localText'],
'equipment_name' => $this->resource['equipmentName'],
'equipment_no' => $this->resource['equipmentNameNo'] ?: '',
'report_doctor_id' => $this->resource['rpDoctor']['localCode'],
'report_doctor_name' => $this->resource['rpDoctor']['localText'],
'report_org_id' => $this->resource['rpOrg']['localCode'],
'report_org_name' => $this->resource['rpOrg']['localText'],
'crisis_flag' => (int) ($this->resource['crisisFlag'] ?: 0),
'crisis_desc' => $this->resource['crisisDesc'] ?: '',
'crisis_content' => $this->resource['crisisContent'] ?: '',
'unusual_flag' => (int) ($this->resource['unusualFlag'] ?: 0),
'deal_flag' => (int) ($this->resource['dealFlag'] ?: 0),
'need_deal_flag' => (int) ($this->resource['needDealFlag'] ?: 0),
// pacs 图片数组一般为空
'pacs_images' => (array) ($this->resource['pacs'] ?? [])
];
$lists[] = [ return $info;
'clinic_no' => $v['clinicNo'],
'serial_no' => $v['sourceId'],
'source_form' => $v['sourceFrom'],
'dept_id' => $v['dept']['localCode'],
'dept_name' => $v['dept']['localText'],
'doctor_id' => $v['doctor']['localText'],
'doctor_name' => $v['doctor']['localText'],
'exam_type' => $v['examMethod'],
'exam_name' => $v['examName'],
'exam_purpose' => $v['examPurpose'],
'diagnose' => $v['diagnose'],
'exam_view' => $v['examView'],
'diagnose_opinion' =>$v['diagnose_opinion'],
'created_time' => $v['createDt'],
'check_time' => $v['checkDt'],
'report_time' => $v['reportDt'],
'comment' => $v['comment'],
// 患者信息
'patient_name' => $v['patient']['name'],
'patient_gender' => $v['patient']['gender'],
'patient_birth' => $v['patient']['birthday'],
// 冗余信息
'org_id' => $v['org']['localCode'],
'org_name' => $v['org']['localText'],
'equipment_name' => $v['equipmentName'],
'equipment_no' => $v['equipmentNameNo'],
'report_doctor_id' => $v['rpDoctor']['localCode'],
'report_doctor_name' => $v['rpDoctor']['localText'],
'report_org_id' => $v['rpOrg']['localCode'],
'report_org_name' => $v['rpOrg']['localText'],
'crisis_flag' => $v['crisisFlag'],
'crisis_desc' => $v['crisisDesc'],
'crisis_content' => $v['crisisContent'],
'unusual_flag' => $v['unusualFlag'],
'deal_flag' => $v['dealFlag'],
'need_deal_flag' => $v['needDealFlag'],
// pacs 图片数组一般为空
'pacs_images' => (array) ($v['pacs'] ?? [])
];
}
return $lists;
} }
} }

@ -38,11 +38,11 @@ class ListsResource extends JsonResource
'exam_purpose' => $v['examPurpose'], 'exam_purpose' => $v['examPurpose'],
'diagnose' => $v['diagnose'], 'diagnose' => $v['diagnose'],
'exam_view' => $v['examView'], 'exam_view' => $v['examView'],
'diagnose_opinion' =>$v['diagnose_opinion'], 'diagnose_opinion' =>$v['diagnoseOpinion'],
'created_time' => $v['createDt'], 'created_time' => $v['createDt'],
'check_time' => $v['checkDt'], 'check_time' => $v['checkDt'],
'report_time' => $v['reportDt'], 'report_time' => $v['reportDt'],
'comment' => $v['comment'], 'comment' => $v['comment'] ?: '',
]; ];
} }

@ -661,7 +661,7 @@ class Client
*/ */
public function getInspectReportLists(string $patient_name, string $card_no, string $start_date, string $end_date, string $bar_code = '', string $source_id = ''): mixed public function getInspectReportLists(string $patient_name, string $card_no, string $start_date, string $end_date, string $bar_code = '', string $source_id = ''): mixed
{ {
return $this->requestHandle('POST', '0rientQueryExaReport', [ return $this->requestHandle('POST', 'orientQueryExamReport', [
'json' => [ 'json' => [
'patientName' => $patient_name, 'patientName' => $patient_name,
'orgId' => '45592623X44040211A1001', // 机构ID 珠海市香洲区第二人民医院 'orgId' => '45592623X44040211A1001', // 机构ID 珠海市香洲区第二人民医院

Loading…
Cancel
Save