Skip to content

domain ​

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

Package domain adapts the shared patient domain for legacy Patient workflows.

Index ​

func Fingerprint ​

go
func Fingerprint(x *Profile) string

Fingerprint hashes normalized patient registration intent.

func MRN ​

go
func MRN(n int64) string

MRN formats a monotonically allocated organization-local number.

func NormalizeEmail ​

go
func NormalizeEmail(s string) (string, string, error)

NormalizeEmail returns display and canonical comparison values for an email.

func NormalizePhone ​

go
func NormalizePhone(s, region string) (string, string, error)

NormalizePhone validates a phone number and returns its display and E.164 values.

func Text ​

go
func Text(s string, maximum int) bool

Text validates bounded, nonblank Unicode text without control characters.

func ValidID ​

go
func ValidID(s string) bool

ValidID accepts canonical nonzero UUIDs.

func ValidKey ​

go
func ValidKey(s string) bool

ValidKey validates printable nonblank create retry keys.

func ValidatePatch ​

go
func ValidatePatch(in p.PatchPatientParams) error

ValidatePatch checks field presence and values for a partial update.

type Profile ​

Profile is the shared patient record with canonical contact values.

go
type Profile = types.PatientProfile

func Apply ​

go
func Apply(before *Profile, in p.PatchPatientParams, now time.Time, region string) (*Profile, bool, error)

Apply validates and applies supplied fields to a copy of the profile.

func New ​

go
func New(in p.CreatePatientParams, now time.Time, region string) (*Profile, error)

New validates and normalizes registration intent without allocating identifiers.

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.