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

ACHSOCVD.m

Go to the documentation of this file.
ACHSOCVD ; IHS/ITSC/PMF - DETAILED PRINT CHS OBJCLAS CODE - VENDOR ;    [ 10/16/2001   8:16 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
 ;
 D BRPT^ACHSFU
 S ACHSFAC=DUZ(2),ACHSPAGE=0
 I $D(^TMP("ACHSOCV",$J,ACHSFAC,0)) G NODATA
 S (ACHSOB,C,ACHSOBST,ACHSPMST,ACHSDOCS,ACHSOBT,ACHSPMTT,ACHSDOCT,ACHSDOC,ACHSFLG,ACHSPAGE,ACHSVDCT,ACHSVOBT,ACHSVPMT)=0
 S ACHSVNDR=""
P2 ;
 S ACHSVNDR=$O(^TMP("ACHSOCV",$J,ACHSFAC,ACHSVNDR))
 G TOTL:ACHSVNDR=""
 S ACHSOC=""
P3 ;
 S ACHSOC=$O(^TMP("ACHSOCV",$J,ACHSFAC,ACHSVNDR,ACHSOC))
 G:ACHSOC="" VNDRTOT
 D HEADER
 S ACHSOCD=$E($P($G(^ACHS(3,ACHSFAC,1,ACHSOC,0)),U),1,2)_"."_$E($P($G(^ACHS(3,ACHSFAC,1,ACHSOC,0)),U),3,4),ACHSOCD=ACHSOCD_" -"_$S($P($G(^ACHS(3,ACHSFAC,1,ACHSOC,0)),U,2)]"":$P($G(^ACHS(3,ACHSFAC,1,ACHSOC,0)),U,2),1:"NOT ON FILE")
 S ACHSDOC=""
P4 ;
 S ACHSDOC=$O(^TMP("ACHSOCV",$J,ACHSFAC,ACHSVNDR,ACHSOC,ACHSDOC))
 G:ACHSDOC="" SUBTOTL
GETADD ;Vendor address
 S ACHSVEN=$P(^TMP("ACHSOCV",$J,ACHSFAC,ACHSVNDR,ACHSOC,ACHSDOC),U,5),Z=$G(^AUTTVNDR(ACHSVEN,13))
 S ACHSVADD=$S(Z="":"NOT ON FILE",1:$P(Z,U,1)),ACHSVCIT=$S(Z="":Z,1:$P(Z,U,2)),ACHSVST=$S(Z="":Z,1:$P(Z,U,3)),ACHSVST=$S(ACHSVST="":ACHSVST,1:$P(^DIC(5,ACHSVST,0),U,1)),ACHSZIP=$S(Z="":Z,1:$P(Z,U,4))
 D:ACHSFLG=0 HEADER1
 S X=^TMP("ACHSOCV",$J,ACHSFAC,ACHSVNDR,ACHSOC,ACHSDOC)
GETPAT ;
 S P=$P(X,U,1),ACHSPAT=$S(P]"":$P(^DPT(P,0),U,1),1:"No NAME on file")
GETHRN ;
 S ACHSHRN=$S($P(X,U,2)]"":$P(X,U,2),1:"NONE"),ACHSOB=$P(X,U,3),A=$P(X,U,4),ACHSPMT=$S(A="":0,1:A)
