Skip to main content

clinik.documents

Compositions are structured clinical documents with sections — discharge summaries, referral letters, care plans, etc.

create

const { data, meta } = await clinik.documents.create(request: DocumentCreateRequest): Promise<ApiResponse<Composition>>
FieldTypeRequiredDescription
statusstringYespreliminary, final, amended
typestringYesDocument type (e.g. “discharge-summary”)
categorystring[]NoDocument categories for classification
patientIdstringYesPatient reference
encounterIdstringNoEncounter reference
practitionerIdstringYesAuthor reference
titlestringYesDocument title
datestringNoDocument date
sectionsDocumentSection[]YesDocument sections (recursive)
confidentiality'N' | 'R' | 'V'NoNormal, Restricted, Very Restricted
attesterDocumentAttester[]NoWho attested to accuracy
custodianIdstringNoOrganization maintaining the document
relatesToDocumentRelatesTo[]NoRelationships to other compositions
eventDocumentEvent[]NoClinical services being documented

Section Structure (recursive)

{
  title: string;
  code?: string;
  text: string;
  resourceIds?: string[];
  authorId?: string;       // Per-section author
  mode?: 'working' | 'snapshot' | 'changes';
  sections?: DocumentSection[];  // Nested sub-sections
}

Attester Structure

{
  mode: 'personal' | 'professional' | 'legal' | 'official';
  time?: string;
  partyId?: string;  // Practitioner ID
}

search / read / update / delete

Same pattern as other resources.