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

ACHSCPTC.m

Go to the documentation of this file.
ACHSCPTC ; IHS/ITSC/PMF - PRINT CHS CPT CODES REPORT-SUMMARY ONLY ;JUL 10, 2008
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**7,13,14**;JUN 11,2001
 ;ITSC/SET/JVK ACHS*3.1*7 8/27/2003 - MODIFIED TO GET CODE NOT IEN 
 ;ACHS*3.1*13 IHS/SET/JVK FIX $O 10/14/05
 ;3.1*14 12.4.2007 IHS/OIT/FCJ ADDED CSV CHANGES
 ;
 D BRPT^ACHSFU
 S (ACHSDOC,ACHSDST)=0
 S (ACHSPAGE,ACHSCS,ACHSCT,ACHSCHAS,ACHSDOCS,ACHSCHBS,ACHSCHAT,ACHSCHBT,ACHSDOCT,ACHS43S,ACHS43T,ACHS57S,ACHS57T,ACHS64S,ACHS64T)=0
 S ACHSVNDR=""
P1 ;
 S ACHSVNDR=$O(^TMP("ACHSCPT",$J,ACHSVNDR))
 G:ACHSVNDR="" TOTAL
 S ACHSCODE=""
 I $D(^TMP("ACHSCPT",$J,ACHSVNDR,0)) S C=0 G NODATA
 D HEADER
