EndpointsPrescriptions

Prescriptions

Function-calling namespace: prescriptions

  • Base URL: https://api.aivida.in
  • Engine endpoint: POST /api
  • Auth: Stack token middleware enabled in optional mode.
  • Send token in header: x-stack-access-token: <access_token> (or Authorization: Bearer <access_token>).
  • In optional mode: no token is allowed; invalid token is rejected with 401.

create

Source: backend/endpoints/prescriptions/create

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
consultationIdstringYes-
patientIdstringYes-
doctorIdstringYes-
medicationsarray<object>Yes-
notesstringNo-
isDispensedbooleanNo-
dispensedAtintegerNounix-ms timestamp; nullable
createdAtintegerNounix-ms timestamp; nullable

Nested Field Structures

medications item

FieldTypeRequiredConstraints
namestringNo-
medicine_typestringNo-
dosagestringNo-
morningbooleanNo-
afternoonbooleanNo-
eveningbooleanNo-
nightbooleanNo-
sosbooleanNo-
statbooleanNo-
duration_valueintegerNo-
duration_unitstringNo-
food_timingstringNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "prescriptions",
  "apiName": "create",
  "data": {
    "organizationId": "org_123",
    "consultationId": "consultation_123",
    "patientId": "patient_123",
    "doctorId": "doctor_123",
    "medications": [
      {
        "name": "value",
        "medicine_type": "general",
        "dosage": "value",
        "morning": true,
        "afternoon": true,
        "evening": true,
        "night": true,
        "sos": true,
        "stat": true,
        "duration_value": 1,
        "duration_unit": "value",
        "food_timing": "value"
      }
    ]
  }
}'

Example Response

{ "status": "ok", "data": {} }

delete

Source: backend/endpoints/prescriptions/delete

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "prescriptions",
  "apiName": "delete",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

getById

Source: backend/endpoints/prescriptions/get-by-id

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "prescriptions",
  "apiName": "getById",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

listByOrganization

Source: backend/endpoints/prescriptions/list-by-organization

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
pageintegerNo-
pageSizeintegerNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "prescriptions",
  "apiName": "listByOrganization",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

update

Source: backend/endpoints/prescriptions/update

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
consultationIdstringNonullable
patientIdstringNonullable
doctorIdstringNonullable
medicationsarray<object>Nonullable
notesstringNonullable
isDispensedbooleanNonullable
dispensedAtintegerNounix-ms timestamp; nullable
createdAtintegerNounix-ms timestamp; nullable

Nested Field Structures

medications item

FieldTypeRequiredConstraints
namestringNo-
medicine_typestringNo-
dosagestringNo-
morningbooleanNo-
afternoonbooleanNo-
eveningbooleanNo-
nightbooleanNo-
sosbooleanNo-
statbooleanNo-
duration_valueintegerNo-
duration_unitstringNo-
food_timingstringNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "prescriptions",
  "apiName": "update",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }