POST
/
ai
/
service
/
v1
/
medical_recognize
医疗票据v1接口识别
curl --request POST \
  --url https://api.textin.com/ai/service/v1/medical_recognize \
  --header 'Content-Type: application/octet-stream' \
  --header 'x-ti-app-id: <api-key>' \
  --header 'x-ti-secret-code: <api-key>'
{
  "code": 200,
  "message": "success",
  "duration": 100,
  "version": "v1.0.0",
  "result": {
    "success_count": 1,
    "page_count": 1,
    "ppi": 144,
    "image_list": [
      {
        "image_angle": 0,
        "rotated_image_width": 1000,
        "rotated_image_height": 3000,
        "page_id": 0,
        "image_base64": "",
        "image_position": [
          100,
          100,
          200,
          100,
          200,
          200,
          100,
          200
        ]
      }
    ],
    "object_list": [
      {
        "type": "medical_invoice",
        "page_ids": [
          0
        ],
        "image_ids": [
          0
        ],
        "details": {
          "invoice_information": {
            "document_title_name": {
              "value": "",
              "description": "单据标题名称"
            },
            "invoice_code": {
              "value": "",
              "description": "票据代码"
            },
            "invoice_number": {
              "value": "",
              "description": "票据号码"
            },
            "business_serial_number": {
              "value": "",
              "description": "业务流水号"
            },
            "bill_verification_code": {
              "value": "",
              "description": "票据校验码"
            },
            "issuance_date": {
              "value": "",
              "description": "开具日期"
            },
            "total_pages_of_invoice": {
              "value": "",
              "description": "票据总页数"
            },
            "current_page_number": {
              "value": "",
              "description": "当前页码"
            }
          },
          "patient_information": {
            "gender": {
              "value": "",
              "description": "性别"
            },
            "inpatient_number": {
              "value": "",
              "description": "住院号"
            },
            "medical_record_number": {
              "value": "",
              "description": "病历号"
            },
            "outpatient_number": {
              "value": "",
              "description": "门诊号"
            },
            "patient_medical_insurance_number": {
              "value": "",
              "description": "患者医保编号"
            },
            "patient_medical_insurance_type": {
              "value": "",
              "description": "患者医保类型"
            },
            "patient_social_security_card_number": {
              "value": "",
              "description": "患者社保卡号"
            }
          },
          "medical_visit_institution_information": {
            "name_of_medical_institution": {
              "value": "",
              "description": "医疗机构名称"
            },
            "type_of_medical_institution": {
              "value": "",
              "description": "医疗机构类型"
            },
            "department": {
              "value": "",
              "description": "科别"
            },
            "admission_time": {
              "value": "",
              "description": "入院时间"
            },
            "discharge_time": {
              "value": "",
              "description": "出院时间"
            },
            "hospitalization_days": {
              "value": "",
              "description": "住院天数"
            }
          },
          "expense_information": {
            "total_amount_in_words": {
              "value": "",
              "description": "大写合计金额"
            },
            "total_expense_amount": {
              "value": "",
              "description": "费用合计金额"
            },
            "personal_account_balance": {
              "value": "",
              "description": "个人账户余额"
            },
            "personal_self_payment_amount": {
              "value": "",
              "description": "个人自付金额"
            },
            "personal_self_funded_amount": {
              "value": "",
              "description": "个人自费金额"
            },
            "prepaid_amount": {
              "value": "",
              "description": "预缴金额"
            },
            "supplementary_payment_amount": {
              "value": "",
              "description": "补缴金额"
            },
            "refund_amount": {
              "value": "",
              "description": "退费金额"
            }
          },
          "payment_method": {
            "payee_unit": {
              "value": "",
              "description": "收款单位"
            },
            "payee": {
              "value": "",
              "description": "收款人"
            },
            "reviewer": {
              "value": "",
              "description": "复核人"
            },
            "payer": {
              "value": "",
              "description": "交款人"
            },
            "medical_insurance_overall_planning_payment": {
              "value": "",
              "description": "医保统筹支付"
            },
            "personal_account_payment": {
              "value": "",
              "description": "个人账户支付"
            },
            "personal_cash_payment": {
              "value": "",
              "description": "个人现金支付"
            },
            "other_payments": {
              "value": "",
              "description": "其他支付"
            }
          },
          "item_details": [
            [
              {
                "amount": {},
                "remarks": {},
                "project_name": {},
                "quantity": {},
                "unit_price": {},
                "project_code_symbol": {}
              }
            ]
          ]
        }
      }
    ]
  }
}

Authorizations

x-ti-app-id
string
header
required

登录Textin后前往 "工作台-账号设置-开发者信息" 查看 x-ti-app-id

x-ti-secret-code
string
header
required

登录Textin后前往 "工作台-账号设置-开发者信息" 查看 x-ti-secret-code

Query Parameters

crop_image
enum<integer>
default:0

选择是否需要进行图片切分,0关闭切分,1开启切分,默认为0

Available options:
0,
1
return_image_base64
enum<integer>
default:0

选择是否需要输出图片base64,对应image_list中image_base64,0关闭,1开启,默认为0

Available options:
0,
1
category
enum<integer>
default:0

指定样本类型,不进行样本分类,直接抽取结果,默认为0不使用该功能 1: 医疗发票识别 2: 医疗费用明细 3: 医疗费用结算单 4: 医疗处方单 5: 医疗检验报告单 6: 医疗诊断报告单

Available options:
1,
2,
3,
4,
5,
6

Body

application/octet-stream · file

要上传的图片,目前支持jpg, png, bmp, pdf, tiff, ofd, webp, 单帧gif等大部分格式.

The body is of type file.

Response

200 - application/json
code
enum<integer>
required

错误码

  • 200: OK
  • 40301: 没有 http body
  • 40600: 图片解码失败,请检查图片格式是否正确。
  • 40400: 识别失败
  • 90001: 其他错误, 详情见 message
Available options:
200,
40301,
40600,
40400,
90001
Example:

200

message
string
required

错误信息

Example:

"success"

duration
integer

接口总耗时,单位为毫秒

Example:

100

version
string

接口版本

Example:

"v1.0.0"

result
object

样本识别结果