source: FOIAVistA/tag/r/SCHEDULING-SD-SC/SDSCSSD.m@ 1540

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

initial load of FOIAVistA 6/30/08 version

File size: 3.8 KB
Line 
1SDSCSSD ;ALB/JAM/RBS - ASCD Service Summary Data Report ; 3/13/07 12:30pm
2 ;;5.3;Scheduling;**495**;Aug 13, 1993;Build 50
3 ;;MODIFIED FOR NATIONAL RELEASE from a Class III software product
4 ;;known as Service Connected Automated Monitoring (SCAM).
5 ;
6 ;**Program Description**
7 ; This report is to be used by managers only
8 Q
9EN ; Entry Point
10 N DIR,X,Y,SDSCRVNM,SDSCSRV,ZTQUEUED,POP,ZTRTN,ZTDTH,ZTDESC,ZTSAVE
11 K ^TMP("SDSCSRV",$J)
12 ; Get start and end date for report
13 D GETDATE^SDSCOMP I SDSCTDT="" G EXIT
14 ; Get Service
15 D SRV^SDSCUTL S DIR("B")="ALL"
16 D ^DIR
17 I $G(DTOUT)!($G(DUOUT)) G EXIT
18 S SDSCRVNM=Y(0)
19 S SDSCSRV=$S(Y'="A":Y,1:"")
20 K %ZIS,IOP,IOC,ZTIO S %ZIS="MQ" D ^%ZIS G:POP EXIT
21 I $D(IO("Q")) D G EXIT
22 . S ZTRTN="FND^SDSCSSD",ZTDTH=$H,ZTDESC="ASCD Service Summary Report"
23 . S ZTSAVE("SDSCBDT")="",ZTSAVE("SDSCEDT")="",ZTSAVE("SDSCRVNM")=""
24 . S ZTSAVE("SDSCSRV")="",ZTSAVE("SDEDT")="",ZTSAVE("SDSCTDT")=""
25 . K IO("Q") D ^%ZTLOAD W !,"REQUEST QUEUED"
26 ;
27FND ;
28 N SDOEDT,TOTAL,SDOE,CLIN,CLNM,SERV,SDSCDATA,SI,SDABRT,VAL,AMT,COL,P,L
29 N SBTOT,TYP,SCVAL
30 S SDOEDT=SDSCTDT,TOTAL=0
31 F S SDOEDT=$O(^SDSC(409.48,"AE",SDOEDT)) Q:SDOEDT\1>SDEDT!(SDOEDT="") D
32 . S SDOE=""
33 . F S SDOE=$O(^SDSC(409.48,"AE",SDOEDT,SDOE)) Q:SDOE="" D
34 .. S CLIN=$$GET1^DIQ(409.68,SDOE_",",.04,"I") I CLIN="" Q
35 .. S CLNM=$$GET1^DIQ(409.68,SDOE_",",.04,"E")
36 .. I SDSCSRV'="" Q:$$GET1^DIQ(44,CLIN_",",9,"I")'=SDSCSRV
37 .. S SERV=$$GET1^DIQ(44,CLIN_",",9,"E")
38 .. S SDSCDATA=$G(^SDSC(409.48,SDOE,0)) I SDSCDATA="" Q
39 .. I +$P(SDSCDATA,U,9),+$P(SDSCDATA,U,6) D STORE("VBA") Q
40 .. I $P(SDSCDATA,U,5)="R" D STORE("REV") Q
41 .. I $P(SDSCDATA,U,5)="C" S SCVAL=$$SCHNG^SDSCUTL(SDOE) D:SCVAL'="" Q
42 ...I '+SCVAL D STORE("NO CHANGE") Q
43 ...I $P(SCVAL,"^",2) D STORE("SCNSC") Q
44 ...D STORE("NSCSC")
45 .. D STORE("NEW")
46 ;
47PRT ; Print report
48 S (P,L,SDABRT)=0 D HDR G EXT:$G(SDABRT)=1
49 F VAL="VBA","REV","NO CHANGE","SCNSC","NSCSC","NEW" S TOTAL(VAL)=0
50 S SERV="" F S SERV=$O(^TMP("SDSCSRV",$J,SERV)) Q:SERV="" D Q:$G(SDABRT)=1
51 . I L+4>IOSL D HDR Q:$G(SDABRT)=1
52 . W !,SERV S L=L+1 F VAL="VBA","REV","NO CHANGE","SCNSC","NSCSC","NEW" S SBTOT(VAL)=0
53 . S CLNM="" F S CLNM=$O(^TMP("SDSCSRV",$J,SERV,CLNM)) Q:CLNM="" D Q:$G(SDABRT)=1
54 .. I L+4>IOSL D HDR Q:$G(SDABRT)=1
55 .. W !,?1,$E(CLNM,1,20) S COL=21,L=L+1
56 .. F VAL="VBA","REV","SCNSC","NSCSC","NO CHANGE","NEW" D
57 ... S AMT=+$G(^TMP("SDSCSRV",$J,SERV,CLNM,VAL)) W ?COL,$J(AMT,7) S COL=COL+10
58 ... S SBTOT(VAL)=SBTOT(VAL)+AMT,TOTAL(VAL)=$G(TOTAL(VAL))+AMT
59 . Q:$G(SDABRT)=1
60 . I L+4>IOSL D HDR Q:$G(SDABRT)=1
61 . W ! S COL=21,L=L+1 F VAL="VBA","REV","SCNSC","NSCSC","NO CHANGE","NEW" D
62 .. W ?COL,"---------" S COL=COL+10
63 . I L+4>IOSL D HDR Q:$G(SDABRT)=1
64 . W !,"Subtotal "_SERV
65 . S COL=21,L=L+1 F VAL="VBA","REV","SCNSC","NSCSC","NO CHANGE","NEW" D
66 .. W ?COL,$J(SBTOT(VAL),7) S COL=COL+10
67 I $G(SDABRT)=1 G EXT
68 I L+4>IOSL D HDR Q:$G(SDABRT)=1
69 S COL=21,L=L+1 W !
70 F TYP="VBA","REV","SCNSC","NSCSC","NO CHANGE","NEW" D
71 . W ?COL,"---------" S COL=COL+10
72 S COL=21,L=L+1 W !,"TOTAL"
73 F TYP="VBA","REV","SCNSC","NSCSC","NO CHANGE","NEW" D
74 . W ?COL,$J($G(TOTAL(TYP)),7) S COL=COL+10
75EXT ;
76 D RPTEND^SDSCRPT1
77 ;
78EXIT ;
79 K SDSCTDT,SDEDT,DIR,Y,SDSCRVNM,SDSCBDT,SDSCEDT,SDSCMSG,SDEFLG
80 K SDFLG,SDOEDAT,SDOSC,SDPAT,SDSCPKG,SDSCSRC,SDV0,I,DIV,SDABRT
81 K SDSCSRV,SDSCDNM,SUBTOT,X,DIRUT,DTOUT,DUOUT ;^TMP("SDSCSRV",$J)
82 Q
83STORE(VAL) ; Total up and Store
84 S ^TMP("SDSCSRV",$J,SERV,CLNM,VAL)=$G(^TMP("SDSCSRV",$J,SERV,CLNM,VAL))+1
85 S ^TMP("SDSCSRV",$J,SERV,CLNM,VAL,SDOE)=""
86 K VAL
87 Q
88HDR ; Header
89 N SDHDR,SDNWPV,I
90 S SDHDR="Service Summary Data Report"
91 U IO D STDHDR^SDSCRPT2 Q:$G(SDABRT)=1
92 S SDNWPV=1,L=4
93 W SDHDR,?67,"PAGE: ",P
94 W !,?5,"For Encounters Dated ",$$FMTE^XLFDT(SDSCTDT,2)," THRU ",$$FMTE^XLFDT(SDEDT,2)," For Service: ",SDSCRVNM
95 W !?24,"VBA OK",?34,"REVIEW",?43,"SC to NSC",?53,"NSC to SC",?65,"SC KEPT",?75,"NEW"
96 W ! F I=1:1:79 W "-"
97 Q
Note: See TracBrowser for help on using the repository browser.