Update index.js
This commit is contained in:
parent
8125e9d4e6
commit
7f250d0668
@ -1050,7 +1050,8 @@ async function auditDiagnosis(item, db) {
|
|||||||
// 4. 根据分组 分别处理
|
// 4. 根据分组 分别处理
|
||||||
if (passList.length) {
|
if (passList.length) {
|
||||||
let successRxList = [];
|
let successRxList = [];
|
||||||
const uploadResult = await Promise.all(passList.map(i => uploadRx2His(i.rx, i.order)));
|
const auditTime = Date.now();
|
||||||
|
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) {
|
||||||
const rx = passList.find(j => j.rx._id.toString() === i.id.toString());
|
const rx = passList.find(j => j.rx._id.toString() === i.id.toString());
|
||||||
@ -1069,7 +1070,7 @@ async function auditDiagnosis(item, db) {
|
|||||||
$set: {
|
$set: {
|
||||||
uploadStatus: "uploaded",
|
uploadStatus: "uploaded",
|
||||||
status: status.pass,
|
status: status.pass,
|
||||||
auditTime: Date.now(),
|
auditTime,
|
||||||
pharmacistSignImg: pharmacistCAUserId,
|
pharmacistSignImg: pharmacistCAUserId,
|
||||||
auditSource
|
auditSource
|
||||||
}
|
}
|
||||||
@ -1143,9 +1144,6 @@ async function auditDiagnosis(item, db) {
|
|||||||
async function uploadRx2His(rx, order) {
|
async function uploadRx2His(rx, order) {
|
||||||
try {
|
try {
|
||||||
const uploadData = formatUploadRxData(rx, order);
|
const uploadData = formatUploadRxData(rx, order);
|
||||||
console.log('='.repeat(10))
|
|
||||||
console.log('='.repeat(10))
|
|
||||||
console.log(JSON.stringify(uploadData))
|
|
||||||
const { success, message } = await hnHis({
|
const { success, message } = await hnHis({
|
||||||
type: 'hlwuploadprescription',
|
type: 'hlwuploadprescription',
|
||||||
data: uploadData
|
data: uploadData
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user