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

ABPVOP03.m

Go to the documentation of this file.
ABPVOP03 ;PRINT PRIVATE INSURANCE ELIG O/P VISIT REPORT; [ 06/02/91  12:50 PM ]
 ;;2.0;FACILITY PVT-INS TRACKING;*0*;IHS-OKC/KJR;AUGUST 7, 1991
START D INIT,HEADING,XTRACT,SUMRY,CLOSE
 Q
 ;
INIT S ABPV("PG")=0,LOC=$P(^DIC(4,ABPV("SITE"),0),"^",1),ZTSK=ABPV("TASK")
 S TITLE="APC VISITS WITH PRIVATE INSURANCE COVERAGE"
 S A("TITLE")="***  PRIVATE INSURANCE ELIGIBLE REPORT  ***"
 Q
 ;
HEADING S ABPV("PG")=ABPV("PG")+1
 S A("TM")=$P($H,",",2),A("HR")=A("TM")\3600,A("MIN")=A("TM")#3600\60
 S:A("MIN")<10 A("MIN")="0"_A("MIN") S TME=A("HR")_":"_A("MIN"),A("PDT")=$E(DT,4,5)_"/"_$E(DT,6,7)_"/"_$E(DT,2,3)
 W @IOF,?80-$L(A("TITLE"))\2,A("TITLE"),!!,A("PDT"),?80-$L(LOC)\2,LOC,?73,"page ",ABPV("PG"),!,TME,?80-$L(TITLE)\2,TITLE S X="(task "_ZTSK_")" W ?80-$L(X),X,!
 S Y=ABPV("BEG") X ^DD("DD") S A("BEG")=Y,Y=ABPV("END") X ^DD("DD") S A("END")=Y S TITLE="For the period "_A("BEG")_" through "_A("END") W ?80-$L(TITLE)\2,TITLE
H5 W !!," D.O.S.",?10,"SVCS",?16,"PATIENT NAME",?38,"CHART #",?47,"INSURANCE CARRIER(S)",! F I=1:1:79 W "-"
 W !
 Q
 ;
XTRACT S A("ADOS")=ABPV("BEG")-1
A S A("ADOS")=$O(^%ZTSK(ZTSK,ABPV("SITE"),A("ADOS")))
 Q:+A("ADOS")=0!(A("ADOS")>ABPV("END"))
 S ABPV("DOS")=$E(A("ADOS"),4,5)_"/"_$E(A("ADOS"),6,7)_"/"_$E(A("ADOS"),2,3) D:$Y>55 HEADING W !,ABPV("DOS") S A("ADFN")=0
A1 S A("ADFN")=$O(^%ZTSK(ZTSK,ABPV("SITE"),A("ADOS"),A("ADFN"))) G A:+A("ADFN")=0
 S A("SVCS")=^%ZTSK(ZTSK,ABPV("SITE"),A("ADOS"),A("ADFN"))
NAME I $D(^DPT(A("ADFN"),0))=0 S A("NAME")="*****  ERROR  *****" G CHART
 S A("NAME")=$P(^DPT(A("ADFN"),0),"^",1),A("NAME")=$E(A("NAME"),1,20)
CHART I $D(^AUPNPAT(A("ADFN"),41,ABPV("SITE"),0))=0 S A("CHART")="*****  ERROR  *****" G PRINT
 S A("CHART")=$P(^AUPNPAT(A("ADFN"),41,ABPV("SITE"),0),"^",2)
PRINT W ?11,A("SVCS"),?16,A("NAME"),?38,$J(A("CHART"),7)
PVTINS S ASM("$Y")=$Y,X=0 F I=1:1 S X=$O(^AUPNPRVT(A("ADFN"),11,X)) Q:X="B"!(X="")  S A("PTR")=$P(^AUPNPRVT(A("ADFN"),11,X,0),"^",1) D INSPRT
 I ((X="B"!(X=""))&(I=1)) S A("PRT")="" D INSPRT
 W:ASM("$Y")=$Y ! G A1
INSPRT I A("PTR")="" W ?47,"***** INCOMPLETE *****" D:$Y>55 HEADING W ! Q
 I $D(^AUTNINS(A("PTR"),0))=0 W ?47,"***** INCOMPLETE *****" D:$Y>55 HEADING W ! Q
 W ?47,$P(^AUTNINS(A("PTR"),0),"^",1) D:$Y>55 HEADING W ! Q
 ;
SUMRY W ! F I=1:1:79 W "-"
 S:ABPV("TOTAL")=0 ABPV("%")=0
 S:ABPV("TOTAL")>0 ABPV("%")=(ABPV("HITS")/ABPV("TOTAL"))*100
 W !!,"TOTAL APC VISITS FOR THIS PERIOD: ",$J(ABPV("TOTAL"),6)
 W !,"VISITS WITH THIRD PARTY COVERAGE: ",$J(ABPV("HITS"),6)
 W !,"PERCENTAGE PRIVATE INS. COVERAGE: ",$J(ABPV("%"),6,1),"%"
 Q
 ;
CLOSE W @IOF X ^%ZIS("C") K A,ASM,ABPV,LOC,TITLE,X,Y,I Q