{
    "schema_version": "1.0",
    "status": "PARTIAL",
    "phase": "H11.0-P11.1-R45-P0",
    "title": "Revenue Performance Baseline and Query Profiling",
    "generated_at": "2026-07-26T06:35:49+03:00",
    "hospital": "NJCH",
    "year": 2026,
    "compare_year": 2025,
    "iterations": 1,
    "revenue_source_scans_in_current_controller": 4,
    "profit_loss_queries_in_current_controller": 1,
    "total_primary_query_calls_in_current_controller": 5,
    "use_revenue_mv_configured": false,
    "timings": {
        "total_revenue": {
            "samples_ms": [
                33.194
            ],
            "min_ms": 33.194,
            "max_ms": 33.194,
            "avg_ms": 33.194,
            "rows": null,
            "status": "ERROR"
        },
        "cash_revenue": {
            "samples_ms": [
                2.085
            ],
            "min_ms": 2.085,
            "max_ms": 2.085,
            "avg_ms": 2.085,
            "rows": null,
            "status": "ERROR"
        },
        "insurance_revenue": {
            "samples_ms": [
                1.984
            ],
            "min_ms": 1.984,
            "max_ms": 1.984,
            "avg_ms": 1.984,
            "rows": null,
            "status": "ERROR"
        },
        "moh_revenue": {
            "samples_ms": [
                2.103
            ],
            "min_ms": 2.103,
            "max_ms": 2.103,
            "avg_ms": 2.103,
            "rows": null,
            "status": "ERROR"
        },
        "profit_loss": {
            "samples_ms": [
                168.41
            ],
            "min_ms": 168.41,
            "max_ms": 168.41,
            "avg_ms": 168.41,
            "rows": 12,
            "status": "OK"
        }
    },
    "errors": {
        "total_revenue": "SQLSTATE[HY000]: General error: 979 OCIStmtExecute: ORA-00979: not a GROUP BY expression\n (ext\\pdo_oci\\oci_statement.c:157)",
        "cash_revenue": "SQLSTATE[HY000]: General error: 979 OCIStmtExecute: ORA-00979: not a GROUP BY expression\n (ext\\pdo_oci\\oci_statement.c:157)",
        "insurance_revenue": "SQLSTATE[HY000]: General error: 979 OCIStmtExecute: ORA-00979: not a GROUP BY expression\n (ext\\pdo_oci\\oci_statement.c:157)",
        "moh_revenue": "SQLSTATE[HY000]: General error: 979 OCIStmtExecute: ORA-00979: not a GROUP BY expression\n (ext\\pdo_oci\\oci_statement.c:157)"
    },
    "oracle_diagnostics": {
        "status": "AVAILABLE",
        "objects": [
            {
                "table_name": "T_INP_OUTP_REVENUE_BATCH",
                "num_rows": "12451835",
                "blocks": "743582",
                "last_analyzed": "26-JUL-26"
            }
        ],
        "indexes": [
            {
                "index_name": "IDX_INP_OUTP_REVENUE_BATCH",
                "table_name": "T_INP_OUTP_REVENUE_BATCH",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "column_name": "PATFINANACCOUNT",
                "column_position": "1"
            },
            {
                "index_name": "IDX_INP_OUTP_REVENUE_BATCH",
                "table_name": "T_INP_OUTP_REVENUE_BATCH",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "column_name": "TRANSACTION_DATE",
                "column_position": "2"
            },
            {
                "index_name": "IDX_REVENUE_BATCH_PERF",
                "table_name": "T_INP_OUTP_REVENUE_BATCH",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "column_name": "VISIT_END_DATE",
                "column_position": "1"
            },
            {
                "index_name": "IDX_REVENUE_BATCH_PERF",
                "table_name": "T_INP_OUTP_REVENUE_BATCH",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "column_name": "SERVICE_CODE",
                "column_position": "2"
            },
            {
                "index_name": "IDX_REV_BATCH_YEAR_MONTH_AMT",
                "table_name": "T_INP_OUTP_REVENUE_BATCH",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "column_name": "YEARID",
                "column_position": "1"
            },
            {
                "index_name": "IDX_REV_BATCH_YEAR_MONTH_AMT",
                "table_name": "T_INP_OUTP_REVENUE_BATCH",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "column_name": "VISIT_MONTH",
                "column_position": "2"
            },
            {
                "index_name": "IDX_REV_BATCH_YEAR_MONTH_AMT",
                "table_name": "T_INP_OUTP_REVENUE_BATCH",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "column_name": "CREDIT_VALUE",
                "column_position": "3"
            },
            {
                "index_name": "IDX_REV_BATCH_YEAR_MONTH_AMT",
                "table_name": "T_INP_OUTP_REVENUE_BATCH",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "column_name": "CASH_VALUE",
                "column_position": "4"
            },
            {
                "index_name": "YEARID_INX",
                "table_name": "T_INP_OUTP_REVENUE_BATCH",
                "uniqueness": "NONUNIQUE",
                "status": "VALID",
                "column_name": "YEARID",
                "column_position": "1"
            }
        ],
        "mv": [
            {
                "mview_name": "MV_REVENUE_MONTHLY",
                "staleness": "NEEDS_COMPILE",
                "compile_state": "NEEDS_COMPILE",
                "last_refresh_type": "COMPLETE",
                "last_refresh_date": "05-JUL-26"
            }
        ],
        "errors": [],
        "mv_config_enabled": false,
        "mv_present": true
    },
    "year_comparison_contract": {
        "mode": "CURRENT_YEAR_FAIR_COMPARISON",
        "current_year": 2026,
        "current_month_excluded": 7,
        "last_complete_month": 6,
        "comparison_months": [
            1,
            2,
            3,
            4,
            5,
            6
        ],
        "period_label": "January through June",
        "rule_en": "When either selected year is the current year, compare only completed months before the current month, using the same months in both years.",
        "rule_ar": "عندما تكون إحدى سنتي المقارنة هي السنة الحالية، تتم مقارنة الأشهر المكتملة السابقة للشهر الحالي فقط مع نفس الأشهر في السنة الأخرى، مع استبعاد الشهر الحالي غير المكتمل."
    },
    "write_operations": "NONE"
}