Documentation
¶
Index ¶
Constants ¶
View Source
const FormMimeType = "application/x-www-form-urlencoded"
View Source
const JSONMimeType = "application/fhir+json"
Variables ¶
This section is empty.
Functions ¶
func BadRequestError ¶
func SendErrorResponse ¶
func SendErrorResponse(ctx context.Context, httpResponse http.ResponseWriter, err error)
SendErrorResponse will send the given error as OperationOutcome to the FHIR client. If the error isn't an Error instance, it will send a generic error back to the FHIR client, to avoid leaking sensitive internals.
func SendResponse ¶
func SendResponse(ctx context.Context, httpResponse http.ResponseWriter, httpStatus int, resource interface{})
Types ¶
type Error ¶
type Error struct {
// Message is the message that can be return to the FHIR client.
Message string
// Cause is an optional error that is only logged internally, not returned to the FHIR client.
Cause error
// IssueType is the FHIR issue type that is used in the OperationOutcome.
IssueType fhir.IssueType
}
Error defines a problem that can be translated to a FHIR OperationOutcome, to be returned to the FHIR client.
func (Error) OperationOutcome ¶
func (e Error) OperationOutcome() fhir.OperationOutcome
Click to show internal directories.
Click to hide internal directories.