domain
import "github.com/prescriptoo/prescriptoo-api/services/patient/internal/domain"Package domain adapts the shared patient domain for legacy Patient workflows.
Index
- func Fingerprint(x *Profile) string
- func MRN(n int64) string
- func NormalizeEmail(s string) (string, string, error)
- func NormalizePhone(s, region string) (string, string, error)
- func Text(s string, maximum int) bool
- func ValidID(s string) bool
- func ValidKey(s string) bool
- func ValidatePatch(in p.PatchPatientParams) error
- type Profile
func Fingerprint
func Fingerprint(x *Profile) stringFingerprint hashes normalized patient registration intent.
func MRN
func MRN(n int64) stringMRN formats a monotonically allocated organization-local number.
func NormalizeEmail
func NormalizeEmail(s string) (string, string, error)NormalizeEmail returns display and canonical comparison values for an email.
func NormalizePhone
func NormalizePhone(s, region string) (string, string, error)NormalizePhone validates a phone number and returns its display and E.164 values.
func Text
func Text(s string, maximum int) boolText validates bounded, nonblank Unicode text without control characters.
func ValidID
func ValidID(s string) boolValidID accepts canonical nonzero UUIDs.
func ValidKey
func ValidKey(s string) boolValidKey validates printable nonblank create retry keys.
func ValidatePatch
func ValidatePatch(in p.PatchPatientParams) errorValidatePatch checks field presence and values for a partial update.
type Profile
Profile is the shared patient record with canonical contact values.
type Profile = types.PatientProfilefunc Apply
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
func New(in p.CreatePatientParams, now time.Time, region string) (*Profile, error)New validates and normalizes registration intent without allocating identifiers.
Generated by gomarkdoc