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: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenErr        = "Invalid Token"
	ExpiredErr      = "Expired Token"
	DbErr           = "Database Error"
	FormatErr       = "Formatting Error"
	BbErr           = "Blue Button Error"
	InternalErr     = "Internal Error"
	RequestErr      = "Request Error"
	UnauthorizedErr = "Unauthorized Error"
	NotFoundErr     = "Not Found Error"
	DeletedErr      = "Deleted Error"
)

Internal codes: These will be modified over time

View Source
const (
	JobFailed       = "Job Failed"
	DetailJobFailed = "Service encountered numerous errors. Job failed to complete."
)
View Source
const (
	UnknownEntityErr = "unknown entity"
)

External messaging: Messages that will be in response body

Variables

This section is empty.

Functions

func CreateCapabilityStatement

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

func CreateJobsBundle

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

func CreateJobsBundleEntry

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

func CreateOpOutcome

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

func GetFhirStatusCode

func GetFhirStatusCode(status models.JobStatus) fhircodes.TaskStatusCode_Value

func WriteBundleResponse

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

func WriteCapabilityStatement

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

func WriteError

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

func WriteOperationOutcome

func WriteOperationOutcome(w io.Writer, outcome *fhirmodels.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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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