PP01: Continuous years with patient counts

List number of patients who have continuous payer plan of at least one year

Input:
<None>

Sample query run:
The following is a sample run of the query.
SELECT floor((p.payer_plan_period_end_date - p.payer_plan_period_start_date)/365) AS year_int,  
       count(1) AS num_patients
FROM payer_plan_period p
GROUP BY floor((p.payer_plan_period_end_date - p.payer_plan_period_start_date)/365)  
ORDER BY 1
;

Output:
Output field list:
 Field  Description
payer_plan_period_start_date The start date of the payer plan period.
payer_plan_period_end_date The end date of the payer plan period.

Sample output record:
 Field  Description
payer_plan_period_start_date  
payer_plan_period_end_date  
Comments