ABPVOP02 ;TALLY PRIVATE INSURANCE ELIG O/P VISIT REPORT; [ 06/02/91 12:49 PM ]
;;2.0;FACILITY PVT-INS TRACKING;*0*;IHS-OKC/KJR;AUGUST 7, 1991
START D INIT I ABPV("GLOB")=0 D Q
.S ^%ZTSK(ZTSK,"ERR")="I COULD NOT DETERMINE YOUR 'APC' GLOBAL TYPE"
D XTRACT,ZTLOAD
Q
;
INIT S ABPV("TOTAL")=0,ABPV("HITS")=0,ABPV("TASK")=ZTSK
S ABPV("GLOB")=$S($D(^AAPCRCDS):"^AAPCRCDS(",$D(^AAPCDATA):"^AAPCDATA(",1:0)
Q
;
XTRACT S A("ADOS")=ABPV("BEG")-1
A S ABPV("IND")=ABPV("GLOB")_"""APC"",A(""ADOS""))"
S A("ADOS")=$O(@ABPV("IND")) Q:+A("ADOS")=0!(A("ADOS")>ABPV("END"))
S A("ADFN")=0
A1 S ABPV("IND")=ABPV("GLOB")_"""APC"",A(""ADOS""),ABPV(""SITE""),A(""ADFN""))"
S A("ADFN")=$O(@ABPV("IND")) G A:+A("ADFN")=0
S ABPV("IND")=ABPV("GLOB")_"""APC"",A(""ADOS""),ABPV(""SITE""),A(""ADFN""),X)"
S X=0 F A("SVCS")=1:1 S X=$O(@ABPV("IND")) Q:+X=0
S A("SVCS")=A("SVCS")-1,ABPV("TOTAL")=ABPV("TOTAL")+A("SVCS")
I $D(^AUPNPRVT(A("ADFN"),0))=0 G A1
S ABPV("HITS")=ABPV("HITS")+A("SVCS")
S ^%ZTSK(ABPV("TASK"),ABPV("SITE"),A("ADOS"),A("ADFN"))=A("SVCS")
G A1
;
ZTLOAD S ZTRTN="^ABPVOP03",ZTDTH=$H,ZTIO=ABPV("IO"),ZTSAVE("ABPV(")=""
S ZTDESC="PRINT PVT INS ELIGIBLE APC VISITS"
D ^%ZTLOAD
ZTLEND K ABPV,ABPV,%ZIS,%IS,ZRTN,ZTDTH,ZTDESC,ZTSAVE,ZTSK,A,X,Y,DIC,DIE,DA
K DR,ZTIO,R,I
Q
ABPVOP02 ;TALLY PRIVATE INSURANCE ELIG O/P VISIT REPORT; [ 06/02/91 12:49 PM ]
+1 ;;2.0;FACILITY PVT-INS TRACKING;*0*;IHS-OKC/KJR;AUGUST 7, 1991
START DO INIT
IF ABPV("GLOB")=0
Begin DoDot:1
+1 SET ^%ZTSK(ZTSK,"ERR")="I COULD NOT DETERMINE YOUR 'APC' GLOBAL TYPE"
End DoDot:1
QUIT
+2 DO XTRACT
DO ZTLOAD
+3 QUIT
+4 ;
INIT SET ABPV("TOTAL")=0
SET ABPV("HITS")=0
SET ABPV("TASK")=ZTSK
+1 SET ABPV("GLOB")=$SELECT($DATA(^AAPCRCDS):"^AAPCRCDS(",$DATA(^AAPCDATA):"^AAPCDATA(",1:0)
+2 QUIT
+3 ;
XTRACT SET A("ADOS")=ABPV("BEG")-1
A SET ABPV("IND")=ABPV("GLOB")_"""APC"",A(""ADOS""))"
+1 SET A("ADOS")=$ORDER(@ABPV("IND"))
IF +A("ADOS")=0!(A("ADOS")>ABPV("END"))
QUIT
+2 SET A("ADFN")=0
A1 SET ABPV("IND")=ABPV("GLOB")_"""APC"",A(""ADOS""),ABPV(""SITE""),A(""ADFN""))"
+1 SET A("ADFN")=$ORDER(@ABPV("IND"))
IF +A("ADFN")=0
GOTO A
+2 SET ABPV("IND")=ABPV("GLOB")_"""APC"",A(""ADOS""),ABPV(""SITE""),A(""ADFN""),X)"
+3 SET X=0
FOR A("SVCS")=1:1
SET X=$ORDER(@ABPV("IND"))
IF +X=0
QUIT
+4 SET A("SVCS")=A("SVCS")-1
SET ABPV("TOTAL")=ABPV("TOTAL")+A("SVCS")
+5 IF $DATA(^AUPNPRVT(A("ADFN"),0))=0
GOTO A1
+6 SET ABPV("HITS")=ABPV("HITS")+A("SVCS")
+7 SET ^%ZTSK(ABPV("TASK"),ABPV("SITE"),A("ADOS"),A("ADFN"))=A("SVCS")
+8 GOTO A1
+9 ;
ZTLOAD SET ZTRTN="^ABPVOP03"
SET ZTDTH=$HOROLOG
SET ZTIO=ABPV("IO")
SET ZTSAVE("ABPV(")=""
+1 SET ZTDESC="PRINT PVT INS ELIGIBLE APC VISITS"
+2 DO ^%ZTLOAD
ZTLEND KILL ABPV,ABPV,%ZIS,%IS,ZRTN,ZTDTH,ZTDESC,ZTSAVE,ZTSK,A,X,Y,DIC,DIE,DA
+1 KILL DR,ZTIO,R,I
+2 QUIT