source: WorldVistAEHR/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPOBILU.m@ 1154

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

initial load of WorldVistAEHR

File size: 5.3 KB
Line 
1RMPOBILU ;EDS/MDB,RVD - HOME OXYGEN BILLING TRANSACTIONS ;8/7/98 10:58
2 ;;3.0;PROSTHETICS;**29,43,44,77**;Feb 09, 1996
3 ;RVD 3/18/03 patch #77 - don't allow future billing month creation
4 ;
5 Q
6VDRSCRN ; SCREEN
7 Q
8 I '$D(RMPOXITE) D Q
9 . W !,$C(7)_"RMPOXITE NOT DEFINED!"
10 . S DIC("S")="I 0"
11 S DIC("S")="I $D(^RMPR(669.9,RMPOXITE,""RMPOVDR"",Y,0))"
12 Q
13XFRM1 ; INPUT XFORM FOR BILLING MONTH, FILE 665.72
14 S %DT(0)=-DT
15 S %DT="E" D ^%DT S X=Y I Y<0 K X Q
16 S (DINUM,X)=$E(X,1,5)_"00"
17 Q
182319 ; -- Display 2319
19 N RMPRNAM,RMPRDOB,RMPRSSN,RMPRDFN
20 S (DFN,RMPRDFN)=RMPODFN D DEM^VADPT
21 S RMPRNAM=VADM(1)
22 S RMPRDOB=+VADM(3)
23 S RMPRSSN=+VADM(2)
24 S $P(RMPR("L"),"-",80)=""
25 S RMPRBAC1=1
26 D ^RMPRPAT
27 K RMPRBAC1
28 Q
29ACCEPT ; ACCEPT TRX
30 D SAME S DR="2///Y" D ^DIE
31 Q
32UNACCEPT ; UNACCEPT TRX
33 D SAME S DR="2///N" D ^DIE
34 Q
35SAME ;
36 K DIE,DA,DR
37 S DA=RMPODFN,DA(1)=RMPOVDR,DA(2)=RMPORVDT,DA(3)=RMPOXITE
38 S DIE="^RMPO(665.72,"_DA(3)_",1,"_DA(2)_",1,"_DA(1)_",""V"","
39 Q
40FCP(FCP) ;
41 ;
42 ; PASS:
43 ; -- AS PARAMETER
44 ; FCP = FREE-TEXT FUND CONTROL POINT NAME
45 ; -- AS VARIABLES
46 ; RMPOXITE = SITE #
47 ; RMPODATE = BILLING MONTH
48 ; RMPOVDR = VENDOR IEN (IF TYPE = 'PURCHASE CARD')
49 ;
50 ; RETURNS:
51 ; TYPE ^ 442 IEN ^ REF # ^ AMOUNT ^ IEN
52 ; TYPE = PAYMENT TYPE (1 = 1358, 'P' = PURCHASE CARD)
53 ; 442 IEN = POINTER TO FILE 442, USED FOR POSTING
54 ; REF # = C# FOR 1358, PCO# FOR PURCHASE CARD
55 ; AMOUNT = TOTAL AMOUNT POSTED SO FAR (PURCHASE CARD ONLY)
56 ; IEN = IEN OF 'FCP' RECORD IN FILE 665.72, USED FOR UPDATING TOTALS
57 ;
58 N FOUND,DATA,RVDT,IEN,TMP,SITE,FN,TYPE
59 S QUIT=0,DATA="",FN=665.72
60 I '$D(RMPOXITE) W !,"SITE NOT DEFINED!" Q -1
61 I '$D(^RMPO(FN,RMPOXITE)) W !,"SITE NOT FOUND!" Q -1
62 S SITE=RMPOXITE
63 I '$D(RMPODATE) W !,"BILLING MONTH NOT DEFINED!" Q -1
64 S RVDT=RMPODATE
65 I '$D(^RMPO(FN,SITE,1,RVDT)) D Q -1
66 . W !,"BILLING MONTH NOT DEFINED!"
67 ;
68 D FCP4 Q:FOUND DATA
69 D FCP1 Q:(Y="")!$$QUIT -1
70 S TYPE=Y
71 D FCP2:TYPE=1,FCP3:TYPE="P" Q:($G(Y)<0)!QUIT -1
72 Q DATA
73 Q
74FCP4 ; LOOK FOR EXISTING PAYMENT TYPE
75 S FOUND=0,DATA=""
76 Q:'$D(^RMPO(FN,SITE,1,RVDT,2,"B",FCP))
77 K DIC S DA(1)=RVDT,DA(2)=SITE
78 S DIC("A")="Select Fund Control Point: "
79 S DIC="^RMPO(FN,"_DA(2)_",1,"_DA(1)_",2,",DIC(0)="AMQEZ"
80 S DIC("S")="S Z=^(0) I $P(Z,U)=FCP,$S($P(Z,U,2):1,($P(Z,U,2)=""P"")&"
81 S DIC("S")=DIC("S")_"($P(Z,U,5)=DUZ)&($P(Z,U,6)=RMPOVDR):1,1:0),"
82 S DIC("S")=DIC("S")_"$P(Z,U,8)="""""
83 S DIC("W")="W ?35,$P(^(0),U,4)"
84 S DIC("W")=DIC("W")_" I $P(^(0),U,2) W ?55,"
85 S DIC("W")=DIC("W")_"$J($$BAL^RMPOPST1($P(^(0),U,3)),10,2)"
86 D ^DIC
87 Q:(Y<0)!$$QUIT
88 K RMPOZ M RMPOZ=Y
89 K DIR S DIR(0)="Y"
90 S RMZ=^RMPO(FN,SITE,1,RVDT,2,+Y,0)
91 S RMZ=$P(RMZ,U,4)
92 S DIR("A")="Are you sure you want "_RMZ
93 S DIR("B")="NO" D ^DIR G:(Y=0) FCP4 Q:(Y'=1)!$$QUIT
94 K Y M Y=RMPOZ
95 I $P(Y(0),U,2) S DATA=$P(Y(0),U,2,4)_U_U_(+Y),FOUND=1 Q
96 S DATA=$P(Y(0),U,2)_U_$P(Y(0),U,3)_U
97 S DATA=DATA_$P(Y(0),U,4)_U_$P(Y(0),U,7)_U_(+Y),FOUND=1
98 Q
99FCP2 ; 1358
100 S PRC("SITE")=RMPRS,PRC("CP")=FCP
101 S PRCS("A")="Select Obligation Number: "
102 D EN1A^PRCS58 Q:(Y<0)!$$QUIT
103 K RMPOZ M RMPOZ=Y
104 K DIR S DIR(0)="Y",DIR("B")="NO"
105 S DIR("A")="Are you sure" D ^DIR Q:(Y<1)!$$QUIT
106 K Y M Y=RMPOZ D FCPSET
107 K PRC,PRCS
108 Q
109FCPSET ; SET ENTRY IN RMPO
110 S DATA=TYPE_U_$P(Y,U,1,2)_U_U ; SETUP RETURN VALUE
111 ;Check if selected IFCAP order exist in file 665.72
112 S Y=$$FCPCHK(.DATA) I Y Q
113 K DIC,DIE,DA,DR,DD,DO
114 S DA(2)=SITE,DA(1)=RVDT
115 S DIC="^RMPO(665.72,"_DA(2)_",1,"_DA(1)_",2,"
116 S DIC("P")=$P(^DD(665.723,2,0),U,2)
117 S DIC(0)="L",X=FCP D FILE^DICN I Y<0 S DATA=-1 Q
118 S DIE=DIC,DA=+Y,DATA=DATA_DA
119 S DR="1////"_TYPE
120 S DR=DR_";2////"_$P(DATA,U,2)
121 S DR=DR_";3///"_$P(DATA,U,3)
122 S DR=DR_";4////"_DUZ
123 S:TYPE="P" DR=DR_";5////"_RMPOVDR
124 D ^DIE
125 S Z1=$P(DATA,U,2)
126 S Z2=$P(DATA,U,3)
127 S $P(^RMPO(665.72,DA(2),1,DA(1),2,DA,0),U,3,4)=Z1_U_Z2
128 Q
129FCPCHK(DATA) ;CHECK IF FCP ALREADY EXIST IN FILE 665.72
130 N IEN,FDT,FPT,FOUND
131 S (IEN,FOUND)=0
132 F S IEN=$O(^RMPO(FN,SITE,1,RVDT,2,"B",FCP,IEN)) Q:IEN="" D Q:FOUND
133 . S FDT=^RMPO(FN,SITE,1,RVDT,2,IEN,0),FPT=$P(FDT,U,2)
134 . I $P(FDT,U,8)>0 Q ; closed flag
135 . I FPT=TYPE,$P(DATA,U,2)=$P(FDT,U,3),$P(DATA,U,3)=$P(FDT,U,4) D
136 . . I TYPE=1 S DATA=DATA_IEN,FOUND=1 Q
137 . . I $P(FDT,U,5)=DUZ,$P(FDT,U,6)=RMPOVDR D
138 . . . S $P(DATA,U,4)=$P(FDT,U,7),DATA=DATA_IEN,FOUND=1
139 Q FOUND
140FCP3 ; PURCHASE CARD
141 N PRCA
142 I '$D(^PRC(440.5,"H",DUZ)) D S Y=-1 Q
143 . W !!,"You are not an authorized Purchase Card User, CONTACT FISCAL!"
144 S PRCA=RMPRS_U_RMPOVDR
145 D ADD^PRCH7D(.PRCA) S Y=PRCA Q:(Y<0)!(Y="^")!$$QUIT
146 K RMPOZ M RMPOZ=Y
147 K DIR S DIR(0)="Y",DIR("B")="NO",DIR("A")="Are you sure"
148 D ^DIR Q:(Y<1)!$$QUIT
149 K Y M Y=RMPOZ D FCPSET
150 Q
151FCP1 ; PAYMENT TYPE
152 K DIR,DA
153 S DIR(0)="665.7232,1" D ^DIR
154 Q
155GETFCP(DFCP) ; Return FCP from file 420 (External value only)
156 ; Pass - DFCP = Default FCP [optional]
157 ;
158 N DIC,DA
159 S:$D(DFCP) DIC("B")=DFCP
160 S DA(1)=RMPOXITE,DIC("A")="Select FUND CONTROL POINT: "
161 S DIC="^RMPR(669.9,"_DA(1)_",""RMPOFCP"",",DIC(0)="AEQMZ" D ^DIC
162 I Y<0!$$QUIT Q Y
163 Q Y_U_Y(0,0)
164QUIT() S QUIT=$D(DTOUT)!$D(DUOUT)!$D(DIROUT) Q QUIT
165EQUIT() S QUIT=$D(DTOUT)!$D(Y) Q QUIT
166LJ(S,W,C) ; Left justify S in a field W wide padding with char F
167 ;
168 S C=$G(C," ") ; Default pad char is space
169 S $P(S,C,W-$L(S)+$L(S,C))=""
170 Q $E(S,1,W)
171 Q
172ENC(X,X1,X2) ;Encrypt
173 ;Variable X = string to encrypt
174 ; X1 = DUZ
175 ; X2 = FCP IEN of file 665.72
176 D EN^XUSHSHP
177 Q X
178DEC(X,X1,X2) ;Decrypt
179 ;Variable X = encrypted string
180 ; X1 = DUZ
181 ; X2 = FCP IEN of file 665.72
182 D DE^XUSHSHP
183 Q X
Note: See TracBrowser for help on using the repository browser.