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

INHB1.m

Go to the documentation of this file.
  1. INHB1(INBPN) ; cmi/flag/maw - JSH 11 Feb 93 12:15 Interface - routine to run a Background Process 07 Oct 91 6:44 AM ; [ 08/09/2001 9:38 AM ]
  1. ;;3.01;BHL IHS Interfaces with GIS;;JULY 1, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. ;INBPN = entry # in Background Process Control file (#4004)
  1. X $G(^INTHOS(1,2))
  1. Q:'$G(INBPN) Q:'$D(^INTHPC(INBPN,0)) Q:'$G(^INRHSITE(1,"ACT"))
  1. K INHER S X="ERROR^INHB1",@^%ZOSF("TRAP")
  1. L +^INRHB("RUN",INBPN):0 E Q
  1. S ^INRHB("RUN",INBPN)=$H K ^INTHPC(INBPN,2)
  1. ;cmi/flagstaff/maw mods here for duz 8/9/2001
  1. ;S U="^",DUZ=.5,DUZ(0)="@",IO="" ;cmi/maw orig 8/9/2001
  1. S INHLDUZ=$O(^VA(200,"B","GIS,USER",0))
  1. S DUZ=$S($G(INHLDUZ):INHLDUZ,1:DUZ)
  1. S U="^",DUZ(0)="@",IO=""
  1. ;cmi/flagstaff/maw end of mods
  1. S DIE="^INTHPC(",DA=INBPN,DR=".04///^S X=$J;.05///NOW" D ^DIE
  1. S X=$$PRIO X:X ^%ZOSF("PRIORITY")
  1. S X=$P(^INTHPC(INBPN,0),U,3) I X,$D(^%ZIS(1,X,0)) S %ZIS="0",IOP=$P(^%ZIS(1,X,0),U)_";0;99999" D ^%ZIS I POP S INHER="Could not open device: "_$P(^%ZIS(1,X,0),U) G ERROR
  1. S ROU=$G(^INTHPC(INBPN,"ROU")) I ROU="" S INHER="No routine specified." G ERROR
  1. S:ROU'["^" ROU="^"_ROU
  1. U:IO]"" IO D @ROU
  1. ;
  1. QUIT ;Background program termination point
  1. L -^INRHB("RUN",INBPN) Q
  1. ;
  1. ERROR ;Process errors
  1. S X="HALT^INHB1",@^%ZOSF("TRAP") X ^INTHOS(1,3)
  1. K ^INRHB("RUN",INBPN)
  1. S:'$D(^INTHPC(INBPN,2,0)) ^(0)="^4004.01D^^"
  1. S DIC="^INTHPC("_INBPN_",2,",DIC(0)="L",DA(1)=INBPN,X="""NOW""" D ^DIC Q:Y<0
  1. S ^INTHPC(INBPN,2,+Y,1)=$S($D(INHER):INHER,1:$$ERRMSG^INHU1)
  1. D ENR^INHE(INBPN,$S($D(INHER):INHER,1:$$ERRMSG^INHU1))
  1. Q
  1. ;
  1. HALT ;Just halt
  1. K ^INRHB("RUN",INBPN) H
  1. ;
  1. PRIO() ;Function which returns priority for this process
  1. I $P(^INTHPC(INBPN,0),U,6)]"" Q $P(^(0),U,6)
  1. Q $P($G(^INRHSITE(1,0)),U,6)