Skip to content

Domain Models

All models are derived from the Django apps in novahomecareapi/. Every tenant-scoped model carries a FK to Organization. Soft-deletion (SoftDeletableModel) and timestamping (TimeStampedModel) are applied where noted.


Table of Contents


organizations

Organization

Root tenant model. Every other model scopes to this via FK.

FieldTypeNotes
nameCharFieldDisplay name
health_nameCharFieldName used in Home Health context
tokenUUIDFieldUnique; used in public-facing portal URLs (/login/<token>)
short_nameCharFieldAbbreviated name
emailEmailFieldOrg contact email
phoneCharField
address, city, state, zipcodeCharField
styleJSONFieldCustom CSS/branding overrides served to portals SPA
logo, faviconFileFieldS3-stored branding assets
urlURLFieldOrg website
activeBooleanFieldSoft on/off for the whole tenant

Key methods: get_administrators(), to_dict(), get_service_names()


users

User

Single table for all roles (extends AbstractUser + SoftDeletableModel).

FieldTypeNotes
roleCharFieldMASTER / ADMIN / EMPLOYEE / CLIENT / MARKETER
organizationFK → Organization
emailEmailFieldPrimary login identifier
phone, secondary_phoneCharFieldE.164 format
genderCharFieldChoice field
marital_statusCharFieldChoice field
address, city, state, zipcodeCharField
timezoneCharField
profile_imageFileFieldS3
zip_fileFileFieldBulk export zip
signatureHandled via Signature model (see job_forms)

Custom managers: UserManager, EmployeeManager, ClientManager, AdminManager, MasterManager, MarketerManager — each pre-filters by role.

Key properties: full_name, age, is_health_available

Key methods: get_applications(), get_competency_tests(), get_forms(), get_notes(), get_grievances(), get_work_schedules(), get_service_visits(), get_service_plans()


EmployeePosition

Lookup table for staff roles. Controls which documents and checklists are generated.

FieldTypeNotes
keyCharFieldHCC, CNA, HHA, RN, LPN, ST (SLP), OT, PT, MSW, ADM, MKT
labelCharFieldHuman-readable name
is_healthBooleanFieldTrue for clinical roles (RN, LPN, CNA, HHA, PT, OT, ST, MSW)
is_oasisBooleanFieldTrue for roles that document OASIS assessments
is_home_careBooleanFieldTrue for HC-eligible roles

The is_health / is_oasis / is_home_care flags drive document generation logic — e.g. competency checklists are only generated for positions where the flag is set. See Employee Documents.


JobOffer

An employment offer extended to an applicant.

FieldTypeNotes
userFK → UserThe applicant receiving the offer
positionFK → EmployeePosition
salaryDecimalField
start_dateDateField
payment_ratesJSONFieldRate structure
compensationJSONFieldAdditional compensation details
statusCharFieldNEW / REJECTED / ACCEPTED

EmployeeProfile

Extended profile for EMPLOYEE users (OneToOne with User).

FieldTypeNotes
userOneToOneField → User
managerFK → UserAssigned manager/supervisor
positionFK → EmployeePositionCurrent role
salaryDecimalField
payment_ratesJSONField
external_idCharFieldID in external payroll / HR system
sos_*CharField fieldsEmergency contact name, phone, relationship
health_license_*CharField/DateFieldLicense number, state, expiration
cpr_certification_date, cpr_expiration_dateDateField
formsTracking fields for onboarding form completion

ClientType

Lookup table. Determines which admission document set applies.

KeyMeaning
HCCHome Care Client
HHPHome Health Patient

ClientProfile

Extended profile for CLIENT users (OneToOne with User).

