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

ABPAPD7.m

Go to the documentation of this file.
ABPAPD7 ;POST PAYMENT EDIT CHECK; [ 07/25/91  11:30 AM ]
 ;;1.4;AO PVT-INS TRACKING;*0*;IHS-OKC/KJR;JULY 25, 1991
A0 K DIC,DIE,DA,DR,ABPAERR S DA(1)=ABPATDFN,DA=ABPADDFN
 I +$P(^ABPVAO(DA(1),"P",DA,"A",0),"^",4)'>0 D  G A0A^ABPAPD8
 .W *7,!!?10,"You have deleted all payment information...therefore,"
A0A I ((+ABPA("STDAMT")<0)&('GOTCHECK)) K ABPA("DHS") D
 .K DIR S DIR(0)="YOA",DIR("A")="Are you issuing a refund (Y/N)? "
 .S DIR("B")="NO" W *7 D ^DIR I Y D
 ..K DIR S DIR(0)="FO",DIR("A")="Enter the DHS check number you are "
 ..S DIR("A")=DIR("A")_"processing" D ^DIR
 ..I X]""&($E(X)'=" ")&(X'["^") S ABPA("DHS")=X
 .I $D(ABPA("DHS"))'=1 S ABPAERR="" W *7 D  Q
 ..K ABPAMESS S ABPAMESS="CHECK NUMBER/TRANSACTION TYPE MIS-MATCH"
 ..S ABPAMESS(2)="... Press any key to continue ... " D PAUSE^ABPAMAIN
 .K DIE,DR,DA S DA(1)=ABPATDFN,DA=ABPADDFN,DR=".1///"_ABPA("DHS")
 .S DIE="^ABPVAO("_ABPATDFN_",""P""," D ^DIE
VOID I ((+ABPA("STDAMT")>0)&('GOTCHECK)) K ABPA("DHS") D
 .K DIR S DIR(0)="YOA",DIR("A")="Are you voiding a previous refund"
 .S DIR("A")=DIR("A")_" (Y/N)? ",DIR("B")="NO" W *7 D ^DIR I Y D
 ..K DIR S DIR(0)="FO",DIR("A")="Enter the DHS check number you are "
 ..S DIR("A")=DIR("A")_"voiding" D ^DIR
 ..I X]""&($E(X)'=" ")&(X'["^") S ABPA("DHS")=X
 .I $D(ABPA("DHS"))'=1 S ABPAERR="" W *7 D  Q
 ..K ABPAMESS S ABPAMESS="CHECK NUMBER/TRANSACTION TYPE MIS-MATCH"
 ..S ABPAMESS(2)="... Press any key to continue ... " D PAUSE^ABPAMAIN
 .K DIE,DR,DA S DA(1)=ABPATDFN,DA=ABPADDFN,DR=".1///"_ABPA("DHS")
 .S DIE="^ABPVAO("_ABPATDFN_",""P""," D ^DIE
 I ((+ABPA("STDAMT")=0)&(GOTCHECK)) S ABPAERR="" W *7 D
 .K ABPAMESS S ABPAMESS="CHECK NUMBER/TRANSACTION TYPE MIS-MATCH"
 .S ABPAMESS(2)="... Press any key to continue ... " D PAUSE^ABPAMAIN
 I GOTCHECK I +ABPA("STDAMT")>+ABPACHK("RAMT") S ABPAERR="" W *7 D
 .K ABPAMESS S ABPAMESS="PAYMENT ALLOCATION-CHECK BALANCE ERROR"
 .S ABPAMESS(2)="... Press any key to continue ... " D PAUSE^ABPAMAIN
 I $D(ABPAERR)=1 K ABPAERR G DISP^ABPAPD3
 K ABPA("OPERR"),ABPA("RBERR") D BEGIN^ABPAPD7A,^ABPAPD7C
 I $D(ABPA("RBERR"))'=0 D  K ABPA("RBERR") G A0A^ABPAPD8
 .S ABPAMESS="YOU CANNOT REFUND MORE THAN WAS PREVIOUSLY POSTED" W *7
 .S ABPAMESS(2)="... Press any key to continue ... " D PAUSE^ABPAMAIN
 I $D(ABPA("OPERR"))'=0 D  K ABPA("OPERR") G A0A^ABPAPD8
 .S ABPAMESS="ILLEGAL OVERPAYMENT ENCOUNTERED" W *7
 .S ABPAMESS(2)="... Press any key to continue ... " D PAUSE^ABPAMAIN
 K DIR S DIR("A",1)="1 - Execute write-offs, 2 - Select write-offs"
 S DIR("A",1)=DIR("A",1)_", 3 - Do not write-off, 4 - Cancel"
 S DIR("A")="Select ACTION: ",DIR(0)="SOA^1:Execute write-offs;"
 S DIR(0)=DIR(0)_"2:Select write-off;3:Do not write-off;4:Cancel;"
 S DIR("B")=1 D ^DIR G:+Y=0!(+Y=4) A0A^ABPAPD8 S ABPA("Y")=+Y
FILE ;ENTRY POINT
 ;PROCEDURE TO SET CLAIM SPECIFIC PAYMENT TRANSACTION AMOUNTS
 ;REQUIRES ABPATDFN=CURRENT PATIENT DFN, ABPADDFN=CURRENT PAYMENT DFN
 ;REQUIRES THE ARRAY ABPA("PP",ABPADOS,DA) BE DEFINED WHERE:
 ;ABPADOS=CLAIM DOS, DA=CLAIM DFN
 ;REQUIRES ABPA("Y")=1, 2, OR 3 WHERE 1=EXECUTE AUTOMATIC WRITE-OFFS,
 ;2=EXECUTE SELECTIVE WRITE-OFFS, 3=EXECUTE NO WRITE-OFFS
 K DIC,DIE,DA,DR,DIK,ABPA("QF"),ABPADOS
 S ABPAD=0 F ABPA("I")=0:0 D  Q:+ABPAD=0
 .S ABPAD=$O(^ABPVAO(ABPATDFN,"P",ABPADDFN,"D",ABPAD)) Q:+ABPAD=0
 .Q:$D(^ABPVAO(ABPATDFN,"P",ABPADDFN,"D",ABPAD,0))'=1  S ABPADATA=^(0)
 .S ABPADOS=+ABPADATA,DA=$P(ABPADATA,"^",2) Q:+ABPADOS=0!(+DA<1)
 .Q:$D(^ABPVAO(ABPATDFN,1,DA,0))'=1!($D(ABPA("PP",ABPADOS,DA))'=1)
 .F P=2:1:5 S $P(ABPADATA,"^",P+1)=$P(ABPA("CP",ABPADOS,DA),"^",P)
 .S ^ABPVAO(ABPATDFN,"P",ABPADDFN,"D",ABPAD,0)=ABPADATA K DIE,DR
 .Q:$D(ABPA("CONVERT"))=1
 .I +ABPA("PP",ABPADOS,DA)'>0 D  Q
 ..S DA(1)=ABPATDFN,DIE="^ABPVAO("_DA(1)_",1,",DR=".18///C" D ^DIE
 .I ABPA("Y")=1 D  Q
 ..S $P(^ABPVAO(ABPATDFN,1,DA,0),"^",3)=+ABPA("PP",ABPADOS,DA)
 ..S DA(1)=ABPATDFN,DIE="^ABPVAO("_DA(1)_",1,",DR=".18///C" D ^DIE
 .I ABPA("Y")=2 D  Q
 ..K DIR S DIR(0)="YO",DIR("A")="Write-off the remaining $"
 ..S DIR("A")=DIR("A")_$J($P(ABPA("PP",ABPADOS,DA),"^"),8,2)
 ..S DIR("A")=DIR("A")_" for Claim #",DIR("B")="YES"
 ..S DIR("A")=DIR("A")_$P(^ABPVAO(ABPATDFN,1,DA,0),"^",2) D ^DIR
 ..I +Y=1 D  W "... Written-off!" Q
 ...S $P(^ABPVAO(ABPATDFN,1,DA,0),"^",3)=+ABPA("PP",ABPADOS,DA)
 ...S DA(1)=ABPATDFN,DIE="^ABPVAO("_DA(1)_",1,",DR=".18///C" D ^DIE
 ..W " ... Not written-off!"
 Q:$D(ABPA("CONVERT"))=1
A3 I GOTCHECK D
 .K DIE,DA,DR S DA(2)=$O(ABPACHK("")),DA(1)=$O(ABPACHK(DA(2),""))
 .S DA=$O(ABPACHK(DA(2),DA(1),""))
 .S DIE="^ABPACHKS("_DA(2)_",""I"","_DA(1)_",""C"","
 .S ABPACHK("RAMT")=ABPACHK("RAMT")-ABPA("STDAMT")
 .S ABPACHK("PAMT")=ABPACHK("AMT")-ABPACHK("RAMT")
 .S DR="6///P;7///"_ABPACHK("PAMT")_";8///"_ABPACHK("RAMT")
 .S DR=DR_";9///"_DUZ_";10///NOW" D ^DIE
 .K DIK S DIK=DIE D IX^DIK
 L ^ABPVAO(ABPATDFN)
 K DIC,DIE,DA,DR,ABPACAMT,ABPAPAMT,DIK,ABPADOS,ABPA("I"),ABPA("QF")
 K ABPAPOST,ABPASDT,ABPARECV,ABPADATA,ABPACHK,CLOSE,ABPA("CHK")
 G ^ABPAPD1