Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PRCARFP

PRCARFP.m

Go to the documentation of this file.
  1. PRCARFP ;WASH-ISC@ALTOONA,PA/CMS-PREPAYMENT POST REPT ;1/11/95 9:24 AM
  1. V ;;4.5;Accounts Receivable;**90**;Mar 20, 1995
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;Automatic payment posting from prepayment
  1. N BEG,END,X,Y,%DT,%ZIS
  1. ST W !! D NOW^%DTC S %DT(0)=-%,%DT="AEXP",%DT("A")="Enter Transaction START Date: " D ^%DT G:Y<0 REPQ S BEG=Y
  1. W !! S %DT="AEX",%DT("A")="Enter Transaction END Date: " D ^%DT G:Y<0 REPQ S END=Y
  1. I BEG>END W !!,*7," (Ending date must be greater than Start date.)" G ST
  1. S %ZIS="MQ" D ^%ZIS G:POP REPQ
  1. I $D(IO("Q")) S ZTRTN="DQ^PRCARFP",ZTSAVE("BEG")="",ZTSAVE("END")="",ZTDESC="Prepayment Posting Report" D ^%ZTLOAD G REPQ
  1. U IO D DQ
  1. REPQ W:$E(IOST,1,2)'="C-" @IOF D ^%ZISC Q
  1. DQ ;
  1. N BN,DAT,DFN,NOW,OUT,PAGE,PTN,TN,X,Y
  1. D NOW^%DTC S Y=X D DD^%DT S NOW=Y
  1. S (PAGE,OUT)=0 D HD
  1. S DAT=0 F S DAT=$O(^PRCA(433,"AP",DAT)) Q:'DAT!(DAT>END)!(OUT) I DAT'<BEG F PTN=0:0 S PTN=$O(^PRCA(433,"AP",DAT,PTN)) Q:'PTN!(OUT) F TN=0:0 S TN=$O(^PRCA(433,"AP",DAT,PTN,TN)) Q:'TN!(OUT) D
  1. .N VA,VADM,VAERR I ($Y+7)>IOSL D HD Q:OUT
  1. .W !,$E(DAT,4,5)_"/"_$E(DAT,6,7)_"/"_$E(DAT,2,3),?11,+$G(^PRCA(433,TN,0))
  1. .S Y=$P(^PRCA(430.3,$P(^PRCA(433,TN,1),U,2),0),U,1) W ?18,$S(Y["FULL":"PAYMNT (FULL)",Y["PART":"PAYMNT (PART)",1:$E(Y,1,9))
  1. .W ?32,"$"_$FN($P(^PRCA(433,TN,1),U,5),",",2)
  1. .S BN=+$P(^PRCA(433,TN,0),U,2) I Y["PAY",",22,23,"'[(","_$P(^PRCA(430,BN,0),U,2)_","),$P(^(0),U,18)'="36X5287" W "*"
  1. .I $P($G(^RCD(340,+$P(^PRCA(430,BN,0),U,9),0)),U,1)["DPT" S DFN=+$P(^(0),U,1) D DEM^VADPT
  1. .W ?45,+$G(^PRCA(433,PTN,0)),?55,$G(VADM(1)),?69,$P(^PRCA(430,BN,0),U,1)
  1. .I '$D(^PRCA(433,"AP",DAT,TN,PTN)) W !,?11,"**ERROR MESSAGE: Corresponding Transaction not found!" Q
  1. .I +$P($G(^PRCA(433,TN,1)),U,5)'=+$P($G(^PRCA(433,PTN,1)),U,5) W !,?11,"**ERROR MESSAGE: Unbalanced Transaction Amounts"
  1. .QUIT
  1. W !!,"* - Include the payment amount on an FMS ET document",!
  1. DQQ Q
  1. HD ;
  1. D:PAGE>0 SCRN G:OUT HDQ S PAGE=PAGE+1
  1. W @IOF W !,?5,"Background Payment Posting from Prepayment Receivables",?60,"Page ",PAGE," ",NOW
  1. W !,?10,"Reporting period: " S Y=BEG X ^DD("DD") W Y," thru " S Y=END X ^DD("DD") W Y
  1. W !! F Y=1:1:79 W "="
  1. W !,"Tran.",?11,"Tran.",?18,"Tran.",?32,"Tran.",?40,"Corresponding",?55,"Patient",?69,"Bill"
  1. W !,"Date",?11,"No.",?18,"Type",?32,"Amount",?43,"Tran. No.",?55,"Name",?69,"No.",!!
  1. HDQ Q
  1. SCRN ;crt display exit
  1. W !!,"* - Include the payment amount on an FMS ET document"
  1. Q:$E(IOST,1,2)'["C-"
  1. N DIR,DIRUT,DUOUT,DIROUT,X,Y
  1. F Y=$Y:1:(IOSL-4) W !
  1. S DIR(0)="E" D ^DIR I $D(DIRUT)!($D(DUOUT)) S OUT=1
  1. Q