Health insurance claim form

1. Extract health insurance claim information with image URL or pdf URL input

API:

MethodURL
GEThttps://demo.computervision.com.vn/api/v2/ocr/claims

Params:

KeyValueDescription
imghttps://example.com/image.pngURL of photo or pdf
format_typeurlType of data to pass in, receive value: url, file, base64
get_thumbtrue/falseReturns a aligned image

Demo Python:

import requests
api_key = "YOUR_API_KEY"
api_secret = "YOUR_API_SECRET"
image_url = 'https://example.com/image.png'
response = requests.get(
"https://cloud.computervision.com.vn/api/v2/ocr/claims?img=%s&format_type=url&get_thumb=false"
% image_url,
auth=(api_key, api_secret))
print(response.json())

2. Extract health insurance claim information with image file or pdf file input

API:

MethodURLcontent-type
POSThttps://cloud.computervision.com.vn/api/v2/ocr/claimsmultipart/form-data

Params:

KeyValueDescription
format_typefileType of data to pass in, receive value: url, file, base64
get_thumbtrue/falseReturns a aligned image

Body:

KeyTypeValueDescription
imgfileexample.jpgImage file or pdf file

Demo Python:

import requests
api_key = "YOUR_API_KEY"
api_secret = "YOUR_API_SECRET"
image_path = '/path/to/your/image.jpg'
response = requests.post(
"https://cloud.computervision.com.vn/api/v2/ocr/claims?format_type=file&get_thumb=false",
auth=(api_key, api_secret),
files={'img': open(image_path, 'rb')})
print(response.json())

3. Extract health insurance claim information with JSON input

API:

MethodURLcontent-type
POSThttps://cloud.computervision.com.vn/api/v2/ocr/claimsapplication/json

Params:

KeyValueDescription
format_typebase64Type of data to pass in, receive value: url, file, base64
get_thumbtrue/falseReturns a aligned image

Body:

{
"img": "iVBORw0KGgoAAAANSU..." // string base64 of the image or pdf to extract
}

Demo Python:

import base64
import io
import requests
from PIL import Image
def get_byte_img(img):
img_byte_arr = io.BytesIO()
img.save(img_byte_arr, format='PNG')
encoded_img = base64.encodebytes(img_byte_arr.getvalue()).decode('ascii')
return encoded_img
api_key = "YOUR_API_KEY"
api_secret = "YOUR_API_SECRET"
img_name = "path_img"
encode_cmt = get_byte_img(Image.open(img_name))
response = requests.post(
"https://cloud.computervision.com.vn/api/v2/ocr/claims?format_type=base64&get_thumb=false",
auth=(api_key, api_secret),
json={'img' : encode_cmt})
print(response.json())

4. Response

The response will be a JSON with the following format:

{
"data": [xxxx],
"errorCode": string,
"errorMessage": string
}

In the case of extracting the data field recordset information will be a list of elements:

{
"info": [xxxx],
"type": [xxxx],
"pages": [xxxx]
}

type: The type of document in the health insurance claim file is extracted information.

  • invoice
  • list_expense
  • claim_form
  • hospital_discharge_paper
  • bvcard
  • id_doc
  • prescription
  • medical_report
  • discharge_report
  • bill
  • surgical_certificate
  • specify_vote
  • test_results
  • medical_examination
  • receipts
  • health_records
  • guarantee_confirmation
  • accident_report
  • death_certificate

pages: Is a list containing index of the pages of the document type.

In the case of extracting information of a document type, data will be an element

{
"info": [xxxx],
}

