# Activity types
URL: https://docs.awellhealth.com/api-reference/reference/activity-types

> For the complete documentation index, see [llms.txt](https://docs.awellhealth.com/llms.txt).



Work with the specific activity types — forms, checklists, messages, clinical notes, calculations, and EMR reports.

## Queries [#queries]

### `calculationAction` [#calculationaction]

Returns the calculation activity for the given ID.

**Arguments**

| Argument | Type      | Required | Description                        |
| -------- | --------- | -------- | ---------------------------------- |
| `id`     | `String!` | Yes      | The ID of the calculation activity |

**Returns:** `ActionPayload!`

**Example**

```graphql
query CalculationAction($id: String!) {
  calculationAction(id: $id) {
    calculationId
    code
    success
  }
}
```

Variables:

```json
{
  "id": "<string>"
}
```

### `calculationResults` [#calculationresults]

Returns the results of a calculation activity.

**Arguments**

| Argument      | Type      | Required | Description             |
| ------------- | --------- | -------- | ----------------------- |
| `activity_id` | `String!` | Yes      | The ID of the activity  |
| `pathway_id`  | `String!` | Yes      | The ID of the care flow |

**Returns:** `CalculationResultsPayload!`

**Example**

```graphql
query CalculationResults($activity_id: String!, $pathway_id: String!) {
  calculationResults(activity_id: $activity_id, pathway_id: $pathway_id) {
    code
    result {
      label
      status
      subresult_id
      unit
      value
      value_type
    }
    success
  }
}
```

Variables:

```json
{
  "activity_id": "<string>",
  "pathway_id": "<string>"
}
```

### `checklist` [#checklist]

Returns a checklist activity by its ID.

**Arguments**

| Argument | Type      | Required | Description                      |
| -------- | --------- | -------- | -------------------------------- |
| `id`     | `String!` | Yes      | The ID of the checklist activity |

**Returns:** `ChecklistPayload!`

**Example**

```graphql
query Checklist($id: String!) {
  checklist(id: $id) {
    checklist {
      items
      title
    }
    code
    success
  }
}
```

Variables:

```json
{
  "id": "<string>"
}
```

### `clinicalNote` [#clinicalnote]

Returns a clinical note activity by its ID.

**Arguments**

| Argument | Type      | Required | Description                          |
| -------- | --------- | -------- | ------------------------------------ |
| `id`     | `String!` | Yes      | The ID of the clinical note activity |

**Returns:** `ClinicalNotePayload!`

**Example**

```graphql
query ClinicalNote($id: String!) {
  clinicalNote(id: $id) {
    clinical_note {
      context {
        key
        value
      }
      id
      narratives {
        body
        id
        key
        title
      }
    }
    code
    success
  }
}
```

Variables:

```json
{
  "id": "<string>"
}
```

### `emrReport` [#emrreport]

Returns an EMR report activity by its ID.

**Arguments**

| Argument | Type      | Required | Description                       |
| -------- | --------- | -------- | --------------------------------- |
| `id`     | `String!` | Yes      | The ID of the EMR report activity |

**Returns:** `EmrReportPayload!`

**Example**

```graphql
query EmrReport($id: String!) {
  emrReport(id: $id) {
    code
    report {
      id
      message_html
      metadata {
        id
        label
        name
        value
      }
    }
    success
  }
}
```

Variables:

```json
{
  "id": "<string>"
}
```

### `form` [#form]

Returns a form activity by its ID.

**Arguments**

| Argument     | Type      | Required | Description                 |
| ------------ | --------- | -------- | --------------------------- |
| `id`         | `String!` | Yes      | The ID of the form activity |
| `pathway_id` | `String`  | No       | The ID of the care flow     |

**Returns:** `FormPayload!`

**Example**

```graphql
query Form($id: String!, $pathway_id: String) {
  form(id: $id, pathway_id: $pathway_id) {
    code
    form {
      definition_id
      id
      key
      metadata
      previous_answers {
        activity_id
        date
      }
      questions {
        dataPointValueType
        definition_id
        id
        key
        metadata
        page
        questionType
        title
        title_html
        userQuestionType
      }
      release_id
      title
      trademark
    }
    success
  }
}
```

Variables:

```json
{
  "id": "<string>",
  "pathway_id": "<string>"
}
```

### `formActivityDataPoints` [#formactivitydatapoints]

Returns the data points captured by a form activity.

**Arguments**

| Argument      | Type      | Required | Description             |
| ------------- | --------- | -------- | ----------------------- |
| `activity_id` | `String!` | Yes      | The ID of the activity  |
| `careflow_id` | `String!` | Yes      | The ID of the care flow |

**Returns:** `FormActivityDataPointsPayload!`

**Example**

```graphql
query FormActivityDataPoints($activity_id: String!, $careflow_id: String!) {
  formActivityDataPoints(activity_id: $activity_id, careflow_id: $careflow_id) {
    code
    data_points {
      key
      value
      valueType
    }
    success
  }
}
```

Variables:

```json
{
  "activity_id": "<string>",
  "careflow_id": "<string>"
}
```

### `formResponse` [#formresponse]

Returns the response submitted for a form activity.

**Arguments**

| Argument      | Type      | Required | Description             |
| ------------- | --------- | -------- | ----------------------- |
| `activity_id` | `String!` | Yes      | The ID of the activity  |
| `pathway_id`  | `String!` | Yes      | The ID of the care flow |

**Returns:** `FormResponsePayload!`

**Example**

```graphql
query FormResponse($activity_id: String!, $pathway_id: String!) {
  formResponse(activity_id: $activity_id, pathway_id: $pathway_id) {
    code
    response {
      answers {
        label
        question_id
        value
        value_type
      }
    }
    success
  }
}
```

Variables:

```json
{
  "activity_id": "<string>",
  "pathway_id": "<string>"
}
```

### `forms` [#forms]

Returns the forms defined in a care flow definition.

**Arguments**

| Argument                | Type      | Required | Description                                                    |
| ----------------------- | --------- | -------- | -------------------------------------------------------------- |
| `pathway_definition_id` | `String!` | Yes      | The ID of the care flow definition                             |
| `release_id`            | `String`  | No       | The ID of the published care flow definition version (release) |

**Returns:** `FormsPayload!`

**Example**

```graphql
query Forms($pathway_definition_id: String!, $release_id: String) {
  forms(pathway_definition_id: $pathway_definition_id, release_id: $release_id) {
    code
    forms {
      definition_id
      id
      key
      metadata
      previous_answers {
        activity_id
        date
      }
      questions {
        dataPointValueType
        definition_id
        id
        key
        metadata
        page
        questionType
        title
        title_html
        userQuestionType
      }
      release_id
      title
      trademark
    }
    success
  }
}
```

Variables:

```json
{
  "pathway_definition_id": "<string>",
  "release_id": "<string>"
}
```

### `message` [#message]

Returns a message activity by its ID.

**Arguments**

| Argument | Type      | Required | Description                    |
| -------- | --------- | -------- | ------------------------------ |
| `id`     | `String!` | Yes      | The ID of the message activity |

**Returns:** `MessagePayload!`

**Example**

```graphql
query Message($id: String!) {
  message(id: $id) {
    code
    message {
      attachments {
        id
        name
        type
        url
      }
      body
      format
      id
      subject
    }
    success
  }
}
```

Variables:

```json
{
  "id": "<string>"
}
```

## Mutations [#mutations]

### `evaluateFormRules` [#evaluateformrules]

Evaluates a form's rules against a set of answers.

**Arguments**

| Argument | Type                      | Required | Description                                            |
| -------- | ------------------------- | -------- | ------------------------------------------------------ |
| `input`  | `EvaluateFormRulesInput!` | Yes      | The form and the answers to evaluate its rules against |

**Returns:** `EvaluateFormRulesPayload!`

**Example**

```graphql
mutation EvaluateFormRules($input: EvaluateFormRulesInput!) {
  evaluateFormRules(input: $input) {
    code
    results {
      question_id
      rule_id
      satisfied
    }
    success
  }
}
```

Variables:

```json
{
  "input": {
    "answers": [
      {
        "question_id": "<string>",
        "value": "<string>"
      }
    ],
    "form_id": "<string>"
  }
}
```

### `markMessageAsRead` [#markmessageasread]

Marks a message activity as read.

**Arguments**

| Argument | Type                      | Required | Description                                         |
| -------- | ------------------------- | -------- | --------------------------------------------------- |
| `input`  | `MarkMessageAsReadInput!` | Yes      | The details of the message activity to mark as read |

**Returns:** `MarkMessageAsReadPayload!`

**Example**

```graphql
mutation MarkMessageAsRead($input: MarkMessageAsReadInput!) {
  markMessageAsRead(input: $input) {
    activity {
      action
      action_component {
        definition_id
        release_id
        title
      }
      container_name
      context {
        action_id
        agent_config_id
        agent_id
        agent_thread_id
        instance_id
        pathway_id
        run_id
        step_id
        track_id
      }
      date
      expires_at
      form {
        definition_id
        id
        key
        metadata
        release_id
        title
        trademark
      }
      form_display_mode
      icon_url
      id
      isUserActivity
      metadata
      public
      reference_id
      reference_type
      resolution
      session_id
      status
      stream_id
    }
    code
    success
  }
}
```

Variables:

```json
{
  "input": {
    "activity_id": "<string>"
  }
}
```

### `submitChecklist` [#submitchecklist]

Submits a checklist activity.

**Arguments**

| Argument | Type                    | Required | Description                                     |
| -------- | ----------------------- | -------- | ----------------------------------------------- |
| `input`  | `SubmitChecklistInput!` | Yes      | The details of the checklist activity to submit |

**Returns:** `SubmitChecklistPayload!`

**Example**

```graphql
mutation SubmitChecklist($input: SubmitChecklistInput!) {
  submitChecklist(input: $input) {
    activity {
      action
      action_component {
        definition_id
        release_id
        title
      }
      container_name
      context {
        action_id
        agent_config_id
        agent_id
        agent_thread_id
        instance_id
        pathway_id
        run_id
        step_id
        track_id
      }
      date
      expires_at
      form {
        definition_id
        id
        key
        metadata
        release_id
        title
        trademark
      }
      form_display_mode
      icon_url
      id
      isUserActivity
      metadata
      public
      reference_id
      reference_type
      resolution
      session_id
      status
      stream_id
    }
    code
    success
  }
}
```

Variables:

```json
{
  "input": {
    "activity_id": "<string>"
  }
}
```

### `submitFormResponse` [#submitformresponse]

Submits a response to a form activity.

**Arguments**

| Argument | Type                       | Required | Description                                  |
| -------- | -------------------------- | -------- | -------------------------------------------- |
| `input`  | `SubmitFormResponseInput!` | Yes      | The form activity and the response to submit |

**Returns:** `SubmitFormResponsePayload!`

**Example**

```graphql
mutation SubmitFormResponse($input: SubmitFormResponseInput!) {
  submitFormResponse(input: $input) {
    activity {
      action
      action_component {
        definition_id
        release_id
        title
      }
      container_name
      context {
        action_id
        agent_config_id
        agent_id
        agent_thread_id
        instance_id
        pathway_id
        run_id
        step_id
        track_id
      }
      date
      expires_at
      form {
        definition_id
        id
        key
        metadata
        release_id
        title
        trademark
      }
      form_display_mode
      icon_url
      id
      isUserActivity
      metadata
      public
      reference_id
      reference_type
      resolution
      session_id
      status
      stream_id
    }
    code
    success
  }
}
```

Variables:

```json
{
  "input": {
    "activity_id": "<string>",
    "response": [
      {
        "question_id": "<string>",
        "value": "<string>"
      }
    ]
  }
}
```

### `updateEmrReportStatus` [#updateemrreportstatus]

Updates the status of an EMR report.

**Arguments**

| Argument | Type                          | Required | Description                                  |
| -------- | ----------------------------- | -------- | -------------------------------------------- |
| `input`  | `UpdateEmrReportStatusInput!` | Yes      | The EMR report request and the status to set |

**Returns:** `UpdateEmrReportStatusPayload!`

**Example**

```graphql
mutation UpdateEmrReportStatus($input: UpdateEmrReportStatusInput!) {
  updateEmrReportStatus(input: $input) {
    code
    request {
      id
      status
    }
    success
  }
}
```

Variables:

```json
{
  "input": {
    "reason": "<string>",
    "request_id": "<string>",
    "status": "<string>"
  }
}
```
