2018-04-17 08:38:28.571 INFO estContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [gov.va.ccrs.brengine.BatchProcessorAllRulesTest], using SpringBootContextLoader
2018-04-17 08:38:28.571 INFO AbstractContextLoader  - Could not detect default resource locations for test class [gov.va.ccrs.brengine.BatchProcessorAllRulesTest]: no resource found for suffixes {-context.xml, Context.groovy}.
2018-04-17 08:38:28.571 INFO nfigContextLoaderUtils - Could not detect default configuration classes for test class [gov.va.ccrs.brengine.BatchProcessorAllRulesTest]: BatchProcessorAllRulesTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
2018-04-17 08:38:28.840 INFO estContextBootstrapper - Found @SpringBootConfiguration gov.va.ccrs.brengine.BrEngineApplication for test class gov.va.ccrs.brengine.BatchProcessorAllRulesTest
2018-04-17 08:38:29.024 INFO estContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
2018-04-17 08:38:29.040 INFO estContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@4d0f2471, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@7133da86, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@3232a28a, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@73e22a3d, org.springframework.test.context.support.DirtiesContextTestExecutionListener@47faa49c, org.springframework.test.context.transaction.TransactionalTestExecutionListener@28f2a10f, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@f736069, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@6da21078, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@7fee8714, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@4229bb3f, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@56cdfb3b, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@2b91004a]
2018-04-17 08:38:29.488 INFO hProcessorAllRulesTest - Starting BatchProcessorAllRulesTest on JX574H2 with PID 19072 (started by DWei in C:\Users\DWei\CCRS-BUSRULES\brengine)
2018-04-17 08:38:29.488 INFO hProcessorAllRulesTest - The following profiles are active: ut
2018-04-17 08:38:29.523 INFO nfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@13bc8645: startup date [Tue Apr 17 08:38:29 EDT 2018]; root of context hierarchy
2018-04-17 08:38:31.034 INFO ultListableBeanFactory - Overriding bean definition for bean 'authenticationManager' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=apiSecurityConfig; factoryMethodName=authenticationManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [gov/va/ccrs/brengine/security/ApiSecurityConfig.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=securityConfig; factoryMethodName=authenticationManager; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [gov/va/ccrs/brengine/security/SecurityConfig.class]]
2018-04-17 08:38:31.216 INFO ultListableBeanFactory - Overriding bean definition for bean 'dataSource' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Generic; factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Generic.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari; factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]]
2018-04-17 08:38:32.538 INFO anPostProcessorChecker - Bean 'org.springframework.kafka.annotation.KafkaBootstrapConfiguration' of type [org.springframework.kafka.annotation.KafkaBootstrapConfiguration$$EnhancerBySpringCGLIB$$bf14729] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-04-17 08:38:32.575 INFO anPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$383f35a6] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-04-17 08:38:33.340 INFO HikariDataSource       - HikariPool-1 - Starting...
2018-04-17 08:38:33.662 INFO HikariDataSource       - HikariPool-1 - Start completed.
2018-04-17 08:38:33.815 INFO tityManagerFactoryBean - Building JPA container EntityManagerFactory for persistence unit 'default'
2018-04-17 08:38:35.320 WARN RootClass              - HHH000038: Composite-id class does not override equals(): gov.va.ccrs.brengine.seoc.SeocProcedure
2018-04-17 08:38:35.321 WARN RootClass              - HHH000039: Composite-id class does not override hashCode(): gov.va.ccrs.brengine.seoc.SeocProcedure
2018-04-17 08:38:36.114 INFO tityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default'
2018-04-17 08:38:37.269 INFO HoconUtils             - Loading config file from C:\Users\DWei\CCRS-BUSRULES\brengine\bin\main\rules-config.conf
2018-04-17 08:38:38.167 WARN User                   - User.withDefaultPasswordEncoder() is considered unsafe for production and is only intended for sample applications.
2018-04-17 08:38:38.334 WARN User                   - User.withDefaultPasswordEncoder() is considered unsafe for production and is only intended for sample applications.
2018-04-17 08:38:39.209 INFO ultSecurityFilterChain - Creating filter chain: Ant [pattern='/fetchDecisions/**'], [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@573870cb, org.springframework.security.web.context.SecurityContextPersistenceFilter@323efafe, org.springframework.security.web.header.HeaderWriterFilter@2adc1e84, org.springframework.security.web.csrf.CsrfFilter@43778371, org.springframework.security.web.authentication.logout.LogoutFilter@2c5708e7, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@18ac4af6, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@2cc34cd5, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@4f7ba0af, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@5b88af70, org.springframework.security.web.session.SessionManagementFilter@45b8bbbf, org.springframework.security.web.access.ExceptionTranslationFilter@126254ec, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@ad5cffa]
2018-04-17 08:38:39.251 INFO ultSecurityFilterChain - Creating filter chain: org.springframework.security.web.util.matcher.AnyRequestMatcher@1, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@8b1202a, org.springframework.security.web.context.SecurityContextPersistenceFilter@708f7386, org.springframework.security.web.header.HeaderWriterFilter@5178345d, org.springframework.security.web.authentication.logout.LogoutFilter@3dd750ba, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@2c154508, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@36cf16a6, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@377e90b0, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@27b490de, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@34bddf43, org.springframework.security.web.session.SessionManagementFilter@7b2d58e6, org.springframework.security.web.access.ExceptionTranslationFilter@2a6dbb7c, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@2bd4780c]
2018-04-17 08:38:39.421 INFO AbstractContextSource  - Property 'userDn' not set - anonymous context will be used for read-write operations
2018-04-17 08:38:40.507 INFO aultLifecycleProcessor - Starting beans in phase 2147483547
2018-04-17 08:38:40.523 INFO ationBeanPostProcessor - No TaskScheduler/ScheduledExecutorService bean found for scheduled processing
2018-04-17 08:38:40.545 INFO hProcessorAllRulesTest - Started BatchProcessorAllRulesTest in 11.457 seconds (JVM running for 12.771)
2018-04-17 08:38:40.597 INFO ScriptUtils            - Executing SQL script from class path resource [sql/create_tables_h2.sql]
2018-04-17 08:38:40.793 INFO ScriptUtils            - Executed SQL script from class path resource [sql/create_tables_h2.sql] in 193 ms.
2018-04-17 08:38:40.793 INFO ScriptUtils            - Executing SQL script from class path resource [sql/populate_claim.sql]
2018-04-17 08:38:40.880 INFO ScriptUtils            - Executed SQL script from class path resource [sql/populate_claim.sql] in 87 ms.
2018-04-17 08:38:40.881 INFO ScriptUtils            - Executing SQL script from class path resource [sql/populate_edi_nonconforming.sql]
2018-04-17 08:38:40.887 INFO ScriptUtils            - Executed SQL script from class path resource [sql/populate_edi_nonconforming.sql] in 6 ms.
Hibernate: 
    select
        batchinfo0_.etl_batch_id as etl_batc1_16_0_,
        batchinfo0_.batch_status as batch_st2_16_0_,
        batchinfo0_.last_updated_user as last_upd3_16_0_,
        batchinfo0_.end_date_time as end_date4_16_0_,
        batchinfo0_.source_system as source_s5_16_0_,
        batchinfo0_.last_updated_date as last_upd6_16_0_ 
    from
        claim_batch_log batchinfo0_ 
    where
        batchinfo0_.etl_batch_id=?
