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

PRCACLM.m

Go to the documentation of this file.
PRCACLM ;SF-ISC/YJK-CALM CODE SHEET GENERATOR ;9/10/93  10:59 AM
V ;;4.5;Accounts Receivable;**371**;Mar 20, 1995;Build 29
 ;;Per VHA Directive 6402, this routine should not be modified.
EN1 ;CREATE NEW CODE SHEET OF ANY TYPE
 G:'$D(PRC("SITE")) OUT S PRCFA("ARCS")=""
AM ;
 I ",22,23,26,"[(","_$P(^PRCA(430,PRCABN,0),"^",2)_",") D TT
 I +$P($G(^PRCA(433,+$G(PRCAEN),8)),U,8) W !!,"* This is flagged as a Contractual Adjustment. Tran. Type should be 934.24 *",!
 D TT^PRCFAC G OUT:'% D NEWCS^PRCFAC G:'$D(DA) OUT S DIE="^PRCF(423,"
 S:PRCFA("AMT")<0 PRCFA("AMT")=-PRCFA("AMT") S ^PRCF(423,DA,1)=PRCFA("ALD")_U_U_U_U_U_U_U_U_PRCFA("AMT")
 S:PRCFA("TT")'[934.24 $P(^PRCF(423,DA,1),"^",15)=$P(^PRCA(430.2,+$P(^PRCA(430,PRCABN,0),"^",2),0),"^",8)
 I ",22,23,26,"[(","_$P(^PRCA(430,PRCABN,0),"^",2)_",") S $P(^PRCF(423,DA,6),"^",30)=PRCFA("ALD"),$P(^PRCF(423,DA,1),"^",16)="$"
 I $P(^PRCA(430,PRCABN,0),U,2)=$O(^PRCA(430.2,"AC",33,0)) D REF
 K Y I ",22,23,26,"'[(","_$P(^PRCA(430,PRCABN,0),"^",2)_",") S DR=PRCFA("EDIT") D ^DIE
 I $D(Y)=0 D ^PRCFACXM D:$P(^PRCA(430,PRCABN,0),U,2)=$O(^PRCA(430.2,"AC",33,0)) TREF S:'$D(PRCFDEL) PRCALM=2 Q
 D DEL^PRCFACXM,OUT1 Q
TT G:'$D(PRCAEN) TTQ I ",1,35,"'[","_$P(^PRCA(433,PRCAEN,1),U,2)_"," Q
 I PRCFA("ALD")["7.1.8" S PRCFA("TTF")=$S($P(^PRCA(433,PRCAEN,1),U,2)=35:93031,1:93030) G TTQ
 S PRCFA("TTF")=$S($P(^PRCA(433,PRCAEN,1),U,2)=35:93931,1:93930)
TTQ I '$G(PRCFA("TTF")),$P(^PRCA(430,PRCABN,0),U,2)=$O(^PRCA(430.2,"AC",33,0)) S PRCFA("TTF")=97213
 S PRCFASYS="CLM",PRCHAUTO=1 Q
OUT1 K %,%DT,%TG,%X,%Y,A,B,C,DIG,DIH,DIU,DIV,DIW,DIK,DQ,I,M,N,X1,PRCFA("ARCS") Q
OUT K %,%X,%Y,%XX,PRCFA("ARCS"),B,D,D0,DG,DIC,DIE,DIG,DIH,DIV,DIW,DLAYGO,DQ,DR,I,J,K,M,M,PRCFA,Q,Q1,S,X,Y,Z Q
PH ;
 NEW PRCAFY,PRCAAP
 I $P(^PRCA(430,PRCABN,0),"^",4)="" S DR="4////^S X="_$P(^PRCA(430.2,+$P(^(0),"^",2),0),"^",4),DA=PRCABN,DIE="^PRCA(430," D ^DIE
 S PRCAAP=$S($D(^PRCD(420.3,+$P(^PRCA(430.2,+$P(^PRCA(430,PRCABN,0),"^",2),0),"^",5),0)):$P(^(0),"^",3),1:"")
 I PRCAAP]"" F PRCAFY=0:0 S PRCAFY=$O(^PRCA(430,PRCABN,2,PRCAFY)) Q:'PRCAFY  I $P(^(PRCAFY,0),"^",4)="" S DIE="^PRCA(430,"_PRCABN_",2,",DA(1)=PRCABN,DA=PRCAFY,DR="3///^S X="""_PRCAAP_"""" D ^DIE
 Q
REF ;
 N DFN,VAERR,VA,VADM,VAPA
 S DFN=+^RCD(340,+$P(^PRCA(430,PRCABN,0),U,9),0) Q:'DFN
 D DEM^VADPT,ADD^VADPT
 S $P(^PRCF(423,DA,6),U,7,10)=$P(VADM(2),U)_U_1_U_$E($TR($P($G(VADM(1)),",",2),".")_" "_$TR($P($G(VADM(1)),",",1),"."),1,23)_U_$E($TR($G(VAPA(1)),"."),1,23)
 S $P(^PRCF(423,DA,6),U,11,15)=$E($TR($G(VAPA(2)),"."),1,23)_U_$E($TR($G(VAPA(4)),"."),1,13)_U_$E($TR($P($G(^DIC(5,+$G(VAPA(5)),0)),U,2),"."),1,2)_U_$E($TR($G(VAPA(6)),"-"),1,9)_"^OVERPAYMENT"
 S $P(^PRCF(423,DA,1),U,8)="0245",$P(^(1),U,10)=3012
 Q
TREF ;
 N DIE,DR,CDI,PRCA,PRCAA2,PRCAEN,PRCAMT,PRCASV,PRCFDA Q:$D(PRCFDEL)  S CDI=DA
 I $P($G(^PRCF(423,CDI,8)),U,16)']"" W !!,"NO ELECTRONIC SIGNATURE!" D DEL Q
 D SETTR^PRCAUTL I '$G(PRCAEN) W !!,"COULD NOT SET UP A REFUND TRANSACTION!" D DEL Q
 W !!,"Creating a REFUND Transaction....."
 D PATTR^PRCAUTL S PRCA("ADJ")=$O(^PRCA(430.3,"AC",120,0)),PRCASV("BDT")=$G(DT),PRCASV("APR")=DUZ,PRCASV("FY")="^"_+$P($G(^PRCA(430,PRCABN,7)),U,18)
 S DIE="^PRCA(433,",DR="[PRCA FY ADJ2 BATCH]",DA=PRCAEN D ^DIE
 S PRCAMT=-$G(PRCAMT),PRCAA2=$P(^PRCA(433,PRCAEN,4,0),U,3)
 D UPFY^PRCADJ,TRANUP^PRCAUTL
 ; PRCA*4.5*371 - Replace direct global sets in 7 node with FileMan calls so indexes get updated
 S PRCFDA(430,PRCABN_",",71)=$G(^PRCA(430,PRCABN,7))+PRCAMT,PRCA("STATUS")=$O(^PRCA(430.3,"AC",120,0)) D FILE^DIE(,"PRCFDA"),UPSTATS^PRCAUT2
 Q
DEL ;
 N DA,DIK
 S PRCFDEL=1,DA=CDI,DIK="^PRCF(423," D ^DIK
 W *7,"             <Code Sheet Deleted>"
 Q