Skip to main content

clinik.media

Media (FHIR Media) captures images, videos, and audio recordings from clinical encounters. Track diagnostic images, wound photos, ultrasound recordings, and other clinical media.

create

const { data, meta } = await clinik.media.create(request): Promise<ApiResponse<Media>>
FieldTypeRequiredDescription
statusstringYespreparation, in-progress, not-done, on-hold, stopped, completed
typestringNoimage, video, audio
modalitystringNoAcquisition equipment type
viewstringNoImaging view
patientIdstringNoPatient ID
encounterIdstringNoEncounter ID
createdDateTimestringNoWhen the media was created
issuedstringNoWhen the media was issued
operatorIdstringNoOperator Practitioner ID
reasonCodestring[]NoReason codes
bodySitestringNoBody site
deviceNamestringNoDevice name
deviceIdstringNoDevice ID
heightnumberNoImage height in pixels
widthnumberNoImage width in pixels
framesnumberNoNumber of frames
durationnumberNoDuration in seconds
contentobjectYesMedia content (see below)
notestringNoAdditional notes
basedOnstring[]NoServiceRequest/CarePlan IDs

Content Object

FieldTypeRequiredDescription
contentTypestringYesMIME type (e.g. image/jpeg, video/mp4)
datastringNoBase64-encoded content
urlstringNoURL to the media
titlestringNoTitle of the media

Example

const { data } = await clinik.media.create({
  status: 'completed',
  type: 'image',
  patientId: 'pt_abc123',
  encounterId: 'enc_visit456',
  operatorId: 'prac_dr789',
  bodySite: 'Left knee',
  height: 1920,
  width: 1080,
  content: {
    contentType: 'image/jpeg',
    url: 'https://storage.example.com/images/knee-xray-001.jpg',
    title: 'Left knee X-ray — AP view',
  },
  note: 'Pre-operative imaging for total knee replacement evaluation',
});
Same pattern as other resources. Update supports status and note. Search supports patientId, status, type, modality, dateFrom, dateTo filters.