Skip to content

http ​

go
import "github.com/prescriptoo/prescriptoo-api/services/prescription/internal/presentation/http"

Package http exposes validated prescription contracts through Huma.

Index ​

type AuthenticatedInput ​

AuthenticatedInput documents credentials without enforcing them in stub operations.

go
type AuthenticatedInput struct {
    Authorization string `header:"Authorization" hidden:"true"`
}

type CancelInput ​

CancelInput requires a reason and current version.

go
type CancelInput struct {
    PrescriptionInput
    Body prescriptionpublic.CancelPrescriptionParams
}

type CreateInput ​

CreateInput accepts patient context and optional draft clinical content.

go
type CreateInput struct {
    AuthenticatedInput
    Body    prescriptionpublic.CreatePrescriptionParams
    RawBody []byte
}

func (*CreateInput) Resolve ​

go
func (i *CreateInput) Resolve(_ huma.Context) []error

Resolve validates contradictions within supplied clinical content, not persisted issuance rules.

type CreateSuggestionAdviceInput ​

CreateSuggestionAdviceInput accepts the advice suggestion label.

go
type CreateSuggestionAdviceInput struct {
    Body servicepublic.SuggestionAdviceParams
}

type CreateSuggestionDiagnosisInput ​

CreateSuggestionDiagnosisInput accepts the diagnosis suggestion label.

go
type CreateSuggestionDiagnosisInput struct {
    Body servicepublic.SuggestionDiagnosisParams
}

type CreateSuggestionInvestigationInput ​

CreateSuggestionInvestigationInput accepts the investigation suggestion label.

go
type CreateSuggestionInvestigationInput struct {
    Body servicepublic.SuggestionInvestigationParams
}

type Handler ​

Handler wires each HTTP operation to an individual service-owned use case.

go
type Handler struct {
    Create  executor[servicepublic.CreatePrescriptionInput, servicepublic.Prescription]
    List    executor[servicepublic.ListPrescriptionsInput, servicepublic.Page[servicepublic.Summary]]
    Get     executor[servicepublic.GetPrescriptionInput, servicepublic.Prescription]
    Patch   executor[servicepublic.PatchPrescriptionInput, servicepublic.Prescription]
    Issue   executor[servicepublic.IssuePrescriptionInput, servicepublic.Prescription]
    Cancel  executor[servicepublic.CancelPrescriptionInput, servicepublic.Prescription]
    History executor[servicepublic.GetPatientHistoryInput, servicepublic.PatientPrescriptionHistory]
}

func NewHandler ​

go
func NewHandler() *Handler

NewHandler creates documentation-first operations without persistence dependencies.

func (*Handler) RegisterHuma ​

go
func (h *Handler) RegisterHuma(api huma.API)

RegisterHuma registers typed success schemas, validation and explicit stub responses.

type HistoryInput ​

HistoryInput selects a page of prescription-derived patient history.

go
type HistoryInput struct {
    AuthenticatedInput
    PaginationInput
    PatientID string `path:"patientId" minLength:"1" pattern:"\\S"`
}

type IssueInput ​

IssueInput checks the expected version before future issuance.

go
type IssueInput struct {
    PrescriptionInput
    Body prescriptionpublic.IssuePrescriptionParams
}

type ListInput ​

ListInput filters records in an explicitly authorized organization.

go
type ListInput struct {
    AuthenticatedInput
    PaginationInput
    OrganizationID string `query:"organization_id" required:"true" minLength:"1" pattern:"\\S"`
    PatientID      string `query:"patient_id" minLength:"1" pattern:"\\S"`
    DoctorID       string `query:"doctor_id" minLength:"1" pattern:"\\S"`
    Status         string `query:"status" enum:"draft,issued,canceled"`
}

type ListSuggestionsInput ​

ListSuggestionsInput selects a bounded page and optional literal label search.

go
type ListSuggestionsInput struct {
    Q      string `query:"q" maxLength:"255"`
    Limit  int    `query:"limit" minimum:"1" maximum:"100" default:"20"`
    Cursor string `query:"cursor" maxLength:"8192" doc:"Opaque cursor tied to the catalog and search query."`
}

type PaginationInput ​

PaginationInput contains bounded pagination and a filter-bound cursor.

go
type PaginationInput struct {
    Limit  int    `query:"limit" minimum:"1" maximum:"100" default:"20"`
    Cursor string `query:"cursor" doc:"Opaque cursor tied to organization and selected filters."`
}