Hibernate: 
    /* insert gov.va.ccrs.brengine.batchprocessing.ProcessingTracker
        */ insert 
        into
            rules_batch_log
            (rules_batch_log_key, etl_batch_id, claim_type, engine_version, error, end_date_time, hostname, resume_mode, last_updated_user, number_of_claims, number_of_failures, number_of_lines, number_of_processed_claims, number_of_processed_lines, number_of_waiting_for_data, rule_names, environment_name, start_date_time, status, last_updated_date_time) 
        values
            (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: 
    /* load gov.va.ccrs.brengine.batchprocessing.BatchInfo */ select
        batchinfo0_.etl_batch_id as etl_batc1_16_0_,
        batchinfo0_.batch_status as batch_st2_16_0_,
        batchinfo0_.last_updated_user as last_upd3_16_0_,
        batchinfo0_.end_date_time as end_date4_16_0_,
        batchinfo0_.source_system as source_s5_16_0_,
        batchinfo0_.last_updated_date as last_upd6_16_0_ 
    from
        claim_batch_log batchinfo0_ 
    where
        batchinfo0_.etl_batch_id=?
Hibernate: 
    /* update
        gov.va.ccrs.brengine.batchprocessing.BatchInfo */ update
            claim_batch_log 
        set
            batch_status=?,
            last_updated_user=?,
            end_date_time=?,
            source_system=?,
            last_updated_date=? 
        where
            etl_batch_id=?
2018-04-17 08:38:41.221 INFO ncExecutionInterceptor - No task executor bean found for async processing: no bean of type TaskExecutor and no bean named 'taskExecutor' either
2018-04-17 08:38:41.227 INFO BatchProcessor         - Starting processing of batchId 'pharm_batch_1'
2018-04-17 08:38:41.231 INFO tationBasedRuleFactory - Found the following rule beans annotated with gov.va.ccrs.brengine.rule.annotation.RuleFactoryBean
[]
2018-04-17 08:38:41.236 INFO tationBasedRuleFactory - Found the following rule beans annotated with gov.va.ccrs.brengine.rule.annotation.RuleBean
[referralRules, dollarThresholdRule, duplicateRules, episodeRules, icnRule, leieRule, paymentAuthorityRules, timelyFilingRule]
2018-04-17 08:38:41.236 INFO BatchProcessor         - Number of rules used for processing: 8
2018-04-17 08:38:41.237 INFO BatchProcessor         - Rules:
[gov.va.ccrs.brengine.rule.referral.ReferralRules@4b336cc8, gov.va.ccrs.brengine.rule.dollarthreshold.DollarThresholdRule@3ba46845, gov.va.ccrs.brengine.rule.duplicate.DuplicateRules@43423d40, gov.va.ccrs.brengine.rule.seoc.EpisodeRules@dbc7e0a, gov.va.ccrs.brengine.rule.icn.IcnRule@428eb3d5, gov.va.ccrs.brengine.rule.leie.LeieRule@2ce47652, gov.va.ccrs.brengine.rule.paymentauthority.PaymentAuthorityRules@2c56eba5, gov.va.ccrs.brengine.rule.timelyfiling.TimelyFilingRule@131c0b6f]
2018-04-17 08:38:41.237 INFO BatchProcessor         - Updating status of batch 'pharm_batch_1' to RULES_INIT
Hibernate: 
    /* load gov.va.ccrs.brengine.batchprocessing.ProcessingTracker */ select
        processing0_.rules_batch_log_key as rules_ba1_38_0_,
        processing0_.etl_batch_id as etl_batc2_38_0_,
        processing0_.claim_type as claim_ty3_38_0_,
        processing0_.engine_version as engine_v4_38_0_,
        processing0_.error as error5_38_0_,
        processing0_.end_date_time as end_date6_38_0_,
        processing0_.hostname as hostname7_38_0_,
        processing0_.resume_mode as resume_m8_38_0_,
        processing0_.last_updated_user as last_upd9_38_0_,
        processing0_.number_of_claims as number_10_38_0_,
        processing0_.number_of_failures as number_11_38_0_,
        processing0_.number_of_lines as number_12_38_0_,
        processing0_.number_of_processed_claims as number_13_38_0_,
        processing0_.number_of_processed_lines as number_14_38_0_,
        processing0_.number_of_waiting_for_data as number_15_38_0_,
        processing0_.rule_names as rule_na16_38_0_,
        processing0_.environment_name as environ17_38_0_,
        processing0_.start_date_time as start_d18_38_0_,
        processing0_.status as status19_38_0_,
        processing0_.last_updated_date_time as last_up20_38_0_ 
    from
        rules_batch_log processing0_ 
    where
        processing0_.rules_batch_log_key=?
Hibernate: 
    /* load gov.va.ccrs.brengine.batchprocessing.BatchInfo */ select
        batchinfo0_.etl_batch_id as etl_batc1_16_0_,
        batchinfo0_.batch_status as batch_st2_16_0_,
        batchinfo0_.last_updated_user as last_upd3_16_0_,
        batchinfo0_.end_date_time as end_date4_16_0_,
        batchinfo0_.source_system as source_s5_16_0_,
        batchinfo0_.last_updated_date as last_upd6_16_0_ 
    from
        claim_batch_log batchinfo0_ 
    where
        batchinfo0_.etl_batch_id=?
Hibernate: 
    /* update
        gov.va.ccrs.brengine.batchprocessing.ProcessingTracker */ update
            rules_batch_log 
        set
            etl_batch_id=?,
            claim_type=?,
            engine_version=?,
            error=?,
            end_date_time=?,
            hostname=?,
            resume_mode=?,
            last_updated_user=?,
            number_of_claims=?,
            number_of_failures=?,
            number_of_lines=?,
            number_of_processed_claims=?,
            number_of_processed_lines=?,
            number_of_waiting_for_data=?,
            rule_names=?,
            environment_name=?,
            start_date_time=?,
            status=?,
            last_updated_date_time=? 
        where
            rules_batch_log_key=?
Hibernate: 
    /* update
        gov.va.ccrs.brengine.batchprocessing.BatchInfo */ update
            claim_batch_log 
        set
            batch_status=?,
            last_updated_user=?,
            end_date_time=?,
            source_system=?,
            last_updated_date=? 
        where
            etl_batch_id=?
Hibernate: 
    /* select
        generatedAlias0 
    from
        DollarThreshold as generatedAlias0 */ select
            dollarthre0_.charge_amount_threshold_key as charge_a1_13_,
            dollarthre0_.claim_type as claim_ty2_13_,
            dollarthre0_.last_updated_user as last_upd3_13_,
            dollarthre0_.threshold_amount as threshol4_13_,
            dollarthre0_.last_updated_date_time as last_upd5_13_ 
        from
            rules.charge_amount_threshold dollarthre0_
2018-04-17 08:38:41.271 INFO BatchProcessor         - Deleting all prior outcomes/decisions for the batch, if any
Hibernate: 
    /* delete 
    from
        ValidationFailure vf 
    where
        vf.decision.key in (
            select
                key 
            from
                Decision d 
            where
                d.batchId= ?1 
                and d.decisionType != 'REJECTED' 
        ) */ delete 
        from
            validation_failure 
        where
            decision_key in (
                select
                    decision1_.decision_key 
                from
                    decision decision1_ 
                where
                    decision1_.etl_batch_id=? 
                    and decision1_.decision<>'REJECTED'
            )
Hibernate: 
    /* delete 
    from
        Decision d 
    where
        d.batchId= ?1 
        and d.decisionType != 'REJECTED' */ delete 
        from
            decision 
        where
            etl_batch_id=? 
            and decision<>'REJECTED'
2018-04-17 08:38:41.302 INFO DecisionDaoImpl        - Deleted 0 decisions and 0 failures for batchId pharm_batch_1
2018-04-17 08:38:41.302 INFO BatchProcessor         - Loading all claims for the batch pharm_batch_1
Hibernate: 
    /* select
        distinct c 
    from
        Claim c 
    join
        fetch c.formType formType 
    join
        fetch c.pharmClaimLines line 
    left join
        fetch c.billingProvider billProv 
    left join
        fetch c.renderingProvider renderingProv 
    left join
        fetch billProv.locations 
    left join
        fetch c.patient patient 
    join
        fetch c.pharmacyClaim 
    where
        c.isCurrent=true 
        and line.isCurrent=true 
        and formType.code='NCPDP D.0' 
        and line.key not in (
            select
                claimLineKey 
            from
                Decision d 
            where
                d.claim.key=c.key
        )  
        and c.batchId=?1  */ select
            distinct claim0_.claim_key as claim_ke1_30_0_,
            formtype1_.form_type_key as form_typ1_22_1_,
            pharmclaim2_.claim_detail_key as claim_de1_34_2_,
            provider3_.provider_key as provider1_29_3_,
            locations5_.provider_location_key as provider1_37_4_,
            provider4_.provider_key as provider1_29_5_,
            patient6_.patient_key as patient_1_25_6_,
            pharmacycl7_.claim_key as claim_ke1_26_7_,
            claim0_.etl_batch_id as etl_batc2_30_0_,
            claim0_.billing_provider_key as billing16_30_0_,
            claim0_.ccn_region as ccn_regi3_30_0_,
            claim0_.charge_amount as charge_a4_30_0_,
            claim0_.claim_id as claim_id5_30_0_,
            claim0_.end_date as end_date6_30_0_,
            claim0_.form_type_key as form_ty17_30_0_,
            claim0_.is_current as is_curre7_30_0_,
            claim0_.last_updated_date as last_upd8_30_0_,
            claim0_.other_insurance as other_in9_30_0_,
            claim0_.patient_key as patient18_30_0_,
            claim0_.patient_account_number as patient10_30_0_,
            claim0_.preauth_number as preauth11_30_0_,
            claim0_.claim_receipt_date as claim_r12_30_0_,
            claim0_.referral_number as referra13_30_0_,
            claim0_.referring_provider_key as referri19_30_0_,
            claim0_.rendering_provider_key as renderi20_30_0_,
            claim0_.source_system as source_14_30_0_,
            claim0_.start_date as start_d15_30_0_,
            claim0_.station_key as station21_30_0_,
            formtype1_.form_code as form_cod2_22_1_,
            pharmclaim2_.etl_batch_id as etl_batc2_34_2_,
            pharmclaim2_.claim_key as claim_k11_34_2_,
            pharmclaim2_.date_paid as date_pai3_34_2_,
            pharmclaim2_.is_current as is_curre4_34_2_,
            pharmclaim2_.line_item_control_number as line_ite5_34_2_,
            pharmclaim2_.gross_amount_due as gross_am6_34_2_,
            pharmclaim2_.product_id as product_7_34_2_,
            pharmclaim2_.prescription_service_reference as prescrip8_34_2_,
            pharmclaim2_.quantity_dispensed as quantity9_34_2_,
            pharmclaim2_.date_of_service as date_of10_34_2_,
            pharmclaim2_.claim_key as claim_k11_34_0__,
            pharmclaim2_.claim_detail_key as claim_de1_34_0__,
            provider3_.provider_name as provider2_29_3_,
            provider3_.npi as npi3_29_3_,
            provider3_.tax_id as tax_id4_29_3_,
            locations5_.address1 as address2_37_4_,
            locations5_.city as city3_37_4_,
            locations5_.country_code as country_4_37_4_,
            locations5_.postal_code as postal_c5_37_4_,
            locations5_.provider_key as provider8_37_4_,
            locations5_.provider_phone as provider6_37_4_,
            locations5_.state_long_name as state_lo7_37_4_,
            locations5_.provider_key as provider8_37_1__,
            locations5_.provider_location_key as provider1_37_1__,
            provider4_.provider_name as provider2_29_5_,
            provider4_.npi as npi3_29_5_,
            provider4_.tax_id as tax_id4_29_5_,
            patient6_.address1 as address2_25_6_,
            patient6_.address2 as address3_25_6_,
            patient6_.etl_batch_id as etl_batc4_25_6_,
            patient6_.city as city5_25_6_,
            patient6_.date_of_birth as date_of_6_25_6_,
            patient6_.first_name as first_na7_25_6_,
            patient6_.icn as icn8_25_6_,
            patient6_.insured_id as insured_9_25_6_,
            patient6_.last_name as last_na10_25_6_,
            patient6_.member_id as member_11_25_6_,
            patient6_.middle_initial as middle_12_25_6_,
            patient6_.postal_code as postal_13_25_6_,
            patient6_.sex as sex14_25_6_,
            patient6_.ssn as ssn15_25_6_,
            patient6_.state_code as state_c16_25_6_,
            pharmacycl7_.provider_key as provider2_26_7_ 
        from
            dim_va_claim claim0_ 
        inner join
            dim_claim_form_type formtype1_ 
                on claim0_.form_type_key=formtype1_.form_type_key 
        inner join
            f_pharmacy_claim_details pharmclaim2_ 
                on claim0_.claim_key=pharmclaim2_.claim_key 
        left outer join
            dim_provider provider3_ 
                on claim0_.billing_provider_key=provider3_.provider_key 
        left outer join
            provider_location locations5_ 
                on provider3_.provider_key=locations5_.provider_key 
        left outer join
            dim_provider provider4_ 
                on claim0_.rendering_provider_key=provider4_.provider_key 
        left outer join
            dim_patient patient6_ 
                on claim0_.patient_key=patient6_.patient_key 
        inner join
            dim_pharmacy_claim pharmacycl7_ 
                on claim0_.claim_key=pharmacycl7_.claim_key 
        where
            claim0_.is_current='Y' 
            and pharmclaim2_.is_current='Y' 
            and formtype1_.form_code='NCPDP D.0' 
            and (
                pharmclaim2_.claim_detail_key not in  (
                    select
                        decision8_.claim_detail_key 
                    from
                        decision decision8_ 
                    where
                        decision8_.claim_key=claim0_.claim_key
                )
            ) 
            and claim0_.etl_batch_id=?
Hibernate: 
    select
        institutio0_.claim_key as claim_ke1_24_0_,
        institutio0_.admission_date as admissio2_24_0_,
        institutio0_.statement_from_date as statemen3_24_0_,
        institutio0_.statement_to_date as statemen4_24_0_,
        claim1_.claim_key as claim_ke1_30_1_,
        claim1_.etl_batch_id as etl_batc2_30_1_,
        claim1_.billing_provider_key as billing16_30_1_,
        claim1_.ccn_region as ccn_regi3_30_1_,
        claim1_.charge_amount as charge_a4_30_1_,
        claim1_.claim_id as claim_id5_30_1_,
        claim1_.end_date as end_date6_30_1_,
        claim1_.form_type_key as form_ty17_30_1_,
        claim1_.is_current as is_curre7_30_1_,
        claim1_.last_updated_date as last_upd8_30_1_,
        claim1_.other_insurance as other_in9_30_1_,
        claim1_.patient_key as patient18_30_1_,
        claim1_.patient_account_number as patient10_30_1_,
        claim1_.preauth_number as preauth11_30_1_,
        claim1_.claim_receipt_date as claim_r12_30_1_,
        claim1_.referral_number as referra13_30_1_,
        claim1_.referring_provider_key as referri19_30_1_,
        claim1_.rendering_provider_key as renderi20_30_1_,
        claim1_.source_system as source_14_30_1_,
        claim1_.start_date as start_d15_30_1_,
        claim1_.station_key as station21_30_1_,
        formtype2_.form_type_key as form_typ1_22_2_,
        formtype2_.form_code as form_cod2_22_2_ 
    from
        dim_institutional_claim institutio0_ 
    left outer join
        dim_va_claim claim1_ 
            on institutio0_.claim_key=claim1_.claim_key 
    left outer join
        dim_claim_form_type formtype2_ 
            on claim1_.form_type_key=formtype2_.form_type_key 
    where
        institutio0_.claim_key=?
2018-04-17 08:38:41.403 INFO BatchProcessor         - Loaded 1 claims 1 lines
2018-04-17 08:38:41.403 INFO BatchProcessor         - Updating status of batch 'pharm_batch_1' to RULES_IN_PROCESS
Hibernate: 
    /* load gov.va.ccrs.brengine.batchprocessing.ProcessingTracker */ select
        processing0_.rules_batch_log_key as rules_ba1_38_0_,
        processing0_.etl_batch_id as etl_batc2_38_0_,
        processing0_.claim_type as claim_ty3_38_0_,
        processing0_.engine_version as engine_v4_38_0_,
        processing0_.error as error5_38_0_,
        processing0_.end_date_time as end_date6_38_0_,
        processing0_.hostname as hostname7_38_0_,
        processing0_.resume_mode as resume_m8_38_0_,
        processing0_.last_updated_user as last_upd9_38_0_,
        processing0_.number_of_claims as number_10_38_0_,
        processing0_.number_of_failures as number_11_38_0_,
        processing0_.number_of_lines as number_12_38_0_,
        processing0_.number_of_processed_claims as number_13_38_0_,
        processing0_.number_of_processed_lines as number_14_38_0_,
        processing0_.number_of_waiting_for_data as number_15_38_0_,
        processing0_.rule_names as rule_na16_38_0_,
        processing0_.environment_name as environ17_38_0_,
        processing0_.start_date_time as start_d18_38_0_,
        processing0_.status as status19_38_0_,
        processing0_.last_updated_date_time as last_up20_38_0_ 
    from
        rules_batch_log processing0_ 
    where
        processing0_.rules_batch_log_key=?
Hibernate: 
    /* load gov.va.ccrs.brengine.batchprocessing.BatchInfo */ select
        batchinfo0_.etl_batch_id as etl_batc1_16_0_,
        batchinfo0_.batch_status as batch_st2_16_0_,
        batchinfo0_.last_updated_user as last_upd3_16_0_,
        batchinfo0_.end_date_time as end_date4_16_0_,
        batchinfo0_.source_system as source_s5_16_0_,
        batchinfo0_.last_updated_date as last_upd6_16_0_ 
    from
        claim_batch_log batchinfo0_ 
    where
        batchinfo0_.etl_batch_id=?
Hibernate: 
    /* update
        gov.va.ccrs.brengine.batchprocessing.ProcessingTracker */ update
            rules_batch_log 
        set
            etl_batch_id=?,
            claim_type=?,
            engine_version=?,
            error=?,
            end_date_time=?,
            hostname=?,
            resume_mode=?,
            last_updated_user=?,
            number_of_claims=?,
            number_of_failures=?,
            number_of_lines=?,
            number_of_processed_claims=?,
            number_of_processed_lines=?,
            number_of_waiting_for_data=?,
            rule_names=?,
            environment_name=?,
            start_date_time=?,
            status=?,
            last_updated_date_time=? 
        where
            rules_batch_log_key=?
Hibernate: 
    /* update
        gov.va.ccrs.brengine.batchprocessing.BatchInfo */ update
            claim_batch_log 
        set
            batch_status=?,
            last_updated_user=?,
            end_date_time=?,
            source_system=?,
            last_updated_date=? 
        where
            etl_batch_id=?
2018-04-17 08:38:41.418 INFO BatchProcessor         - Starting 3 threads to process the batch pharm_batch_1
2018-04-17 08:38:41.418 INFO BatchProcessor         - Claim processing thread Thread[SimpleAsyncTaskExecutor-3,5,main] completed, processed 0 claims
2018-04-17 08:38:41.418 INFO BatchProcessor         - Claim processing thread Thread[SimpleAsyncTaskExecutor-4,5,main] completed, processed 0 claims
Hibernate: 
    /* select
        r 
    from
        Referral r 
    where
        r.referralNumber = :referralNumber */ select
            referral0_.referral_key as referral1_10_,
            referral0_.referral_expiration_date as referral2_10_,
            referral0_.payment_authority_obligation_key as payment_3_10_,
            referral0_.referral_date as referral4_10_,
            referral0_.referral_number as referral5_10_,
            referral0_.referring_provider as referrin6_10_,
            referral0_.service_requested as service_7_10_ 
        from
            ccra.referral referral0_ 
        where
            referral0_.referral_number=?
Hibernate: 
    /* select
        distinct c 
    from
        Claim c 
    join
        fetch c.formType 
    join
        fetch c.pharmClaimLines line 
    join
        fetch c.decisions d 
    left join
        fetch c.billingProvider 
    left join
        fetch c.patient pt 
    join
        fetch c.pharmacyClaim 
    where
        c.isCurrent = 'Y' 
        and d.decisionType in (
            'APPROVED', 'BILL_SENT', 'PAID'
        ) */ select
            distinct claim0_.claim_key as claim_ke1_30_0_,
            formtype1_.form_type_key as form_typ1_22_1_,
            pharmclaim2_.claim_detail_key as claim_de1_34_2_,
            decisions3_.decision_key as decision1_21_3_,
            provider4_.provider_key as provider1_29_4_,
            patient5_.patient_key as patient_1_25_5_,
            pharmacycl6_.claim_key as claim_ke1_26_6_,
            claim0_.etl_batch_id as etl_batc2_30_0_,
            claim0_.billing_provider_key as billing16_30_0_,
            claim0_.ccn_region as ccn_regi3_30_0_,
            claim0_.charge_amount as charge_a4_30_0_,
            claim0_.claim_id as claim_id5_30_0_,
            claim0_.end_date as end_date6_30_0_,
            claim0_.form_type_key as form_ty17_30_0_,
            claim0_.is_current as is_curre7_30_0_,
            claim0_.last_updated_date as last_upd8_30_0_,
            claim0_.other_insurance as other_in9_30_0_,
            claim0_.patient_key as patient18_30_0_,
            claim0_.patient_account_number as patient10_30_0_,
            claim0_.preauth_number as preauth11_30_0_,
            claim0_.claim_receipt_date as claim_r12_30_0_,
            claim0_.referral_number as referra13_30_0_,
            claim0_.referring_provider_key as referri19_30_0_,
            claim0_.rendering_provider_key as renderi20_30_0_,
            claim0_.source_system as source_14_30_0_,
            claim0_.start_date as start_d15_30_0_,
            claim0_.station_key as station21_30_0_,
            formtype1_.form_code as form_cod2_22_1_,
            pharmclaim2_.etl_batch_id as etl_batc2_34_2_,
            pharmclaim2_.claim_key as claim_k11_34_2_,
            pharmclaim2_.date_paid as date_pai3_34_2_,
            pharmclaim2_.is_current as is_curre4_34_2_,
            pharmclaim2_.line_item_control_number as line_ite5_34_2_,
            pharmclaim2_.gross_amount_due as gross_am6_34_2_,
            pharmclaim2_.product_id as product_7_34_2_,
            pharmclaim2_.prescription_service_reference as prescrip8_34_2_,
            pharmclaim2_.quantity_dispensed as quantity9_34_2_,
            pharmclaim2_.date_of_service as date_of10_34_2_,
            pharmclaim2_.claim_key as claim_k11_34_0__,
            pharmclaim2_.claim_detail_key as claim_de1_34_0__,
            decisions3_.etl_batch_id as etl_batc2_21_3_,
            decisions3_.claim_key as claim_ke8_21_3_,
            decisions3_.claim_detail_key as claim_de3_21_3_,
            decisions3_.decision_date_time as decision4_21_3_,
            decisions3_.decision as decision5_21_3_,
            decisions3_.last_updated_user as last_upd6_21_3_,
            decisions3_.last_updated_date_time as last_upd7_21_3_,
            decisions3_.claim_key as claim_ke8_21_1__,
            decisions3_.decision_key as decision1_21_1__,
            provider4_.provider_name as provider2_29_4_,
            provider4_.npi as npi3_29_4_,
            provider4_.tax_id as tax_id4_29_4_,
            patient5_.address1 as address2_25_5_,
            patient5_.address2 as address3_25_5_,
            patient5_.etl_batch_id as etl_batc4_25_5_,
            patient5_.city as city5_25_5_,
            patient5_.date_of_birth as date_of_6_25_5_,
            patient5_.first_name as first_na7_25_5_,
            patient5_.icn as icn8_25_5_,
            patient5_.insured_id as insured_9_25_5_,
            patient5_.last_name as last_na10_25_5_,
            patient5_.member_id as member_11_25_5_,
            patient5_.middle_initial as middle_12_25_5_,
            patient5_.postal_code as postal_13_25_5_,
            patient5_.sex as sex14_25_5_,
            patient5_.ssn as ssn15_25_5_,
            patient5_.state_code as state_c16_25_5_,
            pharmacycl6_.provider_key as provider2_26_6_ 
        from
            dim_va_claim claim0_ 
        inner join
            dim_claim_form_type formtype1_ 
                on claim0_.form_type_key=formtype1_.form_type_key 
        inner join
            f_pharmacy_claim_details pharmclaim2_ 
                on claim0_.claim_key=pharmclaim2_.claim_key 
        inner join
            decision decisions3_ 
                on claim0_.claim_key=decisions3_.claim_key 
        left outer join
            dim_provider provider4_ 
                on claim0_.billing_provider_key=provider4_.provider_key 
        left outer join
            dim_patient patient5_ 
                on claim0_.patient_key=patient5_.patient_key 
        inner join
            dim_pharmacy_claim pharmacycl6_ 
                on claim0_.claim_key=pharmacycl6_.claim_key 
        where
            claim0_.is_current='Y' 
            and (
                decisions3_.decision in (
                    'APPROVED' , 'BILL_SENT' , 'PAID'
                )
            )
Hibernate: 
    /* select
        distinct r 
    from
        Referral r 
    left join
        fetch r.preAuthorization 
    where
        r.referralNumber = :referralNumber */ select
            distinct referral0_.referral_key as referral1_10_0_,
            preauthori1_.preauthorization_key as preautho1_8_1_,
            referral0_.referral_expiration_date as referral2_10_0_,
            referral0_.payment_authority_obligation_key as payment_3_10_0_,
            referral0_.referral_date as referral4_10_0_,
            referral0_.referral_number as referral5_10_0_,
            referral0_.referring_provider as referrin6_10_0_,
            referral0_.service_requested as service_7_10_0_,
            preauthori1_.date_from as date_fro2_8_1_,
            preauthori1_.date_to as date_to3_8_1_,
            preauthori1_.preauthorization_number as preautho4_8_1_,
            preauthori1_.referral_key as referral5_8_1_,
            preauthori1_.referral_key as referral5_8_0__,
            preauthori1_.preauthorization_key as preautho1_8_0__ 
        from
            ccra.referral referral0_ 
        left outer join
            ccra.preauthorization preauthori1_ 
                on referral0_.referral_key=preauthori1_.referral_key 
        where
            referral0_.referral_number=?
Hibernate: 
    select
        preauthori0_.preauthorization_key as preautho5_9_0_,
        preauthori0_.preauthorization_detail_key as preautho1_9_0_,
        preauthori0_.preauthorization_detail_key as preautho1_9_1_,
        preauthori0_.preauthorization_key as preautho5_9_1_,
        preauthori0_.preauthorized_service as preautho2_9_1_,
        preauthori0_.quantity as quantity3_9_1_,
        preauthori0_.subcategory as subcateg4_9_1_,
        orderset1_.orderset_key as orderset1_3_2_,
        orderset1_.code as code2_3_2_,
        orderset1_.order_set_description as order_se3_3_2_,
        orderset1_.pre_authorization_detail_key as pre_auth4_3_2_,
        ordersetda2_.orderset_date_key as orderset1_4_3_,
        ordersetda2_.date_from as date_fro2_4_3_,
        orderset3_.orderset_key as orderset1_3_4_,
        orderset3_.code as code2_3_4_,
        orderset3_.order_set_description as order_se3_3_4_,
        orderset3_.pre_authorization_detail_key as pre_auth4_3_4_ 
    from
        ccra.preauthorization_detail preauthori0_ 
    left outer join
        ccra.orderset orderset1_ 
            on preauthori0_.preauthorization_detail_key=orderset1_.pre_authorization_detail_key 
    left outer join
        ccra.ordersetdate ordersetda2_ 
            on orderset1_.orderset_key=ordersetda2_.orderset_date_key 
    left outer join
        ccra.orderset orderset3_ 
            on ordersetda2_.orderset_date_key=orderset3_.orderset_key 
    where
        preauthori0_.preauthorization_key=?
Hibernate: 
    select
        ordersetda0_.orderset_date_key as orderset3_5_0_,
        ordersetda0_.orderset_date_item_key as orderset1_5_0_,
        ordersetda0_.orderset_date_item_key as orderset1_5_1_,
        ordersetda0_.orderset_date_key as orderset3_5_1_,
        ordersetda0_.procedure_code as procedur2_5_1_ 
    from
        ccra.ordersetdateitem ordersetda0_ 
    where
        ordersetda0_.orderset_date_key=?
Hibernate: 
    /* select
        generatedAlias0 
    from
        Seoc as generatedAlias0 
    where
        generatedAlias0.seocId=:param0 */ select
            seoc0_.seoc_key as seoc_key1_39_,
            seoc0_.category_of_care as category2_39_,
            seoc0_.duration as duration3_39_,
            seoc0_.end_date as end_date4_39_,
            seoc0_.is_pal as is_pal5_39_,
            seoc0_.name as name6_39_,
            seoc0_.seoc_id as seoc_id7_39_,
            seoc0_.start_date as start_da8_39_,
            seoc0_.version as version9_39_ 
        from
            seoc seoc0_ 
        where
            seoc0_.seoc_id=?
Hibernate: 
    select
        procedures0_.seoc_key as seoc_key1_40_0_,
        procedures0_.procedure_key as procedur2_40_0_,
        procedures0_.seoc_key as seoc_key1_40_1_,
        procedures0_.procedure_key as procedur2_40_1_,
        procedure1_.procedure_key as procedur1_28_2_,
        procedure1_.procedure_code as procedur2_28_2_,
        procedure1_.short_description as short_de3_28_2_ 
    from
        seoc_procedure_junction procedures0_ 
    inner join
        dim_procedure_code procedure1_ 
            on procedures0_.procedure_key=procedure1_.procedure_key 
    where
        procedures0_.seoc_key=?
2018-04-17 08:38:41.520 ERROR BatchProcessor         - Batch 'pharm_batch_1', host 'JX574H2',  thread 'SimpleAsyncTaskExecutor-2' failed with the error java.util.concurrent.CompletionException: java.lang.IllegalStateException: procedure not valid for pharmacy claim type
java.util.concurrent.CompletionException: java.lang.IllegalStateException: procedure not valid for pharmacy claim type
	at org.springframework.aop.interceptor.AsyncExecutionAspectSupport.lambda$doSubmit$0(AsyncExecutionAspectSupport.java:273)
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: procedure not valid for pharmacy claim type
	at gov.va.ccrs.brengine.claim.PharmacyClaimLine.procedure(PharmacyClaimLine.java:68)
	at gov.va.ccrs.brengine.rule.seoc.EpisodeRules.validate(EpisodeRules.java:118)
	at gov.va.ccrs.brengine.rule.seoc.EpisodeRules.validateReferral(EpisodeRules.java:101)
	at gov.va.ccrs.brengine.rule.seoc.EpisodeRules.process(EpisodeRules.java:54)
	at executeRules(RulesClaimExecutor.java:100)
	at executeRulesAndPresistDecisions(RulesClaimExecutor.java:64)
	at executeRulesForClaimQueue(RulesClaimExecutor.java:48)
	at gov.va.ccrs.brengine.rule.RulesClaimExecutor$$FastClassBySpringCGLIB$$d090f078.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
	at org.springframework.aop.interceptor.AsyncExecutionAspectSupport.lambda$doSubmit$0(AsyncExecutionAspectSupport.java:270)
	... 2 common frames omitted
Hibernate: 
    /* load gov.va.ccrs.brengine.batchprocessing.ProcessingTracker */ select
        processing0_.rules_batch_log_key as rules_ba1_38_0_,
        processing0_.etl_batch_id as etl_batc2_38_0_,
        processing0_.claim_type as claim_ty3_38_0_,
        processing0_.engine_version as engine_v4_38_0_,
        processing0_.error as error5_38_0_,
        processing0_.end_date_time as end_date6_38_0_,
        processing0_.hostname as hostname7_38_0_,
        processing0_.resume_mode as resume_m8_38_0_,
        processing0_.last_updated_user as last_upd9_38_0_,
        processing0_.number_of_claims as number_10_38_0_,
        processing0_.number_of_failures as number_11_38_0_,
        processing0_.number_of_lines as number_12_38_0_,
        processing0_.number_of_processed_claims as number_13_38_0_,
        processing0_.number_of_processed_lines as number_14_38_0_,
        processing0_.number_of_waiting_for_data as number_15_38_0_,
        processing0_.rule_names as rule_na16_38_0_,
        processing0_.environment_name as environ17_38_0_,
        processing0_.start_date_time as start_d18_38_0_,
        processing0_.status as status19_38_0_,
        processing0_.last_updated_date_time as last_up20_38_0_ 
    from
        rules_batch_log processing0_ 
    where
        processing0_.rules_batch_log_key=?
Hibernate: 
    /* load gov.va.ccrs.brengine.batchprocessing.BatchInfo */ select
        batchinfo0_.etl_batch_id as etl_batc1_16_0_,
        batchinfo0_.batch_status as batch_st2_16_0_,
        batchinfo0_.last_updated_user as last_upd3_16_0_,
        batchinfo0_.end_date_time as end_date4_16_0_,
        batchinfo0_.source_system as source_s5_16_0_,
        batchinfo0_.last_updated_date as last_upd6_16_0_ 
    from
        claim_batch_log batchinfo0_ 
    where
        batchinfo0_.etl_batch_id=?
Hibernate: 
    /* update
        gov.va.ccrs.brengine.batchprocessing.ProcessingTracker */ update
            rules_batch_log 
        set
            etl_batch_id=?,
            claim_type=?,
            engine_version=?,
            error=?,
            end_date_time=?,
            hostname=?,
            resume_mode=?,
            last_updated_user=?,
            number_of_claims=?,
            number_of_failures=?,
            number_of_lines=?,
            number_of_processed_claims=?,
            number_of_processed_lines=?,
            number_of_waiting_for_data=?,
            rule_names=?,
            environment_name=?,
            start_date_time=?,
            status=?,
            last_updated_date_time=? 
        where
            rules_batch_log_key=?
Hibernate: 
    /* update
        gov.va.ccrs.brengine.batchprocessing.BatchInfo */ update
            claim_batch_log 
        set
            batch_status=?,
            last_updated_user=?,
            end_date_time=?,
            source_system=?,
            last_updated_date=? 
        where
            etl_batch_id=?
2018-04-17 08:38:41.536 INFO EmailNotifier          - Sending email to 'alexander@myarch.com'. Subject:
Batch 'pharm_batch_1', host 'JX574H2',  thread 'SimpleAsyncTaskExecutor-2' failed with the error java.util.concurrent.CompletionException: java.lang.IllegalStateException: procedure not valid for pharmacy claim type
2018-04-17 08:38:41.536 INFO EmailNotifier          - Email sending is disabled, the email won't be sent
2018-04-17 08:38:41.536 INFO nfigApplicationContext - Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@13bc8645: startup date [Tue Apr 17 08:38:29 EDT 2018]; root of context hierarchy
2018-04-17 08:38:41.572 INFO aultLifecycleProcessor - Stopping beans in phase 2147483547
2018-04-17 08:38:41.572 INFO aultLifecycleProcessor - Stopping beans in phase 0
2018-04-17 08:38:41.587 INFO tityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'
2018-04-17 08:38:41.587 INFO HikariDataSource       - HikariPool-1 - Shutdown initiated...
2018-04-17 08:38:41.603 INFO HikariDataSource       - HikariPool-1 - Shutdown completed.
