@icure/be-fhc-api 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/x-api/message-x-api.js +7 -14
package/package.json
CHANGED
package/x-api/message-x-api.js
CHANGED
|
@@ -47,11 +47,10 @@ class MessageXApi {
|
|
|
47
47
|
.then(msg => {
|
|
48
48
|
return this.documentXApi
|
|
49
49
|
.newInstance(user, msg, {
|
|
50
|
-
mainUti: "public.json",
|
|
51
50
|
name: `${msg.subject}_content.json`
|
|
52
51
|
})
|
|
53
52
|
.then(doc => this.documentXApi.createDocument(doc))
|
|
54
|
-
.then(doc => this.documentXApi.setClearDocumentAttachment(doc, (0, api_1.ua2ab)((0, api_1.string2ua)(JSON.stringify(req)))))
|
|
53
|
+
.then(doc => this.documentXApi.setClearDocumentAttachment(doc, (0, api_1.ua2ab)((0, api_1.string2ua)(JSON.stringify(req))), ["public.json"]))
|
|
55
54
|
.then(() => msg);
|
|
56
55
|
});
|
|
57
56
|
}
|
|
@@ -357,11 +356,10 @@ class MessageXApi {
|
|
|
357
356
|
.then(msg => {
|
|
358
357
|
return docXApi
|
|
359
358
|
.newInstance(user, msg, {
|
|
360
|
-
mainUti: "public.json",
|
|
361
359
|
name: `${msg.subject}_content.json`
|
|
362
360
|
})
|
|
363
361
|
.then(doc => docXApi.createDocument(doc))
|
|
364
|
-
.then(doc => docXApi.setClearDocumentAttachment(doc, (0, api_1.ua2ab)((0, api_1.string2ua)(JSON.stringify(dmgMessage)))))
|
|
362
|
+
.then(doc => docXApi.setClearDocumentAttachment(doc, (0, api_1.ua2ab)((0, api_1.string2ua)(JSON.stringify(dmgMessage))), ["public.json"]))
|
|
365
363
|
.then(() => msg);
|
|
366
364
|
});
|
|
367
365
|
}
|
|
@@ -632,15 +630,12 @@ class MessageXApi {
|
|
|
632
630
|
.then(msg => this.api.createMessage(msg))
|
|
633
631
|
.then(msg => Promise.all([
|
|
634
632
|
this.documentXApi.newInstance(user, msg, {
|
|
635
|
-
mainUti: "public.plain-text",
|
|
636
633
|
name: msg.subject
|
|
637
634
|
}),
|
|
638
635
|
this.documentXApi.newInstance(user, msg, {
|
|
639
|
-
mainUti: "public.json",
|
|
640
636
|
name: `${msg.subject}_records`
|
|
641
637
|
}),
|
|
642
638
|
this.documentXApi.newInstance(user, msg, {
|
|
643
|
-
mainUti: "public.json",
|
|
644
639
|
name: `${msg.subject}_parsed_records`
|
|
645
640
|
})
|
|
646
641
|
])
|
|
@@ -650,9 +645,9 @@ class MessageXApi {
|
|
|
650
645
|
this.documentXApi.createDocument(jsonParsedDoc)
|
|
651
646
|
]))
|
|
652
647
|
.then(([doc, jsonDoc, jsonParsedDoc]) => Promise.all([
|
|
653
|
-
this.documentXApi.setClearDocumentAttachment(doc, (0, api_1.ua2ab)((0, api_1.string2ua)(efactMessage.detail))),
|
|
654
|
-
this.documentXApi.setClearDocumentAttachment(jsonDoc, (0, api_1.ua2ab)((0, api_1.string2ua)(JSON.stringify(efactMessage)))),
|
|
655
|
-
this.documentXApi.setClearDocumentAttachment(jsonParsedDoc, (0, api_1.ua2ab)((0, api_1.string2ua)(JSON.stringify(parsedRecords))))
|
|
648
|
+
this.documentXApi.setClearDocumentAttachment(doc, (0, api_1.ua2ab)((0, api_1.string2ua)(efactMessage.detail)), ["public.plain-text"]),
|
|
649
|
+
this.documentXApi.setClearDocumentAttachment(jsonDoc, (0, api_1.ua2ab)((0, api_1.string2ua)(JSON.stringify(efactMessage))), ["public.json"]),
|
|
650
|
+
this.documentXApi.setClearDocumentAttachment(jsonParsedDoc, (0, api_1.ua2ab)((0, api_1.string2ua)(JSON.stringify(parsedRecords))), ["public.json"])
|
|
656
651
|
]))
|
|
657
652
|
.then(() => ["920999", "920099", "920900"].includes(messageType)
|
|
658
653
|
? this.invoiceXApi.getInvoices(new api_1.ListOfIds({ ids: parentMessage.invoiceIds }))
|
|
@@ -904,11 +899,9 @@ class MessageXApi {
|
|
|
904
899
|
saveMessageAttachment(user, msg, res) {
|
|
905
900
|
return Promise.all([
|
|
906
901
|
this.documentXApi.newInstance(user, msg, {
|
|
907
|
-
mainUti: "public.json",
|
|
908
902
|
name: "920000_records"
|
|
909
903
|
}),
|
|
910
904
|
this.documentXApi.newInstance(user, msg, {
|
|
911
|
-
mainUti: "public.plain-text",
|
|
912
905
|
name: "920000"
|
|
913
906
|
})
|
|
914
907
|
])
|
|
@@ -917,8 +910,8 @@ class MessageXApi {
|
|
|
917
910
|
this.documentXApi.createDocument(doc)
|
|
918
911
|
]))
|
|
919
912
|
.then(([jsonDoc, doc]) => Promise.all([
|
|
920
|
-
this.documentXApi.setClearDocumentAttachment(jsonDoc, (0, api_1.ua2ab)((0, api_1.string2ua)(JSON.stringify(res.records)))),
|
|
921
|
-
this.documentXApi.setClearDocumentAttachment(doc, (0, api_1.ua2ab)((0, api_1.string2ua)(res.detail)))
|
|
913
|
+
this.documentXApi.setClearDocumentAttachment(jsonDoc, (0, api_1.ua2ab)((0, api_1.string2ua)(JSON.stringify(res.records))), ["public.json"]),
|
|
914
|
+
this.documentXApi.setClearDocumentAttachment(doc, (0, api_1.ua2ab)((0, api_1.string2ua)(res.detail)), ["public.plain-text"])
|
|
922
915
|
]))
|
|
923
916
|
.then(() => this.receiptXApi.iccApi.logReceipt(user, msg.id, [
|
|
924
917
|
`mycarenet:efact:inputReference:${res.inputReference}`,
|