FieldTypeNotes
userOneToOneField → User
client_typesM2M → ClientTypeHC, HH, or both — drives dynamic nav (see Client Profile)
socDateFieldStart of Care
insuranceCharField / JSONFieldInsurance details
primary_conditionCharFieldPrimary diagnosis/condition
sos_*CharField fieldsEmergency contact
designated_representative_*CharField fieldsLegal rep / power of attorney
case_manager_*CharField fieldsReferring physician / case manager contact
allergiesTextFieldMedical history
advance_directivesBooleanField / CharField
dnrBooleanFieldDo Not Resuscitate
triage_codeCharField
manual_upload_documentsBooleanFieldFlag to allow admin manual document uploads

applications

Application

Job application submitted by a prospective employee.

FieldTypeNotes
organizationFK → Organization
userFK → UserApplicant
positionFK → EmployeePositionApplied-for role
statusCharFieldNEWPRE_APPROVEDRBCBCCAPPROVED / REJECTED / BCE
Personal fieldsCharFieldFirst/last name, DOB, SSN, address, phone, email
trainingJSONFieldTraining history
educationJSONFieldEducation history
job_historyJSONFieldPrevious employment
referencesJSONFieldProfessional references
signatureFileFieldSignature image
pdfFileFieldGenerated application PDF
health_license_*CharField/DateFieldLicense number, state, expiration
cpr_certification_date, cpr_expiration_dateDateField
contact_opt_inBooleanFieldSMS/marketing consent

Status flow: NEWPRE_APPROVEDRBC (Reference & Background Check initiated) → BCC (Background Check Complete) → APPROVED or REJECTED; BCE = Background Check Exception.


ApplicationFile

Individual supporting documents attached to an application.

FieldTypeNotes
applicationFK → Application
typeCharFieldSee choices below
fileFileFieldS3
expiration_dateDateFieldNullable
active_dateDateFieldNullable
completed_dateDateFieldNullable

File type choices:

KeyMeaning
IDGovernment-issued ID
SSNSocial Security card
TBTTB Test
OIGOIG exclusion check
NSONon-Sex Offender registry check
INProof of Insurance
DDB
BCCBackground Check (consent)
BCRBackground Check (report)
CPRCPR certification
RU
HSP

assessments

OASISAssessment

Clinical outcome tracking document. Home Health and Both clients only.

FieldTypeNotes
caregiverFK → UserThe HH employee who completed the assessment
categoryCharFieldINITIAL / REVALIDATION
completed_dateDateField
expiration_dateDateField
fileFileFieldS3

Property: is_expired — true if expiration_date < today.


competency_checklists

ChecklistAssessmentForm

Template/definition for a competency assessment checklist (distinct from CompetencyTest which is a quiz).

FieldTypeNotes
keyCharFieldIdentifier (e.g. RN, LPN, CNA_HHA, ANNUAL)
labelCharFieldDisplay name
employee_positionsM2M → EmployeePositionWhich roles this checklist applies to
is_annually_renewBooleanFieldTrue for the Annual Competency Checklist
pdf_previewFileFieldPreview PDF
pdf_templateFileFieldTemplate used to generate filled PDF
creatorFK → UserAdmin who created the form definition

ChecklistAssessment

An instance of a checklist assigned to a specific employee.

FieldTypeNotes
organizationFK → Organization
assessment_formFK → ChecklistAssessmentForm
user_assignedFK → UserThe employee
user_assignerFK → UserThe admin who assigned it
fileFileFieldCompleted/signed PDF
answersJSONFieldEmployee responses
is_importantBooleanFieldFlags high-priority items
is_manually_submittedBooleanFieldTrue if admin uploaded instead of using the portal flow
signing_statusCharFieldUNS (Unsigned) / SHA (Shared) / SIG (Signed)
completion_dateDateField

Method: sign() — transitions signing_status to SIG and sets completion_date.


competency_tests

The competency test app is a scored quiz engine, separate from the checklist app above.

CompetencyTest

Definition of a knowledge test.

