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

ACRFSYS.m

Go to the documentation of this file.
ACRFSYS ;IHS/OIRM/DSD/AEF/MRS - VARIOUS ARMS SYSTEM UTILITY SUBROUTINES [ 10/27/2004   4:18 PM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**13**;NOV 05, 2001
 ;NEW ROUTINE ACR*2.1*13.06
AREA(X) ;EP -- RETURNS INTERNAL AREA SYSTEM FOR FMS SUPPLIES AND SERVICES FILE
 ;
 ;      Used by Function ACRFSSAREA, which is used by trigger on
 ;      COMMON ACCOUNTING NUMBER field of FMS Supplies and Services file
 ;      to trigger the AREA SYSTEM field.
 ;
 ;      Input:
 ;      X  =  IEN OF FMS SUPPLIES AND SERVICES FILE ENTRY
 ;
 ;      Output:
 ;      X  =  INTERNAL AREA IN FMS SYSTEM DEFAULTS FILE
 ;
 I $P($G(^ACRSS(X,0)),U,5)="" S X="" Q X
 I $P($G(^ACRCAN($P($G(^ACRSS(X,0)),U,5),0)),U,7)="" S X="" Q X
 I $P($G(^AUTTLCOD($P($G(^ACRCAN($P($G(^ACRSS(X,0)),U,5),0)),U,7),0)),U,3)="" S X="" Q X
 S X=$P($G(^AUTTACPT($P($G(^AUTTLCOD($P($G(^ACRCAN($P($G(^ACRSS(X,0)),U,5),0)),U,7),0)),U,3),0)),U,2)
 S X=$O(^ACRSYS("B",X,0))
 I 'X S X=""
 Q X
 ;
SYS(X) ;EP -- RETURNS FMS SYSTEM DEFAULTS ENTRY IEN FOR PURCHASING OFFICE
 ;
 ;      X = FMS PURCHASING OFFICE IEN
 ;
 N Y
 S Y=1
 I 'X Q Y
 I '$P($G(^ACRPO(X,0)),U,19) Q Y
 S Y=$P(^ACRPO(X,0),U,19)
 Q Y
 ;
ARMSDIR(X)         ;EP;
 ;----- EXTRINSIC FUNCTION TO RETURN ARMS DEFAULT DIRECTORY FROM
 ;      FMS SYSTEMS DEFAULTS FILE
 ;   X= SYSTEM NUMBER IN FMS SYSTEM DEFAULT FILE CURRENTLY ALWAYS 1
 ;      UNTIL SYSTEM BECOMES FULLY MULTIREGIONAL
 ; WRITES ERROR MESSAGE WHEN DIRECTORY PATH IS UNDEFINED IN
 ;          ^ACRSYS(X,402),U,3)
 ;
 N Y
 S Y=$P($G(^ACRSYS(X,402)),U,3)
 I Y']"" D
 .W !?5,*7,"ARMS DIRECTORY IS UNDEFINED IN THE FMS SYSTEM DEFAULTS,"
 .W ?5,"FILE, PLEASE NOTIFY ARMS MANAGER"
 Q Y
 ;
ODDPATH(X)         ;EP; EXTRINSIC FUNCTION
 ;RETURNS OPEN DOCUMENT EXPORT/IMPORT PATH NAME
 ;     X= SYSTEM NUMBER IN FMS SYSTEM DEFAULT FILE
 ;        CURRENTLY ALWAYS 1
 ;        UNTIL SYSTEM BECOMES FULLY MULTIREGIONAL
 ;
 N Y,Z
 S Z=$P($G(^ACRSYS(X,301)),U)
 I Z']"" D  Q Z
 .W !?5,*7,"OPEN DOCUMENT DOWNLOAD DIRECTORY IS UNDEFINED IN THE"
 .W !?5,"FMS SYSTEM DEFAULTS FILE, PLEASE NOTIFY ARMS MANAGER"
 D JCMD^ACRFUTL("cd "_Z,.Y)
 I Y D
 . W !,"No such directory "_Z
 . S Z=""
 . D PAUSE^ACRFWARN
 Q Z