janstuemmel/campfhir-server

View on GitHub
lib/util/operationOutcome.js

Summary

Maintainability
A
0 mins
Test Coverage
const { Http } = require('fhir-proof');
const { OperationOutcome } = Http;


module.exports.createError = (code, text) => {

  return OperationOutcome({
    issue: [
      {
        severity: 'error',
        code: code,
        details: {
          text: text
        }
      }
    ]
  })
};