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

ACHSOCSP.m

Go to the documentation of this file.
ACHSOCSP ; IHS/ITSC/PMF - PRINT CHS SERVICE CLASS CODES SUMMARY ;    [ 10/12/2004  12:50 PM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**6,7**;JUNE 11,2001
 ;ACHS*3.1*6 IHS/SET/JVK ADD TOTALS TO SHOW OBLIGTED TO PAID SUMMARY
 ;ACHS*3.1*7 IHS/SET/JVK ADD PAID TOTALS FOR NUMBER OF DOC'S
 ;
 D BRPT^ACHSFU
 S (ACHSOB,ACHSPAY,ACHSDOC)=0,ACHSBM=IOSL-4
 S (ACHSPAGE,ACHSOBST,ACHSPMS,ACHSDOCS,ACHSOBT,ACHSPMTT,ACHSDOCT,ACHSDOC,ACHSOB,ACHSPMT,ACHSPMST,ACHSDST,ACHSOBS,ACHSOBT,ACHSWKLD,ACHSWKTO)=0
 I '$D(^TMP("ACHSOCSQ",$J)) D NODATA G END
 S ACHSFAC=""
P1 ;
 S ACHSFAC=$O(^TMP("ACHSOCSQ",$J,ACHSFAC))
 G:ACHSFAC="" TOTAL
 D HEADER,HEADER1
 S ACHSOC=""
P1A ;
 S ACHSOC=$O(^TMP("ACHSOCSQ",$J,ACHSFAC,ACHSOC))
 I ACHSOC="" D SUBTOTL G P1
 S ACHSOCD=$E($P(ACHSOC,U,1),1,2)_"."_$E($P(ACHSOC,U,1),3,99)_$$REPEAT^XLFSTR(" ",30)
 S X=$G(^TMP("ACHSOCSQ",$J,ACHSFAC,ACHSOC))
 S ACHSDOCS=$P(X,U,1)
 S ACHSOBS=$P(X,U,2)
 S ACHSPMS=$P(X,U,3)
 S ACHSWKL=$P(X,U,4)
 ;ITSC/SET/JVK ACHS*3.1*7 ADD DOCS PAID VS TOTAL DOCS
 S ACHSPDOC=$P(X,U,5)
 S ACHSBLKT=$P(X,U,6)
 I ACHSBLKT="" S ACHSBLKT=0
 W !,$E(ACHSOCD,1,30),$J($FN(ACHSDOCS,","),10),$J($FN(ACHSOBS,",",2),16),$J($FN(ACHSPMS,",",2),16),$J($FN(ACHSWKL,","),8)
 ;ITSC/SET/JVK ACHS*3.1.*7 ADD TOTAL OF PAID DOCS TO PRINT LINE
 W !,?12,"Paid Doc(s)",?30,$J(ACHSPDOC,10),?45,"Blankets/Special Doc(s): ",ACHSBLKT,!
 S ACHSOBST=ACHSOBST+ACHSOBS,ACHSPMST=ACHSPMST+ACHSPMS,ACHSDST=ACHSDST+ACHSDOCS,ACHSWKLD=ACHSWKLD+ACHSWKL
 I $Y>ACHSBM D RTRN^ACHS G:$G(ACHSQUIT) END Q:'$D(ACHSPAGE)  D HEADER,HEADER1
 G P1A
 ;
SUBTOTL ;
 W !!,$$REPEAT^XLFSTR("-",80),!,"SUBTOTAL",$$REPEAT^XLFSTR(" ",22),$J($FN(ACHSDST,","),10),$J("$"_$FN(ACHSOBST,",",2),16),$J("$"_$FN(ACHSPMST,",",2),16),$J($FN(ACHSWKLD,","),8)
 ;IHS/SET/JVK ACHS*3.1*6 BEG NEW CODE
 ;I ACHSOBST>0,ACHSPMST>0 S X=(ACHSPMST/ACHSOBST)*100 W !!,"PERCENTAGE OF PAYMENT TO OBLIGATED",?54,$J($FN(X,",",2),8),"%"
 I ACHSOBST>0,ACHSPMST>0 S X=(ACHSPMST/ACHSOBST)*100 W !!,"PERCENTAGE OF POSTED PAYMENTS TO OBLIGATED",?54,$J($FN(X,",",2),8),"%"
 W !!,"OBLIGATED PAYMENT RECONCILE AMT",?45,$J($FN(ACHSOBX,",",2),10)
 W !!,"PAYMENT ADJUSTMENT RECONCILE AMT",?45,$J($FN(ACHSZAT,",",2),10)
 ;S ACHSOBT=ACHSOBT+ACHSOBST,ACHSPMTT=ACHSPMTT+ACHSPMST,ACHSDOCT=ACHSDOCT+ACHSDST,ACHSWKTO=ACHSWKTO+ACHSWKLD
 S ACHSOBT=ACHSOBT+ACHSOBST+ACHSOBX+ACHSZAT,ACHSPMTT=ACHSPMTT+ACHSPMST,ACHSDOCT=ACHSDOCT+ACHSDST,ACHSWKTO=ACHSWKTO+ACHSWKLD
 ;IHS/SET/JVK ACHS*3.1*6 END NEW CODE
 S (ACHSOBST,ACHSPMST,ACHSDST,ACHSPAGE,ACHSWKLD)=0
 Q
 ;
TOTAL ;
 W !!!!,$$REPEAT^XLFSTR("=",80),!!,"TOTAL",$$REPEAT^XLFSTR(" ",25),$J($FN(ACHSDOCT,","),10),$J("$"_$FN(ACHSOBT,",",2),16),$J("$"_$FN(ACHSPMTT,",",2),16),$J($FN(ACHSWKTO,","),8),!
 I ACHSOBT>0,ACHSPMTT>0 S Z=(ACHSPMTT/ACHSOBT)*100 W !,"PERCENTAGE OF PAYMENT TO TOTAL OBLIGATED",?54,$J($FN(Z,",",2),8),"%"
 ;ITSC/SET/JVK ACHS*3.1*7 ADD LINE BELOW
 W !!,"TOTAL DOCUMENTS IN PAID STATUS: ",?20,$J(ACHSPSCC,10)
 D RTRN^ACHS
END ;Close device, kill variables, quit
 S:$D(ZTQUEUED) ZTREQ="@"
 D ERPT^ACHS,EN^XBVK("ACHS"),^ACHSVAR
 K I,X
 K ^TMP("ACHSOCSQ",$J),X2,Z,DIR
 Q
 ;
NODATA ;
 D HEADER
 W !!!,"NO DATA FOR SPECIFIED ",$S(ACHSFY:"FISCAL YEAR",1:"DATES"),".",!!!!
 D RTRN^ACHS
 Q
 ;
 W @IOF
 S ACHSPAGE=ACHSPAGE+1
 S Y=$$HTE^XLFDT($H),ACHSTIM=$P(Y,"@",2)
 W !,"*",$P(Y,"@",1)
 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 - Page "
 W ?((80/2)-($L(X)/2)),X_ACHSPAGE,!
 S X=$S(ACHSFY:"For FISCAL YEAR: "_ACHSFY,1:"From "_$$FMTE^XLFDT(ACHSBDT)_" to "_$$FMTE^XLFDT(ACHSEDT))
 W ?((80/2)-($L(X)/2)),X,!,$$REPEAT^XLFSTR("*",80)
 Q
 ;
HEADER1 ;
 W !!,"OBJCODE",?32,"#_DOCS_#",?46,"$_OBLIGD_$",?61,"$_PAYMENT_$  WORKLD"
 Q
 ;