P1A ;
 S ACHSCODE=$O(^TMP("ACHSCPT",$J,ACHSVNDR,ACHSCODE))
 G:ACHSCODE="" SUBTOTL
 S ACHSDOCS=$P($G(^TMP("ACHSCPT",$J,ACHSVNDR,ACHSCODE)),U)
 S ACHSCHB=$P($G(^TMP("ACHSCPT",$J,ACHSVNDR,ACHSCODE)),U,2)
 S ACHSCHA=$P($G(^TMP("ACHSCPT",$J,ACHSVNDR,ACHSCODE)),U,3)
 ;IHS/SET/JVK ACHS*3.1*7
 ;S ACHSCODP=$S($D(^ICPT(ACHSCODE,0)):$P($G(^ICPT(ACHSCODE,0)),U,2),1:"NOT ON FILE")
 ;ACHS*3.1*13 IHS/SET/JVK COMMENT BELOW ADD $J FOLLOWING LINE 10/14/05
 ;S ACHSDCPT="" S ACHSDCPT=$O(^TMP("ACHSINDX",ACHSCODE,ACHSDCPT))
 S ACHSDCPT="" S ACHSDCPT=$O(^TMP("ACHSINDX",$J,ACHSCODE,ACHSDCPT))
 ;3.1*14 12.13.2007 IHS/OIT/FCJ ADDED CSV CHANGES NXT 2 LINES
 ;S ACHSCODP=$S(ACHSDCPT["ICPT":$P($G(^ICPT(ACHSCODE,0)),U,2),ACHSDCPT["AUTTREVN":$P($G(^AUTTREVN(ACHSCODE,0)),U,2),ACHSDCPT["AUTTADA":$P($G(^AUTTADA(ACHSCODE,0)),U,2),1:"NOT ON FILE")
 S ACHSCODP=$S(ACHSDCPT["ICPT":$P($$CPT^ICPTCOD(ACHSCODE),U,3),ACHSDCPT["AUTTREVN":$P($G(^AUTTREVN(ACHSCODE,0)),U,2),ACHSDCPT["AUTTADA":$P($G(^AUTTADA(ACHSCODE,0)),U,2),1:"NOT ON FILE")
 ;S ACHSCOD=$S($D(^ICPT(ACHSCODE,0)):$P($G(^ICPT(ACHSCODE,0)),U,1),1:ACHSCODE)
 ;3.1*14 12.4.2007 IHS/OIT/FCJ ADDED CSV CHANGES NXT 2 LINES
 ;S ACHSCOD=$S(ACHSDCPT["ICPT":$P($G(^ICPT(ACHSCODE,0)),U,1),ACHSDCPT["AUTTREVN":$P($G(^AUTTREVN(ACHSCODE,0)),U,1),ACHSDCPT["AUTTADA":$P($G(^AUTTADA(ACHSCODE,0)),U,1),1:"NOT ON FILE")
 S ACHSCOD=$S(ACHSDCPT["ICPT":$P($$CPT^ICPTCOD(ACHSCODE),U,2),ACHSDCPT["AUTTREVN":$P($G(^AUTTREVN(ACHSCODE,0)),U,1),ACHSDCPT["AUTTADA":$P($G(^AUTTADA(ACHSCODE,0)),U,1),1:"NOT ON FILE")
 ;Prints data totals
 ;ITSC/SET/JVK ACHS*3.1*7
 ;W !?1,$J(ACHSCOD,6)_" - "_ACHSCODP,?40,$J(ACHSDOCS,4)
 W !?1,$J(ACHSCOD,6)_" - "_$J($E(ACHSCODP,1,30),30),?40,$J(ACHSDOCS,4)
 S X=ACHSCHB,X2=2
 D COMMA^%DTC
 W ?51,X
 S X=ACHSCHA,X2=2
 D COMMA^%DTC
 W ?66,X
 I IOST["P-"&($Y>56) D HEADER,HEADER1
 I IOST["C-",'$D(IO("S"))&($Y>24) K DIR S DIR(0)="E" W !! D ^DIR G END:Y=0 D HEADER,HEADER1
 S ACHSCHBS=ACHSCHBS+ACHSCHB,ACHSCHAS=ACHSCHAS+ACHSCHA,ACHSDST=ACHSDST+ACHSDOCS,ACHSCS=ACHSCS+1
 S Z=$G(^TMP("ACHSCPT",$J,ACHSVNDR,ACHSCODE))
 S ACHS43=$P(Z,U,4),ACHS57=$P(Z,U,5),ACHS64=$P(Z,U,6)
 S ACHS43S=ACHS43S+ACHS43,ACHS57S=ACHS57S+ACHS57,ACHS64S=ACHS64S+ACHS64
 G P1A
 ;
SUBTOTL ;
 W !!,$$REPEAT^XLFSTR("-",80),!,"SUBTOTAL",?10,ACHSCS,?40,$J(ACHSDST,4)
 S X=ACHSCHBS,X2="2$"
 D COMMA^%DTC
 W ?51,X
 S X=ACHSCHAS,X2="2$"
 D COMMA^%DTC
 W ?66,X
 I ACHSCHBS>0&(ACHSCHAS>0) W !! S X=(ACHSCHAS/ACHSCHBS)*100 W "PERCENTAGE OF CHGS ALLOWED TO CHGS BILLED",?64,$E(X,1,5)_"%"
 W !!?3,"** HOSP - "_ACHS43S_" **",?32,"** DENT - "_ACHS57S_" **",?62,"** OUTP - "_ACHS64S_" **"
 S ACHSCHBT=ACHSCHBT+ACHSCHBS,ACHSCHAT=ACHSCHAT+ACHSCHAS,ACHSDOCT=ACHSDOCT+ACHSDST,ACHSCT=ACHSCT+ACHSCS
 S ACHS43T=ACHS43T+ACHS43S,ACHS57T=ACHS57T+ACHS57S,ACHS64T=ACHS64T+ACHS64S
 K DIR
 I IOST["C-",'$D(IO("S")) S DIR(0)="E" W !! D ^DIR G END:Y=0
 S (ACHSCHBS,ACHSCHAS,ACHSDST,ACHSPAGE,ACHSCS,ACHS43S,ACHS57S,ACHS64S)=0
 G P1
 ;
TOTAL ;
 W !!!!,$$REPEAT^XLFSTR("=",80),!!,"TOTAL",?10,ACHSCT,?40,$J(ACHSDOCT,4)
 S X=ACHSCHBT,X2="2$"
 D COMMA^%DTC
 W ?51,X
 S X=ACHSCHAT,X2="2$"
 D COMMA^%DTC
 W ?66,X,!
 I ACHSCHBT>0&(ACHSCHAT>0) W ! S Z=(ACHSCHAT/ACHSCHBT)*100 W "PERCENTAGE OF CHGS ALLOWED TO CHGS BILLED" W ?64,$E(Z,1,5)_"%"
 W !!?3,"** HOSP - "_ACHS43T_" **",?32,"** DENT - "_ACHS57T_" **",?62,"** OUTP - "_ACHS64T_" **"
 K DIR
 I IOST["C-",'$D(IO("S")) S DIR(0)="E" W !! D ^DIR G END:Y=0
END ;Close device, kill variables, quit
 S:$D(ZTQUEUED) ZTREQ="@"
 D ^%ZISC
 K ACHSDOC,ACHSPAGE,C,ACHSDOCS,ACHS43,ACHS43S,ACHS43T,ACHS57,ACHS57S
 K ACHSDOCT,ACHSDOC,ACHSDAT,ACHSTIM,ACHSVNDR,I,X,ACHS57T,ACHS64
 K ACHSDST,ACHSUSR,^TMP("ACHSCPT",$J),X2,Y,ACHS64S,ACHS64T,ACHSBEG
 K ACHSCHA,ACHSCHAS,ACHSCHAT,ACHSCHB,ACHSCHBS,ACHSCHBT,ACHSCOD
 K ACHSCODE,ACHSCODP,ACHSCS,ACHSCT,ACHSEND,ACHSQIO,Z,DIR
 Q
 ;
NODATA ;
 K DIR
 S DIR(0)="E"
 D HEADER
 W !!!,"NO DATA AVAILABLE FOR SPECIFIED CRITERIA",!!!!
 I IOST["C-",'$D(IO("S")) D ^DIR Q:Y=0
 K DIR,^TMP("ACHSCPT",$J,ACHSVNDR,0)
 S ACHSPAGE=0
 G P1
 ;
 W @IOF
 S ACHSPAGE=ACHSPAGE+1
 S Y=$$HTE^XLFDT($H),ACHSDAT=$P(Y,"@",1),ACHSTIM=$P(Y,"@",2)
 W !,"*",ACHSDAT
 S X=$$LOC^ACHS
 W ?((80/2)-($L(X)/2)),X,?71,ACHSTIM,"*",!,"*User: ",ACHSUSR,?70,"Device:",IO,"*",!!
 S X="CPT CODE Summary Report - Page "
 W ?((80/2)-($L(X)/2)),X_ACHSPAGE
 S X="For "_$$FMTE^XLFDT(ACHSBEG)_" To "_$$FMTE^XLFDT(ACHSEND)
 W !?((80/2)-($L(X)/2)),X,!,$$REPEAT^XLFSTR("*",80)
HEADER1 ;
 W !!?1,"CPTCODE",?40,"# DOCS #",?52,"$ CHG BLD $",?66,"$ CHG ALWD $",!,$$REPEAT^XLFSTR("~",80)
 Q