This commit is contained in:
wucongxing 2023-04-26 09:15:21 +08:00
parent ab557a857a
commit 2d492a98d3

View File

@ -114,55 +114,7 @@ class CaService extends BaseService
// 创建通道
$channel = new Channel();
$wg->add(4);
// 获取处方关联疾病名称
co(function () use ($wg,$channel,$order_prescription_id) {
defer(function() use ($wg) {
$wg->done();
});
$params = array();
$params['order_prescription_id'] = $order_prescription_id;
$order_prescription_icd = OrderPrescriptionIcd::getList($params);
if (empty($order_prescription_icd)) {
$channel->push('处方疾病数据错误');
return;
}
dump(111);
$this->icd_name = "";
$icd_name = array_column($order_prescription_icd->toArray(), 'icd_name');
dump($icd_name);
if (!empty($icd_name)) {
if (count($icd_name) > 1) {
dump(22222);
$this->icd_name = implode(';', $icd_name);
} else {
dump(333);
$this->icd_name = $icd_name[0];
}
}
});
// 获取处方关联商品数据
co(function () use ($wg,$channel,$order_prescription_id) {
defer(function() use ($wg) {
$wg->done();
});
$params = array();
$params['order_prescription_id'] = $order_prescription_id;
$order_prescription_product = OrderPrescriptionProduct::getList($params);
if (empty($order_prescription_product)) {
$channel->push('处方药品数据错误');
return;
}
$this->order_prescription_product = $order_prescription_product->toArray();
});
$wg->add(2);
// 获取医生自定义科室名称
$doctor_id = $order_prescription['doctor_id'];
@ -213,8 +165,6 @@ class CaService extends BaseService
// 结束
$wg->wait();
dump($this->icd_name);
// 判断通道是否存在异常数据
$res = $channel->isEmpty();
if (!$res){
@ -230,6 +180,34 @@ class CaService extends BaseService
$channel->close();
}
// 获取处方关联疾病名称
$params = array();
$params['order_prescription_id'] = $order_prescription_id;
$order_prescription_icd = OrderPrescriptionIcd::getList($params);
if (empty($order_prescription_icd)) {
throw new BusinessException("处方疾病数据错误");
}
$this->icd_name = "";
$icd_name = array_column($order_prescription_icd->toArray(), 'icd_name');
if (!empty($icd_name)) {
if (count($icd_name) > 1) {
$this->icd_name = implode(';', $icd_name);
} else {
$this->icd_name = $icd_name[0];
}
}
// 获取处方药品数据
$params = array();
$params['order_prescription_id'] = $order_prescription_id;
$order_prescription_product = OrderPrescriptionProduct::getList($params);
if (empty($order_prescription_product)) {
throw new BusinessException("处方药品数据错误");
}
$this->order_prescription_product = $order_prescription_product->toArray();
// 处方pdf本地地址
$this->prescription_pdf_local_path = "./runtime/file/prescription/" . $order_prescription_id . '.pdf';