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

ACHSTCK1.m

Go to the documentation of this file.
ACHSTCK1 ; IHS/ITSC/PMF - CHS TELECOMMUNICATION PROGRAM ; [ 10/31/2003  11:57 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**5,7,21**;JUNE 11, 2001;Build 43
 ;IHS/SET/GTH ACHS*3.1*5 12/06/2002 - Replace direct ref to non-package global.
 ;ITSC/SET/JVK ACHS*3.1*7 7/21/03 - Replace code for Cache
 ;ACHS*3.1*21 ADDED M15 ERROR MESSAGE
 Q  ;NOT AN ENTRY POINT
 ;
OHFSDOC ;;VARIABLES REQUIRED FOR OPENHFS CALL
 ;;
 ;;   ACHSZDEV      -- IF OPEN SUCCESSFUL, RETURNS DEVICE NUMBER
 ;;   ACHSZFN       -- FILE NAME (FULL PATH IF NEC)
 ;;   ACHSEMSG      -- CONTAINS ERROR MESSAGE
 ;;   ACHSZZA       -- CONTAINS COMPLETION CODE (NON-ZERO = ERROR)
 ;;   ACHSZIN       -- OPEN PARAMETER (1=READ ONLY) DEFAULT VALUE
 ;;   ACHSZFO       -- FILE OFFSET (DEFAULT = 0)
 ;
OPENHFS ;EP
 ;S ACHSEMSG="",ACHSZZA=0,ACHSZDEV=50;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 S ACHSEMSG="",ACHSZZA=0,ACHSZDEV=0 ;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 ;by starting at 50 instead of 0, we skip over several
 ;devices we DON'T want ;IHS/SET/GTH ACHS*3.1*5 12/06/2002 Except "50" is MSM specific.
 ;
 I '$D(ACHSZIN) S ACHSZIN=1
 I '$D(ACHSZFO) S ACHSZFO=0
OPENHFSA ; 
 S ACHSZDEV=$O(^%ZIS(1,ACHSZDEV))
 G OPENEND:+ACHSZDEV=0
 ;I $D(^%ZIS(1,ACHSZDEV,"TYPE"))'=1 G OPENHFSA;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 ;G OPENHFSC:^%ZIS(1,ACHSZDEV,"TYPE")="HFS";IHS/SET/GTH ACHS*3.1*5 12/06/2002
 ;G OPENHFSC:$$GET1^DIQ(3.5,ACHSZDEV,2,"I")="HFS" ;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 I $$GET1^DIQ(3.5,ACHSZDEV,2,"I")="HFS",$$GET1^DIQ(3.5,ACHSZDEV,.01,"I")="HFS" G OPENHFSC ;IHS/SET/JVK ACHS*3.1*7 7/2/2003
 G OPENHFSA
 ;
OPENHFSC ;
 ;IHS/SET/JVK ACHS*3.1*7 7/2/2003 REPLACE ORIGINAL CODE WITH NXT 8 LNS.
 S ZISH1=$P(ACHSZFN,"/",1,4)_"/"
 S ZISH2=$P(ACHSZFN,"/",5)
 S ZISH3=$S(ACHSZIN=1:"R",ACHSZIN=0:"W",1:"R")
 S Y=$$OPEN^%ZISH(ZISH1,ZISH2,ZISH3)
 U IO S ACHSZZA=$$STATUS^%ZISH
 I ACHSZZA S ACHSEMSG="M10" D CLOSE^%ZISH
 E  S ACHSZDEV=IO
 Q
 ;IHS/SET/JVK ACHS*3.1*7 END NEW CODE
 ;I '$D(ACHSZDLM),ACHSZIN=1 S %ZIS("IOPAR")="("""_ACHSZFN_""":""R"":"""_ACHSZFO_""")"
 ;I $D(ACHSZDLM),ACHSZIN=1 S %ZIS("IOPAR")="("""_ACHSZFN_""":""R"":"""_ACHSZFO_""":::"""_ACHSZDLM_""")"
 ;I '$D(ACHSZDLM),ACHSZIN'=1 S %ZIS("IOPAR")="("""_ACHSZFN_""":""M"":"""_ACHSZFO_""")"
 ;I $D(ACHSZDLM),ACHSZIN'=1 S %ZIS("IOPAR")="("""_ACHSZFN_""":""M"":"""_ACHSZFO_""":::"""_ACHSZDLM_""")"
 ;S IOP=$P(^%ZIS(1,ACHSZDEV,0),U) ;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 ;S IOP=$$GET1^DIQ(3.5,ACHSZDEV,.01) ;IHS/SET/GTH ACHS*3.1*5 12/06/2002
 ;D ^%ZIS
 ;I POP G OPENHFSA
 ;U IO S ACHSZZA=$$STATUS^%ZISH
 ;I ACHSZZA S ACHSEMSG="M10" D ^%ZISC
 ;S ACHSZDEV=IO
 ;Q
 ;
OPENEND ;
 S ACHSEMSG="M8",ACHSZZA=-1
 Q
 ;
ERROR ;EP
 I '$D(ACHSEMSG) D ERROREX Q
 S X=$P($T(@ACHSEMSG),";;",2)
 D HOME^%ZIS
 U IO(0)
 W !!,*7,$$C^XBFUNC(X,80),!
 I $$DIR^XBDIR("E","Enter <RETURN> to Continue")
ERROREX ;
 S ACHSJFLG=1
 K ACHSEMSG
 Q
 ;
CRTSETUP ;EP
 D HOME^%ZIS
 S ACHSXY=$P(^%ZIS(2,IOST(0),1),U,5)
 I '$D(^%ZIS(1,IOS,"SUBTYPE")) G BTRMDEF
 I '$D(^%ZIS(1,IOS,"TYPE")) G BTRMDEF
 I ^%ZIS(1,IOS,"TYPE")'="TRM" G BTRMDEF
 I '$D(^%ZIS(2,IOST(0),5)) G BTRMDEF
 S ACHSLE=$P(^%ZIS(2,IOST(0),5),U,6)
 S ACHSLE="W "_ACHSLE
 S ACHSRVON=$P(^%ZIS(2,IOST(0),5),U,4)
 S ACHSRVOF=$P(^%ZIS(2,IOST(0),5),U,5)
 S X=0 X ^%ZOSF("RM")
 Q
 ;
BTRMDEF ;
 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 HFS DEVICES ARE BUSY
M9 ;;PROGRAM AND/OR FUNCTION CANCELLED BY OPERATOR
M10 ;;OPEN FAILURE ON 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 in IHS COMMUNICATIONS PARAMETERS file
M15 ;;No Files to process