EndpointsPatient Medical History

Patient Medical History

Function-calling namespace: patientMedicalHistory

  • 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/patient-medical-history/create

Input Fields

FieldTypeRequiredConstraints
patientIdstringYes-
organizationIdstringYes-
allergiesarray<string>No-
chronicConditionsarray<string>No-
currentMedicationsarray<string>No-
pastSurgeriesarray<object>No-
familyHistorystringNo-
updatedAtintegerNounix-ms timestamp; nullable

Nested Field Structures

pastSurgeries item

FieldTypeRequiredConstraints
namestringNo-
datestringNoformat: YYYY-MM-DD
notesstringNo-

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": "patientMedicalHistory",
  "apiName": "create",
  "data": {
    "patientId": "patient_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

delete

Source: backend/endpoints/patient-medical-history/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": "patientMedicalHistory",
  "apiName": "delete",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

getById

Source: backend/endpoints/patient-medical-history/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": "patientMedicalHistory",
  "apiName": "getById",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

listByOrganization

Source: backend/endpoints/patient-medical-history/list-by-organization

Input Fields

FieldTypeRequiredConstraints
patientIdstringYes-
organizationIdstringNo-
searchstringNo-
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": "patientMedicalHistory",
  "apiName": "listByOrganization",
  "data": {
    "patientId": "patient_123"
  }
}'

Example Response

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

update

Source: backend/endpoints/patient-medical-history/update

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
patientIdstringNonullable
allergiesarray<string>Nonullable
chronicConditionsarray<string>Nonullable
currentMedicationsarray<string>Nonullable
pastSurgeriesarray<object>Nonullable
familyHistorystringNonullable
updatedAtintegerNounix-ms timestamp; nullable

Nested Field Structures

pastSurgeries item

FieldTypeRequiredConstraints
namestringNo-
datestringNoformat: YYYY-MM-DD
notesstringNo-

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": "patientMedicalHistory",
  "apiName": "update",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

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