PRINT ;Prints data totals
 W !,ACHSDOC,?17,$E(ACHSPAT,1,25),?45,$J(ACHSHRN,6)
 S X=ACHSOB,X2=2
 D COMMA^%DTC
 W ?54,X
 S X=ACHSPMT,X2=2
 D COMMA^%DTC
 W ?68,X
 S ACHSOBST=ACHSOBST+ACHSOB,ACHSPMST=ACHSPMST+ACHSPMT,C=C+1,ACHSDOCS=C,ACHSFLG=1
 I IOST["P-",$Y>56 S ACHSFLG=1 D HEADER,HEADER1
 I IOST["C-",'$D(IO("S")),$Y>24 G END:'$$DIR^XBDIR("E") S ACHSFLG=1 D HEADER,HEADER1
 G P4
 ;
SUBTOTL ;
 W !!,$$REPEAT^XLFSTR("-",80),!,"SUBTOTAL",?25,$J(ACHSDOCS,4)
 S X=ACHSOBST,X2="2$"
 D COMMA^%DTC
 W ?54,X
 S X=ACHSPMST,X2="2$"
 D COMMA^%DTC
 W ?68,X
 S ACHSOBT=ACHSOBT+ACHSOBST,ACHSPMTT=ACHSPMTT+ACHSPMST,ACHSDOCT=ACHSDOCT+ACHSDOCS
 I ACHSOBST>0,ACHSPMST>0 S X=(ACHSPMST/ACHSOBST)*100 W !!,"PERCENTAGE OF PAYMENT TO OBLIGATED" W ?67,$E(X,1,5)_"%"
 S ACHSVDCT=ACHSVDCT+ACHSDOCS,ACHSVOBT=ACHSVOBT+ACHSOBST,ACHSVPMT=ACHSVPMT+ACHSPMST
 I IOST["C-",'$D(IO("S")) W !! G END:'$$DIR^XBDIR("E")
 S (C,ACHSOBST,ACHSPMST,ACHSFLG,ACHSDOCS)=0
 G P3
 ;
VNDRTOT ;
 W !!,$$REPEAT^XLFSTR("=",80),!,"VENDOR TOTALS",?25,$J(ACHSVDCT,4)
 S X=ACHSVOBT,X2="2$"
 D COMMA^%DTC
 W ?54,X
 S X=ACHSVPMT,X2="2$"
 D COMMA^%DTC
 W ?68,X
 I ACHSVOBT>0,ACHSVPMT>0 S X=(ACHSVPMT/ACHSVOBT)*100 W !!,"PERCENTAGE OF PAYMENT TO OBLIGATED" W ?67,$E(X,1,5)_"%"
 I IOST["C-",'$D(IO("S")) W !! G END:'$$DIR^XBDIR("E")
 S (ACHSVDCT,ACHSFLG,ACHSVOBT,ACHSVPMT,ACHSPAGE)=0
 G P2
 ;
TOTL ;
 W !!!!,$$REPEAT^XLFSTR("=",80),!!,"TOTAL",?25,$J(ACHSDOCT,4)
 S X=ACHSOBT,X2="2$"
 D COMMA^%DTC
 W ?56,X
 S X=ACHSPMTT,X2="2$"
 D COMMA^%DTC
 W ?68,X
 I ACHSOBT>0,ACHSPMTT>0 S X=(ACHSPMTT/ACHSOBT)*100 W !!,"PERCENTAGE OF PAYMENT TO OBLIGATED" W ?67,$E(X,1,5)_"%"
 I IOST["C-",'$D(IO("S")) W !! G END:'$$DIR^XBDIR("E")
END ;Close device, kill variables, quit
 S:$D(ZTQUEUED) ZTREQ="@"
 D ^%ZISC
 K I,P,Z,X,X2,Y,^TMP("ACHSOCV",$J)
 D EN^XBVK("ACHS"),^ACHSVAR
 Q
 ;
NODATA ;
 D HEADER
 W !!!,"NO DATA FOR SPECIFIED FISCAL YEAR",!!!!
 I IOST["C-",'$D(IO("S")) Q:'$$DIR^XBDIR("E")
 K ^TMP("ACHSOCV",$J,ACHSFAC,0)
 G END
 ;
 U IO
 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
 W ?71,ACHSTIM,"*",!,"*User: ",ACHSUSR,?70,"Device:",IO,"*"
 S X="Detailed SERVICE CLASSIFICATION Report BY VENDOR - Page "
 W !!?((80/2)-($L(X)/2)),X_ACHSPAGE
 S X="For FISCAL YEAR: "
 W !?((80/2)-($L(X)/2)),X_ACHSFY,!,$$REPEAT^XLFSTR("*",80)
 Q
 ;
HEADER1 ;Prints Object Class Code/Vendor Data
 W !!?5,"Object Class Code: ",ACHSOCD,!?16,"Vendor: ",ACHSVNDR,!?24,ACHSVADD,!?24,ACHSVCIT," ",?34,ACHSVST," ",?45,ACHSZIP,!!?1,"# DOCS #",?17,"PATIENT NAME",?44,"# CHART #",?56,"$ OBLIG $",?68,"$ PAYMENT $",!
 Q
 ;