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

ACHSPCCR.m

Go to the documentation of this file.
ACHSPCCR ; IHS/ITSC/PMF - CHS AREA SPLITOUT REPORT ;JUL 10, 2008
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**14,21**;JUN 11,2001;Build 43
 ;ACHS*3.1*14 11/08/2007 IHS/OIT/FCJ NEW ROUTINE TO PRINT TOTAL RECORDS FOR UFMS AND BCBS
ST ;EP
 D BCBS,UFMS,HDR1,PRT
 S ^ACHSPCC("PROC")="S"  ;ACHS*3.1*21
 G EXIT
BCBS ;DATA FOR BCBS
 ;achsbrct-batch record count achsbdct=batch dollar amount achsrct-record count achsdct=dollar amount
 S (ACHSBRCT,ACHSBDCT,ACHSRCT,ACHSDCT,ACHSFIN)=0
 I $D(^ACHSBCBS) S ACHS="" F  S ACHS=$O(^ACHSBCBS(ACHS)) Q:ACHS=""  D
 .S ACHSREC=^ACHSBCBS(ACHS)
 .I $E(ACHSREC,1,2)="AA" D FACBC Q
 .Q:$E(ACHSREC,1,2)'="5A"
 .I $E(ACHSREC,1,2)="5A"
 .S ACHSRCT=ACHSRCT+1
 .S ACHSDCT=$E(ACHSREC,69,76)+ACHSDCT
 .S ACHSFIN=$E(ACHSREC,5,7)
 S ACHSBBC=ACHSBRCT_U_ACHSBDCT
 Q
UFMS ;DATA FOR UFMS
 S (ACHSBRCT,ACHSBDCT,ACHSRCT,ACHSDCT)=0
 I $D(^ACHSUFMS) S ACHS=0 F  S ACHS=$O(^ACHSUFMS(ACHS)) Q:ACHS'?1N.N  D
 .S ACHSREC=^ACHSUFMS(ACHS)
 .S ACHSFIN=$E(ACHSREC,27,29)
 .S ACHSDCT=$E(ACHSREC,52,63),Y=$E(ACHSREC,11)
 .S ACHSDCT=$S(Y=2:"-"_ACHSDCT,1:ACHSDCT)
 .I '$D(ACHSBFUF(ACHSFIN)) S $P(ACHSBFUF(ACHSFIN),U,2)=1,$P(ACHSBFUF(ACHSFIN),U,3)=ACHSDCT
 .E  S $P(ACHSBFUF(ACHSFIN),U,2)=$P(ACHSBFUF(ACHSFIN),U,2)+1,$P(ACHSBFUF(ACHSFIN),U,3)=$P(ACHSBFUF(ACHSFIN),U,3)+ACHSDCT
 .S ACHSBRCT=ACHSBRCT+1,ACHSBDCT=ACHSBDCT+ACHSDCT
 S ACHSUFMS=ACHSBRCT_U_ACHSBDCT
 Q
FACBC ;TOTAL BY FAC FOR BCBS FILES
 S ACHSBRCT=ACHSBRCT+ACHSRCT,ACHSBDCT=ACHSBDCT+ACHSDCT
 I '$D(ACHSBFBC($E(ACHSREC,3,8))) S ACHSBFBC($E(ACHSREC,3,8))=ACHSRCT_U_ACHSDCT
 E  S $P(ACHSBFBC($E(ACHSREC,3,8)),U)=$P(ACHSBFBC($E(ACHSREC,3,8)),U)+ACHSRCT,$P(ACHSBFBC($E(ACHSREC,3,8)),U,2)=$P(ACHSBFBC($E(ACHSREC,3,8)),U,2)+ACHSDCT
 S (ACHSRCT,ACHSDCT)=0
 S ACHSBFUF(ACHSFIN)=$E(ACHSREC,3,8)_U_0_U_0
 S ACHSFIN=0
 Q
PRT ; PRINT DATA
 W ?5,"Blue Cross Blue Sheild of New Mexico"
 S ASUFAC=0 F  S ASUFAC=$O(ACHSBFBC(ASUFAC)) Q:ASUFAC'?1N.N  D
 .Q:$P(ACHSBFBC(ASUFAC),U)=0
 .S X=0,X=$O(^AUTTLOC("C",ASUFAC,X))  S ACHSFAC=$P(^DIC(4,X,0),U)
 .W !?10,ACHSFAC,?44,$P(ACHSBFBC(ASUFAC),U)
 .S X=$P(ACHSBFBC(ASUFAC),U,2)/100,X2=2,X3=16
 .D COMMA^%DTC W ?55,X
 S X=$P(ACHSBBC,U,2)/100,X2=2,X3=16 D COMMA^%DTC
 W !!?5,"Total Finance Records: ",$P(ACHSBBC,U),?35,"Total Dollar Amount: ",X
 ;
 W !!?5,"United Financial Management System"
 S ACHS=0 F  S ACHS=$O(ACHSBFUF(ACHS)) Q:ACHS=""  D
 .S ACHSFAC=ACHS
 .S ASUFAC=$P(ACHSBFUF(ACHS),U) I ASUFAC'="" S X=0,X=$O(^AUTTLOC("C",ASUFAC,X)) S ACHSFAC=$P(^DIC(4,X,0),U)
 .W !?10,ACHSFAC,?44,$P(ACHSBFUF(ACHS),U,2)
 .S X=$P(ACHSBFUF(ACHS),U,3)/100,X2=2,X3=16
 .D COMMA^%DTC W ?55,X
 S X=$P(ACHSUFMS,U,2)/100,X2=2,X3=16 D COMMA^%DTC
 W !!?5,"Total Finance Records: ",$P(ACHSUFMS,U),?35,"Total Dollar Amount: ",X
 Q
HDR1 ;
 U IO
 S (X,Y)="",$P(X,"*",71)="",$P(Y,"-",69)=""
 W @IOF,!?5,X,!?5,"*",?10,"C H S  DATA  SPLIT-OUT (EXPORT)  FOR: ",$E($$LOC^ACHS,1,25),?74,"*"
 W !?5,"*",?10,$E(DT,4,5),"-",$E(DT,6,7),"-",$E(DT,2,3),?22,"TRANSACTION  TOTALS  BY  FACILITY",?74,"*",!
 W ?5,"*",Y,"*",!?5,"* THE DESTINATION OF THESE DATA RECORDS IS: ",?74,"*",!
 W ?5,"*",?10,"United Financial Management System and BLUE CROSS/SHIELD OF NM",?74,"*",!
 W ?5,"*",Y,"*",!?5,"*",?10,"NAME OF FACILITY",?44,"NUMB TRNS",?60,"DOLLAR AMT",?74,"*",!?5,X,!!
 Q
EXIT ;
 I $D(IO("S")) S IOP="`"_IOS D ^%ZIS
 D ^%ZISC
 D HOME^%ZIS U IO
 K ACHSBRCT,ACHSBDCT,ACHSRCT,ACHSDCT,ACHSFIN,ACHSREC,ACHSBFBC,ACHSBFUF,ACHSBBC,ACHSUFMS,ACHSFAC,ASUFAC,ACHS
 K X,X2,X3,Y
 Q