Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions _data/menus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,9 @@ effects_module:
- title: "Custom HTML and Django Templates"
url: /sdk/layout-effect/#custom-html-and-django-templates
description: Render custom HTML using Django templates.
- title: "Data Integration"
url: /sdk/effect-data-integration/
description: Manage documents in the Data Integration queue.
- title: "Create Calendar"
url: /sdk/calendar-create-effect/
description: Create a calendar for a provider.
Expand Down
1 change: 1 addition & 0 deletions collections/_sdk/effects.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ The following effects are available to be applied in Canvas.
| RESCHEDULE_APPOINTMENT | Can be used to reschedule an appointment. Check out [Appointment Effects](/sdk/effect-notes/#reschedule-appointment). |
| RESCHEDULE_SCHEDULE_EVENT | Can be used to reschedule a schedule event. Check out [Schedule Event Effects](/sdk/effect-notes/#reschedule-schedule-event). |
| APPOINTMENT__SLOTS__POST_SEARCH_RESULTS | Can be used to modify slot availability when scheduling an appointment |
| REMOVE_DOCUMENT_FROM_PATIENT | Can be used to remove/unlink a document from a patient in the Data Integration queue. |

<br/>
<br/>
Expand Down
54 changes: 54 additions & 0 deletions collections/_sdk/effects/data_integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: "Data Integration"
slug: "effect-data-integration"
excerpt: "Manage documents in the Data Integration queue."
hidden: false
---

The Canvas SDK allows you to manage documents in the Data Integration queue.

## Removing a Document from a Patient

To remove or unlink a document from a patient in the Data Integration queue, import the `RemoveDocumentFromPatient` class and create an instance of it.

| Attribute | | Type | Description |
|-------------|----------|---------------|-------------------------------------------------------------------------------------------------------------------|
| document_id | required | string | The ID of the IntegrationTask document to unlink from the patient. |
| patient_id | optional | string | The patient ID to specify which patient link to remove. If not provided, removes the current patient association. |

An example of removing a document from a patient:

```python
from canvas_sdk.effects import Effect
from canvas_sdk.effects.data_integration import RemoveDocumentFromPatient
from canvas_sdk.events import EventType
from canvas_sdk.handlers import BaseHandler


class RemoveDocumentHandler(BaseHandler):
RESPONDS_TO = EventType.Name(EventType.DOCUMENT_LINKED_TO_PATIENT)

def compute(self) -> list[Effect]:
document_id = self.event.target.id

remove_document = RemoveDocumentFromPatient(
document_id=document_id,
)

return [remove_document.apply()]
```

If a document could be linked to multiple patients, you can specify which patient to unlink:

```python
from canvas_sdk.effects.data_integration import RemoveDocumentFromPatient

remove_document = RemoveDocumentFromPatient(
document_id="d2194110-5c9a-4842-8733-ef09ea5ead11",
patient_id="patient-uuid-here",
)
```

<br/>
<br/>
<br/>
Loading