intakedesk / PowerBI-General

Placeholder for issues migrated from Jira
1 stars 0 forks source link

Clients, Talcum Usage calculate as per Eduardo and Howard Meeting #560

Closed jesusitd closed 3 years ago

jesusitd commented 4 years ago
array(
                    array(
                        'name' => 'talc_usage_months',
                        'label' => 'Total Times Used Prior to Diagnosis',
                        'customCode' => '
                        {if $fields.talc_usage_duration.value == "monthly"}
                            {assign var=m2 value="1"}
                        {elseif $fields.talc_usage_duration.value == "weekly"}
                            {assign var=m2 value="4.35"}
                        {elseif $fields.talc_usage_duration.value == "daily"}
                            {assign var=m2 value="30.5"}
                        {else}
                            {assign var=m2 value=0}
                        {/if}
                        {assign var=m1 value=$fields.talc_usage_duration_frequency.value|intval}                        
                        {assign var=m3 value=$fields.talc_usage_months.value|intval}
                        {assign var=m4 value=$fields.talc_usage_years_before_diagnosis.value|intval}
                        {$m1*$m2*$m3*$m4|intval} times used',
                    ),
                    array(

                    ),
                ), 

this has the constants used for the application

jesusitd commented 4 years ago

Working for AWKO: image image

Talc Usage Total Applications = 'Cases'[talc_usage_years] * 'Cases'[Talc Usage Months Per Year] * 'Cases'[Talc Usage Applications Days per Month] * COALESCE( 'Cases'[Talc Usage Duration Frequency Times a Day], 1 ) (Applied to APPLICATIONS calculated columns)

jesusitd commented 4 years ago

ALSO: TALCUM USAGE QUALIFYING YEARS AND APPLICATIONS CANNOT CONSIDER 1982 FOR NOW.

Must use regular hierarchy or precedence: Start Year -> Tubal Ligation ? -> DX ? -> Discontinued Date.

Talc Usage Years Qualifying = -- COALESCE( 'Cases'[Talc Usage 1982 Before Tubal Ligation], 'Cases'[Talc Usage 1982 Before Discontinued Date] )
COALESCE( 'Cases'[Talc Usage Before Tubal Ligation], 'Cases'[talc_usage_years] )

Talc Usage Before Tubal Ligation = VAR _diff =  DATEDIFF( 'Cases'[Talc Usage Start Date], 'Cases'[Talc Tubal Ligation Date], YEAR ) RETURN IF( _diff >= 0, _diff, BLANK() )

Talc P7 Usage Frequency = IF( 'Cases'[Talc Usage Years Qualifying] >= 6 || COALESCE( 'Cases'[Talc Usage Applications Before Tubal Ligation], 'Cases'[Talc Usage Total Applications] ) >= 2000, "Meets Criteria", "Does Not Meet Criteria" )
/* IF( 'Cases'[Talc Usage Years Qualifying] >= 6 || COALESCE( 'Cases'[Talc Usage 1982 Applications Before Tubal Ligation], 'Cases'[Talc Usage 1982 Applications Before Discontinued Date] ) >= 2000, "Meets Criteria", "Does Not Meet Criteria" ) */
jesusitd commented 4 years ago

Also released:

Waiting HK revision

jesusitd commented 3 years ago

All Talc usage being calculated well.