/ocr/inspection_report
1.接口描述
该API是用于识别提取医疗检查报告上的文字信息。
请求方式:
POST
请求URL:
https://cloudapi.deepfinch.com/ocr/inspection_report
调试工具
2.请求参数
2.1 请求头域
字段 | 类型 | 必需 | 描述 |
---|---|---|---|
X-DF-API-ID | string | 是 | API调用凭证信息,详细信息请参考API调用 |
X-DF-API-SECRET | string | 是 | API调用凭证信息,详细信息请参考API调用 |
2.2 请求体
字段 | 类型 | 必需 | 描述 |
---|---|---|---|
file | file | 见下方注释 | 需上传的图片文件,上传本地图片进行检测时选取此参数 |
url | string | 见下方注释 | 图片网络地址,采用抓取网络图片方式时需选取此参数 |
请求参数
file
与url
二选一。
url 中若含有特殊字符,则需要对这些字符进行转义,所有中文和特殊字符必需以UTF-8编码转义。
目前支持 http/https 协议的网络地址。下载限时 5s,超时后仍未下载完成则属于失败。
参数file
需把图片文件以 multipart/form-data 的形式放到 POST 消息体中。
3.返回参数
字段 | 类型 | 描述 |
---|---|---|
request_id | string | 本次请求的 id |
status | string | 状态。正常为 OK ,其他值表示失败。详见错误码 |
result | object | 识别结果 |
3.1 result 字段的参数
字段 | 类型 | 说明 |
---|---|---|
name | object | 患者姓名 |
age | object | 年龄 |
sex | object | 性别 |
department | object | 科室 |
outpatient_numb | object | 门诊号 |
outpatient_check_name | object | 检查名称 |
outpatient_check_part | object | 检查部位 |
outpatient_date | object | 检查日期 |
image_result | object | 影像结果 |
check_result | object | 检查结果 |
3.1.1 各字段的参数
字段 | 类型 | 说明 |
---|---|---|
txt | string | 提取文本 |
region | floatArray | 文本坐标 |
输出示例:
{
"request_id": "TID16cfd4fcf3b84ed18951a580dab5b65e",
"result": {
"age": {
"region": [
957.988116892376,
339.9141979768786,
1004.856247280307,
339.9141979768786,
1004.856247280307,
373.12420582519434,
957.988116892376,
373.12420582519434
],
"txt": "7"
},
"check_result": {
"region": [
[
71.39931705401376,
1351.842672413793,
219.81506328246203,
1351.842672413793,
219.81506328246203,
1388.9597400089694,
71.39931705401376,
1388.9597400089694
],
[
83.11634965099651,
1396.7738595026908,
356.51377691392753,
1396.7738595026908,
356.51377691392753,
1435.8444569712976,
83.11634965099651,
1435.8444569712976
]
],
"txt": "肠系膜淋巴结肿大"
},
"department": {
"region": [
1286.0650296078932,
390.7059746860674,
1436.433614602505,
390.7059746860674,
1436.433614602505,
425.86951240781343,
1286.0650296078932,
425.86951240781343
],
"txt": "儿科"
},
"image_result": {
"region": [
[
79.21067211866894,
834.1572559547539,
229.579257113281,
834.1572559547539,
229.579257113281,
873.2278534233606,
79.21067211866894,
873.2278534233606
],
[
141.70151263591032,
879.0884430436516,
1098.592508056169,
879.0884430436516,
1098.592508056169,
922.066100259119,
141.70151263591032,
922.066100259119
],
[
616.2413328137121,
882.9955027905123,
893.5444376089706,
882.9955027905123,
893.5444376089706,
916.205510638828,
616.2413328137121,
916.205510638828
],
[
913.0728252706085,
884.9490326639425,
1098.592508056169,
884.9490326639425,
1098.592508056169,
922.066100259119,
913.0728252706085,
922.066100259119
],
[
141.70151263591032,
924.0196301325493,
1428.62225953785,
924.0196301325493,
1428.62225953785,
965.0437574745864,
141.70151263591032,
965.0437574745864
],
[
77.25783335250514,
970.9043470948774,
331.1268729537982,
970.9043470948774,
331.1268729537982,
1008.0214146900539,
77.25783335250514,
1008.0214146900539
]
],
"txt": "脐周腹腔内见数个淋巴 结回声,患儿腹部超声可显示部位未探及明显包块及游离液性暗区回声。"
},
"name": {
"region": [
282.30590379970346,
336.0071382300179,
374.08932580940166,
336.0071382300179,
374.08932580940166,
371.17067595176405,
282.30590379970346,
371.17067595176405
],
"txt": "XXX"
},
"outpatient_check_name": {
"region": [
954.0824393600484,
447.3583410155471,
1436.433614602505,
447.3583410155471,
1436.433614602505,
480.5683488638629,
954.0824393600484,
480.5683488638629
],
"txt": "胃肠道(右下腹)彩超、肠系膜淋巴结"
},
"outpatient_check_part": {
"region": [
141.70151263591032,
924.0196301325493,
1428.62225953785,
924.0196301325493,
1428.62225953785,
965.0437574745864,
141.70151263591032,
965.0437574745864
],
"txt": "未探及明显包块及游离液性暗区回声"
},
"outpatient_date": {
"region": [],
"txt": ""
},
"outpatient_numb": {
"region": [
1282.1593520755655,
345.7747875971697,
1424.7165820055222,
345.7747875971697,
1424.7165820055222,
377.031265572055,
1282.1593520755655,
377.031265572055
],
"txt": "240407228"
},
"sex": {
"region": [
627.9583654106948,
339.9141979768786,
661.1566244354792,
339.9141979768786,
661.1566244354792,
373.12420582519434,
627.9583654106948,
373.12420582519434
],
"txt": "女"
}
},
"status": "OK"
}
4.错误码
状态码 | status 字段 |
说明 |
---|---|---|
400 |
INVALID_ARGUMENT | 请求参数错误 |
400 |
DETECTION_FAILED | 图片检测失败 |
401 |
UNAUTHORIZED | 未授权或授权失败 |
403 |
RATE_LIMIT_EXCEEDED | 调用频率超出限额 |
404 |
NOT_FOUND | 请求路径错误 |
500 |
INTERNAL_ERROR | 服务器内部错误 |
输出示例:
{
"status": "INVALID_ARGUMENT",
"reason": "must specify 'file'",
"request_id": "TID8bf47ab6eda64476973cc5f5b6ebf57e"
}