Clipboard
Introduction #
The Clipboard model is the record of a Clipboard command. It holds free-text content staged on a patient’s note, such as a pasted transcript or summary. A plugin queries it to read that content along with the patient and note the text belongs to.
Clipboards are included regardless of command state (staged or committed); use committed() to filter to only committed commands. A plugin does not write clipboard content through this model. That content is recorded through the Clipboard command.
Basic usage #
To get a clipboard by identifier, use the get method on the model manager:
from canvas_sdk.v1.data import Clipboard
clipboard = Clipboard.objects.get(id="b80b1cdc-2e6a-4aca-90cc-ebc02e683f35")
The staged content is on the text attribute:
from canvas_sdk.v1.data import Clipboard
clipboard = Clipboard.objects.get(id="b80b1cdc-2e6a-4aca-90cc-ebc02e683f35")
text = clipboard.text
get, filter, and committed are available on the manager.
Accessing clipboards from a patient or note #
The clipboards for a patient or note are reachable through the clipboards reverse accessor, which is named the same on Patient and on Note:
from canvas_sdk.v1.data import Note, Patient
patient = Patient.objects.get(id="1eed3ea2a8d546a1b681a2a45de1d790")
patient_clipboards = patient.clipboards.all()
note = Note.objects.get(id="89992c23-c298-4118-864a-26cb3e1ae822")
note_clipboards = note.clipboards.all()
Committed clipboards #
The committed method returns records whose underlying command has been committed and not entered in error:
from canvas_sdk.v1.data import Clipboard
committed_clipboards = Clipboard.objects.committed()
Filtering #
Clipboards can be filtered by any attribute on the model with the filter method:
from canvas_sdk.v1.data import Clipboard
clipboards = Clipboard.objects.filter(note__id="2c91b0d8-7b9d-4ef1-89e2-1f9a3a8a2b14")
Attributes #
Clipboard #
| Field Name | Type |
|---|---|
| id | UUID |
| dbid | Integer |
| created | DateTime |
| modified | DateTime |
| originator | CanvasUser |
| committer | CanvasUser |
| entered_in_error | CanvasUser |
| patient | Patient |
| note | Note |
| text | String |