Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@grgaortiz
Created September 8, 2016 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grgaortiz/352d99515a3a03633349ca4edb488c26 to your computer and use it in GitHub Desktop.
Save grgaortiz/352d99515a3a03633349ca4edb488c26 to your computer and use it in GitHub Desktop.
SELECT TOP 1
PhysicianName,
wrvuactualytd AS WRVU_Actual,
wrvuthresholdYTD AS WRVU_Threshold,
[Rate per Work RVU] AS RatePerRVU,
EarnedCompYTD AS EarnedComp,
clinicalbasedrawYTD AS BaseDraw,
QualityCompWithholdYTD AS QualityBonusWithold,
ExcessEarnedCompYTD AS ExcessEarnedComp,
TrueupQ1,
TrueupQ2,
TrueupQ3,
TrueupQ4,
TrueupYTD,
EstCompDueYTD,
GroupWRVUsYTD,
GroupThresholdYTD,
GroupWeightedAVGRate,
GroupEarnedCompYTD,
GroupBaseDrawYTD,
GroupQualityCompwithholdYTD,
GroupExcessEarnedCompYTD,
GroupTrueupQ1,
GroupTrueupQ2,
GroupTrueupQ3,
GroupTrueupQ4,
GroupTrueupYTD,
GroupEstimatedEarnedCompDueYTD,
StartDate,
ReportPeriod,
ROW_NUMBER() OVER (PARTITION BY PhysicianName ORDER BY ReportPeriod ASC) AS TotalReportPeriods
FROM PhysicianComp_Display
WHERE Year = '2016' AND SpecialtyGroup = 'MED HOSPITALIST, IFH'
ORDER BY TotalReportPeriods DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment