Skip to content

Commit

Permalink
fixed a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ashaban committed May 11, 2021
1 parent e429782 commit df249f7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion server/lib/fhir.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions server/lib/mixins/matchMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [{
Expand Down
6 changes: 4 additions & 2 deletions server/lib/routes/match.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1476,6 +1477,7 @@ router.post('/unbreak-match', (req, res) => {
});
});
}
logger.error(JSON.stringify(auditBundle,0,2));
});
} else {
return res.status(400).json({
Expand Down
8 changes: 5 additions & 3 deletions ui/src/views/Client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit df249f7

Please sign in to comment.