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

ACHSVPT.m

Go to the documentation of this file.
ACHSVPT ; IHS/ITSC/PMF - UPDATE VENDOR PAYMENTS FILE ;   [ 10/16/2001   8:16 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
 ;
 ;CALLED FROM
 ;ACHSAJ1+146
 ;ACHSPA0+72 
 ;
 ;INPUT IS ACHSDAP     ;AMOUNT TO BE ADDED TO 
 ;
 ;CHS VENDOR PAYMENTS^9002075
 ;
 ;IF FACILITY ENTRY NOT THERE CREATE NEW ONE
 ;AGAIN A CASE WHERE FILEMAN SHOULD HANDLE THIS
 I '$D(^ACHSVPMT(DUZ(2))) D
 .S $P(^ACHSVPMT(DUZ(2),0),U)=DUZ(2)
 .S ^ACHSVPMT("B",DUZ(2),DUZ(2))=""
 .S $P(^ACHSVPMT(0),U,3)=DUZ(2),$P(^(0),U,4)=$P(^(0),U,4)+1 ;ENTRY COUNT
 ;
 ;IF NO 0 NODE FOR SUB-FILE 'VENDOR NAME' 9002075.01 CREATE IT
 I '$D(^ACHSVPMT(DUZ(2),1,0)) D
 .S ^ACHSVPMT(DUZ(2),1,0)=$$ZEROTH^ACHS(9002075,1)
 .S $P(^ACHSVPMT(DUZ(2),1,0),U,3)=ACHSPROV         ;LAST ENTRY USED
 .S $P(^ACHSVPMT(DUZ(2),1,0),U,4)=0                ;ENTRY COUNT
 ;
 ;IF NOT VENDOR ENTRY CREATE ONE
 I '$D(^ACHSVPMT(DUZ(2),1,ACHSPROV)) D
 .S $P(^ACHSVPMT(DUZ(2),1,0),U,3)=ACHSPROV         ;LAST ENTRY USED
 .S $P(^ACHSVPMT(DUZ(2),1,0),U,4)=$P(^ACHSVPMT(DUZ(2),1,0),U,4)+1 ;LAST ENTRY
 .S ^ACHSVPMT(DUZ(2),1,ACHSPROV,0)=ACHSPROV
 .S ^ACHSVPMT(DUZ(2),1,"B",ACHSPROV,ACHSPROV)=""
 ;
 ;IF NO 0 NODE FOR SUB-FILE 'FISCAL YEAR' 9002075.02 CREATE IT
 I '$D(^ACHSVPMT(DUZ(2),1,ACHSPROV,1,0)) D
 .S ^ACHSVPMT(DUZ(2),1,ACHSPROV,1,0)=$$ZEROTH^ACHS(9002075,1,1)
 ;
 ;IF FISCAL YEAR ENTRY DOESN'T EXIST CREATE IT
 I '$D(^ACHSVPMT(DUZ(2),1,ACHSPROV,1,ACHSCFY)) D
 .S $P(^ACHSVPMT(DUZ(2),1,ACHSPROV,1,0),U,3)=ACHSCFY
 .S $P(^ACHSVPMT(DUZ(2),1,ACHSPROV,1,0),U,4)=$P(^ACHSVPMT(DUZ(2),1,ACHSPROV,1,0),U,4)+1
 ;
 ;IF THE FISCAL YEAR 0 DATA NODE ISN'T THERE CREATE IT 
 I '$D(^ACHSVPMT(DUZ(2),1,ACHSPROV,1,ACHSCFY,0)) S ^ACHSVPMT(DUZ(2),1,ACHSPROV,1,ACHSCFY,0)=ACHSCFY_U_ACHSDAP_U_DT G END
 ;
 ;GET 'DOLLAR AMT PAID'
 S X=$P(^ACHSVPMT(DUZ(2),1,ACHSPROV,1,ACHSCFY,0),U,2)
 ;
 ;INCREMENT IT BY ????? 'IHS PAYMENT AMOUNT' FROM TRANSACTION FILE
 ;OR VAR ACHSADAM WHICH IS ENTERED IN ^ACHSAJ BY THE USER AT THE
 ;"Payment Adjustment Amount" PROMPT     
 ;HAVE TO LOOK CLOSE AT WHAT ACHSDAP IS AT THE TWO CALLS MADE
 S $P(^ACHSVPMT(DUZ(2),1,ACHSPROV,1,ACHSCFY,0),U,2)=X+ACHSDAP
 S $P(^ACHSVPMT(DUZ(2),1,ACHSPROV,1,ACHSCFY,0),U,3)=DT    ;'LAST UPDATE DATE'
END ;
 K ACHSDAP
 Q
 ;