Eye Consultations
Function-calling namespace: eyeConsultations
- 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.
Clinical Payload Notes
visualAcuitystores unaided, pinhole, and Best Corrected VA (BCVA) for right and left eyes.refractionstores Sphere (SPH), Cylinder (CYL), Axis, Addition (ADD), VA, and Near Add for right and left eyes.- Axis must be between
0and180. - Supported visual acuity values:
6/6,6/9,6/12,6/18,6/24,9/18,N6,N8,N10.
create
Source: backend/endpoints/eye-consultations/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
consultationId | string | Yes | - |
organizationId | string | Yes | - |
visualAcuity | object | Yes | requires rightEye and leftEye acuity values; nullable |
refraction | object | Yes | requires rightEye and leftEye refraction values; axis: 0-180; nullable |
notes | string | No | - |
Nested Field Structures
visualAcuity
| Field | Type | Required | Constraints |
|---|---|---|---|
rightEye | object | No | - |
leftEye | object | No | - |
refraction
| Field | Type | Required | Constraints |
|---|---|---|---|
rightEye | object | No | - |
leftEye | object | 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": "eyeConsultations",
"apiName": "create",
"data": {
"consultationId": "consultation_123",
"organizationId": "org_123",
"visualAcuity": {
"rightEye": {
"unaidedDistance": "9/18",
"unaidedNear": "N8",
"pinholeDistance": "6/12",
"pinholeNear": "N6",
"bestCorrectedDistance": "6/12",
"bestCorrectedNear": "N6"
},
"leftEye": {
"unaidedDistance": "6/24",
"unaidedNear": "N10",
"pinholeDistance": "6/18",
"pinholeNear": "N8",
"bestCorrectedDistance": "6/6",
"bestCorrectedNear": "N6"
}
},
"refraction": {
"rightEye": {
"sphere": -1.25,
"cylinder": -0.75,
"axis": 90,
"addition": 1,
"va": "6/6",
"nearAdd": 1.25
},
"leftEye": {
"sphere": -1.5,
"cylinder": -0.5,
"axis": 85,
"addition": 1,
"va": "6/6",
"nearAdd": 1.25
}
},
"notes": "Patient reports blurry distance vision."
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/eye-consultations/delete
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
consultationId | 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": "eyeConsultations",
"apiName": "delete",
"data": {
"consultationId": "consultation_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getByConsultation
Source: backend/endpoints/eye-consultations/get-by-consultation
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
consultationId | string | No | - |
appointmentId | string | No | - |
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": "eyeConsultations",
"apiName": "getByConsultation",
"data": {
"consultationId": "consultation_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/eye-consultations/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
consultationId | string | No | - |
appointmentId | string | No | - |
organizationId | string | Yes | - |
visualAcuity | object | No | optional; when creating a missing eye record, full visualAcuity is required; nullable |
refraction | object | No | optional; when creating a missing eye record, full refraction is required; axis: 0-180; nullable |
notes | string | No | nullable |
Nested Field Structures
visualAcuity
| Field | Type | Required | Constraints |
|---|---|---|---|
rightEye | object | No | - |
leftEye | object | No | - |
refraction
| Field | Type | Required | Constraints |
|---|---|---|---|
rightEye | object | No | - |
leftEye | object | 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": "eyeConsultations",
"apiName": "update",
"data": {
"consultationId": "consultation_123",
"organizationId": "org_123",
"visualAcuity": {
"rightEye": {
"unaidedDistance": "9/18",
"unaidedNear": "N8",
"pinholeDistance": "6/12",
"pinholeNear": "N6",
"bestCorrectedDistance": "6/12",
"bestCorrectedNear": "N6"
},
"leftEye": {
"unaidedDistance": "6/24",
"unaidedNear": "N10",
"pinholeDistance": "6/18",
"pinholeNear": "N8",
"bestCorrectedDistance": "6/6",
"bestCorrectedNear": "N6"
}
},
"refraction": {
"rightEye": {
"sphere": -1.25,
"cylinder": -0.75,
"axis": 90,
"addition": 1,
"va": "6/6",
"nearAdd": 1.25
},
"leftEye": {
"sphere": -1.5,
"cylinder": -0.5,
"axis": 85,
"addition": 1,
"va": "6/6",
"nearAdd": 1.25
}
},
"notes": "Updated after refraction check."
}
}'Example Response
{ "status": "ok", "data": {} }