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

ACHSACOA.m

Go to the documentation of this file.
ACHSACOA ; IHS/ITSC/TPF/PMF - AREA CONSOLIDATION (PT 2 OF ACHSACO) ;JUL 10, 2008
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**13,14,18,21**;JUN 11,2001;Build 43
 ;ACHS*3.1*13 6.14.2007 IHS/OIT/FCJ ADDED UFMS SUB FOR TOTAL RECORDS AND SENDING FILE
 ;ACHS*3.1*14 10.02.2007 IHS/OIT/FCJ CHG DOLLAR LENGHT IN UFMS BATCH TRAILER RECORD
 ;
XIT ;EP
 U IO(0)
 ;I $$DIR^XBDIR("E","Press <RETURN> to END") ;ACHS*3.1*21 REQUESTING A RETURN BELOW IN ACHSVAR
 I $D(ACHSPTR) S IO=ACHSPTR D ^%ZISC
END ;
 K DA,DIC,DIR,I,J,K,W,X,Y,Z
 D EN^XBVK("ACHS")
 S ACHSISAO=1 D ^ACHSVAR  ;ACHS*3.1*21 ADDED TEST FOR AREA VAR
 S %=$$DEL^%ZISH("/usr/spool/chsdata/","achs.cons.list")
 K ^TMP("ACHSACO",$J)
 Q
 ;
ABEND ;EP
 D ^%ZISC
 W "File Not Found",!!,"ABNORMAL END OF CHS CONSOLIDATION",!
 I $$DIR^XBDIR("E","Press <RETURN> To Continue...")
 D END
 Q
 ;
REPORT ;EP
 I '(IO(0)=ACHSPTR)!($D(ACHSPPO)) S ACHSIO=ACHSPTR D REPORT^ACHSACO2
 S ACHSIO=IO(0)
 K ACHSPPO,ACHSPPC
 ;
 D REPORT^ACHSACO2            ;AREA OFFICE CONSOLIDATION REPORT
 ;
 I $D(^ACHSSVR),$O(^ACHSSVR(0)) D
 .U IO(0)
 .W !!?10,"PRINTING VENDOR SPECIAL REPORTS",!
 .D ^ACHSSVRP     ;SELECT AND PRINT AO SPECIAL VENDOR REPORT
 ;
 D UFMS           ;ACHS*3.1*13 6.14.2007 IHS/OIT/FCJ SET HEADER AND TRAILER RECORDS FOR UFMS
 D FILEBLD        ;MOVE TO UNDOCUMENTED PARAMETER
 D SENDMSG        ;SEND MESSAGE TO MAIL GROUP    
 D XIT
 Q
 ;
FILEBLD ;
 I +ACHSZFAC("TOTAL")>0 G FILEBLDA
 U IO(0)
 W !!,"NO RECORDS CONSOLIDATED FROM FACILITIES ",!
 Q
 ;
FILEBLDA ;
 U IO(0)
 ;
 ;CHECK UNDOCUMENTED PIECE (PARAMETER)
 ;ACHS*3.1*21 COMMENTED OUT NEXT LINE WILL NOT SEND TO TAPE, QUIT IF NO ARCHIEVE DIRECTORY DEFINNED
 ;G:'$L($$AOP^ACHS(2,13)) CHSTAR
 D FILEDEL  ;ACHS*3.1*21 THIS IS CALLED FR CHSTAR SO MV'D HERE
 Q:'$L($$AOP^ACHS(2,13))
 ;
 ;UNDOCUMENTED PARAMETER
 W !!,"  moving your facility files to '",$$AOP^ACHS(2,13),"'..."
 ;
 ;ACHS*3.1*21  CHANGED $$IM^ACHS TO ACHSPTH AND PTH IS SET FOR 252611
 F ACHSI=1:1 Q:'$D(ACHSPLST(ACHSI))  D
 .W !,$P(ACHSPLST(ACHSI),U)
 .;I $$ASF^ACHS(DUZ(2))=252611 S X=$$MV^%ZISH($$EX^ACHS,$P(ACHSPLST(ACHSI),U),$$AOP^ACHS(2,13),$P(ACHSPLST(ACHSI),U))  ;ACHS*3.1*18
 .;E  S X=$$MV^%ZISH($$IM^ACHS,$P(ACHSPLST(ACHSI),U),$$AOP^ACHS(2,13),$P(ACHSPLST(ACHSI),U))                           ;ACHS*3.1*18
 .S X=$$MV^%ZISH(ACHSPTH,$P(ACHSPLST(ACHSI),U),$$AOP^ACHS(2,13),$P(ACHSPLST(ACHSI),U))
 ;
 Q
 ;
