Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SCCVEGD0

SCCVEGD0.m

Go to the documentation of this file.
  1. SCCVEGD0 ;ALB/JRP,TMP - DSPLY RSLTS 4 ENCNTR CNVRSN GLBL ESTMTR;18-JAN-96
  1. ;;5.3;Scheduling;**211**;Aug 13, 1993
  1. MAILSUM(PTRLOG,RESULT) ;MAIL SUMMARY OF GLOBAL ESTIMATES
  1. ;INPUT : PTRLOG - Pointer to entry in SCHEDULING CONVERSION LOG
  1. ; file (#404.98) that display is built for
  1. ;OUTPUT : RESULT - the # of users the bulletin was sent to [optional]
  1. ;NOTES : Summary will be mailed to all users that scheduled and
  1. ; re-started the estimation and to the current user. If no
  1. ; valid recipients are, it will be sent to the POSTMASTER.
  1. ;
  1. N SCLINES,LINES,NODE,TMP,TMP1,XMSUB,XMDUZ,XMY,XMZ,XMTEXT
  1. ;
  1. S RESULT=0
  1. ;
  1. Q:'$D(^SD(404.98,+$G(PTRLOG),0))
  1. ;
  1. ;Build message subject/stub
  1. S XMSUB="Scheduling Conversion Global Growth for "
  1. S TMP=+$P($G(^SD(404.98,PTRLOG,0)),U,3)
  1. S XMSUB=XMSUB_$E(TMP,4,5)_"/"_$E(TMP,6,7)_"/"_(1700+$E(TMP,1,3))
  1. S TMP=+$P($G(^SD(404.98,PTRLOG,0)),U,4)
  1. S XMSUB=XMSUB_" to "_$E(TMP,4,5)_"/"_$E(TMP,6,7)_"/"_(1700+$E(TMP,1,3))
  1. S XMDUZ="SCHEDULING CONVERSION GLOBAL ESTIMATOR"
  1. ;Build bulletin text
  1. S LINES=$$BUILD(PTRLOG,"SCLINES")
  1. S XMTEXT="SCLINES("
  1. I $G(DUZ) S XMY(+DUZ)="",RESULT=RESULT+1 ;Send to current user
  1. ;Find all users that scheduled or re-started the conversion
  1. S TMP=0
  1. F S TMP=+$O(^SD(404.98,PTRLOG,"R",TMP)) Q:'TMP S NODE=$G(^(TMP,0)) D
  1. .Q:"13"'[+$P(NODE,U,2) ; schedule or re-start only
  1. .I $P(NODE,U,6),'$D(XMY(+$P(NODE,U,6))) S RESULT=RESULT+1,XMY(+$P(NODE,U,6))=""
  1. ;No users - send to POSTMASTER
  1. I '$O(XMY(0)) S XMY(.5)="",RESULT=1
  1. ;Send message
  1. D ^XMD
  1. Q
  1. ;
  1. BUILD(PTRLOG,OUTARRAY) ;BUILD DISPLAY FOR GLOBAL ESTIMATES
  1. ;INPUT : PTRLOG - Pointer to entry in SCHEDULING CONVERSION LOG
  1. ; file (#404.98) that display is built for
  1. ; OUTARRAY - Array to build display into (full global reference)
  1. ; Defaults to ^TMP("SCCVEG",$J,"DISPLAY")
  1. ;OUTPUT : N - Number of lines in display
  1. ; OUTARRAY will be returned as follows
  1. ; OUTARRAY(x,0) = Line x of display
  1. ; (First line in display will be line # 1)
  1. ;NOTES : Display is based on a screen width of 80 characters
  1. ; : It is the responsibility of the calling application to
  1. ; initialize OUTARRAY
  1. ;
  1. N CURRENT,INSERTED,LOGNODE,TMP,INFO,DATE,SCCV2,Z
  1. ;
  1. Q:'$D(^SD(404.98,+$G(PTRLOG,0))) 0
  1. ;
  1. S:$G(OUTARRAY)="" OUTARRAY="^TMP(""SCCVEG"","_$J_",""DISPLAY"")"
  1. S LOGNODE=$G(^SD(404.98,PTRLOG,0)),SCCV2=$G(^(2))
  1. ;Put totals into display
  1. S CURRENT=1
  1. S Z="Template #: "_PTRLOG
  1. S @OUTARRAY@(CURRENT,0)=Z
  1. S CURRENT=CURRENT+1
  1. S @OUTARRAY@(CURRENT,0)=$E("Total # new entries expected:"_$J("",39),1,39)_"Total # encounters to convert:"
  1. S CURRENT=CURRENT+1
  1. S @OUTARRAY@(CURRENT,0)=$E(" Encounters : "_+$P(SCCV2,U,7)_$J("",39),1,39)_" Add/Edits : "_+$P(SCCV2,U)
  1. S CURRENT=CURRENT+1
  1. S @OUTARRAY@(CURRENT,0)=$E(" Visits : "_+$P(SCCV2,U,8)_$J("",39),1,39)_" Ancillaries : "_+$P(SCCV2,U,2)
  1. S CURRENT=CURRENT+1
  1. S @OUTARRAY@(CURRENT,0)=$E(" V PROVIDERs : "_+$P(SCCV2,U,9)_$J("",39),1,39)_" Appointments: "_+$P(SCCV2,U,3)
  1. S CURRENT=CURRENT+1
  1. S @OUTARRAY@(CURRENT,0)=$E(" V POVs : "_+$P(SCCV2,U,10)_$J("",39),1,39)_" Credit Stops: "_+$P(SCCV2,U,4)
  1. S CURRENT=CURRENT+1
  1. S @OUTARRAY@(CURRENT,0)=$E(" V CPTs : "_+$P(SCCV2,U,11)_$J("",39),1,39)_" Dispositions: "_+$P(SCCV2,U,5)
  1. ;Put whitespace into display
  1. S CURRENT=CURRENT+1,@OUTARRAY@(CURRENT,0)=""
  1. ;Put global estimations chart into display
  1. S INSERTED=$$DSPGLBL^SCCVEGD1(PTRLOG,OUTARRAY,CURRENT)
  1. S CURRENT=CURRENT+INSERTED
  1. ;Done - return number of lines contained in display
  1. Q CURRENT