FieldTypeNotes
name, descriptionCharField/TextField
minimum_scoreIntegerFieldDefault: 75 (passing threshold)
pdf_template, html_templateFileFieldFor generating the PDF result
validations, answersJSONFieldAnswer key and validation rules
stepsDefined via CompetencyTestStep
onboardingBooleanFieldAssigned during onboarding
renewalBooleanFieldAssigned on annual renewal cycle
renewal_deltaIntegerFieldDays until renewal is due
versionCharFieldUnique; used for versioning test content

CompetencyTestStep

An ordered section/page within a CompetencyTest.

FieldTypeNotes
competency_testFK → CompetencyTest
nameCharField
orderIntegerFieldDetermines display sequence
mdxTextFieldStep content (MDX / Markdown with components)
validations, extended_validationsJSONFieldPer-step validation rules

CompetencyTestSubmission

A completed attempt at a CompetencyTest.

FieldTypeNotes
answersJSONFieldEmployee's submitted answers
scoreIntegerFieldCalculated score
approvedBooleanFieldTrue if score ≥ minimum_score
pdfFileFieldGenerated result PDF
expiration_dateDateFieldWhen re-testing is required
completed_dateDateField
manually_loadedBooleanFieldAdmin bypass / manual upload

CompetencyTestRequest

Join record linking a test to an employee for a given org. One request per employee-test assignment.

FieldTypeNotes
competency_testFK → CompetencyTest
employeeFK → User
organizationFK → Organization
submissionOneToOneField → CompetencyTestSubmissionNullable until submitted

Method: submit(answers) — creates a CompetencyTestSubmission, scores it, auto-approves if score ≥ minimum.


compliance_documents

Introduced in v5.1.0. Dual-signature flow: client signs first, then Case Manager. See Compliance Documents.

CaseManager

External physician/provider who co-signs compliance documents. Has no portal account.

FieldTypeNotes
full_nameCharField
emailEmailFieldOTP is sent here
organizationFK → Organization
creatorFK → UserAdmin who registered this Case Manager

Unique constraints: (full_name, email, organization) and (email, organization).


ComplianceDocumentForm

Template/definition for a compliance document type.

FieldTypeNotes
keyCharFieldIdentifier
labelCharFieldDisplay name
pdf_previewFileField
pdf_templateFileField
creatorFK → User
organizationsM2M → OrganizationWhich orgs have access to this form type

ComplianceDocument

An instance of a compliance document assigned to a client. Tracks both user and Case Manager signing independently.

FieldTypeNotes
organizationFK → Organization
compliance_formFK → ComplianceDocumentForm
user_assignedFK → UserThe client
user_assignerFK → UserThe admin who assigned it
case_managerFK → CaseManagerThe co-signer
case_manager_signatureFileFieldCase Manager's signature image
case_manager_commentTextFieldOptional comment from Case Manager
fileFileFieldFinal signed PDF
answersJSONFieldClient's form responses
is_importantBooleanField
is_manually_submittedBooleanField
user_signing_statusCharFieldPEN (Pending) / SIG (Signed)
manager_signing_statusCharFieldPEN (Pending) / SIG (Signed)
user_completion_dateDateFieldWhen client signed
manager_completion_dateDateFieldWhen Case Manager signed
completed_dateDateFieldSet when both have signed
last_reminder_sentDateTimeFieldTracks reminder email cadence

grievances

Grievance

A formal grievance raised by an employee. Extends SoftDeletableModel and ExportableModel.

FieldTypeNotes
organizationFK → Organization
employeeFK → User
subjectCharField
bodyTextField
is_readBooleanFieldAdmin read receipt
file_to_exportFileFieldGenerated PDF export

Method: export() — renders the grievance to PDF and stores in file_to_export.


job_forms

The core document engine. Form defines a document template; FormRequest is the per-user assignment; FormSubmission is the completed record.

Form

