HIPAASOC2

Process UB-04 Institutional Claim Extractor — HIPAA Compliant

Healthcare organizations process thousands of documents daily. Manual processing delays patient care and increases compliance risk.

138
Fields Extracted
300s
Max Processing

What This Template Does

AI-powered extraction using gemini-2.5-flash. Part of 113 production-ready templates.

Capabilities

  • Healthcare Extraction
  • Institutional Claims
  • Ub 04 Extraction
  • Claims
  • Ub 04

Output Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "UB-04 Institutional Claim Extraction Schema",
  "description": "Schema for extracted institutional/hospital claim data from UB-04 (CMS-1450) forms",
  "type": "object",
  "required": [
    "document_type",
    "provider_info",
    "patient_info",
    "revenue_lines",
    "diagnosis_codes"
  ],
  "properties": {
    "document_type": {
      "type": "string",
      "const": "ub_04",
      "description": "Document type identifier
...

Quick Start

$ pip install doclayer
$ doclayer process document.pdf --agent healthcare.ub-04

See It In Action

Real extraction example showing input document and structured output.

Input Document
===============================================================================
                              UB-04 (CMS-1450)
                         INSTITUTIONAL CLAIM FORM
===============================================================================

PAGE 1 OF 1                                    CREATION DATE: 12/15/2024

===============================================================================
                    PROVIDER INFORMATION (FL 1-5)
======================================
Extracted Data
{
  "document_type": "ub_04",
  "provider_info": {
    "fl_1_provider_name": "Midwest Regional Medical Center",
    "fl_1_address": {
      "street": "2500 Healthcare Drive",
      "city": "Springfield",
      "state": "IL",
      "zip": "62701"
    },
    "fl_2_pay_to_name": null,
    "fl_2_pay_to_address": null,
    "fl_3a_pat_control_number": "MR-2024-885521",
    "fl_3b_med_rec_number": "MRN-445566778",
    "fl_4_type_of_bill": "0111",
    "fl_5_fed_tax_id": "37-XXXXXXX",
    "fl_56_npi": "1987654321",
    "fl_57_other_provider_id": "IL-HSP-0012345"
  },
  "type_of_bill_breakdown": {
    "first_digit": "1 - Hospital",
    "second_digit": "1 - Inpatient (Part A)",
    "third_digit": "1 - Admit Through Discharge",
    "description": "Hospital Inpatient - Admit Through Discharge"
  },
  "patient_info": {
    "fl_8a_patient_id": "ID-998877665",
    "fl_8b_patient_name": "Anderson, James Michael",
    "fl_9_patient_address": {
      "street": "1847 Maple Street",
      "city": "Springfield",
      "state": "IL",
      "zip": "62704",
      "country": "USA"
    },
    "fl_10_birthdate": "1958-03-25",
    "fl_11_sex": "M",
    "fl_12_admission_date": "2024-12-08",
    "fl_13_admission_hour": "14",
    "fl_14_admission_type": "1",
    "fl_15_admission_source": "7",
    "fl_16_discharge_hour": "11",
    "fl_17_discharge_status": "01"
  },
  "condition_codes": {
    "fl_18_28": [
      "P7",
      "02"
    ]
  },
  "occurrence_codes": {
    "fl_31_34": [
      {
        "code": "11",
        "date": "2024-12-08"
      },
      {
        "code": "17",
        "date": "2024-12-08"
      }
    ]
  },
  "occurrence_span_codes": {
    "fl_35_36": []
  },
  "value_codes": {
    "fl_39_41": [
      {
        "code": "01",
        "amount": "$0.00"
      },
      {
        "code": "06",
        "amount": "$2,500.00"
      }
    ]
  },
  "revenue_lines": [
    {
      "fl_42_rev_code": "0121",
      "fl_43_description": "Room-Board/Semi",
      "fl_44_hcpcs_cpt": null,
      "fl_44_modifiers": [],
      "fl_45_service_date": null,
      "fl_46_units": 7,
      "fl_47_total_charges": "$14,000.00",
      "fl_48_non_covered": "$0.00"
    },
    {
      "fl_42_rev_code": "0250",
      "fl_43_description": "Pharmacy",
      "fl_44_hcpcs_cpt": null,
      "fl_44_modifiers": [],
      "fl_45_service_date": null,
      "fl_46_units": 1,
      "fl_47_total_charges": "$3,847.50",
      "fl_48_non_covered": "$0.00"
    },
    {
      "fl_42_rev_code": "0258",
      "fl_43_description": "IV Solutions",
      "fl_44_hcpcs_cpt": null,
      "fl_44_modifiers": [],
      "fl_45_service_date": null,
      "fl_46_units": 1,
      "fl_47_total_charges": "$1,245.00",
      "fl_48_non_covered": "$0.00"
    },
    {
      "fl_42_rev_code": "0270",
      "fl_43_description": "Med-Sur Supplies",
      "fl_44_hcpcs_cpt": null,
      "fl_44_modifiers": [],
      "fl_45_service_date": null,
      "fl_46_units": 1,
      "fl_47_total_charges": "$892.75",
      "fl_48_non_covered": "$0.00"
    },
    {
      "fl_42_rev_code": "0300",
      "fl_43_description": "Laboratory",
      "fl_44_hcpcs_cpt": null,
      "fl_44_modifiers": [],
      "fl_45_service_date": null,
      "fl_46_units": 1,
      "fl_47_total_charges": "$2,156.00",
      "fl_48_non_covered": "$0.00"
    },
    {
      "fl_42_rev_code": "0320",
      "fl_43_description": "DX X-Ray",
      "fl_44_hcpcs_cpt": "71046",
      "fl_44_modifiers": [],
      "fl_45_service_date": null,
      "fl_46_units": 2,
      "fl_47_total_charges": "$845.00",
      "fl_48_non_covered": "$0.00"
    },
    {
      "fl_42_rev_code": "0351",
      "fl_43_description": "CT Scan-Head",
      "fl_44_hcpcs_cpt": "70450",
      "fl_44_modifiers": [],
      "fl_45_service_date": null,
      "fl_46_units": 1,
      "fl_47_total_charges": "$2,450.00",
      "fl_48_non_covered": "$0.00"
    },
    {
      "fl_42_rev_code": "0730",
      "fl_43_description": "EKG/ECG",
      "fl_44_hcpcs_cpt": "93000",
      "fl_44_modifiers": [],
      "fl_45_service_date": null,
      "fl_46_units": 1,
      "fl_47_total_charges": "$425.00",
      "fl_48_non_covered": "$0.00"
    },
    {
      "fl_42_rev_code": "0410",
      "fl_43_description": "Respiratory Svc",
      "fl_44_hcpcs_cpt": "94640",
      "fl_44_modifiers": [],
      "fl_45_service_date": null,
      "fl_46_units": 8,
      "fl_47_total_charges": "$1,680.00",
      "fl_48_non_covered": "$0.00"
    },
    {
      "fl_42_rev_code": "0272",
      "fl_43_description": "Sterile Supply",
      "fl_44_hcpcs_cpt": null,
      "fl_44_modifiers": [],
      "fl_45_service_date": null,
      "fl_46_units": 1,
      "fl_47_total_charges": "$567.25",
      "fl_48_non_covered": "$0.00"
    },
    {
      "fl_42_rev_code": "0001",
      "fl_43_description": "Total Charges",
      "fl_44_hcpcs_cpt": null,
      "fl_44_modifiers": [],
      "fl_45_service_date": null,
      "fl_46_units": null,
      "fl_47_total_charges": "$28,108.50",
      "fl_48_non_covered": "$0.00"
    }
  ],
  "payer_info": {
    "primary": {
      "fl_50_payer_name": "Medicare Part A",
      "fl_51_health_plan_id": "00308",
      "fl_52_release_info": "Y",
      "fl_53_assignment": "Y",
      "fl_54_prior_payments": "$0.00",
      "fl_55_est_amount_due": "$22,486.80",
      "fl_58_insured_name": "Anderson, James M",
      "fl_59_relationship": "01",
      "fl_60_subscriber_id": "1EG4-TE5-MK72",
      "fl_61_group_name": "Medicare",
      "fl_62_insurance_group": null,
      "fl_63_treatment_auth": null,
      "fl_64_document_control": null,
      "fl_65_employer_name": "Retired"
    },
    "secondary": {
      "fl_50_payer_name": "AARP Medigap",
      "fl_51_health_plan_id": "62308",
      "fl_58_insured_name": "Anderson, James M",
      "fl_60_subscriber_id": "AARP-8899776655"
    },
    "tertiary": null
  },
  "diagnosis_codes": {
    "fl_66_icd_version": "0",
    "principal_diagnosis": {
      "fl_67_code": "J18.9",
      "fl_67a_poa": "Y"
    },
    "other_diagnoses": [
      {
        "code": "J96.01",
        "poa": "N"
      },
      {
        "code": "I10",
        "poa": "Y"
      },
      {
        "code": "E11.9",
        "poa": "Y"
      },
      {
        "code": "J44.1",
        "poa": "Y"
      }
    ],
    "fl_69_admitting_diagnosis": "J18.9",
    "fl_70_patient_reason": [
      "R05.9",
      "R06.02",
      "R50.9"
    ],
    "fl_71_pps_code": "193",
    "fl_72_external_cause": []
  },
  "procedure_codes": {
    "fl_74_principal_procedure": null,
    "fl_74_other_procedures": []
  },
  "attending_provider": {
    "fl_76_npi": "1122334455",
    "fl_76_qualifier": null,
    "fl_76_id": null,
    "fl_76_name": "Chen, David L MD"
  },
  "other_providers": {
    "operating": null,
    "other_1": {
      "fl_78_79_npi": "2233445566",
      "fl_78_79_qualifier": "DN",
      "fl_78_79_name": "Patel, Meera K MD"
    }
  },
  "remarks": {
    "fl_80_remarks": "Patient admitted via ER with community-acquired pneumonia. Responded well to IV antibiotics. Discharged home in stable condition with oral antibiotics and follow-up in 7 days."
  },
  "totals": {
    "fl_47_total_charges": "$28,108.50",
    "fl_48_total_non_covered": "$0.00",
    "page_of": "1 of 1",
    "creation_date": "2024-12-15"
  },
  "calculated_fields": {
    "total_revenue_lines": 10,
    "total_covered_charges": "$28,108.50",
    "length_of_stay": 7
  },
  "validation": {
    "tob_valid": true,
    "required_fields_present": true,
    "revenue_codes_valid": true,
    "icd_codes_valid": true,
    "npi_format_valid": true,
    "charges_sum_correctly": true,
    "dates_logical": true,
    "poa_required_present": true
  }
}

Example UB-04 hospital claim for inpatient stay with multiple procedures and revenue codes. Demonstrates extraction of institutional billing data, length of stay, and facility charges.

Frequently Asked Questions

What documents can UB-04 Institutional Claim Extractor process?

The UB-04 Institutional Claim Extractor template processes healthcare documents including various formats and layouts. See the instructions for specific document types supported.

How accurate is the UB-04 Institutional Claim Extractor extraction?

The UB-04 Institutional Claim Extractor template uses Gemini 2.5 Flash for high-accuracy extraction. Results include confidence scores for each field.

Can I customize the UB-04 Institutional Claim Extractor template?

Yes, you can modify the extraction schema, add custom fields, or adjust the instructions to match your specific requirements.

Start Extracting Data Today

Process your first document in under 5 minutes. No credit card required.