Clinic Forms API
Endpoints for managing forms and consents within the clinic system.
Consents
List Consents
Get a list of consent forms.
Endpoint: GET /v1/clinic/forms/consents
Authentication: Required
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number for pagination |
page_size | integer | No | Number of items per page |
patient_id | integer | No | Filter by patient ID |
form_type | string | No | Filter by consent form type |
status | string | No | Filter by consent status |
Example Request
GET /v1/clinic/forms/consents?patient_id=1049&status=signed HTTP/1.1
Content-Type: application/json
X-User-Token: your_token_hereCreate Consent
Endpoint: POST /v1/clinic/forms/consents
Authentication: Required
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
consent | object | Yes | Consent data object |
consent.patient_id | integer | Yes | ID of the patient |
consent.form_type | string | Yes | Type of consent form |
consent.content | string | Yes | Consent form content |
consent.signature | string | No | Base64 encoded signature |
consent.signed_at | string | No | Date/time when signed (ISO 8601) |
consent.witness_signature | string | No | Base64 encoded witness signature |
consent.witness_name | string | No | Name of the witness |
Example Request
POST /v1/clinic/forms/consents HTTP/1.1
Content-Type: application/json
X-User-Token: your_token_here
{
"consent": {
"patient_id": 1049,
"form_type": "treatment_consent",
"content": "I consent to the proposed treatment plan...",
"signature": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34...",
"signed_at": "2023-10-27T14:30:00.000Z",
"witness_name": "Dr. Smith"
}
}Response Format
Consent Response
{
"id": 123,
"patient_id": 1049,
"form_type": "treatment_consent",
"content": "I consent to the proposed treatment plan...",
"status": "signed",
"signature": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34...",
"signed_at": "2023-10-27T14:30:00.000Z",
"witness_signature": null,
"witness_name": "Dr. Smith",
"created_at": "2023-10-20T10:00:00.000Z",
"updated_at": "2023-10-27T14:30:00.000Z"
}Form Types
Common consent form types include:
treatment_consent- General treatment consentmedication_consent- Consent for medication administrationtelehealth_consent- Consent for telehealth servicesprivacy_consent- HIPAA privacy consentresearch_consent- Consent for research participationminor_consent- Consent for treatment of minors
Consent Status Values
draft- Consent form created but not yet signedpending- Consent form sent to patient for signaturesigned- Consent form has been signed by patientexpired- Consent form has expired and needs renewalrevoked- Consent has been revoked by patient
Error Responses
422 Unprocessable Entity
{
"errors": {
"patient_id": ["can't be blank"],
"form_type": ["is not included in the list"],
"content": ["can't be blank"]
}
}404 Not Found
{
"errors": "Consent form not found"
}403 Forbidden
{
"errors": "You are not authorized to access this consent form"
}Notes
- Signatures should be provided as base64 encoded PNG images with the
data:image/png;base64,prefix - The
signed_atfield should be in ISO 8601 format - Consent forms may require witness signatures depending on the form type and local regulations
- Some consent forms may have expiration dates and require periodic renewal
- Patient consent is required before accessing or sharing protected health information