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

ASUMXDIO.m

Go to the documentation of this file.
ASUMXDIO ; IHS/ASDST/WAR -INDEX MASTER I/O ;  
 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
 ;;4.2T1;SUPPLY ACCOUNTING MGMT SYSTEM;;JAN 28, 2000
 ;;This routine is a utility routine which provides an entry point to
 ;;read (retreve) data from the SAMS Index Master file.
 ;;(in global ^ASUMX & VA Fileman file ASUMST INDEX)
READ ;EP; TO SET INDEX MASTER FIELDS
 ;ASUMX("E#","IDX") (INDEX) MUST BE SET
 Q:'$D(ASUMX("E#","IDX"))
 I ASUMX("E#","IDX")'?8N S X=ASUMX("E#","IDX") D DIX^ASUMDIRM(.X) Q:Y<0
 S ASUMX(0)=$G(^ASUMX(ASUMX("E#","IDX"),0))
 S ASUMX(2)=$G(^ASUMX(ASUMX("E#","IDX"),2))
 S ASUMX("IDX")=$P(ASUMX(0),U)
 ;  ** LMH 6/13/00 NXT. LN. QUITS IF DELETED MSTR. INDEX ITEM **
 Q:ASUMX("IDX")=""
 I ASUMX("IDX")']"" D
 .S ASUF("NOMST")=1,ASUMX("DESC")=""
 E  D
 .I ASUMX("IDX")[999999!(ASUMX("IDX")="")  D
 ..S ASUF("DLIDX")=1
 ..S ASUMX("DESC")=""
 .E  D
 ..S ASUMX("DESC")=$P(ASUMX(0),U,2)
 ..I ASUMX("IDX")'=$E(ASUMX("E#","IDX"),3,8) D
 ...W *7,!!,"***** PANIC -INDEX MASTER IS CORRUPTED !! -CAN NOT CONTINUE ******",!!!,"******** CALL YOUR SITE MANAGER TO HAVE CORRECTIVE ACTION PERFORMED ********"
 ...S ASUP("HLT")=1
 S ASUMX("DESC",1)=$E(ASUMX("DESC"),1,30)
 S ASUMX("DESC",2)=$E(ASUMX("DESC"),31,62)
 S ASUMX("AR U/I")=$P(ASUMX(0),U,4)
 S ASUMX("BCD")=$P(ASUMX(0),U,3)
 S ASUMX("NSN")=$P(ASUMX(0),U,5)
 N X D
 .S (X,ASUMX("ACC"))=$P(ASUMX(0),U,6) D ACC^ASULDIRF(X)
 .S (X,ASUMX("SOBJ"))=$P(ASUMX(0),U,7) D SSO^ASULDIRF(X)
 .S (X,ASUMX("CAT"))=$P(ASUMX(0),U,8) D CAT^ASULDIRF(X)
 S ASUMX("ESTB")=$P(ASUMX(0),U,9)
 S ASUMX("DELIX")=$P(ASUMX(2),U)
 S ASUMX("DELDS")=$P(ASUMX(2),U,2)
 S ASUMX("DELDT")=$P(ASUMX(2),U,3)
 Q
XK ;EP; TO KILL INDEX MASTER FIELDS
 K ASUMX("E#","IDX")
XKF ;EP; TO KILL INDEX MASTER DATA FIELDS ONLY
 K ASUMX
 Q
IDX(X) ;EP ;WITH PARAMATER
 S ASUMX("E#","IDX")=X
 G READ
WRITE ;EP; WRITE INDEX MASTER
 I ASUT("TRCD")="4A" D
 .S ASUMX("IDX")=$E(ASUT("IXA","IDX","PT"),3,8)
 .S ASUMX("E#","IDX")=ASUT("IXA","IDX","PT")
 .S ASUMX("DESC")=ASUT("IXA","DESC")
 .S ASUMX("AR U/I")=ASUT("IXA","AR U/I")
 .S ASUMX("BCD")=ASUT("IXA","BCD")
 .S ASUMX("NSN")=ASUT("IXA","NSN")
 .S ASUMX("ACC")=ASUT("IXA","ACC")
 .S ASUMX("SOBJ")=ASUT("IXA","SOBJ")
 .S ASUMX("CAT")=ASUT("IXA","CAT")
 .S ASUMX("ESTB")=ASUT("IXA","DTE")
 .S (ASUMX("DELIX"),ASUMX("DELDS"),ASUMX("DELDT"))=""
 Q:'$D(ASUMX("E#","IDX"))
 S $P(ASUMX(0),U)=ASUMX("IDX")
 S $P(ASUMX(0),U,2)=$G(ASUMX("DESC"))
 S $P(ASUMX(0),U,4)=ASUMX("AR U/I")
 S $P(ASUMX(0),U,3)=ASUMX("BCD")
 S $P(ASUMX(0),U,5)=ASUMX("NSN")
 S $P(ASUMX(0),U,6)=ASUMX("ACC")
 S $P(ASUMX(0),U,7)=ASUMX("SOBJ")
 S $P(ASUMX(0),U,8)=ASUMX("CAT")
 S $P(ASUMX(0),U,9)=ASUMX("ESTB")
 S $P(ASUMX(0),U,11)=$E(ASUMX("E#","IDX"),1,2)
 S $P(ASUMX(2),U)=ASUMX("DELIX")
 S $P(ASUMX(2),U,2)=ASUMX("DELDS")
 S $P(ASUMX(2),U,3)=ASUMX("DELDT")
U ;EP ; WRITE INDEX MASTER
 S ^ASUMX(ASUMX("E#","IDX"),0)=ASUMX(0)
 S ^ASUMX(ASUMX("E#","IDX"),2)=ASUMX(2)
 S DA=ASUMX("E#","IDX"),DIK="^ASUMX(" D IX^DIK
 Q