;Change dates to display format
; Input:
; GMRCDT1 Start date in FM format, can be "ALL" for all dates
; GMRCDT2 End date in FM format, can be null if GMRCDT1 is "ALL"
; Output:
; GMRCEDT1 Start date in external format
; GMRCEDT2 End date in extenal format
DOSTAT(GEN,ND)
;Do the number crunching for the statistics
; GEN 1 if service
; 2 if grouper
; ND This service in GMRCSVC
SERVSTAT(COUNT,GEN,ND,GRP)
;Build list for a service or a grouper
; COUNT subscript in to the array ^TMP("GMRCR"
; GEN 1 if service
; 2 if grouper
; ND Pointer to this this service in GMRCSVC
; GRP Pointer to grouper that this service is in ^GMR(123.5
; (If this is not a grouper i.e. GEN=2)
PARENTS(ND,PARENT)
;Add totals for service to itself as a parent and to its parent service
; ND This service in GMRCSVC
; PARENT This services grouper in GMRCSVC