source: FOIAVistA/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPOPST3.m@ 1437

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

initial load of FOIAVistA 6/30/08 version

File size: 4.6 KB
Line 
1RMPOPST3 ;EDS/JAM,HinesIO/DDA - HOME OXYGEN BILLING TRANSACTIONS/ACCEPT FOR POST ;7/24/98
2 ;;3.0;PROSTHETICS;**29,44,41,98,110**;Feb 09, 1996;Build 10
3 ;This subroutine is part of the billing module. Check file 665.72
4 ;for accepted transactions not yet posted.
5 Q
6ACCEPT ; Check for accepted entries and post if user indicates
7 N DFNS
8 D FNDACC I $O(DFNS(""))="" Q
9 D PSTACC
10 Q ;ACCEPT
11 ;
12TEST ;set test data
13 N RMPOXITE,RMPOVDR,RMPODATE,DFNS
14 S RMPOXITE=1,RMPOVDR=10,RMPODATE=2981200,DFNS(47)=""
15 S RMPO("STA")=521
16 D FNDACC I $O(DFNS(""))="" Q
17 D PSTACC
18 Q ;TEST
19 ;
20FNDACC ;Check records to ensure all accepted transactions are posted.
21 N DFN,BILDT,SITE,FIL,VDR,I
22 S FIL=665.72,SITE=RMPOXITE,BILDT=RMPODATE,VDR=RMPOVDR
23 S DFN=0
24 F I=1:1 S DFN=$O(^RMPO(FIL,SITE,1,BILDT,1,VDR,"V",DFN)) Q:'DFN D
25 . ;check if patient transaction posted
26 . I $P(^RMPO(FIL,SITE,1,BILDT,1,VDR,"V",DFN,0),U,3)="Y" Q
27 . ;check if patient transaction accepted
28 . I $P(^RMPO(FIL,SITE,1,BILDT,1,VDR,"V",DFN,0),U,2)'="Y" Q
29 . I I=10 D
30 . . W !!,"Verifying all accepted transactions posted. Please be patient"
31 . S DFNS(DFN)=""
32 Q ;FNDACC
33 ;
34PSTACC ;Post accepted transactions if so indicated by user
35 N MES K DIR
36 S DIR(0)="Y",DIR("B")="NO"
37 S MES="There are patients whose billing transactions have been accepted"
38 S DIR("A",1)=MES,DIR("A",2)=" and not yet posted"
39 S DIR("A")="Would you like to post them now"
40 S DIR("?")="YES will Post accepted transaction and NO will not post"
41 D ^DIR
42 I 'Y!($D(DIRUT))!($D(DIROUT)) Q
43 ;Call post module to post transactions
44 D POST^RMPOPST0
45 K DIR,DIRUT,DIROUT,Y
46 Q ;PSTACC
47F660 ;Post to file ^RMPR(660 for form 2319
48 N ITM,ITMD,D665A,SUSDES,TRXDT,D660,D6I,D6X,RMPOG,ERR
49 S D665A=$G(^RMPR(665,DFN,"RMPOA")) I D665A="" Q
50 D ;AMIS grouper number
51 . L +^RMPR(669.9,RMPOXITE,0):9999 I $T=0 S RMPOG=DT_$P(DT,2,3) Q
52 . S RMPOG=$P(^RMPR(669.9,RMPOXITE,0),U,7),RMPOG=RMPOG-1
53 . S $P(^RMPR(669.9,RMPOXITE,0),U,7)=RMPOG
54 . L -^RMPR(669.9,RMPOXITE,0)
55 S TRXDT=$P(^RMPO(665.72,RMPOXITE,1,RMPODATE,1,RMPOVDR,0),U,2)
56 S ITM="" F S ITM=$O(^TMP($J,FCP,DFN,ITM)) Q:ITM="" D
57 . S ITMD=$G(^RMPO(665.72,RMPOXITE,1,RMPODATE,1,RMPOVDR,"V",DFN,1,ITM,0))
58 . I ITMD="" Q
59 .; I $P(ITMD,U,6)'>0 Q ;nothing posted to IFCAP
60 . S RMCPHC=$P(ITMD,U,2),RMCPT="",RMCPRENT=$P(ITMD,U,18),RMCPSO="C"
61 . S RMCPTY=$P(ITMD,U,14),RMCPQH=$P(ITMD,U,19)
62 . S RMCPT1=$G(^RMPR(661.1,RMCPHC,4))
63 . I RMCPT1["RP",((RMCPTY="R")!(RMCPTY="X")) S RMCPT=RMCPT_"RP,"
64 . I RMCPT1["QH",($G(RMCPQH)) S RMCPT=RMCPT_"QH,"
65 . I (RMCPRENT=1),(RMCPT1["RR") S RMCPT=RMCPT_"RR,"
66 . I RMCPT1["NU",(RMCPT'["RR") S RMCPT=RMCPT_"NU,"
67 . I $L(RMCPT)>2 S RMCLEN=$L(RMCPT),RMCPT=$E(RMCPT,1,RMCLEN-1)
68 . S DIC="^RMPR(660,",DIC(0)="L",X=DT
69 . K DD,DO D FILE^DICN I +Y<0 Q
70 . S D6I=+Y,D6X=D6I_","
71 . K DIE,DA,DR S DA(4)=RMPOXITE,DA(3)=RMPODATE,DA(2)=RMPOVDR,DA(1)=DFN
72 . S DIE="^RMPO(665.72,"_DA(4)_",1,"_DA(3)_",1,"_DA(2)_",""V"","_DA(1)
73 . S DIE=DIE_",1,",DA=ITM,DR="15////^S X=D6I" D ^DIE
74 . S D660(660,D6X,.02)=DFN ;Patient name pointer
75 . S D660(660,D6X,1)=TRXDT ;Request date
76 . S D660(660,D6X,2)=$P(ITMD,U,14) ;Type of transaction
77 . S D660(660,D6X,4)=$P(ITMD,U) ;item
78 . S D660(660,D6X,4.1)=$P(^RMPR(661.1,$P(ITMD,U,2),0),U,4) ;HCPCS
79 . S D660(660,D6X,4.5)=$P(ITMD,U,2) ;PSAS HCPCS
80 . S D660(660,D6X,4.7)=RMCPT ;CPT MODIFIER
81 . S D660(660,D6X,5)=$P(ITMD,U,7)-$P(ITMD,U,17) ;quantity
82 . S D660(660,D6X,7)=RMPOVDR ;vendor
83 . S D660(660,D6X,8)=RMPO("STA") ;station
84 . S D660(660,D6X,10)=CURDT ;Delivery date
85 . D
86 . . I $P(PAYINF,U) D Q
87 . . . S D660(660,D6X,11)=9 ;form requested on(1358)
88 . . . ;IFCAP transaction number - from file 424
89 . . . I $G(IEN424)'="" S D660(660,D6X,23)=$P($G(^PRC(424,IEN424,0)),U)
90 . . S D660(660,D6X,11)=14 ;form requested on (visa)
91 . . S D660(660,D6X,23)=SRVORD ;IFCAP transaction number
92 . S D660(660,D6X,12)="C" ;Source
93 . S D660(660,D6X,14)=$P(ITMD,U,6) ;total cost
94 . S D660(660,D6X,16)=$P(ITMD,U,4) ;remarks
95 . S SUSDES=$S($P(ITMD,U,11)'="":"Suspended Amt "_$P(ITMD,U,11)_" ",1:"")
96 . S D660(660,D6X,24)=SUSDES_$P(ITMD,U,12) ;description
97 . S D660(660,D6X,27)=DUZ ;initiator
98 . S D660(660,D6X,62)=$P(D665A,U) ;patient category
99 . S D660(660,D6X,63)=$P(D665A,U,5) ;special category
100 . S D660(660,D6X,68)=RMPOG
101 . S D660(660,D6X,78)=$P(ITMD,U,15) ;unit of issue
102 . D FILE^DIE("K","D660","ERR")
103 . I $D(ERR) D
104 . . W !!,"Posting to 2319 for item ",ITM," patient ",DFN," failed."
105 . . W "Posting will be done later"
106 . . Q
107 . ; RMPR*3*98
108 . ; CALL TO PROCESS PFSS CHARGE MESSAGE
109 . I '$D(ERR) D CHARGE^RMPOPF
110 . Q
111 K DIC,X,Y
112 Q
Note: See TracBrowser for help on using the repository browser.