家庭成员健康情况增加是否正在服药
This commit is contained in:
parent
b428db8e99
commit
25cdfbc20a
@ -44,7 +44,7 @@ class TestController extends AbstractController
|
||||
// 获取云证书-首次
|
||||
public function test_1(){
|
||||
$ca = new Ca();
|
||||
|
||||
// // 测试医生
|
||||
// $data = array();
|
||||
// $data['user_id'] = "491925054435950592";
|
||||
// $data['card_num'] = "410323199603261241";
|
||||
@ -61,9 +61,10 @@ class TestController extends AbstractController
|
||||
// return fail();
|
||||
// }
|
||||
|
||||
// 测试药师
|
||||
$data = array();
|
||||
$data['user_id'] = "534534546";
|
||||
$data['card_num'] = "410323199603261236";
|
||||
$data['card_num'] = "410323199603261240";
|
||||
$result = $ca->getCloudCert($data);
|
||||
|
||||
$data = array();
|
||||
|
||||
@ -163,6 +163,11 @@ class OrderPrescriptionService extends BaseService
|
||||
throw new BusinessException("医生开方日期错误");
|
||||
}
|
||||
|
||||
// 药师端检测处方图片
|
||||
if ($user['user_type'] == 3 && empty($order_prescription['prescription_img'])){
|
||||
throw new BusinessException("医生开方日期错误");
|
||||
}
|
||||
|
||||
// 获取处方关联疾病数据
|
||||
$params = array();
|
||||
$params['order_prescription_id'] = $order_prescription_id;
|
||||
@ -236,14 +241,23 @@ class OrderPrescriptionService extends BaseService
|
||||
$data['product'][] = $product;
|
||||
}
|
||||
dump("签名获取成功");
|
||||
|
||||
if ($user['user_type'] == 3){
|
||||
$cert_sign_result = $ca->getCertSign($user['user_id'], $user['user_id'], $data);
|
||||
}else{
|
||||
$cert_sign_result = $ca->getCertSign("491925054435950592", "491925054435950592", $data);
|
||||
}
|
||||
|
||||
|
||||
// 验证云证书签名-验证无需处理,只要不返回错误即可
|
||||
$ca->verifyPkcs7($cert_sign_result['signP7'],$data);
|
||||
dump("签名验证成功");
|
||||
// 下载基础处方pdf图片
|
||||
|
||||
$oss = new Oss();
|
||||
|
||||
// 医生
|
||||
if ($user['user_type'] == 2){
|
||||
// 下载基础处方pdf图片
|
||||
$filename = "basic/file/prescription.jpg";
|
||||
$prescription_image = $oss->getObjectToRAM($filename);
|
||||
|
||||
@ -361,6 +375,23 @@ class OrderPrescriptionService extends BaseService
|
||||
$filename = "applet/prescription/" . $order_prescription['order_prescription_id'] . '.' . 'jpg';
|
||||
$prescription_img_url = $oss->putObject($filename, $img_result);
|
||||
dump("处方图片上传oss成功");
|
||||
}
|
||||
|
||||
// 药师
|
||||
if ($user['user_type'] == 3){
|
||||
// 下载开具的处方图片
|
||||
$filename = "basic/file/prescription.jpg";
|
||||
$prescription_image = $oss->getObjectToRAM($filename);
|
||||
|
||||
dump("下载基础处方pdf图片成功");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 图片生成pdf
|
||||
$pdf = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', false);
|
||||
|
||||
@ -779,11 +779,14 @@ class PatientFamilyService extends BaseService
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($request_params['drugs_name'])){
|
||||
if (isset($request_params['is_take_medicine'])){
|
||||
if ($request_params['is_take_medicine'] != $patient_family_health['is_take_medicine']){
|
||||
$data['is_take_medicine'] = $request_params['is_take_medicine'];
|
||||
if ($request_params['drugs_name'] != $patient_family_health['drugs_name']){
|
||||
$data['drugs_name'] = $request_params['drugs_name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($data)){
|
||||
$data['updated_at'] = date('Y-m-d H:i:s', time());
|
||||
@ -845,7 +848,10 @@ class PatientFamilyService extends BaseService
|
||||
|
||||
$data['diagnosis_date'] = $request_params['diagnosis_date'];
|
||||
$data['diagnosis_hospital'] = $request_params['diagnosis_hospital'];
|
||||
if (isset($request_params['is_take_medicine'])){
|
||||
$data['is_take_medicine'] = $request_params['is_take_medicine'];
|
||||
$data['drugs_name'] = $request_params['drugs_name'];
|
||||
}
|
||||
$patient_family_health = PatientFamilyHealth::addPatientFamilyHealth($data);
|
||||
if (empty($patient_family_health)){
|
||||
return fail();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user