/ocr/medical/v2/medical_pet_detail

1.接口描述

该 API 用于识别提取宠物医疗费用清单上的文字信息。

  • 图片要求:
    1. 格式为 JPG(JPEG), PNG
    2. 宽和高大于 128px, 小于等于 6000px
    3. 小于等于 5 MB

请求方式

POST

https://cloudapi.deepfinch.com/ocr/medical/v2/medical_pet_detail/basic

调试工具

Debugging Tool

2.请求参数

2.1 请求头域

字段 类型 必需 描述
X-DF-API-ID string API调用凭证信息,详细信息请参考API调用
X-DF-API-SECRET string API调用凭证信息,详细信息请参考API调用

2.2 请求体

字段 类型 必需 描述
file file 见下方注释 需上传的图片文件,上传本地图片进行检测时选取此参数
url string 见下方注释 图片网络地址,采用抓取网络图片方式时需选取此参数
auto_rotate boolean 是否开启图片自动旋转, 默认:false

请求参数 fileurl 二选一。
url 中若含有特殊字符,则需要对这些字符进行转义,所有中文和特殊字符必需以UTF-8编码转义。
目前支持 http/https 协议的网络地址。下载限时 5s,超时后仍未下载完成则属于失败。
参数 file 需把图片文件以 multipart/form-data 的形式放到 POST 消息体中。

3.返回参数

字段 类型 说明
request_id string 本次请求的id
status string 状态,正常为 OK
degree int 图片旋转角度
medical_result object 票据信息提取结果

3.1 medical_result 字段的参数:

字段 类型 说明
note_title string 票据标题
patient_name string 宠物名称
patient_gender int 性别:0-未知,1-公, 2-母
hospital_name string 医院名称
start_hospital_date string 入院日期
end_hospital_date string 出院日期
hospital_days float 住院天数
total_cost float 总金额
cost_detail_list array 细类项目
3.1.2 cost_detail_list 字段的参数:
字段 类型 说明
ocr_name string 细目名称,基于票面名称拆解后细目名称,建议细目名称用此条
cost float 细目金额
amount float 细目数量
unit_price float 细目单价
spec string 规格
unit string 单位
medical_level string 医保等级,根据票面内容提取
selfpay_ratio float 自付比例,取值范围:[0-1],从票面提取或通过细目名称查询医保库获取
selfpay float 自付金额,从票面提取或通过细目金额 * 自付比例计算
medical_type int 项目类型:0-未知,1-西药,2-中药,3-诊疗项目
class string 细目所属大类,根据票面内容提取
item_coding string 项目编码,根据票面内容提取
origin_ocr_name string 票面上原始打印的细目名称
name string 通过细目名称匹配的医保库名称
check_amount_unitprice_cost int 细目校验规则:单价(unit_price)*数量(amount)=金额(cost),1-成立,0-不成立,-1-缺失规则字段
返回结果示例
{
    "degree": 0,
    "medical_result": {
        "cost_detail_list": [
            {
                "amount": 2,
                "class": null,
                "cost": 110,
                "item_coding": "330100015a",
                "medical_level": null,
                "medical_type": null,
                "name": null,
                "ocr_name": "麻醉中监测",
                "origin_ocr_name": "麻醉中监测",
                "selfpay": null,
                "selfpay_ratio": null,
                "spec": null,
                "unit": "小时",
                "unit_price": 55
            },
            {
                "amount": 1,
                "class": null,
                "cost": 80,
                "item_coding": "330100016",
                "medical_level": null,
                "medical_type": null,
                "name": null,
                "ocr_name": "控制性降压",
                "origin_ocr_name": "控制性降压",
                "selfpay": null,
                "selfpay_ratio": null,
                "spec": null,
                "unit": "次",
                "unit_price": 80
            },
            {
                "amount": 1,
                "class": null,
                "cost": 50,
                "item_coding": "110200005c",
                "medical_level": null,
                "medical_type": null,
                "name": null,
                "ocr_name": "诊查费",
                "origin_ocr_name": "诊查费",
                "selfpay": null,
                "selfpay_ratio": null,
                "spec": null,
                "unit": "日",
                "unit_price": 50
            }
        ],
        "end_hospital_date": null,
        "hospital_days": null,
        "hospital_name": "XXX宠物医院",
        "note_title": null,
        "patient_gender":1,
        "patient_name": "XXX",
        "start_hospital_date": null,
        "total_cost": 240
    },
    "status": "OK"
}

4.错误码

状态码 status 字段 说明
400 INVALID_ARGUMENT 请求参数错误
400 DETETION_FAILED 图片检测失败
400 DOWNLOAD_ERROR 网络地址图片获取失败
401 UNAUTHORIZED 未授权或授权失败
401 KEY_EXPIRED 账号过期
403 NO_PERMISSION 无调用权限
403 OUT_OF_QUOTA 调用次数超出限额
403 RATE_LIMIT_EXCEEDED 调用频率超出限额
404 NOT_FOUND 请求路径错误
500 INTERNAL_ERROR 服务器内部错误

备注: 以上40X系列错误描述请参考reason字段

输出样例
{
  "status": "INVALID_ARGUMENT",
  "reason": "must specify 'file' or 'url' argument",
  "request_id": "TID8bf47ab6eda64476973cc5f5b6ebf57e"
}

5.输入示例

results matching ""

    No results matching ""