source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SDAMQ1.m@ 1705

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

initial load of FOIAVistA 6/30/08 version

File size: 2.6 KB
Line 
1SDAMQ1 ;ALB/MJK - AM Background Job (cont.) ; 12/1/91
2 ;;5.3;Scheduling;**24,132**;Aug 13, 1993
3 ;
4BULL ; -- send bulletin
5 ; use site specified mg
6 N SDLN,XMY,XMTEXT,XMSUB,XMDUZ
7 D XMY^SDUTL2(+$P($G(^DG(43,1,"SCLR")),U,15),0)
8 G BULLQ:'$D(XMY)
9 S XMSUB="Outpatient Encounter Status Update"
10 K ^TMP("SDAMTEXT",$J) S XMTEXT="^TMP(""SDAMTEXT"",$J,",SDLN=0
11 D TEXT,^XMD
12BULLQ K ^TMP("SDAMTEXT",$J)
13 Q
14 ;
15TEXT ;
16 D SET^SDAMQ3("The 'Outpatient Encounter' status update has been completed.")
17 D SET^SDAMQ3(" ")
18 D SET^SDAMQ3(" Job STARTED Date/Time: "_$$FTIME^VALM1(SDSTART))
19 D SET^SDAMQ3(" Job FINISHED Date/Time: "_$$FTIME^VALM1(SDFIN))
20 D SET^SDAMQ3(" ")
21 D SET^SDAMQ3(" ")
22 D SET^SDAMQ3(" *** Update Summary ***")
23 D SET^SDAMQ3(" ")
24 D SET^SDAMQ3(" Outpatient encounters from "_$$FDATE^VALM1(SDBEG)_" to "_$$FDATE^VALM1(SDEND)_"@2400:")
25 N SDIVNM,SDTOT
26 S SDIVNM="" F X="NAT","GRAND" S SDTOT("OVERALL",X)=0
27 F S SDIVNM=$O(^TMP("SDSTATS",$J,SDIVNM)) Q:SDIVNM="" D
28 .F X="NAT","GRAND" S SDTOT("DIV",X)=0
29 .D SET^SDAMQ3(""),SET^SDAMQ3(""),SET^SDAMQ3(""),SET^SDAMQ3(" Division: "_SDIVNM)
30 .D BULL^SDAMQ3(.SDIVNM,.SDLN,.SDTOT) ; appointments
31 .D BULL^SDAMQ4(.SDIVNM,.SDLN,.SDTOT) ; add/edits
32 .D BULL^SDAMQ5(.SDIVNM,.SDLN,.SDTOT) ; dispositions
33 .D SET^SDAMQ3(" ============== =============== ======= =======")
34 .D LINE^SDAMQ3("DIVISION TOTAL",SDTOT("DIV","NAT"),SDTOT("DIV","GRAND"))
35 .F X="NAT","GRAND" S SDTOT("OVERALL",X)=SDTOT("OVERALL",X)+SDTOT("DIV",X)
36 D SET^SDAMQ3(" ============== =============== ======= =======")
37 D LINE^SDAMQ3("FACILITY TOTAL",SDTOT("OVERALL","NAT"),SDTOT("OVERALL","GRAND"))
38 Q
39 ;
40ADD ; -- add log entries
41 N SDDT,X1,X2,X,DR,DA,DIE,DIC
42 S SDDT=SDBEG
43 F Q:SDDT>SDEND S X=SDDT,DIC(0)="LM",DLAYGO=409.65,DIC="^SDD(409.65," D ^DIC K DIC,DLAYGO D
44 .I Y>0 S DA=+Y,DR="[SDAM ADD LOG]",DIE="^SDD(409.65," D ^DIE
45 .S X1=SDDT,X2=1 D C^%DTC S SDDT=X
46 Q
47 ;
48UPD(SDBEG,SDEND,SDATE,SDFLD,SDADD) ; -- update date fields in 409.65
49 ; input: SDBEG := begin date
50 ; SDEND := end date
51 ; SDATE := date/time of processing(i.e. NOW)
52 ; SDFLD := date field to update
53 ; SDADD := flag to add entry [optional]
54 ;
55 N SDDT,X1,X2,X,DR,DA,DIE,DIC,SDDR
56 I '$D(SDADD) N SDADD S SDADD=0
57 S SDDT=SDBEG,SDDR=SDFLD_"////"_SDATE
58 F Q:SDDT>SDEND D
59 .S X=SDDT,DIC(0)="",DIC="^SDD(409.65,"
60 .S:SDADD DIC(0)=DIC(0)_"L",DLAYGO=409.65
61 .D ^DIC K DIC,DLAYGO
62 .I Y>0,$S(SDFLD'=.06:1,1:'$D(^TMP("SDAM NOT UPDATED",$J,SDDT))) S DA=+Y,DR=SDDR,DIE="^SDD(409.65," D ^DIE
63 .S X1=SDDT,X2=1 D C^%DTC S SDDT=X
64 Q
65 ;
Note: See TracBrowser for help on using the repository browser.