修改聊天内页基础数据接口

This commit is contained in:
2023-03-30 11:09:43 +08:00
parent 177b5f28d7
commit 1d09e024b8
4 changed files with 101 additions and 6 deletions
+91 -1
View File
@@ -2,9 +2,14 @@
namespace App\Services;
use App\Constants\HttpEnumCode;
use App\Exception\BusinessException;
use App\Model\DoctorPharmacistCert;
use App\Model\OrderPrescription;
use App\Model\OrderPrescriptionIcd;
use App\Model\OrderPrescriptionProduct;
use App\Model\OrderProductItem;
use Extend\Ca\Ca;
use Hyperf\Contract\LengthAwarePaginatorInterface;
class OrderPrescriptionService extends BaseService
@@ -33,7 +38,7 @@ class OrderPrescriptionService extends BaseService
* @param string|int $per_page
* @return array
*/
public function getPharmacistWaitAuditPage(string $pharmacist_id,int $pharmacist_audit_status,int $platform_audit_status,string|int $page = 1,string|int $per_page = 10): array
public function getPharmacistWaitAuditPage(string $pharmacist_id, int $pharmacist_audit_status, int $platform_audit_status, string|int $page = 1, string|int $per_page = 10): array
{
$params = array();
$params['pharmacist_id'] = $pharmacist_id;
@@ -93,4 +98,89 @@ class OrderPrescriptionService extends BaseService
$params['pharmacist_audit_status'] = 1;
return OrderPrescription::getCount($params);
}
// 开具处方时获取云证书签名
public function getCaCertSign(array $order_prescription, array $order_prescription_icd, array $order_prescription_product)
{
try {
// // 获取处方数据
// $params = array();
// $params['order_prescription_id'] = $order_prescription_id;
// $order_prescription = OrderPrescription::getOne($params);
// if (empty($order_prescription)){
// throw new BusinessException("处方数据错误");
// }
//
// // 获取处方关联疾病数据
// $params = array();
// $params['order_prescription_id'] = $order_prescription_id;
// $order_prescription_icd = OrderPrescriptionIcd::getOne($params);
// if (empty($order_prescription_icd)){
// throw new BusinessException("处方疾病数据错误");
// }
//
// // 获取处方关联商品数据
// $params = array();
// $params['order_prescription_id'] = $order_prescription_id;
// $order_prescription_product = OrderPrescriptionProduct::getList($params);
// if (empty($order_prescription_product)){
// throw new BusinessException("处方药品数据错误");
// }
$ca = new Ca();
// 获取云证书签名
$data = array();
$data['created_at'] = $order_prescription;
$data['department_custom_name'] = "外科";
$data['user_name'] = "测试用户1";
$data['sex'] = "";
$data['age'] = 19;
$data['allergy_history'] = "";
$data['icd_name'] = "感冒";
$data['doctor_advice'] = "多吃药";
$data['product'] = [
[
"product_name" => "感冒药150ml*10",
"single_unit" => "一次一包",
"frequency_use" => "1天3次",
"single_use" => "口服",
"prescription_product_num" => "X1盒",
],
[
"product_name" => "感冒药250ml*10",
"single_unit" => "一次一包",
"frequency_use" => "1天3次",
"single_use" => "口服",
"prescription_product_num" => "X1盒",
],
[
"product_name" => "感冒药350ml*10",
"single_unit" => "一次一包",
"frequency_use" => "1天3次",
"single_use" => "口服",
"prescription_product_num" => "X1盒",
],
[
"product_name" => "感冒药450ml*10",
"single_unit" => "一次一包",
"frequency_use" => "1天3次",
"single_use" => "口服",
"prescription_product_num" => "X1盒",
],
[
"product_name" => "感冒药550ml*10",
"single_unit" => "一次一包",
"frequency_use" => "1天3次",
"single_use" => "口服",
"prescription_product_num" => "X1盒",
],
];
$result = $ca->getCertSign("491925054435950592", "491925054435950592", $data);
} catch (\Exception $e) {
}
}
}