source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGODUTL.m@ 862

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

initial load of WorldVistAEHR

File size: 3.0 KB
RevLine 
[613]1DGODUTL ;ALB/EG - INITIALIZE ARRAYS FOR DGODNP1/DGODOP1 & TOTAL ; JAN-13-1989 @ 0854
2 ;;5.3;Registration;;Aug 13, 1993
3 ;;V 4.5
4G0 ;initializes array
5 S A1=0 F I=1:1 S A1=$O(^DG(40.8,A1)) Q:(A1="")!(A1'?.N) S A(I)=^DG(40.8,A1,0),A2=I,DGDV=$E($P(A(I),U,2)_" ",1,5) S ^UTILITY("DGOD",$J,"AO",I)=A(I) F K1=1:1:DGTN D G1
6 Q
7 ;
8G1 ;zero each cell
9 S ^UTILITY("DGOD",$J,DGJB,K1,"TOT",DGDV)=0 F DGV="N","V" F DGMT="AN","AS","B","C","N","U","X" F DGEL="*",0:1:8 S ^UTILITY("DGOD",$J,DGJB,K1,DGDV,DGV,DGMT,DGEL)=0
10 ;zero row subtotal
11 F DGV="N","V" F DGEL="*",0:1:8 S ^UTILITY("DGOD",$J,DGJB,K1,DGDV,DGV,"TOT",DGEL)=0
12 ;zero column subtotal
13 F DGV="N","V" F DGMT="AN","AS","B","C","N","U","X" S ^UTILITY("DGOD",$J,DGJB,K1,DGDV,DGV,"TOT",DGMT)=0
14 ;zero vet/nonvet subtotal
15 F DGV="N","V" S ^UTILITY("DGOD",$J,DGJB,K1,DGDV,"TOT",DGV)=0
16 ;zero column total for division
17 F DGMT="AN","AS","B","C","N","U","X" S (^UTILITY("DGOD",$J,DGJB,K1,"TOT",DGDV,DGMT),^UTILITY("DGOD",$J,DGJB,K1,"TOT",DGMT))=0
18 ;zero division total
19 S ^UTILITY("DGOD",$J,DGJB,K1,"TOT",DGDV)=0
20 ;zero grand total
21 S ^UTILITY("DGOD",$J,"TOT",DGJB,K1)=0
22 Q
23 ;
24T0 ;totals the array
25 F I=1:1:A2 S DGDV=$E($P(A(I),U,2)_" ",1,5) F K1=1:1:DGTN D T1
26 Q
27 ;
28T1 ;row subtotal for vet/non-vet
29 F DGV="N","V" S DGK=$S(DGV="N":8,1:6) F DGMT="AN","AS","B","C","N","U","X" F DGEL=0:1:DGK,"*" S ^UTILITY("DGOD",$J,DGJB,K1,DGDV,DGV,"TOT",DGEL)=^UTILITY("DGOD",$J,DGJB,K1,DGDV,DGV,"TOT",DGEL)+^UTILITY("DGOD",$J,DGJB,K1,DGDV,DGV,DGMT,DGEL)
30 ;column subtotal for vet/non-vet
31 F DGV="N","V" S DGK=$S(DGV="N":8,1:6) F DGEL=0:1:DGK,"*" F DGMT="AN","AS","B","C","N","U","X" S ^UTILITY("DGOD",$J,DGJB,K1,DGDV,DGV,"TOT",DGMT)=^UTILITY("DGOD",$J,DGJB,K1,DGDV,DGV,"TOT",DGMT)+^UTILITY("DGOD",$J,DGJB,K1,DGDV,DGV,DGMT,DGEL)
32 ;subtotal vet/non-vet
33 F DGV="N","V" S DGK=$S(DGV="N":8,1:6) F DGEL=0:1:DGK,"*" S ^UTILITY("DGOD",$J,DGJB,K1,DGDV,"TOT",DGV)=^UTILITY("DGOD",$J,DGJB,K1,DGDV,"TOT",DGV)+^UTILITY("DGOD",$J,DGJB,K1,DGDV,DGV,"TOT",DGEL)
34 ;column total for division
35 F DGV="N","V" F DGMT="AN","AS","B","C","N","U","X" S ^UTILITY("DGOD",$J,DGJB,K1,"TOT",DGDV,DGMT)=^UTILITY("DGOD",$J,DGJB,K1,"TOT",DGDV,DGMT)+^UTILITY("DGOD",$J,DGJB,K1,DGDV,DGV,"TOT",DGMT)
36 ;division total
37 F DGV="N","V" S ^UTILITY("DGOD",$J,DGJB,K1,"TOT",DGDV)=^UTILITY("DGOD",$J,DGJB,K1,"TOT",DGDV)+^UTILITY("DGOD",$J,DGJB,K1,DGDV,"TOT",DGV)
38 ;grand total for all columns
39 F DGMT="AN","AS","B","C","N","U","X" S ^UTILITY("DGOD",$J,DGJB,K1,"TOT",DGMT)=^UTILITY("DGOD",$J,DGJB,K1,"TOT",DGMT)+^UTILITY("DGOD",$J,DGJB,K1,"TOT",DGDV,DGMT)
40 ;grand total
41 S ^UTILITY("DGOD",$J,"TOT",DGJB,K1)=^UTILITY("DGOD",$J,"TOT",DGJB,K1)+^UTILITY("DGOD",$J,DGJB,K1,"TOT",DGDV)
42 K DGK Q
43 ;
44ET ;elapsed time for run
45 Q:$D(H1)=0 S H2=$H D ET1
46 S DGTOUT=$S(DGTOUT<60:$J(DGTOUT,1,2)_" secs",DGTOUT<3600:$J(DGTOUT/60,1,2)_" min",1:$J(DGTOUT/3600,1,2)_" hrs") Q
47 ;
48ET1 ;H1-start time,H2-end time,DGTOUT-difference in seconds
49 S H1(1)=$P(H1,",",1),H1(2)=$P(H1,",",2),H2(1)=$P(H2,",",1),H2(2)=$P(H2,",",2)
50 I H1(1)=H2(1) S DGTOUT=H2(2)-H1(2) Q
51 S DGTOUT=86400*(H2(1)-H1(1))+(H2(2)-H1(2)) Q
Note: See TracBrowser for help on using the repository browser.