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

AFSHCK1.m

Go to the documentation of this file.
AFSHCK1 ; IHS/OIRM/DSD/JDM -PART 2 OF GENERIC VARIABLE CHECK PROGRAM ;  [ 10/27/2004   4:20 PM ]
 ;;3.0T1;AO FINANCIAL DATA MGMT SYSTEM;**13**;FEB 02, 1999
 ;ACR*2.1*9
 Q  ;NOT AN ENTRY POINT
OHFSDOC ;;VARIABLES REQUIRED FOR OPENHFS CALL
 ;;
 ;;   %DEV      -- INITIALLY SET TO 51
 ;;   %FN       -- UNIX FILE NAME (FULL PATH IF NEC)
 ;;   AFSERMSG  -- CONTAINS ERROR MESSAGE
 ;;   Y         -- CONTAINS %ZISH COMPLETION CODE (0-4)
 ;;   %IN       -- OPEN PARAMETER (1=READ ONLY) DEFAULT VALUE
 ;;   %FO       --  FILE OFFSET (DEFAULT = 0)
OPENHFS(ZISH1,ZISH2,%DEV) ;PEP - OPEN A SPECIFIC UNIX FILE
 ;Returns %DEV or error message in AFSERMSG
 NEW N,ZISH3,Y                      ; ACR*2.1*13.01 IM13574
 I '$D(%IN) S %IN=1
 I '$D(%FO) S %FO=0
 ;S N=$L(%FN,"/") ;DETERMINE %FN # OF DELIMITED PIECES  ; ACR*2.1*13.01 IM13574
 ;S ZISH1=$P(%FN,"/",1,N-1)_"/"                ; ACR*2.1*13.01 IM13574
 ;S ZISH2=$P(%FN,"/",N)                        ; ACR*2.1*13.01 IM13574
 ;S ZISH3=$S(%IN=1:"R",%IN=0:"M",1:"R")        ; ACR*2.1*13.01 IM13574
 ;S Y=$$OPEN^%ZISH(ZISH1,ZISH2,ZISH3)          ; ACR*2.1*13.01 IM13574
 ;I Y'=0 S AFSERMSG="M10"                      ; ACR*2.1*13.01 IM13574
 ;E  S %DEV=IO                                 ; ACR*2.1*13.01 IM13574
 ;K N,ZISH1,ZISH2,ZISH3                        ; ACR*2.1*13.01 IM13574
 S ZISH3=$S(%IN=0:"W",1:"R")                   ; ACR*2.1*13.01 IM13574
 S Y=$$OPEN^%ZISH(ZISH1,ZISH2,ZISH3)           ; ACR*2.1*13.01 IM13574
 I Y'=0 S AFSERMSG="M10" Q                     ; ACR*2.1*13.01 IM13574
 S %DEV=IO                                     ; ACR*2.1*13.01 IM13574
 Q
ERROR ;EP
 G ERROREX:'$D(AFSERMSG)
 S X=$P($T(@AFSERMSG),";;",2)
 U IO(0) W !!,*7,?(80-$L(X)/2),X,!
 K DIR S DIR(0)="E",DIR("A")="Enter <RETURN> to Continue" D ^DIR
ERROREX S AFSJFLG=1 K AFSERMSG Q
BTRMDEF ;EP
 W !!!,"PROPER TERMINAL ATTRIBUTES MISSING  -  NOTIFY SITE MANAGER",!! H 3 Q
M1 ;;COMPUTER CENTER FOR TELECOMMUNICATIONS NOT CORRECTLY DEFINED
M2 ;;IHS COMM PARAMETERS NOT SET FOR THIS LOCATION
M3 ;;3780 TELECOMMUNICATIONS PORT NOT DEFINED
M4 ;;REMOTE NUMBER NOT DEFINED FOR THIS COMPUTER CENTER"
M5 ;;USER ID OR USER PASSWORD NOT DEFINED
M6 ;;DEFAULT 3780 COMMUNICATION PORT IN USE
M7 ;;ALL 3780 COMMUNICATION PORTS ARE BUSY
M8 ;;ALL UNIX HFS DEVICES ARE BUSY
M9 ;;PROGRAM AND/OR FUNCTION CANCELLED BY OPERATOR
M10 ;;OPEN FAILURE ON UNIX HFS FILE
M11 ;;DEFAULT PRINTER PORT NOT CORRECTLY DEFINED
M12 ;;PRINTER SET-UP ERROR -- NOTIFY SUPERVISOR
M13 ;;EXPORT AND/OR APPLICATION PARAMETERS NOT SET CORRECTLY
M14 ;;PACKAGE PREFIX NOT FOUND
CCTRID ;EP
 S AFSUXFNM=$S(AFSCCTR="DPS":"ddps",AFSCCTR="NIH":"nih",AFSCCTR="BCS":"bcbs",AFSCCTR="PCC":"pcc",1:" ")
 S AFSCCTRN=$S(AFSCCTR="DPS":"IHS Data Center (ALBQ)",AFSCCTR="NIH":"National Inst. of Hlth (Bethesda)",AFSCCTR="BCS":"Blue Cross / Shield (NM)",AFSCCTR="PCC":"Parklawn Computer Center (PCC)",1:"Z")
 Q
CCTRIDR ;EP
 I AFSCCTR'="PCC" S AFSRRTYP=$S(AFSCCTR="BCS":"B",AFSCCTR="NIH":"N",AFSCCTR="DPS":"I",1:"X"),Y=AFSRRTYP
 ;S AFSRRTYP=AFSRTYPE
 Q
CRTSETUP ;EP;                        ;ACR*2.1*13.02 IM13574
 I '$G(IOST(0)) D HOME^%ZIS  ;OIRM/DSD/JDM
 S XY=$P(^%ZIS(2,IOST(0),1),"^",5)
 I '$D(^%ZIS(1,IOS,"SUBTYPE")) G BTRMDEF
 I '$D(^%ZIS(1,IOS,"TYPE")) G BTRMDEF
 I ^%ZIS(1,IOS,"TYPE")'="TRM"&(^%ZIS(1,IOS,"TYPE")'="VTRM") G BTRMDEF
 I '$D(^%ZIS(2,IOST(0),5)) G BTRMDEF
 S AFSLE=$P(^%ZIS(2,IOST(0),5),"^",6)
 S AFSLE="W "_AFSLE
 S AFSRVON=$P(^%ZIS(2,IOST(0),5),"^",4)
 S AFSRVOF=$P(^%ZIS(2,IOST(0),5),"^",5)
 S X=0 X ^%ZOSF("RM")
 Q
 ;
CLOSE ;EP;TO CLOSE %ZISH OPENED DEVICE                ;ACR*2.1*13.01 IM13574
 D CLOSE^%ZISH()
 K IOP,IOPAR,%ZIS,ZTSK,ZTQUEUED,ZTREQ
 Q