Stored procedure to create a stored procedure?!?!?!?!



  • I work for one of the larger insurance companies in the US. My sub company deals mainly with behavioral health issues. Yesterday I got presented with an interesting issue. Years ago a young kid built quite an interesting report system. I really had not touched it before although I know other developers who have. Its a continual cluster of WTFs, to say the least. This app, we shall call it App X, is used to print out various reports. Anyways several reports were printing out erroneous data, totaling things wrong etc. These reports can and do contain 100+ fields and are generated by a stored procedure. When I went to take a look at the stored procedure I was quite amazed. It was the most god-awful thing I'd seen in a long time. 1500+ lines. Finding an error in it was going to be a nightmare. Luckily the kid who wrote it was recently rehired by the company. so I walked over and asked him what the deal was with this stored procedure. Turns out years back he had written a stored procedure to create this 1500+ line stored procedure. I think the attachment speaks for itself.

    ----------------------------------------------------------------------
    CREATE PROCEDURE dbo.sp_rpt4791_6890
    @startdate as datetime,
    @enddate as datetime
    as
    select
    State = 1,
    t1.tIntAge_Index as Age_Index,
    TotalEncounter = count(*),
    Male = sum(case when t1.charClientSex = 'M' then 1 else 0 end),
    Female = sum (case when t1.charClientSex = 'F' then 1 else 0 end),
    Unknown = sum(case when t1.charClientSex <> 'M' and t1.charClientSex <> 'F' then 1 else 0 end),

    ---homeless count -----------------------------------
    HL = sum(case when t1.bitClient_HomelessYes = 1 then 1 when t1.bitClient_HomelessNo = 1 then 0 else 0 end),

    -----state agency involvement------
    DMH = sum(case when t1.tIntStateAgencyIndex = 1 then 1 else 0 end),
    DYS = sum(case when t1.tIntStateAgencyIndex = 2 then 1 else 0 end),
    DMR = sum(case when t1.tIntStateAgencyIndex = 3 then 1 else 0 end),
    DSS = sum(case when t1.tIntStateAgencyIndex = 4 then 1 else 0 end),

    ---funding source
    F1 = sum(case when t1.tIntFundingSrc_Index = 1 then 1 else 0 end),
    F2 = sum(case when t1.tIntFundingSrc_Index = 2 or t1.tIntFundingSrc_Index = 3 or t1.tIntFundingSrc_Index = 4 or t1.tIntFundingSrc_Index = 5 then 1 else 0 end),
    F3 = sum(case when t1.tIntFundingSrc_Index = 2 then 1 else 0 end),
    F4 = sum(case when t1.tIntFundingSrc_Index = 3 then 1 else 0 end),
    F5 = sum(case when t1.tIntFundingSrc_Index = 4 then 1 else 0 end),
    F6 = sum(case when t1.tIntFundingSrc_Index = 5 then 1 else 0 end),
    F7 = sum(case when t1.tIntFundingSrc_Index = 6 then 1 else 0 end),
    F8 = sum(case when t1.tIntFundingSrc_Index = 7 then 1 else 0 end),
    F9 = sum(case when t1.tIntFundingSrc_Index = 8 then 1 else 0 end),
    F10 = sum(case when t1.tIntFundingSrc_Index = 9 then 1 else 0 end),
    F11 = sum(case when t1.tIntFundingSrc_Index = 10 then 1 else 0 end),
    F12 = sum(case when t1.tIntFundingSrc_Index = 12 then 1 else 0 end),
    F13 = sum(case when t1.tIntFundingSrc_Index = 13 then 1 else 0 end),
    F14 = sum(case when t1.tIntFundingSrc_Index = 0 then 1 else 0 end),

    ---MBR Initiated---
    M0 = sum(case when t1.tIntMBR_Index = 0 then 1 else 0 end),
    M1 = sum(case when t1.tIntMBR_Index = 11 then 1 else 0 end),
    M2 = sum(case when t1.tIntMBR_Index = 12 then 1 else 0 end),
    M3 = sum(case when t1.tIntMBR_Index = 13 then 1 else 0 end),

    ---Rendered service: E0 not reported ----
    E0 = sum(case when
            t2.bitEmergencyLifeThreatening = 0 and
            t2.bitEmergencyNonLifeThreatening = 0 and
            t2.bitNonEmergencyUrgent = 0 and
            t2.bitEvalWithMD_RNCS = 0 and
            t2.bitEvalWithoutMD_RNCS = 0 and
            t2.bitFollowUpWithMD_RNCS = 0 and
            t2.bitFollowUpWithoutMD_RNCS = 0 and
            t2.bit1to1Specializing = 0 and
            t2.bitExtendedCrisisManagement = 0 then 1 else 0 end),
    E1 = sum(case when t2.bitEmergencyLifeThreatening = 1 then 1 else 0 end),
    E2 = sum(case when t2.bitEmergencyNonLifeThreatening = 1 then 1 else 0 end),
    E3 = sum(case when t2.bitNonEmergencyUrgent = 1 then 1 else 0 end),
    E4 = sum(case when t2.bitUrgentSeenWithin72hrsYes = 1 then 1 else 0 end),
    E5 = sum(case when t2.bitUrgentSeenWithin72hrsNo = 1 then 1 else 0 end),
    E6 = sum(case when t2.bitEvalWithoutMD_RNCS = 1 then 1 else 0 end),
    E7 = sum(case when t2.bitFollowUpWithoutMD_RNCS = 1 then 1 else 0 end),
    E8 = sum(case when t2.bitEvalWithMD_RNCS = 1 then 1 else 0 end),
    E9 = sum(case when t2.bitFollowUpWithMD_RNCS = 1 then 1 else 0 end),
    E10 = sum(case when t2.bit1to1Specializing = 1 then 1 else 0 end),
    E11 = sum(case when t2.tIntSpecializingHours >= 2 then 1 else 0 end),
    E12 = sum(case when t2.bitExtendedCrisisManagement = 1 then 1 else 0 end),
    E13 = sum(case when t2.tIntExtendedCrisisManagementHours >= 3 then 1 else 0 end),

    ----Evaluation location ------------------
    EL0 = sum(case when t1.tIntEvaluationLocation_Index = 0 then 1 else 0 end),
    EL1 = sum(case when t1.tIntEvaluationLocation_Index = 1 then 1 else 0 end),
    EL2 = sum(case when t1.tIntEvaluationLocation_Index = 2 then 1 else 0 end),
    EL3 = sum(case when t1.tIntEvaluationLocation_Index = 3 then 1 else 0 end),
    EL4 = sum(case when t1.tIntEvaluationLocation_Index = 4 then 1 else 0 end),
    EL5 = sum(case when t1.tIntEvaluationLocation_Index = 5 then 1 else 0 end),
    EL6 = sum(case when t1.tIntEvaluationLocation_Index = 6 then 1 else 0 end),
    EL7 = sum(case when t1.tIntEvaluationLocation_Index = 7 then 1 else 0 end),
    EL8 = sum(case when t1.tIntEvaluationLocation_Index = 8 then 1 else 0 end),
    EL9 = sum(case when t1.tIntEvaluationLocation_Index = 9 then 1 else 0 end),
    EL10 = sum(case when
             t1.tIntEvaluationLocation_Index = 10 or
             t1.tIntEvaluationLocation_Index = 11 or
             t1.tIntEvaluationLocation_Index = 12 or
             t1.tIntEvaluationLocation_Index = 13 or
             t1.tIntEvaluationLocation_Index = 14 then 1 else 0 end),
    EL11 = sum(case when t1.tIntEvaluationLocation_Index = 15 then 1 else 0 end),

    ------------------  Total Mobile for evaluation location 07/26/06 ---------------------------------
    EL12 = sum(case when
             t1.tIntEvaluationLocation_Index = 3 or
             t1.tIntEvaluationLocation_Index = 4 or
             t1.tIntEvaluationLocation_Index = 5 or
             t1.tIntEvaluationLocation_Index = 6 or
             t1.tIntEvaluationLocation_Index = 7 or
             t1.tIntEvaluationLocation_Index = 8 or
             t1.tIntEvaluationLocation_Index = 9 or
             t1.tIntEvaluationLocation_Index = 10 or
             t1.tIntEvaluationLocation_Index = 11 or
             t1.tIntEvaluationLocation_Index = 12 or
             t1.tIntEvaluationLocation_Index = 13 or
             t1.tIntEvaluationLocation_Index = 14 or
             t1.tIntEvaluationLocation_Index = 15 then 1 else 0 end),                              

    ---diagnosis -----
    Dx0 = sum(case when t3.bitMHonly = 0 and
                        t3.bitSAonly = 0 and
                        t3.bitDualDiagnos = 0 then 1 else 0 end),
    Dx1 = sum(case when t3.bitMHonly = 1 then 1 else 0 end),
    Dx2 = sum(case when t3.bitSAonly = 1 then 1 else 0 end),
    Dx3 = sum(case when t3.bitDualDiagnos = 1 then 1 else 0 end),

    ----disposition ---------
    DS0 = sum(case when t1.sIntDispositionIndex = 0 then 1 else 0 end),
    DS1 = sum(case when t1.sIntDispositionIndex = 1 then 1 else 0 end),
    DS2 = sum(case when t1.sIntDispositionIndex = 2 then 1 else 0 end),
    DS3 = sum(case when t1.sIntDispositionIndex = 3 then 1 else 0 end),
    DS4 = sum(case when t1.sIntDispositionIndex = 4 then 1 else 0 end),
    DS5 = sum(case when t1.sIntDispositionIndex = 5 then 1 else 0 end),
    DS6 = sum(case when t1.sIntDispositionIndex = 6 then 1 else 0 end),
    DS7 = sum(case when t1.sIntDispositionIndex = 7 then 1 else 0 end),
    DS8 = sum(case when t1.sIntDispositionIndex = 8 then 1 else 0 end),
    DS9 = sum(case when t1.sIntDispositionIndex = 9 then 1 else 0 end),
    DS10 = sum(case when t1.sIntDispositionIndex = 10 then 1 else 0 end),
    DS11 = sum(case when t1.sIntDispositionIndex = 11 then 1 else 0 end),
    DS12 = sum(case when t1.sIntDispositionIndex = 12 then 1 else 0 end),
    DS13 = sum(case when t1.sIntDispositionIndex = 13 then 1 else 0 end),
    DS14 = sum(case when t1.sIntDispositionIndex = 14 then 1 else 0 end),
    DS15 = sum(case when t1.sIntDispositionIndex = 15 then 1 else 0 end),
    DS16 = sum(case when t1.sIntDispositionIndex = 16 then 1 else 0 end),
    DS17 = sum(case when t1.sIntDispositionIndex = 17 then 1 else 0 end),
    DS18 = sum(case when t1.sIntDispositionIndex = 18 then 1 else 0 end),
    DS19 = sum(case when t1.sIntDispositionIndex = 19 then 1 else 0 end),
    DS20 = sum(case when t1.sIntDispositionIndex = 20 then 1 else 0 end),
    DS21 = sum(case when t1.sIntDispositionIndex = 21 then 1 else 0 end),
    DS22 = sum(case when t1.sIntDispositionIndex = 22 then 1 else 0 end),
    DS23 = sum(case when t1.sIntDispositionIndex = 23 then 1 else 0 end),
    DS24 = sum(case when t1.sIntDispositionIndex = 24 then 1 else 0 end),
    DS25 = sum(case when t1.sIntDispositionIndex = 25 then 1 else 0 end),
    DS26 = sum(case when t1.sIntDispositionIndex = 26 then 1 else 0 end),
    DS27 = sum(case when t1.sIntDispositionIndex = 27 then 1 else 0 end),
    --  Inpatient psychiatric  07/26/06 ---
    DS28 = sum(case when t1.sIntDispositionIndex = 4 or t1.sIntDispositionIndex = 5 then 1 else 0 end)
    INTO #tblcount
    FROM newESP_tblEncounter t1, newESP_tblRenderService t2, newESP_tblDiagnoses t3, newESP_tblClients t4, newESP_tlkpEspReagions t5 where t1.intRendServiceIdFK = t2.intRenderedServiceId
    and t1.intDiagnosesIdFK = t3.intDiagnosId and t1.intClientIdFK = t4.intClientId and t5.ESP_index = t1.ESP_Index
    and t1.Date_of_Service between @startdate and @enddate
    GROUP BY t1.tIntAge_Index


    select
    State,
    5 as Age_Index,
    sum(TotalEncounter) AS SumOfTotalEncounter,
    sum(Male) AS SumOfMale,
    sum(Female) AS SumOfFemale,
    sum(Unknown) AS SumOfUnknown,
    sum(HL) AS SumOfHL,
    sum(DMH) AS SumOfDMH,
    sum(DYS) AS SumOfDYS,
    sum(DMR) AS SumOfDMR,
    sum(DSS) AS SumOfDSS,
    sum(F1) AS SumOfF1,
    sum(F2) AS SumOfF2,
    sum(F3) AS SumOfF3,
    sum(F4) AS SumOfF4,
    sum(F5) AS SumOfF5,
    sum(F6) AS SumOfF6,
    sum(F7) AS SumOfF7,
    sum(F8) AS SumOfF8,
    sum(F9) AS SumOfF9,
    sum(F10) AS SumOfF10,
    sum(F11) AS SumOfF11,
    sum(F12) AS SumOfF12,
    sum(F13) AS SumOfF13,
    sum(F14) AS SumOfF14,
    sum(M0) AS SumOfM0,
    sum(M1) AS SumOfM1,
    sum(M2) AS SumOfM2,
    sum(M3) AS SumOfM3,
    sum(E0) AS SumOfE0,
    sum(E1) AS SumOfE1,
    sum(E2) AS SumOfE2,
    sum(E3) AS SumOfE3,
    sum(E4) AS SumOfE4,
    sum(E5) AS SumOfE5,
    sum(E6) AS SumOfE6,
    sum(E7) AS SumOfE7,
    sum(E8) AS SumOfE8,
    sum(E9) AS SumOfE9,
    sum(E10) AS SumOfE10,
    sum(E11) AS SumOfE11,
    sum(E12) AS SumOfE12,
    sum(E13) AS SumOfE13,
    sum(EL0) AS SumOfEL0,
    sum(EL1) AS SumOfEL1,
    sum(EL2) AS SumOfEL2,
    sum(EL3) AS SumOfEL3,
    sum(EL4) AS SumOfEL4,
    sum(EL5) AS SumOfEL5,
    sum(EL6) AS SumOfEL6,
    sum(EL7) AS SumOfEL7,
    sum(EL8) AS SumOfEL8,
    sum(EL9) AS SumOfEL9,
    sum(EL10) AS SumOfEL10,
    sum(EL11) AS SumOfEL11,
    sum(EL12) AS SumOfEL12,  ---------------
    sum(Dx0) AS SumOfDx0,
    sum(Dx1) AS SumOfDx1,
    sum(Dx2) AS SumOfDx2,
    sum(Dx3) AS SumOfDx3,
    sum(DS0) AS SumOfDS0,
    sum(DS1) AS SumOfDS1,
    sum(DS2) AS SumOfDS2,
    sum(DS3) AS SumOfDS3,
    sum(DS4) AS SumOfDS4,
    sum(DS5) AS SumOfDS5,
    sum(DS6) AS SumOfDS6,
    sum(DS7) AS SumOfDS7,
    sum(DS8) AS SumOfDS8,
    sum(DS9) AS SumOfDS9,
    sum(DS10) AS SumOfDS10,
    sum(DS11) AS SumOfDS11,
    sum(DS12) AS SumOfDS12,
    sum(DS13) AS SumOfDS13,
    sum(DS14) AS SumOfDS14,
    sum(DS15) AS SumOfDS15,
    sum(DS16) AS SumOfDS16,
    sum(DS17) AS SumOfDS17,
    sum(DS18) AS SumOfDS18,
    sum(DS19) AS SumOfDS19,
    sum(DS20) AS SumOfDS20,
    sum(DS21) AS SumOfDS21,
    sum(DS22) AS SumOfDS22,
    sum(DS23) AS SumOfDS23,
    sum(DS24) AS SumOfDS24,
    sum(DS25) AS SumOfDS25,
    sum(DS26) AS SumOfDS26,
    sum(DS27) AS SumOfDS27,
    sum(DS28) AS SumOfDS28  ----------------
    into #tbltotal
    FROM #tblcount group by State

    --INSERT TOTAL RECORDS THAT HAVE AGE_INDEX 5
    INSERT INTO #tblcount select * from #tbltotal

    if exists(select top 1 1 from sysobjects where name = 'RPT4791_6890' and xtype = 'U')
    begin
     drop table RPT4791_6890
    end
    ----CREATE TABLE RPT4791_6890 FOR CRYTAL REPORT
    CREATE TABLE RPT4791_6890
    (
    State int,
    TotalEncounter_S int, TotalEncounter_0 int, TotalEncounter_1 int, TotalEncounter_2 int, TotalEncounter_3 int, TotalEncounter_4 int,
    Male_S int, Male_0 int, Male_1 int, Male_2 int, Male_3 int, Male_4 int,
    Female_S int, Female_0 int, Female_1 int, Female_2 int, Female_3 int, Female_4 int,
    Unknown_S int, Unknown_0 int, Unknown_1 int, Unknown_2 int, Unknown_3 int, Unknown_4 int,
    HL_S int, HL_0 int, HL_1 int, HL_2 int, HL_3 int, HL_4 int,
    DMH_S int, DMH_0 int, DMH_1 int, DMH_2 int, DMH_3 int, DMH_4 int,
    DYS_S int, DYS_0 int, DYS_1 int, DYS_2 int, DYS_3 int, DYS_4 int,
    DMR_S int, DMR_0 int, DMR_1 int, DMR_2 int, DMR_3 int, DMR_4 int,
    DSS_S int, DSS_0 int, DSS_1 int, DSS_2 int, DSS_3 int, DSS_4 int,
    F1_S int, F1_0 int, F1_1 int, F1_2 int, F1_3 int, F1_4 int,
    F2_S int, F2_0 int, F2_1 int, F2_2 int, F2_3 int, F2_4 int,
    F3_S int, F3_0 int, F3_1 int, F3_2 int, F3_3 int, F3_4 int,
    F4_S int, F4_0 int, F4_1 int, F4_2 int, F4_3 int, F4_4 int,
    F5_S int, F5_0 int, F5_1 int, F5_2 int, F5_3 int, F5_4 int,
    F6_S int, F6_0 int, F6_1 int, F6_2 int, F6_3 int, F6_4 int,
    F7_S int, F7_0 int, F7_1 int, F7_2 int, F7_3 int, F7_4 int,
    F8_S int, F8_0 int, F8_1 int, F8_2 int, F8_3 int, F8_4 int,
    F9_S int, F9_0 int, F9_1 int, F9_2 int, F9_3 int, F9_4 int,
    F10_S int, F10_0 int, F10_1 int, F10_2 int, F10_3 int, F10_4 int,
    F11_S int, F11_0 int, F11_1 int, F11_2 int, F11_3 int, F11_4 int,
    F12_S int, F12_0 int, F12_1 int, F12_2 int, F12_3 int, F12_4 int,
    F13_S int, F13_0 int, F13_1 int, F13_2 int, F13_3 int, F13_4 int,
    F14_S int, F14_0 int, F14_1 int, F14_2 int, F14_3 int, F14_4 int,
    M0_S int, M0_0 int, M0_1 int, M0_2 int, M0_3 int, M0_4 int,
    M1_S int, M1_0 int, M1_1 int, M1_2 int, M1_3 int, M1_4 int,
    M2_S int, M2_0 int, M2_1 int, M2_2 int, M2_3 int, M2_4 int,
    M3_S int, M3_0 int, M3_1 int, M3_2 int, M3_3 int, M3_4 int,
    E0_S int, E0_0 int, E0_1 int, E0_2 int, E0_3 int, E0_4 int,
    E1_S int, E1_0 int, E1_1 int, E1_2 int, E1_3 int, E1_4 int,
    E2_S int, E2_0 int, E2_1 int, E2_2 int, E2_3 int, E2_4 int,
    E3_S int, E3_0 int, E3_1 int, E3_2 int, E3_3 int, E3_4 int,
    E4_S int, E4_0 int, E4_1 int, E4_2 int, E4_3 int, E4_4 int,
    E5_S int, E5_0 int, E5_1 int, E5_2 int, E5_3 int, E5_4 int,
    E6_S int, E6_0 int, E6_1 int, E6_2 int, E6_3 int, E6_4 int,
    E7_S int, E7_0 int, E7_1 int, E7_2 int, E7_3 int, E7_4 int,
    E8_S int, E8_0 int, E8_1 int, E8_2 int, E8_3 int, E8_4 int,
    E9_S int, E9_0 int, E9_1 int, E9_2 int, E9_3 int, E9_4 int,
    E10_S int, E10_0 int, E10_1 int, E10_2 int, E10_3 int, E10_4 int,
    E11_S int, E11_0 int, E11_1 int, E11_2 int, E11_3 int, E11_4 int,
    E12_S int, E12_0 int, E12_1 int, E12_2 int, E12_3 int, E12_4 int,
    E13_S int, E13_0 int, E13_1 int, E13_2 int, E13_3 int, E13_4 int,
    EL0_S int, EL0_0 int, EL0_1 int, EL0_2 int, EL0_3 int, EL0_4 int,
    EL1_S int, EL1_0 int, EL1_1 int, EL1_2 int, EL1_3 int, EL1_4 int,
    EL2_S int, EL2_0 int, EL2_1 int, EL2_2 int, EL2_3 int, EL2_4 int,
    EL3_S int, EL3_0 int, EL3_1 int, EL3_2 int, EL3_3 int, EL3_4 int,
    EL4_S int, EL4_0 int, EL4_1 int, EL4_2 int, EL4_3 int, EL4_4 int,
    EL5_S int, EL5_0 int, EL5_1 int, EL5_2 int, EL5_3 int, EL5_4 int,
    EL6_S int, EL6_0 int, EL6_1 int, EL6_2 int, EL6_3 int, EL6_4 int,
    EL7_S int, EL7_0 int, EL7_1 int, EL7_2 int, EL7_3 int, EL7_4 int,
    EL8_S int, EL8_0 int, EL8_1 int, EL8_2 int, EL8_3 int, EL8_4 int,
    EL9_S int, EL9_0 int, EL9_1 int, EL9_2 int, EL9_3 int, EL9_4 int,
    EL10_S int, EL10_0 int, EL10_1 int, EL10_2 int, EL10_3 int, EL10_4 int,
    EL11_S int, EL11_0 int, EL11_1 int, EL11_2 int, EL11_3 int, EL11_4 int,
    EL12_S int, EL12_0 int, EL12_1 int, EL12_2 int, EL12_3 int, EL12_4 int, --------------
    Dx0_S int, Dx0_0 int, Dx0_1 int, Dx0_2 int, Dx0_3 int, Dx0_4 int,
    Dx1_S int, Dx1_0 int, Dx1_1 int, Dx1_2 int, Dx1_3 int, Dx1_4 int,
    Dx2_S int, Dx2_0 int, Dx2_1 int, Dx2_2 int, Dx2_3 int, Dx2_4 int,
    Dx3_S int, Dx3_0 int, Dx3_1 int, Dx3_2 int, Dx3_3 int, Dx3_4 int,
    DS0_S int, DS0_0 int, DS0_1 int, DS0_2 int, DS0_3 int, DS0_4 int,
    DS1_S int, DS1_0 int, DS1_1 int, DS1_2 int, DS1_3 int, DS1_4 int,
    DS2_S int, DS2_0 int, DS2_1 int, DS2_2 int, DS2_3 int, DS2_4 int,
    DS3_S int, DS3_0 int, DS3_1 int, DS3_2 int, DS3_3 int, DS3_4 int,
    DS4_S int, DS4_0 int, DS4_1 int, DS4_2 int, DS4_3 int, DS4_4 int,
    DS5_S int, DS5_0 int, DS5_1 int, DS5_2 int, DS5_3 int, DS5_4 int,
    DS6_S int, DS6_0 int, DS6_1 int, DS6_2 int, DS6_3 int, DS6_4 int,
    DS7_S int, DS7_0 int, DS7_1 int, DS7_2 int, DS7_3 int, DS7_4 int,
    DS8_S int, DS8_0 int, DS8_1 int, DS8_2 int, DS8_3 int, DS8_4 int,
    DS9_S int, DS9_0 int, DS9_1 int, DS9_2 int, DS9_3 int, DS9_4 int,
    DS10_S int, DS10_0 int, DS10_1 int, DS10_2 int, DS10_3 int, DS10_4 int,
    DS11_S int, DS11_0 int, DS11_1 int, DS11_2 int, DS11_3 int, DS11_4 int,
    DS12_S int, DS12_0 int, DS12_1 int, DS12_2 int, DS12_3 int, DS12_4 int,
    DS13_S int, DS13_0 int, DS13_1 int, DS13_2 int, DS13_3 int, DS13_4 int,
    DS14_S int, DS14_0 int, DS14_1 int, DS14_2 int, DS14_3 int, DS14_4 int,
    DS15_S int, DS15_0 int, DS15_1 int, DS15_2 int, DS15_3 int, DS15_4 int,
    DS16_S int, DS16_0 int, DS16_1 int, DS16_2 int, DS16_3 int, DS16_4 int,
    DS17_S int, DS17_0 int, DS17_1 int, DS17_2 int, DS17_3 int, DS17_4 int,
    DS18_S int, DS18_0 int, DS18_1 int, DS18_2 int, DS18_3 int, DS18_4 int,
    DS19_S int, DS19_0 int, DS19_1 int, DS19_2 int, DS19_3 int, DS19_4 int,
    DS20_S int, DS20_0 int, DS20_1 int, DS20_2 int, DS20_3 int, DS20_4 int,
    DS21_S int, DS21_0 int, DS21_1 int, DS21_2 int, DS21_3 int, DS21_4 int,
    DS22_S int, DS22_0 int, DS22_1 int, DS22_2 int, DS22_3 int, DS22_4 int,
    DS23_S int, DS23_0 int, DS23_1 int, DS23_2 int, DS23_3 int, DS23_4 int,
    DS24_S int, DS24_0 int, DS24_1 int, DS24_2 int, DS24_3 int, DS24_4 int,
    DS25_S int, DS25_0 int, DS25_1 int, DS25_2 int, DS25_3 int, DS25_4 int,
    DS26_S int, DS26_0 int, DS26_1 int, DS26_2 int, DS26_3 int, DS26_4 int,
    DS27_S int, DS27_0 int, DS27_1 int, DS27_2 int, DS27_3 int, DS27_4 int,
    DS28_S int, DS28_0 int, DS28_1 int, DS28_2 int, DS28_3 int, DS28_4 int -------------
    )
    ---insert unique esp_name, region into this RPT4791_6890 table
    INSERT INTO RPT4791_6890 (State) values (1)

    declare @AGE_INDEX int
    select @AGE_INDEX = 0

    WHILE @AGE_INDEX <= 5
    BEGIN
    UPDATE RPT4791_6890
    SET
    RPT4791_6890.TotalEncounter_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.TotalEncounter else ISNULL(RPT4791_6890.TotalEncounter_S, 0) END),
    RPT4791_6890.TotalEncounter_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.TotalEncounter else ISNULL(RPT4791_6890.TotalEncounter_0, 0) END),
    RPT4791_6890.TotalEncounter_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.TotalEncounter else ISNULL(RPT4791_6890.TotalEncounter_1, 0) END),
    RPT4791_6890.TotalEncounter_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.TotalEncounter else ISNULL(RPT4791_6890.TotalEncounter_2, 0) END),
    RPT4791_6890.TotalEncounter_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.TotalEncounter else ISNULL(RPT4791_6890.TotalEncounter_3, 0) END),
    RPT4791_6890.TotalEncounter_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.TotalEncounter else ISNULL(RPT4791_6890.TotalEncounter_4, 0) END),
    RPT4791_6890.Male_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.Male else ISNULL(RPT4791_6890.Male_S, 0) END),
    RPT4791_6890.Male_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.Male else ISNULL(RPT4791_6890.Male_0, 0) END),
    RPT4791_6890.Male_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.Male else ISNULL(RPT4791_6890.Male_1, 0) END),
    RPT4791_6890.Male_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.Male else ISNULL(RPT4791_6890.Male_2, 0) END),
    RPT4791_6890.Male_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.Male else ISNULL(RPT4791_6890.Male_3, 0) END),
    RPT4791_6890.Male_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.Male else ISNULL(RPT4791_6890.Male_4, 0) END),
    RPT4791_6890.Female_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.Female else ISNULL(RPT4791_6890.Female_S, 0) END),
    RPT4791_6890.Female_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.Female else ISNULL(RPT4791_6890.Female_0, 0) END),
    RPT4791_6890.Female_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.Female else ISNULL(RPT4791_6890.Female_1, 0) END),
    RPT4791_6890.Female_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.Female else ISNULL(RPT4791_6890.Female_2, 0) END),
    RPT4791_6890.Female_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.Female else ISNULL(RPT4791_6890.Female_3, 0) END),
    RPT4791_6890.Female_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.Female else ISNULL(RPT4791_6890.Female_4, 0) END),
    RPT4791_6890.Unknown_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.Unknown else ISNULL(RPT4791_6890.Unknown_S, 0) END),
    RPT4791_6890.Unknown_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.Unknown else ISNULL(RPT4791_6890.Unknown_0, 0) END),
    RPT4791_6890.Unknown_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.Unknown else ISNULL(RPT4791_6890.Unknown_1, 0) END),
    RPT4791_6890.Unknown_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.Unknown else ISNULL(RPT4791_6890.Unknown_2, 0) END),
    RPT4791_6890.Unknown_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.Unknown else ISNULL(RPT4791_6890.Unknown_3, 0) END),
    RPT4791_6890.Unknown_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.Unknown else ISNULL(RPT4791_6890.Unknown_4, 0) END),
    RPT4791_6890.HL_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.HL else ISNULL(RPT4791_6890.HL_S, 0) END),
    RPT4791_6890.HL_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.HL else ISNULL(RPT4791_6890.HL_0, 0) END),
    RPT4791_6890.HL_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.HL else ISNULL(RPT4791_6890.HL_1, 0) END),
    RPT4791_6890.HL_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.HL else ISNULL(RPT4791_6890.HL_2, 0) END),
    RPT4791_6890.HL_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.HL else ISNULL(RPT4791_6890.HL_3, 0) END),
    RPT4791_6890.HL_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.HL else ISNULL(RPT4791_6890.HL_4, 0) END),
    RPT4791_6890.DMH_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DMH else ISNULL(RPT4791_6890.DMH_S, 0) END),
    RPT4791_6890.DMH_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DMH else ISNULL(RPT4791_6890.DMH_0, 0) END),
    RPT4791_6890.DMH_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DMH else ISNULL(RPT4791_6890.DMH_1, 0) END),
    RPT4791_6890.DMH_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DMH else ISNULL(RPT4791_6890.DMH_2, 0) END),
    RPT4791_6890.DMH_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DMH else ISNULL(RPT4791_6890.DMH_3, 0) END),
    RPT4791_6890.DMH_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DMH else ISNULL(RPT4791_6890.DMH_4, 0) END),
    RPT4791_6890.DYS_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DYS else ISNULL(RPT4791_6890.DYS_S, 0) END),
    RPT4791_6890.DYS_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DYS else ISNULL(RPT4791_6890.DYS_0, 0) END),
    RPT4791_6890.DYS_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DYS else ISNULL(RPT4791_6890.DYS_1, 0) END),
    RPT4791_6890.DYS_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DYS else ISNULL(RPT4791_6890.DYS_2, 0) END),
    RPT4791_6890.DYS_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DYS else ISNULL(RPT4791_6890.DYS_3, 0) END),
    RPT4791_6890.DYS_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DYS else ISNULL(RPT4791_6890.DYS_4, 0) END),
    RPT4791_6890.DMR_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DMR else ISNULL(RPT4791_6890.DMR_S, 0) END),
    RPT4791_6890.DMR_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DMR else ISNULL(RPT4791_6890.DMR_0, 0) END),
    RPT4791_6890.DMR_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DMR else ISNULL(RPT4791_6890.DMR_1, 0) END),
    RPT4791_6890.DMR_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DMR else ISNULL(RPT4791_6890.DMR_2, 0) END),
    RPT4791_6890.DMR_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DMR else ISNULL(RPT4791_6890.DMR_3, 0) END),
    RPT4791_6890.DMR_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DMR else ISNULL(RPT4791_6890.DMR_4, 0) END),
    RPT4791_6890.DSS_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DSS else ISNULL(RPT4791_6890.DSS_S, 0) END),
    RPT4791_6890.DSS_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DSS else ISNULL(RPT4791_6890.DSS_0, 0) END),
    RPT4791_6890.DSS_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DSS else ISNULL(RPT4791_6890.DSS_1, 0) END),
    RPT4791_6890.DSS_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DSS else ISNULL(RPT4791_6890.DSS_2, 0) END),
    RPT4791_6890.DSS_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DSS else ISNULL(RPT4791_6890.DSS_3, 0) END),
    RPT4791_6890.DSS_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DSS else ISNULL(RPT4791_6890.DSS_4, 0) END),
    RPT4791_6890.F1_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F1 else ISNULL(RPT4791_6890.F1_S, 0) END),
    RPT4791_6890.F1_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F1 else ISNULL(RPT4791_6890.F1_0, 0) END),
    RPT4791_6890.F1_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F1 else ISNULL(RPT4791_6890.F1_1, 0) END),
    RPT4791_6890.F1_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F1 else ISNULL(RPT4791_6890.F1_2, 0) END),
    RPT4791_6890.F1_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F1 else ISNULL(RPT4791_6890.F1_3, 0) END),
    RPT4791_6890.F1_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F1 else ISNULL(RPT4791_6890.F1_4, 0) END),
    RPT4791_6890.F2_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F2 else ISNULL(RPT4791_6890.F2_S, 0) END),
    RPT4791_6890.F2_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F2 else ISNULL(RPT4791_6890.F2_0, 0) END),
    RPT4791_6890.F2_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F2 else ISNULL(RPT4791_6890.F2_1, 0) END),
    RPT4791_6890.F2_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F2 else ISNULL(RPT4791_6890.F2_2, 0) END),
    RPT4791_6890.F2_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F2 else ISNULL(RPT4791_6890.F2_3, 0) END),
    RPT4791_6890.F2_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F2 else ISNULL(RPT4791_6890.F2_4, 0) END),
    RPT4791_6890.F3_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F3 else ISNULL(RPT4791_6890.F3_S, 0) END),
    RPT4791_6890.F3_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F3 else ISNULL(RPT4791_6890.F3_0, 0) END),
    RPT4791_6890.F3_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F3 else ISNULL(RPT4791_6890.F3_1, 0) END),
    RPT4791_6890.F3_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F3 else ISNULL(RPT4791_6890.F3_2, 0) END),
    RPT4791_6890.F3_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F3 else ISNULL(RPT4791_6890.F3_3, 0) END),
    RPT4791_6890.F3_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F3 else ISNULL(RPT4791_6890.F3_4, 0) END),
    RPT4791_6890.F4_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F4 else ISNULL(RPT4791_6890.F4_S, 0) END),
    RPT4791_6890.F4_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F4 else ISNULL(RPT4791_6890.F4_0, 0) END),
    RPT4791_6890.F4_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F4 else ISNULL(RPT4791_6890.F4_1, 0) END),
    RPT4791_6890.F4_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F4 else ISNULL(RPT4791_6890.F4_2, 0) END),
    RPT4791_6890.F4_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F4 else ISNULL(RPT4791_6890.F4_3, 0) END),
    RPT4791_6890.F4_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F4 else ISNULL(RPT4791_6890.F4_4, 0) END),
    RPT4791_6890.F5_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F5 else ISNULL(RPT4791_6890.F5_S, 0) END),
    RPT4791_6890.F5_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F5 else ISNULL(RPT4791_6890.F5_0, 0) END),
    RPT4791_6890.F5_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F5 else ISNULL(RPT4791_6890.F5_1, 0) END),
    RPT4791_6890.F5_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F5 else ISNULL(RPT4791_6890.F5_2, 0) END),
    RPT4791_6890.F5_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F5 else ISNULL(RPT4791_6890.F5_3, 0) END),
    RPT4791_6890.F5_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F5 else ISNULL(RPT4791_6890.F5_4, 0) END),
    RPT4791_6890.F6_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F6 else ISNULL(RPT4791_6890.F6_S, 0) END),
    RPT4791_6890.F6_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F6 else ISNULL(RPT4791_6890.F6_0, 0) END),
    RPT4791_6890.F6_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F6 else ISNULL(RPT4791_6890.F6_1, 0) END),
    RPT4791_6890.F6_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F6 else ISNULL(RPT4791_6890.F6_2, 0) END),
    RPT4791_6890.F6_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F6 else ISNULL(RPT4791_6890.F6_3, 0) END),
    RPT4791_6890.F6_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F6 else ISNULL(RPT4791_6890.F6_4, 0) END),
    RPT4791_6890.F7_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F7 else ISNULL(RPT4791_6890.F7_S, 0) END),
    RPT4791_6890.F7_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F7 else ISNULL(RPT4791_6890.F7_0, 0) END),
    RPT4791_6890.F7_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F7 else ISNULL(RPT4791_6890.F7_1, 0) END),
    RPT4791_6890.F7_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F7 else ISNULL(RPT4791_6890.F7_2, 0) END),
    RPT4791_6890.F7_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F7 else ISNULL(RPT4791_6890.F7_3, 0) END),
    RPT4791_6890.F7_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F7 else ISNULL(RPT4791_6890.F7_4, 0) END),
    RPT4791_6890.F8_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F8 else ISNULL(RPT4791_6890.F8_S, 0) END),
    RPT4791_6890.F8_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F8 else ISNULL(RPT4791_6890.F8_0, 0) END),
    RPT4791_6890.F8_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F8 else ISNULL(RPT4791_6890.F8_1, 0) END),
    RPT4791_6890.F8_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F8 else ISNULL(RPT4791_6890.F8_2, 0) END),
    RPT4791_6890.F8_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F8 else ISNULL(RPT4791_6890.F8_3, 0) END),
    RPT4791_6890.F8_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F8 else ISNULL(RPT4791_6890.F8_4, 0) END),
    RPT4791_6890.F9_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F9 else ISNULL(RPT4791_6890.F9_S, 0) END),
    RPT4791_6890.F9_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F9 else ISNULL(RPT4791_6890.F9_0, 0) END),
    RPT4791_6890.F9_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F9 else ISNULL(RPT4791_6890.F9_1, 0) END),
    RPT4791_6890.F9_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F9 else ISNULL(RPT4791_6890.F9_2, 0) END),
    RPT4791_6890.F9_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F9 else ISNULL(RPT4791_6890.F9_3, 0) END),
    RPT4791_6890.F9_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F9 else ISNULL(RPT4791_6890.F9_4, 0) END),
    RPT4791_6890.F10_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F10 else ISNULL(RPT4791_6890.F10_S, 0) END),
    RPT4791_6890.F10_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F10 else ISNULL(RPT4791_6890.F10_0, 0) END),
    RPT4791_6890.F10_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F10 else ISNULL(RPT4791_6890.F10_1, 0) END),
    RPT4791_6890.F10_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F10 else ISNULL(RPT4791_6890.F10_2, 0) END),
    RPT4791_6890.F10_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F10 else ISNULL(RPT4791_6890.F10_3, 0) END),
    RPT4791_6890.F10_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F10 else ISNULL(RPT4791_6890.F10_4, 0) END),
    RPT4791_6890.F11_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F11 else ISNULL(RPT4791_6890.F11_S, 0) END),
    RPT4791_6890.F11_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F11 else ISNULL(RPT4791_6890.F11_0, 0) END),
    RPT4791_6890.F11_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F11 else ISNULL(RPT4791_6890.F11_1, 0) END),
    RPT4791_6890.F11_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F11 else ISNULL(RPT4791_6890.F11_2, 0) END),
    RPT4791_6890.F11_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F11 else ISNULL(RPT4791_6890.F11_3, 0) END),
    RPT4791_6890.F11_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F11 else ISNULL(RPT4791_6890.F11_4, 0) END),
    RPT4791_6890.F12_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F12 else ISNULL(RPT4791_6890.F12_S, 0) END),
    RPT4791_6890.F12_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F12 else ISNULL(RPT4791_6890.F12_0, 0) END),
    RPT4791_6890.F12_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F12 else ISNULL(RPT4791_6890.F12_1, 0) END),
    RPT4791_6890.F12_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F12 else ISNULL(RPT4791_6890.F12_2, 0) END),
    RPT4791_6890.F12_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F12 else ISNULL(RPT4791_6890.F12_3, 0) END),
    RPT4791_6890.F12_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F12 else ISNULL(RPT4791_6890.F12_4, 0) END),
    RPT4791_6890.F13_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F13 else ISNULL(RPT4791_6890.F13_S, 0) END),
    RPT4791_6890.F13_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F13 else ISNULL(RPT4791_6890.F13_0, 0) END),
    RPT4791_6890.F13_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F13 else ISNULL(RPT4791_6890.F13_1, 0) END),
    RPT4791_6890.F13_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F13 else ISNULL(RPT4791_6890.F13_2, 0) END),
    RPT4791_6890.F13_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F13 else ISNULL(RPT4791_6890.F13_3, 0) END),
    RPT4791_6890.F13_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F13 else ISNULL(RPT4791_6890.F13_4, 0) END),
    RPT4791_6890.F14_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.F14 else ISNULL(RPT4791_6890.F14_S, 0) END),
    RPT4791_6890.F14_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.F14 else ISNULL(RPT4791_6890.F14_0, 0) END),
    RPT4791_6890.F14_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.F14 else ISNULL(RPT4791_6890.F14_1, 0) END),
    RPT4791_6890.F14_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.F14 else ISNULL(RPT4791_6890.F14_2, 0) END),
    RPT4791_6890.F14_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.F14 else ISNULL(RPT4791_6890.F14_3, 0) END),
    RPT4791_6890.F14_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.F14 else ISNULL(RPT4791_6890.F14_4, 0) END),
    RPT4791_6890.M0_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.M0 else ISNULL(RPT4791_6890.M0_S, 0) END),
    RPT4791_6890.M0_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.M0 else ISNULL(RPT4791_6890.M0_0, 0) END),
    RPT4791_6890.M0_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.M0 else ISNULL(RPT4791_6890.M0_1, 0) END),
    RPT4791_6890.M0_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.M0 else ISNULL(RPT4791_6890.M0_2, 0) END),
    RPT4791_6890.M0_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.M0 else ISNULL(RPT4791_6890.M0_3, 0) END),
    RPT4791_6890.M0_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.M0 else ISNULL(RPT4791_6890.M0_4, 0) END),
    RPT4791_6890.M1_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.M1 else ISNULL(RPT4791_6890.M1_S, 0) END),
    RPT4791_6890.M1_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.M1 else ISNULL(RPT4791_6890.M1_0, 0) END),
    RPT4791_6890.M1_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.M1 else ISNULL(RPT4791_6890.M1_1, 0) END),
    RPT4791_6890.M1_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.M1 else ISNULL(RPT4791_6890.M1_2, 0) END),
    RPT4791_6890.M1_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.M1 else ISNULL(RPT4791_6890.M1_3, 0) END),
    RPT4791_6890.M1_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.M1 else ISNULL(RPT4791_6890.M1_4, 0) END),
    RPT4791_6890.M2_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.M2 else ISNULL(RPT4791_6890.M2_S, 0) END),
    RPT4791_6890.M2_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.M2 else ISNULL(RPT4791_6890.M2_0, 0) END),
    RPT4791_6890.M2_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.M2 else ISNULL(RPT4791_6890.M2_1, 0) END),
    RPT4791_6890.M2_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.M2 else ISNULL(RPT4791_6890.M2_2, 0) END),
    RPT4791_6890.M2_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.M2 else ISNULL(RPT4791_6890.M2_3, 0) END),
    RPT4791_6890.M2_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.M2 else ISNULL(RPT4791_6890.M2_4, 0) END),
    RPT4791_6890.M3_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.M3 else ISNULL(RPT4791_6890.M3_S, 0) END),
    RPT4791_6890.M3_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.M3 else ISNULL(RPT4791_6890.M3_0, 0) END),
    RPT4791_6890.M3_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.M3 else ISNULL(RPT4791_6890.M3_1, 0) END),
    RPT4791_6890.M3_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.M3 else ISNULL(RPT4791_6890.M3_2, 0) END),
    RPT4791_6890.M3_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.M3 else ISNULL(RPT4791_6890.M3_3, 0) END),
    RPT4791_6890.M3_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.M3 else ISNULL(RPT4791_6890.M3_4, 0) END),
    RPT4791_6890.E0_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E0 else ISNULL(RPT4791_6890.E0_S, 0) END),
    RPT4791_6890.E0_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E0 else ISNULL(RPT4791_6890.E0_0, 0) END),
    RPT4791_6890.E0_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E0 else ISNULL(RPT4791_6890.E0_1, 0) END),
    RPT4791_6890.E0_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E0 else ISNULL(RPT4791_6890.E0_2, 0) END),
    RPT4791_6890.E0_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E0 else ISNULL(RPT4791_6890.E0_3, 0) END),
    RPT4791_6890.E0_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E0 else ISNULL(RPT4791_6890.E0_4, 0) END),
    RPT4791_6890.E1_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E1 else ISNULL(RPT4791_6890.E1_S, 0) END),
    RPT4791_6890.E1_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E1 else ISNULL(RPT4791_6890.E1_0, 0) END),
    RPT4791_6890.E1_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E1 else ISNULL(RPT4791_6890.E1_1, 0) END),
    RPT4791_6890.E1_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E1 else ISNULL(RPT4791_6890.E1_2, 0) END),
    RPT4791_6890.E1_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E1 else ISNULL(RPT4791_6890.E1_3, 0) END),
    RPT4791_6890.E1_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E1 else ISNULL(RPT4791_6890.E1_4, 0) END),
    RPT4791_6890.E2_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E2 else ISNULL(RPT4791_6890.E2_S, 0) END),
    RPT4791_6890.E2_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E2 else ISNULL(RPT4791_6890.E2_0, 0) END),
    RPT4791_6890.E2_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E2 else ISNULL(RPT4791_6890.E2_1, 0) END),
    RPT4791_6890.E2_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E2 else ISNULL(RPT4791_6890.E2_2, 0) END),
    RPT4791_6890.E2_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E2 else ISNULL(RPT4791_6890.E2_3, 0) END),
    RPT4791_6890.E2_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E2 else ISNULL(RPT4791_6890.E2_4, 0) END),
    RPT4791_6890.E3_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E3 else ISNULL(RPT4791_6890.E3_S, 0) END),
    RPT4791_6890.E3_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E3 else ISNULL(RPT4791_6890.E3_0, 0) END),
    RPT4791_6890.E3_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E3 else ISNULL(RPT4791_6890.E3_1, 0) END),
    RPT4791_6890.E3_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E3 else ISNULL(RPT4791_6890.E3_2, 0) END),
    RPT4791_6890.E3_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E3 else ISNULL(RPT4791_6890.E3_3, 0) END),
    RPT4791_6890.E3_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E3 else ISNULL(RPT4791_6890.E3_4, 0) END),
    RPT4791_6890.E4_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E4 else ISNULL(RPT4791_6890.E4_S, 0) END),
    RPT4791_6890.E4_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E4 else ISNULL(RPT4791_6890.E4_0, 0) END),
    RPT4791_6890.E4_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E4 else ISNULL(RPT4791_6890.E4_1, 0) END),
    RPT4791_6890.E4_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E4 else ISNULL(RPT4791_6890.E4_2, 0) END),
    RPT4791_6890.E4_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E4 else ISNULL(RPT4791_6890.E4_3, 0) END),
    RPT4791_6890.E4_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E4 else ISNULL(RPT4791_6890.E4_4, 0) END),
    RPT4791_6890.E5_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E5 else ISNULL(RPT4791_6890.E5_S, 0) END),
    RPT4791_6890.E5_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E5 else ISNULL(RPT4791_6890.E5_0, 0) END),
    RPT4791_6890.E5_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E5 else ISNULL(RPT4791_6890.E5_1, 0) END),
    RPT4791_6890.E5_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E5 else ISNULL(RPT4791_6890.E5_2, 0) END),
    RPT4791_6890.E5_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E5 else ISNULL(RPT4791_6890.E5_3, 0) END),
    RPT4791_6890.E5_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E5 else ISNULL(RPT4791_6890.E5_4, 0) END),
    RPT4791_6890.E6_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E6 else ISNULL(RPT4791_6890.E6_S, 0) END),
    RPT4791_6890.E6_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E6 else ISNULL(RPT4791_6890.E6_0, 0) END),
    RPT4791_6890.E6_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E6 else ISNULL(RPT4791_6890.E6_1, 0) END),
    RPT4791_6890.E6_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E6 else ISNULL(RPT4791_6890.E6_2, 0) END),
    RPT4791_6890.E6_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E6 else ISNULL(RPT4791_6890.E6_3, 0) END),
    RPT4791_6890.E6_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E6 else ISNULL(RPT4791_6890.E6_4, 0) END),
    RPT4791_6890.E7_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E7 else ISNULL(RPT4791_6890.E7_S, 0) END),
    RPT4791_6890.E7_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E7 else ISNULL(RPT4791_6890.E7_0, 0) END),
    RPT4791_6890.E7_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E7 else ISNULL(RPT4791_6890.E7_1, 0) END),
    RPT4791_6890.E7_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E7 else ISNULL(RPT4791_6890.E7_2, 0) END),
    RPT4791_6890.E7_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E7 else ISNULL(RPT4791_6890.E7_3, 0) END),
    RPT4791_6890.E7_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E7 else ISNULL(RPT4791_6890.E7_4, 0) END),
    RPT4791_6890.E8_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E8 else ISNULL(RPT4791_6890.E8_S, 0) END),
    RPT4791_6890.E8_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E8 else ISNULL(RPT4791_6890.E8_0, 0) END),
    RPT4791_6890.E8_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E8 else ISNULL(RPT4791_6890.E8_1, 0) END),
    RPT4791_6890.E8_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E8 else ISNULL(RPT4791_6890.E8_2, 0) END),
    RPT4791_6890.E8_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E8 else ISNULL(RPT4791_6890.E8_3, 0) END),
    RPT4791_6890.E8_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E8 else ISNULL(RPT4791_6890.E8_4, 0) END),
    RPT4791_6890.E9_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E9 else ISNULL(RPT4791_6890.E9_S, 0) END),
    RPT4791_6890.E9_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E9 else ISNULL(RPT4791_6890.E9_0, 0) END),
    RPT4791_6890.E9_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E9 else ISNULL(RPT4791_6890.E9_1, 0) END),
    RPT4791_6890.E9_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E9 else ISNULL(RPT4791_6890.E9_2, 0) END),
    RPT4791_6890.E9_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E9 else ISNULL(RPT4791_6890.E9_3, 0) END),
    RPT4791_6890.E9_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E9 else ISNULL(RPT4791_6890.E9_4, 0) END),
    RPT4791_6890.E10_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E10 else ISNULL(RPT4791_6890.E10_S, 0) END),
    RPT4791_6890.E10_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E10 else ISNULL(RPT4791_6890.E10_0, 0) END),
    RPT4791_6890.E10_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E10 else ISNULL(RPT4791_6890.E10_1, 0) END),
    RPT4791_6890.E10_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E10 else ISNULL(RPT4791_6890.E10_2, 0) END),
    RPT4791_6890.E10_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E10 else ISNULL(RPT4791_6890.E10_3, 0) END),
    RPT4791_6890.E10_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E10 else ISNULL(RPT4791_6890.E10_4, 0) END),
    RPT4791_6890.E11_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E11 else ISNULL(RPT4791_6890.E11_S, 0) END),
    RPT4791_6890.E11_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E11 else ISNULL(RPT4791_6890.E11_0, 0) END),
    RPT4791_6890.E11_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E11 else ISNULL(RPT4791_6890.E11_1, 0) END),
    RPT4791_6890.E11_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E11 else ISNULL(RPT4791_6890.E11_2, 0) END),
    RPT4791_6890.E11_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E11 else ISNULL(RPT4791_6890.E11_3, 0) END),
    RPT4791_6890.E11_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E11 else ISNULL(RPT4791_6890.E11_4, 0) END),
    RPT4791_6890.E12_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E12 else ISNULL(RPT4791_6890.E12_S, 0) END),
    RPT4791_6890.E12_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E12 else ISNULL(RPT4791_6890.E12_0, 0) END),
    RPT4791_6890.E12_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E12 else ISNULL(RPT4791_6890.E12_1, 0) END),
    RPT4791_6890.E12_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E12 else ISNULL(RPT4791_6890.E12_2, 0) END),
    RPT4791_6890.E12_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E12 else ISNULL(RPT4791_6890.E12_3, 0) END),
    RPT4791_6890.E12_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E12 else ISNULL(RPT4791_6890.E12_4, 0) END),
    RPT4791_6890.E13_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.E13 else ISNULL(RPT4791_6890.E13_S, 0) END),
    RPT4791_6890.E13_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.E13 else ISNULL(RPT4791_6890.E13_0, 0) END),
    RPT4791_6890.E13_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.E13 else ISNULL(RPT4791_6890.E13_1, 0) END),
    RPT4791_6890.E13_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.E13 else ISNULL(RPT4791_6890.E13_2, 0) END),
    RPT4791_6890.E13_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.E13 else ISNULL(RPT4791_6890.E13_3, 0) END),
    RPT4791_6890.E13_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.E13 else ISNULL(RPT4791_6890.E13_4, 0) END),
    RPT4791_6890.EL0_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.EL0 else ISNULL(RPT4791_6890.EL0_S, 0) END),
    RPT4791_6890.EL0_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.EL0 else ISNULL(RPT4791_6890.EL0_0, 0) END),
    RPT4791_6890.EL0_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.EL0 else ISNULL(RPT4791_6890.EL0_1, 0) END),
    RPT4791_6890.EL0_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.EL0 else ISNULL(RPT4791_6890.EL0_2, 0) END),
    RPT4791_6890.EL0_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.EL0 else ISNULL(RPT4791_6890.EL0_3, 0) END),
    RPT4791_6890.EL0_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.EL0 else ISNULL(RPT4791_6890.EL0_4, 0) END),
    RPT4791_6890.EL1_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.EL1 else ISNULL(RPT4791_6890.EL1_S, 0) END),
    RPT4791_6890.EL1_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.EL1 else ISNULL(RPT4791_6890.EL1_0, 0) END),
    RPT4791_6890.EL1_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.EL1 else ISNULL(RPT4791_6890.EL1_1, 0) END),
    RPT4791_6890.EL1_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.EL1 else ISNULL(RPT4791_6890.EL1_2, 0) END),
    RPT4791_6890.EL1_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.EL1 else ISNULL(RPT4791_6890.EL1_3, 0) END),
    RPT4791_6890.EL1_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.EL1 else ISNULL(RPT4791_6890.EL1_4, 0) END),
    RPT4791_6890.EL2_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.EL2 else ISNULL(RPT4791_6890.EL2_S, 0) END),
    RPT4791_6890.EL2_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.EL2 else ISNULL(RPT4791_6890.EL2_0, 0) END),
    RPT4791_6890.EL2_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.EL2 else ISNULL(RPT4791_6890.EL2_1, 0) END),
    RPT4791_6890.EL2_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.EL2 else ISNULL(RPT4791_6890.EL2_2, 0) END),
    RPT4791_6890.EL2_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.EL2 else ISNULL(RPT4791_6890.EL2_3, 0) END),
    RPT4791_6890.EL2_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.EL2 else ISNULL(RPT4791_6890.EL2_4, 0) END),
    RPT4791_6890.EL3_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.EL3 else ISNULL(RPT4791_6890.EL3_S, 0) END),
    RPT4791_6890.EL3_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.EL3 else ISNULL(RPT4791_6890.EL3_0, 0) END),
    RPT4791_6890.EL3_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.EL3 else ISNULL(RPT4791_6890.EL3_1, 0) END),
    RPT4791_6890.EL3_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.EL3 else ISNULL(RPT4791_6890.EL3_2, 0) END),
    RPT4791_6890.EL3_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.EL3 else ISNULL(RPT4791_6890.EL3_3, 0) END),
    RPT4791_6890.EL3_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.EL3 else ISNULL(RPT4791_6890.EL3_4, 0) END),
    RPT4791_6890.EL4_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.EL4 else ISNULL(RPT4791_6890.EL4_S, 0) END),
    RPT4791_6890.EL4_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.EL4 else ISNULL(RPT4791_6890.EL4_0, 0) END),
    RPT4791_6890.EL4_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.EL4 else ISNULL(RPT4791_6890.EL4_1, 0) END),
    RPT4791_6890.EL4_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.EL4 else ISNULL(RPT4791_6890.EL4_2, 0) END),
    RPT4791_6890.EL4_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.EL4 else ISNULL(RPT4791_6890.EL4_3, 0) END),
    RPT4791_6890.EL4_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.EL4 else ISNULL(RPT4791_6890.EL4_4, 0) END),
    RPT4791_6890.EL5_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.EL5 else ISNULL(RPT4791_6890.EL5_S, 0) END),
    RPT4791_6890.EL5_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.EL5 else ISNULL(RPT4791_6890.EL5_0, 0) END),
    RPT4791_6890.EL5_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.EL5 else ISNULL(RPT4791_6890.EL5_1, 0) END),
    RPT4791_6890.EL5_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.EL5 else ISNULL(RPT4791_6890.EL5_2, 0) END),
    RPT4791_6890.EL5_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.EL5 else ISNULL(RPT4791_6890.EL5_3, 0) END),
    RPT4791_6890.EL5_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.EL5 else ISNULL(RPT4791_6890.EL5_4, 0) END),
    RPT4791_6890.EL6_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.EL6 else ISNULL(RPT4791_6890.EL6_S, 0) END),
    RPT4791_6890.EL6_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.EL6 else ISNULL(RPT4791_6890.EL6_0, 0) END),
    RPT4791_6890.EL6_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.EL6 else ISNULL(RPT4791_6890.EL6_1, 0) END),
    RPT4791_6890.EL6_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.EL6 else ISNULL(RPT4791_6890.EL6_2, 0) END),
    RPT4791_6890.EL6_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.EL6 else ISNULL(RPT4791_6890.EL6_3, 0) END),
    RPT4791_6890.EL6_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.EL6 else ISNULL(RPT4791_6890.EL6_4, 0) END),
    RPT4791_6890.EL7_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.EL7 else ISNULL(RPT4791_6890.EL7_S, 0) END),
    RPT4791_6890.EL7_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.EL7 else ISNULL(RPT4791_6890.EL7_0, 0) END),
    RPT4791_6890.EL7_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.EL7 else ISNULL(RPT4791_6890.EL7_1, 0) END),
    RPT4791_6890.EL7_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.EL7 else ISNULL(RPT4791_6890.EL7_2, 0) END),
    RPT4791_6890.EL7_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.EL7 else ISNULL(RPT4791_6890.EL7_3, 0) END),
    RPT4791_6890.EL7_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.EL7 else ISNULL(RPT4791_6890.EL7_4, 0) END),
    RPT4791_6890.EL8_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.EL8 else ISNULL(RPT4791_6890.EL8_S, 0) END),
    RPT4791_6890.EL8_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.EL8 else ISNULL(RPT4791_6890.EL8_0, 0) END),
    RPT4791_6890.EL8_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.EL8 else ISNULL(RPT4791_6890.EL8_1, 0) END),
    RPT4791_6890.EL8_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.EL8 else ISNULL(RPT4791_6890.EL8_2, 0) END),
    RPT4791_6890.EL8_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.EL8 else ISNULL(RPT4791_6890.EL8_3, 0) END),
    RPT4791_6890.EL8_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.EL8 else ISNULL(RPT4791_6890.EL8_4, 0) END),
    RPT4791_6890.EL9_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.EL9 else ISNULL(RPT4791_6890.EL9_S, 0) END),
    RPT4791_6890.EL9_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.EL9 else ISNULL(RPT4791_6890.EL9_0, 0) END),
    RPT4791_6890.EL9_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.EL9 else ISNULL(RPT4791_6890.EL9_1, 0) END),
    RPT4791_6890.EL9_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.EL9 else ISNULL(RPT4791_6890.EL9_2, 0) END),
    RPT4791_6890.EL9_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.EL9 else ISNULL(RPT4791_6890.EL9_3, 0) END),
    RPT4791_6890.EL9_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.EL9 else ISNULL(RPT4791_6890.EL9_4, 0) END),
    RPT4791_6890.EL10_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.EL10 else ISNULL(RPT4791_6890.EL10_S, 0) END),
    RPT4791_6890.EL10_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.EL10 else ISNULL(RPT4791_6890.EL10_0, 0) END),
    RPT4791_6890.EL10_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.EL10 else ISNULL(RPT4791_6890.EL10_1, 0) END),
    RPT4791_6890.EL10_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.EL10 else ISNULL(RPT4791_6890.EL10_2, 0) END),
    RPT4791_6890.EL10_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.EL10 else ISNULL(RPT4791_6890.EL10_3, 0) END),
    RPT4791_6890.EL10_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.EL10 else ISNULL(RPT4791_6890.EL10_4, 0) END),
    RPT4791_6890.EL11_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.EL11 else ISNULL(RPT4791_6890.EL11_S, 0) END),
    RPT4791_6890.EL11_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.EL11 else ISNULL(RPT4791_6890.EL11_0, 0) END),
    RPT4791_6890.EL11_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.EL11 else ISNULL(RPT4791_6890.EL11_1, 0) END),
    RPT4791_6890.EL11_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.EL11 else ISNULL(RPT4791_6890.EL11_2, 0) END),
    RPT4791_6890.EL11_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.EL11 else ISNULL(RPT4791_6890.EL11_3, 0) END),
    RPT4791_6890.EL11_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.EL11 else ISNULL(RPT4791_6890.EL11_4, 0) END),
    ---ADDED ON 7/26/2006 BY SWONG AND TBUI TOTAL MOBILE EVALUATION----
    RPT4791_6890.EL12_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.EL12 else ISNULL(RPT4791_6890.EL12_S, 0) END),
    RPT4791_6890.EL12_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.EL12 else ISNULL(RPT4791_6890.EL12_0, 0) END),
    RPT4791_6890.EL12_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.EL12 else ISNULL(RPT4791_6890.EL12_1, 0) END),
    RPT4791_6890.EL12_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.EL12 else ISNULL(RPT4791_6890.EL12_2, 0) END),
    RPT4791_6890.EL12_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.EL12 else ISNULL(RPT4791_6890.EL12_3, 0) END),
    RPT4791_6890.EL12_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.EL12 else ISNULL(RPT4791_6890.EL12_4, 0) END),
    --- END OF TOTAL MOBILE EVALUATION ---
    RPT4791_6890.Dx0_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.Dx0 else ISNULL(RPT4791_6890.Dx0_S, 0) END),
    RPT4791_6890.Dx0_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.Dx0 else ISNULL(RPT4791_6890.Dx0_0, 0) END),
    RPT4791_6890.Dx0_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.Dx0 else ISNULL(RPT4791_6890.Dx0_1, 0) END),
    RPT4791_6890.Dx0_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.Dx0 else ISNULL(RPT4791_6890.Dx0_2, 0) END),
    RPT4791_6890.Dx0_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.Dx0 else ISNULL(RPT4791_6890.Dx0_3, 0) END),
    RPT4791_6890.Dx0_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.Dx0 else ISNULL(RPT4791_6890.Dx0_4, 0) END),
    RPT4791_6890.Dx1_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.Dx1 else ISNULL(RPT4791_6890.Dx1_S, 0) END),
    RPT4791_6890.Dx1_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.Dx1 else ISNULL(RPT4791_6890.Dx1_0, 0) END),
    RPT4791_6890.Dx1_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.Dx1 else ISNULL(RPT4791_6890.Dx1_1, 0) END),
    RPT4791_6890.Dx1_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.Dx1 else ISNULL(RPT4791_6890.Dx1_2, 0) END),
    RPT4791_6890.Dx1_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.Dx1 else ISNULL(RPT4791_6890.Dx1_3, 0) END),
    RPT4791_6890.Dx1_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.Dx1 else ISNULL(RPT4791_6890.Dx1_4, 0) END),
    RPT4791_6890.Dx2_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.Dx2 else ISNULL(RPT4791_6890.Dx2_S, 0) END),
    RPT4791_6890.Dx2_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.Dx2 else ISNULL(RPT4791_6890.Dx2_0, 0) END),
    RPT4791_6890.Dx2_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.Dx2 else ISNULL(RPT4791_6890.Dx2_1, 0) END),
    RPT4791_6890.Dx2_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.Dx2 else ISNULL(RPT4791_6890.Dx2_2, 0) END),
    RPT4791_6890.Dx2_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.Dx2 else ISNULL(RPT4791_6890.Dx2_3, 0) END),
    RPT4791_6890.Dx2_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.Dx2 else ISNULL(RPT4791_6890.Dx2_4, 0) END),
    RPT4791_6890.Dx3_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.Dx3 else ISNULL(RPT4791_6890.Dx3_S, 0) END),
    RPT4791_6890.Dx3_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.Dx3 else ISNULL(RPT4791_6890.Dx3_0, 0) END),
    RPT4791_6890.Dx3_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.Dx3 else ISNULL(RPT4791_6890.Dx3_1, 0) END),
    RPT4791_6890.Dx3_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.Dx3 else ISNULL(RPT4791_6890.Dx3_2, 0) END),
    RPT4791_6890.Dx3_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.Dx3 else ISNULL(RPT4791_6890.Dx3_3, 0) END),
    RPT4791_6890.Dx3_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.Dx3 else ISNULL(RPT4791_6890.Dx3_4, 0) END),
    RPT4791_6890.DS0_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS0 else ISNULL(RPT4791_6890.DS0_S, 0) END),
    RPT4791_6890.DS0_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS0 else ISNULL(RPT4791_6890.DS0_0, 0) END),
    RPT4791_6890.DS0_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS0 else ISNULL(RPT4791_6890.DS0_1, 0) END),
    RPT4791_6890.DS0_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS0 else ISNULL(RPT4791_6890.DS0_2, 0) END),
    RPT4791_6890.DS0_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS0 else ISNULL(RPT4791_6890.DS0_3, 0) END),
    RPT4791_6890.DS0_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS0 else ISNULL(RPT4791_6890.DS0_4, 0) END),
    RPT4791_6890.DS1_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS1 else ISNULL(RPT4791_6890.DS1_S, 0) END),
    RPT4791_6890.DS1_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS1 else ISNULL(RPT4791_6890.DS1_0, 0) END),
    RPT4791_6890.DS1_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS1 else ISNULL(RPT4791_6890.DS1_1, 0) END),
    RPT4791_6890.DS1_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS1 else ISNULL(RPT4791_6890.DS1_2, 0) END),
    RPT4791_6890.DS1_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS1 else ISNULL(RPT4791_6890.DS1_3, 0) END),
    RPT4791_6890.DS1_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS1 else ISNULL(RPT4791_6890.DS1_4, 0) END),
    RPT4791_6890.DS2_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS2 else ISNULL(RPT4791_6890.DS2_S, 0) END),
    RPT4791_6890.DS2_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS2 else ISNULL(RPT4791_6890.DS2_0, 0) END),
    RPT4791_6890.DS2_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS2 else ISNULL(RPT4791_6890.DS2_1, 0) END),
    RPT4791_6890.DS2_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS2 else ISNULL(RPT4791_6890.DS2_2, 0) END),
    RPT4791_6890.DS2_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS2 else ISNULL(RPT4791_6890.DS2_3, 0) END),
    RPT4791_6890.DS2_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS2 else ISNULL(RPT4791_6890.DS2_4, 0) END),
    RPT4791_6890.DS3_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS3 else ISNULL(RPT4791_6890.DS3_S, 0) END),
    RPT4791_6890.DS3_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS3 else ISNULL(RPT4791_6890.DS3_0, 0) END),
    RPT4791_6890.DS3_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS3 else ISNULL(RPT4791_6890.DS3_1, 0) END),
    RPT4791_6890.DS3_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS3 else ISNULL(RPT4791_6890.DS3_2, 0) END),
    RPT4791_6890.DS3_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS3 else ISNULL(RPT4791_6890.DS3_3, 0) END),
    RPT4791_6890.DS3_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS3 else ISNULL(RPT4791_6890.DS3_4, 0) END),
    RPT4791_6890.DS4_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS4 else ISNULL(RPT4791_6890.DS4_S, 0) END),
    RPT4791_6890.DS4_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS4 else ISNULL(RPT4791_6890.DS4_0, 0) END),
    RPT4791_6890.DS4_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS4 else ISNULL(RPT4791_6890.DS4_1, 0) END),
    RPT4791_6890.DS4_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS4 else ISNULL(RPT4791_6890.DS4_2, 0) END),
    RPT4791_6890.DS4_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS4 else ISNULL(RPT4791_6890.DS4_3, 0) END),
    RPT4791_6890.DS4_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS4 else ISNULL(RPT4791_6890.DS4_4, 0) END),
    RPT4791_6890.DS5_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS5 else ISNULL(RPT4791_6890.DS5_S, 0) END),
    RPT4791_6890.DS5_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS5 else ISNULL(RPT4791_6890.DS5_0, 0) END),
    RPT4791_6890.DS5_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS5 else ISNULL(RPT4791_6890.DS5_1, 0) END),
    RPT4791_6890.DS5_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS5 else ISNULL(RPT4791_6890.DS5_2, 0) END),
    RPT4791_6890.DS5_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS5 else ISNULL(RPT4791_6890.DS5_3, 0) END),
    RPT4791_6890.DS5_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS5 else ISNULL(RPT4791_6890.DS5_4, 0) END),
    RPT4791_6890.DS6_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS6 else ISNULL(RPT4791_6890.DS6_S, 0) END),
    RPT4791_6890.DS6_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS6 else ISNULL(RPT4791_6890.DS6_0, 0) END),
    RPT4791_6890.DS6_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS6 else ISNULL(RPT4791_6890.DS6_1, 0) END),
    RPT4791_6890.DS6_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS6 else ISNULL(RPT4791_6890.DS6_2, 0) END),
    RPT4791_6890.DS6_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS6 else ISNULL(RPT4791_6890.DS6_3, 0) END),
    RPT4791_6890.DS6_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS6 else ISNULL(RPT4791_6890.DS6_4, 0) END),
    RPT4791_6890.DS7_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS7 else ISNULL(RPT4791_6890.DS7_S, 0) END),
    RPT4791_6890.DS7_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS7 else ISNULL(RPT4791_6890.DS7_0, 0) END),
    RPT4791_6890.DS7_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS7 else ISNULL(RPT4791_6890.DS7_1, 0) END),
    RPT4791_6890.DS7_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS7 else ISNULL(RPT4791_6890.DS7_2, 0) END),
    RPT4791_6890.DS7_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS7 else ISNULL(RPT4791_6890.DS7_3, 0) END),
    RPT4791_6890.DS7_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS7 else ISNULL(RPT4791_6890.DS7_4, 0) END),
    RPT4791_6890.DS8_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS8 else ISNULL(RPT4791_6890.DS8_S, 0) END),
    RPT4791_6890.DS8_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS8 else ISNULL(RPT4791_6890.DS8_0, 0) END),
    RPT4791_6890.DS8_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS8 else ISNULL(RPT4791_6890.DS8_1, 0) END),
    RPT4791_6890.DS8_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS8 else ISNULL(RPT4791_6890.DS8_2, 0) END),
    RPT4791_6890.DS8_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS8 else ISNULL(RPT4791_6890.DS8_3, 0) END),
    RPT4791_6890.DS8_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS8 else ISNULL(RPT4791_6890.DS8_4, 0) END),
    RPT4791_6890.DS9_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS9 else ISNULL(RPT4791_6890.DS9_S, 0) END),
    RPT4791_6890.DS9_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS9 else ISNULL(RPT4791_6890.DS9_0, 0) END),
    RPT4791_6890.DS9_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS9 else ISNULL(RPT4791_6890.DS9_1, 0) END),
    RPT4791_6890.DS9_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS9 else ISNULL(RPT4791_6890.DS9_2, 0) END),
    RPT4791_6890.DS9_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS9 else ISNULL(RPT4791_6890.DS9_3, 0) END),
    RPT4791_6890.DS9_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS9 else ISNULL(RPT4791_6890.DS9_4, 0) END),
    RPT4791_6890.DS10_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS10 else ISNULL(RPT4791_6890.DS10_S, 0) END),
    RPT4791_6890.DS10_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS10 else ISNULL(RPT4791_6890.DS10_0, 0) END),
    RPT4791_6890.DS10_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS10 else ISNULL(RPT4791_6890.DS10_1, 0) END),
    RPT4791_6890.DS10_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS10 else ISNULL(RPT4791_6890.DS10_2, 0) END),
    RPT4791_6890.DS10_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS10 else ISNULL(RPT4791_6890.DS10_3, 0) END),
    RPT4791_6890.DS10_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS10 else ISNULL(RPT4791_6890.DS10_4, 0) END),
    RPT4791_6890.DS11_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS11 else ISNULL(RPT4791_6890.DS11_S, 0) END),
    RPT4791_6890.DS11_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS11 else ISNULL(RPT4791_6890.DS11_0, 0) END),
    RPT4791_6890.DS11_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS11 else ISNULL(RPT4791_6890.DS11_1, 0) END),
    RPT4791_6890.DS11_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS11 else ISNULL(RPT4791_6890.DS11_2, 0) END),
    RPT4791_6890.DS11_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS11 else ISNULL(RPT4791_6890.DS11_3, 0) END),
    RPT4791_6890.DS11_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS11 else ISNULL(RPT4791_6890.DS11_4, 0) END),
    RPT4791_6890.DS12_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS12 else ISNULL(RPT4791_6890.DS12_S, 0) END),
    RPT4791_6890.DS12_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS12 else ISNULL(RPT4791_6890.DS12_0, 0) END),
    RPT4791_6890.DS12_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS12 else ISNULL(RPT4791_6890.DS12_1, 0) END),
    RPT4791_6890.DS12_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS12 else ISNULL(RPT4791_6890.DS12_2, 0) END),
    RPT4791_6890.DS12_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS12 else ISNULL(RPT4791_6890.DS12_3, 0) END),
    RPT4791_6890.DS12_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS12 else ISNULL(RPT4791_6890.DS12_4, 0) END),
    RPT4791_6890.DS13_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS13 else ISNULL(RPT4791_6890.DS13_S, 0) END),
    RPT4791_6890.DS13_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS13 else ISNULL(RPT4791_6890.DS13_0, 0) END),
    RPT4791_6890.DS13_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS13 else ISNULL(RPT4791_6890.DS13_1, 0) END),
    RPT4791_6890.DS13_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS13 else ISNULL(RPT4791_6890.DS13_2, 0) END),
    RPT4791_6890.DS13_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS13 else ISNULL(RPT4791_6890.DS13_3, 0) END),
    RPT4791_6890.DS13_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS13 else ISNULL(RPT4791_6890.DS13_4, 0) END),
    RPT4791_6890.DS14_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS14 else ISNULL(RPT4791_6890.DS14_S, 0) END),
    RPT4791_6890.DS14_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS14 else ISNULL(RPT4791_6890.DS14_0, 0) END),
    RPT4791_6890.DS14_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS14 else ISNULL(RPT4791_6890.DS14_1, 0) END),
    RPT4791_6890.DS14_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS14 else ISNULL(RPT4791_6890.DS14_2, 0) END),
    RPT4791_6890.DS14_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS14 else ISNULL(RPT4791_6890.DS14_3, 0) END),
    RPT4791_6890.DS14_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS14 else ISNULL(RPT4791_6890.DS14_4, 0) END),
    RPT4791_6890.DS15_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS15 else ISNULL(RPT4791_6890.DS15_S, 0) END),
    RPT4791_6890.DS15_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS15 else ISNULL(RPT4791_6890.DS15_0, 0) END),
    RPT4791_6890.DS15_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS15 else ISNULL(RPT4791_6890.DS15_1, 0) END),
    RPT4791_6890.DS15_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS15 else ISNULL(RPT4791_6890.DS15_2, 0) END),
    RPT4791_6890.DS15_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS15 else ISNULL(RPT4791_6890.DS15_3, 0) END),
    RPT4791_6890.DS15_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS15 else ISNULL(RPT4791_6890.DS15_4, 0) END),
    RPT4791_6890.DS16_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS16 else ISNULL(RPT4791_6890.DS16_S, 0) END),
    RPT4791_6890.DS16_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS16 else ISNULL(RPT4791_6890.DS16_0, 0) END),
    RPT4791_6890.DS16_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS16 else ISNULL(RPT4791_6890.DS16_1, 0) END),
    RPT4791_6890.DS16_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS16 else ISNULL(RPT4791_6890.DS16_2, 0) END),
    RPT4791_6890.DS16_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS16 else ISNULL(RPT4791_6890.DS16_3, 0) END),
    RPT4791_6890.DS16_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS16 else ISNULL(RPT4791_6890.DS16_4, 0) END),
    RPT4791_6890.DS17_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS17 else ISNULL(RPT4791_6890.DS17_S, 0) END),
    RPT4791_6890.DS17_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS17 else ISNULL(RPT4791_6890.DS17_0, 0) END),
    RPT4791_6890.DS17_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS17 else ISNULL(RPT4791_6890.DS17_1, 0) END),
    RPT4791_6890.DS17_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS17 else ISNULL(RPT4791_6890.DS17_2, 0) END),
    RPT4791_6890.DS17_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS17 else ISNULL(RPT4791_6890.DS17_3, 0) END),
    RPT4791_6890.DS17_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS17 else ISNULL(RPT4791_6890.DS17_4, 0) END),
    RPT4791_6890.DS18_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS18 else ISNULL(RPT4791_6890.DS18_S, 0) END),
    RPT4791_6890.DS18_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS18 else ISNULL(RPT4791_6890.DS18_0, 0) END),
    RPT4791_6890.DS18_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS18 else ISNULL(RPT4791_6890.DS18_1, 0) END),
    RPT4791_6890.DS18_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS18 else ISNULL(RPT4791_6890.DS18_2, 0) END),
    RPT4791_6890.DS18_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS18 else ISNULL(RPT4791_6890.DS18_3, 0) END),
    RPT4791_6890.DS18_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS18 else ISNULL(RPT4791_6890.DS18_4, 0) END),
    RPT4791_6890.DS19_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS19 else ISNULL(RPT4791_6890.DS19_S, 0) END),
    RPT4791_6890.DS19_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS19 else ISNULL(RPT4791_6890.DS19_0, 0) END),
    RPT4791_6890.DS19_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS19 else ISNULL(RPT4791_6890.DS19_1, 0) END),
    RPT4791_6890.DS19_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS19 else ISNULL(RPT4791_6890.DS19_2, 0) END),
    RPT4791_6890.DS19_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS19 else ISNULL(RPT4791_6890.DS19_3, 0) END),
    RPT4791_6890.DS19_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS19 else ISNULL(RPT4791_6890.DS19_4, 0) END),
    RPT4791_6890.DS20_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS20 else ISNULL(RPT4791_6890.DS20_S, 0) END),
    RPT4791_6890.DS20_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS20 else ISNULL(RPT4791_6890.DS20_0, 0) END),
    RPT4791_6890.DS20_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS20 else ISNULL(RPT4791_6890.DS20_1, 0) END),
    RPT4791_6890.DS20_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS20 else ISNULL(RPT4791_6890.DS20_2, 0) END),
    RPT4791_6890.DS20_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS20 else ISNULL(RPT4791_6890.DS20_3, 0) END),
    RPT4791_6890.DS20_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS20 else ISNULL(RPT4791_6890.DS20_4, 0) END),
    RPT4791_6890.DS21_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS21 else ISNULL(RPT4791_6890.DS21_S, 0) END),
    RPT4791_6890.DS21_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS21 else ISNULL(RPT4791_6890.DS21_0, 0) END),
    RPT4791_6890.DS21_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS21 else ISNULL(RPT4791_6890.DS21_1, 0) END),
    RPT4791_6890.DS21_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS21 else ISNULL(RPT4791_6890.DS21_2, 0) END),
    RPT4791_6890.DS21_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS21 else ISNULL(RPT4791_6890.DS21_3, 0) END),
    RPT4791_6890.DS21_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS21 else ISNULL(RPT4791_6890.DS21_4, 0) END),
    RPT4791_6890.DS22_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS22 else ISNULL(RPT4791_6890.DS22_S, 0) END),
    RPT4791_6890.DS22_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS22 else ISNULL(RPT4791_6890.DS22_0, 0) END),
    RPT4791_6890.DS22_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS22 else ISNULL(RPT4791_6890.DS22_1, 0) END),
    RPT4791_6890.DS22_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS22 else ISNULL(RPT4791_6890.DS22_2, 0) END),
    RPT4791_6890.DS22_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS22 else ISNULL(RPT4791_6890.DS22_3, 0) END),
    RPT4791_6890.DS22_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS22 else ISNULL(RPT4791_6890.DS22_4, 0) END),
    RPT4791_6890.DS23_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS23 else ISNULL(RPT4791_6890.DS23_S, 0) END),
    RPT4791_6890.DS23_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS23 else ISNULL(RPT4791_6890.DS23_0, 0) END),
    RPT4791_6890.DS23_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS23 else ISNULL(RPT4791_6890.DS23_1, 0) END),
    RPT4791_6890.DS23_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS23 else ISNULL(RPT4791_6890.DS23_2, 0) END),
    RPT4791_6890.DS23_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS23 else ISNULL(RPT4791_6890.DS23_3, 0) END),
    RPT4791_6890.DS23_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS23 else ISNULL(RPT4791_6890.DS23_4, 0) END),
    RPT4791_6890.DS24_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS24 else ISNULL(RPT4791_6890.DS24_S, 0) END),
    RPT4791_6890.DS24_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS24 else ISNULL(RPT4791_6890.DS24_0, 0) END),
    RPT4791_6890.DS24_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS24 else ISNULL(RPT4791_6890.DS24_1, 0) END),
    RPT4791_6890.DS24_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS24 else ISNULL(RPT4791_6890.DS24_2, 0) END),
    RPT4791_6890.DS24_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS24 else ISNULL(RPT4791_6890.DS24_3, 0) END),
    RPT4791_6890.DS24_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS24 else ISNULL(RPT4791_6890.DS24_4, 0) END),
    RPT4791_6890.DS25_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS25 else ISNULL(RPT4791_6890.DS25_S, 0) END),
    RPT4791_6890.DS25_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS25 else ISNULL(RPT4791_6890.DS25_0, 0) END),
    RPT4791_6890.DS25_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS25 else ISNULL(RPT4791_6890.DS25_1, 0) END),
    RPT4791_6890.DS25_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS25 else ISNULL(RPT4791_6890.DS25_2, 0) END),
    RPT4791_6890.DS25_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS25 else ISNULL(RPT4791_6890.DS25_3, 0) END),
    RPT4791_6890.DS25_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS25 else ISNULL(RPT4791_6890.DS25_4, 0) END),
    RPT4791_6890.DS26_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS26 else ISNULL(RPT4791_6890.DS26_S, 0) END),
    RPT4791_6890.DS26_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS26 else ISNULL(RPT4791_6890.DS26_0, 0) END),
    RPT4791_6890.DS26_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS26 else ISNULL(RPT4791_6890.DS26_1, 0) END),
    RPT4791_6890.DS26_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS26 else ISNULL(RPT4791_6890.DS26_2, 0) END),
    RPT4791_6890.DS26_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS26 else ISNULL(RPT4791_6890.DS26_3, 0) END),
    RPT4791_6890.DS26_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS26 else ISNULL(RPT4791_6890.DS26_4, 0) END),
    RPT4791_6890.DS27_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS27 else ISNULL(RPT4791_6890.DS27_S, 0) END),
    RPT4791_6890.DS27_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS27 else ISNULL(RPT4791_6890.DS27_0, 0) END),
    RPT4791_6890.DS27_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS27 else ISNULL(RPT4791_6890.DS27_1, 0) END),
    RPT4791_6890.DS27_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS27 else ISNULL(RPT4791_6890.DS27_2, 0) END),
    RPT4791_6890.DS27_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS27 else ISNULL(RPT4791_6890.DS27_3, 0) END),
    RPT4791_6890.DS27_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS27 else ISNULL(RPT4791_6890.DS27_4, 0) END),
    --- ADDED INPATIENT PSYCHIATRIC AT 07/26/06 ------------
    RPT4791_6890.DS28_S = (CASE WHEN #tblcount.Age_Index = 5 then #tblcount.DS28 else ISNULL(RPT4791_6890.DS28_S, 0) END),
    RPT4791_6890.DS28_0 = (CASE WHEN #tblcount.Age_Index = 0 then #tblcount.DS28 else ISNULL(RPT4791_6890.DS28_0, 0) END),
    RPT4791_6890.DS28_1 = (CASE WHEN #tblcount.Age_Index = 1 then #tblcount.DS28 else ISNULL(RPT4791_6890.DS28_1, 0) END),
    RPT4791_6890.DS28_2 = (CASE WHEN #tblcount.Age_Index = 2 then #tblcount.DS28 else ISNULL(RPT4791_6890.DS28_2, 0) END),
    RPT4791_6890.DS28_3 = (CASE WHEN #tblcount.Age_Index = 3 then #tblcount.DS28 else ISNULL(RPT4791_6890.DS28_3, 0) END),
    RPT4791_6890.DS28_4 = (CASE WHEN #tblcount.Age_Index = 4 then #tblcount.DS28 else ISNULL(RPT4791_6890.DS28_4, 0) END)
    --- END ADDED INPATIENT PSYCHIATRIC AT 07/26/06 ------------
    FROM RPT4791_6890, #tblcount where #tblcount.State = RPT4791_6890.State
    and #tblcount.Age_Index = @AGE_INDEX
    SELECT @AGE_INDEX = @AGE_INDEX + 1
    END


    if exists(select top 1 1 from sysobjects where name = 'RPT4791_6890_Percent' and xtype = 'U')
    begin
     drop table RPT4791_6890_Percent
    end


    create table RPT4791_6890_Percent
    (
    State int, startdate varchar(10), enddate varchar(10),
    TotalEncounter_S_percent varchar(6), TotalEncounter_0_percent varchar(6), TotalEncounter_1_percent varchar(6), TotalEncounter_2_percent varchar(6), TotalEncounter_3_percent varchar(6), TotalEncounter_4_percent varchar(6),
    Male_S_percent varchar(6), Male_0_percent varchar(6), Male_1_percent varchar(6), Male_2_percent varchar(6), Male_3_percent varchar(6), Male_4_percent varchar(6),
    Female_S_percent varchar(6), Female_0_percent varchar(6), Female_1_percent varchar(6), Female_2_percent varchar(6), Female_3_percent varchar(6), Female_4_percent varchar(6),
    Unknown_S_percent varchar(6), Unknown_0_percent varchar(6), Unknown_1_percent varchar(6), Unknown_2_percent varchar(6), Unknown_3_percent varchar(6), Unknown_4_percent varchar(6),
    HL_S_percent varchar(6), HL_0_percent varchar(6), HL_1_percent varchar(6), HL_2_percent varchar(6), HL_3_percent varchar(6), HL_4_percent varchar(6),
    DMH_S_percent varchar(6), DMH_0_percent varchar(6), DMH_1_percent varchar(6), DMH_2_percent varchar(6), DMH_3_percent varchar(6), DMH_4_percent varchar(6),
    DYS_S_percent varchar(6), DYS_0_percent varchar(6), DYS_1_percent varchar(6), DYS_2_percent varchar(6), DYS_3_percent varchar(6), DYS_4_percent varchar(6),
    DMR_S_percent varchar(6), DMR_0_percent varchar(6), DMR_1_percent varchar(6), DMR_2_percent varchar(6), DMR_3_percent varchar(6), DMR_4_percent varchar(6),
    DSS_S_percent varchar(6), DSS_0_percent varchar(6), DSS_1_percent varchar(6), DSS_2_percent varchar(6), DSS_3_percent varchar(6), DSS_4_percent varchar(6),
    F1_S_percent varchar(6), F1_0_percent varchar(6), F1_1_percent varchar(6), F1_2_percent varchar(6), F1_3_percent varchar(6), F1_4_percent varchar(6),
    F2_S_percent varchar(6), F2_0_percent varchar(6), F2_1_percent varchar(6), F2_2_percent varchar(6), F2_3_percent varchar(6), F2_4_percent varchar(6),
    F3_S_percent varchar(6), F3_0_percent varchar(6), F3_1_percent varchar(6), F3_2_percent varchar(6), F3_3_percent varchar(6), F3_4_percent varchar(6),
    F4_S_percent varchar(6), F4_0_percent varchar(6), F4_1_percent varchar(6), F4_2_percent varchar(6), F4_3_percent varchar(6), F4_4_percent varchar(6),
    F5_S_percent varchar(6), F5_0_percent varchar(6), F5_1_percent varchar(6), F5_2_percent varchar(6), F5_3_percent varchar(6), F5_4_percent varchar(6),
    F6_S_percent varchar(6), F6_0_percent varchar(6), F6_1_percent varchar(6), F6_2_percent varchar(6), F6_3_percent varchar(6), F6_4_percent varchar(6),
    F7_S_percent varchar(6), F7_0_percent varchar(6), F7_1_percent varchar(6), F7_2_percent varchar(6), F7_3_percent varchar(6), F7_4_percent varchar(6),
    F8_S_percent varchar(6), F8_0_percent varchar(6), F8_1_percent varchar(6), F8_2_percent varchar(6), F8_3_percent varchar(6), F8_4_percent varchar(6),
    F9_S_percent varchar(6), F9_0_percent varchar(6), F9_1_percent varchar(6), F9_2_percent varchar(6), F9_3_percent varchar(6), F9_4_percent varchar(6),
    F10_S_percent varchar(6), F10_0_percent varchar(6), F10_1_percent varchar(6), F10_2_percent varchar(6), F10_3_percent varchar(6), F10_4_percent varchar(6),
    F11_S_percent varchar(6), F11_0_percent varchar(6), F11_1_percent varchar(6), F11_2_percent varchar(6), F11_3_percent varchar(6), F11_4_percent varchar(6),
    F12_S_percent varchar(6), F12_0_percent varchar(6), F12_1_percent varchar(6), F12_2_percent varchar(6), F12_3_percent varchar(6), F12_4_percent varchar(6),
    F13_S_percent varchar(6), F13_0_percent varchar(6), F13_1_percent varchar(6), F13_2_percent varchar(6), F13_3_percent varchar(6), F13_4_percent varchar(6),
    F14_S_percent varchar(6), F14_0_percent varchar(6), F14_1_percent varchar(6), F14_2_percent varchar(6), F14_3_percent varchar(6), F14_4_percent varchar(6),
    M0_S_percent varchar(6), M0_0_percent varchar(6), M0_1_percent varchar(6), M0_2_percent varchar(6), M0_3_percent varchar(6), M0_4_percent varchar(6),
    M1_S_percent varchar(6), M1_0_percent varchar(6), M1_1_percent varchar(6), M1_2_percent varchar(6), M1_3_percent varchar(6), M1_4_percent varchar(6),
    M2_S_percent varchar(6), M2_0_percent varchar(6), M2_1_percent varchar(6), M2_2_percent varchar(6), M2_3_percent varchar(6), M2_4_percent varchar(6),
    M3_S_percent varchar(6), M3_0_percent varchar(6), M3_1_percent varchar(6), M3_2_percent varchar(6), M3_3_percent varchar(6), M3_4_percent varchar(6),
    E0_S_percent varchar(6), E0_0_percent varchar(6), E0_1_percent varchar(6), E0_2_percent varchar(6), E0_3_percent varchar(6), E0_4_percent varchar(6),
    E1_S_percent varchar(6), E1_0_percent varchar(6), E1_1_percent varchar(6), E1_2_percent varchar(6), E1_3_percent varchar(6), E1_4_percent varchar(6),
    E2_S_percent varchar(6), E2_0_percent varchar(6), E2_1_percent varchar(6), E2_2_percent varchar(6), E2_3_percent varchar(6), E2_4_percent varchar(6),
    E3_S_percent varchar(6), E3_0_percent varchar(6), E3_1_percent varchar(6), E3_2_percent varchar(6), E3_3_percent varchar(6), E3_4_percent varchar(6),
    E4_S_percent varchar(6), E4_0_percent varchar(6), E4_1_percent varchar(6), E4_2_percent varchar(6), E4_3_percent varchar(6), E4_4_percent varchar(6),
    E5_S_percent varchar(6), E5_0_percent varchar(6), E5_1_percent varchar(6), E5_2_percent varchar(6), E5_3_percent varchar(6), E5_4_percent varchar(6),
    E6_S_percent varchar(6), E6_0_percent varchar(6), E6_1_percent varchar(6), E6_2_percent varchar(6), E6_3_percent varchar(6), E6_4_percent varchar(6),
    E7_S_percent varchar(6), E7_0_percent varchar(6), E7_1_percent varchar(6), E7_2_percent varchar(6), E7_3_percent varchar(6), E7_4_percent varchar(6),
    E8_S_percent varchar(6), E8_0_percent varchar(6), E8_1_percent varchar(6), E8_2_percent varchar(6), E8_3_percent varchar(6), E8_4_percent varchar(6),
    E9_S_percent varchar(6), E9_0_percent varchar(6), E9_1_percent varchar(6), E9_2_percent varchar(6), E9_3_percent varchar(6), E9_4_percent varchar(6),
    E10_S_percent varchar(6), E10_0_percent varchar(6), E10_1_percent varchar(6), E10_2_percent varchar(6), E10_3_percent varchar(6), E10_4_percent varchar(6),
    E11_S_percent varchar(6), E11_0_percent varchar(6), E11_1_percent varchar(6), E11_2_percent varchar(6), E11_3_percent varchar(6), E11_4_percent varchar(6),
    E12_S_percent varchar(6), E12_0_percent varchar(6), E12_1_percent varchar(6), E12_2_percent varchar(6), E12_3_percent varchar(6), E12_4_percent varchar(6),
    E13_S_percent varchar(6), E13_0_percent varchar(6), E13_1_percent varchar(6), E13_2_percent varchar(6), E13_3_percent varchar(6), E13_4_percent varchar(6),
    EL0_S_percent varchar(6), EL0_0_percent varchar(6), EL0_1_percent varchar(6), EL0_2_percent varchar(6), EL0_3_percent varchar(6), EL0_4_percent varchar(6),
    EL1_S_percent varchar(6), EL1_0_percent varchar(6), EL1_1_percent varchar(6), EL1_2_percent varchar(6), EL1_3_percent varchar(6), EL1_4_percent varchar(6),
    EL2_S_percent varchar(6), EL2_0_percent varchar(6), EL2_1_percent varchar(6), EL2_2_percent varchar(6), EL2_3_percent varchar(6), EL2_4_percent varchar(6),
    EL3_S_percent varchar(6), EL3_0_percent varchar(6), EL3_1_percent varchar(6), EL3_2_percent varchar(6), EL3_3_percent varchar(6), EL3_4_percent varchar(6),
    EL4_S_percent varchar(6), EL4_0_percent varchar(6), EL4_1_percent varchar(6), EL4_2_percent varchar(6), EL4_3_percent varchar(6), EL4_4_percent varchar(6),
    EL5_S_percent varchar(6), EL5_0_percent varchar(6), EL5_1_percent varchar(6), EL5_2_percent varchar(6), EL5_3_percent varchar(6), EL5_4_percent varchar(6),
    EL6_S_percent varchar(6), EL6_0_percent varchar(6), EL6_1_percent varchar(6), EL6_2_percent varchar(6), EL6_3_percent varchar(6), EL6_4_percent varchar(6),
    EL7_S_percent varchar(6), EL7_0_percent varchar(6), EL7_1_percent varchar(6), EL7_2_percent varchar(6), EL7_3_percent varchar(6), EL7_4_percent varchar(6),
    EL8_S_percent varchar(6), EL8_0_percent varchar(6), EL8_1_percent varchar(6), EL8_2_percent varchar(6), EL8_3_percent varchar(6), EL8_4_percent varchar(6),
    EL9_S_percent varchar(6), EL9_0_percent varchar(6), EL9_1_percent varchar(6), EL9_2_percent varchar(6), EL9_3_percent varchar(6), EL9_4_percent varchar(6),
    EL10_S_percent varchar(6), EL10_0_percent varchar(6), EL10_1_percent varchar(6), EL10_2_percent varchar(6), EL10_3_percent varchar(6), EL10_4_percent varchar(6),
    EL11_S_percent varchar(6), EL11_0_percent varchar(6), EL11_1_percent varchar(6), EL11_2_percent varchar(6), EL11_3_percent varchar(6), EL11_4_percent varchar(6),
    -- ADDED 7/26/2006 -----------
    EL12_S_percent varchar(6), EL12_0_percent varchar(6), EL12_1_percent varchar(6), EL12_2_percent varchar(6), EL12_3_percent varchar(6), EL12_4_percent varchar(6),
    --ENDED ADD 7/26/2006 ----
    Dx0_S_percent varchar(6), Dx0_0_percent varchar(6), Dx0_1_percent varchar(6), Dx0_2_percent varchar(6), Dx0_3_percent varchar(6), Dx0_4_percent varchar(6),
    Dx1_S_percent varchar(6), Dx1_0_percent varchar(6), Dx1_1_percent varchar(6), Dx1_2_percent varchar(6), Dx1_3_percent varchar(6), Dx1_4_percent varchar(6),
    Dx2_S_percent varchar(6), Dx2_0_percent varchar(6), Dx2_1_percent varchar(6), Dx2_2_percent varchar(6), Dx2_3_percent varchar(6), Dx2_4_percent varchar(6),
    Dx3_S_percent varchar(6), Dx3_0_percent varchar(6), Dx3_1_percent varchar(6), Dx3_2_percent varchar(6), Dx3_3_percent varchar(6), Dx3_4_percent varchar(6),
    DS0_S_percent varchar(6), DS0_0_percent varchar(6), DS0_1_percent varchar(6), DS0_2_percent varchar(6), DS0_3_percent varchar(6), DS0_4_percent varchar(6),
    DS1_S_percent varchar(6), DS1_0_percent varchar(6), DS1_1_percent varchar(6), DS1_2_percent varchar(6), DS1_3_percent varchar(6), DS1_4_percent varchar(6),
    DS2_S_percent varchar(6), DS2_0_percent varchar(6), DS2_1_percent varchar(6), DS2_2_percent varchar(6), DS2_3_percent varchar(6), DS2_4_percent varchar(6),
    DS3_S_percent varchar(6), DS3_0_percent varchar(6), DS3_1_percent varchar(6), DS3_2_percent varchar(6), DS3_3_percent varchar(6), DS3_4_percent varchar(6),
    DS4_S_percent varchar(6), DS4_0_percent varchar(6), DS4_1_percent varchar(6), DS4_2_percent varchar(6), DS4_3_percent varchar(6), DS4_4_percent varchar(6),
    DS5_S_percent varchar(6), DS5_0_percent varchar(6), DS5_1_percent varchar(6), DS5_2_percent varchar(6), DS5_3_percent varchar(6), DS5_4_percent varchar(6),
    DS6_S_percent varchar(6), DS6_0_percent varchar(6), DS6_1_percent varchar(6), DS6_2_percent varchar(6), DS6_3_percent varchar(6), DS6_4_percent varchar(6),
    DS7_S_percent varchar(6), DS7_0_percent varchar(6), DS7_1_percent varchar(6), DS7_2_percent varchar(6), DS7_3_percent varchar(6), DS7_4_percent varchar(6),
    DS8_S_percent varchar(6), DS8_0_percent varchar(6), DS8_1_percent varchar(6), DS8_2_percent varchar(6), DS8_3_percent varchar(6), DS8_4_percent varchar(6),
    DS9_S_percent varchar(6), DS9_0_percent varchar(6), DS9_1_percent varchar(6), DS9_2_percent varchar(6), DS9_3_percent varchar(6), DS9_4_percent varchar(6),
    DS10_S_percent varchar(6), DS10_0_percent varchar(6), DS10_1_percent varchar(6), DS10_2_percent varchar(6), DS10_3_percent varchar(6), DS10_4_percent varchar(6),
    DS11_S_percent varchar(6), DS11_0_percent varchar(6), DS11_1_percent varchar(6), DS11_2_percent varchar(6), DS11_3_percent varchar(6), DS11_4_percent varchar(6),
    DS12_S_percent varchar(6), DS12_0_percent varchar(6), DS12_1_percent varchar(6), DS12_2_percent varchar(6), DS12_3_percent varchar(6), DS12_4_percent varchar(6),
    DS13_S_percent varchar(6), DS13_0_percent varchar(6), DS13_1_percent varchar(6), DS13_2_percent varchar(6), DS13_3_percent varchar(6), DS13_4_percent varchar(6),
    DS14_S_percent varchar(6), DS14_0_percent varchar(6), DS14_1_percent varchar(6), DS14_2_percent varchar(6), DS14_3_percent varchar(6), DS14_4_percent varchar(6),
    DS15_S_percent varchar(6), DS15_0_percent varchar(6), DS15_1_percent varchar(6), DS15_2_percent varchar(6), DS15_3_percent varchar(6), DS15_4_percent varchar(6),
    DS16_S_percent varchar(6), DS16_0_percent varchar(6), DS16_1_percent varchar(6), DS16_2_percent varchar(6), DS16_3_percent varchar(6), DS16_4_percent varchar(6),
    DS17_S_percent varchar(6), DS17_0_percent varchar(6), DS17_1_percent varchar(6), DS17_2_percent varchar(6), DS17_3_percent varchar(6), DS17_4_percent varchar(6),
    DS18_S_percent varchar(6), DS18_0_percent varchar(6), DS18_1_percent varchar(6), DS18_2_percent varchar(6), DS18_3_percent varchar(6), DS18_4_percent varchar(6),
    DS19_S_percent varchar(6), DS19_0_percent varchar(6), DS19_1_percent varchar(6), DS19_2_percent varchar(6), DS19_3_percent varchar(6), DS19_4_percent varchar(6),
    DS20_S_percent varchar(6), DS20_0_percent varchar(6), DS20_1_percent varchar(6), DS20_2_percent varchar(6), DS20_3_percent varchar(6), DS20_4_percent varchar(6),
    DS21_S_percent varchar(6), DS21_0_percent varchar(6), DS21_1_percent varchar(6), DS21_2_percent varchar(6), DS21_3_percent varchar(6), DS21_4_percent varchar(6),
    DS22_S_percent varchar(6), DS22_0_percent varchar(6), DS22_1_percent varchar(6), DS22_2_percent varchar(6), DS22_3_percent varchar(6), DS22_4_percent varchar(6),
    DS23_S_percent varchar(6), DS23_0_percent varchar(6), DS23_1_percent varchar(6), DS23_2_percent varchar(6), DS23_3_percent varchar(6), DS23_4_percent varchar(6),
    DS24_S_percent varchar(6), DS24_0_percent varchar(6), DS24_1_percent varchar(6), DS24_2_percent varchar(6), DS24_3_percent varchar(6), DS24_4_percent varchar(6),
    DS25_S_percent varchar(6), DS25_0_percent varchar(6), DS25_1_percent varchar(6), DS25_2_percent varchar(6), DS25_3_percent varchar(6), DS25_4_percent varchar(6),
    DS26_S_percent varchar(6), DS26_0_percent varchar(6), DS26_1_percent varchar(6), DS26_2_percent varchar(6), DS26_3_percent varchar(6), DS26_4_percent varchar(6),
    DS27_S_percent varchar(6), DS27_0_percent varchar(6), DS27_1_percent varchar(6), DS27_2_percent varchar(6), DS27_3_percent varchar(6), DS27_4_percent varchar(6),
    -- ADDED 7/26/2006 --------
    DS28_S_percent varchar(6), DS28_0_percent varchar(6), DS28_1_percent varchar(6), DS28_2_percent varchar(6), DS28_3_percent varchar(6), DS28_4_percent varchar(6)
    -- ENDED ADD 7/26/2006 --------
    )
    insert into RPT4791_6890_Percent (State) values (1)

    UPDATE RPT4791_6890_Percent
    SET
    RPT4791_6890_Percent.TotalEncounter_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.TotalEncounter_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.TotalEncounter_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.TotalEncounter_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.TotalEncounter_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.TotalEncounter_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.TotalEncounter_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.TotalEncounter_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.TotalEncounter_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.TotalEncounter_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.TotalEncounter_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.TotalEncounter_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Male_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Male_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Male_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Male_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Male_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Male_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Male_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Male_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Male_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Male_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Male_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Male_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Female_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Female_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Female_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Female_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Female_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Female_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Female_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Female_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Female_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Female_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Female_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Female_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Unknown_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Unknown_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Unknown_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Unknown_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Unknown_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Unknown_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Unknown_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Unknown_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Unknown_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Unknown_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Unknown_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Unknown_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.HL_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.HL_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.HL_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.HL_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.HL_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.HL_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.HL_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.HL_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.HL_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.HL_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.HL_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.HL_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DMH_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DMH_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DMH_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DMH_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DMH_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DMH_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DMH_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DMH_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DMH_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DMH_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DMH_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DMH_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DYS_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DYS_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DYS_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DYS_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DYS_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DYS_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DYS_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DYS_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DYS_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DYS_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DYS_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DYS_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DMR_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DMR_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DMR_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DMR_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DMR_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DMR_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DMR_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DMR_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DMR_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DMR_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DMR_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DMR_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DSS_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DSS_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DSS_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DSS_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DSS_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DSS_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DSS_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DSS_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DSS_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DSS_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DSS_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DSS_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F1_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F1_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F1_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F1_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F1_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F1_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F1_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F1_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F1_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F1_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F1_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F1_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F2_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F2_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F2_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F2_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F2_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F2_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F2_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F2_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F2_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F2_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F2_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F2_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F3_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F3_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F3_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F3_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F3_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F3_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F3_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F3_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F3_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F3_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F3_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F3_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F4_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F4_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F4_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F4_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F4_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F4_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F4_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F4_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F4_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F4_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F4_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F4_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F5_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F5_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F5_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F5_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F5_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F5_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F5_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F5_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F5_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F5_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F5_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F5_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F6_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F6_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F6_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F6_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F6_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F6_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F6_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F6_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F6_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F6_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F6_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F6_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F7_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F7_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F7_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F7_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F7_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F7_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F7_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F7_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F7_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F7_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F7_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F7_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F8_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F8_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F8_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F8_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F8_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F8_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F8_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F8_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F8_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F8_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F8_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F8_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F9_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F9_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F9_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F9_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F9_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F9_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F9_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F9_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F9_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F9_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F9_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F9_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F10_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F10_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F10_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F10_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F10_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F10_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F10_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F10_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F10_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F10_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F10_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F10_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F11_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F11_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F11_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F11_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F11_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F11_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F11_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F11_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F11_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F11_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F11_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F11_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F12_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F12_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F12_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F12_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F12_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F12_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F12_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F12_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F12_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F12_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F12_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F12_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F13_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F13_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F13_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F13_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F13_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F13_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F13_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F13_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F13_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F13_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F13_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F13_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F14_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F14_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F14_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F14_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F14_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F14_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F14_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F14_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F14_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F14_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.F14_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.F14_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M0_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M0_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M0_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M0_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M0_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M0_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M0_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M0_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M0_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M0_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M0_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M0_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M1_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M1_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M1_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M1_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M1_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M1_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M1_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M1_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M1_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M1_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M1_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M1_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M2_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M2_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M2_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M2_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M2_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M2_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M2_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M2_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M2_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M2_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M2_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M2_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M3_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M3_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M3_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M3_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M3_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M3_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M3_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M3_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M3_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M3_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.M3_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.M3_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E0_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E0_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E0_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E0_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E0_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E0_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E0_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E0_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E0_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E0_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E0_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E0_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E1_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E1_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E1_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E1_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E1_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E1_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E1_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E1_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E1_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E1_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E1_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E1_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E2_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E2_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E2_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E2_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E2_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E2_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E2_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E2_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E2_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E2_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E2_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E2_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E3_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E3_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E3_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E3_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E3_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E3_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E3_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E3_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E3_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E3_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E3_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E3_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E4_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E4_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E4_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E4_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E4_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E4_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E4_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E4_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E4_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E4_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E4_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E4_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E5_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E5_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E5_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E5_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E5_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E5_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E5_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E5_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E5_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E5_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E5_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E5_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E6_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E6_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E6_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E6_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E6_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E6_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E6_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E6_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E6_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E6_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E6_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E6_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E7_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E7_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E7_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E7_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E7_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E7_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E7_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E7_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E7_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E7_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E7_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E7_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E8_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E8_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E8_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E8_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E8_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E8_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E8_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E8_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E8_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E8_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E8_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E8_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E9_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E9_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E9_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E9_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E9_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E9_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E9_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E9_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E9_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E9_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E9_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E9_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E10_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E10_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E10_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E10_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E10_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E10_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E10_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E10_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E10_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E10_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E10_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E10_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E11_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E11_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E11_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E11_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E11_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E11_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E11_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E11_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E11_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E11_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E11_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E11_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E12_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E12_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E12_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E12_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E12_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E12_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E12_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E12_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E12_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E12_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E12_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E12_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E13_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E13_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E13_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E13_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E13_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E13_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E13_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E13_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E13_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E13_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.E13_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.E13_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL0_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL0_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL0_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL0_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL0_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL0_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL0_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL0_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL0_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL0_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL0_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL0_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL1_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL1_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL1_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL1_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL1_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL1_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL1_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL1_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL1_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL1_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL1_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL1_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL2_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL2_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL2_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL2_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL2_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL2_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL2_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL2_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL2_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL2_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL2_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL2_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL3_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL3_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL3_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL3_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL3_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL3_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL3_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL3_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL3_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL3_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL3_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL3_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL4_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL4_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL4_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL4_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL4_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL4_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL4_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL4_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL4_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL4_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL4_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL4_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL5_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL5_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL5_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL5_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL5_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL5_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL5_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL5_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL5_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL5_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL5_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL5_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL6_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL6_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL6_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL6_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL6_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL6_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL6_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL6_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL6_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL6_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL6_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL6_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL7_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL7_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL7_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL7_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL7_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL7_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL7_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL7_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL7_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL7_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL7_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL7_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL8_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL8_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL8_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL8_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL8_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL8_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL8_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL8_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL8_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL8_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL8_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL8_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL9_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL9_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL9_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL9_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL9_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL9_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL9_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL9_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL9_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL9_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL9_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL9_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL10_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL10_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL10_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL10_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL10_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL10_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL10_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL10_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL10_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL10_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL10_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL10_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL11_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL11_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL11_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL11_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL11_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL11_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL11_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL11_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL11_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL11_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL11_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL11_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    --- ADDED 7/26/2006 ----------
    RPT4791_6890_Percent.EL12_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL12_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL12_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL12_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL12_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL12_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL12_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL12_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL12_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL12_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.EL12_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.EL12_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    --- ENDED 7/26/2006 ----------
    RPT4791_6890_Percent.Dx0_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx0_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx0_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx0_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx0_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx0_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx0_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx0_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx0_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx0_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx0_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx0_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx1_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx1_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx1_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx1_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx1_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx1_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx1_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx1_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx1_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx1_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx1_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx1_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx2_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx2_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx2_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx2_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx2_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx2_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx2_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx2_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx2_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx2_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx2_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx2_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx3_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx3_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx3_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx3_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx3_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx3_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx3_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx3_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx3_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx3_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.Dx3_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.Dx3_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS0_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS0_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS0_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS0_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS0_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS0_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS0_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS0_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS0_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS0_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS0_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS0_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS1_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS1_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS1_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS1_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS1_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS1_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS1_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS1_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS1_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS1_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS1_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS1_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS2_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS2_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS2_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS2_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS2_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS2_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS2_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS2_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS2_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS2_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS2_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS2_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS3_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS3_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS3_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS3_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS3_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS3_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS3_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS3_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS3_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS3_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS3_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS3_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS4_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS4_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS4_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS4_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS4_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS4_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS4_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS4_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS4_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS4_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS4_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS4_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS5_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS5_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS5_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS5_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS5_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS5_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS5_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS5_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS5_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS5_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS5_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS5_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS6_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS6_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS6_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS6_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS6_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS6_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS6_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS6_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS6_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS6_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS6_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS6_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS7_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS7_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS7_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS7_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS7_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS7_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS7_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS7_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS7_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS7_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS7_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS7_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS8_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS8_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS8_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS8_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS8_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS8_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS8_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS8_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS8_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS8_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS8_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS8_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS9_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS9_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS9_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS9_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS9_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS9_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS9_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS9_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS9_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS9_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS9_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS9_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS10_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS10_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS10_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS10_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS10_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS10_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS10_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS10_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS10_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS10_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS10_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS10_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS11_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS11_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS11_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS11_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS11_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS11_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS11_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS11_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS11_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS11_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS11_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS11_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS12_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS12_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS12_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS12_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS12_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS12_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS12_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS12_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS12_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS12_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS12_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS12_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS13_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS13_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS13_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS13_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS13_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS13_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS13_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS13_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS13_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS13_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS13_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS13_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS14_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS14_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS14_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS14_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS14_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS14_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS14_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS14_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS14_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS14_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS14_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS14_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS15_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS15_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS15_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS15_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS15_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS15_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS15_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS15_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS15_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS15_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS15_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS15_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS16_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS16_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS16_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS16_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS16_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS16_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS16_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS16_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS16_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS16_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS16_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS16_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS17_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS17_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS17_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS17_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS17_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS17_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS17_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS17_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS17_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS17_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS17_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS17_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS18_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS18_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS18_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS18_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS18_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS18_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS18_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS18_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS18_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS18_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS18_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS18_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS19_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS19_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS19_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS19_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS19_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS19_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS19_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS19_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS19_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS19_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS19_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS19_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS20_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS20_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS20_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS20_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS20_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS20_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS20_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS20_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS20_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS20_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS20_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS20_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS21_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS21_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS21_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS21_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS21_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS21_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS21_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS21_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS21_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS21_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS21_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS21_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS22_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS22_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS22_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS22_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS22_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS22_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS22_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS22_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS22_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS22_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS22_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS22_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS23_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS23_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS23_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS23_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS23_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS23_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS23_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS23_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS23_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS23_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS23_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS23_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS24_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS24_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS24_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS24_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS24_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS24_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS24_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS24_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS24_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS24_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS24_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS24_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS25_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS25_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS25_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS25_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS25_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS25_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS25_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS25_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS25_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS25_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS25_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS25_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS26_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS26_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS26_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS26_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS26_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS26_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS26_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS26_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS26_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS26_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS26_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS26_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS27_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS27_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS27_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS27_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS27_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS27_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS27_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS27_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS27_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS27_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS27_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS27_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    ----- ADDED 7/26/2006 ---------
    RPT4791_6890_Percent.DS28_S_percent = (CASE WHEN RPT4791_6890.TotalEncounter_S = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS28_S * 100.00)/RPT4791_6890.TotalEncounter_S, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS28_0_percent = (CASE WHEN RPT4791_6890.TotalEncounter_0 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS28_0 * 100.00)/RPT4791_6890.TotalEncounter_0, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS28_1_percent = (CASE WHEN RPT4791_6890.TotalEncounter_1 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS28_1 * 100.00)/RPT4791_6890.TotalEncounter_1, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS28_2_percent = (CASE WHEN RPT4791_6890.TotalEncounter_2 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS28_2 * 100.00)/RPT4791_6890.TotalEncounter_2, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS28_3_percent = (CASE WHEN RPT4791_6890.TotalEncounter_3 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS28_3 * 100.00)/RPT4791_6890.TotalEncounter_3, 0.0),5,1) + '%' END),
    RPT4791_6890_Percent.DS28_4_percent = (CASE WHEN RPT4791_6890.TotalEncounter_4 = 0 THEN '0.0%' ELSE str(ISNULL((RPT4791_6890.DS28_4 * 100.00)/RPT4791_6890.TotalEncounter_4, 0.0),5,1) + '%' END),
    ----- ENDED ADD -------
    RPT4791_6890_Percent.startdate = convert(varchar(10), @startdate, 101),
    RPT4791_6890_Percent.enddate = convert(varchar(10), @enddate, 101)
    from RPT4791_6890_Percent, RPT4791_6890 where
    RPT4791_6890_Percent.State = RPT4791_6890.State
    GO



  • Find him.

    Kill him.

    Torture him, then kill him.

    Start over.

    Simple 'nuf.



  • That's simply breathtaking.  I concur with snoofle, BTW.  That person needs to be given some hurt.  If you don't want to resort to illegal violence, then at least a large Nerf bombardment, perhaps a random one daily.



  • For the love of God and all things Holy!

    MY EYES!!!! 



  • I was thinking I spend a few weeks where I give him a million razor/paper cuts and dipping him repeatedly in salt/chlorine solution. finally when I was bored I would wrap him in aluminum foil and stick him in a gigantic microwave.



  • @JamesKilton said:

    For the love of God and all things Holy!

    MY EYES!!!! 

    I think what you want are these:

    The Goggles



  • I think I can safely say God had nothing to do with this.



  • i'm the poor sap that has to fix that hellish mess :(



  • @galgorah said:

    I work for one of the larger insurance companies in the US. My sub company deals mainly with behavioral health issues. Yesterday I got presented with an interesting issue. Years ago a young kid built quite an interesting report system. I really had not touched it before although I know other developers who have. Its a continual cluster of WTFs, to say the least. This app, we shall call it App X, is used to print out various reports. Anyways several reports were printing out erroneous data, totaling things wrong etc. These reports can and do contain 100+ fields and are generated by a stored procedure. When I went to take a look at the stored procedure I was quite amazed. It was the most god-awful thing I'd seen in a long time. 1500+ lines. Finding an error in it was going to be a nightmare. Luckily the kid who wrote it was recently rehired by the company. so I walked over and asked him what the deal was with this stored procedure. Turns out years back he had written a stored procedure to create this 1500+ line stored procedure. I think the attachment speaks for itself.

     

    The weirdest thing to me about this post (and others like it) is that you bothered to say "we shall call it App X", but then never reference that again.  Why even say it???



  • @Morbii said:

    The weirdest thing to me about this post (and others like it) is that you bothered to say "we shall call it App X", but then never reference that again.  Why even say it???

    The joys of unstructured writing. 



  • Here's a one act play I have written after seeing this thread:

    Steve: "Wow, the scroll bar got awfully long, this must be a popular thread."
    Steve: "Wait a minute, there's no way it could be that popular..."
    Steve: "Oh my God..."

    FIN


    P.S.  I apparently can't reply to the first post since it's so long.  The textbox just stays grayed out.



  • I'm surprised my writing was not worse.  My work is full of WTF's like this one.  The <a href="http://forums.worsethanfailure.com/forums/thread/123065.aspx">Bitprocessor</a> for example.  I've been at this job for a year and things have gotten a lot better in that time.  Even one of the other developers (.net) who when I started had no idea what OOP is, has learned a lot and improved, mostly by force mind you.  umm ya on secod thought maybe I should find a better company. LOL!



  • The scary part is that I showed this to our DBA here, and his only comment was "I've seen worse".

     Demons!  WHERE?!?  (Apparently, he says he has seen an 80 page Stored Procedure.  shudder)
     



  • ugh. This one is only about 66 pages when you print it out.  Tell him I now feel his pain on that one.  Ugh Well I'm off to bed again.  I woke up to a splitting migraine.  It's like Thor is pounding my skull with Mjölnir.  Probably induced by the whole host of WTF's recently Lol. 



  • @galgorah said:

    ugh. This one is only about 66 pages when you print it out.

    Well, you know what the (management) solution to that is, don't you?

    Use a smaller font size!

     


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.