fix:问题修复
This commit is contained in:
parent
552dc546be
commit
6185f89f95
@ -1121,6 +1121,15 @@ async function auditDiagnosis(item, db) {
|
|||||||
if (passList.length) {
|
if (passList.length) {
|
||||||
let successRxList = [];
|
let successRxList = [];
|
||||||
const auditTime = Date.now();
|
const auditTime = Date.now();
|
||||||
|
// uploadRx2His 内部会按处方 id 从 MongoDB 重新读取记录并生成 PDF,
|
||||||
|
// 因此不能只在内存 rx 对象中补签名,必须先写入数据库。
|
||||||
|
await db.collection("diagnostic-record").updateMany(
|
||||||
|
{
|
||||||
|
_id: { $in: passList.map(i => i.rx._id) },
|
||||||
|
status: status.init,
|
||||||
|
},
|
||||||
|
{ $set: { pharmacistSignImg: pharmacistCAUserId } }
|
||||||
|
);
|
||||||
const uploadResult = await Promise.all(passList.map(i => uploadRx2His({ ...i.rx, auditTime }, i.order)));
|
const uploadResult = await Promise.all(passList.map(i => uploadRx2His({ ...i.rx, auditTime }, i.order)));
|
||||||
uploadResult.forEach(i => {
|
uploadResult.forEach(i => {
|
||||||
if (i.success) {
|
if (i.success) {
|
||||||
|
|||||||
@ -129,8 +129,11 @@ function safeDataImage(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getUploadRoot() {
|
function getUploadRoot() {
|
||||||
// 与 upload.js 使用相同的共享上传目录,拒绝任意文件系统路径。
|
// 源码运行时:<repo>/hn-hlw-service/hlw/prescription-pdf -> <repo>/upload-files。
|
||||||
return path.resolve(__dirname, "../../../upload-files");
|
// esbuild 后 __dirname 为 /opt/apps(bundle_pro.js 所在目录),上传目录则为 /opt/apps/upload-files。
|
||||||
|
return process.env.IS_BUILDED === "YES"
|
||||||
|
? path.resolve(__dirname, "../upload-files")
|
||||||
|
: path.resolve(__dirname, "../../../upload-files");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getImageMimeType(buffer, contentType = "") {
|
function getImageMimeType(buffer, contentType = "") {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user