Invoice - invoice

  • account_bank: This field is a list. Each element contains the following fields:
    • account_no
    • account_no_box
    • account_no_confidence
    • bank
    • bank_box
    • bank_confidence
  • buyer_name
  • buyer_name_box
  • buyer_name_confidence
  • date
  • date_box
  • date_confidence
  • form
  • form_box
  • form_confidence
  • image
  • image_seals
  • image_table
  • invoice_no
  • invoice_no_box
  • invoice_no_confidence
  • lookup_code
  • lookup_code_box
  • lookup_code_confidence
  • lookup_website
  • lookup_website_box
  • lookup_website_confidence
  • payment_method
  • payment_method_box
  • payment_method_confidence
  • purchaser_name
  • purchaser_name_box
  • purchaser_name_confidence
  • serial_no
  • serial_no_box
  • serial_no_confidence
  • sub_total
  • sub_total_box
  • sub_total_confidence
  • supplier
  • supplier_box
  • supplier_confidence
  • supplier_address
  • supplier_address_box
  • supplier_address_confidence
  • table: This field is a list. Each element contains the following fields:
    • value
    • box
    • score
    • label: Can be one of the following values:
      • number
      • description
      • unit
      • quantity
      • unit_price
      • amount_before_tax
      • tax
      • tax_amount
      • amount_total
  • tax_code
  • tax_code_box
  • tax_code_confidence
  • total_amount
  • total_amount_box
  • total_amount_confidence
  • valid_seals
  • vat_amount
  • vat_amount_box
  • vat_amount_confidence
  • vat_rate
  • vat_rate_box
  • vat_rate_confidence

Hospital discharge paper - hospital_discharge_paper

  • address
  • address_box
  • address_confidence
  • department
  • department_box
  • department_confidence
  • diagnose
  • diagnose_box
  • diagnose_confidence
  • gender
  • gender_box
  • gender_confidence
  • hospital_discharge_date
  • hospital_discharge_date_box
  • hospital_discharge_date_confidence
  • hospitalization_date
  • hospitalization_date_box
  • hospitalization_date_confidence
  • icd_10: This field is a list. Each element contains the following fields:
    • icd
    • box
    • score
  • image
  • image_seals
  • medical_facility
  • medical_facility_box
  • medical_facility_confidence
  • patient_name
  • patient_name_box
  • patient_name_confidence
  • pid
  • pid_box
  • pid_confidence
  • treatments
  • treatments_box
  • treatments_confidence
  • valid_seals
  • year_of_birth
  • year_of_birth_box
  • year_of_birth_confidence
  • health_insurance_number
  • health_insurance_number_box
  • health_insurance_number_confidence

Claim form - claim_form

  • account_number
  • account_number_box
  • account_number_confidence
  • bank
  • bank_box
  • bank_confidence
  • beneficiary
  • beneficiary_box
  • beneficiary_confidence
  • cash
  • cash_box
  • cash_confidence
  • claimant
  • claimant_box
  • claimant_confidence
  • claimant_address
  • claimant_address_box
  • claimant_address_confidence
  • claimant_email
  • claimant_email_box
  • claimant_email_confidence
  • claimant_phone
  • claimant_phone_box
  • claimant_phone_confidence
  • date_of_accident
  • date_of_accident_box
  • date_of_accident_confidence
  • diagnose
  • diagnose_box
  • diagnose_confidence
  • email
  • email_box
  • email_confidence
  • id_card
  • id_card_box
  • id_card_confidence
  • image
  • image_seals
  • insure_name
  • insure_name_box
  • insure_name_confidence
  • medical_facility
  • medical_facility_box
  • medical_facility_confidence
  • phone_number
  • phone_number_box
  • phone_number_confidence
  • policy_no
  • policy_no_box
  • policy_no_confidence
  • total_insured_amount
  • total_insured_amount_box
  • total_insured_amount_confidence
  • treatment_method
  • treatment_method_box
  • treatment_method_confidence
  • valid_seals

Bao Viet card - bvcard

  • name
  • name_box
  • name_confidence
  • plan
  • plan_box
  • plan_confidence
  • company
  • company_box
  • company_confidence
  • valid
  • valid_box
  • valid_confidence
  • policy_no
  • policy_no_box
  • policy_no_confidence
  • image

ID document - id_doc

  • address
  • address_box
  • address_confidence
  • dob
  • dob_box
  • dob_confidence
  • gender
  • gender_box
  • gender_confidence
  • image
  • name
  • name_box
  • name_confidence
  • nationality Quốc tịch.
  • nationality_box
  • nationality_confidence

List expense - list_expense

  • address
  • address_box
  • address_confidence
  • diagnosis
  • diagnosis_box
  • diagnosis_confidence
  • hospital_discharge_date
  • hospital_discharge_date_box
  • hospital_discharge_date_confidence
  • hospitalization_date
  • hospitalization_date_box
  • hospitalization_date_confidence
  • icd_10: This field is a list. Each element contains the following fields:
    • icd
    • box
    • score
  • image
  • image_list
  • mage_seals
  • medical_facility
  • medical_facility_box
  • medical_facility_confidence
  • patient_name
  • patient_name_box
  • patient_name_confidence
  • pid
  • pid_box
  • pid_confidence
  • table: Includes the following fields:
    • image_table
    • page_table
    • info_table: This field is a list. Each element in this field has the following structure:
