产品详情
API参数 全国医疗发票识别 调用地址: http,https://v2medicalinvoice.api.bdymkt.com/v2/medical_invoice 请求方式: POST 支持格式: application/json;charset=UTF-8 调用工具: 去调试 请求参数(Headers) 请求参数(Query) 请求参数(Body)
- 名称
- 类型
- 是否必须
- 示例值
- 描述
- image
- string
- true
- --
- 图像转base64的UrlEncode编码数据
- province
- string
- false
- --
- 相关省市地区的拼音;电子发票填e_invoice;住院发票不填写
<dependency>
<groupId>com.baidubce</groupId>
<artifactId>api-explorer-sdk</artifactId>
<version>1.0.0</version>
</dependency>
import com.baidubce.http.ApiExplorerClient;
import com.baidubce.http.AppSigner;
import com.baidubce.http.HttpMethodName;
import com.baidubce.model.ApiExplorerRequest;
import com.baidubce.model.ApiExplorerResponse;
// 全国医疗发票识别 Java示例代码
public class RequestDemo {
public static void main(String[] args) {
String path = "https://v2medicalinvoice.api.bdymkt.com/v2/medical_invoice";
ApiExplorerRequest request = new ApiExplorerRequest(HttpMethodName.POST, path);
request.setCredentials("您的 access key", "您的 secret key");
request.addHeaderParameter("Content-Type", "application/json;charset=UTF-8");
String requestExample = "image=%2F9j%2F4AAQSkZJRgABAQAASABIAAD%2F4QBYRXhpZgA...";
request.setJsonBody(requestExample);
ApiExplorerClient client = new ApiExplorerClient(new AppSigner());
try {
ApiExplorerResponse response = client.sendRequest(request);
// 返回结果格式为Json字符串
System.out.println(response.getResult());
} catch (Exception e) {
e.printStackTrace();
}
}
}
点击复制代码
正常返回示例 {
"degree": 0,
"medical_result": {
"billing_date": "2020-11-29",
"charging_units": "重庆医科大学附属儿童医院",
"check_code": "8c2e08",
"checksum": {
"billing_date": -1,
"cost_categories": 1,
"cost_detail_list": -1,
"note_no": -1,
"payments_class_b": -1,
"payments_class_c": -1,
"total_cost": 1
},
"cost_categories": [
{
"cost": 270,
"name": "西药费"
}
],
"cost_detail_list": [],
"end_hospital_date": null,
"hospital_days": null,
"hospital_departments": null,
"hospital_name": "重庆医科大学附属儿童医院",
"hospital_no": "1201129114299",
"medical_card_no": null,
"medical_insurance_no": null,
"medical_insurance_type": "城镇居民医保",
"medical_organization_type": "综合医院",
"medical_record_no": null,
"note_code": "50060120",
"note_no": "0021528790",
"note_title": "重庆市医疗门诊收费票据(",
"patient_gender": 1,
"patient_name": "XXX",
"payee": "XX",
"payment_channel": null,
"payments_info": [
{
"check_info": 0,
"cost": 0,
"name": "医保统筹基金支付"
},
{
"check_info": 0,
"cost": 0,
"name": "其他支付"
},
{
"check_info": 0,
"cost": 0,
"name": "个人账户支付"
},
{
"check_info": 0,
"cost": 270,
"name": "个人现金支付"
},
{
"check_info": 0,
"cost": 0,
"name": "个人自付"
},
{
"check_info": 0,
"cost": 0,
"name": "个人自费"
}
],
"reviewer": "何洁",
"service_serial_no": "120112911429920201129100300",
"social_security_card_no": null,
"start_hospital_date": null,
"total_cost": 270,
"treatment_date": "2020-11-29",
"type": 1,
"unified_social_credit_code": "500113201411047812",
"work_unit": null
},
"status": "OK"
}
失败返回示例 {
"status": "INVALID_ARGUMENT",
"reason": "must specify 'file' or 'url' argument",
"request_id": "TID8bf47ab6eda64476973cc5f5b6ebf57e"
}
错误码定义 - code
- message
- status
- 描述
- 400
- INVALID_ARGUMENT
- 400
- 请求参数错误
- 403
- OUT_OF_QUOTA
- 403
- 调用次数超出限额
- 500
- INTERNAL_ERROR
- 500
- 服务器内部错误
