Patient Medical History
Function-calling namespace: patientMedicalHistory
- Base URL:
https://api.aivida.in - Engine endpoint:
POST /api - Auth: Stack token middleware enabled in
optionalmode. - Send token in header:
x-stack-access-token: <access_token>(orAuthorization: Bearer <access_token>). - In
optionalmode: no token is allowed; invalid token is rejected with401.
create
Source: backend/endpoints/patient-medical-history/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
patientId | string | Yes | - |
organizationId | string | Yes | - |
allergies | array<string> | No | - |
chronicConditions | array<string> | No | - |
currentMedications | array<string> | No | - |
pastSurgeries | array<object> | No | - |
familyHistory | string | No | - |
updatedAt | integer | No | unix-ms timestamp; nullable |
Nested Field Structures
pastSurgeries item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
date | string | No | format: YYYY-MM-DD |
notes | string | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
patientId | string | Yes | - |
organizationId | string | No | - |
search | string | No | - |
page | integer | No | - |
pageSize | integer | No | - |
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
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
patientId | string | No | nullable |
allergies | array<string> | No | nullable |
chronicConditions | array<string> | No | nullable |
currentMedications | array<string> | No | nullable |
pastSurgeries | array<object> | No | nullable |
familyHistory | string | No | nullable |
updatedAt | integer | No | unix-ms timestamp; nullable |
Nested Field Structures
pastSurgeries item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
date | string | No | format: YYYY-MM-DD |
notes | string | No | - |
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": {} }