FieldTypeNotes
name, descriptionCharField/TextField
typeCharFieldFILLABLE (portal renders fields) / UPLOADABLE (user uploads a file)
submitterCharFieldADMIN / EMPLOYEE / CLIENT / MASTER — who completes this form
categoryCharFieldSee choices below
pdf_template, html_templateFileFieldUsed by WeasyPrint to generate PDF
mdxTextFieldRich content for portal rendering
json_schemaJSONFieldField definitions for fillable forms
onboardingBooleanFieldAssigned automatically at onboarding
renewalBooleanFieldAssigned on renewal cycle
renewal_deltaIntegerFieldDays until renewal due
only_manuallyBooleanFieldAdmin-only assignment; never auto-assigned
activeBooleanField
can_resendBooleanFieldAdmin can re-send for re-signature
dates_requiredBooleanFieldWhether active/expiration dates must be set
employee_positionsM2M → EmployeePositionRestricts form to specific roles
client_typesM2M → ClientTypeRestricts form to HCC or HHP clients

Category choices:

KeyMeaning
OBOnboarding
EVE-Verify
GEGeneral
OFOffer / Job Acceptance
TSTesting
MDMedical
VIVehicle Insurance
DTDrug Test
TMTermination
PCProvisional Contract
SPService Plan

FormSubmission

The completed data for a form assignment.

FieldTypeNotes
answersJSONFieldSubmitted field values
pdf_uploadedBooleanFieldTrue if user uploaded a file rather than filling fields
pdfFileFieldGenerated or uploaded PDF (S3)
signatureImageFieldCaptured signature image
expiration_date, active_date, completed_dateDateField
manually_loadedBooleanFieldAdmin bypass

FormRequest

Per-user assignment of a Form. One record per user-form pair.

FieldTypeNotes
formFK → Form
userFK → User
submissionOneToOneField → FormSubmissionNullable until submitted
extra_dataJSONFieldAdditional context passed at assignment time
is_importantBooleanField
end_dateDateFieldDeadline

Methods: submit(data) — creates a FormSubmission, triggers PDF generation. load_submission(file) — manual upload path.


SignatureFontType

A font available for typed signatures.

FieldTypeNotes
nameCharField
google_font_urlURLField
woff_rendererFileFieldWoff font file for PDF rendering
family_nameCharFieldCSS font-family name

Signature

A saved signature belonging to a user. Can be handwritten (canvas) or typed (font-rendered).

FieldTypeNotes
userFK → User
font_typeFK → SignatureFontTypeNullable; used for FONT type signatures
typeCharFieldHANDWRITTEN / FONT
textCharFieldThe typed text (for FONT type)
hand_writeImageFieldCanvas-drawn signature image
typed_renderImageFieldFont-rendered signature image
is_defaultBooleanFieldUser's selected default signature

messages

Message

Direct message between two portal users within an org.

FieldTypeNotes
creatorFK → UserSender
recipientFK → UserReceiver
organizationFK → Organization
bodyTextField

MessageAttachment

File attached to a Message.

FieldTypeNotes
messageFK → Message
filenameCharField
attachmentFileFieldS3

notes

Note

Covers multiple structured record types that share the same data shape. Extends SoftDeletableModel and ExportableModel.

FieldTypeNotes
organizationFK → Organization
creatorFK → UserAdmin who created the record
userFK → UserEmployee or client the note is about
typeCharFieldSee choices below
subjectCharField
bodyTextField
file_to_exportFileFieldGenerated PDF
completed_dateDateField

Type choices:

KeyMeaning
NOTEGeneral note
DISCIPLINARY_ACTIONDisciplinary record
PERFORMANCE_EVALUATIONPerformance review
PERFORMANCE_EVALUATION_9090-day performance review
SUPERVISORY_REPORTSSupervisory visit report
SATISFACTORY_SURVEYSSatisfaction survey
CASE_COMUNICATIONCase communication (note: typo in codebase)
INCIDENT_REPORTIncident report

NotesFile

Supporting file attached to a Note (e.g. signed PDF page).

FieldTypeNotes
noteFK → Note
answersJSONField
fileFileFieldS3

notifications

