Legal Directives & State Registry
Relevant source files
The following files were used as context for generating this wiki page:
- artifacts/mobile/content/legal/types.ts
- artifacts/mobile/content/legal/registry.ts
- artifacts/mobile/content/legal/helpers.ts
- artifacts/mobile/content/legal/reviewed/florida.ts
- artifacts/mobile/content/legal/reviewed/california.ts
- artifacts/mobile/content/legal/reviewed/massachusetts.ts
- artifacts/mobile/app/legal/info.tsx
The Legal Directives & State Registry is a comprehensive legal document center within the Hospice Roadmap application. Its primary purpose is to provide patients, caregivers, and healthcare providers with state-specific legal and medical planning documentation required for end-of-life care. The system organizes complex legal requirements into a structured, searchable format that highlights medical orders, advance directives, and decision-maker designations for all 50 U.S. states and Washington D.C.
This module functions as an educational resource rather than legal advice. It employs a "truth-alignment" strategy where content is categorized by review status, ensuring users distinguish between fully verified official state guidance and scaffolded educational placeholders. Key document types covered include POLST/MOLST, DNR orders, Health Care Proxies, and Living Wills.
Sources: Pasted-Build-a-complete-new-feature...txt, artifacts/mobile/content/legal/types.ts:6-12
System Architecture & Data Modeling
The architecture utilizes a normalized registry pattern to manage state-specific data. It is built on a type-safe foundation that defines the relationship between states, document categories, and specific legal requirements such as witnessing and notarization.
Core Data Structures
The system's data model is centered around the StateLegalRegistry interface, which aggregates overview information, specific document entries, and state-wide registry details.
| Interface | Description | Key Fields |
|---|---|---|
StateLegalRegistry | Top-level container for a state's legal data. | stateCode, overview, documents, registryInfo |
LegalDocumentEntry | Detailed metadata for a specific legal form. | id, category, witnessRequirement, officialFormUrl |
LegalReviewMeta | Governance data for content accuracy. | reviewStatus, lastLegalReviewed, sourceType |
LegalRequirement | Boolean and descriptive logic for execution. | required, details |
Sources: artifacts/mobile/content/legal/types.ts:64-128
Document Categorization
Documents are sorted into specific categories and sections to aid user navigation and clinical clarity.
- Medical Orders: Immediately actionable orders like DNR, DNI, and POLST/MOLST.
- Decision Makers: Designations such as Health Care Proxy or Power of Attorney for Health Care.
- Planning Documents: Instructional forms like Living Wills and Advance Directives.
- Court-Based Authority: Information regarding Guardianship and Conservatorship.
Sources: artifacts/mobile/content/legal/types.ts:25-46
Registry Logic & State Overrides
The registry operates on a "scaffold-and-override" logic. Every state is initially populated with placeholder data to prevent UI breaks, which is then replaced by high-fidelity "Reviewed" content as legal verification is completed.
Content Generation Flow
The initialization process uses helper functions to create a consistent baseline for all jurisdictions.
The diagram shows the logic used to merge scaffolded state data with reviewed overrides.
Sources: artifacts/mobile/content/legal/registry.ts:24-42, artifacts/mobile/content/legal/helpers.ts:107-111
Reviewed States vs. Pending Review
The system uses a strict ReviewStatus enum to communicate the reliability of the information to the user.
- Reviewed: Content verified against official sources (e.g., California, Florida, Massachusetts).
- Pending Review: Scaffolded educational content with unknown specific requirements.
- Source Only: Contains official links but lacks full editorial review.
- Needs Update: Previously reviewed content flagged for legal changes.
Sources: artifacts/mobile/content/legal/registry.ts:28-36, artifacts/mobile/content/legal/types.ts:48-52
Document Execution Requirements
Every document entry includes specific logic for execution, ensuring users understand the legal hurdles required to make a document valid within their state.
Witnessing and Notarization
The system tracks whether a signature requires witnesses, a notary, or both. For example:
- Florida Advance Directive: Requires two adult witnesses; at least one must not be a spouse or blood relative.
- California AHCD: Allows for either two qualified witnesses OR a notary acknowledgment.
- Massachusetts Health Care Proxy: Requires two adult witnesses; the agent cannot be a witness.
Sources: artifacts/mobile/content/legal/reviewed/florida.ts:85-95, artifacts/mobile/content/legal/reviewed/california.ts:89-105, artifacts/mobile/content/legal/reviewed/massachusetts.ts:88-93
Clinical Recognition
The registry differentiates between documents based on who honors them and under what conditions.
The diagram illustrates the relationship between legal documents and the clinical entities required to recognize them.
Sources: artifacts/mobile/content/legal/types.ts:98-103, artifacts/mobile/app/legal/info.tsx:28-44
Search & Retrieval Logic
The registry provides utility functions for searching across all states and documents. The search is case-insensitive and covers state names, codes, document titles, common names, and summaries.
Retrieval Functions
| Function | Parameters | Return Type | Purpose |
|---|---|---|---|
getStateRegistry | code: StateCode | StateLegalRegistry | Retrieves the full registry for a specific state. |
getLegalDocument | stateCode, docId | LegalDocumentEntry | Finds a specific document within a state context. |
searchStatesAndDocuments | query: string | StateLegalRegistry[] | Filters states based on matching criteria. |
Sources: artifacts/mobile/content/legal/registry.ts:47-83
State-Specific Implementations
Florida (FL)
- Primary Documents: Designation of Health Care Surrogate, Living Will.
- Critical Rule: The Florida DNRO must be printed on yellow paper to be valid for EMS recognition.
- Terminology: Florida specifically uses "Surrogate" rather than "Proxy."
Sources: artifacts/mobile/content/legal/reviewed/florida.ts:13-35
California (CA)
- Primary Documents: Advance Health Care Directive (AHCD), POLST.
- Critical Rule: Execution requires either a notary OR two qualified witnesses. If the principal is in a skilled nursing facility, an ombudsman must be a witness.
- State Registry: California maintains an optional Advance Directive Registry via the Secretary of State.
Sources: artifacts/mobile/content/legal/reviewed/california.ts:13-33, artifacts/mobile/content/legal/reviewed/california.ts:192-205
Massachusetts (MA)
- Primary Documents: Health Care Proxy, MOLST.
- Critical Rule: The state is currently transitioning from MOLST (Medical Orders for Life-Sustaining Treatment) to POLST.
- Governance: Governed by MGL Chapter 201D.
Sources: artifacts/mobile/content/legal/reviewed/massachusetts.ts:11-30
Conclusion
The Legal Directives & State Registry serves as a centralized, type-safe infrastructure for end-of-life documentation. By combining a standardized data model with state-specific overrides, the system provides accurate, actionable guidance while maintaining clear boundaries regarding the legal review status of its content. This architecture ensures that users have immediate access to official state forms and specialized instructions (such as Florida's yellow paper requirement) while preserving the platform's overall "truth-alignment" standards.
Sources: artifacts/mobile/content/legal/registry.ts:12-20, artifacts/mobile/content/legal/helpers.ts:5-9