Claim Roll Up Idea

Embed Size (px)

Citation preview

  • 8/7/2019 Claim Roll Up Idea

    1/4

    Claim Level Rollup:

    Note: In this document I reference the suggested table CMS_SERVICE_CLAIM_LINK. This would be a new tablecreated for the claim roll up. Im also basing some of this on the code inServiceDeliverySearchViewModel.GenerateClaimBatchNew(). It appears that code is currently at the heart of how HFMcreates claims.

    One thought to make the rollup work is that we store a SQL Query which rolls up multiple service deliveries. For example,

    lets say we need to roll up on Consumer, Care Plan, Diagnosis, HCPCS, Place of Service, and Provider. The followingquery would roll up service deliveries:

    Select Consumer_UUID, CarePlan_UUID, SD.DIAGNOSIS_CODE,S.HCPCS_CODE, SD.place_of_service_code, SD.Provider_UUIDFROM Service_Delivery SDINNERJOIN Service_Allocation SA ON SD.Service_Alloc_UUID= SA.Service_Alloc_UUIDINNERJOINSERVICE S ON SA.Service_UUID = S.Service_UUIDGroupBy Consumer_UUID, CarePlan_UUID, SD.DIAGNOSIS_CODE,S.HCPCS_CODE, SD.place_of_service_code, SD.Provider_UUID

    We would need to somehow provide a list of service deliveries. Perhaps we could add BATCH_UUID to theCMS_SERVICE _CLAIM _LINK table. When the user clicks Generate Claim Batch the application should create a newCMS_BATCH record. It should then write the BATCH_UUID, SERVICE_DELIVERY_UUID, andSERVICE_DELIVERY_DAILY_DETAIL_UUID of all selected services to the CMS_SERVICE_LINK table. Now, lets takethe same query from above and add CMS_SERVICE_CLAIM_LINK:

    Select Consumer_UUID, CarePlan_UUID, SD.DIAGNOSIS_CODE,S.HCPCS_CODE, SD.place_of_service_code, SD.Provider_UUID,Row_Number()OVER(ORDERBY Consumer_UUID)As Claim_NumberFROM Service_Delivery SDINNERJOIN Service_Allocation SA ON SD.Service_Alloc_UUID= SA.Service_Alloc_UUIDINNERJOINSERVICE S ON SA.Service_UUID = S.Service_UUIDINNERJOIN CMS_SERVICE_CLAIM_LINK CL ON

    SD.SERVICE_DELIVERY_UUID = CL.SERVICE_DELIVERY_UUIDWHERE CL.BATCH_UUID =GroupBy Consumer_UUID, CarePlan_UUID, SD.DIAGNOSIS_CODE,S.HCPCS_CODE, SD.place_of_service_code, SD.Provider_UUID

    With this query the roll up is based on the service deliveries selected by the user. I also added Row_Number so that eachrollup has a unique number.

    We need to link each roll up pulled by the query above with a service delivery. To do this we need a query that link theservice delivery table with the query above:

    SelectDistinct SD.Service_Delivery_UUID, SD.Agency_UUID,A.Short_Name As Agency,SD.Service_UUID, Site.Description, SD.Fund_IDENTIFIER_UUID,Q1.*FROM Service_Delivery SDINNERJOIN Service_Allocation SA ON SD.Service_Alloc_UUID= SA.Service_Alloc_UUIDINNERJOINSERVICE S ON SA.Service_UUID = S.Service_UUIDINNERJOIN CMS_SERVICE_CLAIM_LINK CL ONSD.SERVICE_DELIVERY_UUID = CL.SERVICE_DELIVERY_UUIDINNERJOIN Agency A ON SD.Agency_UUID = A.Agency_UUIDLEFTJOINSiteON SD.Site_UUID = Site.Site_UUIDINNERJOIN(Select Consumer_UUID, CarePlan_UUID, SD.DIAGNOSIS_CODE,S.HCPCS_CODE, SD.place_of_service_code, SD.Provider_UUID,

    Row_Number()OVER(ORDERBY Consumer_UUID)As Claim_NumberFROM Service_Delivery SDINNERJOIN Service_Allocation SA ON SD.Service_Alloc_UUID= SA.Service_Alloc_UUIDINNERJOINSERVICE S ON SA.Service_UUID = S.Service_UUIDINNERJOIN CMS_SERVICE_CLAIM_LINK CL ONSD.SERVICE_DELIVERY_UUID = CL.SERVICE_DELIVERY_UUIDWHERE CL.BATCH_UUID =GroupBy Consumer_UUID, CarePlan_UUID, SD.DIAGNOSIS_CODE,S.HCPCS_CODE, SD.place_of_service_code, SD.Provider_UUID)As Q1 ON SD.Consumer_UUID = Q1.Consumer_UUIDand SA.CarePlan_UUID = Q1.CarePlan_UUID

  • 8/7/2019 Claim Roll Up Idea

    2/4

    and S.HCPCS_CODE = Q1.HCPCS_CODEand SD.Provider_UUID = Q1.Provider_UUIDOrderBY Claim_Number

    The query above would be at the heart of the roll up. This is the query we would use to pull the service deliveries weneed to roll into claims. This query would be saved in the config table. This query links the service delivery records withthe roll up records.

    In HFM, the following code saves claim records:

    cmsClaim.ProviderUuid = selectedServiceDelivery.ServiceDelivery.ProviderUuid;cmsClaim.AgencyUuid = selectedServiceDelivery.ServiceDelivery.AgencyUuid;cmsClaim.AgencyName = selectedServiceDelivery.ServiceDelivery.Agency;cmsClaim.SiteDescription = selectedServiceDelivery.ServiceDelivery.Site.ToString();cmsClaim.FundIdentifierCode = selectedServiceDelivery.FundIdentifierUuid.ToString();cmsClaim.ServiceUuid = selectedServiceDelivery.ServiceUuid;cmsClaim.SubProviderName = selectedServiceDelivery.SubProvider;cmsClaim.TotalUnits = selectedServiceDelivery.TotalUnits;cmsClaim.UnitPrice = selectedServiceDelivery.ServiceDelivery.UnitPrice;cmsClaim.DiagnosisCode = selectedServiceDelivery.DiagnosisCode;cmsClaim.ServiceDeliveryUuid = selectedServiceDelivery.ServiceDeliveryUuid

    Ive added fields to the query to account for this code. HFM could take the recordset returned by the query above andloop through it. Each time the value of Claim_Number changes a new claim record should created. Each serviceassociated with a given Claim_Number should be updated with the same Claim_UUID in the

    CMS_SERVICE_CLAIM_LINK table. For example:

    Lets say the query above returns the following:

    Service_Delivery_UUID .. Claim_CountE824F980-9ECA-4845-8094-38910FF8EA3B 13129D68A-53E9-4533-AB0C-D60E621AD06B 115FA9ABC-E91C-4D65-B5B7-13A53E15683D 26A30DE6A-0C86-435C-808C-51B7EFEBBB82 2

    HFM would loop through this record set.:When HFM sees the first record it will create a new CMS_CLAIM record. It should also update

    CMS_SERVICE_CLAIM_LINK.CLAIM_UUID where SERVICE_DELIVERY_UUID = E824F980-9ECA-4845-8094-38910FF8EA3B

    When HFM moves to the second record it should know that a CMS_CLAIM record was already created for

    CLAIM_COUNT 1. It should not create a new CMS_CLAIM record. It should also updateCMS_SERVICE_CLAIM_LINK.CLAIM_UUID where SERVICE_DELIVERY_UUID = 3129D68A-53E9-4533-AB0C-D60E621AD06B

    When HFM moves to the third record it will know a new claim has not been created for Claim_Count 2. Here itwill add a new CMS_CLAIM record for Claim_Count 2. It should also updateCMS_SERVICE_CLAIM_LINK.CLAIM_UUID where SERVICE_DELIVERY_UUID = 15FA9ABC-E91C-4D65-B5B7-13A53E15683D

    When HFM moves to the fourth record it should know that a CMS_CLAIM record was already created forCLAIM_COUNT 2. It should not create a new CMS_CLAIM record. It should also updateCMS_SERVICE_CLAIM_LINK.CLAIM_UUID where SERVICE_DELIVERY_UUID = 6A30DE6A-0C86-435C-808C-51B7EFEBBB82

    At this point we will have created the CMS_CLAIM records.

    Service Level Rollup:

    Lets assume the user has requested we roll up at the service level based on service dates. I think we should have acheck box on the config page which determines if we roll up on dates. I cant think of any other values we could roll up onat this level.

    By time we reach the service level rollup we should have all of our CMS_Claim records created.

    Lets start by getting a list of claim_uuids associated with the current batch:

    Select CLAIM_UUID FROM CMS_CLAIM WHERE BATCH_UUID =''

  • 8/7/2019 Claim Roll Up Idea

    3/4

    Loop through each UUID in the list. For each UUID we will need to get a l ist of Service Delivery Details associated withthe claim. Order the list by Service_Date:

    Select SC.SERVICE_DELIVERY_DAILY_DETAIL_UUID , SC.SERVICE_DELIVERY_UUID,SERVICE_DATE,case

    when sdd.units isnullthen sd.unitsElse sdd.Units

    endAs UNITS, SD.UNIT_PRICE FROM CMS_SERVICE_CLAIM_LINK SCLEFTJOIN SERVICE_DELIVERY_DAILY_DETAIL SDD ON SC.SERVICE_DELIVERY_DAILY_DETAIL_UUID= SDD.SERVICE_DELIVERY_DAILY_DETAIL_UUIDLEFTJOIN SERVICE_DELIVERY SD ON SC.SERVICE_DELIVERY_UUID =SD.SERVICE_DELIVERY_UUIDWHERE SC.Claim_UUID =''ORDERBY Service_Date

    For each service delivery in the list we will need to keep track of Service_Date, Units, and Unit Price. We will want to rollup claims when dates are continuous. Notice in the query above if SERVICE_DELIVERY_DAILY_DETAIL.UNITS is nullwe are pulling units from SERVICE_DELIVERY.

    Lets assume the query above pulls the following records:

    Service_Delivery_Dai ly_Detai l_UUID Service_Delivery_UUID Service_Date Units Unit CostA9518A9F-22BE-432B-8690-83F5DE5C7AE3 1A8A0EDE-5B4A-413D-8CA4-5A2B9CD0940710/27/102.50 21.00

    9FBCEEA8-56A9-4DB6-B993-486E2D5E1ECF 1A8A0EDE-5B4A-413D-8CA4-5A2B9CD09407 10/28/102.50 21.00

    6D563261-B97C-4A96-82A7-65838C5DD359 AADA1B1D-2B25-41AD-AB20-59677040F205 11/1/102.00 21.00

    BCB01961-7AFD-45F5-9B7A-6B43E5290DA0 AADA1B1D-2B25-41AD-AB20-59677040F205 11/2/104.00 21.00

    145224E0-A332-4C66-80C5-100A33C6735E AADA1B1D-2B25-41AD-AB20-59677040F205 11/3/102.50 21.00

    HFM would loop through this record set:

    It should hit the first record and realize that this is first record. It would note that the current detail record is

    10/27/10, for 2.50 units, billed for 52.5 (2.5 * 21)

    HFM will check the second record. It should compare the service information of this record to the information inmemory. It will check if the service date of this record is one day later than the record in memory. It is, so the currentservice information is

    10/27/10-10/28/10, for 5 units (2.50 + 2.50), billed for 105 (52.5 + 52.5)

    HFM will check the third record. It should compare the service information of this record to the information inmemory. It will check if the service date of this record is one day later than the record in memory. It is NOT, so thecurrent service information should be written to the database. Here we would create a new claim detail record. We willalso update CMS_SERVICE_CLAIM_LINK:

    Update CMS_SERVICE_CLAIM_LINK SET CLAIM_DETAIL_UUID =''WHERE CLAIM_UUID =''and SERVICE_DELIVERY_DAILY_DETAIL_UUID IN('9FBCEEA8-56A9-4DB6-B993-486E2D5E1ECF' ,'A9518A9F-22BE-432B-8690-83F5DE5C7AE3' )

    HFM will clear the service information in memory and start a new detail record based on the information in thethird record:

    11/1/10, for 2 units, billed for 42 (2 *21)

    HFM will check the fourth record. It should compare the service information of this record to the information inmemory. It will check if the service date of this record is one day later than the record in memory. It is, so the currentservice information is

    11/1/10-11/2/10, for 6 units (2 + 4), billed for 126 (42 + 84).

    HFM will check the fifth record. It should compare the service information of this record to the information inmemory. It will check if the service date of this record is one day later than the record in memory. It is, so the currentservice information is

  • 8/7/2019 Claim Roll Up Idea

    4/4

    11/1/10 -11/3/10, for 8.5 units (2 + 4 + 2.5), billed for 178.5 (42 + 84 + 52.5)

    This is the final record in the recordset, so we create the final claim detail record. We will also updateCMS_SERVICE_CLAIM_LINK:

    Update CMS_SERVICE_CLAIM_LINK SET CLAIM_DETAIL_UUID =''WHERE CLAIM_UUID =''and SERVICE_DELIVERY_DAILY_DETAIL_UUID IN

    ('6D563261-B97C-4A96-82A7-65838C5DD359', 'BCB01961-7AFD-45F5-9B7A-6B43E5290DA0','145224E0-A332-4C66-80C5-100A33C6735E' )