Admissions
Function-calling namespace: admissions
- 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/admissions/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
patientId | string | Yes | - |
admittingDoctorId | string | Yes | - |
appointmentId | string | No | - |
consultationId | string | No | - |
admissionReason | string | Yes | - |
admissionNotes | string | No | - |
wardId | string | No | - |
roomId | string | No | - |
bedId | string | No | - |
status | string | Yes | default: REQUESTED |
requestedAt | integer | Yes | unix-ms timestamp; default: current Unix ms |
advanceAmount | number | No | nullable |
advancePaymentMethod | string | No | - |
advanceTransactionId | 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": "admissions",
"apiName": "create",
"data": {
"organizationId": "org_123",
"patientId": "patient_123",
"admittingDoctorId": "doctor_123",
"admissionReason": "Post-operative observation",
"admissionNotes": "Needs 24-hour monitoring.",
"status": "REQUESTED",
"requestedAt": 1773271800000
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/admissions/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": "admissions",
"apiName": "delete",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getAdmissionLogs
Source: backend/endpoints/admissions/get-admission-logs
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
admissionId | 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": "admissions",
"apiName": "getAdmissionLogs",
"data": {
"admissionId": "admission_123"
}
}'Example Response
{ "status": "ok", "data": {} }getAdmittedPatientDetailForBilling
Source: backend/endpoints/admissions/get-admitted-patient-detail-for-billing
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
admissionId | string | Yes | - |
organizationSlug | 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": "admissions",
"apiName": "getAdmittedPatientDetailForBilling",
"data": {
"admissionId": "admission_123",
"organizationSlug": "demo-hospital"
}
}'Example Response
{ "status": "ok", "data": {} }getById
Source: backend/endpoints/admissions/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": "admissions",
"apiName": "getById",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }listByDoctorId
Source: backend/endpoints/admissions/list-by-doctor-id
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
doctorId | string | Yes | - |
status | string | No | nullable |
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": "admissions",
"apiName": "listByDoctorId",
"data": {
"doctorId": "doctor_123"
}
}'Example Response
{ "status": "ok", "data": {} }listByOrganization
Source: backend/endpoints/admissions/list-by-organization
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
status | string | No | nullable |
searchQuery | 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": "admissions",
"apiName": "listByOrganization",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/admissions/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
patientId | string | No | nullable |
admittingDoctorId | string | No | nullable |
appointmentId | string | No | nullable |
consultationId | string | No | nullable |
status | string | No | nullable |
admissionReason | string | No | nullable |
admissionNotes | string | No | nullable |
requestedAt | integer | No | unix-ms timestamp; nullable |
wardId | string | No | nullable |
roomId | string | No | nullable |
bedId | string | No | nullable |
admittedAt | integer | No | unix-ms timestamp; nullable |
confirmedByUserId | string | No | nullable |
dischargingDoctorId | string | No | nullable |
dischargeReason | string | No | nullable |
dischargeSummary | string | No | nullable |
dischargeRequestedAt | integer | No | unix-ms timestamp; nullable |
dischargedAt | integer | No | unix-ms timestamp; nullable |
billingClearedByUserId | string | No | nullable |
billingClearedAt | integer | No | unix-ms timestamp; nullable |
advanceAmount | number | No | nullable |
advancePaymentMethod | string | No | nullable |
advanceTransactionId | string | No | nullable |
advancePaidAt | integer | No | unix-ms timestamp; nullable |
advanceCollectedByUserId | string | No | nullable |
firstCareStartedByNurseId | string | No | nullable |
firstCareStartedAt | integer | No | unix-ms timestamp; nullable |
createdAt | integer | No | unix-ms timestamp; nullable |
updatedAt | integer | No | unix-ms timestamp; nullable |
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": "admissions",
"apiName": "update",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }