http
import "github.com/prescriptoo/prescriptoo-api/services/prescription/internal/presentation/http"Package http exposes validated prescription contracts through Huma.
Index
- type AuthenticatedInput
- type CancelInput
- type CreateInput
- type CreateSuggestionAdviceInput
- type CreateSuggestionDiagnosisInput
- type CreateSuggestionInvestigationInput
- type Handler
- type HistoryInput
- type IssueInput
- type ListInput
- type ListSuggestionsInput
- type PaginationInput
- type PatchInput
- type PrescriptionInput
- type SuggestionAdviceHandler
- type SuggestionAdviceInput
- type SuggestionDiagnosisHandler
- type SuggestionDiagnosisInput
- type SuggestionInvestigationHandler
- type SuggestionInvestigationInput
- type UpdateSuggestionAdviceInput
- type UpdateSuggestionDiagnosisInput
- type UpdateSuggestionInvestigationInput
type AuthenticatedInput
AuthenticatedInput documents credentials without enforcing them in stub operations.
type AuthenticatedInput struct {
Authorization string `header:"Authorization" hidden:"true"`
}type CancelInput
CancelInput requires a reason and current version.
type CancelInput struct {
PrescriptionInput
Body prescriptionpublic.CancelPrescriptionParams
}type CreateInput
CreateInput accepts patient context and optional draft clinical content.
type CreateInput struct {
AuthenticatedInput
Body prescriptionpublic.CreatePrescriptionParams
RawBody []byte
}func (*CreateInput) Resolve
func (i *CreateInput) Resolve(_ huma.Context) []errorResolve validates contradictions within supplied clinical content, not persisted issuance rules.
type CreateSuggestionAdviceInput
CreateSuggestionAdviceInput accepts the advice suggestion label.
type CreateSuggestionAdviceInput struct {
Body servicepublic.SuggestionAdviceParams
}type CreateSuggestionDiagnosisInput
CreateSuggestionDiagnosisInput accepts the diagnosis suggestion label.
type CreateSuggestionDiagnosisInput struct {
Body servicepublic.SuggestionDiagnosisParams
}type CreateSuggestionInvestigationInput
CreateSuggestionInvestigationInput accepts the investigation suggestion label.
type CreateSuggestionInvestigationInput struct {
Body servicepublic.SuggestionInvestigationParams
}type Handler
Handler wires each HTTP operation to an individual service-owned use case.
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
func NewHandler() *HandlerNewHandler creates documentation-first operations without persistence dependencies.
func (*Handler) RegisterHuma
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.
type HistoryInput struct {
AuthenticatedInput
PaginationInput
PatientID string `path:"patientId" minLength:"1" pattern:"\\S"`
}type IssueInput
IssueInput checks the expected version before future issuance.
type IssueInput struct {
PrescriptionInput
Body prescriptionpublic.IssuePrescriptionParams
}type ListInput
ListInput filters records in an explicitly authorized organization.
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.
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.
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.
type PatchInput struct {
PrescriptionInput
Body prescriptionpublic.PatchPrescriptionParams
RawBody []byte
}func (*PatchInput) Resolve
func (i *PatchInput) Resolve(_ huma.Context) []errorResolve rejects version-only patches and validates only supplied clinical sections.
type PrescriptionInput
PrescriptionInput identifies an immutable prescription resource.
type PrescriptionInput struct {
AuthenticatedInput
PrescriptionID string `path:"prescriptionId" minLength:"1" pattern:"\\S"`
}type SuggestionAdviceHandler
SuggestionAdviceHandler serves the global advice suggestion entity.
type SuggestionAdviceHandler struct {
// contains filtered or unexported fields
}func NewSuggestionAdviceHandler
func NewSuggestionAdviceHandler(repo ports.SuggestionAdviceRepository) *SuggestionAdviceHandlerNewSuggestionAdviceHandler injects the advice suggestion repository.
func (*SuggestionAdviceHandler) RegisterHuma
func (h *SuggestionAdviceHandler) RegisterHuma(api huma.API)RegisterHuma registers CRUD routes for advice suggestions.
type SuggestionAdviceInput
SuggestionAdviceInput identifies an advice suggestion.
type SuggestionAdviceInput struct {
ID string `path:"suggestionAdviceId" minLength:"1" maxLength:"255" pattern:"\\S"`
}type SuggestionDiagnosisHandler
SuggestionDiagnosisHandler serves the global diagnosis suggestion entity.
type SuggestionDiagnosisHandler struct {
// contains filtered or unexported fields
}func NewSuggestionDiagnosisHandler
func NewSuggestionDiagnosisHandler(repo ports.SuggestionDiagnosisRepository) *SuggestionDiagnosisHandlerNewSuggestionDiagnosisHandler injects the diagnosis suggestion repository.
func (*SuggestionDiagnosisHandler) RegisterHuma
func (h *SuggestionDiagnosisHandler) RegisterHuma(api huma.API)RegisterHuma registers CRUD routes for diagnosis suggestions.
type SuggestionDiagnosisInput
SuggestionDiagnosisInput identifies a diagnosis suggestion.
type SuggestionDiagnosisInput struct {
ID string `path:"suggestionDiagnosisId" minLength:"1" maxLength:"255" pattern:"\\S"`
}type SuggestionInvestigationHandler
SuggestionInvestigationHandler serves the global investigation suggestion entity.
type SuggestionInvestigationHandler struct {
// contains filtered or unexported fields
}func NewSuggestionInvestigationHandler
func NewSuggestionInvestigationHandler(repo ports.SuggestionInvestigationRepository) *SuggestionInvestigationHandlerNewSuggestionInvestigationHandler injects the investigation suggestion repository.
func (*SuggestionInvestigationHandler) RegisterHuma
func (h *SuggestionInvestigationHandler) RegisterHuma(api huma.API)RegisterHuma registers CRUD routes for investigation suggestions.
type SuggestionInvestigationInput
SuggestionInvestigationInput identifies an investigation suggestion.
type SuggestionInvestigationInput struct {
ID string `path:"suggestionInvestigationId" minLength:"1" maxLength:"255" pattern:"\\S"`
}type UpdateSuggestionAdviceInput
UpdateSuggestionAdviceInput updates only the advice suggestion label.
type UpdateSuggestionAdviceInput struct {
SuggestionAdviceInput
Body servicepublic.SuggestionAdviceParams
}type UpdateSuggestionDiagnosisInput
UpdateSuggestionDiagnosisInput updates only the diagnosis suggestion label.
type UpdateSuggestionDiagnosisInput struct {
SuggestionDiagnosisInput
Body servicepublic.SuggestionDiagnosisParams
}type UpdateSuggestionInvestigationInput
UpdateSuggestionInvestigationInput updates only the investigation suggestion label.
type UpdateSuggestionInvestigationInput struct {
SuggestionInvestigationInput
Body servicepublic.SuggestionInvestigationParams
}Generated by gomarkdoc