source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDAMQ4.m@ 1361

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

initial load of WorldVistAEHR

File size: 2.0 KB
RevLine 
[613]1SDAMQ4 ;ALB/MJK - AM Background Job/Add/Edit Processing ; 24 Aug 99 9:59 PM
2 ;;5.3;Scheduling;**24,132,153,199**;Aug 13, 1993
3 ;
4EN(SDBEG,SDEND) ; -- count add/edits
5 N SDT,SDOE
6 S SDT=SDBEG
7 F S SDT=$O(^SCE("B",SDT)) Q:'SDT!(SDT>SDEND) D
8 . S SDOE=0
9 . F S SDOE=$O(^SCE("B",SDT,SDOE)) Q:'SDOE D CHK(SDOE)
10ENQ Q
11 ;
12CHK(SDOE) ; -- set data in ^tmp if appropriate
13 N SDOE0,SDIVNM,SDNAT,X,SDSTOP,SDSTAT
14 S SDOE0=$G(^SCE(SDOE,0))
15 S SDPAR=+$P(SDOE0,U,6)
16 S SDORG=+$P(SDOE0,U,8)
17 S SDSTAT=$P(SDOE0,U,12)
18 ;
19 ; -- do checks
20 IF SDPAR G CHKQ ; -- quit if has parent
21 IF SDORG'=2 G CHKQ ; -- quit if no a/e
22 IF $$REQ^SDM1A(+SDOE0)'="CO" G CHKQ ; -- quit if "CO" not required
23 IF '$$DIV^SDAMQ(+$P(SDOE0,U,11),.SDIVNM,35) G CHKQ ; -- quit if no division
24 ;
25 ; -- set ^tmp
26 S SDNAT='$$CO^SDAMQ(SDOE) I SDNAT S SDNAT=SDSTAT=14
27 S SDSTOP=+$P($G(^DIC(40.7,+$P(SDOE0,U,3),0)),U,2)
28 S X=$G(^TMP("SDSTATS",$J,SDIVNM,"AE",SDSTOP))
29 S ^TMP("SDSTATS",$J,SDIVNM,"AE",SDSTOP)=(X+SDNAT)_U_($P(X,U,2)+1)
30 ;
31CHKQ Q
32 ;
33BULL(SDIVNM,SDLN,SDTOT) ;
34 N SDSTOP,SDSTOPN,NAT,GRAND,OTHER,TNAT,TGRAND
35 D HDR
36 S (OTHER,SDSTOP,TNAT,TGRAND)=0
37 F S SDSTOP=$O(^TMP("SDSTATS",$J,SDIVNM,"AE",SDSTOP)) Q:'SDSTOP S X=^(SDSTOP) D
38 .S NAT=+X,GRAND=+$P(X,U,2)
39 .S TNAT=TNAT+NAT,TGRAND=TGRAND+GRAND
40 .S SDTOT("DIV","NAT")=SDTOT("DIV","NAT")+NAT
41 .S SDTOT("DIV","GRAND")=SDTOT("DIV","GRAND")+GRAND
42 .S SDSTOPN=$S($D(^DIC(40.7,+$O(^DIC(40.7,"C",SDSTOP,0)),0)):$P(^(0),U),1:"UNKNOWN")
43 .I 'NAT S OTHER=OTHER+GRAND
44 .I NAT D LINE^SDAMQ3(SDSTOP_"-"_SDSTOPN,NAT,GRAND)
45 D LINE^SDAMQ3("ALL OTHER STOPS",0,OTHER)
46 D SET^SDAMQ3(" --------------- ---------------- ------- -------")
47 D LINE^SDAMQ3("Add/Edit Totals",TNAT,TGRAND)
48BULLQ Q
49 ;
50HDR ; -- ae header block
51 D SET^SDAMQ3("")
52 D SET^SDAMQ3(" Add/Edits Total")
53 D SET^SDAMQ3(" Stop Code Requiring Action Stops Pct.")
54 D SET^SDAMQ3(" --------- ---------------- ------- -------")
55 Q
Note: See TracBrowser for help on using the repository browser.