NotificationMessage

Template/definition for a notification type. Configured once, reused across all deliveries.

FieldTypeNotes
typeCharFieldOne of ~30 choices — see below
channelCharFieldEMAIL / PORTAL / ALL
receiverCharFieldADMIN / EMPLOYEE / CLIENT / MARKETER
email_subject, portal_subjectCharFieldMay contain {Organization Name} etc. placeholders
email_body, html_email_bodyTextFieldPlain + HTML email templates
portal_bodyTextFieldIn-portal notification text

Notable type values (partial list):

TypeWhen
NEW_ACCOUNTUser account created
NEW_APPLICATIONNew job application submitted
APPLICATION_APPROVEDApplication approved
ONBOARDING_COMPLETEDEmployee onboarding complete
ANNUAL_CTAnnual competency test due
ANNUAL_TBAnnual TB test due
MESSAGENew direct message
GRIEVANCENew grievance submitted
WORK_SCHEDULEWork schedule updated
SERVICE_PLANService plan generated/shared
SERVICE_PLAN_REMINDERService plan reminder
SATISFACTION_SURVEYSatisfaction survey available
SUPERVISORY_REPORTSupervisory report due
MISSING_DOCUMENTATIONIncomplete document reminder
COMPETENCY_TEST_DUECompetency test coming due
NEW_JOB_ACCEPTANCENew job offer to accept
REFERRAL_COMPLETEDReferral converted to client
REFERRAL_STEP_EXPIREDReferral step overdue
CLIENT_ONBOARDING_COMPLETEDClient onboarding complete
BC_COMPLETEDBackground check completed

Notification

An individual notification delivered to a specific user.

FieldTypeNotes
userFK → UserRecipient
messageFK → NotificationMessageTemplate used
organizationFK → Organization
is_readBooleanFieldIn-portal read status
is_notifiedBooleanFieldWhether email has been dispatched
contextJSONFieldDynamic values used to render the template (e.g. org name, link)

Methods: send() and role-specific send variants that resolve the template + context into an actual email/portal notification.


referrals

Tracks a prospective client from initial intake through conversion to a ClientProfile.

Referral

FieldTypeNotes
userOneToOneField → UserCreated when referral converts to a client; nullable until then
creatorFK → UserMarketer who submitted the referral
organizationFK → Organization
statusCharFieldIP (In Progress) / CL (Closed) / DC (Discarded) / PD (Pending)
ssnCharFieldEncrypted
Personal fieldsCharFieldFirst/last name, birth_date, phone, email
Address fieldsCharFieldaddress, city, state, zipcode
gender, marital_statusCharField
socDateFieldAnticipated Start of Care
insuranceJSONFieldInsurance details
primary_conditionCharField
Referrer fieldsCharFieldReferring physician/provider contact info
Case manager fieldsCharFieldCase manager contact info
estimate_atDateFieldExpected admission date

Methods: discard() — marks referral as DC. to_client() — creates a User + ClientProfile from the referral data, sets status to CL.


Step

Definition of a referral pipeline stage (ordered).

FieldTypeNotes
nameCharField
orderIntegerFieldUnique; determines pipeline sequence
time_dueIntegerFieldDays allowed for this step

ReferralStep

An instance of a Step for a specific Referral.

FieldTypeNotes
stepFK → Step
referralFK → Referral
statusCharFieldIP (In Progress) / NA (Not Applicable) / DN (Done)
expiration_dateDateFieldCalculated from Step.time_due
completed_atDateTimeField

Method: done() — marks step complete, triggers next-step logic.


StepNote

A note or attachment on a specific ReferralStep.

FieldTypeNotes
referral_stepFK → ReferralStep
creatorFK → User
noteTextField
fileFileFieldOptional attachment

MarketerMetric / GeneralMetric

Aggregated performance metrics. Updated via update_metrics().

FieldNotes
active_referralsCurrent open referrals
clientsTotal converted clients
days_by_referralAverage days from referral to admission

