修改新增家庭成员返回数据类型
This commit is contained in:
parent
4c23655a7c
commit
bcc4d60170
@ -8,6 +8,8 @@ use App\Constants\HttpEnumCode;
|
||||
use App\Exception\BusinessException;
|
||||
use App\Model\DoctorInquiryTime;
|
||||
use App\Model\OrderPrescriptionProduct;
|
||||
use App\Model\OrderProduct;
|
||||
use App\Model\OrderProductItem;
|
||||
use App\Model\UserCaCert;
|
||||
use App\Model\OrderInquiry;
|
||||
use App\Model\OrderPrescription;
|
||||
@ -40,9 +42,8 @@ class TestController extends AbstractController
|
||||
// $this->test_11();
|
||||
// $this->test_5();
|
||||
// $this->test_1();
|
||||
// $this->test_11();
|
||||
$this->test_11();
|
||||
// $this->test_12();
|
||||
$this->test_13();
|
||||
}
|
||||
|
||||
// 获取云证书-首次
|
||||
@ -576,7 +577,7 @@ class TestController extends AbstractController
|
||||
}
|
||||
|
||||
public function test_11(){
|
||||
$order_prescription_id = "";
|
||||
$order_prescription_id = "501751534291394561";
|
||||
|
||||
// 获取处方数据
|
||||
$params = array();
|
||||
@ -594,11 +595,37 @@ class TestController extends AbstractController
|
||||
throw new BusinessException("处方药品数据错误");
|
||||
}
|
||||
|
||||
// 获取问诊订单数据
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $order_prescription['order_inquiry_id'];
|
||||
$order_inquiry = OrderInquiry::getOne($params);
|
||||
if (empty($order_inquiry)) {
|
||||
throw new BusinessException("处方药品数据错误");
|
||||
}
|
||||
|
||||
// 获取商品订单数据
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $order_prescription['order_inquiry_id'];
|
||||
$order_product = OrderProduct::getOne($params);
|
||||
if (empty($order_product)) {
|
||||
throw new BusinessException("处方药品数据错误");
|
||||
}
|
||||
|
||||
// 获取商品订单数据
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $order_prescription['order_inquiry_id'];
|
||||
$order_product_item = OrderProductItem::getList($params);
|
||||
if (empty($order_product_item)) {
|
||||
throw new BusinessException("处方药品数据错误");
|
||||
}
|
||||
|
||||
$OrderPrescriptionService = new OrderPrescriptionService();
|
||||
$result = $OrderPrescriptionService->reportPrescription();
|
||||
$result = $OrderPrescriptionService->reportPrescription(
|
||||
$order_inquiry->toArray(),
|
||||
$order_prescription->toArray(),
|
||||
$order_prescription_product->toArray(),
|
||||
$order_product->toArray()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@ use App\Model\UserPharmacistInfo;
|
||||
use Extend\Alibaba\Oss;
|
||||
use Extend\Ca\Ca;
|
||||
use Hyperf\Contract\LengthAwarePaginatorInterface;
|
||||
use Hyperf\Utils\WaitGroup;
|
||||
use Intervention\Image\ImageManager;
|
||||
use TCPDF;
|
||||
|
||||
@ -560,10 +561,41 @@ class OrderPrescriptionService extends BaseService
|
||||
// 上报处方平台
|
||||
public function reportPrescription(array $order_inquiry, array $order_prescription, array $order_prescription_product, array $order_product)
|
||||
{
|
||||
$wg = new WaitGroup();
|
||||
$wg->add(2);
|
||||
|
||||
$user = []; // 就诊患者用户数据
|
||||
$patient_family = []; // 家庭成员-基本信息
|
||||
$order_prescription_icd = []; // 处方关联疾病数据
|
||||
$user_doctor = []; // 医生数据
|
||||
$hospital_department_custom = []; // 医生科室
|
||||
$user_doctor_info = []; // 医生详情数据
|
||||
$user_pharmacist = []; // 药师数据
|
||||
$user_pharmacist_info = []; // 药师详数据
|
||||
$order_inquiry_case = []; // 病例数据
|
||||
|
||||
// 获取就诊患者用户数据
|
||||
$user_id = $order_inquiry['user_id'];
|
||||
co(function () use ($wg,&$user,$user_id) {
|
||||
$params = array();
|
||||
$params['user_id'] = $order_inquiry['user_id'];
|
||||
$params['user_id'] = $user_id;
|
||||
$user = User::getOne($params);
|
||||
|
||||
// 计数器减一
|
||||
$wg->done();
|
||||
});
|
||||
|
||||
// 获取家庭成员-基本信息
|
||||
$family_id = $order_inquiry['family_id'];
|
||||
co(function () use ($wg,&$patient_family,$family_id) {
|
||||
$params = array();
|
||||
$params['family_id'] = $family_id;
|
||||
$patient_family = PatientFamily::getOne($params);
|
||||
|
||||
// 计数器减一
|
||||
$wg->done();
|
||||
});
|
||||
|
||||
if (empty($user)) {
|
||||
throw new BusinessException("用户数据错误");
|
||||
}
|
||||
@ -587,7 +619,7 @@ class OrderPrescriptionService extends BaseService
|
||||
// 处理疾病数据
|
||||
$icd_name = array_column($order_prescription_icd->toArray(), 'icd_name');
|
||||
if (!empty($icd_name)) {
|
||||
if (count($icd_name > 1)){
|
||||
if (count($icd_name) > 1) {
|
||||
$icd_name = implode(';', $icd_name);
|
||||
} else {
|
||||
$icd_name = $icd_name[0];
|
||||
@ -680,7 +712,7 @@ class OrderPrescriptionService extends BaseService
|
||||
$arg['thirdLastPharmacistImg'] = addAliyunOssWebsite($user_pharmacist_info['sign_image']); // 终审药师签名 链接
|
||||
$arg['ThirdLastTime'] = $order_prescription['pharmacist_verify_time']; // 终审时间
|
||||
$arg['thirdSignImg'] = addAliyunOssWebsite("/basic/file/hospital_signature.png"); // 处方签章链接
|
||||
$arg['referenceCharge'] = $order_product['amount_total']; // 处方费用
|
||||
$arg['referenceCharge'] = $order_product['amount_total']; // 处方费用(不包含运费)
|
||||
$arg['chiefComplaint'] = $order_inquiry_case['disease_desc'] ?: ""; // 主诉
|
||||
$arg['historyPresent'] = $order_inquiry_case['disease_class_name'] ?: ""; // 现病史
|
||||
$arg['pastHistory'] = $order_inquiry_case['family_history'] ?: "无"; // 既往史
|
||||
@ -703,7 +735,7 @@ class OrderPrescriptionService extends BaseService
|
||||
$arg['drugList'][$key]['drugName'] = $product['product_name']; // 药品名称
|
||||
$arg['drugList'][$key]['specifications'] = $product['product_spec']; // 药品规格
|
||||
$arg['drugList'][$key]['price'] = $product['product_price']; // 药品单价
|
||||
$arg['drugList'][$key]['packingCount'] = $item['amount']; // 药品数量
|
||||
$arg['drugList'][$key]['packingCount'] = $item['prescription_product_num']; // 药品数量
|
||||
$arg['drugList'][$key]['surplusPackingCount'] = 0; // 处方药品剩余使用数量
|
||||
$arg['drugList'][$key]['packingUnit'] = $product['packaging_unit']; // 药品单位
|
||||
$arg['drugList'][$key]['singleDosage'] = $product['single_unit']; // 单次用量
|
||||
@ -717,10 +749,11 @@ class OrderPrescriptionService extends BaseService
|
||||
$arg['orderDrugList'][$key]['drugName'] = $product['product_name']; // 药品名称
|
||||
$arg['orderDrugList'][$key]['specifications'] = $product['product_spec']; // 药品规格
|
||||
$arg['orderDrugList'][$key]['price'] = $product['product_price']; // 药品单价
|
||||
$arg['orderDrugList'][$key]['drugCount'] = $item['amount']; // 药品数量
|
||||
$arg['orderDrugList'][$key]['drugCount'] = $item['prescription_product_num']; // 药品数量
|
||||
$arg['orderDrugList'][$key]['packingUnit'] = $product['packaging_unit']; // 药品单位
|
||||
}
|
||||
|
||||
|
||||
return $arg;
|
||||
}
|
||||
}
|
||||
@ -229,7 +229,7 @@ class PatientFamilyService extends BaseService
|
||||
}
|
||||
|
||||
$result = array();
|
||||
$result['family_id'] = $patient_family['family_id'];
|
||||
$result['family_id'] = (string)$patient_family['family_id'];
|
||||
return success($result);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user