Manage Adverse Events
curl --request PUT \
--url https://api.example.com/api/v1/icsr/{icsr_id}/eventos \
--header 'Content-Type: application/json' \
--data '
{
"eventos": [
{
"texto": "<string>",
"tipo_notificacion": "<string>",
"fecha_inicio": "<string>",
"fecha_fin": "<string>",
"gravedad": "<string>",
"causalidad": "<string>",
"desenlace": "<string>",
"solo_ram_grave": "<string>",
"texto_correo": "<string>",
"doc_fuente_url": "<string>",
"meddra_llt_code": "<string>",
"meddra_llt_term": "<string>",
"meddra_pt_code": "<string>",
"meddra_pt_term": "<string>",
"meddra_pt_manual": "<string>",
"is_from_narrative": true
}
],
"gravedad": "<string>",
"causalidad": "<string>",
"desenlace": "<string>",
"solo_ram_grave": "<string>",
"texto_correo": "<string>",
"doc_fuente_url": "<string>",
"meddra_llt_code": "<string>",
"meddra_llt_term": "<string>",
"meddra_pt_code": "<string>",
"meddra_pt_term": "<string>",
"meddra_pt_manual": "<string>"
}
'{
"id": 123,
"icsr_id": 123,
"texto": "<string>",
"tipo_notificacion": "<string>",
"fecha_inicio": "<string>",
"fecha_fin": "<string>",
"gravedad": "<string>",
"causalidad": "<string>",
"desenlace": "<string>",
"solo_ram_grave": "<string>",
"texto_correo": "<string>",
"doc_fuente_url": "<string>",
"meddra_llt_code": "<string>",
"meddra_llt_term": "<string>",
"meddra_pt_code": "<string>",
"meddra_pt_term": "<string>",
"meddra_pt_manual": "<string>",
"is_from_narrative": true
}ICSR
Manage Adverse Events
Add, update, and manage adverse events for ICSR cases with MedDRA coding support
PUT
/
api
/
v1
/
icsr
/
{icsr_id}
/
eventos
Manage Adverse Events
curl --request PUT \
--url https://api.example.com/api/v1/icsr/{icsr_id}/eventos \
--header 'Content-Type: application/json' \
--data '
{
"eventos": [
{
"texto": "<string>",
"tipo_notificacion": "<string>",
"fecha_inicio": "<string>",
"fecha_fin": "<string>",
"gravedad": "<string>",
"causalidad": "<string>",
"desenlace": "<string>",
"solo_ram_grave": "<string>",
"texto_correo": "<string>",
"doc_fuente_url": "<string>",
"meddra_llt_code": "<string>",
"meddra_llt_term": "<string>",
"meddra_pt_code": "<string>",
"meddra_pt_term": "<string>",
"meddra_pt_manual": "<string>",
"is_from_narrative": true
}
],
"gravedad": "<string>",
"causalidad": "<string>",
"desenlace": "<string>",
"solo_ram_grave": "<string>",
"texto_correo": "<string>",
"doc_fuente_url": "<string>",
"meddra_llt_code": "<string>",
"meddra_llt_term": "<string>",
"meddra_pt_code": "<string>",
"meddra_pt_term": "<string>",
"meddra_pt_manual": "<string>"
}
'{
"id": 123,
"icsr_id": 123,
"texto": "<string>",
"tipo_notificacion": "<string>",
"fecha_inicio": "<string>",
"fecha_fin": "<string>",
"gravedad": "<string>",
"causalidad": "<string>",
"desenlace": "<string>",
"solo_ram_grave": "<string>",
"texto_correo": "<string>",
"doc_fuente_url": "<string>",
"meddra_llt_code": "<string>",
"meddra_llt_term": "<string>",
"meddra_pt_code": "<string>",
"meddra_pt_term": "<string>",
"meddra_pt_manual": "<string>",
"is_from_narrative": true
}Endpoints
List Events for a Case
GET /api/v1/icsr/{icsr_id}/eventos
icsr:read
Replace All Events
PUT /api/v1/icsr/{icsr_id}/eventos
icsr:update
Update Single Event
PUT /api/v1/icsr/{icsr_id}/eventos/{evento_id}
icsr:update
Update MedDRA Coding Only
PUT /api/v1/icsr/{icsr_id}/meddra
icsr:update
Bulk Event Retrieval
GET /api/v1/icsr/eventos?ids=1&ids=2&ids=3
GET /api/v1/icsr/_bulk/eventos?ids=1,2,3
icsr:read
Path Parameters
The unique identifier of the ICSR case
The unique identifier of the specific adverse event (for single event updates)
Request Body (Replace All Events)
Array of event objects. Sending an empty array will delete all events.
Show Event Object Schema
Show Event Object Schema
Event description/text (minimum 1 character)
Notification type (e.g., “Inicial”, “Seguimiento”)
Event start date (ISO format: YYYY-MM-DD)
Event end date (ISO format: YYYY-MM-DD)
Event severity. Common values:
- “Grave”
- “No grave”
- “Potencialmente grave”
Causality assessment. Common values:
- “Definitiva” - Certain/definite relationship
- “Probable” - Probable relationship
- “Posible” - Possible relationship
- “Improbable” - Unlikely relationship
- “Condicional” - Conditional
- “No clasificable” - Unassessable
Event outcome. Common values:
- “Recuperado” - Recovered
- “En recuperación” - Recovering
- “Recuperado con secuelas” - Recovered with sequelae
- “No recuperado” - Not recovered
- “Muerte” - Death
- “Desconocido” - Unknown
Whether serious only due to adverse reaction. Values: “Si”, “No”, or null
Extended text from email or correspondence
URL to source document or attachment
MedDRA Lowest Level Term (LLT) code (e.g., “10037868”)
MedDRA LLT term text (e.g., “Rash eritematoso”)
MedDRA Preferred Term (PT) code (e.g., “10037844”)
MedDRA PT term text (e.g., “Rash”)
Manually entered PT term if auto-coding is not used
Whether the event was extracted from the narrative description (vs. manually added)
Request Body (Update Single Event)
Update event severity
Update causality assessment
Update event outcome
Update serious-only-due-to-AE flag
Update extended text
Update source document URL
Update LLT code
Update LLT term
Update PT code
Update PT term
Update manual PT term
Response
Returns an array of event objects:Unique event identifier
Parent ICSR case ID
Event description
Notification type
Event start date
Event end date
Event severity
Causality assessment
Event outcome
Serious-only-due-to-AE indicator
Extended text from correspondence
Source document URL
MedDRA LLT code
MedDRA LLT term
MedDRA PT code
MedDRA PT term
Manual PT term
Whether extracted from narrative
Bulk Retrieval Response
When using the bulk endpoints (GET /api/v1/icsr/eventos?ids=...), the response is an object keyed by ICSR ID:
{
"1234": [
{
"id": 5001,
"icsr_id": 1234,
"texto": "Rash eritematoso",
"gravedad": "No grave",
"causalidad": "Probable"
}
],
"1235": [
{
"id": 5002,
"icsr_id": 1235,
"texto": "Náuseas",
"gravedad": "No grave",
"causalidad": "Posible"
},
{
"id": 5003,
"icsr_id": 1235,
"texto": "Vómitos",
"gravedad": "No grave",
"causalidad": "Posible"
}
]
}
Example Requests
List Events
GET /api/v1/icsr/1234/eventos
[
{
"id": 5001,
"icsr_id": 1234,
"texto": "Rash eritematoso generalizado",
"tipo_notificacion": "Inicial",
"fecha_inicio": "2024-01-15",
"fecha_fin": "2024-01-18",
"gravedad": "No grave",
"causalidad": "Probable",
"desenlace": "Recuperado",
"solo_ram_grave": null,
"meddra_pt_code": "10037844",
"meddra_pt_term": "Rash",
"meddra_llt_code": "10037868",
"meddra_llt_term": "Rash eritematoso",
"is_from_narrative": true
}
]
Add Multiple Events
PUT /api/v1/icsr/1234/eventos
{
"eventos": [
{
"texto": "Rash eritematoso generalizado",
"tipo_notificacion": "Inicial",
"fecha_inicio": "2024-01-15",
"fecha_fin": "2024-01-18",
"gravedad": "No grave",
"causalidad": "Probable",
"desenlace": "Recuperado",
"meddra_pt_code": "10037844",
"meddra_pt_term": "Rash",
"meddra_llt_code": "10037868",
"meddra_llt_term": "Rash eritematoso",
"is_from_narrative": true
},
{
"texto": "Prurito intenso",
"tipo_notificacion": "Inicial",
"fecha_inicio": "2024-01-15",
"fecha_fin": "2024-01-17",
"gravedad": "No grave",
"causalidad": "Probable",
"desenlace": "Recuperado",
"meddra_pt_code": "10037087",
"meddra_pt_term": "Prurito",
"is_from_narrative": true
}
]
}
Update Event Severity and Causality
PUT /api/v1/icsr/1234/eventos/5001
{
"gravedad": "Grave",
"causalidad": "Definitiva",
"solo_ram_grave": "Si"
}
Update MedDRA Coding
PUT /api/v1/icsr/1234/meddra
{
"eventos": [
{
"texto": "Rash eritematoso generalizado",
"meddra_llt_code": "10037868",
"meddra_llt_term": "Rash eritematoso",
"meddra_pt_code": "10037844",
"meddra_pt_term": "Rash",
"is_from_narrative": true
}
]
}
Clear All Events
PUT /api/v1/icsr/1234/eventos
{
"eventos": []
}
Behavior
Replace All Events Workflow
- Delete existing events: All current events for the case are deleted
- Validate new events: Each event in the array is validated
- Insert new events: Valid events are inserted in order
- Commit transaction: All changes are committed atomically
- Return updated list: The complete list of events is returned with assigned IDs
Field Normalization
String fields are automatically trimmed:- Empty strings after trimming become
null - Whitespace-only values become
null - This applies to all text fields including MedDRA terms
MedDRA Coding
MedDRA codes follow a hierarchical structure:- LLT (Lowest Level Term): Most specific term (e.g., “Rash eritematoso”)
- PT (Preferred Term): Standardized grouping term (e.g., “Rash”)
- Use
meddra_llt_codeandmeddra_pt_codefor coded terms - Use
meddra_pt_manualfor free-text terms when coding is not available
Event Ordering
Events are ordered by theirid in ascending order (insertion order). To reorder events, you must replace the entire array.
Validation
The API validates:- ICSR case exists
- User has update permissions
textofield is required and non-empty- Date formats are valid ISO-8601
- Field lengths don’t exceed database limits (max 255 chars for most fields)
- MedDRA codes are strings (no format validation)
Error Responses
400 Bad Request
{
"detail": [
{
"loc": ["body", "eventos", 0, "texto"],
"msg": "field required",
"type": "value_error.missing"
}
]
}
404 Not Found
{
"detail": "ICSR no encontrado"
}
{
"detail": "Evento no encontrado para este ICSR"
}
Use Cases
Narrative Extraction Workflow
- Parse the case narrative (e.g., using NLP)
- Extract individual adverse events
- Send all events via PUT
/icsr/{id}/eventos - Mark each event with
is_from_narrative: true
Manual Event Entry
- User enters event details in a form
- Include severity, causality, outcome from dropdowns
- Add MedDRA coding if available
- Send as a single-event array
- Mark with
is_from_narrative: false
Event Severity by Event (Not Case-Level)
VIGIA supports individual severity assessment per event:- Each event has its own
gravedadfield - Update individual events via PUT
/icsr/{id}/eventos/{evento_id} - Case-level
gravedadfield on ICSR model represents overall severity
Causality Assessment Evolution
- Initial submission:
causalidad: "Posible" - After investigation: Update to
"Probable" - After expert review: Update to
"Definitiva" - Use single-event update endpoint to modify just causality
Best Practices
When Replacing Events
- Always GET first: Retrieve current events before making changes
- Preserve existing events: Include all events you want to keep
- Add new events: Append to the array
- Remove unwanted events: Exclude from the array
- Send complete array: Never send a partial list unless intentionally deleting events
MedDRA Coding
- Use standard codes when available: Prefer coded terms over free text
- Include both LLT and PT: Provide complete hierarchy
- Store code and term: Always pair code with the term text
- Manual fallback: Use
meddra_pt_manualwhen coding is unavailable
Performance
- Batch event updates in a single request rather than multiple individual updates
- For MedDRA-only updates, use the
/meddraendpoint (same behavior, semantic clarity) - Bulk retrieval is more efficient than individual GET requests for multiple cases
Related Endpoints
- Create Case - Create ICSR (events are usually added after case creation)
- Update Case - Update case-level severity and outcome
- List Cases - List cases with their events
⌘I