; If report is sent to screen, prompt for next page or quit
CNT
EN
; Called from DG UNSUPPORTED CV END DATES RPT option
SCH
CVDATEQ
SRT()
; Get sort order
; OUPUT: Y - Sort (N=Name; D=DFN)
PRINT
; Print veteran
CHK
; Calculate CV End Date, check MSE data is supporting it
; INPUT: DFN - Patient file IEN
; OUTPUT: CEN = CV End Date on file
; CALC = Calculated CV End Date
PRTVAR
; Set up variables needed to print report
RPT(DGSRT)
; Entry point to produce report
TOT
; Print total records at the end of the report
LOOPD
; Sort by DFN. Loop through ^XTMP("DGCVRPT","NOSUP","DFN", x-ref
HDR
; Print report header
EN1
; Extract
EN2(DGSRT)
; Print
; INPUT DGSRT - Sort order for report (Name or DFN)
RPTQUE
; Get report device. Queue report if requested.
PUT
; Put record on list
CVDATE(DFN,DGARR,DGERR)
; Returns all values for calculating the CV End date
; in DGARR (passed by reference)
; AND
; any error codes from the DIQ call in DGERR (passed by reference)
; AND
; the calculated CV End Date as the result of the function call
LOOPN
; Sort by name. Loop through ^XTMP("DGCVRPT","NOSUP","NAM", x-ref