[
[json_0, json_1, json_2, json_3], // Represents for each row
[...],
...
] // Representation of 1 table

And each of these json has the following structure:

{
"value": string,
"score": float,
"box": array // [left, top, right, bottom]
{
  • table_date
  • table_date_box
  • table_date_confidence
  • table_number
  • table_number_box
  • table_number_confidence
  • total_payment
  • total_payment_box
  • total_payment_confidence
  • valid_seals

Prescription - prescription

  • address
  • address_box
  • address_confidence
  • diagnose
  • diagnose_box
  • diagnose_confidence
  • drug_info: This field is a list. Each element contains the following fields:
    • box
    • drug
    • quanlity
    • score
  • gender
  • gender_box
  • gender_confidence
  • icd_10: This field is a list. Each element contains the following fields:
    • icd
    • box
    • score
  • image
  • image_drug
  • image_seals
  • medical_facility
  • medical_facility_box
  • medical_facility_confidence
  • patient_name
  • patient_name_box
  • patient_name_confidence
  • pid
  • pid_box
  • pid_confidence
  • prescription_date
  • prescription_date_box
  • prescription_date_confidence
  • valid_seals
  • year_of_birth
  • year_of_birth_box
  • year_of_birth_confidence

Guarantee confirmation - guarantee_confirmation

  • claim_form_no
  • claim_form_no_box
  • claim_form_no_confidence
  • conclusion
  • conclusion_box
  • conclusion_confidence
  • condition
  • condition_box
  • condition_confidence
  • created_date
  • created_date_box
  • created_date_confidence
  • date_of_consultation
  • date_of_consultation_box
  • date_of_consultation_confidence
  • dob
  • dob_box
  • dob_confidence
  • from_date
  • from_date_box
  • from_date_confidence
  • guaranteed_expenses
  • guaranteed_expenses_box
  • guaranteed_expenses_confidence
  • id_no
  • id_no_box
  • id_no_confidence
  • image
  • image_seals
  • insured
  • insured_box
  • insured_confidence
  • insured_confirmation
  • insured_confirmation_box
  • insured_confirmation_confidence
  • medical_expenses
  • medical_expenses_box
  • medical_expenses_confidence
  • medical_facility
  • medical_facility_box
  • medical_facility_confidence
  • paid_by_insured
  • paid_by_insured_box
  • paid_by_insured_confidence
  • period_of_insurance
  • period_of_insurance_box
  • period_of_insurance_confidence
  • policy_holder
  • policy_holder_box
  • policy_holder_confidence
  • policy_no
  • policy_no_box
  • policy_no_confidence
  • rehabilitation_type
  • rehabilitation_type_box
  • rehabilitation_type_confidence
  • to_date
  • to_date_box
  • to_date_confidence
  • valid_seals
  • warranty_notes
  • warranty_notes_box
  • warranty_notes_confidence

Surgical certificate - surgical_certificate

  • address
  • address_box
  • address_confidence
  • anesthesiologist
  • anesthesiologist_box
  • anesthesiologist_confidence
  • anesthetic_method
  • anesthetic_method_box
  • anesthetic_method_confidence
  • department
  • department_box
  • department_confidence
  • diagnose
  • diagnose_box
  • diagnose_confidence
  • dob
  • dob_box
  • dob_confidence
  • gender
  • gender_box
  • gender_confidence
  • hospital_discharge_date
  • hospital_discharge_date_box
  • hospital_discharge_date_confidence
  • hospitalization_date
  • hospitalization_date_box
  • hospitalization_date_confidence
  • image
  • image_seals
  • medical_facility
  • medical_facility_box
  • medical_facility_confidence
  • patient_name
  • patient_name_box
  • patient_name_confidence
  • pid
  • pid_box
  • pid_confidence
  • surgical_day
  • surgical_day_box
  • surgical_doctor
  • surgical_day_confidence
  • surgical_doctor_box
  • surgical_doctor_confidence
  • valid_seals

Discharge report - discharge_report

  • address
  • address_box
  • address_confidence
  • definitive_diagnosis
  • definitive_diagnosis_box
  • definitive_diagnosis_confidence
  • department
  • department_box
  • department_confidence
  • discharge_date
  • discharge_date_box
  • discharge_date_confidence
  • dob
  • dob_box
  • dob_confidence
  • followup_treatment_plan
  • followup_treatment_plan_box
  • followup_treatment_plan_confidence
  • gender
  • gender_box
  • gender_confidence
  • hospital_discharge_status
  • hospital_discharge_status_box
  • hospital_discharge_status_confidence
  • hospitalization_date
  • hospitalization_date_box
  • hospitalization_date_confidence
  • hospitalization_reason
  • hospitalization_reason_box
  • hospitalization_reason_confidence
  • image
  • image_seals
  • pathological_process
  • pathological_process_box
  • pathological_process_confidence
  • patient_name
  • patient_name_box
  • patient_name_confidence
  • pid
  • pid_box
  • pid_confidence
  • preliminary_diagnosis
  • preliminary_diagnosis_box
  • preliminary_diagnosis_confidence
  • prescribed_medicines
  • prescribed_medicines_box
  • prescribed_medicines_confidence
  • treatment_method
  • treatment_method_box
  • treatment_method_confidence
  • valid_seals

Medical report - medical_report

  • address
  • address_box
  • address_confidence
  • clinical_examination
  • clinical_examination_box
  • clinical_examination_confidence
  • date_of_examination
  • date_of_examination_box
  • date_of_examination_confidence
  • date_of_reexamination
  • date_of_reexamination_box
  • date_of_reexamination_confidence
  • dob
  • dob_box
  • dob_confidence
  • gender
  • gender_box
  • gender_confidence
  • icd
  • icd_box
  • icd_confidence
  • image
  • image_seals
  • medical_history
  • medical_history_box
  • medical_history_confidence
  • medical_tests
  • medical_tests_box
  • medical_tests_confidence
  • pathological_process
  • pathological_process_box
  • pathological_process_confidence
  • patient_name
  • patient_name_box
  • patient_name_confidence
  • pid
  • pid_box
  • pid_confidence
  • preliminary_diagnosis
  • preliminary_diagnosis_box
  • preliminary_diagnosis_confidence
  • symptom
  • symptom_box
  • symptom_confidence
  • treatment_method
  • treatment_method_box
  • treatment_method_confidence
  • valid_seals

Specify vote - specify_vote

  • address
  • address_box
  • address_confidence
  • designated_date
  • designated_date_box
  • designated_date_confidence
  • designated_doctor
  • designated_doctor_box
  • designated_doctor_confidence
  • designated_place
  • designated_place_box
  • designated_place_confidence
  • dob
  • dob_box
  • dob_confidence
  • gender
  • gender_box
  • gender_confidence
  • image
  • image_seals
  • medical_facility
  • medical_facility_box
  • medical_facility_confidence
  • patient_name
  • patient_name_box
  • patient_name_confidence
  • pid
  • pid_box
  • pid_confidence
  • preliminary_diagnosis
  • preliminary_diagnosis_box
  • preliminary_diagnosis_confidence
  • test_place
  • test_place_box
  • test_place_confidence
  • valid_seals

Test results - test_results

  • address
  • address_box
  • address_confidence
  • designated_date
  • designated_date_box
  • designated_date_confidence
  • designated_doctor
  • designated_doctor_box
  • designated_doctor_confidence
  • dob
  • dob_box
  • dob_confidence
  • gender
  • gender_box
  • gender_confidence
  • image
  • image_seals
  • medical_facility
  • medical_facility_box
  • medical_facility_confidence
  • patient_name
  • patient_name_box
  • patient_name_confidence
  • pid
  • pid_box
  • pid_confidence
  • preliminary_diagnosis
  • preliminary_diagnosis_box
  • preliminary_diagnosis_confidence
  • test_date
  • test_date_box
  • test_date_confidence
  • valid_seals

Accident report - accident_report

  • name
  • name_box
  • name_confidence
  • address
  • address_box
  • address_confidence
  • date_of_accident
  • date_of_accident_box
  • date_of_accident_confidence
  • location
  • location_box
  • location_confidence
  • image
  • image_seals
  • valid_seals

Bill - bill

  • address
  • address_box
  • address_confidence
  • date
  • date_box
  • date_confidence
  • dob
  • dob_box
  • dob_confidence
  • gender
  • gender_box
  • gender_confidence
  • image
  • image_seals
  • insure_name
  • insure_name_box
  • insure_name_confidence
  • medical_facility
  • medical_facility_box
  • medical_facility_confidence
  • total_amount
  • total_amount_box
  • total_amount_confidence
  • valid_seals

Receipts - receipts

  • address
  • address_box
  • address_confidence
  • date
  • date_box
  • date_confidence
  • dob
  • dob_box
  • dob_confidence
  • gender
  • gender_box
  • gender_confidence
  • image
  • image_seals
  • insure_name
  • insure_name_box
  • insure_name_confidence
  • medical_facility
  • medical_facility_box
  • medical_facility_confidence
  • total_amount
  • total_amount_box
  • total_amount_confidence
  • valid_seals

Health records - health_records

  • dob
  • dob_box
  • dob_confidence
  • gender
  • gender_box
  • gender_confidence
  • image
  • image_seals
  • insure_name
  • insure_name_box
  • insure_name_confidence
  • medical_facility
  • medical_facility_box
  • medical_facility_confidence
  • valid_seals

Medical examination - medical_examination

  • address
  • address_box
  • address_confidence
  • clinical_examination
  • clinical_examination_box
  • clinical_examination_confidence
  • conclusion
  • conclusion_box
  • conclusion_confidence
  • date_of_examination
  • date_of_examination_box
  • date_of_examination_confidence
  • definitive_diagnosis
  • definitive_diagnosis_box
  • definitive_diagnosis_confidence
  • dob
  • dob_box
  • dob_confidence
  • gender
  • gender_box
  • gender_confidence
  • icd_10: This field is a list. Each element contains the following fields:
    • icd
    • box
    • score
  • image
  • image_seals
  • medical_facility
  • medical_facility_box
  • medical_facility_confidence
  • medical_history
  • medical_history_box
  • medical_history_confidence
  • pathological_process
  • pathological_process_box
  • pathological_process_confidence
  • patient_name
  • patient_name_box
  • patient_name_confidence
  • pid
  • pid_box
  • pid_confidence
  • preliminary_diagnosis
  • preliminary_diagnosis_box
  • preliminary_diagnosis_confidence
  • symptom
  • symptom_box
  • symptom_confidence
  • valid_seals

Death certificate - death_certificate

  • number
  • number_box
  • number_confidence
  • number_book
  • number_book_box
  • number_book_confidence Độ tin cậy quyển số.
  • name
  • name_box
  • name_confidence
  • image
  • gender
  • gender_box
  • gender_confidence
  • dob
  • dob_box
  • dob_confidence
  • ethnicity
  • ethnicity_box
  • ethnicity_confidence
  • nationality
  • nationality_box
  • nationality_confidence
  • address
  • address_box
  • address_confidence
  • id_number
  • id_number_box
  • id_number_confidence
  • death_time
  • death_time_box
  • death_time_confidence
  • place_of_death
  • place_of_death_box
  • place_of_death_confidence
  • reason
  • reason_box
  • reason_confidence
  • death_certificate
  • death_certificate_box
  • death_certificate_confidence
  • authority
  • authority_box
  • authority_confidence
  • applied_date
  • applied_date_box
  • applied_date_confidence
  • regis_place
  • regis_place_box
  • regis_place_confidence
  • regis_date
  • regis_date_box
  • regis_date_confidence
  • note
  • note_box
  • note_confidence
  • person_in_charge
  • person_in_charge_box
  • person_in_charge_confidence
  • person_signed
  • person_signed_box
  • person_signed_confidence
  • death_registration_book
  • death_registration_book_box
  • death_registration_book_confidence
  • date
  • date_box
  • date_confidence
  • person_signed_copy
  • person_signed_copy_box
  • person_signed_copy_confidence

Error code table:

CodeMessage
0Success
1The photo does not contain content
2Url is unavailable
3Incorrect image format
4Out of requests
5Incorrect api_key or api_secret
6Incorrect format type