Skip to content

Model Reference

Agency & Configuration (orchid/models/agency.py)

ModelPurpose
AgencyRoot record. One per database. Name, subdomain, subscription.
AgencyPreferencesFeature flags — which programs (ED, GC, SD) are enabled, operational settings.
AgencyColorsBranding: primary/secondary colors, logo S3 key.
AgencyDQSettingsDisqualification rules: age ranges, BMI thresholds, boolean flags.
MatchingFilterPreferencesWhich matching filters are available and their defaults.
NotificationPreferencesWhich notifications are sent, to whom, and when.
AgencyCustomResponsesCustom text overrides for standard messages.
AgencyCustomCopyCustom copy overrides for UI text.
ProfileFooterSettingsFooter content shown on printed profiles.
AgencyTeamGroups of admin users. Used for confidential case access.
AgencyTeamAdminJoin table: admin ↔ team.
AgencyDocumentDocuments uploaded at the agency level (not case-specific).
AgencyDocumentFolderFolders for organizing agency documents.
AgencyContactTypesCustom contact type labels for this agency.
ProfileAppearanceControls which sections show on each profile type per agency.

Users & Admins (orchid/models/user.py)

ModelPurpose
AdminAgency staff member. Has user_type (admin, company_admin, etc.).
UserClient — IP, ED, GC, or SD. Has user_type (‘IP’, ‘donor’, ‘surrogate’, ‘sperm_donor’).
NonParticipatingUserRead-only access user tied to a case.
ThirdPartyUserExternal user with limited case visibility.
DashboardSettingsWhich widgets appear on an admin’s dashboard.
DashboardWidgetIndividual dashboard widget with type and position.
AdminEmailSyncStatusTracks admin email sync connection state.

Authentication (orchid/models/auth.py)

ModelPurpose
CSRFTokenCSRF protection tokens for form submissions.
ExternalUserExternal API user identity.
GurgleTokenAuthentication token for the Gurgle messaging platform.

Cases (orchid/models/case.py)

ModelPurpose
CaseThe core journey record. Links to all other case-scoped data.
CasePartyJoin table: User ↔ Case with a party_type role.
CaseDocumentA document uploaded to a case (S3-referenced).
CaseEmailA manually-logged email association to a case.
CaseLogAudit trail entry for a case action.
CaseNoteA staff note on a case, optionally pinned.
GCCaseGC-specific supplement for gestational carrier cases.
CaseClosingDetailsFinal outcome and closing information.
FamilyFamily information record for the IP.
JourneyPhotoMilestone photo uploaded by the IP.

Medical Cycles (orchid/models/cycle.py)

ModelPurpose
TransferEmbryo transfer procedure record.
RetrievalEgg retrieval procedure record.
RetrievalBatchA batch within a multi-batch retrieval.
SDRetrievalSperm retrieval record.
SDRetrievalDateDate records for SD retrievals.
SDRetrievalBatchBatch within an SD retrieval.
LabLab test result attached to a cycle event.
PregnancyConfirmed pregnancy record.
DeliveryBirth/delivery record.

Contacts & Leads (orchid/models/contact.py, lead.py)

ModelPurpose
ContactA reviewed applicant before they become a User.
ContactDocumentDocument uploaded for a contact.
ContactEmailManually-logged email for a contact.
ContactLogAudit trail for a contact record.
ContactNoteStaff note on a contact.
ContactLeadInitial inquiry — lightest-weight pre-contact record.
ContactLeadRequestFull data from a lead’s initial inquiry form.

Profiles (orchid/models/profile.py)

ModelPurpose
ProfileBaseBase profile record (is_approved, is_visible).
EDProfileEgg donor profile — personal details, education, ethnicity, medical.
EDEducationEducation history records for an ED.
EDEthnicityEthnicity entries for an ED (can be multi-ethnic).
EDFamilyMemberFamily member health records for an ED.
EDFamilyMemberEthnicityEthnicity for a family member.
EDFamilyMemberBuiltinRelationStandard relationship types.
EDTestResultGenetic / medical test results for an ED.
EDProfileDocumentDocuments attached to an ED profile.
EDProfileImagePhotos for an ED profile.
EDProfileVideoVideos for an ED profile.
SDProfileDocumentDocuments for an SD profile.
SDProfileImagePhotos for an SD profile.
SDProfileVideoVideos for an SD profile.
GCProfileDeliveryPrevious delivery records for a GC.
GCProfileDocumentDocuments for a GC profile.
GCProfileImagePhotos for a GC profile.
GCProfileVideoVideos for a GC profile.
IPProfileDocumentDocuments for an IP profile.
IPProfileImagePhotos for an IP profile.
IPProfileVideoVideos for an IP profile.
DeliveryBabyBaby information record from a GC delivery.
ProfileKeyPer-agency field visibility/required settings.
ProfileQuestionCustom questions for a profile section.
UserCustomProfileA user’s custom profile section instance.
UserCustomProfileAnswerAn answer to a custom profile question.
UserCustomProfileSectionDefinition of a custom profile section.

Matching (orchid/models/matching.py, matchsheet.py)

ModelPurpose
MatchingQueueOrdered list of candidates for an IP’s review.
FavoriteAn IP’s favorited candidate.
MatchBreakDetailsWhy a match proposal was declined.
MatchingPreferencesIP’s matching preferences (stored as JSON).
MatchSheetA completed match sheet document.
MatchSheetTemplateTemplate defining a match sheet structure.
MatchSheetHeaderSection header in a match sheet template.
MatchSheetQuestionA question in a match sheet template.
CaseMatchSheetAnswerAn answer to a match sheet question for a specific case.

