Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The mediator SHOULD return a structured object that indicates the response that should be returned to the user as well as metadata about the actions that were performed. This structured object should be returned in the HTTP response for each request that the OpenHIM-core send to the mediator. This object The mediator MUST return this object with a content-type header with the value: 'application/json+openhim'. If the mediator wants to set a specific content-type to return to the client, they can set this in the response object as a header.

The JSON object returned to the OpenHIM should take the following form:

Code Block
languagejs
{
	"type": "openhim-response-type", // a static string that contains the response type, this should always contain this string
	"status": "Success", // (optional) an indicator of the status of the transaction, this can be one of the following: ['Processing', 'Failed', 'Completed', 'Successful', 'Completed with error(s)']
	"response": { ... }, // a response object as defined by OpenHIM-core - https://github.com/jembi/openhim-core-js/blob/master/src/model/transactions.coffee#L13-L18
	"orchestrations": { ... }, // (optional) an array of orchestration objects as defined by OpenHIM-core - https://github.com/jembi/openhim-core-js/blob/master/src/model/transactions.coffee#L26-L30
	"properties": { // (optional) a map of properties that the HIM may want to report
		"pro1": "val",
		"pro2": "val"
	}
}

...