Skip to content

public ​

go
import "github.com/prescriptoo/prescriptoo-api/services/patient/public"

Package public exposes patient-owned data and curated synchronous capabilities.

Index ​

Variables ​

go
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.

go
type CreatePatientInput struct {
    Authorization  string
    IdempotencyKey string
    DoctorAccess   *DoctorAccessContext
    Params         CreatePatientParams
}

type CreatePatientParams ​

CreatePatientParams is shared registration intent.

go
type CreatePatientParams = types.CreatePatientParams

type Demographics ​

Demographics is the shared patient demographic model.

go
type Demographics = types.Demographics

type DoctorAccessContext ​

DoctorAccessContext carries server-verified professional identity; it is never decoded from HTTP.

go
type DoctorAccessContext struct{ UserID, DoctorID string }

type GetPatientInput ​

GetPatientInput is shared by HTTP reads and curated synchronous patient lookups.

go
type GetPatientInput struct {
    Authorization, PatientID string
    DoctorAccess             *DoctorAccessContext
}

type ListPatientsInput ​

ListPatientsInput selects an authorized organization and an opaque page cursor.

go
type ListPatientsInput struct {
    DoctorAccess                                 *DoctorAccessContext
    Authorization, OrganizationID, Query, Cursor string
    Limit                                        int
}

type Page ​

Page contains a newest-first, cursor-paginated result.

go
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.

go
type PatchPatientInput struct {
    DoctorAccess             *DoctorAccessContext
    Authorization, PatientID string
    Params                   PatchPatientParams
}

type PatchPatientParams ​

PatchPatientParams retains the Patient public schema customization.

go
type PatchPatientParams types.PatchPatientParams

func (PatchPatientParams) TransformSchema ​

go
func (PatchPatientParams) TransformSchema(_ huma.Registry, schema *huma.Schema) *huma.Schema

TransformSchema permits null to clear optional enum fields.

func (*PatchPatientParams) UnmarshalJSON ​

go
func (p *PatchPatientParams) UnmarshalJSON(data []byte) error

UnmarshalJSON preserves omission and explicit null using the shared model.

type Patient ​

Patient is the shared organization-scoped patient model.

go
type Patient = types.Patient

type PatientCreator ​

PatientCreator exposes authorized patient registration.

go
type PatientCreator interface {
    CreatePatient(context.Context, CreatePatientInput) (*Patient, error)
}

type PatientLister ​

PatientLister exposes authorized organization patient search.

go
type PatientLister interface {
    ListPatients(context.Context, ListPatientsInput) (*Page[Patient], error)
}

type PatientPatcher ​

PatientPatcher exposes version-protected partial updates.

go
type PatientPatcher interface {
    PatchPatient(context.Context, PatchPatientInput) (*Patient, error)
}

type PatientReader ​

PatientReader returns authorized patient data without exposing persistence or internal entities.

go
type PatientReader interface {
    GetPatient(context.Context, GetPatientInput) (*Patient, error)
}

type Snapshot ​

Snapshot is the shared prescription patient snapshot.

go
type Snapshot = types.Snapshot

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.