新增查看患者病例接口
This commit is contained in:
@@ -10,6 +10,8 @@ use App\Model\OrderInquiry;
|
||||
use App\Model\OrderInquiryCase;
|
||||
use App\Model\OrderInquiryCoupon;
|
||||
use App\Model\PatientFamily;
|
||||
use App\Model\PatientFamilyHealth;
|
||||
use App\Model\PatientFamilyPersonal;
|
||||
use App\Model\Product;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Utils\PcreMatch;
|
||||
@@ -257,6 +259,83 @@ class InquiryService extends BaseService
|
||||
return success($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者问诊病例
|
||||
* @return array
|
||||
*/
|
||||
public function getPatientInquiryCase(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
$inquiry_case_id = $this->request->route('inquiry_case_id');
|
||||
|
||||
// 获取病例信息
|
||||
$params = array();
|
||||
$params['inquiry_case_id'] = $inquiry_case_id;
|
||||
$order_inquiry_case = OrderInquiryCase::getOne($params);
|
||||
if (empty($order_inquiry_case)){
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 获取患者家庭成员信息表-基本信息
|
||||
$params = array();
|
||||
$params['family_id'] = $order_inquiry_case['family_id'];
|
||||
$patient_family = PatientFamily::getOne($params);
|
||||
$order_inquiry_case['height'] = $order_inquiry_case['height'] ?: $patient_family['height'] ?: NULL;
|
||||
$order_inquiry_case['weight'] = $order_inquiry_case['weight'] ?: $patient_family['weight'] ?: NULL;
|
||||
$order_inquiry_case['job_name'] = $patient_family['job_name'] ?? "";
|
||||
$order_inquiry_case['nation_name'] = $patient_family['nation_name'] ?? "";
|
||||
|
||||
// 获取患者家庭成员信息表-健康情况
|
||||
$params = array();
|
||||
$params['family_id'] = $order_inquiry_case['family_id'];
|
||||
$patient_family_health = PatientFamilyHealth::getOne($params);
|
||||
$order_inquiry_case['diagnosis_hospital'] = $patient_family_health['diagnosis_hospital'] ?? "";
|
||||
|
||||
// 获取患者家庭成员信息表-个人情况
|
||||
$params = array();
|
||||
$params['family_id'] = $order_inquiry_case['family_id'];
|
||||
$patient_family_personal = PatientFamilyPersonal::getOne($params);
|
||||
$order_inquiry_case['drink_wine_status'] = $patient_family_personal['drink_wine_status'] ?? 1;
|
||||
$order_inquiry_case['smoke_status'] = $patient_family_personal['smoke_status'] ?? 1;
|
||||
$order_inquiry_case['chemical_compound_status'] = $patient_family_personal['chemical_compound_status'] ?? 1;
|
||||
$order_inquiry_case['chemical_compound_describe'] = $patient_family_personal['chemical_compound_describe'] ?? "";
|
||||
$order_inquiry_case['is_operation'] = $patient_family_personal['is_operation'] ?? 0;
|
||||
$order_inquiry_case['operation'] = $patient_family_personal['operation'] ?? "";
|
||||
|
||||
// 获取用药意向
|
||||
$product = [];
|
||||
$fields = [
|
||||
'inquiry_case_id',
|
||||
'product_id',
|
||||
'case_product_num',
|
||||
];
|
||||
$params = array();
|
||||
$params['inquiry_case_id'] = $order_inquiry_case['inquiry_case_id'];
|
||||
$inquiry_case_product = InquiryCaseProduct::getWithProductList($params,$fields);
|
||||
if (!empty($inquiry_case_product)){
|
||||
foreach ($inquiry_case_product as &$item){
|
||||
if (!empty($item['Product'])){
|
||||
$product[] = $item['Product']['product_name'] . ' ' . $item['Product']['product_spec'] . '(' . $item['case_product_num'] . $item['Product']['packaging_unit'] . ')';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$order_inquiry_case['product'] = $product;
|
||||
unset($inquiry_case_product);
|
||||
|
||||
// 复诊凭证
|
||||
if (!empty($order_inquiry_case['diagnose_images'])){
|
||||
$diagnose_images = explode(',',$order_inquiry_case['diagnose_images']);
|
||||
foreach ($diagnose_images as &$item){
|
||||
$item = addAliyunOssWebsite($item);
|
||||
}
|
||||
|
||||
$order_inquiry_case['diagnose_images'] = $diagnose_images;
|
||||
}
|
||||
|
||||
return success($order_inquiry_case->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生未接诊订单数量
|
||||
* @param string $doctor_id 医生id
|
||||
|
||||
Reference in New Issue
Block a user