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

ACHSOCVS.m

Go to the documentation of this file.
ACHSOCVS ; IHS/ITSC/PMF - SUMMARY ONLY PRT 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)
 S (ACHSOB,ACHSPAGE,C,ACHSOBST,ACHSPMST,ACHSDOCS,ACHSOBT,ACHSPMTT,ACHSDOCT,ACHSDOC,ACHSOBGT,ACHSPMGT,ACHSDGT)=0
 I $D(^TMP("ACHSOCV",$J,ACHSFAC,0)) S C=0 G NODATA
 S ACHSVNDR=""
P1 ;
 S ACHSVNDR=$O(^TMP("ACHSOCV",$J,ACHSFAC,ACHSVNDR))
 G TOTL:ACHSVNDR=""
 D HEADER,HEADER1
 S ACHSOC=""
P2 ;
 S ACHSOC=$O(^TMP("ACHSOCV",$J,ACHSFAC,ACHSVNDR,ACHSOC))
 G:ACHSOC="" SUBTOTL
 S ACHSDOC=""
 S ACHSDOCS=$P(^TMP("ACHSOCV",$J,ACHSFAC,ACHSVNDR,ACHSOC),U,1),ACHSOBST=$P(^(ACHSOC),U,2),ACHSPMST=$P(^(ACHSOC),U,3)
 S ACHSOCD=$E($P(^ACHS(3,ACHSFAC,1,ACHSOC,0),U,1),1,2)_"."_$E($P(^ACHS(3,ACHSFAC,1,ACHSOC,0),U,1),3,4),ACHSOCD=ACHSOCD_" -"_$S($P(^ACHS(3,ACHSFAC,1,ACHSOC,0),U,2)]"":$P(^(0),U,2),1:"NOT ON FILE")
PRINT ;Prints data totals
 W !?4,ACHSOCD,?39,$J(ACHSDOCS,4)
 S X=ACHSOBST,X2=2
 D COMMA^%DTC
 W ?50,X
 S X=ACHSPMST,X2=2
 D COMMA^%DTC
 W ?66,X
 I IOST["P-",$Y>56 D HEADER,HEADER1
 I IOST["C-",'$D(IO("S")),$Y>24 W !! G END:'$$DIR^XBDIR("E") D HEADER,HEADER1
 S ACHSOBT=ACHSOBT+ACHSOBST,ACHSPMTT=ACHSPMTT+ACHSPMST,ACHSDOCT=ACHSDOCT+ACHSDOCS
 S (ACHSOBST,ACHSDOCS,ACHSPMST,C)=0
 G P2
 ;
SUBTOTL ;
 W !!,$$REPEAT^XLFSTR("-",80),!?3,"SUBTOTAL",?39,$J(ACHSDOCT,4)
 S X=ACHSOBT,X2="2$"
 D COMMA^%DTC
 W ?50,X
 S X=ACHSPMTT,X2="2$"
 D COMMA^%DTC
 W ?66,X
 I ACHSOBT>0,ACHSPMTT>0 S X=(ACHSPMTT/ACHSOBT)*100 W !!?3,"PERCENTAGE OF PAYMENT TO OBLIGATED" W ?63,$E(X,1,5)_"%"
 S ACHSOBGT=ACHSOBGT+ACHSOBT,ACHSPMGT=ACHSPMGT+ACHSPMTT,ACHSDGT=ACHSDGT+ACHSDOCT
 I IOST["C-",'$D(IO("S")) W !! G END:'$$DIR^XBDIR("E")
 S (C,ACHSOBT,ACHSPMTT,ACHSDOCT,ACHSPAGE)=0
 G P1
 ;
TOTL ;
 W !!!!,$$REPEAT^XLFSTR("=",80),!!?3,"TOTAL",?39,$J(ACHSDGT,4)
 S X=ACHSOBGT,X2="2$"
 D COMMA^%DTC
 W ?50,X
 S X=ACHSPMGT,X2="2$"
 D COMMA^%DTC
 W ?66,X
 I ACHSOBGT>0,ACHSPMGT>0 S X=(ACHSPMGT/ACHSOBGT)*100 W !!?3,"PERCENTAGE OF PAYMENT TO OBLIGATED" W ?63,$E(X,1,5)_"%"
 I IOST["C-",'$D(IO("S")) W !! G END:'$$DIR^XBDIR("E")
END ; 
 S:$D(ZTQUEUED) ZTREQ="@"
 D ^%ZISC,EN^XBVK("ACHS"),^ACHSVAR
 K C,I,X,X2,Y,^TMP("ACHSOCV",$J),DIR
 Q
 ;
NODATA ;
 D HEADER
 W !!!,"NO DATA FOR SPECIFIED FISCAL YEAR",!!!!
 I IOST["C-",'$D(IO("S")) G END:'$$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="SERVICE CLASSIFICATION Summary 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 Vendor 
 W !?4,"Vendor: ",ACHSVNDR,!!?3,"# CODE #",?39,"# DOCS #",?52,"$ OBLIG $",?66,"$ PAYMENT $",!
 Q
 ;