NextGen Knowledge Center

FhirResponseFactory

This utility class makes the above even easier, with the following methods:

  • getReadResponse(message, vid, lastModified, statusCode, mimeType)
  • getVreadResponse(message, vid, lastModified, statusCode, mimeType)
  • getUpdateResponse(message, vid, lastModified, statusCode, mimeType)
  • getCreateResponse(message, id, vid, lastModified, statusCode, mimeType)
  • getResponse(message, id, vid, lastModified, statusCode, mimeType)
All of these are convenience methods for creating FhirResponse objects. Some methods have multiple versions depending on whether you're sending a payload back. For example instead of the code above, all that would be needed is this:

Note that documentation for these classes is included in the Reference list in transformers, and also in the auto-completion dialog. You can also view the Javadoc by going to the extensions/fhir/docs/javadocs/ folder in your installation directory.

Once you send back an appropriate FhirResponse object, the FHIR Listener will take care of everything else (status code, custom headers) automatically.