Introduction: #
Resource/service: ecg-processor
Description: This service is related to the ECG processing and pdf generation functionality.
Audience/users: SDK users
Prerequisites: Main packages required are ecg-processor
and spandan-pdf-report-generator
Getting Started: #
Base URL: https://api.sunfox.in/ecg-processor/
{Environment}/v3
Environments : dev/prod
Authentication:
api-key
: (api key/master key/business id)Authorization
: (verifier token)
Error Handling :
- 200 : success
- 400 : Bad Request
- 401 : Unauthorized
- 500 : Internal Server Error
Endpoints: #
Method | Endpoint | Description |
---|---|---|
POST | /process | process ECG data, save the ECG data and generate PDF. |
[POST] /process
Description: #
This endpoint takes ECG leads data and processor_type to process the data and generate a PDF report
Parameters: #
Header:
Name | Type | Required | Description |
---|---|---|---|
api-key | string | yes | master-key/business-id |
Authorization | string | yes | verifier_token |
Body:
Name | Type | Required | Description |
---|---|---|---|
ecg-data | Object | yes | ECG leads data in base64 data. |
patient_data | Object | yes | Patient data |
test_id | Number/String | yes | Primary key of “spandan-sdk-test-logs-dev”. Uniquely identifies a SDK log test. |
generate_pdf_report | Boolean | yes | Generate PDF or not. |
processor_type | String | yes | processor_type can have 2 values : LEAD_TWO and TWELVE_LEAD (uppercase) |
scaling_factor | Number/String | optional | scaling of graph in PDF |
meta_data | Object | yes | Metadata like device information and report_id. |
Example Request Body: #
{
"ecg_data": {
"v1_data" : "---base64---",
"lead2_data" : "---base64---",
"v2_data" : "---base64---",
v3_data : "---base64---",
v4_data : "---base64---",
v5_data : "---base64---",
v6_data : "---base64---",
lead1_data : "---base64---"
}
"patient_data": {
"first_name":"Ritik",
"last_name":"Thapliyal",
"age":"30",
"height":"1",
"weight":"11",
"gender":"MALE"
},
"test_id":"1",
"generate_pdf_report": true,
"processor_type": "TWELVE_LEAD",
"scaling_factor": "25",
"meta_data": {
"report_id":"Ritik",
"device_variant":"SPNE",
"device_id":"31234798372912739",
"firmware_version":"33"
}
}
Example Response Body: #
Error :
{
"success": false,
"message": "patient_data.height must be a `number` type, but the final value was: `NaN` (cast from the value `\"1a\"`)."
}
Success :
{
"success": true,
"data": {
"characteristics": {
"pr": 155,
"qrs": 100,
"qt": 381,
"qtc": 439.94,
"rr": 850,
"st": -0.0065080915178571,
"heartRate": 80
},
"conclusions": {
"detection": "Normal\n",
"ecgType": "Normal ECG",
"recommendation": " Follow healthy Life Style ",
"anomalies": "Normal",
"risk": "LOW_RISK"
},
"url": "https://spandan-web-api-data.s3.ap-south-1.amazonaws.com/dev/657e49bff458f744/PDF/657e49bff458f74417170531443261956.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAQS3J4QKH67SKOI6P%2F20240530%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20240530T071224Z&X-Amz-Expires=3600&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEJ%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCmFwLXNvdXRoLTEiRjBEAiBQbiWn8AJ6XRfo6lVY5dEpebGShihbn4MjNnVPu5s%2FUQIgP53qbm36fnDMrXFa1cw7VQWPhLPrDRcFBT4olKHr8lAqhQMIKBADGgwwNDA0ODczODc3OTEiDBePqnoDBBKJ7sviNiriAk3RTKNrX1N4Y20ow9oBiTBr7rwYra1LT0SLrxWndfCYcBgwdJvqdllQapLFRZBh8duA4mlP4I90n5iIimPMGNYC0OGJ%2F6RX7hrBMK5fpK%2Bs7Cn0zClRlpaJU3uUfur8M55j1OzyGMDhr%2BMmPiiblvk4yNmAmT%2FF3DESmwcV6yCAEVjjMR7gGN70Sbkjxfpm7AWN3XNW%2BLEjRh5uhqShvsn84E8a5afWv8V5M6WZmzW2b6JW3V2%2BIijeJfLGUvtCtirlPsY%2B0j8O4T3DJxJsgB3YAGjeSTQM3vHwRpR24ujKHuSJa155S%2BROR6TSK3zLIQDpVeQ5lwAC0g5GJCCwJz25y9iC1nGEuW2TLOaWco%2FvBExYHMc4IqGWR%2Fth0MXAHujJddi2HOeha5tKYfb7kFlcvikBatSbZVKZDTV7pZqR%2Fg5LPbiO7jlyRRc7uZM9DgmU23n%2Fm5F5%2B3go6f9FK7YLtTCrzeCyBjqfAUykfP53a1V5WUdS5ixOV0uBoVdDfKSC%2BOc0bySlkJ4%2F0x%2FppqdNmZfTOS%2FA1K6ZiTFnx3qh1Bl4H9aw%2F2344IUybyNQ%2FxMj4SyzzAeJkqZ9oV%2BAQhkpdgLPtvycSAXn2Ni7ToGhAtJ41hpWBEA4Z%2FFUcu3vv%2B6ACBd0EVPskX0jn%2BQtnVCNdzipbrX7IswoEv%2FYxnCKHm5Kufv1pt8ZYw%3D%3D&X-Amz-Signature=a926894c9453e843d365b90e45a05fad6e6075a86f7b951fdfe8c8d2e6c31b6b&X-Amz-SignedHeaders=host"
}
}
Error Codes: #
- 200 : Success
- 400 : Bad Request
- 401 : Unauthorized
- 500 : Internal Server Error