Here is the end of the Stored Procedure I have. It has gone through many steps to create temporary values in the "Final Calculation". After the "Final Calculation" is done, the results are outputted to the screen.
I want to send these values to a text or csv file.
Here is the code:
/* FINAL CALCULATION */
SET @Denominator = (SELECT COUNT(VisitID) FROM #StrokePopulation)
SET @Numerator = (SELECT COUNT(VisitID) FROM #Numerator)
SET @Exclusions = (SELECT COUNT(VisitID) FROM #Exclusions)
/* Output for Attestation */
@MeasureNumberIdentifier AS 'Measure'
,@ReportName AS 'Report Name'
,@Denominator AS 'Denominator'
,@Numerator AS 'Numerator'
,@Exclusions AS 'Exclusions'
/* Output Detail for patients meeting Performance Numerator */
IF @Detail = 'Y'
SELECT 'Yes' AS [Meets Measure],*
Is "BCP" an option?