Skip to main content

clinik.activityDefinitions

Activity definitions (FHIR ActivityDefinition) describe clinical activities that can be performed — templates for orders, referrals, procedures, and other clinical actions.

create

const { data, meta } = await clinik.activityDefinitions.create(request): Promise<ApiResponse<ActivityDefinition>>
FieldTypeRequiredDescription
statusstringYesdraft, active, retired
namestringNoComputer-friendly name
titlestringNoHuman-friendly title
descriptionstringNoDescription of the activity
purposestringNoWhy this definition exists
usagestringNoClinical usage notes
kindstringNoResource kind (Appointment, MedicationRequest, ServiceRequest, Task)
codestring | CodeableConceptNoActivity code
intentstringNoproposal, plan, directive, order
prioritystringNoroutine, urgent, asap, stat
doNotPerformbooleanNoTrue if should NOT be performed
timingDateTimestringNoWhen the activity should occur
timingPeriod{ start?, end? }NoTime window for the activity
locationIdstringNoLocation ID
participantArray<{ type, role? }>NoParticipants
quantity{ value, unit? }NoQuantity
bodySitestring[]NoBody sites
publisherstringNoPublisher name
datestringNoPublication date
versionstringNoBusiness version
urlstringNoCanonical URL
experimentalbooleanNoFor testing only
topicstring[]NoTopic categories

Example

const { data } = await clinik.activityDefinitions.create({
  status: 'active',
  name: 'blood-glucose-check',
  title: 'Blood Glucose Check',
  kind: 'ServiceRequest',
  code: { system: 'http://loinc.org', code: '2339-0', display: 'Glucose [Mass/volume] in Blood' },
  intent: 'order',
  priority: 'routine',
  description: 'Routine blood glucose monitoring for diabetic patients',
  participant: [{ type: 'practitioner', role: 'Lab Technician' }],
});
Same pattern as other resources. Search supports status, name, title, kind, code filters.
For advanced ActivityDefinition features like dynamicValue, expression, library, or relatedArtifact, use the FHIR Passthrough.