public
import "github.com/prescriptoo/prescriptoo-api/services/patient/public"Package public exposes patient-owned data and curated synchronous capabilities.
Index
- Variables
- type CreatePatientInput
- type CreatePatientParams
- type Demographics
- type DoctorAccessContext
- type GetPatientInput
- type ListPatientsInput
- type Page
- type PatchPatientInput
- type PatchPatientParams
- type Patient
- type PatientCreator
- type PatientLister
- type PatientPatcher
- type PatientReader
- type Snapshot
Variables
var (
// ErrInvalidInput rejects invalid patient data.
ErrInvalidInput = types.ErrPatientInvalidInput
// ErrUnauthorized indicates that current patient authentication failed.
ErrUnauthorized = types.ErrPatientUnauthorized
// ErrForbidden indicates missing patient authority.
ErrForbidden = types.ErrPatientForbidden
// ErrNotFound hides absent or inaccessible patient resources.
ErrNotFound = types.ErrPatientNotFound
// ErrConflict indicates a stale version or conflicting retry.
ErrConflict = types.ErrPatientConflict
// ErrUnavailable indicates a required patient provider failure.
ErrUnavailable = types.ErrPatientUnavailable
)type CreatePatientInput
CreatePatientInput carries credentials separately from client-owned parameters.
type CreatePatientInput struct {
Authorization string
IdempotencyKey string
DoctorAccess *DoctorAccessContext
Params CreatePatientParams
}type CreatePatientParams
CreatePatientParams is shared registration intent.
type CreatePatientParams = types.CreatePatientParamstype Demographics
Demographics is the shared patient demographic model.
type Demographics = types.Demographicstype DoctorAccessContext
DoctorAccessContext carries server-verified professional identity; it is never decoded from HTTP.
type DoctorAccessContext struct{ UserID, DoctorID string }type GetPatientInput
GetPatientInput is shared by HTTP reads and curated synchronous patient lookups.
type GetPatientInput struct {
Authorization, PatientID string
DoctorAccess *DoctorAccessContext
}type ListPatientsInput
ListPatientsInput selects an authorized organization and an opaque page cursor.
type ListPatientsInput struct {
DoctorAccess *DoctorAccessContext
Authorization, OrganizationID, Query, Cursor string
Limit int
}type Page
Page contains a newest-first, cursor-paginated result.
type Page[T any] struct {
Items []T `json:"items" nullable:"false"`
NextCursor string `json:"next_cursor,omitempty"`
CurrentPage int `json:"current_page"`
PerPage int `json:"per_page"`
TotalPages int `json:"total_pages"`
TotalItems int `json:"total_items"`
}type PatchPatientInput
PatchPatientInput updates only supplied profile fields.
type PatchPatientInput struct {
DoctorAccess *DoctorAccessContext
Authorization, PatientID string
Params PatchPatientParams
}type PatchPatientParams
PatchPatientParams retains the Patient public schema customization.
type PatchPatientParams types.PatchPatientParamsfunc (PatchPatientParams) TransformSchema
func (PatchPatientParams) TransformSchema(_ huma.Registry, schema *huma.Schema) *huma.SchemaTransformSchema permits null to clear optional enum fields.
func (*PatchPatientParams) UnmarshalJSON
func (p *PatchPatientParams) UnmarshalJSON(data []byte) errorUnmarshalJSON preserves omission and explicit null using the shared model.
type Patient
Patient is the shared organization-scoped patient model.
type Patient = types.Patienttype PatientCreator
PatientCreator exposes authorized patient registration.
type PatientCreator interface {
CreatePatient(context.Context, CreatePatientInput) (*Patient, error)
}type PatientLister
PatientLister exposes authorized organization patient search.
type PatientLister interface {
ListPatients(context.Context, ListPatientsInput) (*Page[Patient], error)
}type PatientPatcher
PatientPatcher exposes version-protected partial updates.
type PatientPatcher interface {
PatchPatient(context.Context, PatchPatientInput) (*Patient, error)
}type PatientReader
PatientReader returns authorized patient data without exposing persistence or internal entities.
type PatientReader interface {
GetPatient(context.Context, GetPatientInput) (*Patient, error)
}type Snapshot
Snapshot is the shared prescription patient snapshot.
type Snapshot = types.SnapshotGenerated by gomarkdoc