| 1 | RMPOPST2 ;EDS/JAM - HOME OXYGEN BILLING TRANSACTIONS/POSTING - SIGN OFF ;7/24/98 | 
|---|
| 2 | ;;3.0;PROSTHETICS;**29,44**;Feb 09, 1996 | 
|---|
| 3 | ; | 
|---|
| 4 | ;This subroutine is part of the billing module. Purchase Card | 
|---|
| 5 | ;orders are obligated and 1358 serivce orders are closed. | 
|---|
| 6 | ;The ^RMPO(665.72 global is updated with the date closed and user. | 
|---|
| 7 | Q | 
|---|
| 8 | MAIN ; Proper entry point | 
|---|
| 9 | D HOME^%ZIS | 
|---|
| 10 | S QUIT=0 | 
|---|
| 11 | D HOSITE^RMPOUTL0 Q:('$D(RMPOREC))!QUIT | 
|---|
| 12 | S RMPOXITE=RMPOREC | 
|---|
| 13 | D MONTH^RMPOBIL0() Q:'$D(RMPODATE)!QUIT | 
|---|
| 14 | ;D VENDOR^RMPOBIL0 Q:'$D(RMPOVDR)!QUIT | 
|---|
| 15 | D SIGNOF,EXIT | 
|---|
| 16 | Q | 
|---|
| 17 | TEST ;set test data | 
|---|
| 18 | S RMPOXITE=1,RMPORVDT=7019199,RMPOVDR=10,RMPODATE=2980800,DFNS(47)="" | 
|---|
| 19 | S RMPO("STA")=521 N XQY0 | 
|---|
| 20 | S XQY0="RMPO BILLING TRANSACTIONS^Billing Transactions^^R^547^^^^^^^341^^^" | 
|---|
| 21 | ; | 
|---|
| 22 | SIGNOF ;Sign off/close a FCP/purchase order | 
|---|
| 23 | ;Determine payment type;if PC obligate & close;if 1358 close | 
|---|
| 24 | N SITE,RVDT,FIL,PFLG,FCPTOT,REFNO,IEN442,FCP,IENFCP,PAYTYP,LCK,X,Y | 
|---|
| 25 | S FIL=665.72,SITE=RMPOXITE,RVDT=RMPODATE ;,VDR=RMPOVDR | 
|---|
| 26 | D PTYP I Y<0!(Y="")!(Y="^") D ABORT Q | 
|---|
| 27 | S PAYTYP=Y D FCP I Y'>0 D ABORT Q | 
|---|
| 28 | S IENFCP=+Y,FCP=$P(Y(0),U),IEN442=$P(Y(0),U,3),REFNO=$P(Y(0),U,4) | 
|---|
| 29 | S FCPTOT=$P(Y(0),U,7) | 
|---|
| 30 | S PFLG=0 D FILCHK I PFLG D  I 'Y D ABORT Q | 
|---|
| 31 | . S DIR(0)="Y" | 
|---|
| 32 | . S DIR("A")="All Records not posted for "_FCP_" Continue" D ^DIR | 
|---|
| 33 | ;Lock record at FCP level in ^RMPO(665.72 | 
|---|
| 34 | S LCK=$$FCPLCK^RMPOPST0 I 'LCK D  Q | 
|---|
| 35 | . W !!,"Record in Use.  Try Later...." | 
|---|
| 36 | D  I 'Y D ABORT G UNLK ;verify user is ready to close FCP | 
|---|
| 37 | . S DIR(0)="Y" | 
|---|
| 38 | . S DIR("A")="Sure you want to Continue" D ^DIR | 
|---|
| 39 | D @$S(PAYTYP:"FCPUPD",1:"PCSO") | 
|---|
| 40 | ;Unlock record at FCP in ^RMPO(665.72 | 
|---|
| 41 | UNLK D UNLKFCP^RMPOPST0 | 
|---|
| 42 | Q  ;SIGNOF | 
|---|
| 43 | ; | 
|---|
| 44 | ABORT ;Write abort message | 
|---|
| 45 | W !!,"Process Aborted..." | 
|---|
| 46 | Q | 
|---|
| 47 | ; | 
|---|
| 48 | PTYP ;Select Payment Type; 1358 or purchase card | 
|---|
| 49 | K DIC,DA,DR | 
|---|
| 50 | D FCP1^RMPOBILU | 
|---|
| 51 | Q  ;PTYP | 
|---|
| 52 | FCP ;Select Fund Control Point/Purchase Order to Sign Off | 
|---|
| 53 | K DIC,DA,DR | 
|---|
| 54 | S DA(1)=RVDT,DA(2)=SITE,DIC="^RMPO(665.72,"_DA(2)_",1,"_DA(1)_",2," | 
|---|
| 55 | S DIC(0)="QAEZ" | 
|---|
| 56 | D | 
|---|
| 57 | . I PAYTYP S DIC("S")="I $P(^(0),U,2)=PAYTYP,$P(^(0),U,8)=""""" Q | 
|---|
| 58 | . ;S DIC("S")="I $P(^(0),U,2)=PAYTYP,$P(^(0),U,5)=DUZ,$P(^(0),U,6)=VDR,$P(^(0),U,8)=""""" | 
|---|
| 59 | . S DIC("S")="I $P(^(0),U,2)=PAYTYP,$P(^(0),U,5)=DUZ,$P(^(0),U,8)=""""" | 
|---|
| 60 | S DIC("W")="W ?35,$P(^(0),U,2)," | 
|---|
| 61 | S DIC("W")=DIC("W")_"$P(^(0),U,4)" | 
|---|
| 62 | D ^DIC | 
|---|
| 63 | I Y<0 W "  Nothing Found..." | 
|---|
| 64 | Q  ;FCP | 
|---|
| 65 | FCPUPD ;Close FCP record in ^RMPO(665.72 file. Update global with date closed | 
|---|
| 66 | ;and user for 1358 purchase order | 
|---|
| 67 | K DIE,DA,DR | 
|---|
| 68 | D NOW^%DTC | 
|---|
| 69 | S DA=IENFCP,DA(1)=RVDT,DA(2)=SITE | 
|---|
| 70 | S DIE="^RMPO(665.72,"_DA(2)_",1,"_DA(1)_",2," | 
|---|
| 71 | S DR="4////"_DUZ_";"_"7///"_% | 
|---|
| 72 | D ^DIE | 
|---|
| 73 | Q  ;FCPUPD | 
|---|
| 74 | ; | 
|---|
| 75 | PCSO ;Obligate/Sign off PC order | 
|---|
| 76 | N PRCA,PRCB,PRCC | 
|---|
| 77 | S PRCA="",PRCB=IEN442 | 
|---|
| 78 | S PRCC=FCPTOT | 
|---|
| 79 | D OBL^PRCH7D(.X,PRCA,PRCB,PRCC) | 
|---|
| 80 | I X="^" D  Q  ;not obligated | 
|---|
| 81 | . W !!,"Purchase Card Order "_REFNO | 
|---|
| 82 | . W " Not Obligated for "_FCP | 
|---|
| 83 | D FCPUPD | 
|---|
| 84 | Q  ;PCSO | 
|---|
| 85 | ; | 
|---|
| 86 | FILCHK ;Check records to enure all posting done before obligating for a FCP | 
|---|
| 87 | ;PFLG 1-found record not posted, 0-all record posted | 
|---|
| 88 | N DFN,IT,ITDT,VDR | 
|---|
| 89 | W !!,"Verifying all items posted for FCP. Please be patient." | 
|---|
| 90 | S VDR=0 | 
|---|
| 91 | F  S VDR=$O(^RMPO(FIL,SITE,1,RVDT,1,VDR)) Q:'VDR  D  I PFLG Q | 
|---|
| 92 | . S DFN=0 | 
|---|
| 93 | . F  S DFN=$O(^RMPO(FIL,SITE,1,RVDT,1,VDR,"V",DFN)) Q:'DFN  D  I PFLG Q | 
|---|
| 94 | . . I $P(^RMPO(FIL,SITE,1,RVDT,1,VDR,"V",DFN,0),U,3)="Y" Q | 
|---|
| 95 | . . S IT=0 | 
|---|
| 96 | . . F  S IT=$O(^RMPO(FIL,SITE,1,RVDT,1,VDR,"V",DFN,1,IT)) Q:'IT  D  Q:PFLG | 
|---|
| 97 | . . . S ITDT=^RMPO(FIL,SITE,1,RVDT,1,VDR,"V",DFN,1,IT,0) W "." | 
|---|
| 98 | . . . I $P(ITDT,U,3)=FCP D | 
|---|
| 99 | . . . . I $P(ITDT,U,10)'="Y",$P(ITDT,U,6)'=$P(ITDT,U,11) S PFLG=1 | 
|---|
| 100 | Q  ;FILCHK | 
|---|
| 101 | EXIT ;Kill variables | 
|---|
| 102 | K DA,DIC,DIR,RMPO,QUIT,X,Y,RMPODATE,RMPOMTH,RMPOREC,RMPORVDT | 
|---|
| 103 | Q | 
|---|