source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SCCVEGD0.m@ 635

Last change on this file since 635 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.5 KB
Line 
1SCCVEGD0 ;ALB/JRP,TMP - DSPLY RSLTS 4 ENCNTR CNVRSN GLBL ESTMTR;18-JAN-96
2 ;;5.3;Scheduling;**211**;Aug 13, 1993
3MAILSUM(PTRLOG,RESULT) ;MAIL SUMMARY OF GLOBAL ESTIMATES
4 ;INPUT : PTRLOG - Pointer to entry in SCHEDULING CONVERSION LOG
5 ; file (#404.98) that display is built for
6 ;OUTPUT : RESULT - the # of users the bulletin was sent to [optional]
7 ;NOTES : Summary will be mailed to all users that scheduled and
8 ; re-started the estimation and to the current user. If no
9 ; valid recipients are, it will be sent to the POSTMASTER.
10 ;
11 N SCLINES,LINES,NODE,TMP,TMP1,XMSUB,XMDUZ,XMY,XMZ,XMTEXT
12 ;
13 S RESULT=0
14 ;
15 Q:'$D(^SD(404.98,+$G(PTRLOG),0))
16 ;
17 ;Build message subject/stub
18 S XMSUB="Scheduling Conversion Global Growth for "
19 S TMP=+$P($G(^SD(404.98,PTRLOG,0)),U,3)
20 S XMSUB=XMSUB_$E(TMP,4,5)_"/"_$E(TMP,6,7)_"/"_(1700+$E(TMP,1,3))
21 S TMP=+$P($G(^SD(404.98,PTRLOG,0)),U,4)
22 S XMSUB=XMSUB_" to "_$E(TMP,4,5)_"/"_$E(TMP,6,7)_"/"_(1700+$E(TMP,1,3))
23 S XMDUZ="SCHEDULING CONVERSION GLOBAL ESTIMATOR"
24 ;Build bulletin text
25 S LINES=$$BUILD(PTRLOG,"SCLINES")
26 S XMTEXT="SCLINES("
27 I $G(DUZ) S XMY(+DUZ)="",RESULT=RESULT+1 ;Send to current user
28 ;Find all users that scheduled or re-started the conversion
29 S TMP=0
30 F S TMP=+$O(^SD(404.98,PTRLOG,"R",TMP)) Q:'TMP S NODE=$G(^(TMP,0)) D
31 .Q:"13"'[+$P(NODE,U,2) ; schedule or re-start only
32 .I $P(NODE,U,6),'$D(XMY(+$P(NODE,U,6))) S RESULT=RESULT+1,XMY(+$P(NODE,U,6))=""
33 ;No users - send to POSTMASTER
34 I '$O(XMY(0)) S XMY(.5)="",RESULT=1
35 ;Send message
36 D ^XMD
37 Q
38 ;
39BUILD(PTRLOG,OUTARRAY) ;BUILD DISPLAY FOR GLOBAL ESTIMATES
40 ;INPUT : PTRLOG - Pointer to entry in SCHEDULING CONVERSION LOG
41 ; file (#404.98) that display is built for
42 ; OUTARRAY - Array to build display into (full global reference)
43 ; Defaults to ^TMP("SCCVEG",$J,"DISPLAY")
44 ;OUTPUT : N - Number of lines in display
45 ; OUTARRAY will be returned as follows
46 ; OUTARRAY(x,0) = Line x of display
47 ; (First line in display will be line # 1)
48 ;NOTES : Display is based on a screen width of 80 characters
49 ; : It is the responsibility of the calling application to
50 ; initialize OUTARRAY
51 ;
52 N CURRENT,INSERTED,LOGNODE,TMP,INFO,DATE,SCCV2,Z
53 ;
54 Q:'$D(^SD(404.98,+$G(PTRLOG,0))) 0
55 ;
56 S:$G(OUTARRAY)="" OUTARRAY="^TMP(""SCCVEG"","_$J_",""DISPLAY"")"
57 S LOGNODE=$G(^SD(404.98,PTRLOG,0)),SCCV2=$G(^(2))
58 ;Put totals into display
59 S CURRENT=1
60 S Z="Template #: "_PTRLOG
61 S @OUTARRAY@(CURRENT,0)=Z
62 S CURRENT=CURRENT+1
63 S @OUTARRAY@(CURRENT,0)=$E("Total # new entries expected:"_$J("",39),1,39)_"Total # encounters to convert:"
64 S CURRENT=CURRENT+1
65 S @OUTARRAY@(CURRENT,0)=$E(" Encounters : "_+$P(SCCV2,U,7)_$J("",39),1,39)_" Add/Edits : "_+$P(SCCV2,U)
66 S CURRENT=CURRENT+1
67 S @OUTARRAY@(CURRENT,0)=$E(" Visits : "_+$P(SCCV2,U,8)_$J("",39),1,39)_" Ancillaries : "_+$P(SCCV2,U,2)
68 S CURRENT=CURRENT+1
69 S @OUTARRAY@(CURRENT,0)=$E(" V PROVIDERs : "_+$P(SCCV2,U,9)_$J("",39),1,39)_" Appointments: "_+$P(SCCV2,U,3)
70 S CURRENT=CURRENT+1
71 S @OUTARRAY@(CURRENT,0)=$E(" V POVs : "_+$P(SCCV2,U,10)_$J("",39),1,39)_" Credit Stops: "_+$P(SCCV2,U,4)
72 S CURRENT=CURRENT+1
73 S @OUTARRAY@(CURRENT,0)=$E(" V CPTs : "_+$P(SCCV2,U,11)_$J("",39),1,39)_" Dispositions: "_+$P(SCCV2,U,5)
74 ;Put whitespace into display
75 S CURRENT=CURRENT+1,@OUTARRAY@(CURRENT,0)=""
76 ;Put global estimations chart into display
77 S INSERTED=$$DSPGLBL^SCCVEGD1(PTRLOG,OUTARRAY,CURRENT)
78 S CURRENT=CURRENT+INSERTED
79 ;Done - return number of lines contained in display
80 Q CURRENT
Note: See TracBrowser for help on using the repository browser.