CHSTAR ;ASK OPERATOR ABOUT BACKING UP CHS PROCESSED FILES TO TAPE
 U IO(0)
 I '$$DIR^XBDIR("Y","Do you want to BACKUP processed CHS Facility Data to TAPE","Y","","","",1) D FILEDEL Q
 ;
FLCP1 ;
 U IO(0)
 W !
 ;
 ;ARCHIVE TO TAPE ????? mikey questioned whether this works
 S ACHSHCMD=("tar -cvft /dev/rct0 `cat /usr/spool/chsdata/achs.bk` ")
 ;
 ;IHS/ITSC/PMF  1/12/01  change call of vendor routine to call
 ;or routine in our namespace
 S ACHSRTCD=$$TERMINAL^ACHSHCMD(ACHSHCMD)      ;GET RETURN CODE
 ;
 I ACHSRTCD>0 W !!?3,"BACKUP WAS UNSUCCESSFUL - FILES NOT DELETED FROM /usr/spool/uucppublic",! Q
 ;
 ;
 ;ACHS*3.1*21 MODIFIED ENTIRE FILEDEL SECTION TO USE %ZISH AND USED ACHSPTH FOR THE DIRECTORY
FILEDEL ;DELETE FACILITY FILES PROCESSED FROM ACHSPTH
 Q  ;FILES ARE BEING MOVED TO ARCHIVED NOT COPIED..ACHS*3.1*21
 U IO(0)
 I '$$DIR^XBDIR("Y","Should CHS Facility Files processed from "_ACHSPTH_" be DELETED","N","","","",1) Q
 S L=0,L1=0,L2=0 F  S L=$O(ACHSPLST(L)) Q:L'?1N.N  D
 .S L1=$$DEL^%ZISH(ACHSPTH,ACHSPLST(L))
 .I L1>0 S L2=1
 I L2 W !,"ALL FILES COULD NOT BE DELETED"
 E  W !,"FILES DELETED...."
 ;
 Q
 ;
SENDMSG ;
 N XMSUB,XMDUZ,XMTEXT,XMY
 S XMB="ACHS AREA BALANCES"   ;MAIL GROUP
 S XMDUZ="CHS Area Office Consolidation",XMSUB="CHS Facility Account Balances."
 S XMTEXT="^TMP(""ACHSACO"",$J,"
 D ^XMB,KILL^XM
 Q
 ;ACHS*3.1*13 6.14.2007 IHS/OIT/FCJ
UFMS ;SET BATCH HEADER AND RECORD FOR THE UFMS FILE, SAVE AND SEND FILE;
 S X=$E(DT,4,7)_$E(DT,2,3)
 ;ACHS*3.1*14 10.02.2007 IHS/OIT/FCJ CHG 10 TO 11 IN NEXT LINE
 S ^ACHSUFMS("COUNT")="4BATCH"_X_"Z3"_$E(10000+^ACHSUFMS("COUNT"),2,5)_$J("",21)_"J"_$P(^AUTTSITE(1,0),U,2)_$J("",6)_$E(10000000000+^ACHSUFMS(0),2,11)_$J("",78)
 S ^ACHSUFMS(0)="1BATCH"_X_"Z3"_$J("",121)
 Q
 ;