type PatchInput ​

PatchInput replaces changed sections of the author's draft.

go
type PatchInput struct {
    PrescriptionInput
    Body    prescriptionpublic.PatchPrescriptionParams
    RawBody []byte
}

func (*PatchInput) Resolve ​

go
func (i *PatchInput) Resolve(_ huma.Context) []error

Resolve rejects version-only patches and validates only supplied clinical sections.

type PrescriptionInput ​

PrescriptionInput identifies an immutable prescription resource.

go
type PrescriptionInput struct {
    AuthenticatedInput
    PrescriptionID string `path:"prescriptionId" minLength:"1" pattern:"\\S"`
}

type SuggestionAdviceHandler ​

SuggestionAdviceHandler serves the global advice suggestion entity.

go
type SuggestionAdviceHandler struct {
    // contains filtered or unexported fields
}

func NewSuggestionAdviceHandler ​

go
func NewSuggestionAdviceHandler(repo ports.SuggestionAdviceRepository) *SuggestionAdviceHandler

NewSuggestionAdviceHandler injects the advice suggestion repository.

func (*SuggestionAdviceHandler) RegisterHuma ​

go
func (h *SuggestionAdviceHandler) RegisterHuma(api huma.API)

RegisterHuma registers CRUD routes for advice suggestions.

type SuggestionAdviceInput ​

SuggestionAdviceInput identifies an advice suggestion.

go
type SuggestionAdviceInput struct {
    ID string `path:"suggestionAdviceId" minLength:"1" maxLength:"255" pattern:"\\S"`
}

type SuggestionDiagnosisHandler ​

SuggestionDiagnosisHandler serves the global diagnosis suggestion entity.

go
type SuggestionDiagnosisHandler struct {
    // contains filtered or unexported fields
}

func NewSuggestionDiagnosisHandler ​

go
func NewSuggestionDiagnosisHandler(repo ports.SuggestionDiagnosisRepository) *SuggestionDiagnosisHandler

NewSuggestionDiagnosisHandler injects the diagnosis suggestion repository.

func (*SuggestionDiagnosisHandler) RegisterHuma ​

go
func (h *SuggestionDiagnosisHandler) RegisterHuma(api huma.API)

RegisterHuma registers CRUD routes for diagnosis suggestions.

type SuggestionDiagnosisInput ​

SuggestionDiagnosisInput identifies a diagnosis suggestion.

go
type SuggestionDiagnosisInput struct {
    ID string `path:"suggestionDiagnosisId" minLength:"1" maxLength:"255" pattern:"\\S"`
}

type SuggestionInvestigationHandler ​

SuggestionInvestigationHandler serves the global investigation suggestion entity.

go
type SuggestionInvestigationHandler struct {
    // contains filtered or unexported fields
}

func NewSuggestionInvestigationHandler ​

go
func NewSuggestionInvestigationHandler(repo ports.SuggestionInvestigationRepository) *SuggestionInvestigationHandler

NewSuggestionInvestigationHandler injects the investigation suggestion repository.

func (*SuggestionInvestigationHandler) RegisterHuma ​

go
func (h *SuggestionInvestigationHandler) RegisterHuma(api huma.API)

RegisterHuma registers CRUD routes for investigation suggestions.

type SuggestionInvestigationInput ​

SuggestionInvestigationInput identifies an investigation suggestion.

go
type SuggestionInvestigationInput struct {
    ID string `path:"suggestionInvestigationId" minLength:"1" maxLength:"255" pattern:"\\S"`
}

type UpdateSuggestionAdviceInput ​

UpdateSuggestionAdviceInput updates only the advice suggestion label.

go
type UpdateSuggestionAdviceInput struct {
    SuggestionAdviceInput
    Body servicepublic.SuggestionAdviceParams
}

type UpdateSuggestionDiagnosisInput ​

UpdateSuggestionDiagnosisInput updates only the diagnosis suggestion label.

go
type UpdateSuggestionDiagnosisInput struct {
    SuggestionDiagnosisInput
    Body servicepublic.SuggestionDiagnosisParams
}

type UpdateSuggestionInvestigationInput ​

UpdateSuggestionInvestigationInput updates only the investigation suggestion label.

go
type UpdateSuggestionInvestigationInput struct {
    SuggestionInvestigationInput
    Body servicepublic.SuggestionInvestigationParams
}

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.