Forms (orchid/models/form.py)

ModelPurpose
FormA form definition (questions, type, agency).
FormQuestionA question in a form (type, text, options).
UserFormAn instance of a form assigned to a user/case.
UserFormAnswerA user’s answer to a form question.
MedicalReleaseFormSpecialized model for medical release forms.
IntakeFormSubmissionTracks intake form submission (creates user).
GeneralFormSubmissionPublic/external form submission (no user created).
RecaptchaSubmissionTracks reCAPTCHA results for intake forms.

Workflow & Tasks (orchid/models/workflow.py, tood.py, date_tood.py, milestone.py)

ModelPurpose
TemplateBaseA workflow template (top-level container).
TemplateStageA stage within a workflow template.
TemplateSubStageA sub-stage within a stage.
TemplateTaskA task definition within a sub-stage.
TemplateTaskDocumentA document requirement attached to a task.
CustomSubStageAd-hoc sub-stage added to a template.
CustomTaskAd-hoc task added outside the template structure.
CaseTaskAn instance of a task on a specific case.
ContactTaskA task on a contact record.
ClinicTaskA task related to a clinic.
GeneralTaskA general admin to-do not tied to a case.
DateBasedToDoTemplateTemplate for date-triggered tasks.
DateBasedToDoSnippetTemplateA snippet within a date-based template.
CaseDateBasedToDoSnippetAn instantiated date-triggered task on a case.
MileStoneBaseBase milestone definition.
MileStoneA specific milestone type.
CaseMilestoneA milestone achieved on a specific case.

Email & Messaging (orchid/models/email_sync.py, general.py)

ModelPurpose
EmailSyncEmail sync state for an admin (status, last sync time).
EmailSyncStatusEnum-like: active, paused, error, disconnected.
EmailSyncTypeEnum-like: gmail, microsoft.
EmailSyncErrorTypeTypes of transient sync errors.
EmailSyncDisconnectReasonWhy a sync was permanently disconnected.
EmailMessageA synced email message (body, from, to, linked case/contact).
EmailA sent transactional email record.
EmailTemplateA reusable email template with Jinja2 body.
MassEmailA bulk email send job.
OAuthTokenGmail or Outlook OAuth access/refresh tokens.
OAuthTokenTypeEnum-like: gmail, microsoft.
SMSTemplateA reusable SMS template.

Provider Network (orchid/models/provider.py, clinic.py)

ModelPurpose
ProviderAn external provider organization (clinic, attorney, etc.).
ProviderUserA person at a provider org who has portal access.
CaseProviderAssignment: this Provider works on this Case.
CaseProviderExternalAPI-based provider assignment.
CaseProviderExternalDocumentDocument shared via external API.
CaseProviderExternalMatchsheetMatch sheet shared externally.
CaseProviderExternalMatchsheetListList of shared match sheets.
CaseProviderExternalMatchsheetShareShare record for a match sheet.
CaseProviderExternalFlagsFeature flags for an external provider.
CaseProviderExternalCycleShareCycle data shared with an external provider.
ProviderNoteA note on a provider record.
ProviderContactNoteA note on a provider contact.
ProviderDocumentA document attached to a provider.
ClinicA specific clinic record (IVF clinic details).
ClinicContactA contact person at a clinic.
ClinicDocumentA document at the clinic level.

Contracts (orchid/models/contract.py)

ModelPurpose
ContractContract type definition for an agency.
ContractRelationshipWhich parties sign which contracts.
CaseContractA contract instance on a specific case.
HelloSignTemplateHelloSign template linked by hs_template_id.
HelloSignParentA signature request created in HelloSign.
SignedContractCompleted signed document (S3 reference).

Campaigns (orchid/models/campaign.py)

ModelPurpose
CampaignA recruitment email campaign.
CampaignFlowA step in a drip campaign sequence.
CaseCampaignA case/contact enrolled in a campaign.
CaseCampaignFlowTracking record for each flow step.

Reporting (orchid/models/report.py)

ModelPurpose
CustomReportA saved custom report definition.
FormQuestionReportAggregate report on form question answers.
MatchingDaysReportHow many days cases spend in matching stages.

Activity & Audit (orchid/models/activity.py)

ModelPurpose
ActivityFeedActivity feed items for a case/contact.
ActivityNoteNotes within the activity feed.
ChangeLogLow-level change tracking for model updates.

General / Miscellaneous (orchid/models/general.py)

ModelPurpose
ArchiveReasonReasons for archiving a case or contact.
CalendarEventCalendar events displayed in the admin UI.
DefaultChannelDefault communication channel settings.
EventGeneral event log record.
NotificationSystem notification for an admin or user.
ProgramAgency program definitions.
ServiceLevelService tier definitions.
StatusStatus label definitions (some cases use this).
SubscriptionInfoAgency billing subscription details.

Error Tracking (orchid/models/__init__.py)

ModelPurpose
ErrorsGeneral application error records (content-deduplicated).
ErrAPIAPI-specific error records.
Err400HTTP 400-series error records.
IPAddressIP address tracking for rate limiting.
IPAddressErrError records by IP address.

Model mixins (orchid/models/mixins.py)

These are not standalone models — they are mixed into other models:

MixinAdds
AddressMixinstreet, city, state, zip, country columns
DocumentMixinS3 file reference columns
FlagsMixinBoolean flag columns
TaskMixinTask completion tracking columns
EncryptedSsnMixinEncrypted SSN storage
TimeZoneMixinTimezone-aware datetime handling
UserMixinCommon user fields
CaseMixinCommon case reference fields