This commit is contained in:
wucongxing 2023-03-31 16:38:05 +08:00
parent a8e0dbf891
commit bb7ea260f3
2 changed files with 17 additions and 19 deletions

View File

@ -10,6 +10,7 @@ use App\Model\DoctorInquiryTime;
use App\Model\DoctorPharmacistCert; use App\Model\DoctorPharmacistCert;
use App\Model\OrderInquiry; use App\Model\OrderInquiry;
use App\Model\OrderPrescription; use App\Model\OrderPrescription;
use App\Model\OrderPrescriptionIcd;
use App\Model\UserDoctor; use App\Model\UserDoctor;
use App\Services\ImService; use App\Services\ImService;
use App\Services\MessagePush; use App\Services\MessagePush;
@ -507,27 +508,24 @@ class TestController extends AbstractController
} }
public function test_11(){ public function test_11(){
$ca = new Ca(); // 获取处方关联疾病数据
$prescription_pdf_result = $ca->getSignedFile("491925054435950592","1641368425758359554"); $params = array();
if (empty($prescription_pdf_result)){ $params['order_prescription_id'] = "500341310934036481";
throw new BusinessException("下载处方签章文件失败"); $order_prescription_icd = OrderPrescriptionIcd::getOne($params);
if (empty($order_prescription_icd)){
throw new BusinessException("处方疾病数据错误");
} }
$file = fopen("./runtime/test.pdf", "w") or die("Unable to open file!"); dump($order_prescription_icd->toArray());
fwrite($file, $prescription_pdf_result); // 处理疾病数据
fclose($file); $icd_name = array_column($order_prescription_icd->toArray(),'icd_name');
if (!empty($icd_name)){
$icd_name = implode(';',$icd_name);
}else{
$icd_name = "";
}
// 将临时文件转换为图片 dump($icd_name);
$pdf = new Pdf("./runtime/test.pdf");
$pdf->saveImage("./runtime/test.jpg");
// dump($prescription_pdf_result);
//
// $manager = new ImageManager();
// $image = $manager->make($prescription_pdf_result)->convert('jpg');
//
// // 保存图片
// $image->save('./runtime/image.jpg');
} }
} }

View File

@ -166,7 +166,7 @@ class OrderPrescriptionService extends BaseService
// 获取处方关联疾病数据 // 获取处方关联疾病数据
$params = array(); $params = array();
$params['order_prescription_id'] = $order_prescription_id; $params['order_prescription_id'] = $order_prescription_id;
$order_prescription_icd = OrderPrescriptionIcd::getOne($params); $order_prescription_icd = OrderPrescriptionIcd::getList($params);
if (empty($order_prescription_icd)){ if (empty($order_prescription_icd)){
throw new BusinessException("处方疾病数据错误"); throw new BusinessException("处方疾病数据错误");
} }