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

ABPVEEC2.m

Go to the documentation of this file.
ABPVEEC2 ;DELETE PVT INS CLAIMS; [ 06/06/91  8:53 AM ]
 ;;2.0;FACILITY PVT-INS TRACKING;*0*;IHS-OKC/KJR;AUGUST 7, 1991
 Q  ;;NOT AN ENTRY POINT
WRITE F ABPVJ=3:1 Q:$P(ABPVTEXT,";",ABPVJ)=""  D
 .S @("P"_ABPVJ)=$P(ABPVTEXT,";",ABPVJ)
 W ! S DX=P5,DY=P6 S:IOST["QUME" DY=DY+1 X XY W P3,$J(P4,22)
 I $D(P7)=1 W " " W:$D(@P7)=1 @P7
 Q
REVON S DX=0,DY=18 W ! X XY D EOP^ABPVZMM W:IOST["QUME" !
 W:$D(ABPVRON) @(ABPVRON)
 Q
INIT D XIT
 S $P(ABPVL,"-",79)="",$P(ABPVLL,"=",79)=""
 D SCREEN
 Q
SCREEN S ABPV("HD",1)=ABPVTLE,ABPV("HD",2)="DELETE CLAIM"
 I $D(ABPVCDFN)=1 D
 .S ABPV("HD",2)=ABPV("HD",2)_" #"_$P(^ABPVFAC(ABPVCDFN,0),"^")
 D ^ABPVHD
 F ABPVI=1:1 S ABPVTEXT=$T(PROMPT+ABPVI) Q:ABPVTEXT=""  D WRITE
 W !,ABPVLL,!
 Q
PAT D REVON W "Enter the NAME of the patient (format = LNAME,FNAME MI.)"
 W:$D(ABPVRON)=1 @(ABPVROFF)
 K DFN,DIC("S"),DIC("B")
 S DIC="^AUPNPAT(",DIC(0)="AEQZ" D ^DIC
 I +Y<1 Q
 S Y(0,0)=^DPT(+Y,0),ABPVPDFN=+Y,ABPVPNAM=$P(Y(0,0),"^") K Y
 S ABPVHRN="" I $D(^AUPNPAT(ABPVPDFN,41,DUZ(2),0))=1 D
 .S ABPVHRN=$P(^AUPNPAT(ABPVPDFN,41,DUZ(2),0),"^",2)
 S ABPVFAC=$P(^DIC(4,DUZ(2),0),"^") I $Y>23 D SCREEN Q
 F ABPVI=1:1:3 S ABPVTEXT=$T(PROMPT+ABPVI) D WRITE
 Q
DOS D REVON W "Enter/Select billing date"
 W:$D(ABPVRON)=1 @(ABPVROFF)
 S ABPVDOS=$O(^ABPVFAC("PC",ABPVPDFN,"")) I +ABPVDOS=0 K ABPVDOS Q
 S ABPVDOS=0,ABPVCNT=10000 F I=0:0 D  I +ABPVDOS=0 K ABPVDOS Q
 .S ABPVDOS=$O(^ABPVFAC("PC",ABPVPDFN,ABPVDOS)) Q:+ABPVDOS=0
 .S DA=0 F J=0:0 D  Q:+DA=0
 ..S DA=$O(^ABPVFAC("PC",ABPVPDFN,ABPVDOS,DA)) Q:+DA=0
 ..Q:$D(^ABPVFAC(DA,0))'=1  S DATA=^(0),ABPVCNT=ABPVCNT-1
 ..S ABPVDT(ABPVCNT)=$J($P(DATA,"^"),7)_"  "
 ..S ABPVDT(ABPVCNT)=ABPVDT(ABPVCNT)_$E(ABPVDOS,4,5)_"/"_$E(ABPVDOS,6,7)_"/"
 ..S ABPVDT(ABPVCNT)=ABPVDT(ABPVCNT)_$E(ABPVDOS,2,3)_$J($P(DATA,"^",6),5)
 ..S ABPVDT(ABPVCNT)=ABPVDT(ABPVCNT)_$J($P(DATA,"^",7),5)
 ..S ABPVDT(ABPVCNT)=ABPVDT(ABPVCNT)_$J($P(^AUTNINS($P(DATA,"^",8),0),"^"),33)
 ..S ABPVDT(ABPVCNT)=ABPVDT(ABPVCNT)_$J($P(DATA,"^",9),8,2)
 Q:+ABPVCNT=10000  S CT=0
 W !?6,"BILL ID     DOS     TYP  D/V              INSURER    "
 W "            AMT",!?6,"-------  --------   ---  ---  "
 W "------------------------------   -----"
 F CNT=1:1 S CT=$O(ABPVDT(CT)) Q:+CT=0  S ABPVDATE(CNT)=ABPVDT(CT)
 S CNT=CNT-1 K ABPVDT S (CT,I,II)=0
NXTCT S DN=I+1 F I=I+1:1:II+3 S CT=$O(ABPVDATE(CT)) Q:+CT=0  D
 .W ! W $J(CT,2),".",?6,ABPVDATE(CT)
 S:I=CNT CT="",I=I+1 S:+CT=0 I=I-1 S (D1,II)=I
SELECT W !,"CHOOSE " S:+CT=0 DN=1 W DN,"-",D1 W:+CT'=0 " or '^' TO STOP"
 W ": " R X:DTIME
 I X["^" K ABPVDOS Q
 I X="" Q:+CT=0  G NXTCT
 I X<1 Q:+CT=0  G NXTCT
 I $D(ABPVDATE(X))=0 W *7,"   ??" G SELECT
 S ABPVDOS=$E(ABPVDATE(+X),10,17),ABPVCDFN=$E(ABPVDATE(+X),1,7)
 F ABPVI=0:0 Q:$E(ABPVCDFN,1)'=" "  S ABPVCDFN=$E(ABPVCDFN,2,7)
 S DA=$O(^ABPVFAC("B",ABPVCDFN,"")) I $D(^ABPVFAC(DA,0))'=1 K ABPVDOS
 K ABPVDATE,CT,DN,D1,I,II S ABPVCDFN=DA,DATA=^ABPVFAC(ABPVCDFN,0)
 S ABPVTYPE=$P(DATA,"^",6),ABPVDV=$P(DATA,"^",7),ABPVINS=$P(DATA,"^",8)
 S:ABPVTYPE="O" ABPVTYPE="OUTPATIENT"
 S:ABPVTYPE="I" ABPVTYPE="INPATIENT (HOSPITAL ONLY)"
 S:ABPVTYPE="P" ABPVTYPE="INPATIENT (PHYSICIAN ONLY)"
 S:ABPVTYPE="D" ABPVTYPE="DENTAL"
 S ABPVINS=$P(^AUTNINS(ABPVINS,0),"^")
 S ABPVAMT=$P(DATA,"^",9),ABPVAMT="$"_$J(ABPVAMT,8,2)
 S ABPVTXFG=$P(DATA,"^",14),ABPVTXDT=$P(DATA,"^",15)
 S ABPVTXFG=$P(DATA,"^",14),ABPVTXDT=$P(DATA,"^",15)
 S ABPVPHNM=$P(DATA,"^",16),ABPVPNUM=$P(DATA,"^",17) D SCREEN
 Q
DEL I ABPVTXDT D  G XIT
 .D REVON W *7,"Claim exported on "
 .S Y=ABPVTXDT X ^DD("DD") W Y," - you cannot delete",@ABPVROFF
 .D PAUSE^ABPVZMM
 D REVON W "Delete claim #",$P(^ABPVFAC(ABPVCDFN,0),"^"),@ABPVROFF
 K DIR S DIR("B")="NO",ABPVMESS="       ARE YOU SURE"
 D YN^ABPVZMM K ABPVMESS S ABPVMESS="Nothing deleted!" I Y D
 .W !,"...Deleting claim #",$P(^ABPVFAC(ABPVCDFN,0),"^"),"..."
 .D WAIT^DICD K DIK,DA S DIK="^ABPVFAC(",DA=ABPVCDFN D ^DIK
 .S ABPVMESS="Claim Deletion Completed!"
 S ABPVMESS(2)="...Press any key to continue... " D PAUSE^ABPVZMM
 ;
XIT L
 K ABPV,ABPVI,ABPVJ,DIC,X,Y,ABPVPDFN,ABPVPNAM,ABPVHRN,ABPVL,ABPVLL
 K ABPVFAC,ABPVTYPE,ABPVINS,ABPVDV,ABPVAMT,ABPVDOS,ABPVK,ABPVCN,DTOUT
 K DFOUT,DUOUT,DQOUT,DLOUT,P1,P2,P3,P4,P5,P6,P7,ABPVDATE,ABPVMESS,DIC
 K DIE,DA,DR,DATA,DIR,YY,J,ABPVCDFN,ABPVTEXT,CNT,CT,II,LBL,ABPVTXFG
 K ABPVTXDT,ABPVCNT,ABPVPHNM,ABPVPNUM
 Q
 ;
MAIN D INIT,PAT I $D(ABPVPDFN)'=1 D XIT Q
 D DOS G:$D(ABPVDOS)'=1 MAIN D DEL G MAIN
 ;
PROMPT ;;FLD #;TITLE;X-POSITION;Y-POSITION;VARIABLE NAME
 ;;(1)   ;Patient Name:;7;7;ABPVPNAM
 ;;(2)   ;Facility:;7;8;ABPVFAC
 ;;(3)   ;Health Record Number:;7;9;ABPVHRN
 ;;(4)   ;Date of Service:;7;10;ABPVDOS
 ;;(5)   ;Visit Type:;7;11;ABPVTYPE
 ;;(6)   ;Days or Visits:;7;12;ABPVDV
 ;;(7)   ;Insurance Company:;7;13;ABPVINS
 ;;   (a);Policy Holder Name:;7;14;ABPVPHNM
 ;;   (b);Policy Number:;7;15;ABPVPNUM
 ;;(8)   ;Claim Amount:;7;16;ABPVAMT