diff --git a/server/lib/fhir.js b/server/lib/fhir.js index 2c201385..562fb641 100644 --- a/server/lib/fhir.js +++ b/server/lib/fhir.js @@ -105,7 +105,7 @@ module.exports = () => ({ url = false; request.get(options, (err, res, body) => { statusCode = res.statusCode; - if (res && (res.statusCode < 200 || res.statusCode > 299)) { + if (res && (res.statusCode < 200 || res.statusCode > 299) && res.statusCode !== 404) { logger.error(body); } if (err) { diff --git a/server/lib/mixins/matchMixin.js b/server/lib/mixins/matchMixin.js index 9309d6df..5194f8d9 100644 --- a/server/lib/mixins/matchMixin.js +++ b/server/lib/mixins/matchMixin.js @@ -387,10 +387,10 @@ function createAddPatientAudEvent(operationSummary, req) { system: 'http://dicom.nema.org/resources/ontology/DCM', code: '110110' }, - subtype: { + subtype: [{ system: 'http://hl7.org/fhir/restful-interaction', code: operSummary.action, - }, + }], action, recorded: moment().format("YYYY-MM-DDThh:mm:ss.SSSZ"), agent: [{ diff --git a/server/lib/routes/match.js b/server/lib/routes/match.js index e0a3b90c..ee93e00e 100644 --- a/server/lib/routes/match.js +++ b/server/lib/routes/match.js @@ -927,10 +927,10 @@ router.post('/break-match', (req, res) => { system: 'http://dicom.nema.org/resources/ontology/DCM', code: '110110' }, - subtype: { + subtype: [{ system: 'http://hl7.org/fhir/restful-interaction', code: 'update', - }, + }], action: 'U', recorded: moment().format("YYYY-MM-DDThh:mm:ss.SSSZ"), agent: [{ @@ -1437,6 +1437,7 @@ router.post('/unbreak-match', (req, res) => { }] }; matchMixin.addPatient(clientID, patientsBundle, (err, response, operSum) => { + // operationSummary.push(operSum); const tmpAuditBundle = matchMixin.createAddPatientAudEvent(operationSummary, req); auditBundle.entry = auditBundle.entry.concat(tmpAuditBundle.entry); logger.info('Done rematching ' + entry.resource.id); @@ -1476,6 +1477,7 @@ router.post('/unbreak-match', (req, res) => { }); }); } + logger.error(JSON.stringify(auditBundle,0,2)); }); } else { return res.status(400).json({ diff --git a/ui/src/views/Client.vue b/ui/src/views/Client.vue index d1cdff6a..5d99cc51 100644 --- a/ui/src/views/Client.vue +++ b/ui/src/views/Client.vue @@ -761,9 +761,11 @@ export default { ); }); let operation; - for (let subtype of event.resource.subtype) { - if (subtype.system === "http://hl7.org/fhir/restful-interaction") { - operation = subtype.code; + if(event.resource.subtype && Array.isArray(event.resource.subtype)) { + for (let subtype of event.resource.subtype) { + if (subtype.system === "http://hl7.org/fhir/restful-interaction") { + operation = subtype.code; + } } } modifiedEvent.operation = operation;