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

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

initial load of FOIAVistA 6/30/08 version

File size: 3.8 KB
Line 
1DGPMGLP ;ALB/LM/MJK - G&L PRINT ROUTINE; 27 APR 2003
2 ;;5.3;Registration;**20,134,515,713**;Aug 13, 1993
3 ;
4A S DIE="^DG(43,",DA=1,DR="50///NOW" D ^DIE K DA,DR,DIE
5 S (RA,LA)="",$P(RA,"-",66)="",$P(LA,"-",66)="" ; RA=Right Arrows "-" LA=Left Arrows "-"
6 D 8
7 F DGDIV=0:0 S DGDIV=$O(^UTILITY("DGT",$J,DGDIV)) Q:DGDIV="" S DGINST=DGDIV F DGSRV=0:0 S DGSRV=$O(^UTILITY("DGT",$J,DGDIV,DGSRV)) D:'DGSRV COR Q:'DGSRV D DIVHD,SRVHD,SCAN S:'$D(TTNAME) TTNAME="NT" D:$D(LEG)&(TTNAME'["NO TRANSACTION") FOOT
8 S DGINST=$P(^DG(40.8,DGINST,0),"^",7),DGINST=$P(^DIC(4,DGINST,0),"^") D COR1
9K K TTNAME,FMNAME,NAME,PTDATA,C,C1,DFN,FM,I,I1,I2,I3,L,LA,RA,TT,X,X1,Y,DGCR,DGDIV6,DGX,Y,J,DGINST
10 S DA=1,DIE="^DG(43,",DR="61///NOW;50///@" D ^DIE
11 K DA,DR,DIE
12 Q
13 ;
148 ; If there are no transactions
15 F ORDER=0:0 S ORDER=$O(^DIC(42,"AGL",ORDER)) Q:'ORDER F WARD=0:0 S WARD=$O(^DIC(42,"AGL",ORDER,WARD)) Q:'WARD I $D(^DIC(42,WARD,0)) S X1=$P(^DIC(42,WARD,0),"^",3) I X1]"",X1'="NC" S DGSRV=$S(X1="NH":2,X1="D":3,1:1) D 88
16 Q
1788 S DGDIV=$S($P(^DIC(42,WARD,0),"^",11)']"":+$P(DGPM("GL"),"^",3),1:$P(^DIC(42,WARD,0),"^",11)) D PARAM S:'$D(^UTILITY("DGT",$J,DGDIV,DGSRV)) ^UTILITY("DGT",$J,DGDIV,DGSRV,"8888")=""
18 Q
19 ;
20PARAM ; --check combine/separate parameter in 40.8
21 S DGDIV6=$S($D(^DG(40.8,DGDIV,0)):+$P(^(0),"^",6),1:0),DGSRV=$S('DGDIV6:1,1:DGSRV) Q
22 ;
23DIVHD I $D(FF) W @IOF
24 S FF=1
25 W !?94,"Date/Time Printed: ",DGNOW
26 W !?RM-22\2,"GAINS AND LOSSES SHEET"
27 S X=$$NAME^VASITE(RD)
28 I X']"" D
29 .S X="VA MEDICAL CENTER"
30 .S X=X_$S($D(^DG(40.8,+DGDIV,0)):", "_$P(^(0),"^"),1:"") S:DGDIV']"" X=X_" at "_DGINST
31 W !?RM-$L(X)\2,X
32 S X=RD D DW^%DTC
33 S Z="PERIOD ENDING MIDNIGHT "_X_", "
34 S Y=RD X ^DD("DD")
35 S X=Z_Y
36 W !?RM-$L(X)\2,X
37 K X,Z,Y
38 Q
39 ;
40SRVHD ; -- print service head
41 S X=$P("MEDICAL CENTER^NHCU^DOMICILIARY","^",DGSRV)_" TOTALS"
42 W !?RM-$L(X)\2,X
43 Q
44 ;
45SCAN ; -- scan entries
46 F TT=0:0 S TT=$O(^UTILITY("DGT",$J,DGDIV,DGSRV,TT)) Q:'TT S TTNAME=$S($D(^DG(405.3,+TT,0)):$P(^(0),"^"),TT=9999:"NON-LOSSES",TT=8888:"NO TRANSACTION",1:"UNKNOWN TRANSACTION TYPE")_"(S): "_$J(+^UTILITY("DGT",$J,DGDIV,DGSRV,TT),4) D ^DGPMGLP1
47 Q
48 ;
49FOOT W ! W:UL["-" !
50 F L=1:1:131 W UL
51 S C=0,X=""
52 F I="+","*","#","!","a","b","c","g","r" S C=C+1 I $D(LEG(I)) S X="'"_I_"' - "_$P($T(LEG+C),";;",2)_"; " W:$X>(131-$L(X)) ! W X
53 W !
54 Q
55 ;
56LEG ; Legend
57 ;;Third Party Reimbursement Candidate
58 ;;While in Absent Sick in Hospital Status (ASIH)
59 ;;Discharge within 48 hours of admission
60 ;;While in Absence Status (authorized/unauthorized absence)
61 ;;MT Copay Exempt
62 ;;Category 'B' Veteran
63 ;;MT Copay Required
64 ;;GMT Copay Required
65 ;;Current Means Test Required but not completed
66 Q
67 ;
68LINES W !!!
69 Q
70COR ; From the Medical Center Division File, Census Multiple, Corrections to the Previous G&L's word processing field
71 ;
72 I $D(^DG(40.8,DGDIV,"CEN",RD,"A")) F I=0:0 S I=$O(^DG(40.8,DGDIV,"CEN",RD,"A",I)) Q:I="" D:$Y>62 DIVHD,LINES W !,^DG(40.8,DGDIV,"CEN",RD,"A",I,0)
73 Q
74 ;
75COR1 ; From the G&L Corrections File
76 ;
77 I '$D(^UTILITY($J,"CR")) F I=0:0 S I=$O(^DGS(43.5,"B",RD,I)) Q:I="" I $D(^DGS(43.5,I,0)) S DGCR=^(0),^UTILITY($J,"CR",$S($D(^DPT(+$P(DGCR,"^",5),0)):$P(^(0),"^",1),1:"")_I)=DGCR
78 I $D(^UTILITY($J,"CR")) D DIVHD,LINES ; to print G&L Corrections File on separate page
79 S I="" F J=0:0 S I=$O(^UTILITY($J,"CR",I)) Q:I="" S DGCR=^(I) D COR2,CORR
80 Q
81 ;
82COR2 Q:'$D(DGCR)
83 S DGX=$S($D(^DG(43.61,$P(DGCR,"^",2),0)):$P(^DG(43.61,$P(DGCR,"^",2),0),"^"),1:"")
84 Q
85 ;
86CORR D:$Y>62 DIVHD,LINES
87 W !,DGX ; Type of change
88 W " For ",$S($D(^DPT(+$P(DGCR,"^",5),0)):$P(^(0),"^",1)_" "_$E($P(^(0),"^",9),6,9),1:" ") ; Patient name and SSN
89 I $P(DGCR,"^",6)]"" S Y=$P(DGCR,"^",6) X ^DD("DD") W " For admission of ",Y
90 I $P(DGCR,"^",9)]"" S Y=$P(DGCR,"^",9) X ^DD("DD") W ", transfer of ",Y
91 I $P(DGCR,"^",3)]"" W " Old value: ",$P(DGCR,"^",3)
92 I $P(DGCR,"^",4)]"" W " New value: ",$P(DGCR,"^",4)
93 Q
Note: See TracBrowser for help on using the repository browser.