MarketerMetric is OneToOne with a Marketer user. GeneralMetric is FK to Organization.


services

Models for Service Plans and Service Visits — the care delivery records. Covers both Home Care and Home Health.

WorkService

The central record for both service plans (type=PLAN) and service visits (type=VISIT).

FieldTypeNotes
organizationFK → Organization
creatorFK → UserAdmin who created the record
typeCharFieldPLAN / VISIT
care_typeCharFieldHOME (Home Care) / HEALTH (Home Health)
kindCharFieldName/description of the plan or visit
related_serviceFK → WorkServiceSelf-referential; links a VISIT back to its parent PLAN
signing_statusCharFieldUNS (Unsigned) / SHA (Shared) / SIG (Signed)
consentsJSONFieldList of consent types collected — see ClientConsents choices
fileFileFieldSigned PDF
is_importantBooleanField
is_manually_createdBooleanFieldAdmin bypass
has_verbal_consentBooleanFieldConsent obtained verbally
start_date, end_dateDateField
client_completion_dateDateFieldWhen client signed
manager_completion_dateDateFieldWhen Case Manager / admin signed

ClientConsents choices: RR, COE, CB, CCI, CI, CC


ServiceAuthorization

Authorization details attached to a WorkService plan.

FieldTypeNotes
work_serviceOneToOneField → WorkService
from_date, to_dateDateFieldAuthorization period
total_hoursDecimalFieldAuthorized hours

WorkServiceWeek / WorkServiceShift / ADLService

Structured schedule nested inside a service plan.

  • WorkServiceWeek: One record per week of the plan (index, total_hours).
  • WorkServiceShift: A named shift within a week (index, title, week_schedule JSON).
  • ADLService: Links an ADLSelected task to a shift, with program_week JSON and note.

ADL (Activities of Daily Living)

Lookup hierarchy for ADL tasks that can be scheduled in a service plan.

ModelFields
ADLCategoryname — top-level category (e.g. "Bathing")
ADLCategorySelectedname, adl_category FK — selected category on a plan
ADLname, adl_category FK — individual task
ADLSelectedname, adl FK, adl_category FK — selected task on a plan

WorkServiceAssignment

Assigns a staff member to a WorkService (visit or plan).

FieldTypeNotes
work_serviceFK → WorkService
ownerFK → UserAssigned employee
is_acceptedBooleanFieldWhether the employee accepted the assignment

Unique constraint: (work_service, owner) — one assignment per employee per service record.


support

Public-facing intake forms. No auth required.

ContactForm

General contact submission from the public website.

FieldNotes
first_name, last_name
email, phone, state
comments
sms_opt_inBooleanField

EligibilityForm

Initial eligibility check for prospective clients.

FieldNotes
first_name, last_name, email, phone
is_patientYES / NO / NOT_SURE
has_medical_coverageCoverage type choices
contact_via_phoneBooleanField

ReferralForm

Detailed intake referral from an external referrer (physician, hospital).

FieldNotes
first_name, last_name, dob, ssnPatient identity
phone, email, address fields
primary_disability_type
has_client_been_hospitalized
has_client_medicaid, is_client_65_yearsEligibility flags
is_client_income_under, is_client_assets_underMedicaid financial criteria
is_interpreter_needed, interpreter_languageLEP / language access
ppc_* fieldsPrimary Point of Contact (name, relationship, phone, email)
client_needs, client_needs_otherCare needs description

work_schedules

WorkSchedule

A scheduled work block for an employee. Extends SoftDeletableModel and ExportableModel.

FieldTypeNotes
organizationFK → Organization
creatorFK → UserAdmin who created it
employeeFK → UserAssigned employee
client_idThe associated client
subjectCharField
bodyTextFieldSchedule details
file_to_exportFileFieldGenerated PDF

Method: export() — renders schedule to PDF.

Nova Home Care — Internal Developer Docs