The Patients module manages the full lifecycle of patient profiles in ClinicFlow. A single user account can own multiple patient profiles — oneDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/0Crazy-0/ClinicFlow/llms.txt
Use this file to discover all available pages before exploring further.
Self profile for the account holder and any number of family-member profiles (Child, Spouse, Parent, Sibling, Other). All commands run through FluentValidation before reaching the handler, and all queries return PatientDto projections.
Commands
CreatePatientProfile
Type:IRequest<Guid>
Creates a minimal patient profile for the primary account holder. The RelationshipToUser is automatically set to PatientRelationship.Self. Medical profile fields (blood type, emergency contact) are left unset and must be filled in later via UpdatePatientProfile.
Parameters
The user account that owns this profile. Must be a non-empty GUID.
Given name. Must be between
PersonName.MinimumLength and PersonName.MaximumLength characters.Family name. Same length constraints as
FirstName.Must not be in the future (validated against
TimeProvider.GetUtcNow()).Patient.Id as a Guid.
CreateCompletePatientProfile
Type:IRequest<Guid>
Creates a fully populated patient profile for the primary account holder in one operation. Includes all the fields from CreatePatientProfile plus the medical profile and emergency contact, making the patient immediately eligible for booking appointments.
Parameters
The user account that owns this profile. Must be a non-empty GUID.
Given name. Must satisfy
PersonName length constraints.Family name. Must satisfy
PersonName length constraints.Must not be in the future.
The patient’s blood type (e.g.
"O+", "AB-"). Must not be empty.Free-text list of known allergies. May be empty.
Free-text list of chronic conditions. May be empty.
Full name of the emergency contact. Must satisfy
PersonName length constraints.Phone number of the emergency contact. Must be between
PhoneNumber.MinimumLength and PhoneNumber.MaximumLength characters.Patient.Id as a Guid.
AddFamilyMember
Type:IRequest<Guid>
Adds a basic-profile dependent (family member) to an existing user account. The relationship must not be Self — using PatientRelationship.Self is rejected with DomainErrors.Patient.CannotBeSelf.
Parameters
The owning user account. Must be a non-empty GUID.
Given name of the family member. Must satisfy
PersonName length constraints.Family name. Must satisfy
PersonName length constraints.Must not be in the future.
Enum value representing the relationship to the user. Must be a defined enum member and must not be
Self. Valid values: Child (1), Spouse (2), Parent (3), Sibling (4), Other (5).Patient.Id as a Guid.
AddCompleteFamilyMember
Type:IRequest<Guid>
Adds a fully populated dependent profile to a user account in one step, including medical profile and emergency contact details.
Parameters
The owning user account. Must be a non-empty GUID.
Given name. Must satisfy
PersonName length constraints.Family name. Must satisfy
PersonName length constraints.Must not be in the future.
Blood type string (e.g.
"B+"). Must not be empty.Free-text allergies. May be empty.
Free-text chronic conditions. May be empty.
Full name of emergency contact. Must satisfy
PersonName length constraints.Phone of emergency contact. Must satisfy
PhoneNumber length constraints.Relationship to the user. Must be a valid enum member (
Child, Spouse, Parent, Sibling, or Other).Patient.Id as a Guid.
UpdatePatientProfile
Type:IRequest (returns Unit)
Updates the medical profile and emergency contact for an existing patient. This is the primary way to upgrade a basic profile to a complete one after creation.
Parameters
ID of the patient profile to update. Must be a non-empty GUID.
Blood type string. Must not be empty.
Free-text allergies. May be empty.
Free-text chronic conditions. May be empty.
Emergency contact full name. Must satisfy
PersonName length constraints.Emergency contact phone number. Must satisfy
PhoneNumber length constraints.Unit (void).
RemoveFamilyMember
Type:IRequest (returns Unit)
Soft-deletes a family-member patient profile. The UserId must match the Patient.UserId (the initiator must own the profile). Attempting to remove a Self profile via this command is rejected with DomainErrors.Patient.CannotRemovePrimaryUser.
Parameters
ID of the family-member profile to remove.
ID of the initiating user. Must match the profile’s owner — enforced in the domain entity.
Unit (void).
ClosePatientAccount
Type:IRequest (returns Unit)
Soft-deletes all patient profiles belonging to a user account. Only callable on the primary (Self) profile; the domain enforces that the patient has no pending or active future appointments before proceeding.
Parameters
The user account to close. All linked patient profiles are soft-deleted. Throws
DomainValidationException with CannotCloseAccountWithPendingAppointments if active future appointments exist.Unit (void).
Queries
GetPatientById
Type:IRequest<PatientDto>
Fetches a single patient profile by primary key.
Parameters
The primary key of the patient profile to retrieve.
PatientDto or throws EntityNotFoundException.
GetPatientsByUserId
Type:IRequest<IReadOnlyList<PatientDto>>
Returns all patient profiles (self + family members) associated with a user account.
Parameters
The user account to query. Must be a non-empty GUID.
PatientDto records (may be empty if the user has no profiles).
Response Shape
PatientDto
The unique identifier of the patient profile.
The identifier of the user account that owns this patient profile.
The patient’s full name as a single string.
Enum describing this patient’s relationship to the account holder.
Self=0, Child=1, Spouse=2, Parent=3, Sibling=4, Other=5.The patient’s date of birth.
Blood type string (e.g.
"A+"). null for basic (incomplete) profiles.Free-text allergies.
null or empty for basic profiles.Free-text chronic conditions.
null or empty for basic profiles.Emergency contact name.
null for basic profiles.Emergency contact phone.
null for basic profiles.