Care
Contacts, care plans, observations, medications, consents, funding, shifts and the quality blocks around a client record.
Installs the blocks behind a care provider as one: the client record and its team, clinical blocks, scheduling, staffing, training and controlled documents. It sets the care defaults.
better-supabase add careexport default defineConfig({ blocks: { care: {} } });add lists care in blocks, writes the modules of every part and wires the client in lib/blocks.ts. Import the manifest from better-supabase/blocks/care when you build the set with createBlocks.
import { careBlock } from "better-supabase/blocks/care";Parts
Installing care installs these blocks. Each stays an ordinary block in the config and keeps its own client.
contactsguestsfield-encryptiondata-lifecycleconsentsactivitiescare-plansobservationsmedicationsformsbookingscalendarreminderstime-trackingfundingshiftsqualificationscoursescasesacknowledgementsdriveattachmentsversionsapprovalsstate-machinenumberingsignatures
Defaults
It sets person records to audit reads with a record team, vital signs as the observation defaults, an incident case kind for missed doses, and the case kinds incident, employee incident and complaint. It also controls protocol, policy, procedure, work instruction and form document types in the drive.
The app's own blocks.<part> settings win key by key (Composite blocks).
Helpers
prescribeWithConsent: Check that the subject has an active consent for the purpose, then prescribe. Without the consent nothing is prescribed.
await blocks.care.prescribeWithConsent({
organizationId,
subject,
purposeKey: "medication",
medicationId,
order,
});The helper returns a Result; each step is idempotent, so retrying after a partial failure is safe.
The client dossier
care.dossier({ organizationId, subject }) reads one client's care plans, latest observations, active medication orders, consents and funding awards with their usage together. The first read that fails returns its error and nothing else.
Remove
better-supabase remove care
better-supabase remove care --with-partsThe first command replaces care in blocks with its parts. The second removes the parts too, except any part another block still needs (remove).
Last updated on