OnMedicalReportFinished
Triggered when a structured medical report finishes processing.
It covers reports produced inside the platform and those produced through
SOFT Integration. The latter carry two extra fields, origin and
consultationMetadata, described below.
Payload
{
"eventName": "OnMedicalReportFinished",
"organizationId": "1111111",
"userId": "1111111",
"timestamp": "2026-03-31T19:06:58.667Z",
"consultationSessionId": "medical-consultation-u1234-1234567890-abc123",
"medicalReport": {
"fields": [
{
"id": "3ef6969c-c62d-43fb-9cf6-7d270f1cd4a1",
"customHistory": [],
"customContext": "",
"templateId": "285b5a84-9a1e-4b3c-9a3f-0711ba7bc4a7",
"createdAt": 1776123550031,
"customType": "string",
"order": 1,
"enumerableSelectionOption": "SINGLE",
"customEnumerableOptions": [],
"customValue": "mock value.",
"customName": "mock value",
"customDescription": "mock value",
"updatedAt": 1776123550031
},
{
"customHistory": [],
"customContext": "",
"templateId": "285b5a84-9a1e-4b3c-9a3f-0711ba7bc4a7",
"customType": "string",
"id": "5c14f3f4-8d43-4307-b7ca-f1802ffe4363",
"enumerableSelectionOption": "SINGLE",
"customEnumerableOptions": [],
"createdAt": 1776123559943,
"customValue": "mock value.",
"customName": "mock value",
"updatedAt": 1776123559943,
"customDescription": "mock value",
"order": 2
}
],
"summary": "Consultation summary...",
"createdAt": 1711900000000
},
"requestSignature": "abcdef1234567890"
}
Payload from a SOFT Integration consultation
Same event and same structure, with origin and consultationMetadata added. Here consultationSessionId
is the requestId you generated when requesting the signature:
{
"eventName": "OnMedicalReportFinished",
"organizationId": "1111111",
"userId": "1111111",
"timestamp": "2026-03-31T19:06:58.667Z",
"consultationSessionId": "2222-2222-2222-2222",
"origin": "SOFT_INTEGRATION",
"consultationMetadata": {
"patientId": "PAT-123-56",
"hcId": "1234567"
},
"medicalReport": {
"fields": [],
"summary": "Consultation summary...",
"createdAt": 1711900000000
},
"requestSignature": "abcdef1234567890"
}
consultationMetadata is whatever your system sent when generating the signature, returned untouched. It is
absent if you sent none, so treat both fields as optional.Field description
| Field | Type | Required | Description |
|---|---|---|---|
eventName | string | Yes | Always "OnMedicalReportFinished" |
organizationId | string | Yes | Organization ID |
userId | string | No | User ID |
timestamp | string | Yes | ISO 8601 UTC |
consultationSessionId | string | No | Consultation session ID. In SOFT Integration it is the requestId you generated. |
origin | string | No | Only for SOFT Integration consultations. Always "SOFT_INTEGRATION". |
consultationMetadata | object | No | Only for SOFT Integration consultations. The metadata you sent when generating the signature, returned untouched. Absent if you sent none. |
medicalReport | object | Yes | Structured report object (see below) |
medicalReport.fields | array | Yes | Report field entries (see field structure below) |
medicalReport.summary | string | Yes | Free-text report summary |
medicalReport.createdAt | number | Yes | Unix timestamp (ms) of creation |
requestSignature | string | No | HMAC-SHA256 in Base64. Present if the organization has credentials configured. |
medicalReport.fields[] structure
| Field | Type | Description |
|---|---|---|
id | string | Unique field identifier (UUID) |
templateId | string | Template identifier this field belongs to (UUID) |
customName | string | Display name of the field |
customDescription | string | Description of the field |
customValue | string | The generated value/content for this field |
customType | string | Data type of the field (e.g., "string") |
customContext | string | Additional context for the field |
customHistory | array | History of previous values |
customEnumerableOptions | array | Available options for enumerable fields |
enumerableSelectionOption | string | Selection mode for enumerable fields (e.g., "SINGLE") |
order | number | Display order of the field |
createdAt | number | Unix timestamp (ms) of creation |
updatedAt | number | Unix timestamp (ms) of last update |
Signature string
The medicalReport object is serialized as JSON. The fields are signed in the following order:
organizationId|userId|timestamp|consultationSessionId|{"fields":[...],"summary":"...","createdAt":...}|API_KEY
SOFT Integration signs two extra values. Because the signature concatenates every field present in
the payload, a consultation opened through SOFT Integration is signed like this instead:Build the string from the payload exactly as you received it rather than from a fixed list of fields, and
the same code verifies both.
organizationId|userId|timestamp|consultationSessionId|origin|{"patientId":"..."}|{"fields":[...],...}|API_KEY