responseutils

package
v0.0.0-...-41bf266 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: CC0-1.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCapabilityStatement

func CreateCapabilityStatement(reldate time.Time, relversion, baseurl string) *fhirmodelCS.CapabilityStatement

func CreateJobsBundle

func CreateJobsBundle(jobs []*models.Job, host string) *fhirmodelCR.Bundle

func CreateJobsBundleEntry

func CreateJobsBundleEntry(job *models.Job, host string) *fhirmodelCR.Bundle_Entry

func CreateOpOutcome

func CreateOpOutcome(severity fhircodes.IssueSeverityCode_Value, code fhircodes.IssueTypeCode_Value,
	errType, diagnostics string) *fhirmodelOO.OperationOutcome

func GetFhirStatusCode

func GetFhirStatusCode(status models.JobStatus) fhircodes.TaskStatusCode_Value

func WriteBundleResponse

func WriteBundleResponse(bundle *fhirmodelCR.Bundle, w http.ResponseWriter)

func WriteCapabilityStatement

func WriteCapabilityStatement(ctx context.Context, statement *fhirmodelCS.CapabilityStatement, w http.ResponseWriter)

func WriteError

func WriteError(ctx context.Context, outcome *fhirmodelOO.OperationOutcome, w http.ResponseWriter, code int)

func WriteOperationOutcome

func WriteOperationOutcome(w io.Writer, outcome *fhirmodelOO.OperationOutcome) (int, error)

Types

type ResponseWriter

type ResponseWriter struct{}

func NewResponseWriter

func NewResponseWriter() ResponseWriter

func (ResponseWriter) Exception

func (r ResponseWriter) Exception(ctx context.Context, w http.ResponseWriter, statusCode int, errType, errMsg string)

func (ResponseWriter) JobsBundle

func (r ResponseWriter) JobsBundle(ctx context.Context, w http.ResponseWriter, jobs []*models.Job, host string)

func (ResponseWriter) NotFound

func (r ResponseWriter) NotFound(ctx context.Context, w http.ResponseWriter, statusCode int, errType, errMsg string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL