INH4CONV ;DGH; 24 Apr 95 11:43
;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
;COPYRIGHT 1991-2000 SAIC
EN1 ;This makes necessary changes to interface globals for ver 4.4
;1) Converts existing "AH" x-ref of ^INLHFTSK to new format
;2) Transfers entries from server queues to primary interface queues
;
N T,PRIO,INTSK,TT,D,H,X,Y,Z
FORMAT ;Convert format queue, ^INLHFTSK.
;Old format -- ^INLHFTSK("AH",Time to process,INTSK)
;New format -- ^INLHFTSK("AH",Priority,Time,INTSK) and .06 field
;is FORMAT PRIORITY
G:'$D(^INLHFTSK("AH")) SERVER
S T="" F S T=$O(^INLHFTSK("AH",T)) Q:'T D
.S INTSK="" F S INTSK=$O(^INLHFTSK("AH",T,INTSK)) Q:'INTSK D
..;Look up FORMAT PRIORITY from Tran Type file,
..S TT=$P($G(^INLHFTSK(INTSK,0)),U)
..S PRIO=$S('TT:0,1:+$P($G(^INRHT(TT,0)),U,14))
..S ^INLHFTSK("AH",PRIO,T,INTSK)=""
..K ^INLHFTSK("AH",T,INTSK)
;
SERVER ;Transfer entries, if any, from format controller,
;^INLHFTSK("SRVR",time to process,INTSK)
G:'$D(^INLHFTSK("SRVR")) OUTPUT
S H="" F S H=$O(^INLHFTSK("SRVR",H)) Q:'$L(H) D
.S INTSK="" F S INTSK=$O(^INLHFTSK("SRVR",H,INTSK)) Q:'INTSK D
..S TT=$P($G(^INLHFTSK(INTSK,0)),U)
..S PRIO=$S('TT:0,1:+$P($G(^INRHT(TT,0)),U,14))
..S ^INLHFTSK("AH",PRIO,T,INTSK)=""
K ^INLHFTSK("SRVR")
;
OUTPUT ;Transfer entries, if any, from output controller, ^INLHSCH("SRVR"
G:'$D(^INLHSCH("SRVR")) EXIT
S X="" F S X=$O(^INLHSCH("SRVR",X)) Q:X="" D
. S Y="" F S Y=$O(^INLHSCH("SRVR",X,Y)) Q:'Y D
.. S Z="" F S Z=$O(^INLHSCH("SRVR",X,Y,Z)) Q:'Z D
... S ^INLHSCH(X,Y,Z)="",D=$P($G(^INTHU(Z,0)),U,2)
... K ^INLHSCH("SRVR",X,Y,Z)
;
EXIT Q
INH4CONV ;DGH; 24 Apr 95 11:43
+1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
+2 ;COPYRIGHT 1991-2000 SAIC
EN1 ;This makes necessary changes to interface globals for ver 4.4
+1 ;1) Converts existing "AH" x-ref of ^INLHFTSK to new format
+2 ;2) Transfers entries from server queues to primary interface queues
+3 ;
+4 NEW T,PRIO,INTSK,TT,D,H,X,Y,Z
FORMAT ;Convert format queue, ^INLHFTSK.
+1 ;Old format -- ^INLHFTSK("AH",Time to process,INTSK)
+2 ;New format -- ^INLHFTSK("AH",Priority,Time,INTSK) and .06 field
+3 ;is FORMAT PRIORITY
+4 IF '$DATA(^INLHFTSK("AH"))
GOTO SERVER
+5 SET T=""
FOR
SET T=$ORDER(^INLHFTSK("AH",T))
IF 'T
QUIT
Begin DoDot:1
+6 SET INTSK=""
FOR
SET INTSK=$ORDER(^INLHFTSK("AH",T,INTSK))
IF 'INTSK
QUIT
Begin DoDot:2
+7 ;Look up FORMAT PRIORITY from Tran Type file,
+8 SET TT=$PIECE($GET(^INLHFTSK(INTSK,0)),U)
+9 SET PRIO=$SELECT('TT:0,1:+$PIECE($GET(^INRHT(TT,0)),U,14))
+10 SET ^INLHFTSK("AH",PRIO,T,INTSK)=""
+11 KILL ^INLHFTSK("AH",T,INTSK)
End DoDot:2
End DoDot:1
+12 ;
SERVER ;Transfer entries, if any, from format controller,
+1 ;^INLHFTSK("SRVR",time to process,INTSK)
+2 IF '$DATA(^INLHFTSK("SRVR"))
GOTO OUTPUT
+3 SET H=""
FOR
SET H=$ORDER(^INLHFTSK("SRVR",H))
IF '$LENGTH(H)
QUIT
Begin DoDot:1
+4 SET INTSK=""
FOR
SET INTSK=$ORDER(^INLHFTSK("SRVR",H,INTSK))
IF 'INTSK
QUIT
Begin DoDot:2
+5 SET TT=$PIECE($GET(^INLHFTSK(INTSK,0)),U)
+6 SET PRIO=$SELECT('TT:0,1:+$PIECE($GET(^INRHT(TT,0)),U,14))
+7 SET ^INLHFTSK("AH",PRIO,T,INTSK)=""
End DoDot:2
End DoDot:1
+8 KILL ^INLHFTSK("SRVR")
+9 ;
OUTPUT ;Transfer entries, if any, from output controller, ^INLHSCH("SRVR"
+1 IF '$DATA(^INLHSCH("SRVR"))
GOTO EXIT
+2 SET X=""
FOR
SET X=$ORDER(^INLHSCH("SRVR",X))
IF X=""
QUIT
Begin DoDot:1
+3 SET Y=""
FOR
SET Y=$ORDER(^INLHSCH("SRVR",X,Y))
IF 'Y
QUIT
Begin DoDot:2
+4 SET Z=""
FOR
SET Z=$ORDER(^INLHSCH("SRVR",X,Y,Z))
IF 'Z
QUIT
Begin DoDot:3
+5 SET ^INLHSCH(X,Y,Z)=""
SET D=$PIECE($GET(^INTHU(Z,0)),U,2)
+6 KILL ^INLHSCH("SRVR",X,Y,Z)
End DoDot:3
End DoDot:2
End DoDot:1
+7 ;
EXIT QUIT