For AI agents: the documentation index is at /docs/aidbox/llms.txt. A Markdown version of this page is available at /docs/aidbox/notebooks.md or by requesting it with the Accept: text/markdown header.
Aidbox Docs
All notebooks

Delete Resources

Examples to delete resources in Aidbox

13 cells · updated Apr 29, 2024

This is a read-only view. Responses shown were saved when the notebook was published — open it in your own Aidbox to run the cells against live data.

1. Delete a resource

Note: notebook is also a type of resource and can be deleted with this operation

REST Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
DELETE /Notebook/3ae34975-5305-47e6-9de1-7cfa23c76a75
Response: Body
Status: 200
{
  "name": "Delete Resources",
  "cells": [
    {
      "id": "b5f46c1f-79e8-4107-8f4b-686c892c2193",
      "type": "markdown",
      "value": "# 1. Delete a resource\nNote: notebook is also a type of resource and can be deleted with this operation",
      "folded": {
        "code": true,
        "result": false
      },
      "result": "<h1>1. Delete a resource</h1><p>Note: notebook is also a type of resource and can be deleted with this operation</p>",
      "nb-title": "Delete Resources",
      "evaluating?": false
    },
    {
      "id": "99e2223a-f522-4f49-8308-93cf3fdb0c80",
      "type": "rest",
      "value": "DELETE /Notebook/3ae34975-5305-47e6-9de1-7cfa23c76a75",
      "folded": {
        "result": false
      },
      "result": {
        "body": "{\"name\":\"Delete Resources\",\"cells\":[{\"id\":\"b5f46c1f-79e8-4107-8f4b-686c892c2193\",\"type\":\"markdown\",\"value\":\"# 1. Delete a resource\\nNote: notebook is also a type of resource and can be deleted with this operation\",\"folded\":{\"code\":true,\"result\":false},\"result\":\"<h1>1. Delete a resource</h1><p>Note: notebook is also a type of resource and can be deleted with this operation</p>\",\"nb-title\":\"Delete Resources\",\"evaluating?\":false},{\"id\":\"99e2223a-f522-4f49-8308-93cf3fdb0c80\",\"type\":\"rest\",\"value\":\"DELETE /Notebook/fbafb29f-34d4-4a80-b17d-85fff4e1caab\",\"folded\":{\"result\":false},\"result\":{\"body\":\"{\\\"cells\\\":[],\\\"id\\\":\\\"fbafb29f-34d4-4a80-b17d-85fff4e1caab\\\",\\\"resourceType\\\":\\\"Notebook\\\",\\\"meta\\\":{\\\"lastUpdated\\\":\\\"2023-09-15T19:44:18.025050Z\\\",\\\"createdAt\\\":\\\"2023-09-15T19:44:18.025050Z\\\",\\\"versionId\\\":\\\"5657\\\"}}\",\"status\":200,\"headers\":{\"x-duration\":15,\"content-type\":\"application/json\",\"x-request-id\":\"c839f0b8-80da-4624-8065-647230d7d628\"}},\"nb-title\":\"Delete Resources\",\"evaluating?\":false},{\"id\":\"fa9ad30a-42d8-4e71-b9f2-46c7ab75245e\",\"type\":\"rest\"},{\"id\":\"efbff04b-5d32-4a12-93a7-6d5203170c1b\",\"type\":\"markdown\",\"value\":\"# 2. Delete all the resources of a specific type\",\"folded\":{\"code\":true,\"result\":false},\"result\":\"<h1>2. Delete all the resources of a specific type</h1>\",\"nb-title\":\"Delete Resources\",\"evaluating?\":false},{\"id\":\"06c84383-0b94-4fcf-a8a2-d99c9a494614\",\"type\":\"sql\",\"value\":\"truncate location;\",\"folded\":{\"result\":false},\"result\":{\"query\":\"truncate location;\",\"result\":[{\"data\":0,\"type\":\"count\"}],\"status\":\"success\",\"duration\":29},\"nb-title\":\"Delete Resources\",\"evaluating?\":false}],\"description\":\"Examples to delete resources in Aidbox\",\"edit-secret\":\"bfdf661d-3c05-42cf-a610-1002f553488d\",\"publication-id\":\"00ddc162-a36e-4181-a186-ee19701a6be6\",\"id\":\"3ae34975-5305-47e6-9de1-7cfa23c76a75\",\"resourceType\":\"Notebook\",\"meta\":{\"lastUpdated\":\"2023-11-20T15:11:22.154058Z\",\"createdAt\":\"2023-11-20T15:11:22.154058Z\",\"versionId\":\"182\"}}",
        "status": 200,
        "headers": {
          "x-duration": 335,
          "content-type": "application/json",
          "license-mode": "normal",
          "x-request-id": "80bd4488dc80830286bd460b7c322bd9"
        }
      },
      "nb-title": "Delete Resources",
      "evaluating?": false
    },
    {
      "id": "fa9ad30a-42d8-4e71-b9f2-46c7ab75245e",
      "type": "rest",
      "value": ""
    },
    {
      "id": "efbff04b-5d32-4a12-93a7-6d5203170c1b",
      "type": "markdown",
      "value": "# 2. Delete all the resources of a specific type",
      "folded": {
        "code": true,
        "result": false
      },
      "result": "<h1>2. Delete all the resources of a specific type</h1>",
      "nb-title": "Delete Resources",
      "evaluating?": false
    },
    {
      "id": "06c84383-0b94-4fcf-a8a2-d99c9a494614",
      "type": "sql",
      "value": "truncate location;",
      "folded": {
        "result": false
      },
      "result": {
        "query": "truncate location;",
        "result": [
          {
            "data": 0,
            "type": "count"
          }
        ],
        "status": "success",
        "duration": 29
      },
      "nb-title": "Delete Resources",
      "evaluating?": false
    }
  ],
  "description": "Examples to delete resources in Aidbox",
  "edit-secret": "bfdf661d-3c05-42cf-a610-1002f553488d",
  "publication-id": "00ddc162-a36e-4181-a186-ee19701a6be6",
  "id": "3ae34975-5305-47e6-9de1-7cfa23c76a75",
  "resourceType": "Notebook",
  "meta": {
    "lastUpdated": "2023-11-20T15:11:45.879794Z",
    "createdAt": "2023-11-20T15:11:45.879794Z",
    "versionId": "184"
  }
}
REST Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
DELETE /Patient/patient_id
REST Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
DELETE /User/yqi
Response: Body
Status: 200
{
  "data": {
    "name": "Yue Qi (CHUM)",
    "roles": [
      "Developer"
    ]
  },
  "password": "$s0$f0801$ga4+2mCLFw9ax8dpbP59HQ==$M2xJrtoIDwKDr1Q1wY+25hr2+FW37bomeoMXvd29d5I=",
  "id": "yqi",
  "resourceType": "User",
  "meta": {
    "lastUpdated": "2023-11-16T15:15:00.036147Z",
    "createdAt": "2023-11-16T15:15:00.036147Z",
    "versionId": "151"
  }
}

2. Delete all the resources of a specific type

SQL Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
truncate patient;
0 rows affected
SQL Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
truncate location;
0 rows affected
SQL Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
truncate encounter;
0 rows affected
SQL Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
truncate observation;
0 rows affected
SQL Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
truncate procedure;
0 rows affected
SQL Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
truncate condition;
0 rows affected
SQL Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
truncate serviceRequest;
0 rows affected
SQL Send Cells run only inside Aidbox. Use Run in Aidbox above to open this notebook in your own instance.
truncate medicationAdministration;
0 rows affected