11:43 PM  24-FEB-99
broker 1.1
XWBBRK
XWBBRK ;ISC-SF/EG - DHCP BROKER PROTOYPE ;08/20/96  14:30
 ;;1.1T3;RPC BROKER;;Nov 25, 1996
 ;
PRSP(P) ;Parse Protocol
 ;M Extrinsic Function
 ;
 ;Inputs
 ;P        Protocol string with the form
 ;         Protocol := Protocol Header^Message where
 ;         Protocol Header := LLLWKID;WINH;PRCH;WISH;MESG
 ;           LLL  := length of protocol header (3 numeric)
 ;           WKID := Workstation ID (ALPHA)
 ;           WINH := Window handle (ALPHA)
 ;           PRCH := Process handle (ALPHA)
 ;           WISH := Window server handle (ALPHA)
 ;           MESG := Unparsed message
 ;Outputs
 ;ERR      0 for success, "-1^Text" if error
 ;
 N ERR,C,M,R,X,U
 S U="U",R=0,C=";"
 S M=512 ;Maximum buffer input
 S ERR=0
 IF $E(P,1,5)="{XWB}" S P=$E(P,6,$L(P)) ;drop out prefix
 IF '+$G(P) S ERR="-1^Required input reference is NULL"
 IF +ERR=0 D
 . S XWB(R,"LENG")=+$E(P,1,3)
 . S X=$E(P,4,XWB(R,"LENG")+3)
 . S XWB(R,"MESG")=$E(P,XWB(R,"LENG")+4,M)
 . S XWB(R,"WKID")=$P(X,C)
 . S XWB(R,"WINH")=$P(X,C,2)
 . S XWB(R,"PRCH")=$P(X,C,3)
 . S XWB(R,"WISH")=$P(X,C,4)
 Q ERR
 ;
PRSM(P) ;Parse message
 ;M Extrinsic Function
 ;
 ;Inputs
 ;P        Message string with the form
 ;         Message := Header^Content
 ;           Header  := LLL;FLAG
 ;             LLL     := length of entire message (3 numeric)
 ;             FLAG    := 1 indicates variables follow
 ;           Content := Contains API call information
 ;Outputs
 ;ERR      0 for success, "-1^Text" if error
 N C,ERR,M,R,X,U
 S U="^",R=1,C=";"
 S M=512 ;Max buffer
 S ERR=0
 IF '+$G(P) S ERR="-1^Required input reference is NULL"
 IF +ERR=0 D
 . S XWB(R,"LENG")=+$E(P,1,5)
 . S XWB(R,"FLAG")=$E(P,6,6)
 . S XWB(R,"TEXT")=$E(P,7,M)
 Q ERR
 ;
PRSA(P) ;Parse API information, get calling info
 ;M Extrinsic Function
 ;Inputs
 ;P        Content := API Name^Param string
 ;           API     := .01 field of API file
 ;           Param   := Parameter information
 ;Outputs
 ;ERR      0 for success, "-1^Text" if error
 ;
 N C,DR,ERR,M,R,T,X,U
 S U="^",R=2,C=";"
 S M=512 ;Max buffer
 S ERR=0
 IF '+$L(P) S ERR="-1^Required input reference is NULL"
 IF +ERR=0 D
 . S XWB(R,"CAPI")=$P(P,U)
 . S XWB(R,"PARM")=$E(P,$F(P,U),M)
 . S T=$O(^XWB(8994,"B",XWB(R,"CAPI"),0))
 . S T(0)=$G(^XWB(8994,T,0))
 . S XWB(R,"NAME")=$P(T(0),"^")
 . S XWB(R,"RTAG")=$P(T(0),"^",2)
 . S XWB(R,"RNAM")=$P(T(0),"^",3)
 . S XWBPTYPE=$P(T(0),"^",4)
 . S XWBWRAP=+$P(T(0),"^",8)
 Q ERR
 ;
PRSB(P) ;Parse Parameter information
 ;M Extrinsic Function
 ;Inputs
 ;P        Param   := M parameter list
 ;           Param   := LLL,Name,Value
 ;             LLL     := length of variable name and value
 ;             Name    := name of M variable
 ;             Value   := a string
 ;Outputs
 ;ERR      0 for success, "-1^Text" if error
 ;
 N A,ERR,F,FL,I,K,L,M,P1,P2,P3,P4,P5,MAXP,R
 S R=3
 S MAXP=+$E(P,1,5)
 S P1=$E(P,6,MAXP+5) ;only param string
 S ERR=0
 S F=3,M=512
 IF '+$D(P) S ERR="-1^Required input reference is NULL"
 S FL=+$G(XWB(1,"FLAG"))
 S I=0
 IF '+ERR D
 . ;IF 'FL S P1=$E(P,F+1,MAXP) Q
 . IF 'FL,+MAXP=0 S P1="",ERR=1 Q
 . F  D  Q:P1=""
 . . Q:P1=""
 . . S L=+$E(P1,1,3)-1
 . . S P3=+$E(P1,4,4)
 . . S P1=$E(P1,5,MAXP)
 . . S XWB(R,"P",I)=$S(P3'=1:$E(P1,1,L),1:$$GETV($E(P1,1,L)))
 . . IF FL=1 D
 . . . S A=$$OARY^XWBBRK2,XWBARY=A
 . . . S XWB(R,"P",I)=$$CREF^XWBBRK2(A,XWB(R,"P",I))
 . . S P1=$E(P1,L+1,MAXP)
 . . S K=I,I=I+1
 . IF 'FL Q
 . S P3=P
 . S L=+$E(P3,1,5)
 . S P1=$E(P3,F+3,L+F)
 . ;IF FL=1 S P1=$$CREF^XWBBRK2(A,P1) ;convert array ref to namespace ref
 . S P2=$E(P3,L+F+3,M)
 . ;instantiate array
 . S DUMMY=0
 . F  D  Q:+L=0
 . . S L=$$BREAD(3) Q:+L=0  S P3=$$BREAD(L)
 . . S L=$$BREAD(3) IF +L'=0 S P4=$$BREAD(L)
 . . IF +L=0 Q
 . . ;E  S L=3,P4=$$BREAD(L) IF P4=0 S P4=""
 . . IF P3=0,P4=0 S L=0 Q
 . . IF FL=1 D LINST(A,P3,P4)
 . . IF FL=2 D GINST
 . . S DUMMY=DUMMY+1
 IF ERR Q P1
 S P1=""
 D  Q P1
 . F I=0:1:K D
 . . IF FL,$E(XWB(R,"P",I),1,1)="." D  Q
 . . . S P1=P1_"."_$E(XWB(R,"P",I),2,$L(XWB(R,"P",I)))
 . . . IF I'=K S P1=P1_","
 . . S P1=P1_"XWB("_R_",""P"","_I_")"
 . . IF I'=K S P1=P1_","
 IF '+ERR Q P1
 Q ERR
 ;
BREAD(L) ;read tcp buffer, L is length
 N E,X,DONE
 S (E,DONE)=0
 R X#L:XWBTIME
 S E=X
 IF $L(E)<L F  D  Q:'DONE
 . IF $L(E)=L S DONE=1 Q
 . R X#(L-$L(E)):XWBTIME
 . S E=E_X
 Q E
 ;
CALLP(XWBP,P,DEBUG) ;make API call using Protocol string
 N ERR,S
 S ERR=0
 IF '$D(DEBUG) S DEBUG=0
 IF 'DEBUG D:$D(XRTL) T0^%ZOSV ;start RTL
 S ERR=$$PRSP^XWBBRK(P)
 IF '+ERR S ERR=$$PRSM^XWBBRK(XWB(0,"MESG"))
 IF '+ERR S ERR=$$PRSA^XWBBRK(XWB(1,"TEXT"))
 IF '+ERR S S=$$PRSB^XWBBRK(XWB(2,"PARM"))
 ;IF (+S=0)!(+S>0) D
 D CHKPRMIT^XWBSEC(XWB(2,"CAPI")) ;checks if RPC allowed to run
 S:$L(XWBSEC) ERR="-1^"_XWBSEC
 IF 'DEBUG S:$D(XRT0) XRTN="RPC BROKER READ/PARSE" D:$D(XRT0) T1^%ZOSV ;stop RTL
 IF '+ERR,(+S=0)!(+S>0) D
 . D CAPI^XWBBRK2(.XWBP,XWB(2,"RTAG"),XWB(2,"RNAM"),S)
 IF 'DEBUG K XWB
 IF $D(XWBARY) K @XWBARY,XWBARY
 Q
 ;
LINST(A,X,XWBY) ;instantiate local array
 IF XWBY=$C(1) S XWBY=""
 S X=A_"("_X_")"
 S @X=XWBY
 Q
GINST ;instantiate global
 N DONE,N,T,T1
 S (DONE,I)=0
 ;find piece with global ref - recover $C(44)
 S REF=$TR(REF,$C(23),$C(44))
 F  D  Q:DONE
 . S N=$NA(^TMP("XWB",$J,$P($H,",",2)))
 . S XWB("FRM")=REF
 . S XWB("TO")=N
 . IF '$D(@N) S DONE=1 Q
 ;loop through all and instantiate
 S DONE=0
 F  D  Q:DONE
 . S T=$E(@REF@(I),4,M)
 . IF T="" S DONE=1 Q
 . S @N@("XWB")="" ;set naked indicator
 . S @T
 . S I=I+1
 K @N@("XWB")
 Q
 ;
GETV(V) ;get value of V - reference parameter
 N X
 S X=V
 IF $E(X,1,2)="$$" Q ""
 IF $C(34,36)[$E(V) X "S V="_V
 E  S V=@V
 Q V

XWBBRK2
XWBBRK2 ;ISC-SF/EG - DHCP BROKER PROTOYPE [ 03/17/97  5:49 PM ]
 ;;1.1T3;RPC BROKER;;Nov 25, 1996
CAPI(XWBY,TAG,NAM,PAR) ;make API call
 N R,T,DX,DY
 IF XWB(1,"FLAG")=2 D
 . S PAR=$P(PAR,XWB("FRM"))_XWB("TO")_$P(PAR,XWB("FRM"),2)
 S R=$S(PAR'=+PAR&(PAR=""):TAG_"^"_NAM_"(.XWBY)",1:TAG_"^"_NAM_"(.XWBY,"_PAR_")")
 D:$D(XRTL) T0^%ZOSV ;start RTL
 ;U XWBNULL ;IHS/HMW Uncomment when NULL Device stuff figured out
 D @R
 S:$D(XRT0) XRTN=XWB(2,"NAME") D:$D(XRT0) T1^%ZOSV ;stop RTL
 ;once call is completed, write buffer should be empty, make it so!
 S DX=0,DY=0 X ^%ZOSF("XY")
 U XWBTDEV
 Q
 ;
BHDR(WKID,WINH,PRCH,WISH) ;Build a protocol header
 N S,L
 S S=""
 S S=WKID_";"_WINH_";"_PRCH_";"_WISH_";"
 S L=$L(S)
 S S=$E("000"_L,$L(L)+1,$L(L)+3)_S
 Q S
 ;
BARY(A,R,V) ;add array elements+values to storage array
 IF A'["XWBS" Q "-1^ARRAY NAME MUST BE XWBS"
 S @A@(R)=V
 Q 0
 ;
BLDB(P) ;Build formatted string
 N L
 S L=$L(P)
 Q $E("000"_L,$L(L)+1,$L(L)+3)_P
 ;
BLDA(N,P) ;Build API string
 ;M Extrinsic Function
 ;Inputs
 ;N        API name
 ;P        Comma delimited parameter string
 ;Outputs
 ;String   API string if successful, "-1^Text" if error
 ;
 N I,F,L,T,U,T1,T2
 IF '+$D(N) Q "-1^Required input reference is NULL"
 S U="^"
 S (F,T,Y)=0
 IF '$D(P) S P=""
 IF P'="" D
 . S L=$L(P)-$L($TR(P,$C(44)))+1
 . IF L=0 S L=1
 . F I=1:1:L D  Q:T
 . . S T1=$P(P,",",I)
 . . S T2=$E(T1,1,1)="."
 . . IF T1=+T1 Q
 . . IF $E(T1,1,1)="^" S F=2,T=1 Q
 . . ;IF $E(T1,1,5)="$NA(^" S F=2,T=1 Q
 . . IF T2&($E(T1,2,$L(T1))?.ANP) S F=1,T=1 Q
 ;IF P?.ANP1"."1A.ANP S F=1
 S P=$$BLDB(P)
 S L=$L(P)+$L(P)-3
 S P=F_N_U_P
 S L=$L(P)
 Q $E("000"_L,$L(L)+1,$L(L)+3)_P
 ;
BLDS(R) ;Build a parameter string from an array
 N L,T,Y
 S Y=""
 F  D  Q:R=""
 . S R=$Q(@R)
 . IF R="" Q
 . S L=$L(R)+$L(@R)+1
 . S T=@R
 . S T=$TR(T,$C(44),$C(23))
 . S Y=Y_$E("000"_L,$L(L)+1,$L(L)+3)_R_"="_T
 Q Y_"000"
 ;
BLDU(R) ;Build a parameter string from a scalar
 N DONE,L,N,N1,P1
 IF R=+R Q R
 S N=$F(R,$C(34))
 IF N=0 Q $C(34)_R_$C(34)
 S P1=$E(R,1,N-2)
 S (L,DONE)=0
 F  D  Q:DONE
 . S N1=$F(R,$C(34),N)
 . IF N1=0 S L=$L(R)+2,N1=L
 . S P1=P1_$C(34,34)_$E(R,N,N1-2)
 . IF N1=L S DONE=1,P1=$C(34)_P1_$C(34) Q
 . S N=N1
 Q $TR(P1,$C(44),$C(23))
 ;
BLDG(R) ;build a parameter string from a global reference
 N I,L,L1,M,T,T1,T2,Y
 K ^TMP("XWB",$J)
 IF '$D(R) Q "-1^Reference does not exist"
 S Y=$NA(^TMP("XWB",$J,$P($H,",",2)))
 S I=0
 S M=512
 S T1=$P(R,")")
 S L1=$L($P(R,"("))
 F  D  Q:R=""
 . S R=$Q(@R)
 . S T2=$F(R,"(")
 . IF R=""!(R'[T1) Q
 . S L=$L(R)+$L(@R)-L1
 . S T=@R
 . S T=$TR(T,$C(44),$C(23))
 . S @Y@(I)=$E("000"_L,$L(L)+1,$L(L)+3)_"^("_$E(R,T2,M)_"="_$$BLDU(T)
 . S I=I+1
 S @Y@(I)="000"
 S Y=$TR(Y,$C(44),$C(23))
 Q Y
 ;
OARY() ;create storage array
 N A,DONE,I
 S (DONE,I)=0
 F I=1:1 D  Q:DONE
 . S A="XWBS"_I
 . IF '$D(@A) S DONE=1
 ;S Y("XWBS")=A
 S @A="" ;set naked
 Q A
 ;
CREF(R,P) ;Convert array contained in P to reference A
 N I,X,DONE,F1,S
 S DONE=0
 S S=""
 F I=1:1  D  Q:DONE
 . IF $P(P,",",I)="" S DONE=1 Q
 . S X(I)=$P(P,",",I)
 . IF X(I)?1"."1A.E D
 . . S F1=$F(X(I),".")
 . . S X(I)="."_R
 . S S=S_X(I)_","
 Q $E(S,1,$L(S)-1)
 ;
GETP(P) ;returns various parameters out of the Protocol string
 N M,T,XWB
 S M=512
 S T=$$PRSP^XWBBRK(P)
 IF '+T D
 . S T=$$PRSM^XWBBRK(XWB(0,"MESG"))
 . IF '+T S T=XWB(0,"WKID")_";"_XWB(0,"WINH")_";"_XWB(0,"PRCH")_";"_XWB(0,"WISH")_";"_$P(XWB(1,"TEXT"),"^")
 Q T
 ;
CALLM(X,P,DEBUG) ;make call using Message string
 N ERR,S
 S X="",ERR=0
 S ERR=$$PRSM^XWBBRK(P)
 IF '+ERR S ERR=$$PRSA^XWBBRK(XWB(1,"TEXT"))
 IF '+ERR S S=$$PRSB^XWBBRK(XWB(2,"PARM"))
 IF (+S=0)!(+S>0) D
 . D CAPI(.X,XWB(2,"RTAG"),XWB(2,"RNAM"),S)
 IF 'DEBUG K XWB
 K @(X("XWBS")),X("XWBS")
 Q
 ;
CALLA(X,P,DEBUG) ;make call using API string
 N ERR,S
 S X="",ERR=0
 S ERR=$$PRSA^XWBBRK(P)
 IF '+ERR S S=$$PRSB^XWBBRK(XWB(2,"PARM"))
 IF (+S=0)!(+S>0) D
 . D CAPI(.X,XWB(2,"RTAG"),XWB(2,"RNAM"),S)
 IF 'DEBUG K XWB
 K @(X("XWBS")),X("XWBS")
 Q
 ;
TRANSPRT() ;Determine the Transport Method
 ;DDP is local :=0
 ;TCP/IP is remote :=1
 ;Serial/RS-232 is remote :=2
 Q 1
 ;Q 0 ;Do DDP for Now

XWBFM
XWBFM ;SFISC/VYD - Broker FileMan connectivity ;08/14/95  16:31
 ;;1.1T3;RPC BROKER;;Nov 25, 1996
FIELDLST(RESULT,FNUM) ;retrieve a list of top-level fields of passed file
 ;and return it in RESLUT
 ;**** Note: requires FileMan v 21 with NEW DD RETRIEVER VER 1.0 patch
 N %
 D FILE^DID(FNUM,"T","FIELDS","^TMP($J)","JUNK")
 S %="" F  S %=$O(^TMP($J,"FIELDS",%)) Q:%=""  D
 . S RESULT(%)=$P(^(%),U)_"   ["_$P(^(%),U,2)_"]"
 K ^TMP($J)
 Q
 ;
FILELIST(RESULT,START) ;retrieve a list and return it in RESLUT
 N %
 D LIST^DIC(1,"","","P","","",START)
 S %=0 F  S %=$O(^TMP("DILIST",$J,%)) Q:%=""  D
 . S RESULT(%)=$P(^(%,0),U)_"   ["_$P(^(0),U,2)_"]"
 K ^TMP("DILIST",$J)  ;clean up
 Q
 ;
APILIST(RESULT,START) ;retrieve a list and return it in RESLUT
 N %
 D LIST^DIC(8994,"",".02;.03","P","","",START)
 S %=0 F  S %=$O(^TMP("DILIST",$J,%)) Q:%=""  D
 . S RESULT(%)=$P(^(%,0),U)_"   ["_$P(^(0),U,3,4)_"]"
 K ^TMP("DILIST",$J)  ;clean up
 Q
 ;
FILECHK(RESULT,FNAME) ;checks if the FNAME file exists.  If found, return IEN
 S RESULT=$$FIND1^DIC(1,"","O",FNAME)
 Q

XWBIN001
XWBIN001 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQ(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^DIC(8994,0,"GL")
 ;;=^XWB(8994,
 ;;^DIC("B","REMOTE PROCEDURE",8994)
 ;;=
 ;;^DIC(8994,"%D",0)
 ;;=^^20^20^2950828^^^^
 ;;^DIC(8994,"%D",1,0)
 ;;=This file is used as a repository of server-based procedures in the context
 ;;^DIC(8994,"%D",2,0)
 ;;=of the Client/Server architecture.  By using the Remote Procedure Call (RPC)
 ;;^DIC(8994,"%D",3,0)
 ;;=Broker, applications running on client workstations can envoke (call) the
 ;;^DIC(8994,"%D",4,0)
 ;;=procedures in this file to be executed by the server and the results will be
 ;;^DIC(8994,"%D",5,0)
 ;;=returned to the client application.
 ;;^DIC(8994,"%D",6,0)
 ;;=
 ;;^DIC(8994,"%D",7,0)
 ;;=Each remote procedure entry is associated with an entry point (ROUTINE with
 ;;^DIC(8994,"%D",8,0)
 ;;=optional TAG).  Calls to these procedures can include parameters of different
 ;;^DIC(8994,"%D",9,0)
 ;;=value types.  The resulting value of the call can be either a string, a list
 ;;^DIC(8994,"%D",10,0)
 ;;=of strings or a word processing string as indicated by the RETURN VALUE TYPE
 ;;^DIC(8994,"%D",11,0)
 ;;=field (.04).
 ;;^DIC(8994,"%D",12,0)
 ;;= 
 ;;^DIC(8994,"%D",13,0)
 ;;=The remote procedure may be available for use by anyone or its use may be
 ;;^DIC(8994,"%D",14,0)
 ;;=restricted to one or more application.  The range of availability is indicated
 ;;^DIC(8994,"%D",15,0)
 ;;=by the AVAILABILITY field.  IF THERE IS NO ENTRY IN THE AVAILABILITY FIELD,
 ;;^DIC(8994,"%D",16,0)
 ;;=then the procedure is assumed to be PUBLIC.
 ;;^DIC(8994,"%D",17,0)
 ;;=
 ;;^DIC(8994,"%D",18,0)
 ;;=A remote procedure may be removed from service for a period of time by setting
 ;;^DIC(8994,"%D",19,0)
 ;;=the INACTIVE field.  A request for use of a procedure which is marked inactive
 ;;^DIC(8994,"%D",20,0)
 ;;=will result in an error being returned to the originating application.
 ;;^DD(8994,0)
 ;;=FIELD^^3^11
 ;;^DD(8994,0,"DDA")
 ;;=N
 ;;^DD(8994,0,"DT")
 ;;=2950804
 ;;^DD(8994,0,"IX","B",8994,.01)
 ;;=
 ;;^DD(8994,0,"NM","REMOTE PROCEDURE")
 ;;=
 ;;^DD(8994,0,"PT",19.05,.01)
 ;;=
 ;;^DD(8994,0,"VRPK")
 ;;=RPC BROKER
 ;;^DD(8994,.01,0)
 ;;=NAME^RF^^0;1^K:$L(X)>30!(X?.N)!($L(X)<3)!'(X'?1P.E) X
 ;;^DD(8994,.01,1,0)
 ;;=^.1
 ;;^DD(8994,.01,1,1,0)
 ;;=8994^B
 ;;^DD(8994,.01,1,1,1)
 ;;=S ^XWB(8994,"B",$E(X,1,30),DA)=""
 ;;^DD(8994,.01,1,1,2)
 ;;=K ^XWB(8994,"B",$E(X,1,30),DA)
 ;;^DD(8994,.01,3)
 ;;=NAME MUST BE 3-30 CHARACTERS, NOT NUMERIC OR STARTING WITH PUNCTUATION
 ;;^DD(8994,.02,0)
 ;;=TAG^F^^0;2^K:$L(X)>8!($L(X)<1) X
 ;;^DD(8994,.02,3)
 ;;=Enter the TAG to be used as the entry point for the routine.  Leave this field empty if a TAG is not required.
 ;;^DD(8994,.02,"DT")
 ;;=2941213
 ;;^DD(8994,.03,0)
 ;;=ROUTINE^RF^^0;3^K:$L(X)>8!($L(X)<3)!'(X?1U1.7UN) X
 ;;^DD(8994,.03,3)
 ;;=This is the name of the routine used by this API
 ;;^DD(8994,.03,"DT")
 ;;=2941213
 ;;^DD(8994,.04,0)
 ;;=RETURN VALUE TYPE^RS^1:SINGLE VALUE;2:ARRAY;3:WORD PROCESSING;4:GLOBAL ARRAY;5:GLOBAL INSTANCE;^0;4^Q
 ;;^DD(8994,.04,3)
 ;;=Select the appropriate value to indicate what type of value will be returned by the API.
 ;;^DD(8994,.04,"DT")
 ;;=2950712
 ;;^DD(8994,.05,0)
 ;;=AVAILABILITY^S^P:PUBLIC;S:SUBSCRIPTION;A:AGREEMENT;R:RESTRICTED;^0;5^Q
 ;;^DD(8994,.05,3)
 ;;=Select the appropriate indicator of the availability of this API as PUBLIC (general), SUBSCRIPTION (need to subscribe), AGREEMENT required, or RESTRICTED to the developing package.
 ;;^DD(8994,.05,21,0)
 ;;=^^19^19^2941213^
 ;;^DD(8994,.05,21,1,0)
 ;;=This field is used to indicate the availability of the API to various
 ;;^DD(8994,.05,21,2,0)
 ;;=users.  
 ;;^DD(8994,.05,21,3,0)
 ;;= 
 ;;^DD(8994,.05,21,4,0)
 ;;=PUBLIC indicates that the API is available for general use by any package,
 ;;^DD(8994,.05,21,5,0)
 ;;=and it is not necessary to either indicate that the API is being used or
 ;;^DD(8994,.05,21,6,0)
 ;;=to request permission to use it.
 ;;^DD(8994,.05,21,7,0)
 ;;= 
 ;;^DD(8994,.05,21,8,0)
 ;;=SUBSCRIPTION indicates that the API is available to those packages that
 ;;^DD(8994,.05,21,9,0)
 ;;=wish to use it, BUT the package needs to indicate that it is using the API
 ;;^DD(8994,.05,21,10,0)
 ;;=or subscribing to it.
 ;;^DD(8994,.05,21,11,0)
 ;;= 
 ;;^DD(8994,.05,21,12,0)
 ;;=AGREEMENT indicates that the API is available to packages, other than the
 ;;^DD(8994,.05,21,13,0)
 ;;=developing package, only by means of an integration agreement on its
 ;;^DD(8994,.05,21,14,0)
 ;;=usage.
 ;;^DD(8994,.05,21,15,0)
 ;;= 
 ;;^DD(8994,.05,21,16,0)
 ;;=RESTRICTED indicates that the API is not available for reference by any

XWBIN002
XWBIN002 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQ(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^DD(8994,.05,21,17,0)
 ;;=package other than the package which developed it.  Entry of the input and
 ;;^DD(8994,.05,21,18,0)
 ;;=return parameter information is at the option of the developing package in
 ;;^DD(8994,.05,21,19,0)
 ;;=this case.
 ;;^DD(8994,.05,"DT")
 ;;=2941213
 ;;^DD(8994,.06,0)
 ;;=INACTIVE^S^1:INACTIVE;^0;6^Q
 ;;^DD(8994,.06,3)
 ;;=Enter 1 or I only if this API is currently inactive and not available for use.
 ;;^DD(8994,.06,21,0)
 ;;=^^2^2^2941213^
 ;;^DD(8994,.06,21,1,0)
 ;;=This field is used to indicate that the API is not available for any usage
 ;;^DD(8994,.06,21,2,0)
 ;;=for some reason.
 ;;^DD(8994,.06,"DT")
 ;;=2941213
 ;;^DD(8994,.07,0)
 ;;=CLIENT MANAGER^S^1:YES;^0;7^Q
 ;;^DD(8994,.07,3)
 ;;=Enter 1 or YES if this API requires other configuration information related to transmission to the client.
 ;;^DD(8994,.07,21,0)
 ;;=^^4^4^2941215^
 ;;^DD(8994,.07,21,1,0)
 ;;=This field is used to identify those APIs which may be initiated to
 ;;^DD(8994,.07,21,2,0)
 ;;=control the client or to send data to the client unrelated to requests
 ;;^DD(8994,.07,21,3,0)
 ;;=from the client.  These actions usually require additonal information on
 ;;^DD(8994,.07,21,4,0)
 ;;=the configuration which is present.
 ;;^DD(8994,.07,"DT")
 ;;=2941215
 ;;^DD(8994,.08,0)
 ;;=WORD WRAP ON^S^0:FALSE;1:TRUE;^0;8^Q
 ;;^DD(8994,.08,21,0)
 ;;=^^2^2^2950804^
 ;;^DD(8994,.08,21,1,0)
 ;;=Use this flag to indicate whether text should be returned to client
 ;;^DD(8994,.08,21,2,0)
 ;;=with a carriage + line feed terminator
 ;;^DD(8994,.08,"DT")
 ;;=2950804
 ;;^DD(8994,1,0)
 ;;=DESCRIPTION^8994.01^^1;0
 ;;^DD(8994,2,0)
 ;;=INPUT PARAMETER^8994.02A^^2;0
 ;;^DD(8994,3,0)
 ;;=RETURN PARAMETER DESCRIPTION^8994.03^^3;0
 ;;^DD(8994.01,0)
 ;;=DESCRIPTION SUB-FIELD^^.01^1
 ;;^DD(8994.01,0,"DT")
 ;;=2941213
 ;;^DD(8994.01,0,"NM","DESCRIPTION")
 ;;=
 ;;^DD(8994.01,0,"UP")
 ;;=8994
 ;;^DD(8994.01,.01,0)
 ;;=DESCRIPTION^WL^^0;1^Q
 ;;^DD(8994.01,.01,3)
 ;;=Please enter a brief description of the purpose of this API
 ;;^DD(8994.01,.01,21,0)
 ;;=^^2^2^2941213^
 ;;^DD(8994.01,.01,21,1,0)
 ;;=This field is a word processing field for describing the purpose of the
 ;;^DD(8994.01,.01,21,2,0)
 ;;=API.
 ;;^DD(8994.01,.01,"DT")
 ;;=2941213
 ;;^DD(8994.02,0)
 ;;=INPUT PARAMETER SUB-FIELD^^1^5
 ;;^DD(8994.02,0,"DT")
 ;;=2941215
 ;;^DD(8994.02,0,"IX","B",8994.02,.01)
 ;;=
 ;;^DD(8994.02,0,"NM","INPUT PARAMETER")
 ;;=
 ;;^DD(8994.02,0,"UP")
 ;;=8994
 ;;^DD(8994.02,.01,0)
 ;;=INPUT PARAMETER^MF^^0;1^K:$L(X)>30!($L(X)<3) X
 ;;^DD(8994.02,.01,1,0)
 ;;=^.1
 ;;^DD(8994.02,.01,1,1,0)
 ;;=8994.02^B
 ;;^DD(8994.02,.01,1,1,1)
 ;;=S ^XWB(8994,DA(1),2,"B",$E(X,1,30),DA)=""
 ;;^DD(8994.02,.01,1,1,2)
 ;;=K ^XWB(8994,DA(1),2,"B",$E(X,1,30),DA)
 ;;^DD(8994.02,.01,3)
 ;;=Answer must be 3-30 characters in length.
 ;;^DD(8994.02,.01,21,0)
 ;;=^^1^1^2941213^
 ;;^DD(8994.02,.01,21,1,0)
 ;;=This field is used to identify an input parameter for the API.
 ;;^DD(8994.02,.01,"DT")
 ;;=2941213
 ;;^DD(8994.02,.02,0)
 ;;=PARAMETER TYPE^S^1:SINGLE VALUE;2:ARRAY;3:WORD PROCESSING;^0;2^Q
 ;;^DD(8994.02,.02,3)
 ;;=Select the appropriate value indicating whether the parameter is a single value, an arry or a word processing string.
 ;;^DD(8994.02,.02,21,0)
 ;;=^^2^2^2941213^
 ;;^DD(8994.02,.02,21,1,0)
 ;;=This field is used to indicate the type (SINGLE value, ARRAY, or Word
 ;;^DD(8994.02,.02,21,2,0)
 ;;=Processing entry) of value indicated by this parameter.
 ;;^DD(8994.02,.02,"DT")
 ;;=2941213
 ;;^DD(8994.02,.03,0)
 ;;=MAXIMUM DATA LENGTH^NJ5,0^^0;3^K:+X'=X!(X>32000)!(X<1)!(X?.E1"."1N.N) X
 ;;^DD(8994.02,.03,3)
 ;;=Indicate the maximum length of the parameter, type a Number between 1 and 32000, 0 Decimal Digits
 ;;^DD(8994.02,.03,21,0)
 ;;=^^2^2^2941213^
 ;;^DD(8994.02,.03,21,1,0)
 ;;=This field indicates the maximum length that would be expected for the
 ;;^DD(8994.02,.03,21,2,0)
 ;;=parameter value.
 ;;^DD(8994.02,.03,"DT")
 ;;=2941213
 ;;^DD(8994.02,.04,0)
 ;;=REQUIRED^S^1:YES;0:NO;^0;4^Q
 ;;^DD(8994.02,.04,3)
 ;;=This field is used to indicate when an input parameter is required in the API call.
 ;;^DD(8994.02,.04,21,0)
 ;;=^^2^2^2941215^
 ;;^DD(8994.02,.04,21,1,0)
 ;;=This field is used to indicate that the input parameter is a required
 ;;^DD(8994.02,.04,21,2,0)
 ;;=argument in the API call.
 ;;^DD(8994.02,.04,"DT")
 ;;=2941215
 ;;^DD(8994.02,1,0)
 ;;=DESCRIPTION^8994.021^^1;0
 ;;^DD(8994.021,0)
 ;;=DESCRIPTION SUB-FIELD^^.01^1
 ;;^DD(8994.021,0,"DT")
 ;;=2941213
 ;;^DD(8994.021,0,"NM","DESCRIPTION")
 ;;=
 ;;^DD(8994.021,0,"UP")
 ;;=8994.02
 ;;^DD(8994.021,.01,0)
 ;;=DESCRIPTION^WL^^0;1^Q

XWBIN003
XWBIN003 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQ(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^DD(8994.021,.01,3)
 ;;=Please enter a brief description of this input parameter.
 ;;^DD(8994.021,.01,21,0)
 ;;=^^2^2^2941213^
 ;;^DD(8994.021,.01,21,1,0)
 ;;=This field is used for a description of the meaning or function of the
 ;;^DD(8994.021,.01,21,2,0)
 ;;=input parameter.
 ;;^DD(8994.021,.01,"DT")
 ;;=2941213
 ;;^DD(8994.03,0)
 ;;=RETURN PARAMETER DESCRIPTION SUB-FIELD^^.01^1
 ;;^DD(8994.03,0,"DT")
 ;;=2941213
 ;;^DD(8994.03,0,"NM","RETURN PARAMETER DESCRIPTION")
 ;;=
 ;;^DD(8994.03,0,"UP")
 ;;=8994
 ;;^DD(8994.03,.01,0)
 ;;=RETURN PARAMETER DESCRIPTION^WL^^0;1^Q
 ;;^DD(8994.03,.01,3)
 ;;=Enter a brief description of the return value from this API
 ;;^DD(8994.03,.01,21,0)
 ;;=^^2^2^2941213^
 ;;^DD(8994.03,.01,21,1,0)
 ;;=This field is used to obtain a brief description of the return parameter
 ;;^DD(8994.03,.01,21,2,0)
 ;;=and what it represents.
 ;;^DD(8994.03,.01,"DT")
 ;;=2941213

XWBIN004
XWBIN004 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994)
 ;;=^XWB(8994,
 ;;^UTILITY(U,$J,8994,0)
 ;;=REMOTE PROCEDURE^8994^210^207
 ;;^UTILITY(U,$J,8994,1,0)
 ;;=XWB ECHO STRING^ECHO1^XWBZ1^1^P
 ;;^UTILITY(U,$J,8994,1,1,0)
 ;;=^^3^3^2950202^
 ;;^UTILITY(U,$J,8994,1,1,1,0)
 ;;=This call echos any string passed as parameter.
 ;;^UTILITY(U,$J,8994,1,1,2,0)
 ;;=
 ;;^UTILITY(U,$J,8994,1,1,3,0)
 ;;=to run d ECHO^XWBZ1(something)
 ;;^UTILITY(U,$J,8994,1,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,1,2,1,0)
 ;;=INP^1^255
 ;;^UTILITY(U,$J,8994,2,0)
 ;;=XWB ECHO GLOBAL NODE^GLOB1^XWBZ1^5^P
 ;;^UTILITY(U,$J,8994,2,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,2,2,1,0)
 ;;=GLO^2
 ;;^UTILITY(U,$J,8994,3,0)
 ;;=XWB ECHO LIST^LIST^XWBZ1^2
 ;;^UTILITY(U,$J,8994,4,0)
 ;;=XWB ECHO BIG LIST^BIG^XWBZ1^4^^^^1
 ;;^UTILITY(U,$J,8994,5,0)
 ;;=XWB ECHO SORT LIST^SRT^XWBZ1^2^P
 ;;^UTILITY(U,$J,8994,5,1,0)
 ;;=^^1^1^2951211^^
 ;;^UTILITY(U,$J,8994,5,1,1,0)
 ;;=Sorts a given numeric array, starting from HI or LO
 ;;^UTILITY(U,$J,8994,5,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,5,2,1,0)
 ;;=DIRECTION^1^2^1
 ;;^UTILITY(U,$J,8994,5,2,1,1,0)
 ;;=^^1^1^2950503^
 ;;^UTILITY(U,$J,8994,5,2,1,1,1,0)
 ;;=The string LO or HI
 ;;^UTILITY(U,$J,8994,5,2,2,0)
 ;;=ARRAY^2
 ;;^UTILITY(U,$J,8994,5,2,2,1,0)
 ;;=^^2^2^2950503^
 ;;^UTILITY(U,$J,8994,5,2,2,1,1,0)
 ;;=The array of numbers.  Pass using . syntax
 ;;^UTILITY(U,$J,8994,5,2,2,1,2,0)
 ;;=X(12)="",X(23)="",... for example
 ;;^UTILITY(U,$J,8994,5,3,0)
 ;;=^^1^1^2951211^^
 ;;^UTILITY(U,$J,8994,5,3,1,0)
 ;;=Sorted array
 ;;^UTILITY(U,$J,8994,6,0)
 ;;=XWB ECHO MEMO^MEMO^XWBZ1^4^P^^^1
 ;;^UTILITY(U,$J,8994,7,0)
 ;;=XWB FILE LIST^FILELIST^XWBFM^2^P
 ;;^UTILITY(U,$J,8994,7,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,7,2,1,0)
 ;;=START^1
 ;;^UTILITY(U,$J,8994,8,0)
 ;;=XWB FILENAME CHECK^FILECHK^XWBFM^1^P
 ;;^UTILITY(U,$J,8994,8,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,8,2,1,0)
 ;;=START^1
 ;;^UTILITY(U,$J,8994,8,2,2,0)
 ;;=FNAME
 ;;^UTILITY(U,$J,8994,9,0)
 ;;=XWB API LIST^APILIST^XWBFM^2^P
 ;;^UTILITY(U,$J,8994,9,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,9,2,1,0)
 ;;=START^1
 ;;^UTILITY(U,$J,8994,10,0)
 ;;=XWB GET VARIABLE VALUE^VARVAL^XWBLIB^1
 ;;^UTILITY(U,$J,8994,11,0)
 ;;=XUS AV CODE^VALIDAV^XUSRB^2^R
 ;;^UTILITY(U,$J,8994,11,1,0)
 ;;=^^3^3^2950816^^
 ;;^UTILITY(U,$J,8994,11,1,1,0)
 ;;=This API checks if a ACCESS/VERIFY code pair is valid.
 ;;^UTILITY(U,$J,8994,11,1,2,0)
 ;;=It returns "DUZ^session ok^verify needs changeing" if valid
 ;;^UTILITY(U,$J,8994,11,1,3,0)
 ;;=or a 0 if not ok.
 ;;^UTILITY(U,$J,8994,11,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,11,2,1,0)
 ;;=AVCODE^1^60^1
 ;;^UTILITY(U,$J,8994,11,2,1,1,0)
 ;;=^^1^1^2950816^^
 ;;^UTILITY(U,$J,8994,11,2,1,1,1,0)
 ;;=accessCode_";"_verifyCode in unencrypted form.
 ;;^UTILITY(U,$J,8994,12,0)
 ;;=XUS INTRO MSG^INTRO^XUSRB^3^S^^^1
 ;;^UTILITY(U,$J,8994,12,1,0)
 ;;=^^1^1^2950816^^^^
 ;;^UTILITY(U,$J,8994,12,1,1,0)
 ;;=Return the INTRO message.
 ;;^UTILITY(U,$J,8994,13,0)
 ;;=XUS SIGNON SETUP^SETUP^XUSRB^2^R
 ;;^UTILITY(U,$J,8994,13,1,0)
 ;;=^^1^1^2950816^^^^
 ;;^UTILITY(U,$J,8994,13,1,1,0)
 ;;=Establishes environment necessary for DHCP sign-on
 ;;^UTILITY(U,$J,8994,14,0)
 ;;=XUS SEND KEYS^SENDKEYS^XUSRB^2^R
 ;;^UTILITY(U,$J,8994,14,1,0)
 ;;=^^2^2^2950816^^
 ;;^UTILITY(U,$J,8994,14,1,1,0)
 ;;=Returns an array of strings that are used in the hashing algorithm.
 ;;^UTILITY(U,$J,8994,14,1,2,0)
 ;;=The strings that are returned are picked up from Z^XUSRB.
 ;;^UTILITY(U,$J,8994,15,0)
 ;;=DDR GETS ENTRY DATA^GETSC^DDR2^2^P
 ;;^UTILITY(U,$J,8994,15,1,0)
 ;;=^^1^1^2951024^^^^
 ;;^UTILITY(U,$J,8994,15,1,1,0)
 ;;=Calls database server at GETS^DIQ.
 ;;^UTILITY(U,$J,8994,15,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,15,2,1,0)
 ;;=GETS ATTRIBUTES^2^512^1
 ;;^UTILITY(U,$J,8994,16,0)
 ;;=DDR LISTER^LISTC^DDR^2^P
 ;;^UTILITY(U,$J,8994,16,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,16,2,1,0)
 ;;=LIST ATTRIBUTES^2^512^1
 ;;^UTILITY(U,$J,8994,17,0)
 ;;=DDR FILER^FILEC^DDR^2^P
 ;;^UTILITY(U,$J,8994,17,1,0)
 ;;=^^1^1^2950508^^
 ;;^UTILITY(U,$J,8994,17,1,1,0)
 ;;=Generic call to file edits into FM file.
 ;;^UTILITY(U,$J,8994,17,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,17,2,1,0)
 ;;=EDIT RESULTS^2^512^1
 ;;^UTILITY(U,$J,8994,17,2,1,1,0)
 ;;=^^1^1^2950124^
 ;;^UTILITY(U,$J,8994,17,2,1,1,1,0)
 ;;=Results of editing to be placed in FDA array by broker.
 ;;^UTILITY(U,$J,8994,17,2,2,0)
 ;;=EDIT MODE^1^3^1
 ;;^UTILITY(U,$J,8994,17,2,2,1,0)
 ;;=^^1^1^2950508^^
 ;;^UTILITY(U,$J,8994,17,2,2,1,1,0)
 ;;=Is processing in edit or add data mode.
 ;;^UTILITY(U,$J,8994,17,3,0)
 ;;=^^2^2^2950508^^
 ;;^UTILITY(U,$J,8994,17,3,1,0)
 ;;=If file update is successful, then a 1 is returned. A 0 is returned if

XWBIN005
XWBIN005 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,17,3,2,0)
 ;;=unsuccessful.
 ;;^UTILITY(U,$J,8994,18,0)
 ;;=DDR VALIDATOR^VALC^DDR^2^P
 ;;^UTILITY(U,$J,8994,18,1,0)
 ;;=^^3^3^2950515^^
 ;;^UTILITY(U,$J,8994,18,1,1,0)
 ;;=This function allows the application to validate user input to
 ;;^UTILITY(U,$J,8994,18,1,2,0)
 ;;=a field before filing data. The call uses the database server VAL^DIE
 ;;^UTILITY(U,$J,8994,18,1,3,0)
 ;;=call.
 ;;^UTILITY(U,$J,8994,18,2,0)
 ;;=^8994.02A^2^1
 ;;^UTILITY(U,$J,8994,18,2,2,0)
 ;;=PARAMETERS^2^512^1
 ;;^UTILITY(U,$J,8994,18,2,2,1,0)
 ;;=^^5^5^2950515^^
 ;;^UTILITY(U,$J,8994,18,2,2,1,1,0)
 ;;=This array contains the following parameters necessary to call VAL^DIE:
 ;;^UTILITY(U,$J,8994,18,2,2,1,2,0)
 ;;=    - "FILE"  - file number
 ;;^UTILITY(U,$J,8994,18,2,2,1,3,0)
 ;;=    - "IENS"  - internal entry numbers
 ;;^UTILITY(U,$J,8994,18,2,2,1,4,0)
 ;;=    - "IENS"  - internal entry numbers
 ;;^UTILITY(U,$J,8994,18,2,2,1,5,0)
 ;;=    - "VALUE" - user input value
 ;;^UTILITY(U,$J,8994,18,3,0)
 ;;=^^2^2^2950515^^
 ;;^UTILITY(U,$J,8994,18,3,1,0)
 ;;=This call passes back information in the [data] section and
 ;;^UTILITY(U,$J,8994,18,3,2,0)
 ;;=the [errors] section.
 ;;^UTILITY(U,$J,8994,19,0)
 ;;=MAGGXUS^ACCESS^MAGGTCP8^1^P
 ;;^UTILITY(U,$J,8994,19,1,0)
 ;;=^^3^3^2951212^^^^
 ;;^UTILITY(U,$J,8994,19,1,1,0)
 ;;=accepts 1 parameter, "access code^verify code"
 ;;^UTILITY(U,$J,8994,19,1,2,0)
 ;;=RETURNS 1 if access and verify is ok
 ;;^UTILITY(U,$J,8994,19,1,3,0)
 ;;=RETURNS 0^reason if codes failed.
 ;;^UTILITY(U,$J,8994,19,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,19,2,1,0)
 ;;=MAGGACC^1^255^1
 ;;^UTILITY(U,$J,8994,19,2,1,1,0)
 ;;=^^2^2^2951212^^
 ;;^UTILITY(U,$J,8994,19,2,1,1,1,0)
 ;;=Piece1=Access code
 ;;^UTILITY(U,$J,8994,19,2,1,1,2,0)
 ;;=Piece2=Verify code
 ;;^UTILITY(U,$J,8994,19,3,0)
 ;;=^^2^2^2951212^^^
 ;;^UTILITY(U,$J,8994,19,3,1,0)
 ;;=0^error if failure
 ;;^UTILITY(U,$J,8994,19,3,2,0)
 ;;=duz^name if successful
 ;;^UTILITY(U,$J,8994,20,0)
 ;;=MAGGLKP^LKP^MAGGTCP^2^P
 ;;^UTILITY(U,$J,8994,20,1,0)
 ;;=^^5^5^2951122^^
 ;;^UTILITY(U,$J,8994,20,1,1,0)
 ;;=Input is FILENUM^NUMTORETURN^STARTING VAL
 ;;^UTILITY(U,$J,8994,20,1,2,0)
 ;;=                 i.e. '2^50^smi'
 ;;^UTILITY(U,$J,8994,20,1,3,0)
 ;;=Get 50 entries from patient file starting with SMI
 ;;^UTILITY(U,$J,8994,20,1,4,0)
 ;;= 
 ;;^UTILITY(U,$J,8994,20,1,5,0)
 ;;=The call uses LIST^DIC FM21 silent call.
 ;;^UTILITY(U,$J,8994,20,3,0)
 ;;=^^1^1^2951122^^
 ;;^UTILITY(U,$J,8994,20,3,1,0)
 ;;=Returns a sequential array of matching entries.
 ;;^UTILITY(U,$J,8994,21,0)
 ;;=MAG GXUS^ACCESS^MAGGTCP8^1^P
 ;;^UTILITY(U,$J,8994,21,1,0)
 ;;=^^2^2^2951130^^^
 ;;^UTILITY(U,$J,8994,21,1,1,0)
 ;;=Param="access code^verify code"
 ;;^UTILITY(U,$J,8994,21,1,2,0)
 ;;=returns 1 if ok, 0^reason for failure
 ;;^UTILITY(U,$J,8994,21,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,21,2,1,0)
 ;;=ACCVER^1^255^1
 ;;^UTILITY(U,$J,8994,21,2,1,1,0)
 ;;=^^1^1^2951130^^
 ;;^UTILITY(U,$J,8994,21,2,1,1,1,0)
 ;;="ACC^VER"
 ;;^UTILITY(U,$J,8994,22,0)
 ;;=BMQapicall^APICALL^BMQCB2^1
 ;;^UTILITY(U,$J,8994,23,0)
 ;;=BMQapidmsg^APICALL^BMQCB2^1
 ;;^UTILITY(U,$J,8994,24,0)
 ;;=BMQapitable^APICALL^BMQCB2^2
 ;;^UTILITY(U,$J,8994,25,0)
 ;;=BMQapitmsg^APICALL^BMQCB2^2
 ;;^UTILITY(U,$J,8994,26,0)
 ;;=MAGGXUS2^ACCESS^MAGGTCPZ^2
 ;;^UTILITY(U,$J,8994,27,0)
 ;;=MAGGPATINFO^PINF^MAGGTCP^1
 ;;^UTILITY(U,$J,8994,27,1,0)
 ;;=^^1^1^2951122^
 ;;^UTILITY(U,$J,8994,27,1,1,0)
 ;;=Returns:  Current Means test status ^ Prim Disability ^ Eligibility stat^
 ;;^UTILITY(U,$J,8994,28,0)
 ;;=MAGGPINF1^PINF1^MAGGTCP^1
 ;;^UTILITY(U,$J,8994,28,1,0)
 ;;=^^1^1^2951122^
 ;;^UTILITY(U,$J,8994,28,1,1,0)
 ;;=Returns :  .02(sex) ^ .391(type) ^ .1909(veteran)
 ;;^UTILITY(U,$J,8994,29,0)
 ;;=MAGGADDIMAGE^ADD^MAGGTIA^1^R
 ;;^UTILITY(U,$J,8994,29,1,0)
 ;;=^^1^1^2960311^^^^
 ;;^UTILITY(U,$J,8994,29,1,1,0)
 ;;=Called with array of fields and data to add new entry to image file.
 ;;^UTILITY(U,$J,8994,29,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,29,2,1,0)
 ;;=FIELDS^2^255
 ;;^UTILITY(U,$J,8994,29,2,1,1,0)
 ;;=^^3^3^2960311^^^
 ;;^UTILITY(U,$J,8994,29,2,1,1,1,0)
 ;;=Array of strings as follows:
 ;;^UTILITY(U,$J,8994,29,2,1,1,2,0)
 ;;=Piece 1 = Field number in File 2005 to add data to
 ;;^UTILITY(U,$J,8994,29,2,1,1,3,0)
 ;;=Piece 2 = Data to add to Field
 ;;^UTILITY(U,$J,8994,29,3,0)
 ;;=^^3^3^2960311^^^
 ;;^UTILITY(U,$J,8994,29,3,1,0)
 ;;=Single as follows:
 ;;^UTILITY(U,$J,8994,29,3,2,0)
 ;;=SINGLE=either magien^filename^drive
 ;;^UTILITY(U,$J,8994,29,3,3,0)
 ;;=     or  0^error description
 ;;^UTILITY(U,$J,8994,30,0)
 ;;=MAGGTESTLISTSEND^IN^MAGGTEST^2^P^^^0

XWBIN006
XWBIN006 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,31,0)
 ;;=MAG TEST^TST^MAGSTU^2^P
 ;;^UTILITY(U,$J,8994,32,0)
 ;;=MAGOLU^IMGPT^MAGDELP1^2^R
 ;;^UTILITY(U,$J,8994,33,0)
 ;;=MAGRGETWRITE^GETWRITE^MAGRDEL3^1^R
 ;;^UTILITY(U,$J,8994,33,1,0)
 ;;=^^4^4^2951127^
 ;;^UTILITY(U,$J,8994,33,1,1,0)
 ;;=This API call returns the current write location for the site called.
 ;;^UTILITY(U,$J,8994,33,1,2,0)
 ;;=Piece1=pointer value
 ;;^UTILITY(U,$J,8994,33,1,3,0)
 ;;=Piece2=logical name for write location
 ;;^UTILITY(U,$J,8994,33,1,4,0)
 ;;=Piece3=path name (concluding with \) for the write location
 ;;^UTILITY(U,$J,8994,33,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,33,2,1,0)
 ;;=MAGIN^1^60^0
 ;;^UTILITY(U,$J,8994,33,2,1,1,0)
 ;;=^^1^1^2951127^
 ;;^UTILITY(U,$J,8994,33,2,1,1,1,0)
 ;;=Dummy input parameter for testing
 ;;^UTILITY(U,$J,8994,33,3,0)
 ;;=^^4^4^2951127^
 ;;^UTILITY(U,$J,8994,33,3,1,0)
 ;;=Network write location:
 ;;^UTILITY(U,$J,8994,33,3,2,0)
 ;;=Piece1=pointer number for file 2006.2
 ;;^UTILITY(U,$J,8994,33,3,3,0)
 ;;=Piece2=logical name for write location
 ;;^UTILITY(U,$J,8994,33,3,4,0)
 ;;=Piece3=physical name for write location, concluding with \
 ;;^UTILITY(U,$J,8994,34,0)
 ;;=MAGPUT^FILEPUT^MAGDELP1^1^R
 ;;^UTILITY(U,$J,8994,34,1,0)
 ;;=^^5^5^2951128^^^^
 ;;^UTILITY(U,$J,8994,34,1,1,0)
 ;;=Pointer to image file entry in file 2005, for file(s) to
 ;;^UTILITY(U,$J,8994,34,1,2,0)
 ;;=be sent.  May end in * to send abstract, text file too.
 ;;^UTILITY(U,$J,8994,34,1,3,0)
 ;;=Second piece is the network location to copy to.  This may
 ;;^UTILITY(U,$J,8994,34,1,4,0)
 ;;=be a logical name in the network location file or a
 ;;^UTILITY(U,$J,8994,34,1,5,0)
 ;;=physical reference in the network location file.
 ;;^UTILITY(U,$J,8994,34,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,34,2,1,0)
 ;;=MAGMESS^1^255^1
 ;;^UTILITY(U,$J,8994,34,2,1,1,0)
 ;;=^^3^3^2951128^^^^
 ;;^UTILITY(U,$J,8994,34,2,1,1,1,0)
 ;;=Pointer to image file entry in file 2005, for file(s) to
 ;;^UTILITY(U,$J,8994,34,2,1,1,2,0)
 ;;=be sent.  may end in *.  Piece 2 is network location to
 ;;^UTILITY(U,$J,8994,34,2,1,1,3,0)
 ;;=copy to (can be logical or physical reference).
 ;;^UTILITY(U,$J,8994,34,3,0)
 ;;=^^2^2^2951128^^^^
 ;;^UTILITY(U,$J,8994,34,3,1,0)
 ;;=Piece1=0 if failure
 ;;^UTILITY(U,$J,8994,34,3,2,0)
 ;;=Piece1=1 if successful and queue node was set
 ;;^UTILITY(U,$J,8994,35,0)
 ;;=MAG CONSULT MSG CREATE^MSG^MAGMAPI^1^R
 ;;^UTILITY(U,$J,8994,35,1,0)
 ;;=^^5^5^2960301^^^^
 ;;^UTILITY(U,$J,8994,35,1,1,0)
 ;;=Piece1=0 if failure
 ;;^UTILITY(U,$J,8994,35,1,2,0)
 ;;=Piece1=1 if successful
 ;;^UTILITY(U,$J,8994,35,1,3,0)
 ;;=  
 ;;^UTILITY(U,$J,8994,35,1,4,0)
 ;;=Note: you must create the mail group IMAGE TELECONSULT (RADIOLOGY) and
 ;;^UTILITY(U,$J,8994,35,1,5,0)
 ;;=      add members to recieve the consult notification mail message.
 ;;^UTILITY(U,$J,8994,35,2,0)
 ;;=^8994.02A^3^2
 ;;^UTILITY(U,$J,8994,35,2,2,0)
 ;;=MAGDUZ^1^255^1
 ;;^UTILITY(U,$J,8994,35,2,2,1,0)
 ;;=^^1^1^2951127^^^
 ;;^UTILITY(U,$J,8994,35,2,2,1,1,0)
 ;;=DUZ number for sender of message
 ;;^UTILITY(U,$J,8994,35,2,3,0)
 ;;=TXT^2^32000^1
 ;;^UTILITY(U,$J,8994,35,2,3,1,0)
 ;;=^^1^1^2960301^^^
 ;;^UTILITY(U,$J,8994,35,2,3,1,1,0)
 ;;=Message to be sent; $END$; Recipient list
 ;;^UTILITY(U,$J,8994,35,3,0)
 ;;=^^3^3^2960301^^^^
 ;;^UTILITY(U,$J,8994,35,3,1,0)
 ;;=Piece1=0 if failure
 ;;^UTILITY(U,$J,8994,35,3,2,0)
 ;;=Piece1=1 if successful
 ;;^UTILITY(U,$J,8994,35,3,3,0)
 ;;=Piece2=error if needed
 ;;^UTILITY(U,$J,8994,36,0)
 ;;=MAGRTELW^ADD^MAGRDEL2^1^R
 ;;^UTILITY(U,$J,8994,36,1,0)
 ;;=^^2^2^2951127^
 ;;^UTILITY(U,$J,8994,36,1,1,0)
 ;;=Adds an entry to the Image Teleconsultation File (2005.15).
 ;;^UTILITY(U,$J,8994,36,1,2,0)
 ;;=This is used to track teleconsultations.
 ;;^UTILITY(U,$J,8994,36,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,36,2,1,0)
 ;;=MAGARR1^2^32000^1
 ;;^UTILITY(U,$J,8994,36,2,1,1,0)
 ;;=^^3^3^2951127^
 ;;^UTILITY(U,$J,8994,36,2,1,1,1,0)
 ;;=This array contains strings each of which indicates the field in 
 ;;^UTILITY(U,$J,8994,36,2,1,1,2,0)
 ;;=file 2005.15 to be added.  The second piece of each string contains
 ;;^UTILITY(U,$J,8994,36,2,1,1,3,0)
 ;;=the data to be added.  This works similarly to MAGGTIA.
 ;;^UTILITY(U,$J,8994,36,3,0)
 ;;=^^2^2^2951127^
 ;;^UTILITY(U,$J,8994,36,3,1,0)
 ;;=Status of the call:  Piece1>0 ==> successful, Piece1 = entry number
 ;;^UTILITY(U,$J,8994,36,3,2,0)
 ;;=Piece1 = 0 ==> failure, Piece2 = error message
 ;;^UTILITY(U,$J,8994,37,0)
 ;;=BMQrpccall^RPCCALL^BMQCB2^1
 ;;^UTILITY(U,$J,8994,38,0)
 ;;=BMQrpctable^RPCCALL^BMQCB2^2
 ;;^UTILITY(U,$J,8994,39,0)
 ;;=BMQrpctmsg^RPCCALL^BMQCB2^2

XWBIN007
XWBIN007 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,40,0)
 ;;=BMQsecurity^SECURITY^BMQCB2^2
 ;;^UTILITY(U,$J,8994,40,1,0)
 ;;=^^2^2^2960215^
 ;;^UTILITY(U,$J,8994,40,1,1,0)
 ;;=This api call verifies that the user has authorization to access the
 ;;^UTILITY(U,$J,8994,40,1,2,0)
 ;;=database.
 ;;^UTILITY(U,$J,8994,41,0)
 ;;=MAG DUZ LOOKUP^DUZLU^MAGRDEL3^1^R
 ;;^UTILITY(U,$J,8994,41,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,41,2,1,0)
 ;;=MAGIN^1^255^1
 ;;^UTILITY(U,$J,8994,42,0)
 ;;=MAGGLISTPROC^LIST^MAGGTMC^2^P
 ;;^UTILITY(U,$J,8994,43,0)
 ;;=MAGGPATPROC^PRC^MAGGTMC^2^P
 ;;^UTILITY(U,$J,8994,44,0)
 ;;=MAGGHSLIST^HSLIST^MAGGTCPR^2^R
 ;;^UTILITY(U,$J,8994,44,1,0)
 ;;=^^1^1^2951204^
 ;;^UTILITY(U,$J,8994,44,1,1,0)
 ;;=Returns an array of health summary types
 ;;^UTILITY(U,$J,8994,44,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,44,2,1,0)
 ;;=XXX^1^255^1
 ;;^UTILITY(U,$J,8994,44,2,1,1,0)
 ;;=^^1^1^2951204^
 ;;^UTILITY(U,$J,8994,44,2,1,1,1,0)
 ;;='hs' to receive list of health summary types
 ;;^UTILITY(U,$J,8994,44,3,0)
 ;;=^^1^1^2951204^
 ;;^UTILITY(U,$J,8994,44,3,1,0)
 ;;=array of health summary types
 ;;^UTILITY(U,$J,8994,45,0)
 ;;=MAGGHS^HSUM^MAGGTCPR^2^R
 ;;^UTILITY(U,$J,8994,45,1,0)
 ;;=^^2^2^2951204^
 ;;^UTILITY(U,$J,8994,45,1,1,0)
 ;;=Returns a health summary for a patient of the type
 ;;^UTILITY(U,$J,8994,45,1,2,0)
 ;;=requested.
 ;;^UTILITY(U,$J,8994,45,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,45,2,1,0)
 ;;=INST^1^255^1
 ;;^UTILITY(U,$J,8994,45,2,1,1,0)
 ;;=^^2^2^2951204^
 ;;^UTILITY(U,$J,8994,45,2,1,1,1,0)
 ;;=Piece 1= health summary type
 ;;^UTILITY(U,$J,8994,45,2,1,1,2,0)
 ;;=Piece 2= patient DFN
 ;;^UTILITY(U,$J,8994,45,3,0)
 ;;=^^2^2^2951204^
 ;;^UTILITY(U,$J,8994,45,3,1,0)
 ;;=Array contains lines of health summary that was
 ;;^UTILITY(U,$J,8994,45,3,2,0)
 ;;=requested
 ;;^UTILITY(U,$J,8994,46,0)
 ;;=MAGOGLU^GRP^MAGDELP1^2^R
 ;;^UTILITY(U,$J,8994,46,1,0)
 ;;=^^2^2^2951205^
 ;;^UTILITY(U,$J,8994,46,1,1,0)
 ;;=Receives group internal entry number and DUZ of user.
 ;;^UTILITY(U,$J,8994,46,1,2,0)
 ;;=Returns list of images belonging to that group
 ;;^UTILITY(U,$J,8994,46,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,46,2,1,0)
 ;;=MAGMESS^1^255^1
 ;;^UTILITY(U,$J,8994,46,2,1,1,0)
 ;;=^^2^2^2951205^
 ;;^UTILITY(U,$J,8994,46,2,1,1,1,0)
 ;;=Piece1=Internal entry # in file 2005 for group
 ;;^UTILITY(U,$J,8994,46,2,1,1,2,0)
 ;;=Piece2=DUZ for user
 ;;^UTILITY(U,$J,8994,46,3,0)
 ;;=^^2^2^2951205^
 ;;^UTILITY(U,$J,8994,46,3,1,0)
 ;;=Array contains strings containing same information
 ;;^UTILITY(U,$J,8994,46,3,2,0)
 ;;=as returned by MAGOLU
 ;;^UTILITY(U,$J,8994,47,0)
 ;;=MAGGRPT^BRK^MAGGTRPT^2^R
 ;;^UTILITY(U,$J,8994,47,1,0)
 ;;=^^1^1^2951205^
 ;;^UTILITY(U,$J,8994,47,1,1,0)
 ;;=Returns associated report for image ien requested.
 ;;^UTILITY(U,$J,8994,47,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,47,2,1,0)
 ;;=MAGGIEN^1^255^1
 ;;^UTILITY(U,$J,8994,47,2,1,1,0)
 ;;=^^1^1^2951205^
 ;;^UTILITY(U,$J,8994,47,2,1,1,1,0)
 ;;=Internal entry number in file 2005 for associated report
 ;;^UTILITY(U,$J,8994,47,3,0)
 ;;=^^3^3^2951205^
 ;;^UTILITY(U,$J,8994,47,3,1,0)
 ;;=Array contains associated report(s);
 ;;^UTILITY(U,$J,8994,47,3,2,0)
 ;;=First, image long description is returned,
 ;;^UTILITY(U,$J,8994,47,3,3,0)
 ;;=followed by MEdicine, Surgery, or Radiology report.
 ;;^UTILITY(U,$J,8994,48,0)
 ;;=BGU AVLOGON^VALIDAV^BGUXUSRB^2
 ;;^UTILITY(U,$J,8994,48,1,0)
 ;;=^^3^3^2960226^^
 ;;^UTILITY(U,$J,8994,48,1,1,0)
 ;;=This call is utilized to verify the access and verify
 ;;^UTILITY(U,$J,8994,48,1,2,0)
 ;;=codes passed by the client and to set some environment
 ;;^UTILITY(U,$J,8994,48,1,3,0)
 ;;=variables.
 ;;^UTILITY(U,$J,8994,48,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,48,2,1,0)
 ;;=AVCODE^1
 ;;^UTILITY(U,$J,8994,48,2,1,1,0)
 ;;=^^2^2^2960219^
 ;;^UTILITY(U,$J,8994,48,2,1,1,1,0)
 ;;=This is the access and verify code passed seperated by
 ;;^UTILITY(U,$J,8994,48,2,1,1,2,0)
 ;;=a semicolon.
 ;;^UTILITY(U,$J,8994,49,0)
 ;;=BGU CFAC^CFAC^BGUXUSRB^2
 ;;^UTILITY(U,$J,8994,49,1,0)
 ;;=^^2^2^2960219^
 ;;^UTILITY(U,$J,8994,49,1,1,0)
 ;;=This call is utilized to change the facility ID (DUZ(2))
 ;;^UTILITY(U,$J,8994,49,1,2,0)
 ;;=by the client.
 ;;^UTILITY(U,$J,8994,50,0)
 ;;=BGU CAC^CAC^BGUXUSRB^2
 ;;^UTILITY(U,$J,8994,50,1,0)
 ;;=^^2^2^2960219^
 ;;^UTILITY(U,$J,8994,50,1,1,0)
 ;;=This call is utilized to change the ACCESS code for 
 ;;^UTILITY(U,$J,8994,50,1,2,0)
 ;;=a user on the database server.
 ;;^UTILITY(U,$J,8994,51,0)
 ;;=BGU CVC^CVC^BGUXUSRB^2
 ;;^UTILITY(U,$J,8994,51,1,0)
 ;;=^^2^2^2960219^
 ;;^UTILITY(U,$J,8994,51,1,1,0)
 ;;=This call is utilized to change the VERIFY code

XWBIN008
XWBIN008 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,51,1,2,0)
 ;;=for a user on the database server.
 ;;^UTILITY(U,$J,8994,52,0)
 ;;=ADEPatientList^PTLIST^ADEKT^2^P
 ;;^UTILITY(U,$J,8994,53,0)
 ;;=BPC GET TODAY'S LABS^^BPCLGTR^2^P
 ;;^UTILITY(U,$J,8994,53,1,0)
 ;;=^^1^1^2960507^
 ;;^UTILITY(U,$J,8994,53,1,1,0)
 ;;=retrives today's lab test results for the provider (DUZ)
 ;;^UTILITY(U,$J,8994,54,0)
 ;;=BPC GET INITIAL LAB LIST^TAG^BPCLIPL^2^P
 ;;^UTILITY(U,$J,8994,54,1,0)
 ;;=^^4^4^2960528^^
 ;;^UTILITY(U,$J,8994,54,1,1,0)
 ;;=This collects the initial lab Pick List for a provider
 ;;^UTILITY(U,$J,8994,54,1,2,0)
 ;;=and returns the names of 1.  patients from the lab edit/disp opt
 ;;^UTILITY(U,$J,8994,54,1,3,0)
 ;;=2. returns patients who have labs today and these are flagged with *L*
 ;;^UTILITY(U,$J,8994,54,1,4,0)
 ;;=3.  returns lab data for flagged patients.
 ;;^UTILITY(U,$J,8994,55,0)
 ;;=BGU GETPATIENTLIST^PTLIST^BGUGPLK^2^P
 ;;^UTILITY(U,$J,8994,56,0)
 ;;=BPC GETLABVISITDATA
 ;;^UTILITY(U,$J,8994,57,0)
 ;;=BGUapitable^APICALL^BMQCB2^2
 ;;^UTILITY(U,$J,8994,58,0)
 ;;=BGUrpctable^RPCCALL^BMQCB2^2
 ;;^UTILITY(U,$J,8994,59,0)
 ;;=BGU APITABLE^APICALL^BGUAPI^2
 ;;^UTILITY(U,$J,8994,60,0)
 ;;=BGU APICALL^APICALL^BGUAPI^1
 ;;^UTILITY(U,$J,8994,61,0)
 ;;=BGU RPCCALL^RPCCALL^BGUAPI^1
 ;;^UTILITY(U,$J,8994,62,0)
 ;;=BGU RPCTABLE^RPCCALL^BGUAPI^2
 ;;^UTILITY(U,$J,8994,63,0)
 ;;=BPC ORDER LABS^START^BPCORD^2^P
 ;;^UTILITY(U,$J,8994,63,1,0)
 ;;=^^1^1^2960528^^
 ;;^UTILITY(U,$J,8994,63,1,1,0)
 ;;=Allows user to place a lab order if LAB(5.1) is installed.
 ;;^UTILITY(U,$J,8994,64,0)
 ;;=BPC GETDIAGNOSISLIST^DXLIST^BPCGDX^2^P
 ;;^UTILITY(U,$J,8994,64,1,0)
 ;;=^^1^1^2960610^
 ;;^UTILITY(U,$J,8994,64,1,1,0)
 ;;=GETS LIST OF DIAGNOSIS FOR CLIENT APPS
 ;;^UTILITY(U,$J,8994,65,0)
 ;;=BPC EDITPROBLEM^PRBEDIT^BPCPRBC^2^P
 ;;^UTILITY(U,$J,8994,65,1,0)
 ;;=^^1^1^2960612^
 ;;^UTILITY(U,$J,8994,65,1,1,0)
 ;;=RPC CALL USED FOR ADDING,EDITING AND DELETING PROBLEMS
 ;;^UTILITY(U,$J,8994,66,0)
 ;;=BPC EDITNOTE^NOTEDIT^BPCNOTEC^2^P
 ;;^UTILITY(U,$J,8994,66,1,0)
 ;;=^^1^1^2960617^^
 ;;^UTILITY(U,$J,8994,66,1,1,0)
 ;;=RPC CALL TO EDIT PROBLEM NOTE DATA
 ;;^UTILITY(U,$J,8994,67,0)
 ;;=BGU TABLENAMES^EN^BGUFILE^2^P
 ;;^UTILITY(U,$J,8994,68,0)
 ;;=BGU FIELDNAMES^EN^BMQFIELD^2^P
 ;;^UTILITY(U,$J,8994,69,0)
 ;;=BGU GETRECORD^GETS^BMQCB2^2^P
 ;;^UTILITY(U,$J,8994,70,0)
 ;;=BGU FIND^FIND^BGUFRED^2^P
 ;;^UTILITY(U,$J,8994,71,0)
 ;;=BMQGSecInfo^INTRO^BMQG0^2^P
 ;;^UTILITY(U,$J,8994,72,0)
 ;;=ADECompiledStatistics^CSTATS^ADEKT^2
 ;;^UTILITY(U,$J,8994,73,0)
 ;;=ADEStatisticsAvailable^ASKYQ^ADEKT^2
 ;;^UTILITY(U,$J,8994,74,0)
 ;;=MAGGPROCIMAGE^FILE^MAGGTMC1^1^P
 ;;^UTILITY(U,$J,8994,74,1,0)
 ;;=^^1^1^2960213^^^
 ;;^UTILITY(U,$J,8994,74,1,1,0)
 ;;=Files image pointer in procedure file, and procedure pointers in image file
 ;;^UTILITY(U,$J,8994,74,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,74,2,1,0)
 ;;=DATA^1
 ;;^UTILITY(U,$J,8994,74,2,1,1,0)
 ;;=^^5^5^2951207^
 ;;^UTILITY(U,$J,8994,74,2,1,1,1,0)
 ;;=A string of 4 pieces   PROCEDURE DATE/TIME ^ PROCEDURE INTERNAL NUMBER
 ;;^UTILITY(U,$J,8994,74,2,1,1,2,0)
 ;;=PROCEDURE DATE/TIME  REQ
 ;;^UTILITY(U,$J,8994,74,2,1,1,3,0)
 ;;=PROCEDURE INTERNAL NUMBER  ^MCAR(MCFILE,X
 ;;^UTILITY(U,$J,8994,74,2,1,1,4,0)
 ;;=PATIENT DFN
 ;;^UTILITY(U,$J,8994,74,2,1,1,5,0)
 ;;=PROCEDURE FILE, INTERNAL NUMBER  ^MCAR(697.2,X
 ;;^UTILITY(U,$J,8994,74,2,2,0)
 ;;=MAGARR^2
 ;;^UTILITY(U,$J,8994,74,2,2,1,0)
 ;;=^^1^1^2960213^^
 ;;^UTILITY(U,$J,8994,74,2,2,1,1,0)
 ;;=AN ARRAY OF IMAGES THAT ARE TO BE ASSOCIATED WITH THE PROCEDURE
 ;;^UTILITY(U,$J,8994,74,3,0)
 ;;=^^2^2^2960213^^^
 ;;^UTILITY(U,$J,8994,74,3,1,0)
 ;;=RETURNS   "1^ message"  IF SUCCESSFUL
 ;;^UTILITY(U,$J,8994,74,3,2,0)
 ;;=RETURNS   "0^ message"  IF UNSUCCESSFUL
 ;;^UTILITY(U,$J,8994,75,0)
 ;;=MAGGECHO^ECHO^MAGGTCP^1^P
 ;;^UTILITY(U,$J,8994,76,0)
 ;;=AKFRCLIN^CLIN^AKFRC^2^P
 ;;^UTILITY(U,$J,8994,76,1,0)
 ;;=^^2^2^2950517^^
 ;;^UTILITY(U,$J,8994,76,1,1,0)
 ;;=|TAB|DIC lookup from Hospital Location File
 ;;^UTILITY(U,$J,8994,76,1,2,0)
 ;;=|TAB|User enters string receives array of matches
 ;;^UTILITY(U,$J,8994,76,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,76,2,1,0)
 ;;=CLINIC^1^200
 ;;^UTILITY(U,$J,8994,77,0)
 ;;=AKFRMEDL^MEDL^AKFRP^2
 ;;^UTILITY(U,$J,8994,77,1,0)
 ;;=^^1^1^2950517^^^
 ;;^UTILITY(U,$J,8994,77,1,1,0)
 ;;=|TAB|Build list of active medications from file 52
 ;;^UTILITY(U,$J,8994,77,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,77,2,1,0)
 ;;=DFN^1^10
 ;;^UTILITY(U,$J,8994,78,0)
 ;;=AKFRALLERG^ALRG^AKFRM^2
 ;;^UTILITY(U,$J,8994,78,1,0)
 ;;=^^1^1^2950519^^^^
 ;;^UTILITY(U,$J,8994,78,1,1,0)
 ;;=|TAB|Retrieve list of allergies/adverse reactions

XWBIN009
XWBIN009 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,78,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,78,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,79,0)
 ;;=AKFRFAPPT^FA^AKFRC^2^P
 ;;^UTILITY(U,$J,8994,79,1,0)
 ;;=^^1^1^2950831^^^
 ;;^UTILITY(U,$J,8994,79,1,1,0)
 ;;=|TAB|Receives DFN, retrieves array of future appointments
 ;;^UTILITY(U,$J,8994,79,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,79,2,1,0)
 ;;=DFN^1^10
 ;;^UTILITY(U,$J,8994,80,0)
 ;;=AKFRLVISIT^LV^AKFRC^1
 ;;^UTILITY(U,$J,8994,80,1,0)
 ;;=^^2^2^2950804^^^^
 ;;^UTILITY(U,$J,8994,80,1,1,0)
 ;;=|TAB|Receives DFN and Clinic, Returns Last Visit date/time for
 ;;^UTILITY(U,$J,8994,80,1,2,0)
 ;;=the specified clinic.
 ;;^UTILITY(U,$J,8994,80,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,80,2,1,0)
 ;;=CIEN^1
 ;;^UTILITY(U,$J,8994,80,2,2,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,81,0)
 ;;=AKFRVITL^VIT^AKFRVIT^2
 ;;^UTILITY(U,$J,8994,81,1,0)
 ;;=^^1^1^2950901^^^
 ;;^UTILITY(U,$J,8994,81,1,1,0)
 ;;=|TAB|Receives DFN, Retrieves Last 12 Vital Sign Measurements
 ;;^UTILITY(U,$J,8994,81,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,81,2,1,0)
 ;;=DFN^1^10
 ;;^UTILITY(U,$J,8994,82,0)
 ;;=AKFRPATL^PATL^AKFRM^2
 ;;^UTILITY(U,$J,8994,82,1,0)
 ;;=^^1^1^2951128^^^^
 ;;^UTILITY(U,$J,8994,82,1,1,0)
 ;;=|TAB|Receives IEN of Hospital Location, Retrieves Patient List for Clinic
 ;;^UTILITY(U,$J,8994,82,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,82,2,1,0)
 ;;=CLINIC^1
 ;;^UTILITY(U,$J,8994,82,2,1,1,0)
 ;;=^^1^1^2951128^^^^
 ;;^UTILITY(U,$J,8994,82,2,1,1,1,0)
 ;;=|TAB|IEN of Hospital Location
 ;;^UTILITY(U,$J,8994,83,0)
 ;;=AKFRDEM^DEM^AKFRM^1
 ;;^UTILITY(U,$J,8994,83,1,0)
 ;;=^^1^1^2950829^^^^
 ;;^UTILITY(U,$J,8994,83,1,1,0)
 ;;=|TAB|Receives DFN, Returns Patient Name, SSN, DOB, age, eligiblity
 ;;^UTILITY(U,$J,8994,83,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,83,2,1,0)
 ;;=DFN^1^10
 ;;^UTILITY(U,$J,8994,84,0)
 ;;=AKFRRAD^EN^AKFRTL^2
 ;;^UTILITY(U,$J,8994,84,1,0)
 ;;=^^1^1^2951219^^^^
 ;;^UTILITY(U,$J,8994,84,1,1,0)
 ;;=|TAB|Receives DFN, Returns list of radiology exams
 ;;^UTILITY(U,$J,8994,84,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,84,2,1,0)
 ;;=DFN^1^10
 ;;^UTILITY(U,$J,8994,85,0)
 ;;=AKFRLAB^LABL^AKFRLAB^2^P
 ;;^UTILITY(U,$J,8994,85,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,85,2,1,0)
 ;;=ATG^1^10
 ;;^UTILITY(U,$J,8994,86,0)
 ;;=AKFRDT^DT^AKFRM^1
 ;;^UTILITY(U,$J,8994,86,1,0)
 ;;=^^1^1^2951206^^^^
 ;;^UTILITY(U,$J,8994,86,1,1,0)
 ;;=|TAB|Return Date and Time
 ;;^UTILITY(U,$J,8994,86,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,86,2,1,0)
 ;;=DTF^1
 ;;^UTILITY(U,$J,8994,87,0)
 ;;=AKFRPT^RADP^AKFRTL^2
 ;;^UTILITY(U,$J,8994,87,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,87,2,1,0)
 ;;=RIEN^1
 ;;^UTILITY(U,$J,8994,88,0)
 ;;=AKFRPNL^PNL^AKFRGPN^2
 ;;^UTILITY(U,$J,8994,88,1,0)
 ;;=^^2^2^2950531^
 ;;^UTILITY(U,$J,8994,88,1,1,0)
 ;;=|TAB|Receives DFN , Returns list of Progress Notes
 ;;^UTILITY(U,$J,8994,88,1,2,0)
 ;;=|TAB|Date/Time, Status (signed, unsigned) , Title , Author
 ;;^UTILITY(U,$J,8994,88,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,88,2,1,0)
 ;;=DFN^1^10
 ;;^UTILITY(U,$J,8994,89,0)
 ;;=AKFRPNR^PNR^AKFRGPN^2
 ;;^UTILITY(U,$J,8994,89,1,0)
 ;;=^^1^1^2950607^^^^
 ;;^UTILITY(U,$J,8994,89,1,1,0)
 ;;=|TAB|Receive IEN to Progress Note in File 121 - returns Progress Note Report
 ;;^UTILITY(U,$J,8994,89,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,89,2,1,0)
 ;;=GMRPIFN^1^10
 ;;^UTILITY(U,$J,8994,90,0)
 ;;=AKFRLABR^LABR^AKFRLAB^2
 ;;^UTILITY(U,$J,8994,90,1,0)
 ;;=^^1^1^2950601^
 ;;^UTILITY(U,$J,8994,90,1,1,0)
 ;;=|TAB|Receive DFN - Return list of recent lab results
 ;;^UTILITY(U,$J,8994,90,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,90,2,1,0)
 ;;=DFN^1^10
 ;;^UTILITY(U,$J,8994,91,0)
 ;;=AKFRLABI^LABI^AKFRLAB^2
 ;;^UTILITY(U,$J,8994,91,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,91,2,1,0)
 ;;=DFN^1^10
 ;;^UTILITY(U,$J,8994,92,0)
 ;;=AKFRLIR^LABIR^AKFRLAB^2
 ;;^UTILITY(U,$J,8994,92,2,0)
 ;;=^8994.02A^3^3
 ;;^UTILITY(U,$J,8994,92,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,92,2,2,0)
 ;;=SDT^1^20
 ;;^UTILITY(U,$J,8994,92,2,3,0)
 ;;=EDT^1^20
 ;;^UTILITY(U,$J,8994,93,0)
 ;;=AKFRFLAB^FLAB^AKFRLAB^2
 ;;^UTILITY(U,$J,8994,93,1,0)
 ;;=^^1^1^2950606^
 ;;^UTILITY(U,$J,8994,93,1,1,0)
 ;;=|TAB|Receives DFN - returns future lab orders
 ;;^UTILITY(U,$J,8994,93,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,93,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,94,0)
 ;;=AKFRPLAB^PLAB^AKFRLAB^2
 ;;^UTILITY(U,$J,8994,94,1,0)
 ;;=^^1^1^2950606^
 ;;^UTILITY(U,$J,8994,94,1,1,0)
 ;;=|TAB|Receives DFN - returns array of Past lab orders
 ;;^UTILITY(U,$J,8994,94,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,94,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,95,0)
 ;;=AKFRDS^DS^AKFRPT^2

XWBIN00A
XWBIN00A ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,95,1,0)
 ;;=^^2^2^2960108^^^^
 ;;^UTILITY(U,$J,8994,95,1,1,0)
 ;;=Receive internal entry to discharge summary (DSN)
 ;;^UTILITY(U,$J,8994,95,1,2,0)
 ;;=Display discharge summary
 ;;^UTILITY(U,$J,8994,95,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,95,2,1,0)
 ;;=DSN^1
 ;;^UTILITY(U,$J,8994,96,0)
 ;;=AKFRHSUM^HS^AKFRPT^2^P
 ;;^UTILITY(U,$J,8994,96,1,0)
 ;;=^^1^1^2960129^^^
 ;;^UTILITY(U,$J,8994,96,1,1,0)
 ;;=|TAB|Receives DFN^Health Summary Type - Returns Health Summary
 ;;^UTILITY(U,$J,8994,96,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,96,2,1,0)
 ;;=HSIN^1^20
 ;;^UTILITY(U,$J,8994,96,2,1,1,0)
 ;;=^^1^1^2960129^^^
 ;;^UTILITY(U,$J,8994,96,2,1,1,1,0)
 ;;=|TAB|HSN = "DFN^HEALTH SUMMARY TYPE"
 ;;^UTILITY(U,$J,8994,97,0)
 ;;=AKFRMAP^ACTP^AKFRP^2
 ;;^UTILITY(U,$J,8994,97,1,0)
 ;;=^^1^1^2950607^
 ;;^UTILITY(U,$J,8994,97,1,1,0)
 ;;=|TAB|Receives DFN - return Information Actional Profile (45 day cutoff)
 ;;^UTILITY(U,$J,8994,97,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,97,2,1,0)
 ;;=DFN^1^10
 ;;^UTILITY(U,$J,8994,98,0)
 ;;=AKFRVITC^VITC^AKFRVIT^2
 ;;^UTILITY(U,$J,8994,98,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,98,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,99,0)
 ;;=AKFRVITV^VITV^AKFRVIT^1
 ;;^UTILITY(U,$J,8994,99,1,0)
 ;;=^^4^4^2950608^^^^
 ;;^UTILITY(U,$J,8994,99,1,1,0)
 ;;=|TAB|Receive Vital type (BP,T,R,P,WT,HT) and vital measurement
 ;;^UTILITY(U,$J,8994,99,1,2,0)
 ;;=|TAB|perform data validation
 ;;^UTILITY(U,$J,8994,99,1,3,0)
 ;;=|TAB|if data Okay returns Y=0
 ;;^UTILITY(U,$J,8994,99,1,4,0)
 ;;=|TAB|if invalid data returns Y=1
 ;;^UTILITY(U,$J,8994,99,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,99,2,1,0)
 ;;=vit^1^10
 ;;^UTILITY(U,$J,8994,99,2,1,1,0)
 ;;=^^1^1^2950608^
 ;;^UTILITY(U,$J,8994,99,2,1,1,1,0)
 ;;=|TAB|Vital type
 ;;^UTILITY(U,$J,8994,99,2,2,0)
 ;;=VAL^1^10
 ;;^UTILITY(U,$J,8994,99,2,2,1,0)
 ;;=^^1^1^2950608^^^
 ;;^UTILITY(U,$J,8994,99,2,2,1,1,0)
 ;;=|TAB|Vital Measurement (BP,HT,P,R,T,WT)
 ;;^UTILITY(U,$J,8994,100,0)
 ;;=AKFRVL^VITL^AKFRVIT^2
 ;;^UTILITY(U,$J,8994,100,1,0)
 ;;=^^1^1^2950901^^^^
 ;;^UTILITY(U,$J,8994,100,1,1,0)
 ;;=|TAB|Receives DFN - returns last vital signs
 ;;^UTILITY(U,$J,8994,100,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,100,2,1,0)
 ;;=DFN^1^10
 ;;^UTILITY(U,$J,8994,100,2,2,0)
 ;;=TODAY^1
 ;;^UTILITY(U,$J,8994,101,0)
 ;;=AKFRVITF^VITF^AKFRVIT^1
 ;;^UTILITY(U,$J,8994,101,1,0)
 ;;=^^3^3^2950613^^^
 ;;^UTILITY(U,$J,8994,101,1,1,0)
 ;;=|TAB|Receives Vital type, Vital Value, Clinic Location and DUZ
 ;;^UTILITY(U,$J,8994,101,1,2,0)
 ;;=|TAB|Files Vital signs
 ;;^UTILITY(U,$J,8994,101,1,3,0)
 ;;=|TAB|Returns Y=0 if filed, Y=1 if not filed
 ;;^UTILITY(U,$J,8994,101,2,0)
 ;;=^8994.02A^4^4
 ;;^UTILITY(U,$J,8994,101,2,1,0)
 ;;=DFN^1^10
 ;;^UTILITY(U,$J,8994,101,2,2,0)
 ;;=VAL^1^40
 ;;^UTILITY(U,$J,8994,101,2,2,1,0)
 ;;=^^1^1^2950613^
 ;;^UTILITY(U,$J,8994,101,2,2,1,1,0)
 ;;=|TAB|format: 'Blood Pressure^Temp^Resp^Pulse^Ht^Wt'
 ;;^UTILITY(U,$J,8994,101,2,3,0)
 ;;=CIEN^1^10
 ;;^UTILITY(U,$J,8994,101,2,3,1,0)
 ;;=^^1^1^2950613^
 ;;^UTILITY(U,$J,8994,101,2,3,1,1,0)
 ;;=|TAB|Internal entry to hospital location for clinic
 ;;^UTILITY(U,$J,8994,101,2,4,0)
 ;;=DUZ^1^10
 ;;^UTILITY(U,$J,8994,102,0)
 ;;=AKFRDATG^DATG^AKFRLAB^1
 ;;^UTILITY(U,$J,8994,102,1,0)
 ;;=^^3^3^2950614^
 ;;^UTILITY(U,$J,8994,102,1,1,0)
 ;;=|TAB|Receives internal entry number to clinic (CIEN) and
 ;;^UTILITY(U,$J,8994,102,1,2,0)
 ;;=|TAB|returns default accession test group.
 ;;^UTILITY(U,$J,8994,102,1,3,0)
 ;;=|TAB|
 ;;^UTILITY(U,$J,8994,102,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,102,2,1,0)
 ;;=CIEN^1^10
 ;;^UTILITY(U,$J,8994,103,0)
 ;;=AKFRLABL^LR^AKFRLAB^1
 ;;^UTILITY(U,$J,8994,103,1,0)
 ;;=^^1^1^2950616^
 ;;^UTILITY(U,$J,8994,103,1,1,0)
 ;;=|TAB|Receives DFN , dates of last lab,micro,cytology and surgical path
 ;;^UTILITY(U,$J,8994,103,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,103,2,1,0)
 ;;=DFN^1^10
 ;;^UTILITY(U,$J,8994,104,0)
 ;;=AKFRLABG^GLP^AKFRLGP^2
 ;;^UTILITY(U,$J,8994,104,1,0)
 ;;=^^6^6^2951211^^^
 ;;^UTILITY(U,$J,8994,104,1,1,0)
 ;;=|TAB|Receives DFN
 ;;^UTILITY(U,$J,8994,104,1,2,0)
 ;;=|TAB|         TESTS = string of iens to lab tests (175^1243)
 ;;^UTILITY(U,$J,8994,104,1,3,0)
 ;;=|TAB|         SDT   = starting date
 ;;^UTILITY(U,$J,8994,104,1,4,0)
 ;;=|TAB|         EDT   = ending date
 ;;^UTILITY(U,$J,8994,104,1,5,0)
 ;;= 
 ;;^UTILITY(U,$J,8994,104,1,6,0)
 ;;=|TAB|Returns General Report for Selected Test
 ;;^UTILITY(U,$J,8994,104,2,0)
 ;;=^8994.02A^4^4
 ;;^UTILITY(U,$J,8994,104,2,1,0)
 ;;=DFN^1^8
 ;;^UTILITY(U,$J,8994,104,2,2,0)
 ;;=TESTS^1
 ;;^UTILITY(U,$J,8994,104,2,3,0)
 ;;=SDT^1

XWBIN00B
XWBIN00B ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,104,2,4,0)
 ;;=EDT^1
 ;;^UTILITY(U,$J,8994,105,0)
 ;;=AKFRESIG^ESIG^AKFRM3^1
 ;;^UTILITY(U,$J,8994,105,1,0)
 ;;=^^4^4^2960108^^^^
 ;;^UTILITY(U,$J,8994,105,1,1,0)
 ;;=|TAB|Receives DUZ, SIG (signature code)
 ;;^UTILITY(U,$J,8994,105,1,2,0)
 ;;=|TAB|Returns 0 if verified
 ;;^UTILITY(U,$J,8994,105,1,3,0)
 ;;=|TAB||TAB|1 if no electronic signature on file
 ;;^UTILITY(U,$J,8994,105,1,4,0)
 ;;=|TAB||TAB|2 if invalid entry
 ;;^UTILITY(U,$J,8994,105,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,105,2,1,0)
 ;;=DUZ^1^10
 ;;^UTILITY(U,$J,8994,105,2,2,0)
 ;;=SIG^1
 ;;^UTILITY(U,$J,8994,106,0)
 ;;=AKFRGPNT^GPNT^AKFRGPN1^1
 ;;^UTILITY(U,$J,8994,106,1,0)
 ;;=^^2^2^2950623^^
 ;;^UTILITY(U,$J,8994,106,1,1,0)
 ;;=|TAB|Used to move progress note text from workstation
 ;;^UTILITY(U,$J,8994,106,1,2,0)
 ;;=|TAB|to ^TMP global and then file into Progress Note (file 121)
 ;;^UTILITY(U,$J,8994,106,2,0)
 ;;=^8994.02A^4^4
 ;;^UTILITY(U,$J,8994,106,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,106,2,2,0)
 ;;=GPNIEN^1
 ;;^UTILITY(U,$J,8994,106,2,2,1,0)
 ;;=^^1^1^2950622^
 ;;^UTILITY(U,$J,8994,106,2,2,1,1,0)
 ;;=|TAB|IEN of Progress Note where text is going to be filed
 ;;^UTILITY(U,$J,8994,106,2,3,0)
 ;;=TEXT^1
 ;;^UTILITY(U,$J,8994,106,2,3,1,0)
 ;;=^^1^1^2950623^^
 ;;^UTILITY(U,$J,8994,106,2,3,1,1,0)
 ;;=|TAB|Single line of text
 ;;^UTILITY(U,$J,8994,106,2,4,0)
 ;;=LNUM^1
 ;;^UTILITY(U,$J,8994,106,2,4,1,0)
 ;;=^^1^1^2950623^
 ;;^UTILITY(U,$J,8994,106,2,4,1,1,0)
 ;;=|TAB|Line number
 ;;^UTILITY(U,$J,8994,107,0)
 ;;=AKFRGPNF^PNF^AKFRGPN1^1
 ;;^UTILITY(U,$J,8994,107,1,0)
 ;;=^^2^2^2960109^^^^
 ;;^UTILITY(U,$J,8994,107,1,1,0)
 ;;=|TAB|Receives DFN, DUZ, clinic location (CIEN) , electronic signature (ESIG
 ;;^UTILITY(U,$J,8994,107,1,2,0)
 ;;=|TAB|and creates an entry in file 121 (Generic Progress Notes)
 ;;^UTILITY(U,$J,8994,107,2,0)
 ;;=^8994.02A^4^4
 ;;^UTILITY(U,$J,8994,107,2,1,0)
 ;;=DFN
 ;;^UTILITY(U,$J,8994,107,2,2,0)
 ;;=XDUZ^1
 ;;^UTILITY(U,$J,8994,107,2,3,0)
 ;;=CIEN
 ;;^UTILITY(U,$J,8994,107,2,4,0)
 ;;=ESIG
 ;;^UTILITY(U,$J,8994,108,0)
 ;;=AKFRSCD^SCD^AKFRM^2
 ;;^UTILITY(U,$J,8994,108,1,0)
 ;;=^^1^1^2960129^^^^
 ;;^UTILITY(U,$J,8994,108,1,1,0)
 ;;=|TAB|Receives DFN, returns list of Service Connected Disabilities
 ;;^UTILITY(U,$J,8994,108,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,108,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,109,0)
 ;;=AKFRUNP^UNP^AKFRM^2
 ;;^UTILITY(U,$J,8994,109,1,0)
 ;;=^^2^2^2960201^^^
 ;;^UTILITY(U,$J,8994,109,1,1,0)
 ;;=|TAB|Receives DUZ
 ;;^UTILITY(U,$J,8994,109,1,2,0)
 ;;=|TAB|Returns list of unsigned notes for an author
 ;;^UTILITY(U,$J,8994,109,2,0)
 ;;=^8994.02A^2^1
 ;;^UTILITY(U,$J,8994,109,2,2,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,110,0)
 ;;=AKFRPND^GPND^AKFRGPN1^1
 ;;^UTILITY(U,$J,8994,110,1,0)
 ;;=^^3^3^2950628^
 ;;^UTILITY(U,$J,8994,110,1,1,0)
 ;;=|TAB|Receives DFN, GPNIEN (internal entry to progress note)
 ;;^UTILITY(U,$J,8994,110,1,2,0)
 ;;=|TAB|Removes text from progress note
 ;;^UTILITY(U,$J,8994,110,1,3,0)
 ;;=|TAB|Returns 0 if successful, 1 if not
 ;;^UTILITY(U,$J,8994,110,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,110,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,110,2,2,0)
 ;;=GPNIEN
 ;;^UTILITY(U,$J,8994,111,0)
 ;;=AKFRGPNTXT^GPNTXT^AKFRGPN1^2
 ;;^UTILITY(U,$J,8994,111,1,0)
 ;;=^^3^3^2950628^
 ;;^UTILITY(U,$J,8994,111,1,1,0)
 ;;=|TAB|Receives GPNIEN (internal entry to progress note)
 ;;^UTILITY(U,$J,8994,111,1,2,0)
 ;;=|TAB|Prints text only (no date header, author)
 ;;^UTILITY(U,$J,8994,111,1,3,0)
 ;;=|TAB|
 ;;^UTILITY(U,$J,8994,111,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,111,2,1,0)
 ;;=GPNIEN^1
 ;;^UTILITY(U,$J,8994,112,0)
 ;;=AKFRGPSIG^PNSIG^AKFRGPN1^1
 ;;^UTILITY(U,$J,8994,112,1,0)
 ;;=^^2^2^2960201^^^
 ;;^UTILITY(U,$J,8994,112,1,1,0)
 ;;=|TAB|Receives GPNIEN (internal entry to progress note), DUZ, ESIG
 ;;^UTILITY(U,$J,8994,112,1,2,0)
 ;;=|TAB|Files electronic signature for unsigned note
 ;;^UTILITY(U,$J,8994,112,2,0)
 ;;=^8994.02A^3^3
 ;;^UTILITY(U,$J,8994,112,2,1,0)
 ;;=GPNIEN^1
 ;;^UTILITY(U,$J,8994,112,2,2,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,112,2,3,0)
 ;;=ESIG^1
 ;;^UTILITY(U,$J,8994,113,0)
 ;;=AKFRPNC^COSIG^AKFRGPN1^1
 ;;^UTILITY(U,$J,8994,113,1,0)
 ;;=^^2^2^2950629^^
 ;;^UTILITY(U,$J,8994,113,1,1,0)
 ;;=|TAB|Receives DUZ - returns Y=1 if needs cosigner otherwise Y=0
 ;;^UTILITY(U,$J,8994,113,1,2,0)
 ;;=|TAB|
 ;;^UTILITY(U,$J,8994,113,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,113,2,1,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,114,0)
 ;;=AKFRPNCL^COLIST^AKFRGPN1^2
 ;;^UTILITY(U,$J,8994,114,1,0)
 ;;=^^1^1^2951222^^^^
 ;;^UTILITY(U,$J,8994,114,1,1,0)
 ;;=|TAB|Returns list of prognotes that need a cosignature

XWBIN00C
XWBIN00C ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,114,2,0)
 ;;=^8994.02A^4^4
 ;;^UTILITY(U,$J,8994,114,2,1,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,114,2,2,0)
 ;;=COSIGN^1
 ;;^UTILITY(U,$J,8994,114,2,2,1,0)
 ;;=^^2^2^2951010^^
 ;;^UTILITY(U,$J,8994,114,2,2,1,1,0)
 ;;=COSIGN=0 if does not need cosigner
 ;;^UTILITY(U,$J,8994,114,2,2,1,2,0)
 ;;=COSIGN=1 if need cosigner
 ;;^UTILITY(U,$J,8994,114,2,3,0)
 ;;=AUTHOR^1
 ;;^UTILITY(U,$J,8994,114,2,4,0)
 ;;=COSIGN^1
 ;;^UTILITY(U,$J,8994,115,0)
 ;;=AKFRCOS^CESIG^AKFRGPN1^1
 ;;^UTILITY(U,$J,8994,115,1,0)
 ;;=^^3^3^2950710^^^
 ;;^UTILITY(U,$J,8994,115,1,1,0)
 ;;=|TAB|Receives GPNIEN (internal entry to Progress Note) and DUZ
 ;;^UTILITY(U,$J,8994,115,1,2,0)
 ;;=|TAB|Files Co-Signature
 ;;^UTILITY(U,$J,8994,115,1,3,0)
 ;;=|TAB|Returns Y=0 if filed, Y=1 not filed, Y=2 not authorized to cosign
 ;;^UTILITY(U,$J,8994,115,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,115,2,1,0)
 ;;=GPNIEN^1
 ;;^UTILITY(U,$J,8994,115,2,2,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,116,0)
 ;;=AKFRAMEND^AMEND^AKFRGPN1^1
 ;;^UTILITY(U,$J,8994,116,1,0)
 ;;=^^3^3^2950705^
 ;;^UTILITY(U,$J,8994,116,1,1,0)
 ;;=|TAB|Receives IEN of progress note being amended and
 ;;^UTILITY(U,$J,8994,116,1,2,0)
 ;;=|TAB|IEN of addendum note
 ;;^UTILITY(U,$J,8994,116,1,3,0)
 ;;=|TAB|Files addendum information which links the two
 ;;^UTILITY(U,$J,8994,116,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,116,2,1,0)
 ;;=GMRPORIG^1
 ;;^UTILITY(U,$J,8994,116,2,2,0)
 ;;=GMRPIFN^1
 ;;^UTILITY(U,$J,8994,117,0)
 ;;=AKFRCDX^CDX^AKFRDP^1
 ;;^UTILITY(U,$J,8994,117,1,0)
 ;;=^^1^1^2951226^^
 ;;^UTILITY(U,$J,8994,117,1,1,0)
 ;;=|TAB|Finds COMMON Diagnosis List
 ;;^UTILITY(U,$J,8994,117,1,2,0)
 ;;=|TAB|from Clinic Encounter Option File
 ;;^UTILITY(U,$J,8994,117,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,117,2,1,0)
 ;;=CIEN^1
 ;;^UTILITY(U,$J,8994,118,0)
 ;;=AKFRDXS^DXS^AKFRDP^2
 ;;^UTILITY(U,$J,8994,118,1,0)
 ;;=^^2^2^2950707^^
 ;;^UTILITY(U,$J,8994,118,1,1,0)
 ;;=|TAB|Receives internal entry to Clinic Encounter Option File
 ;;^UTILITY(U,$J,8994,118,1,2,0)
 ;;=|TAB|Returns Diagnosis Section List
 ;;^UTILITY(U,$J,8994,118,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,118,2,1,0)
 ;;=CEIEN^1
 ;;^UTILITY(U,$J,8994,119,0)
 ;;=AKFRDXC^DXC^AKFRDP^2
 ;;^UTILITY(U,$J,8994,119,1,0)
 ;;=^^3^3^2950713^^^^
 ;;^UTILITY(U,$J,8994,119,1,1,0)
 ;;=|TAB|Receives internal entry to Clinic Encounter Option File
 ;;^UTILITY(U,$J,8994,119,1,2,0)
 ;;=|TAB|and Diagnosis Section
 ;;^UTILITY(U,$J,8994,119,1,3,0)
 ;;=|TAB|Returns list of ICD9 codes associated with the Diagnosis Section
 ;;^UTILITY(U,$J,8994,119,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,119,2,1,0)
 ;;=CEIEN^1
 ;;^UTILITY(U,$J,8994,119,2,2,0)
 ;;=DXIEN^1
 ;;^UTILITY(U,$J,8994,120,0)
 ;;=AKFRCOM^PNCOM^AKFRGPN1^1
 ;;^UTILITY(U,$J,8994,120,1,0)
 ;;=^^4^4^2950710^
 ;;^UTILITY(U,$J,8994,120,1,1,0)
 ;;=|TAB|Receives GPNIEN - internal entry number to progress note
 ;;^UTILITY(U,$J,8994,120,1,2,0)
 ;;=|TAB||TAB| TEXT|TAB|- Co-signature comment
 ;;^UTILITY(U,$J,8994,120,1,3,0)
 ;;=|TAB||TAB| LNUM|TAB|- comment line count
 ;;^UTILITY(U,$J,8994,120,1,4,0)
 ;;=|TAB|Files co-signature comment
 ;;^UTILITY(U,$J,8994,120,2,0)
 ;;=^8994.02A^3^3
 ;;^UTILITY(U,$J,8994,120,2,1,0)
 ;;=GPNIEN^1
 ;;^UTILITY(U,$J,8994,120,2,2,0)
 ;;=TEXT^1
 ;;^UTILITY(U,$J,8994,120,2,3,0)
 ;;=LNUM^1
 ;;^UTILITY(U,$J,8994,121,0)
 ;;=AKFRPXS^PRS^AKFRDP^2
 ;;^UTILITY(U,$J,8994,121,1,0)
 ;;=^^2^2^2951127^^^^
 ;;^UTILITY(U,$J,8994,121,1,1,0)
 ;;=|TAB|Receives internal entry to Clinic Option File
 ;;^UTILITY(U,$J,8994,121,1,2,0)
 ;;=|TAB|Returns list of procedure sections
 ;;^UTILITY(U,$J,8994,121,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,121,2,1,0)
 ;;=CIEN^1
 ;;^UTILITY(U,$J,8994,122,0)
 ;;=AKFRPSC^PRC^AKFRDP^2
 ;;^UTILITY(U,$J,8994,122,1,0)
 ;;=^^4^4^2950713^
 ;;^UTILITY(U,$J,8994,122,1,1,0)
 ;;=|TAB|Receives internal entry to Clinic Encounter Option File and
 ;;^UTILITY(U,$J,8994,122,1,2,0)
 ;;=|TAB|Procedure section
 ;;^UTILITY(U,$J,8994,122,1,3,0)
 ;;= 
 ;;^UTILITY(U,$J,8994,122,1,4,0)
 ;;=|TAB|Returns list of CPT procedures/codes
 ;;^UTILITY(U,$J,8994,122,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,122,2,1,0)
 ;;=CEIEN^1
 ;;^UTILITY(U,$J,8994,122,2,1,1,0)
 ;;=^^1^1^2950713^
 ;;^UTILITY(U,$J,8994,122,2,1,1,1,0)
 ;;=|TAB|internal entry to Clinic Encounter Option File
 ;;^UTILITY(U,$J,8994,122,2,2,0)
 ;;=PSIEN^1
 ;;^UTILITY(U,$J,8994,122,2,2,1,0)
 ;;=^^1^1^2950713^
 ;;^UTILITY(U,$J,8994,122,2,2,1,1,0)
 ;;=|TAB|internal entry to Procedure Section
 ;;^UTILITY(U,$J,8994,123,0)
 ;;=AKFRGPA^AMEND^AKFRGPN1^1
 ;;^UTILITY(U,$J,8994,123,1,0)
 ;;=^^4^4^2950719^^
 ;;^UTILITY(U,$J,8994,123,1,1,0)
 ;;=|TAB|Receives IEN to report being ammended (ORIGIEN)

XWBIN00D
XWBIN00D ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,123,1,2,0)
 ;;=|TAB|and IEN of new report (GPNIEN)
 ;;^UTILITY(U,$J,8994,123,1,3,0)
 ;;=|TAB| 
 ;;^UTILITY(U,$J,8994,123,1,4,0)
 ;;=|TAB|API files ammendment information
 ;;^UTILITY(U,$J,8994,123,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,123,2,1,0)
 ;;=ORIGIEN^1
 ;;^UTILITY(U,$J,8994,123,2,2,0)
 ;;=GPNIEN^1
 ;;^UTILITY(U,$J,8994,124,0)
 ;;=AKFRVTS^VTS^AKFRDP^2
 ;;^UTILITY(U,$J,8994,124,1,0)
 ;;=^^2^2^2951211^^
 ;;^UTILITY(U,$J,8994,124,1,1,0)
 ;;=|TAB|Receives internal entry clinic
 ;;^UTILITY(U,$J,8994,124,1,2,0)
 ;;=|TAB|Returns list of Visit Type Sections
 ;;^UTILITY(U,$J,8994,124,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,124,2,1,0)
 ;;=CIEN^1
 ;;^UTILITY(U,$J,8994,125,0)
 ;;=AKFRVTC^VTC^AKFRDP^2
 ;;^UTILITY(U,$J,8994,125,1,0)
 ;;=^^1^1^2951211^^
 ;;^UTILITY(U,$J,8994,125,1,1,0)
 ;;=|TAB|Receives 
 ;;^UTILITY(U,$J,8994,125,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,125,2,1,0)
 ;;=CEIEN^1
 ;;^UTILITY(U,$J,8994,125,2,2,0)
 ;;=VTIEN^1
 ;;^UTILITY(U,$J,8994,126,0)
 ;;=AKFRINS^INS^AKFRM^1
 ;;^UTILITY(U,$J,8994,126,1,0)
 ;;=^^1^1^2950831^^
 ;;^UTILITY(U,$J,8994,126,1,1,0)
 ;;=|TAB|Receives DFN, returns if patient is insured (yes, no, or unknown)
 ;;^UTILITY(U,$J,8994,126,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,126,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,127,0)
 ;;=AKFRAORD^RAORD^AKFRRAD^1
 ;;^UTILITY(U,$J,8994,127,1,0)
 ;;=^^1^1^2950725^
 ;;^UTILITY(U,$J,8994,127,1,1,0)
 ;;=|TAB|Files Radiology Exam Request
 ;;^UTILITY(U,$J,8994,127,2,0)
 ;;=^8994.02A^4^4
 ;;^UTILITY(U,$J,8994,127,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,127,2,2,0)
 ;;=RADATA^1
 ;;^UTILITY(U,$J,8994,127,2,3,0)
 ;;=CIEN^1
 ;;^UTILITY(U,$J,8994,127,2,4,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,128,0)
 ;;=AKFRACH^RAOCH^AKFRRAD^1
 ;;^UTILITY(U,$J,8994,128,1,0)
 ;;=^^1^1^2950725^^
 ;;^UTILITY(U,$J,8994,128,1,1,0)
 ;;=|TAB|File clinical history for a radiology exam request
 ;;^UTILITY(U,$J,8994,128,2,0)
 ;;=^8994.02A^3^3
 ;;^UTILITY(U,$J,8994,128,2,1,0)
 ;;=RAOIFN^1
 ;;^UTILITY(U,$J,8994,128,2,2,0)
 ;;=TEXT^1
 ;;^UTILITY(U,$J,8994,128,2,3,0)
 ;;=LNUM^1
 ;;^UTILITY(U,$J,8994,129,0)
 ;;=AKFRMOD^RAMOD^AKFRRAD^1
 ;;^UTILITY(U,$J,8994,129,1,0)
 ;;=^^1^1^2950725^
 ;;^UTILITY(U,$J,8994,129,1,1,0)
 ;;=|TAB|Files Radiology request modifiers
 ;;^UTILITY(U,$J,8994,129,2,0)
 ;;=^8994.02A^3^3
 ;;^UTILITY(U,$J,8994,129,2,1,0)
 ;;=RAOIFN^1
 ;;^UTILITY(U,$J,8994,129,2,2,0)
 ;;=TEXT^1
 ;;^UTILITY(U,$J,8994,129,2,3,0)
 ;;=LNUM^1
 ;;^UTILITY(U,$J,8994,130,0)
 ;;=AKFROERR^RAOERR^AKFRRAD^1
 ;;^UTILITY(U,$J,8994,130,1,0)
 ;;=^^2^2^2950727^
 ;;^UTILITY(U,$J,8994,130,1,1,0)
 ;;=|TAB|Receives internal entry to radiology exam (file 75.1)
 ;;^UTILITY(U,$J,8994,130,1,2,0)
 ;;=|TAB|Files request in OERR module
 ;;^UTILITY(U,$J,8994,130,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,130,2,1,0)
 ;;=RAOIFN^1
 ;;^UTILITY(U,$J,8994,131,0)
 ;;=AKFRACOM^RACOM^AKFRRAD^2
 ;;^UTILITY(U,$J,8994,131,1,0)
 ;;=^^1^1^2950808^^
 ;;^UTILITY(U,$J,8994,131,1,1,0)
 ;;=|TAB|Builds list of common radiology procedures from file 71.3
 ;;^UTILITY(U,$J,8994,131,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,131,2,1,0)
 ;;=XXX^1
 ;;^UTILITY(U,$J,8994,131,2,1,1,0)
 ;;=^^1^1^2950808^^^
 ;;^UTILITY(U,$J,8994,131,2,1,1,1,0)
 ;;= 
 ;;^UTILITY(U,$J,8994,132,0)
 ;;=AKFRPP^DGRPD^AKFRM^2
 ;;^UTILITY(U,$J,8994,132,1,0)
 ;;=^^1^1^2950821^^
 ;;^UTILITY(U,$J,8994,132,1,1,0)
 ;;=Patient Profile
 ;;^UTILITY(U,$J,8994,132,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,132,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,133,0)
 ;;=AKFRVF^VISIT^AKFRVF^1
 ;;^UTILITY(U,$J,8994,133,1,0)
 ;;=^^3^3^2951005^^^^
 ;;^UTILITY(U,$J,8994,133,1,1,0)
 ;;=|TAB|Receives DFN, ien to clinic, visit type cpt code, 
 ;;^UTILITY(U,$J,8994,133,1,2,0)
 ;;= 
 ;;^UTILITY(U,$J,8994,133,1,3,0)
 ;;=|TAB|Files VISIT
 ;;^UTILITY(U,$J,8994,133,2,0)
 ;;=^8994.02A^5^5
 ;;^UTILITY(U,$J,8994,133,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,133,2,2,0)
 ;;=CIEN^1
 ;;^UTILITY(U,$J,8994,133,2,3,0)
 ;;=VCODE^1
 ;;^UTILITY(U,$J,8994,133,2,4,0)
 ;;=VTP^1
 ;;^UTILITY(U,$J,8994,133,2,5,0)
 ;;=RES^1
 ;;^UTILITY(U,$J,8994,134,0)
 ;;=AKFRVFD^DIAG^AKFRVF^1
 ;;^UTILITY(U,$J,8994,134,1,0)
 ;;=^^4^4^2950803^^
 ;;^UTILITY(U,$J,8994,134,1,1,0)
 ;;=|TAB|Receives DUZ (provider ien) and diagnostic code string
 ;;^UTILITY(U,$J,8994,134,1,2,0)
 ;;=|TAB|example: P:-SVC-AO 411.1 ANGINA,UNSTABLE
 ;;^UTILITY(U,$J,8994,134,1,3,0)
 ;;= 
 ;;^UTILITY(U,$J,8994,134,1,4,0)
 ;;=|TAB|files in LOCAL array for PCE API
 ;;^UTILITY(U,$J,8994,134,2,0)
 ;;=^8994.02A^3^3
 ;;^UTILITY(U,$J,8994,134,2,1,0)
 ;;=DCODE^1
 ;;^UTILITY(U,$J,8994,134,2,2,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,134,2,3,0)
 ;;=COUNT^1
 ;;^UTILITY(U,$J,8994,135,0)
 ;;=AKFRVFPCE^PCE^AKFRVF^2

XWBIN00E
XWBIN00E ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,135,1,0)
 ;;=^^1^1^2950919^^^
 ;;^UTILITY(U,$J,8994,135,1,1,0)
 ;;=|TAB|Execute PCE Device Interface
 ;;^UTILITY(U,$J,8994,135,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,135,2,1,0)
 ;;=START^1
 ;;^UTILITY(U,$J,8994,136,0)
 ;;=AKFRVFP^PROC^AKFRVF^1
 ;;^UTILITY(U,$J,8994,136,1,0)
 ;;=^^1^1^2960109^^^^
 ;;^UTILITY(U,$J,8994,136,1,1,0)
 ;;=|TAB|Place CPT procedure codes into PCE LOCAL array
 ;;^UTILITY(U,$J,8994,136,2,0)
 ;;=^8994.02A^4^4
 ;;^UTILITY(U,$J,8994,136,2,1,0)
 ;;=PCODE^1
 ;;^UTILITY(U,$J,8994,136,2,2,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,136,2,3,0)
 ;;=COUNT^1
 ;;^UTILITY(U,$J,8994,136,2,4,0)
 ;;=EDATA^1
 ;;^UTILITY(U,$J,8994,137,0)
 ;;=AKFRPAT^PAT^AKFRM^2
 ;;^UTILITY(U,$J,8994,137,1,0)
 ;;=^^4^4^2950809^^
 ;;^UTILITY(U,$J,8994,137,1,1,0)
 ;;=|TAB|Receives patient identifier (PID) as full ssn, or name
 ;;^UTILITY(U,$J,8994,137,1,2,0)
 ;;=|TAB|or first letter of last name with last four of ssn
 ;;^UTILITY(U,$J,8994,137,1,3,0)
 ;;=|TAB|and returns Patient Name and DFN.
 ;;^UTILITY(U,$J,8994,137,1,4,0)
 ;;=|TAB|If no match returns 1
 ;;^UTILITY(U,$J,8994,137,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,137,2,1,0)
 ;;=PID^1
 ;;^UTILITY(U,$J,8994,138,0)
 ;;=AKFRVFV^VIT^AKFRVF^1
 ;;^UTILITY(U,$J,8994,138,1,0)
 ;;=^^2^2^2951005^^^^
 ;;^UTILITY(U,$J,8994,138,1,1,0)
 ;;=|TAB|Receives vital type and value, duz and count
 ;;^UTILITY(U,$J,8994,138,1,2,0)
 ;;=|TAB|Places vital data into PCE Local array
 ;;^UTILITY(U,$J,8994,138,2,0)
 ;;=^8994.02A^3^3
 ;;^UTILITY(U,$J,8994,138,2,1,0)
 ;;=VITAL^1
 ;;^UTILITY(U,$J,8994,138,2,2,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,138,2,3,0)
 ;;=COUNT^1
 ;;^UTILITY(U,$J,8994,139,0)
 ;;=AKFRGPNA^COAL^AKFRGPN1^2
 ;;^UTILITY(U,$J,8994,139,1,0)
 ;;=^^1^1^2950815^^
 ;;^UTILITY(U,$J,8994,139,1,1,0)
 ;;=|TAB|Get list of authors with notes requiring co-signature
 ;;^UTILITY(U,$J,8994,139,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,139,2,1,0)
 ;;=XXX^1
 ;;^UTILITY(U,$J,8994,140,0)
 ;;=AKFRTV^VISIT^AKFRVF1^1
 ;;^UTILITY(U,$J,8994,140,2,0)
 ;;=^8994.02A^4^4
 ;;^UTILITY(U,$J,8994,140,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,140,2,2,0)
 ;;=CIEN^1
 ;;^UTILITY(U,$J,8994,140,2,3,0)
 ;;=VCODE^1
 ;;^UTILITY(U,$J,8994,140,2,4,0)
 ;;=VTP^1
 ;;^UTILITY(U,$J,8994,141,0)
 ;;=AKFRTD^DIAG^AKFRVF1^1
 ;;^UTILITY(U,$J,8994,141,2,0)
 ;;=^8994.02A^3^3
 ;;^UTILITY(U,$J,8994,141,2,1,0)
 ;;=DCODE^1
 ;;^UTILITY(U,$J,8994,141,2,2,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,141,2,3,0)
 ;;=COUNT^1
 ;;^UTILITY(U,$J,8994,142,0)
 ;;=AKFRTP^PROC^AKFRVF1^1
 ;;^UTILITY(U,$J,8994,142,2,0)
 ;;=^8994.02A^3^3
 ;;^UTILITY(U,$J,8994,142,2,1,0)
 ;;=PCODE^1
 ;;^UTILITY(U,$J,8994,142,2,2,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,142,2,3,0)
 ;;=COUNT^1
 ;;^UTILITY(U,$J,8994,143,0)
 ;;=AKFRTPCE^PCE^AKFRVF1^2
 ;;^UTILITY(U,$J,8994,144,0)
 ;;=AKFRENROL^ENROLL^AKFRM^1
 ;;^UTILITY(U,$J,8994,144,1,0)
 ;;=^^3^3^2950830^
 ;;^UTILITY(U,$J,8994,144,1,1,0)
 ;;=|TAB|Receives DFN and CIEN (internal entry to clinic)
 ;;^UTILITY(U,$J,8994,144,1,2,0)
 ;;=|TAB|Y = "0-ENROLLED" if patient is enrolled in clinic
 ;;^UTILITY(U,$J,8994,144,1,3,0)
 ;;=|TAB|Y = "1-NOT ENROLLED" if patient is not enrolled in clinic
 ;;^UTILITY(U,$J,8994,144,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,144,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,144,2,2,0)
 ;;=CIEN^1
 ;;^UTILITY(U,$J,8994,145,0)
 ;;=AKFRELIG^ELIG^AKFRM1^2
 ;;^UTILITY(U,$J,8994,145,1,0)
 ;;=^^1^1^2960129^^
 ;;^UTILITY(U,$J,8994,145,1,1,0)
 ;;=|TAB|Receives DFN, Returns eligibility data
 ;;^UTILITY(U,$J,8994,145,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,145,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,146,0)
 ;;=AKFRIND^INSUR^AKFRM1^2
 ;;^UTILITY(U,$J,8994,146,1,0)
 ;;=^^2^2^2950831^
 ;;^UTILITY(U,$J,8994,146,1,1,0)
 ;;=|TAB|Receives DFN, returns insurance information
 ;;^UTILITY(U,$J,8994,146,1,2,0)
 ;;=|TAB|
 ;;^UTILITY(U,$J,8994,146,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,146,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,147,0)
 ;;=AKFRFAPP1^FAPPTS^AKFRM1^2
 ;;^UTILITY(U,$J,8994,147,1,0)
 ;;=^^1^1^2950831^
 ;;^UTILITY(U,$J,8994,147,1,1,0)
 ;;=|TAB|Receives DFN, Returns list of future appointments
 ;;^UTILITY(U,$J,8994,147,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,147,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,148,0)
 ;;=AKFRSRH^SERVICE^AKFRM1^2
 ;;^UTILITY(U,$J,8994,148,1,0)
 ;;=^^3^3^2960129^^
 ;;^UTILITY(U,$J,8994,148,1,1,0)
 ;;=|TAB|Receives DFN, returns Service Related History
 ;;^UTILITY(U,$J,8994,148,1,2,0)
 ;;=|TAB|Agent orange exposure, Radiation Exposure, POW
 ;;^UTILITY(U,$J,8994,148,1,3,0)
 ;;=|TAB|Combat service, Vietnam service, Environmental exposure
 ;;^UTILITY(U,$J,8994,148,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,148,2,1,0)
 ;;=DFN^1

XWBIN00F
XWBIN00F ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,149,0)
 ;;=AKFRADD^ADDRESS^AKFRM1^2
 ;;^UTILITY(U,$J,8994,149,1,0)
 ;;=^^1^1^2950901^
 ;;^UTILITY(U,$J,8994,149,1,1,0)
 ;;=|TAB|Receives DFN, Returns address and phone number
 ;;^UTILITY(U,$J,8994,149,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,149,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,150,0)
 ;;=AKFREMP^EMPLOY^AKFRM1^2
 ;;^UTILITY(U,$J,8994,150,1,0)
 ;;=^^1^1^2950901^
 ;;^UTILITY(U,$J,8994,150,1,1,0)
 ;;=|TAB|Receives DFN, Returns Patient Employment data
 ;;^UTILITY(U,$J,8994,150,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,150,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,151,0)
 ;;=AKFRPOV^POV^AKFRM1^2
 ;;^UTILITY(U,$J,8994,151,1,0)
 ;;=^^1^1^2950915^^
 ;;^UTILITY(U,$J,8994,151,1,1,0)
 ;;=|TAB|Receives DFN, Returns previous ICD9 diagnoses
 ;;^UTILITY(U,$J,8994,151,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,151,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,152,0)
 ;;=AKFRTMP^TMP^AKFRM1^1
 ;;^UTILITY(U,$J,8994,152,1,0)
 ;;=^^7^7^2950913^^
 ;;^UTILITY(U,$J,8994,152,1,1,0)
 ;;=|TAB|Receives variables TVAR = CIEN^DUZ^DFN
 ;;^UTILITY(U,$J,8994,152,1,2,0)
 ;;=|TAB||TAB||TAB|   TYPE = RAD,LAB,VISIT,PROCEDURE,DIAGNOSES
 ;;^UTILITY(U,$J,8994,152,1,3,0)
 ;;=|TAB||TAB||TAB|   DATA = Data being filed on screen MAIN1
 ;;^UTILITY(U,$J,8994,152,1,4,0)
 ;;= 
 ;;^UTILITY(U,$J,8994,152,1,5,0)
 ;;=|TAB|Files information in ^TMP global as a backup, incase an error
 ;;^UTILITY(U,$J,8994,152,1,6,0)
 ;;=occurs on the workstation. When the problem is resolved the patient
 ;;^UTILITY(U,$J,8994,152,1,7,0)
 ;;=may be selected again and previous data is restored.
 ;;^UTILITY(U,$J,8994,152,2,0)
 ;;=^8994.02A^3^3
 ;;^UTILITY(U,$J,8994,152,2,1,0)
 ;;=TVAR^1
 ;;^UTILITY(U,$J,8994,152,2,2,0)
 ;;=TYPE^1
 ;;^UTILITY(U,$J,8994,152,2,3,0)
 ;;=DATA^1
 ;;^UTILITY(U,$J,8994,153,0)
 ;;=AKFRPNTMP^TMPN^AKFRM1^1
 ;;^UTILITY(U,$J,8994,153,1,0)
 ;;=^^1^1^2950908^
 ;;^UTILITY(U,$J,8994,153,1,1,0)
 ;;=|TAB|Files Progress Note in ^TMP as a backup
 ;;^UTILITY(U,$J,8994,153,2,0)
 ;;=^8994.02A^3^3
 ;;^UTILITY(U,$J,8994,153,2,1,0)
 ;;=TVAR^1
 ;;^UTILITY(U,$J,8994,153,2,2,0)
 ;;=LINE^1
 ;;^UTILITY(U,$J,8994,153,2,3,0)
 ;;=COUNT^1
 ;;^UTILITY(U,$J,8994,154,0)
 ;;=AKFRTMPCHK^TMPCHK^AKFRM1^2
 ;;^UTILITY(U,$J,8994,154,1,0)
 ;;=^^2^2^2950908^^^^
 ;;^UTILITY(U,$J,8994,154,1,1,0)
 ;;=|TAB|Receives TVAR (CIEN^DUZ^DFN)
 ;;^UTILITY(U,$J,8994,154,1,2,0)
 ;;=|TAB|Returns list of backup items to restore
 ;;^UTILITY(U,$J,8994,154,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,154,2,1,0)
 ;;=TVAR^1
 ;;^UTILITY(U,$J,8994,155,0)
 ;;=AKFRGTMP^GETEMP^AKFRM1^2
 ;;^UTILITY(U,$J,8994,155,1,0)
 ;;=^^2^2^2950908^
 ;;^UTILITY(U,$J,8994,155,1,1,0)
 ;;=|TAB|Receives TVAR (CIEN^DUZ^DFN) and TYPE (Progress Note, Lab Order, etc)
 ;;^UTILITY(U,$J,8994,155,1,2,0)
 ;;=|TAB|Returns array from ^TMP("ENCOUNTER_BACKUP") to restore data
 ;;^UTILITY(U,$J,8994,155,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,155,2,1,0)
 ;;=TVAR^1
 ;;^UTILITY(U,$J,8994,155,2,2,0)
 ;;=TYPE^1
 ;;^UTILITY(U,$J,8994,156,0)
 ;;=AKFRPATH^PATH^AKFRLAB^2
 ;;^UTILITY(U,$J,8994,156,2,0)
 ;;=^8994.02A^3^3
 ;;^UTILITY(U,$J,8994,156,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,156,2,2,0)
 ;;=PTYPE^1
 ;;^UTILITY(U,$J,8994,156,2,3,0)
 ;;=PDATE^1
 ;;^UTILITY(U,$J,8994,157,0)
 ;;=AKFRSPL^PLIST^AKFRLAB^2
 ;;^UTILITY(U,$J,8994,157,1,0)
 ;;=^^1^1^2950912^^
 ;;^UTILITY(U,$J,8994,157,1,1,0)
 ;;=|TAB|Receives DFN,TYPE (SP or CY), Returns list of pathology exams
 ;;^UTILITY(U,$J,8994,157,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,157,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,157,2,2,0)
 ;;=TYPE^1
 ;;^UTILITY(U,$J,8994,158,0)
 ;;=AKFRXUS^VAL^AKFRXUS^1^R
 ;;^UTILITY(U,$J,8994,158,1,0)
 ;;=^^5^5^2950921^^^^
 ;;^UTILITY(U,$J,8994,158,1,1,0)
 ;;=This API checks if a ACCESS/VERIFY code pair is valid.
 ;;^UTILITY(U,$J,8994,158,1,2,0)
 ;;=It returns "DUZ^session ok^verify needs changeing" if valid
 ;;^UTILITY(U,$J,8994,158,1,3,0)
 ;;=or a 0 if not ok.
 ;;^UTILITY(U,$J,8994,158,1,4,0)
 ;;= 
 ;;^UTILITY(U,$J,8994,158,1,5,0)
 ;;=Somewhat changed from VADIM's Kernel 8 only signon
 ;;^UTILITY(U,$J,8994,158,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,158,2,1,0)
 ;;=AVCODE^1^60^1
 ;;^UTILITY(U,$J,8994,158,2,1,1,0)
 ;;=^^1^1^2950921^^^^
 ;;^UTILITY(U,$J,8994,158,2,1,1,1,0)
 ;;=accessCode_";"_verifyCode in unencrypted form.
 ;;^UTILITY(U,$J,8994,159,0)
 ;;=AKFRES^RES^AKFRM^2
 ;;^UTILITY(U,$J,8994,159,1,0)
 ;;=^^2^2^2960108^^^
 ;;^UTILITY(U,$J,8994,159,1,1,0)
 ;;=|TAB|Receives Name (Last Name,First) and returns
 ;;^UTILITY(U,$J,8994,159,1,2,0)
 ;;=|TAB|a list of matches
 ;;^UTILITY(U,$J,8994,159,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,159,2,1,0)
 ;;=RID^1

XWBIN00G
XWBIN00G ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,160,0)
 ;;=AKFRSAMP^SAMP^AKFRLAB^2
 ;;^UTILITY(U,$J,8994,160,1,0)
 ;;=^^2^2^2951011^
 ;;^UTILITY(U,$J,8994,160,1,1,0)
 ;;=|TAB|Receives ien to file 60
 ;;^UTILITY(U,$J,8994,160,1,2,0)
 ;;=|TAB|Returns list of collection samples for microbiology tests
 ;;^UTILITY(U,$J,8994,160,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,160,2,1,0)
 ;;=TEST^1
 ;;^UTILITY(U,$J,8994,161,0)
 ;;=AKFRUSER^USER^AKFRM1^1
 ;;^UTILITY(U,$J,8994,161,1,0)
 ;;=^^1^1^2960129^^^^
 ;;^UTILITY(U,$J,8994,161,1,1,0)
 ;;=|TAB|Receives DUZ, returns user's name.
 ;;^UTILITY(U,$J,8994,161,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,161,2,1,0)
 ;;=UIEN^1
 ;;^UTILITY(U,$J,8994,162,0)
 ;;=AKFRPLS^SRCH^AKFRPL^2
 ;;^UTILITY(U,$J,8994,162,1,0)
 ;;=^^2^2^2951127^^
 ;;^UTILITY(U,$J,8994,162,1,1,0)
 ;;=Receives term to perform search on
 ;;^UTILITY(U,$J,8994,162,1,2,0)
 ;;=Returns array of matches
 ;;^UTILITY(U,$J,8994,162,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,162,2,1,0)
 ;;=TERM^1
 ;;^UTILITY(U,$J,8994,163,0)
 ;;=AKFRNCHK^NUR^AKFRM1^1
 ;;^UTILITY(U,$J,8994,163,1,0)
 ;;=^^1^1^2951127^
 ;;^UTILITY(U,$J,8994,163,1,1,0)
 ;;=|TAB|Receives DUZ returns Y=1 if DUZ is in nurse staff file
 ;;^UTILITY(U,$J,8994,163,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,163,2,1,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,164,0)
 ;;=AKFRPL^PROBL^AKFRPL^2
 ;;^UTILITY(U,$J,8994,164,1,0)
 ;;=^^1^1^2951127^^
 ;;^UTILITY(U,$J,8994,164,1,1,0)
 ;;=|TAB|Receives DFN - retrieves list of problems from PROBLEM file
 ;;^UTILITY(U,$J,8994,164,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,164,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,165,0)
 ;;=AKFRPLD^DETAIL^AKFRPL^1
 ;;^UTILITY(U,$J,8994,165,1,0)
 ;;=^^2^2^2951129^
 ;;^UTILITY(U,$J,8994,165,1,1,0)
 ;;=|TAB|Receives ien to Problem file
 ;;^UTILITY(U,$J,8994,165,1,2,0)
 ;;=|TAB|Returns more detailed information on problem
 ;;^UTILITY(U,$J,8994,165,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,165,2,1,0)
 ;;=PROBLEM^1
 ;;^UTILITY(U,$J,8994,166,0)
 ;;=AKFRPLC^CMNT^AKFRPL^2
 ;;^UTILITY(U,$J,8994,166,1,0)
 ;;=^^2^2^2951201^
 ;;^UTILITY(U,$J,8994,166,1,1,0)
 ;;=|TAB|Recieves ien to Problem file
 ;;^UTILITY(U,$J,8994,166,1,2,0)
 ;;=|TAB|Returns notes/comments
 ;;^UTILITY(U,$J,8994,166,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,166,2,1,0)
 ;;=PROBLEM^1
 ;;^UTILITY(U,$J,8994,167,0)
 ;;=AKFRPFILE^FILE^AKFRPL^1
 ;;^UTILITY(U,$J,8994,167,1,0)
 ;;=^^1^1^2951206^
 ;;^UTILITY(U,$J,8994,167,1,1,0)
 ;;=|TAB|Files a new entry in the PROBLEM file
 ;;^UTILITY(U,$J,8994,167,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,167,2,1,0)
 ;;=PROBDATA^1
 ;;^UTILITY(U,$J,8994,168,0)
 ;;=AKFRPLCMNT^ACMNT^AKFRPL^1
 ;;^UTILITY(U,$J,8994,168,1,0)
 ;;=^^1^1^2951208^
 ;;^UTILITY(U,$J,8994,168,1,1,0)
 ;;=|TAB|File a new comment for a PROBLEM
 ;;^UTILITY(U,$J,8994,168,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,168,2,1,0)
 ;;=PROBDATA^1
 ;;^UTILITY(U,$J,8994,169,0)
 ;;=AKFRPLEDT^EDIT^AKFRPL^1
 ;;^UTILITY(U,$J,8994,169,1,0)
 ;;=^^2^2^2951211^
 ;;^UTILITY(U,$J,8994,169,1,1,0)
 ;;=|TAB|Receives Problem ien, DUZ and changes to problem
 ;;^UTILITY(U,$J,8994,169,1,2,0)
 ;;=|TAB|File Changes to a Problem
 ;;^UTILITY(U,$J,8994,169,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,169,2,1,0)
 ;;=PROBDATA^1
 ;;^UTILITY(U,$J,8994,170,0)
 ;;=MAG OLU CONSULT^CONLU^MAGRDEL3^2^R
 ;;^UTILITY(U,$J,8994,170,1,0)
 ;;=^^1^1^2960105^
 ;;^UTILITY(U,$J,8994,170,1,1,0)
 ;;=Returns image information for a teleconsultation in file 2005.15
 ;;^UTILITY(U,$J,8994,170,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,170,2,1,0)
 ;;=MAGIN^1^255^1
 ;;^UTILITY(U,$J,8994,170,2,1,1,0)
 ;;=^^1^1^2960105^
 ;;^UTILITY(U,$J,8994,170,2,1,1,1,0)
 ;;=Piece1=Entry number in file 2005.15
 ;;^UTILITY(U,$J,8994,170,3,0)
 ;;=^^2^2^2960105^
 ;;^UTILITY(U,$J,8994,170,3,1,0)
 ;;=Returns array where each node contains information about
 ;;^UTILITY(U,$J,8994,170,3,2,0)
 ;;=an image in the teleconsulation requested.
 ;;^UTILITY(U,$J,8994,171,0)
 ;;=MAG ABSJB^ABSJB^MAGRDEL3^1^R
 ;;^UTILITY(U,$J,8994,171,1,0)
 ;;=^^1^1^2960118^
 ;;^UTILITY(U,$J,8994,171,1,1,0)
 ;;=Sets queue entry to create abstract and/or copy to jukebox.
 ;;^UTILITY(U,$J,8994,171,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,171,2,1,0)
 ;;=MAGIEN^1^255^1
 ;;^UTILITY(U,$J,8994,171,2,1,1,0)
 ;;=^^1^1^2960118^
 ;;^UTILITY(U,$J,8994,171,2,1,1,1,0)
 ;;=Pointer to image file
 ;;^UTILITY(U,$J,8994,171,3,0)
 ;;=^^2^2^2960118^
 ;;^UTILITY(U,$J,8994,171,3,1,0)
 ;;=Piece1=0 if failure, Piece2=Error message
 ;;^UTILITY(U,$J,8994,171,3,2,0)
 ;;=Piece1=1 if successful
 ;;^UTILITY(U,$J,8994,172,0)
 ;;=AKFRPLINACT^INACT^AKFRPL^1
 ;;^UTILITY(U,$J,8994,172,1,0)
 ;;=^^1^1^2951213^

XWBIN00H
XWBIN00H ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,172,1,1,0)
 ;;=|TAB|Inactivates a problem - files comment and date resolved
 ;;^UTILITY(U,$J,8994,172,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,172,2,1,0)
 ;;=PROBDATA^1
 ;;^UTILITY(U,$J,8994,173,0)
 ;;=AKFRESFILE^ESIGN^AKFRM3^1
 ;;^UTILITY(U,$J,8994,173,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,173,2,1,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,173,2,2,0)
 ;;=SIG^1
 ;;^UTILITY(U,$J,8994,174,0)
 ;;=AKFRSIGBLK^SIGBLK^AKFRM3^1
 ;;^UTILITY(U,$J,8994,174,1,0)
 ;;=^^1^1^2960108^^
 ;;^UTILITY(U,$J,8994,174,1,1,0)
 ;;=|TAB|Receives DUZ returns signature block + title
 ;;^UTILITY(U,$J,8994,174,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,174,2,1,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,175,0)
 ;;=AKFRESCHK^ESIGV^AKFRM3^1
 ;;^UTILITY(U,$J,8994,175,1,0)
 ;;=^^2^2^2960108^
 ;;^UTILITY(U,$J,8994,175,1,1,0)
 ;;=Receives new electronic signature
 ;;^UTILITY(U,$J,8994,175,1,2,0)
 ;;=verifies pattern match (6-20 char no lowercase, no control char)
 ;;^UTILITY(U,$J,8994,175,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,175,2,1,0)
 ;;=SIG^1
 ;;^UTILITY(U,$J,8994,176,0)
 ;;=AKFRESCLR^ESIGC^AKFRM3^1
 ;;^UTILITY(U,$J,8994,176,1,0)
 ;;=^^1^1^2960108^
 ;;^UTILITY(U,$J,8994,176,1,1,0)
 ;;=Receives DUZ - clears electronic signature code
 ;;^UTILITY(U,$J,8994,176,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,176,2,1,0)
 ;;=DUZ^1
 ;;^UTILITY(U,$J,8994,177,0)
 ;;=AKFRDSL^DSL^AKFRPT^2
 ;;^UTILITY(U,$J,8994,177,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,177,2,1,0)
 ;;=DFN^1
 ;;^UTILITY(U,$J,8994,178,0)
 ;;=AKFRPNTL^TLIST^AKFRTP^2
 ;;^UTILITY(U,$J,8994,178,1,0)
 ;;=^^2^2^2960131^^
 ;;^UTILITY(U,$J,8994,178,1,1,0)
 ;;=|TAB|Receives ien to clinic
 ;;^UTILITY(U,$J,8994,178,1,2,0)
 ;;=|TAB|Returns list of progress note templates
 ;;^UTILITY(U,$J,8994,178,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,178,2,1,0)
 ;;=CLINIC^1
 ;;^UTILITY(U,$J,8994,179,0)
 ;;=AKFRTPL^EXP^AKFRTPL^2^P
 ;;^UTILITY(U,$J,8994,179,1,0)
 ;;=^^6^6^2960119^^^^
 ;;^UTILITY(U,$J,8994,179,1,1,0)
 ;;= 
 ;;^UTILITY(U,$J,8994,179,1,2,0)
 ;;=EXP(Y,IEN,DFN)  ;-- Template Expansion
 ;;^UTILITY(U,$J,8994,179,1,3,0)
 ;;=        ; -- IEN := Internal Entry Number of Template
 ;;^UTILITY(U,$J,8994,179,1,4,0)
 ;;=        ; -- DFN := Internal Entry Number of Patient File
 ;;^UTILITY(U,$J,8994,179,1,5,0)
 ;;=        ; -- Returns: Array of expanded text
 ;;^UTILITY(U,$J,8994,179,1,6,0)
 ;;= 
 ;;^UTILITY(U,$J,8994,179,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,179,2,1,0)
 ;;=IEN^1^15^1
 ;;^UTILITY(U,$J,8994,179,2,1,1,0)
 ;;=^^1^1^2960117^
 ;;^UTILITY(U,$J,8994,179,2,1,1,1,0)
 ;;=; -- IEN := Internal Entry Number of Template
 ;;^UTILITY(U,$J,8994,179,2,2,0)
 ;;=DFN^1^15^1
 ;;^UTILITY(U,$J,8994,179,2,2,1,0)
 ;;=^^1^1^2960119^^^
 ;;^UTILITY(U,$J,8994,179,2,2,1,1,0)
 ;;=; -- DFN := Internal Entry Number of Patient File
 ;;^UTILITY(U,$J,8994,179,3,0)
 ;;=^^1^1^2960119^^^
 ;;^UTILITY(U,$J,8994,179,3,1,0)
 ;;=Array of expanded Text
 ;;^UTILITY(U,$J,8994,180,0)
 ;;=AKFRTPL-POP^POPUP^AKFRTPL^2^P
 ;;^UTILITY(U,$J,8994,180,1,0)
 ;;=^^3^3^2960131^^
 ;;^UTILITY(U,$J,8994,180,1,1,0)
 ;;=POPUP(Y,IEN)    ;Get the list to load the pop-up menu with this template
 ;;^UTILITY(U,$J,8994,180,1,2,0)
 ;;=        ; -- IEN := Internal Entry Number of Template
 ;;^UTILITY(U,$J,8994,180,1,3,0)
 ;;=        ;  Returns: Array of Items for Pop-Up Menu
 ;;^UTILITY(U,$J,8994,180,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,180,2,1,0)
 ;;=IEN^1^15^1
 ;;^UTILITY(U,$J,8994,180,2,1,1,0)
 ;;=^^1^1^2960131^^
 ;;^UTILITY(U,$J,8994,180,2,1,1,1,0)
 ;;=; -- IEN := Internal Entry Number of Template
 ;;^UTILITY(U,$J,8994,180,3,0)
 ;;=^^1^1^2960131^^
 ;;^UTILITY(U,$J,8994,180,3,1,0)
 ;;=;  Returns: Array of Items for Pop-Up Menu
 ;;^UTILITY(U,$J,8994,181,0)
 ;;=AKFRPNTITLE^PNTL^AKFRGPN^1
 ;;^UTILITY(U,$J,8994,181,1,0)
 ;;=^^2^2^2960131^
 ;;^UTILITY(U,$J,8994,181,1,1,0)
 ;;=|TAB|Receives CIEN (internal entry to clinic)
 ;;^UTILITY(U,$J,8994,181,1,2,0)
 ;;=|TAB|Returns Default Progress Note Title and ien to file 121.2
 ;;^UTILITY(U,$J,8994,181,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,181,2,1,0)
 ;;=CIEN^1
 ;;^UTILITY(U,$J,8994,182,0)
 ;;=MAGGRADLIST^LIST^MAGGTRA^2^P
 ;;^UTILITY(U,$J,8994,182,1,0)
 ;;=^^1^1^2960213^^^^
 ;;^UTILITY(U,$J,8994,182,1,1,0)
 ;;=Input is Radiology patient 'RADFN'. Output is a list of Patient exams.
 ;;^UTILITY(U,$J,8994,182,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,182,2,1,0)
 ;;=DATA^1^30^1
 ;;^UTILITY(U,$J,8994,182,2,1,1,0)
 ;;=^^1^1^2960213^^^^
 ;;^UTILITY(U,$J,8994,182,2,1,1,1,0)
 ;;=This is the Radiology Patient DFN   i.e.  RADFN
 ;;^UTILITY(U,$J,8994,182,3,0)
 ;;=^^10^10^2960213^^^^

XWBIN00I
XWBIN00I ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,182,3,1,0)
 ;;=ARRAY(0) = "0^reason for failure "   IF unsuccessful
 ;;^UTILITY(U,$J,8994,182,3,2,0)
 ;;=If successful
 ;;^UTILITY(U,$J,8994,182,3,3,0)
 ;;=ARRAY(0) = # returned ^ # column headers ^ header 1 ^header 2 ^ header....
 ;;^UTILITY(U,$J,8994,182,3,4,0)
 ;;=ARRAY(1..n) = col 1 value ^ col 2 value ^.. col n value ^ _ RAD DATA
 ;;^UTILITY(U,$J,8994,182,3,5,0)
 ;;=   RAD DATA is the Radiology values stored in ^TMP($J,"RAEX",x) that
 ;;^UTILITY(U,$J,8994,182,3,6,0)
 ;;=   the radiology procedure RAPTLU sets during the search for patien
 ;;^UTILITY(U,$J,8994,182,3,7,0)
 ;;=   exams.  (see routine RAPTLU )
 ;;^UTILITY(U,$J,8994,182,3,8,0)
 ;;=      ^TMP($J,"RAEX",RACNT)=
 ;;^UTILITY(U,$J,8994,182,3,9,0)
 ;;=       RADFN_"^"_RADTI_"^"_RACNI_"^"_RANME_"^"_RASSN_"^"
 ;;^UTILITY(U,$J,8994,182,3,10,0)
 ;;=      _RADATE_"^"_RADTE_"^"_RACN_"^"_RAPRC_"^"_RARPT_"^"_RAST
 ;;^UTILITY(U,$J,8994,183,0)
 ;;=MAGGRADPTR^MAGPTR^MAGGTRA^1^P
 ;;^UTILITY(U,$J,8994,183,1,0)
 ;;=^^1^1^2960213^
 ;;^UTILITY(U,$J,8994,183,1,1,0)
 ;;=Input DUZ, MAGIEN, RAD DATA.  Output 1^message if OK,  0^message if NOT OK.
 ;;^UTILITY(U,$J,8994,183,2,0)
 ;;=^8994.02A^3^3
 ;;^UTILITY(U,$J,8994,183,2,1,0)
 ;;=DUZ^1^^1
 ;;^UTILITY(U,$J,8994,183,2,1,1,0)
 ;;=^^2^2^2960213^
 ;;^UTILITY(U,$J,8994,183,2,1,1,1,0)
 ;;=DUZ of Window user.   ( this is tempory, untill a more secure way is 
 ;;^UTILITY(U,$J,8994,183,2,1,1,2,0)
 ;;=                        decided upon  )
 ;;^UTILITY(U,$J,8994,183,2,2,0)
 ;;=MAGIEN^1^^1
 ;;^UTILITY(U,$J,8994,183,2,2,1,0)
 ;;=^^1^1^2960213^
 ;;^UTILITY(U,$J,8994,183,2,2,1,1,0)
 ;;=Internal entry number of Image File entry  ^MAG(2005,
 ;;^UTILITY(U,$J,8994,183,2,3,0)
 ;;=DATA^1^255^1
 ;;^UTILITY(U,$J,8994,183,2,3,1,0)
 ;;=^^10^10^2960213^
 ;;^UTILITY(U,$J,8994,183,2,3,1,1,0)
 ;;=First "^" piece is MAGIEN, The IMAGE File Internal number.  ^MAG(2005,
 ;;^UTILITY(U,$J,8994,183,2,3,1,2,0)
 ;;=Next  "^" pieces are the same RAD DATA that was sent in the 
 ;;^UTILITY(U,$J,8994,183,2,3,1,3,0)
 ;;= RPC Call MAGGRADLIST, as the return Array.
 ;;^UTILITY(U,$J,8994,183,2,3,1,4,0)
 ;;=    RADFN_"^"_RADTI_"^"_RACNI_"^"_RANME_"^"_RASSN_"^"
 ;;^UTILITY(U,$J,8994,183,2,3,1,5,0)
 ;;=   _RADATE_"^"_RADTE_"^"_RACN_"^"_RAPRC_"^"_RARPT_"^"_RAST
 ;;^UTILITY(U,$J,8994,183,2,3,1,6,0)
 ;;=The same DATA that the RAD procedure RAPTLU saved in ^TMP($J,"RAEX",RACNT)
 ;;^UTILITY(U,$J,8994,183,2,3,1,7,0)
 ;;= We saved the variables that the RAD Routine RAPTLU set up when creating
 ;;^UTILITY(U,$J,8994,183,2,3,1,8,0)
 ;;=the list of Rad Exams for the patient.
 ;;^UTILITY(U,$J,8994,183,2,3,1,9,0)
 ;;=We send it back as input here, Initialize the variables so when we
 ;;^UTILITY(U,$J,8994,183,2,3,1,10,0)
 ;;=need to call any Rad Procedure, we have what we need.\
 ;;^UTILITY(U,$J,8994,183,3,0)
 ;;=^^2^2^2960213^
 ;;^UTILITY(U,$J,8994,183,3,1,0)
 ;;=If successful   '1^message'
 ;;^UTILITY(U,$J,8994,183,3,2,0)
 ;;=If unsuccessful '0^message'
 ;;^UTILITY(U,$J,8994,184,0)
 ;;=MAGGTEST2^TEST2^MAGGTEST^2
 ;;^UTILITY(U,$J,8994,184,1,0)
 ;;=^^1^1^2960214^
 ;;^UTILITY(U,$J,8994,184,1,1,0)
 ;;=TEST CALLS
 ;;^UTILITY(U,$J,8994,185,0)
 ;;=MAGGTEST1^TEST1^MAGGTEST^2^P
 ;;^UTILITY(U,$J,8994,186,0)
 ;;=MAGGPATADD^ADDPAT^MAGGTPT^1^P
 ;;^UTILITY(U,$J,8994,186,1,0)
 ;;=^^1^1^2960226^
 ;;^UTILITY(U,$J,8994,186,1,1,0)
 ;;=Adds a new patient to patient file.
 ;;^UTILITY(U,$J,8994,187,0)
 ;;=MAGGPATINTINF^INTINF^MAGGTPT^1^P
 ;;^UTILITY(U,$J,8994,187,1,0)
 ;;=^^3^3^2960226^
 ;;^UTILITY(U,$J,8994,187,1,1,0)
 ;;=Gets patient info in internal format. This call is used to get info
 ;;^UTILITY(U,$J,8994,187,1,2,0)
 ;;=in format needed to Add New Patient to Remote database. 
 ;;^UTILITY(U,$J,8994,187,1,3,0)
 ;;=(untill we start using FM Components)
 ;;^UTILITY(U,$J,8994,188,0)
 ;;=MAGGPATDUPCHK^DUPCHK^MAGGTPT^2^P
 ;;^UTILITY(U,$J,8994,188,1,0)
 ;;=^^1^1^2960227^
 ;;^UTILITY(U,$J,8994,188,1,1,0)
 ;;=Runs the ^DPTDUP routine, tests for possible duplicate patients.
 ;;^UTILITY(U,$J,8994,188,3,0)
 ;;=^^1^1^2960227^
 ;;^UTILITY(U,$J,8994,188,3,1,0)
 ;;=ARRAY of patient information, (structure soon to change.)
 ;;^UTILITY(U,$J,8994,189,0)
 ;;=MAGGDUZKEY^KEY^MAGGTIU^1^P
 ;;^UTILITY(U,$J,8994,189,1,0)
 ;;=^^1^1^2960228^
 ;;^UTILITY(U,$J,8994,189,1,1,0)
 ;;=Checks to see if USER has Security Key"
 ;;^UTILITY(U,$J,8994,189,3,0)
 ;;=^^3^3^2960228^
 ;;^UTILITY(U,$J,8994,189,3,1,0)
 ;;="1^Okay"                             if user has key
 ;;^UTILITY(U,$J,8994,189,3,2,0)
 ;;="0^User doesn't have Security Key"   if not.
 ;;^UTILITY(U,$J,8994,189,3,3,0)
 ;;="0^NO Key in Security Key File"      if Key isn't on file

XWBIN00J
XWBIN00J ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 Q:'DIFQR(8994)  F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,8994,193,0)
 ;;=XWB EGCHO STRING^ECHO1^XWBZ1^1^P
 ;;^UTILITY(U,$J,8994,193,1,0)
 ;;=^^3^3^2950202^
 ;;^UTILITY(U,$J,8994,193,1,1,0)
 ;;=This call echos any string passed as parameter.
 ;;^UTILITY(U,$J,8994,193,1,2,0)
 ;;= 
 ;;^UTILITY(U,$J,8994,193,1,3,0)
 ;;=to run d ECHO^XWBZ1(something)
 ;;^UTILITY(U,$J,8994,193,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,193,2,1,0)
 ;;=INP^1^255
 ;;^UTILITY(U,$J,8994,194,0)
 ;;=XWB EGCHO LIST^LIST^XWBZ1^2
 ;;^UTILITY(U,$J,8994,195,0)
 ;;=XWB EGCHO BIG LIST^BIG^XWBZ1^4^^^^1
 ;;^UTILITY(U,$J,8994,196,0)
 ;;=XWB EGCHO SORT LIST^SRT^XWBZ1^2^P
 ;;^UTILITY(U,$J,8994,196,1,0)
 ;;=^^1^1^2950503^
 ;;^UTILITY(U,$J,8994,196,1,1,0)
 ;;=Sorts a given numeric array, starting from HI or LO
 ;;^UTILITY(U,$J,8994,196,2,0)
 ;;=^8994.02A^2^2
 ;;^UTILITY(U,$J,8994,196,2,1,0)
 ;;=DIRECTION^1^2^1
 ;;^UTILITY(U,$J,8994,196,2,1,1,0)
 ;;=^^1^1^2950503^
 ;;^UTILITY(U,$J,8994,196,2,1,1,1,0)
 ;;=The string LO or HI
 ;;^UTILITY(U,$J,8994,196,2,2,0)
 ;;=ARRAY^2
 ;;^UTILITY(U,$J,8994,196,2,2,1,0)
 ;;=^^2^2^2950503^
 ;;^UTILITY(U,$J,8994,196,2,2,1,1,0)
 ;;=The array of numbers.  Pass using . syntax
 ;;^UTILITY(U,$J,8994,196,2,2,1,2,0)
 ;;=X(12)="",X(23)="",... for example
 ;;^UTILITY(U,$J,8994,196,3,0)
 ;;=^^1^1^2950503^
 ;;^UTILITY(U,$J,8994,196,3,1,0)
 ;;=Sorted array
 ;;^UTILITY(U,$J,8994,197,0)
 ;;=XWB EGCHO MEMO^MEMO^XWBZ1^4^P^^^1
 ;;^UTILITY(U,$J,8994,198,0)
 ;;=XWB RPC LIST^APILIST^XWBFM^2^P
 ;;^UTILITY(U,$J,8994,198,2,0)
 ;;=^8994.02A^1^1
 ;;^UTILITY(U,$J,8994,198,2,1,0)
 ;;=START^1
 ;;^UTILITY(U,$J,8994,199,0)
 ;;=XWB CREATE CONTEXT^CRCONTXT^XWBSEC^1
 ;;^UTILITY(U,$J,8994,200,0)
 ;;=ADESetFac^SETFC^ADEKT^1
 ;;^UTILITY(U,$J,8994,201,0)
 ;;=ADEGetFac^GETFC^ADEKT^1
 ;;^UTILITY(U,$J,8994,202,0)
 ;;=ADE GET VARIABLE VALUE^VARVAL^ADEKT^1
 ;;^UTILITY(U,$J,8994,203,0)
 ;;=ADE MULTIPLE PARAM TEST^MULTST^ADEKT^2
 ;;^UTILITY(U,$J,8994,204,0)
 ;;=ADE PATIENT LOOKUP^PTLOOK^ADEKT^1
 ;;^UTILITY(U,$J,8994,205,0)
 ;;=ADE APPT ADD^APADD^ADEKT1^1
 ;;^UTILITY(U,$J,8994,206,0)
 ;;=ADE APPT CANCEL^APCAN^ADEKT1^1
 ;;^UTILITY(U,$J,8994,207,0)
 ;;=ADE APPT CONFLICT^APCONFPT^ADEKT1^1
 ;;^UTILITY(U,$J,8994,208,0)
 ;;=ADE APPT DISPLAY^APDIS^ADEKT1^1
 ;;^UTILITY(U,$J,8994,209,0)
 ;;=ADE PATIENT ADDRESS^PTADDR^ADEKT^1
 ;;^UTILITY(U,$J,8994,210,0)
 ;;=FSC RPC^RPC^FSCRPX^4^P^^^1
 ;;^UTILITY(U,$J,8994,210,1,0)
 ;;=^^1^1^2980119^^
 ;;^UTILITY(U,$J,8994,210,1,1,0)
 ;;=NOIS remote procedure entry. All RPCs for NOIS route through this entry.

XWBIN00K
XWBIN00K ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"DIPT",5735,0)
 ;;=XWB SEND API^2950202^^8994^^^^1
 ;;^UTILITY(U,$J,"DIPT",5735,1,0)
 ;;=^.41^2^2
 ;;^UTILITY(U,$J,"DIPT",5735,1,1,0)
 ;;=8994^1^^^^2950202^
 ;;^UTILITY(U,$J,"DIPT",5735,1,1,"F",0)
 ;;=^.411^9^9
 ;;^UTILITY(U,$J,"DIPT",5735,1,1,"F",1,0)
 ;;=.01
 ;;^UTILITY(U,$J,"DIPT",5735,1,1,"F",2,0)
 ;;=.02
 ;;^UTILITY(U,$J,"DIPT",5735,1,1,"F",3,0)
 ;;=.03
 ;;^UTILITY(U,$J,"DIPT",5735,1,1,"F",4,0)
 ;;=.04
 ;;^UTILITY(U,$J,"DIPT",5735,1,1,"F",5,0)
 ;;=.05
 ;;^UTILITY(U,$J,"DIPT",5735,1,1,"F",6,0)
 ;;=.06
 ;;^UTILITY(U,$J,"DIPT",5735,1,1,"F",7,0)
 ;;=.07
 ;;^UTILITY(U,$J,"DIPT",5735,1,1,"F",8,0)
 ;;=1
 ;;^UTILITY(U,$J,"DIPT",5735,1,1,"F",9,0)
 ;;=3
 ;;^UTILITY(U,$J,"DIPT",5735,1,2,0)
 ;;=8994.02^2^8994^3^INPUT PARAMETER^2950202^
 ;;^UTILITY(U,$J,"DIPT",5735,1,2,"F",0)
 ;;=^.411^5^5
 ;;^UTILITY(U,$J,"DIPT",5735,1,2,"F",1,0)
 ;;=.01
 ;;^UTILITY(U,$J,"DIPT",5735,1,2,"F",2,0)
 ;;=.02
 ;;^UTILITY(U,$J,"DIPT",5735,1,2,"F",3,0)
 ;;=.03
 ;;^UTILITY(U,$J,"DIPT",5735,1,2,"F",4,0)
 ;;=.04
 ;;^UTILITY(U,$J,"DIPT",5735,1,2,"F",5,0)
 ;;=1
 ;;^UTILITY(U,$J,"DIPT",5735,1,"B",8994,1)
 ;;=
 ;;^UTILITY(U,$J,"DIPT",5735,1,"B",8994.02,2)
 ;;=
 ;;^UTILITY(U,$J,"DIPT",5735,"F",2)
 ;;=S DIFGT="XWB SEND API",DIFGBFN=8994 D FG^DIFGB;X
 ;;^UTILITY(U,$J,"OPT",29219162,0)
 ;;=XWB EGCHO^RPC BROKER DEMO/TEST^^B^^^^^^^^
 ;;^UTILITY(U,$J,"OPT",29219162,99.1)
 ;;=56917,37375
 ;;^UTILITY(U,$J,"OPT",29219162,"RPC",0)
 ;;=^19.05P^6^6
 ;;^UTILITY(U,$J,"OPT",29219162,"RPC",1,0)
 ;;=194
 ;;^UTILITY(U,$J,"OPT",29219162,"RPC",2,0)
 ;;=195
 ;;^UTILITY(U,$J,"OPT",29219162,"RPC",3,0)
 ;;=193
 ;;^UTILITY(U,$J,"OPT",29219162,"RPC",4,0)
 ;;=197
 ;;^UTILITY(U,$J,"OPT",29219162,"RPC",5,0)
 ;;=196
 ;;^UTILITY(U,$J,"OPT",29219162,"RPC",6,0)
 ;;=10
 ;;^UTILITY(U,$J,"OPT",29219162,"RPC","B",10,6)
 ;;=
 ;;^UTILITY(U,$J,"OPT",29219162,"RPC","B",193,3)
 ;;=
 ;;^UTILITY(U,$J,"OPT",29219162,"RPC","B",194,1)
 ;;=
 ;;^UTILITY(U,$J,"OPT",29219162,"RPC","B",195,2)
 ;;=
 ;;^UTILITY(U,$J,"OPT",29219162,"RPC","B",196,5)
 ;;=
 ;;^UTILITY(U,$J,"OPT",29219162,"RPC","B",197,4)
 ;;=
 ;;^UTILITY(U,$J,"OPT",29219162,"U")
 ;;=RPC BROKER DEMO/TEST
 ;;^UTILITY(U,$J,"OPT",29219163,0)
 ;;=XWB LISTENER STARTER^Start RPC Broker Listeners^^R^^^^^^^^
 ;;^UTILITY(U,$J,"OPT",29219163,25)
 ;;=STRTALL^XWBTCP
 ;;^UTILITY(U,$J,"OPT",29219163,200.9)
 ;;=s
 ;;^UTILITY(U,$J,"OPT",29219163,"U")
 ;;=START RPC BROKER LISTENERS
 ;;^UTILITY(U,$J,"PKG",2321,0)
 ;;=KERNEL BROKER PROTOTYPE^XWB^Data Broker Prototype
 ;;^UTILITY(U,$J,"PKG",2321,4,0)
 ;;=^9.44PA^1^1
 ;;^UTILITY(U,$J,"PKG",2321,4,1,0)
 ;;=8994
 ;;^UTILITY(U,$J,"PKG",2321,4,1,222)
 ;;=y^^^^^^y^o
 ;;^UTILITY(U,$J,"PKG",2321,4,"B",8994,1)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,0)
 ;;=^9.49I^7^7
 ;;^UTILITY(U,$J,"PKG",2321,22,1,0)
 ;;=1.0T1^2950504
 ;;^UTILITY(U,$J,"PKG",2321,22,2,0)
 ;;=1.0T4^2950208^2950209
 ;;^UTILITY(U,$J,"PKG",2321,22,3,0)
 ;;=1.0T5^2950213^2950221
 ;;^UTILITY(U,$J,"PKG",2321,22,4,0)
 ;;=1.0T6^2950223
 ;;^UTILITY(U,$J,"PKG",2321,22,5,0)
 ;;=1.0T7^2950628^2951003
 ;;^UTILITY(U,$J,"PKG",2321,22,6,0)
 ;;=1.0T11^2951031^2970312^184
 ;;^UTILITY(U,$J,"PKG",2321,22,7,0)
 ;;=1.1T3^2961119^2970317^58
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,0)
 ;;=^^679^679^2970317
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,1,0)
 ;;=PRC Broker Version 1.1 Release Notes 11/22/96 4:29 PM 13
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,2,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,3,0)
 ;;=PRC Broker Version 1.1 Release Notes
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,4,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,5,0)
 ;;=This document contains brief descriptions of all the improvements
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,6,0)
 ;;=and bug fixes that we've implemented to date in RPC Broker
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,7,0)
 ;;=version 1.1T3.  The items are grouped by the versions of the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,8,0)
 ;;=Broker and within each version by server and client-related
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,9,0)
 ;;=issues.  The most recent items are near the top and the oldest
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,10,0)
 ;;=are at the bottom, where we also have the latest installation
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,11,0)
 ;;=procedures.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,12,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,13,0)
 ;;=Server version 1.1T3 Enhancements
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,14,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,15,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,16,0)
 ;;=o    MSM for NT 4.3.0 MSERVER replaces RPC Broker Listener
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,17,0)
 ;;=  process
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,18,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,19,0)
 ;;=  MSM for NT in version 4.3.0 introduced a new generic TCP/IP

XWBIN00L
XWBIN00L ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,20,0)
 ;;=  listener MSERVER.  MSERVER is an actual routine in the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,21,0)
 ;;=  manager's UCI that runs and listens to all the ports that you
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,22,0)
 ;;=  specify in SYSGEN.  When a connection is established to one of
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,23,0)
 ;;=  these ports, MSERVER launches your code at some TAG^ROUTINE
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,24,0)
 ;;=  that you specify.  This is pretty similar to VMS' UCX utility.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,25,0)
 ;;=  If you are running some Beta version of MSM 4.3 for NT, we
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,26,0)
 ;;=  encourage you to upgrade to the 4.3.0 already released.  Once
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,27,0)
 ;;=  you upgrade, you should stop using the RPC Broker listener and
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,28,0)
 ;;=  switch to the MSERVER.  Before MSERVER can be used it must be
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,29,0)
 ;;=  configured using SYSGEN as follows:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,30,0)
 ;;=       In the manager's UCI run SYSGEN.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,31,0)
 ;;=       Pick 3 - Edit Configuration Parameters, 15 - Network
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,32,0)
 ;;=     Configuration, 12 - User-Defined Services
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,33,0)
 ;;=       Enter an unused index number and set it up as follows
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,34,0)
 ;;=     Enter Service Name <RPC BROKER>: RPC BROKER
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,35,0)
 ;;=     Enter Routine Reference <MSM^XWBTCPC>: MSM^XWBTCPC
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,36,0)
 ;;=     Select UCI <VAH,MNT>: VAH,MNT
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,37,0)
 ;;=     Enter Partition Size <80>: 80
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,38,0)
 ;;=     Enter Password <>:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,39,0)
 ;;=     Enter TCPIP Port Number <9200>: 9200
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,40,0)
 ;;=     Autostart? <YES>: YES
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,41,0)
 ;;=       However specifying YES for Autostart is not enough for
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,42,0)
 ;;=     MSERVER to start up when MSM is started.  For that you need to
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,43,0)
 ;;=     add MSERVER to the Automatic Startup List as following:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,44,0)
 ;;=       In the manager's UCI run SYSGEN.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,45,0)
 ;;=       Pick 3 - Edit Configuration Parameters, 3 - Autostart and
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,46,0)
 ;;=     Automounts, 5 - Automatic Partition Startup
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,47,0)
 ;;=       Enter an unused index number and set it up as follows
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,48,0)
 ;;=     Enter UCI name <MGR>: MGR
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,49,0)
 ;;=       Enter Entry Reference <STARTUP^MSERVER("RPC BROKER")>:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,50,0)
 ;;=     STARTUP^MSERVER("RPC BROKER")
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,51,0)
 ;;=     Enter partition size <SYSTEM>: SYSTEM
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,52,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,53,0)
 ;;=  To start MSERVER manually, in the manager's UCI type the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,54,0)
 ;;=  following at the programmer prompt: J STARTUP^MSERVER("RPC
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,55,0)
 ;;=  BROKER")
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,56,0)
 ;;=  To shutdown MSERVER in the manager's UCI type the following at
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,57,0)
 ;;=  the programmer prompt: J SHUTDOWN^MSERVER("RPC BROKER")
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,58,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,59,0)
 ;;=  If you're successfully using MSERVER, discontinue using the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,60,0)
 ;;=  Broker listener.  This means don't use STRT^XWBTCP and
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,61,0)
 ;;=  STOP^XWBTCP entry points.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,62,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,63,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,64,0)
 ;;=Client version 1.1T2 Enhancements
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,65,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,66,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,67,0)
 ;;=o    RpcVersion property
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,68,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,69,0)
 ;;=  TRPCBroker component has a new property RpcVersion.  It's a
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,70,0)
 ;;=  published string type property that you can use to pass the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,71,0)
 ;;=  version of the RPC.  This can be useful for backward

XWBIN00M
XWBIN00M ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,72,0)
 ;;=  compatibility as you introduce new functionality into an
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,73,0)
 ;;=  existing RPC the RPC can check XWBAPVER variable on the server
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,74,0)
 ;;=  to determine the version of the call that the client is
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,75,0)
 ;;=  making.  This property cannot be empty and defaults to `0'
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,76,0)
 ;;=  (zero).
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,77,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,78,0)
 ;;=o    VistA Splash Screen
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,79,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,80,0)
 ;;=  When your application starts up it can put up a VistA splash
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,81,0)
 ;;=  screen while the rest of initialization is taking place.  When
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,82,0)
 ;;=  the application actually begins to run the splash scene is
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,83,0)
 ;;=  closed and the main form will open.  Two procedures in a new
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,84,0)
 ;;=  SplVista.PAS unit are provided, SplashOpen and
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,85,0)
 ;;=  SplashClose(TimeOut: longint).  It is recommended that if
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,86,0)
 ;;=  splash scene is used it should be used right inside the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,87,0)
 ;;=  project file (.DPR) itself.  Include the SplVista in the uses
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,88,0)
 ;;=  clause.  Call SplashOpen right after the first form of your
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,89,0)
 ;;=  application is created and call SplashClose right before the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,90,0)
 ;;=  Application.Run method is invoked.  The TimeOut parameter that
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,91,0)
 ;;=  SplashClose requires is the time in milliseconds that the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,92,0)
 ;;=  splash screen should remain at a minimum.  It can happen that
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,93,0)
 ;;=  the application is small enough and the computer is fast
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,94,0)
 ;;=  enough that the splash screen doesn't display long enough for
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,95,0)
 ;;=  a user to even notice it.  Using the TimeOut parameter a
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,96,0)
 ;;=  minimum duration can be assured.  Bellow is an example of how
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,97,0)
 ;;=  the splash screen is used in EGCHO test application.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,98,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,99,0)
 ;;=  program Egcho;
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,100,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,101,0)
 ;;=  uses
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,102,0)
 ;;=    Forms,
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,103,0)
 ;;=    Egcho1 in 'EGCHO1.PAS' {Form1},
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,104,0)
 ;;=    Echoabt in 'ECHOABT.PAS' {AboutBox},
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,105,0)
 ;;=    Rpcberr in 'RPCBERR.PAS' {Form2},
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,106,0)
 ;;=    SplVista;
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,107,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,108,0)
 ;;=  {$R *.RES}
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,109,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,110,0)
 ;;=  begin
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,111,0)
 ;;=    Application.CreateForm(TForm1, Form1);
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,112,0)
 ;;=    SplashOpen;
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,113,0)
 ;;=    Application.CreateForm(TAboutBox, AboutBox);
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,114,0)
 ;;=    SplashClose(2000);
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,115,0)
 ;;=    Application.Run;
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,116,0)
 ;;=  end.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,117,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,118,0)
 ;;=o    Fixed a bug in EGcho test application
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,119,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,120,0)
 ;;=  EGcho had a bug that would cause an error on the server
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,121,0)
 ;;=  whenever you would disconnect EGcho, reconnect and click on
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,122,0)
 ;;=  the Send button of whatever action you ran last.  The Param
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,123,0)
 ;;=  property of the Broker component at that point would not be
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,124,0)
 ;;=  set correctly and the called RPC got confused.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,125,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,126,0)
 ;;=o    Fixed an auto-connect bug in TRPCBroker component

XWBIN00N
XWBIN00N ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,127,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,128,0)
 ;;=  One of the features of the Broker component that stopped
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,129,0)
 ;;=  working in 1.1T1 was that the Broker component should connect
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,130,0)
 ;;=  to the server automatically whenever the first RPC is called.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,131,0)
 ;;=  To demonstrate this in EGcho you can click on one of the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,132,0)
 ;;=  action radio buttons without connecting to the server
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,133,0)
 ;;=  beforehand.  When Broker component connects to the server it
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,134,0)
 ;;=  calls several Broker-namespaced RPCs to set up the environment
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,135,0)
 ;;=  on the server, bring back intro text, authenticate the user,
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,136,0)
 ;;=  etc.  It does all this with the same component that the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,137,0)
 ;;=  application uses to execute its RPCs.  The bug was related to
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,138,0)
 ;;=  the component not saving off all of its properties that the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,139,0)
 ;;=  application set up prior to calling its own RPCs and
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,140,0)
 ;;=  subsequently not restoring all of its properties completely
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,141,0)
 ;;=  before calling the application RPC.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,142,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,143,0)
 ;;=o    BAPI16.DLL and BAPI32.DLL
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,144,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,145,0)
 ;;=  This version includes two new DLLs that allow any programs
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,146,0)
 ;;=  that can make DLL calls to use the Broker.  Programs written
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,147,0)
 ;;=  for 16-bit platform should use BAPI16.DLL and the 32-bit ones
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,148,0)
 ;;=  should use BAPI32.DLL.  We have tested the DLLs with Delphi
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,149,0)
 ;;=  and Visual Basic versions of Egcho.  Upon request we can
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,150,0)
 ;;=  provide source code to Egcho that can be compiled under Visual
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,151,0)
 ;;=  Basic versions 3, 4 (16bit) and 4 (32bit).
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,152,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,153,0)
 ;;=  Note:  BAPI16.DLL has a limitation of allowing only one
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,154,0)
 ;;=          connection to a server-port pair for all applications
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,155,0)
 ;;=          that use the DLL.  So for example, if one program
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,156,0)
 ;;=          connects to DHCPSERVER at port 9200 via the BAPI16.DLL,
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,157,0)
 ;;=          another program using BAPI16.DLL will not be able to
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,158,0)
 ;;=          connect to DHCPSERVER at 9200.  This limitation is only
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,159,0)
 ;;=          in 16-bit version of the DLL; BAPI32.DLL works fine.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,160,0)
 ;;=          If needed, this would be an easy thing to fix.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,161,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,162,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,163,0)
 ;;=Server version 1.1T2 Enhancements
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,164,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,165,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,166,0)
 ;;=o    Support for Intersystems OpenM for NT version 7
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,167,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,168,0)
 ;;=  This version of the Broker now runs on Intersystems OpenM for
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,169,0)
 ;;=  NT version 7 as well as on MSM for NT and DSM.  RPC Broker
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,170,0)
 ;;=  installation and configuration procedures for OpenM are
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,171,0)
 ;;=  exactly the same as for DSM.  Starting and stopping the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,172,0)
 ;;=  listener is also the same as it is for all other M
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,173,0)
 ;;=  environments.  Use STRT^XWBTCP(port) to start the listener and
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,174,0)
 ;;=  STOP^XWBTCP(port) to stop it.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,175,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,176,0)
 ;;=o    New XWB LISTENER STARTER option

XWBIN00O
XWBIN00O ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,177,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,178,0)
 ;;=  XWB LISTENER STARTER option can be used to start one or more
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,179,0)
 ;;=  Broker listeners at one time.  Additionally, this option can
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,180,0)
 ;;=  be used to start all of the listener processes you need
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,181,0)
 ;;=  automatically when the TaskMan starts up, such as after the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,182,0)
 ;;=  system is rebooted or configuration is restarted. XWB LISTENER
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,183,0)
 ;;=  STARTER works in combination with the new CONTROLLED BY
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,184,0)
 ;;=  LISTENER STARTER (#2) subfield of a Port (#1) subfield of a
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,185,0)
 ;;=  Listener (#7) multiple field in the RPC BROKER SITE PARAMETERS
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,186,0)
 ;;=  (8994.1) file.  CONTROLLED BY LISTENER STARTER field is a
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,187,0)
 ;;=  YES/NO set of codes type.  All of the listener entries in this
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,188,0)
 ;;=  file that have CONTROLLED BY LISTENER STARTER set to YES will
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,189,0)
 ;;=  be started when XWB LISTENER STARTER option is run.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,190,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,191,0)
 ;;=o    Harder access to BOX-VOLUME PAIR field
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,192,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,193,0)
 ;;=  We intentionally tightened access to the BOX-VOLUME PAIR
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,194,0)
 ;;=  (#.01) subfield of a LISTENER (#7) field in the RPC BROKER
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,195,0)
 ;;=  SITE PARAMETERS (8994.1) file.  The reason for this is to
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,196,0)
 ;;=  prevent sites inputting inappropriate entries in this field by
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,197,0)
 ;;=  way of casual editing through FileMan.  Simply put, the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,198,0)
 ;;=  appropriate entries are all the BOX-VOLUME pairs that can read
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,199,0)
 ;;=  and write to the ^XWB global, where RPC BROKER SITE PARAMETERS
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,200,0)
 ;;=  file resides.  When editing this pointer-type field, you may
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,201,0)
 ;;=  see other box-volume combinations that are in your TASKMAN
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,202,0)
 ;;=  SITE PARAMETER, but a job running in those box-volume
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,203,0)
 ;;=  combinations could not reach the ^XWB global.  Those box-
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,204,0)
 ;;=  volume combinations would not be appropriate.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,205,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,206,0)
 ;;=  Therefore, in order to edit this field you need to set XWBCHK
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,207,0)
 ;;=  variable to the string "ALLOW" at the programmer prompt prior
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,208,0)
 ;;=  to invoking FileMan.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,209,0)
 ;;=  Example: >S XWBCHK="ALLOW" D Q^DI
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,210,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,211,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,212,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,213,0)
 ;;=Client version 1.1T1 Enhancements
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,214,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,215,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,216,0)
 ;;=o    32-bit and 16-bit
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,217,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,218,0)
 ;;=  This version of the Broker can now be used to produce both 16-
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,219,0)
 ;;=  bit and 32-bit VISTA applications.  This distribution contains
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,220,0)
 ;;=  both versions of the Broker and when properly installed, it
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,221,0)
 ;;=  will create two separate Broker Developer Kit (BDK)
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,222,0)
 ;;=  directories: BDK16 and BDK32.  If you're working in Delphi
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,223,0)
 ;;=  1.0, you should use the BDK16 Broker.  If you have Delphi 2.0,
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,224,0)
 ;;=  use the BDK32 Broker.  The BDK16 Broker will not work in
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,225,0)
 ;;=  Delphi 2.0.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,226,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,227,0)
 ;;=o    Eliminated the use of the RPCBI.DLL and DHCP Client Manager

XWBIN00P
XWBIN00P ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,228,0)
 ;;=  (CLMAN.EXE)
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,229,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,230,0)
 ;;=  Both the RPCBI.DLL and DHCP Client Manager have been
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,231,0)
 ;;=  eliminated from this version of the Broker.  In all previous
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,232,0)
 ;;=  versions of the Broker the RPCBI.DLL served two functions:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,233,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,234,0)
 ;;=     1.It served as a central repository of information for all
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,235,0)
 ;;=       the running Broker clients.  The DLL provided all of the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,236,0)
 ;;=       connect and disconnect functionality and maintained the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,237,0)
 ;;=       connection-state information for all the clients.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,238,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,239,0)
 ;;=     2.It provided an API to the Broker that could be used by
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,240,0)
 ;;=       programs written in any Windows development package
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,241,0)
 ;;=       (i.e., Visual Basic, C++, Delphi, etc.)
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,242,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,243,0)
 ;;=  Also, working with RPCBI.DLL presented a number of challenges:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,244,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,245,0)
 ;;=     o    DLLs cannot be debugged in Delphi.  Once the application
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,246,0)
 ;;=       made a call into the DLL, the Delphi debugger could not step into
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,247,0)
 ;;=       the DLL and there was no way to tell exactly what the code was
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,248,0)
 ;;=       doing.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,249,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,250,0)
 ;;=     o    When we moved to the 32-bit development, we quickly realized
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,251,0)
 ;;=       that we could no longer share memory in the DLL between
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,252,0)
 ;;=       applications.  In 32-bit Windows each process runs in its own
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,253,0)
 ;;=       protected memory space and gets its own image of the DLL.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,254,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,255,0)
 ;;=  The connect and disconnect functionality that was previously
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,256,0)
 ;;=  provided by the DLL has now been incorporated with the Broker
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,257,0)
 ;;=  component itself.  This allows VISTA applications to be
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,258,0)
 ;;=  independent of the DLL and its restrictions.  The feature of
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,259,0)
 ;;=  the RPCBI.DLL that provided an API for non-Delphi applications
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,260,0)
 ;;=  will be recreated in another DLL to be released with a later
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,261,0)
 ;;=  version of the Broker.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,262,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,263,0)
 ;;=  Since the DLL is no longer used, the DHCP Client Manager is no
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,264,0)
 ;;=  longer necessary.  In previous versions of the Broker, the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,265,0)
 ;;=  Client Manager also provided two types of services:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,266,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,267,0)
 ;;=     1.It was used to configure the client side of the Broker.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,268,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,269,0)
 ;;=     2.It was used to invoke RPCBI.DLL.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,270,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,271,0)
 ;;=  The final version of the Broker v. 1.1 will reinstate a
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,272,0)
 ;;=  modified version of the Client Manager providing some of the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,273,0)
 ;;=  current as well as new functionality for the Broker.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,274,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,275,0)
 ;;=o    Temporary loss of cached Access and Verify codes.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,276,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,277,0)
 ;;=  One of the services that the RPCBI.DLL also provided was the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,278,0)
 ;;=  caching of users' Access and Verify codes for subsequent

XWBIN00Q
XWBIN00Q ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,279,0)
 ;;=  logins.  Since the DLL is no longer used, the codes are no
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,280,0)
 ;;=  longer cached.  The user now has to sign in each time he runs
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,281,0)
 ;;=  any Broker 1.1T1 based application.  This is a temporary
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,282,0)
 ;;=  measure.  We are in the process of redesigning the entire
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,283,0)
 ;;=  authentication protocol to support a single signon for all
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,284,0)
 ;;=  VISTA applications, including the roll and scroll
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,285,0)
 ;;=  applications.  This inconvenience will be eliminated once the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,286,0)
 ;;=  single signon issue is resolved.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,287,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,288,0)
 ;;=  In order to avoid the multiple signon requirement during
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,289,0)
 ;;=  development, we have provided a temporary workaround.  The
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,290,0)
 ;;=  TRPCBroker component has a new published property,
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,291,0)
 ;;=  AccessVerifyCodes.  If this property is empty, the signon
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,292,0)
 ;;=  process will happen normally, as it would for any user.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,293,0)
 ;;=  However, the developer can set this property to his own Access
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,294,0)
 ;;=  and Verify codes.  Thus, the process will still be visible,
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,295,0)
 ;;=  but completely automatic.  You will still see the Sign-on
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,296,0)
 ;;=  window displayed, but it won't wait for you to type in your
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,297,0)
 ;;=  codes as it will immediately close.  This is intentional and
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,298,0)
 ;;=  serves as a reminder of what the users will actually
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,299,0)
 ;;=  experience.  Needless to say, you should clear this property
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,300,0)
 ;;=  prior to distributing your application.  In the Object
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,301,0)
 ;;=  Inspector, the value of this property always appears as the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,302,0)
 ;;=  word "Encrypted", even when it's empty.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,303,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,304,0)
 ;;=o    Sign-on window can be customized by users
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,305,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,306,0)
 ;;=  When the application connects to the server, the DHCP Sign-on
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,307,0)
 ;;=  window is displayed for the user to identify and authenticate
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,308,0)
 ;;=  himself on the server.  This window's system menu, a k a
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,309,0)
 ;;=  hyphen menu, has an additional item "Properties..."  When this
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,310,0)
 ;;=  item is selected, the user is presented with a configuration
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,311,0)
 ;;=  form where the users can control the position, size of the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,312,0)
 ;;=  Sign-on window, and the appearance of the introductory text.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,313,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,314,0)
 ;;=  The Window Position can be one of the following:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,315,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,316,0)
 ;;=     o    Center (default) - the window will always appear in the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,317,0)
 ;;=       center of the screen.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,318,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,319,0)
 ;;=     o    Current - whatever is the current position of the window, it
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,320,0)
 ;;=       will be saved and used in the future.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,321,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,322,0)
 ;;=     o    Remember - each time the window is used and closed it will
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,323,0)
 ;;=       record it's position and open up in that same place the next time
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,324,0)
 ;;=       it is used.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,325,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,326,0)
 ;;=  The Window Size can be one of the following:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,327,0)
 ;;=  

XWBIN00R
XWBIN00R ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,328,0)
 ;;=     o    Normal (default) - The size of the window as it was
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,329,0)
 ;;=       designed.  Typically, this is 500 pixels wide by 300 pixels high.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,330,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,331,0)
 ;;=     o    Current - Whatever is the current size of the window.  It
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,332,0)
 ;;=       will be saved and used in the future.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,333,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,334,0)
 ;;=     o    Remember - Each time the window is used and closed, it will
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,335,0)
 ;;=       record it's size and open up with the same size the next time it
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,336,0)
 ;;=       is used.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,337,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,338,0)
 ;;=  Intro Text has a couple of settings users can control:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,339,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,340,0)
 ;;=     Background Color:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,341,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,342,0)
 ;;=       o    Cream (default) - According to the VA GUI conventions, this
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,343,0)
 ;;=          is the background color that should be used with text that users
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,344,0)
 ;;=          cannot edit.  The Intro Text uses this color scheme.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,345,0)
 ;;=       
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,346,0)
 ;;=       o    White - For clarity and brightness.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,347,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,348,0)
 ;;=     Font - Users can change the font of the Intro Text.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,349,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,350,0)
 ;;=o    TRPCBroker Result property dropped
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,351,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,352,0)
 ;;=  The Result property was ambiguous with Delphi's reserved
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,353,0)
 ;;=  Result variable (i.e., used to return values from functions)
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,354,0)
 ;;=  and has been removed from this version of the Broker.  What
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,355,0)
 ;;=  previously was returned in the Result property should now be
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,356,0)
 ;;=  returned in the zeroth element of the Results Property
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,357,0)
 ;;=  referenced as Results[0].
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,358,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,359,0)
 ;;=o    TRPCBroker ConnectMode and DisconnectMode properties are
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,360,0)
 ;;=  phased out
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,361,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,362,0)
 ;;=  These properties confused many developers and are consequently
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,363,0)
 ;;=  being phased out.  For now they have been "demoted" from
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,364,0)
 ;;=  published to public declaration.  This means that these
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,365,0)
 ;;=  properties will no longer be visible in the Object Inspector,
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,366,0)
 ;;=  however, the application will still compile.  At run-time they
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,367,0)
 ;;=  are ignored.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,368,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,369,0)
 ;;=  If your application uses just one Broker component, it will
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,370,0)
 ;;=  not be affected by this change.  However, if your application
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,371,0)
 ;;=  uses more than one Broker component, you should be aware of
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,372,0)
 ;;=  the component's new behavior.  The first time one of the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,373,0)
 ;;=  Broker components in your application connects, it will
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,374,0)
 ;;=  establish an actual connection with the server.  The
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,375,0)
 ;;=  connection record will be added to the list of all active
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,376,0)
 ;;=  connections for your application.  This list is internal to
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,377,0)
 ;;=  the application and is completely under the control of the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,378,0)
 ;;=  Broker components and is transparent to you.  If another

XWBIN00S
XWBIN00S ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,379,0)
 ;;=  Broker component tries to connect to the same server/port, the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,380,0)
 ;;=  existing connection record will be found in the list and its
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,381,0)
 ;;=  socket will be shared.  The new connection will also be added
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,382,0)
 ;;=  to this list.  This process is repeated with each connection
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,383,0)
 ;;=  request.  When a Broker component disconnects, its connection
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,384,0)
 ;;=  record is removed from the internal list of active
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,385,0)
 ;;=  connections.  If it happens to be the last record for the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,386,0)
 ;;=  particular server/port combination, the connection is actually
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,387,0)
 ;;=  closed.  This scheme provides the illusion of multiple
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,388,0)
 ;;=  independent connections without "clogging up" the server.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,389,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,390,0)
 ;;=o    New TRPCBroker.Mult Sorted property
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,391,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,392,0)
 ;;=  The value of the Sorted property determines the order of the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,393,0)
 ;;=  items in a TMult variable.  If Sorted is True, the items are
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,394,0)
 ;;=  sorted in ascending order of their string subscripts.  If
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,395,0)
 ;;=  Sorted is False (default), the items are unsorted, and will
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,396,0)
 ;;=  appear in the order they were added.  Keep in mind that
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,397,0)
 ;;=  changing Sorted from False to True will irreversibly sort the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,398,0)
 ;;=  list so that changing Sorted back to False will not restore
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,399,0)
 ;;=  the list's original sort order (unless the original order was
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,400,0)
 ;;=  already sorted).
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,401,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,402,0)
 ;;=o    Improved robustness reduces, if not eliminates, Broker-
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,403,0)
 ;;=  related GPFs
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,404,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,405,0)
 ;;=  We have made several improvements throughout the Broker:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,406,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,407,0)
 ;;=     o    All of the memory pointers are initialized to nil before
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,408,0)
 ;;=       they are used and are reset after use.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,409,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,410,0)
 ;;=     o    The blocks of code that work with resources are now
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,411,0)
 ;;=       bracketed with try-finally constructs.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,412,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,413,0)
 ;;=     o    The DHCP Sign-on form received a face-lift by simplifying
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,414,0)
 ;;=       its appearance and significant reduction of window panels.  This
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,415,0)
 ;;=       translates into less memory and handles being used.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,416,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,417,0)
 ;;=     o    The removal of RPCBI.DLL should also avoid the possibility
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,418,0)
 ;;=       of memory collisions.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,419,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,420,0)
 ;;=o    Identified and corrected potential memory leaks
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,421,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,422,0)
 ;;=  Careful analysis of Broker code revealed some places where,
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,423,0)
 ;;=  under certain conditions, memory would not be released after
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,424,0)
 ;;=  it was used (i.e., memory leaks).  This has been corrected.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,425,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,426,0)
 ;;=o    Full backward compatibility with Broker version 1.0
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,427,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,428,0)
 ;;=  We made sure that applications compiled with Broker 1.1T1 will
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,429,0)
 ;;=  still work in the same environment as applications that were

XWBIN00T
XWBIN00T ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,430,0)
 ;;=  built with Broker 1.0.  This means that the server does not
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,431,0)
 ;;=  have to be upgraded, the RPCBI.DLL and Client Manager do not
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,432,0)
 ;;=  need to be removed.  PCMM will continue to work along side the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,433,0)
 ;;=  new applications made with Broker 1.1T1.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,434,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,435,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,436,0)
 ;;=Server version 1.1T1 Enhancements
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,437,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,438,0)
 ;;=This version of the Broker includes all of the enhancements that
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,439,0)
 ;;=were included in patch XWB*1*1.  The patch description is
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,440,0)
 ;;=reprinted below:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,441,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,442,0)
 ;;=  1. The removal of extraneous error trap resetting code from
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,443,0)
 ;;=  the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,444,0)
 ;;=  XWBBRK2 routine.  Specifically, lines CAPI+7 - CAPI+8 have
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,445,0)
 ;;=  been removed.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,446,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,447,0)
 ;;=  2. An enhancement that allows a closed root return value from
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,448,0)
 ;;=  an
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,449,0)
 ;;=  RPC which has a return type of ARRAY.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,450,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,451,0)
 ;;=  3. The $GET function is no longer used when resolving
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,452,0)
 ;;=  REFERENCE type
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,453,0)
 ;;=  parameters.  Therefore, if the parameter reference is
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,454,0)
 ;;=  undefined,
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,455,0)
 ;;=  an M error will be generated and trapped on the server.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,456,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,457,0)
 ;;=  4. An MSM null device will be used to catch all inadvertent
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,458,0)
 ;;=  WRITEs in
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,459,0)
 ;;=  RPCs, specifically, those in "ID" nodes of files.  This
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,460,0)
 ;;=  requires
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,461,0)
 ;;=  that MSM sites set up the following entry in the DEVICE file:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,462,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,463,0)
 ;;=  NAME: NULL                           $I: (version specific)
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,464,0)
 ;;=  ASK DEVICE: YES                    ASK PARAMETERS: NO
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,465,0)
 ;;=  SIGN-ON/SYSTEM DEVICE: NO          LOCATION OF TERMINAL: NT
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,466,0)
 ;;=  SYSTEM
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,467,0)
 ;;=  SUBTYPE: C-VT100                   TYPE: TERMINAL
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,468,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,469,0)
 ;;=  $I Value        MSM Version
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,470,0)
 ;;=  --------        ----------------------------------------
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,471,0)
 ;;=  46              MSM for Windows NT, Version 4.3.0 Beta-B
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,472,0)
 ;;=  199             MSM for Windows NT, Version 4.2.4
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,473,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,474,0)
 ;;=  5. The addition of an internal version stamp of Broker
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,475,0)
 ;;=  packets.  This
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,476,0)
 ;;=  allows future incremental updates of the RPC Broker without an
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,477,0)
 ;;=  adverse impact on packages using it.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,478,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,479,0)
 ;;=  6. An enhancement that provides support for MULTIPLE
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,480,0)
 ;;=  Listeners.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,481,0)
 ;;=  With this patch, a site can now start MULTIPLE Broker Listener
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,482,0)
 ;;=  processes in ONE account.  However, no two Listeners,
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,483,0)
 ;;=  regardless
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,484,0)
 ;;=  of the UCIs in which they are running, can share the same port
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,485,0)
 ;;=  on one server.  Additionally, if two or more Listeners are

XWBIN00U
XWBIN00U ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,486,0)
 ;;=  running
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,487,0)
 ;;=  out of the same UCI-volume set, they cannot listen on the same
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,488,0)
 ;;=  port,
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,489,0)
 ;;=  even if the Listener processes are on different CPUs.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,490,0)
 ;;=  See NOIS SDC-0796-61985.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,491,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,492,0)
 ;;=  7. A correction that now provides an error-free shutdown of
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,493,0)
 ;;=  Listeners on MSM systems.  See NOIS DAY-0796-40990.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,494,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,495,0)
 ;;=  8. A correction that fixes a bug in the pattern match on line
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,496,0)
 ;;=  CREF+7^XWBBRK2.  Previously, this routine would misinterpret
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,497,0)
 ;;=  the "E^33310.5" parameter literal as an array.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,498,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,499,0)
 ;;=  9. An enhancement that improves the detection of problems
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,500,0)
 ;;=  during the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,501,0)
 ;;=  startup of the Listener.  If a Listener cannot start listening
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,502,0)
 ;;=  on a given port (e.g., port may be busy), it will generate an
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,503,0)
 ;;=  error on the server and retry up to FIVE times while
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,504,0)
 ;;=  continuously
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,505,0)
 ;;=  informing the user of its status.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,506,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,507,0)
 ;;=o    Listener process name is changed to be more descriptive and
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,508,0)
 ;;=  informative
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,509,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,510,0)
 ;;=  This enhancement was included in patch XWB*1*1 but not
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,511,0)
 ;;=  described.  If you do a system status on a DSM system, where
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,512,0)
 ;;=  the Broker Listener is running, the Listener process name will
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,513,0)
 ;;=  now appear as RPCB_Port:NNNN, where NNNN is the port number
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,514,0)
 ;;=  being listened to.  This should prove quite useful in finding
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,515,0)
 ;;=  a Listener and troubleshooting any connection problems.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,516,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,517,0)
 ;;=o    Handler process name is changed to be more descriptive and
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,518,0)
 ;;=  informative
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,519,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,520,0)
 ;;=  On DSM systems the Handler process name also gets changed.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,521,0)
 ;;=  The name of a Handler process should now appear as
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,522,0)
 ;;=  ipXXX.XXX:NNNN, where XXX.XXX are the last two octets of the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,523,0)
 ;;=  client IP address and NNNN is the port number.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,524,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,525,0)
 ;;=o    New RPC BROKER SITE PARAMETER file (#8994.1)
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,526,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,527,0)
 ;;=  This file is a work in progress.  It will be used to configure
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,528,0)
 ;;=  and adjust many characteristics of an RPC Broker installation
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,529,0)
 ;;=  at a site.  This version of the Broker includes a Listener
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,530,0)
 ;;=  field and various subfields.  The Listener field is a multiple
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,531,0)
 ;;=  and should contain all Listeners that you're planning to run.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,532,0)
 ;;=  A simple change of the STATUS subfield from STOPPED to START
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,533,0)
 ;;=  will start that particular Listener.  Conversely, you can STOP
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,534,0)
 ;;=  a RUNNING Listener.  In the future, this will be accomplished
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,535,0)
 ;;=  via a ListMan interface.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,536,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,537,0)
 ;;=o    Improved support of multiple Listeners

XWBIN00V
XWBIN00V ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,538,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,539,0)
 ;;=  Broker patch XWB*1*1 went a long way in supporting multiple
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,540,0)
 ;;=  Listeners, but it had one shortcoming.  Even after the patch
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,541,0)
 ;;=  was installed, you could not run multiple Listeners in the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,542,0)
 ;;=  same UCI-volume, on different CPUs, listening to the same
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,543,0)
 ;;=  port.  This functionality has been added in this version of
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,544,0)
 ;;=  the Broker.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,545,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,546,0)
 ;;=o    Support for new M standard error trapping
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,547,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,548,0)
 ;;=  This version of the Broker uses the new Kernel error trap
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,549,0)
 ;;=  which now records stack information and NEWed variables.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,550,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,551,0)
 ;;=o    Early detection of impostors and intruders
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,552,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,553,0)
 ;;=  Before the Listener jobs off a Handler for a client, it checks
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,554,0)
 ;;=  the format of the incoming connection request.  If the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,555,0)
 ;;=  incoming message does not conform to the Broker standard, the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,556,0)
 ;;=  connection is closed.  This is an enhancement to the security
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,557,0)
 ;;=  feature of the Broker.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,558,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,559,0)
 ;;=o    Full backward compatibility with Broker client version 1.0
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,560,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,561,0)
 ;;=  The client side of the applications compiled with Broker
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,562,0)
 ;;=  version 1T19 or later should continue to work with this
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,563,0)
 ;;=  version of the server.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,564,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,565,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,566,0)
 ;;=Note for CPRS developers:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,567,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,568,0)
 ;;=You may be using a variant of 1.1T1 that was provided to Kevin
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,569,0)
 ;;=Meldrum at the Salt Lake City IRMFO sometime around 9/25/96.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,570,0)
 ;;=That version had the following minor bugs, all of which have now
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,571,0)
 ;;=been corrected:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,572,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,573,0)
 ;;=  o    The UsePpcbiDll setting in the VISTA.INI file is no longer
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,574,0)
 ;;=     required.  You should remove it from the file if present.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,575,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,576,0)
 ;;=  o    You don't need to include RpcbErr in the uses clause.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,577,0)
 ;;=     Everything pertinent has been moved into TRPCB.PAS.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,578,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,579,0)
 ;;=  o    You don't need to explicitly connect prior to invoking the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,580,0)
 ;;=     TRPCBroker.CreateContext method or some other RPC.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,581,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,582,0)
 ;;=  o    You no longer need the UseRpcbiDll setting in the VISTA.INI
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,583,0)
 ;;=     file.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,584,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,585,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,586,0)
 ;;=Server Side Installation Instructions
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,587,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,588,0)
 ;;=o    XWB1-1T3.KID is a KIDS file.  Use the KIDS software to
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,589,0)
 ;;=  install it.  Make sure that you have installed all of the Kernel
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,590,0)
 ;;=  v. 8.0, VA FileMan v. 21.0, and Toolkit v. 7.3 patches.  You do
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,591,0)
 ;;=  not need a previous version of the Broker to install this latest
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,592,0)
 ;;=  version.

XWBIN00W
XWBIN00W ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,593,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,594,0)
 ;;=o    Do the following setup:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,595,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,596,0)
 ;;=  1.   At the programmer prompt type S XWBCHK="ALLOW"
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,597,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,598,0)
 ;;=  2.Using VA FileMan v. 21.0, edit the new RPC BROKER SITE
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,599,0)
 ;;=     PARAMETERS file.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,600,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,601,0)
 ;;=  3.Enter your site domain; only one entry is allowed here.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,602,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,603,0)
 ;;=  4.Add all the box-volume pairs where you plan to run Broker
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,604,0)
 ;;=     Listeners.  For each box-volume pair enter all the ports
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,605,0)
 ;;=     that you plan to use for the Listeners.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,606,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,607,0)
 ;;=  5.After completing steps 1-3, set the STATUS field to START
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,608,0)
 ;;=     and, assuming that TaskMan is running, the Listener will be
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,609,0)
 ;;=     started.  The STATUS field will then change to RUNNING.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,610,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,611,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,612,0)
 ;;=Client Side Installation Instructions
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,613,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,614,0)
 ;;=XWB1-1T3.EXE contains both 16-bit and 32-bit versions of the BDK
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,615,0)
 ;;=and creates two separate directories: BDK16 and BDK32.  Each
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,616,0)
 ;;=directory is self-contained and does not depend on any files in
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,617,0)
 ;;=other directories.  You don't need to delete the previous version
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,618,0)
 ;;=of the Broker unless it's already in the BDK16 directory.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,619,0)
 ;;=However, it's a good idea to back it up as a precaution.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,620,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,621,0)
 ;;=To complete the installation, perform the following steps:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,622,0)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,623,0)
 ;;=  1.Back up your current Broker directory:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,624,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,625,0)
 ;;=     This is the directory which contains the Broker component
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,626,0)
 ;;=     (TRPCB.DCU) file and other supporting files (e.g., MFunStr,
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,627,0)
 ;;=     XWBUT1, etc.).
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,628,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,629,0)
 ;;=  2.Extract the new/replacement Broker files:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,630,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,631,0)
 ;;=     Place XWB1-1T1.EXE in the directory that is just above your
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,632,0)
 ;;=     current Broker directory and run it there with the -D
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,633,0)
 ;;=     switch.  For example, if you currently have all of the
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,634,0)
 ;;=     Broker files in C:\PROJ\BROKER, then copy XWB1-1T1.EXE into
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,635,0)
 ;;=     C:\PROJ and run it by typing XWB1-1T1 -D.  You'll end up
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,636,0)
 ;;=     with two new directories: C:\PROJ\BDK16 and C:\PROJ\BDK32.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,637,0)
 ;;=     The existing C:\PROJ\BROKER directory will not be affected.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,638,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,639,0)
 ;;=  3.Remove old version of the Broker component and add the new:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,640,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,641,0)
 ;;=     a.In Delphi 1.0, select Options | Install Components...
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,642,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,643,0)
 ;;=     b.In the Search path field, remove the reference to the old
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,644,0)
 ;;=       Broker directory.  You don't need to type in the new
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,645,0)
 ;;=       directory in its place; it will be added automatically
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,646,0)
 ;;=       when you add the new component.

XWBIN00X
XWBIN00X ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 F I=1:2 S X=$T(Q+I) Q:X=""  S Y=$E($T(Q+I+1),4,999),X=$E(X,4,999) S:$A(Y)=126 I=I+1,Y=$E(Y,2,999)_$E($T(Q+I+1),5,999) S:$A(Y)=61 Y=$E(Y,2,999) X NO E  S @X=Y
Q Q
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,647,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,648,0)
 ;;=     c.In the Installed units list box, select TRPCB and click
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,649,0)
 ;;=       the Remove button.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,650,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,651,0)
 ;;=     d.Click Add...
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,652,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,653,0)
 ;;=     e.Click Browse... and navigate to the BDK16 directory.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,654,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,655,0)
 ;;=     f.Change the List Of Files of Type to Unit file (*.DCU) and
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,656,0)
 ;;=       select TRPCB.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,657,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,658,0)
 ;;=     g.Add the RPCBEDTR unit.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,659,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,660,0)
 ;;=     h.Click OK to rebuild the library.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,661,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,662,0)
 ;;=  4.If you have Delphi 2.0 loaded, you can also install the 32-
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,663,0)
 ;;=     bit version of the Broker:
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,664,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,665,0)
 ;;=     a.In Delphi 2.0, select Component | Install...
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,666,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,667,0)
 ;;=     b.Click Add...
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,668,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,669,0)
 ;;=     e.Click Browse... and navigate to the BDK32 directory.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,670,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,671,0)
 ;;=     f.Change the List Of Files of Type to Unit file (*.DCU) and
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,672,0)
 ;;=       select TRPCB.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,673,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,674,0)
 ;;=     g.Add the RPCBEDTR unit.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,675,0)
 ;;=     
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,676,0)
 ;;=     h.Click OK to rebuild the library.
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,677,0)
 ;;=  
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,678,0)
 ;;=  5.Test the installation(s) by loading the new EGCHO project,
 ;;^UTILITY(U,$J,"PKG",2321,22,7,1,679,0)
 ;;=     compiling, and running it.
 ;;^UTILITY(U,$J,"PKG",2321,22,"B","1.0T1",1)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,"B","1.0T11",6)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,"B","1.0T4",2)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,"B","1.0T5",3)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,"B","1.0T6",4)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,"B","1.0T7",5)
 ;;=
 ;;^UTILITY(U,$J,"PKG",2321,22,"B","1.1T3",7)
 ;;=
 ;;^UTILITY(U,$J,"SBF",8994,8994)
 ;;=
 ;;^UTILITY(U,$J,"SBF",8994,8994.01)
 ;;=
 ;;^UTILITY(U,$J,"SBF",8994,8994.02)
 ;;=
 ;;^UTILITY(U,$J,"SBF",8994,8994.021)
 ;;=
 ;;^UTILITY(U,$J,"SBF",8994,8994.03)
 ;;=

XWBINETD
XWBINETD ;ISC-SF/EG - PROCESS MSM-NT TCP REQUEST ;05/21/96  14:19
 ;;1.1T3;RPC BROKER;;Nov 25, 1996
 N XWBPORT
 S XWBPORT=9000
 O 56 U 56::"TCP" W /SOCKET("",XWBPORT) J ^XWBINETD
 S %="MSM TCP "_$J G EN^XWBTCPH

XWBINIS
XWBINIS ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
PAC(PKG,VER) ; called from package init (DIFROM7 created this routine)
 ; PKG = $T(IXF) of the INIT routine.
 ; VER is an array that is contained in DIFROM from the INIT routine
 ;
 N %,%I,%H,DATE,DIFROM,NOW,PACKAGE,RUN,SERVER,SITE,START,X,XMDUZ,XMSUB,XMTEXT,XMY,Y K ^TMP("XWBINIS",$J)
 ;
 ; Site tracking updates only occur if run in a VA production primary domain
 ; account.
 I $G(^XMB("NETNAME"))'[".VA.GOV" Q
 Q:'$D(^%ZOSF("UCI"))  Q:'$D(^%ZOSF("PROD"))
 X ^%ZOSF("UCI") I Y'=^%ZOSF("PROD") Q
 ;
 S SERVER="S.A5CSTS@FORUM.VA.GOV"
 S PACKAGE=$P($P(PKG,";",3),U)
 S SITE=$G(^XMB("NETNAME"))
 S START=$P($G(^DIC(9.4,VER(0),"PRE")),U,2) I '$L(START) S START="Unknown"
 D  ; check if ok to use kernel functions
 .S X="XLFDT" X ^%ZOSF("TEST") I $T D  Q
 ..S NOW=$$HTFM^XLFDT($H)
 ..S RUN="Unknown" I START S RUN=$$FMDIFF^XLFDT(NOW,START,3)
 ..S START=$$FMTE^XLFDT(START)
 ..S DATE=NOW\1
 ..S NOW=$$FMTE^XLFDT(NOW)
 .D NOW^%DTC S NOW=%,DATE=X
 .S RUN="" ; don't bother to compute
 .S Y=START D DD^%DT S START=Y
 .S Y=NOW D DD^%DT S NOW=Y
 ;
 ; Message for server
 S ^TMP("XWBINIS",$J,1,0)="PACKAGE INSTALL"
 S ^TMP("XWBINIS",$J,2,0)="SITE: "_SITE
 S ^TMP("XWBINIS",$J,3,0)="PACKAGE: "_PACKAGE
 S ^TMP("XWBINIS",$J,4,0)="VERSION: "_VER
 S ^TMP("XWBINIS",$J,5,0)="Start time: "_START
 S ^TMP("XWBINIS",$J,6,0)="Completion time: "_NOW
 S ^TMP("XWBINIS",$J,7,0)="Run time: "_RUN
 S ^TMP("XWBINIS",$J,8,0)="DATE: "_DATE
 ;
 ; Data is sent to server on FORUM - S.A5CSTS
 S XMY(SERVER)="",XMDUZ=.5,XMTEXT="^TMP(""XWBINIS"",$J,",XMSUB=PACKAGE_" VERSION "_VER_" INSTALLATION"
 D ^XMD
 K ^TMP("XWBINIS",$J)
 Q

XWBINIT
XWBINIT ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 ;
 K DIF,DIFQ,DIFQR,DIFQN,DIK,DDF,DDT,DTO,D0,DLAYGO,DIC,DIDUZ,DIR,DA,DIFROM,DFR,DTN,DIX,DZ,DIRUT,DTOUT,DUOUT
 S DIOVRD=1,U="^",DIFQ=0,DIFROM="1.1T3" W !,"This version (#1.1T3) of 'XWBINIT' was created on 24-FEB-1999"
 W !?9,"(at DEV/DSD, by VA FileMan V.21.0)",!
 I $D(^DD("VERSION")),^("VERSION")'<21 G GO
 ;W !,"FIRST, I'LL FRESHEN UP YOUR VA FILEMAN...." D N^DINIT
 I ^DD("VERSION")<21 W !,"but I need version 21 of the VA FileMan!" G Q
GO ;
EN ; ENTER HERE TO BYPASS THE PRE-INIT PROGRAM
 S DIFQ=0 K DIRUT,DTOUT,DUOUT
 F DIFRIR=1:1:1 S DIFRRTN="^XWBINIT"_$E("5",DIFRIR) D @DIFRRTN
 W:1 !,"I AM GOING TO SET UP THE FOLLOWING FILES:" F I=1:2:2 S DIF(I)=^UTILITY("DIF",$J,I) D 1 G Q:DIFQ!$D(DIRUT) K DIF(I)
 S DIFROM="1.1T3" D PKG:'$D(DIFROM(0)),^XWBINIT1 G Q:'$D(DIFQ) S DIK(0)="AB"
 F DIF=1:2:2 S %=^UTILITY("DIF",$J,DIF),DIK=$P(%,";",5),N=$P(%,";",3),D=$P(%,";",4)_U_N D D K DIFQ(N)
 K DIFQR D ^XWBINIT2,^XWBINIT3
 L  S DUZ=DIDUZ W:1 !,$C(7),"OK, I'M DONE.",!,"NO"_$P("TE THAT FILE",U,DSEC)_" SECURITY-CODE PROTECTION HAS BEEN MADE"
 I DIFROM F DIF=1:2:2 S %=^UTILITY("DIF",$J,DIF),N=+$P(%,";",3) I N,$P(%,";",8)="y" S ^DD(N,0,"VR")=DIFROM
 I DIFROM(0)>0 F %="PRE","INI","INIT" S:$D(DIFROM(%)) $P(^DIC(9.4,DIFROM(0),%),U,2)=DIFROM(%)
 I $G(DIFQN) S $P(^(0),U,3,4)=$P(DIFQN,U,2)_U_($P(^DIC(0),U,4)+DIFQN) K DIFQN
 I DIFROM,$D(^%ZTSK) S X="XWBINIS" X ^%ZOSF("TEST") D:$T PAC^XWBINIS($T(IXF),.DIFROM)
 S:DIFROM(0)>0 ^DIC(9.4,DIFROM(0),"VERSION")=DIFROM G Q^DIFROM0
D S:$D(^DIC(+N,0))[0 ^(0)=D S X=$D(@(DIK_"0)")),^(0)=D_U_$S(X#2:$P(^(0),U,3,9),1:U)
 S DIFQR=DIFQR(+N) I ^DD("VERSION")>17.5,$D(^DD(+N,0,"DIK"))#2 S X=^("DIK"),Y=+N,DMAX=^DD("ROU") D EN^DIKZ
 I DIFQR D IXALL^DIK:$O(@(DIK_"0)")) W "."
 Q
R G REP^XWBINIT2
 ;
1 S N=+$P(DIF(I),";",3),DIF=$P(DIF(I),";",4),S=$P(DIF(I),";",5)
 W !!?3,N,?13,DIF,$P("  (Partial Definition)",U,$P(DIF(I),";",6)),$P("  (including data)",U,$P(DIF(I),";",13)="y") S Z=$S($D(^DIC(N,0))#2:^(0),1:"")
 I Z="" S DIFQ(N)=1,DIFQN=$G(DIFQN)+1_U_N G S
 I $L($P(Z,DIF)) W $C(7),!,"*BUT YOU ALREADY HAVE '",$P(Z,U),"' AS FILE #",N,"!" D R Q:DIFQ  G S:$D(DIFKEP(N)),1
 S DIFQ(N)=$P(DIF(I),";",7)'="n"
 I $L(Z) W $C(7),!,"Note:  You already have the '",$P(Z,U),"' File." S DIFQ(0)=1
 S %=$E(^UTILITY("DIF",$J,I+1),4,245) I %]"" X % S DIFQ(N)=$T W:'$T !,"Screen on this Data Dictionary did not pass--DD will not be installed!" G S
 I $L(Z),$P(DIF(I),";",10)="y" S DIR("A")="Shall I write over the existing Data Definition",DIR("??")="^D DD^DIFROMH1",DIR("B")="YES",DIR(0)="Y" D ^DIR S DIFQ(N)=Y
S S DIFQR(N)=0 Q:$P(DIF(I),";",13)'="y"!$D(DIRUT)
 I $P(DIF(I),";",15)="y",$O(@(S_"0)"))>0 S DIF=$P(DIF(I),";",14)="o",DIR("A")="Want my data "_$P("merged with^to overwrite",U,DIF+1)_" yours",DIR("??")="^D DTA^DIFROMH1",DIR(0)="Y" D ^DIR S DIFQR(N)=$S('Y:Y,1:Y+DIF) Q
 S %=$P(DIF(I),";",14)="o" W !,$C(7),"I will ",$P("MERGE^OVERWRITE",U,%+1)," your data with mine." S DIFQR(N)=%+1
 Q
Q W $C(7),!!,"NO UPDATING HAS OCCURRED!" G Q^DIFROM0
 ;
PKG S X=$P($T(IXF),";",3),DIC="^DIC(9.4,",DIC(0)="",DIC("S")="I $P(^(0),U,2)="""_$P(X,U,2)_"""",X=$P(X,U) D ^DIC S DIFROM(0)=+Y K DIC
 Q
 ;
IXF ;;KERNEL BROKER PROTOTYPE^XWB;1

XWBINIT1
XWBINIT1 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 ; LOADS AND INDEXES DD'S
 ;
 K DIF,DIK,D,DDF,DDT,DTO,D0,DLAYGO,DIC,DIDUZ,DIR,DA,DFR,DTN,DIX,DZ D DT^DICRW S %=1,U="^",DSEC=1
 S NO=$P("I 0^I $D(@X)#2,X[U",U,%) I %<1 K DIFQ Q
ASK I %=1,$D(DIFQ(0)) W !,"SHALL I WRITE OVER FILE SECURITY CODES" S %=2 D YN^DICN S DSEC=%=1 I %<1 K DIFQ Q
 F X="DIP","OPT" D W Q:'$D(DIFQ)
 Q:'$D(DIFQ)  S %=2 W !!,"ARE YOU SURE EVERYTHING'S OK" D YN^DICN I %-1 K DIFQ Q
 I $D(DIFKEP) F DIDIU=0:0 S DIDIU=$O(DIFKEP(DIDIU)) Q:DIDIU'>0  S DIU=DIDIU,DIU(0)=DIFKEP(DIDIU) D EN^DIU2
 D DT^DICRW K ^UTILITY(U,$J),^UTILITY("DIK",$J) D WAIT^DICD
 S DN="^XWBIN" F R=1:1:33 D @(DN_$$B36(R)) W "."
 F  S D=$O(^UTILITY(U,$J,"SBF","")) Q:D'>0  K:'DIFQ(D) ^(D) S D=$O(^(D,"")) I D>0  K ^(D) D IX
DATA W "." S (D,DDF(1),DDT(0))=$O(^UTILITY(U,$J,0)) Q:D'>0
 I DIFQR(D) S DTO=0,DMRG=1,DTO(0)=^(D),Z=^(D)_"0)",D0=^(D,0),@Z=D0,DFR(1)="^UTILITY(U,$J,DDF(1),D0,",DKP=DIFQR(D)'=2 F D0=0:0 S D0=$O(^UTILITY(U,$J,DDF(1),D0)) S:D0="" D0=-1 Q:'$D(^(D0,0))  S Z=^(0) D I^DITR
 K ^UTILITY(U,$J,DDF(1)),DDF,DDT,DTO,DFR,DFN,DTN G DATA
 ;
W S Y=$P($T(@X),";",2) W !,"NOTE: This package also contains "_Y_"S",! Q:'$D(DIFQ(0))
 S %=1 W ?6,"SHALL I WRITE OVER EXISTING "_Y_"S OF THE SAME NAME" D YN^DICN I '% W !?6,"Answer YES to replace the current "_Y_"S with the incoming ones." G W
 S:%=2 DIFQ(X)=0 K:%<0 DIFQ
 Q
 ;
OPT ;OPTION
RTN ;ROUTINE DOCUMENTATION NOTE
FUN ;FUNCTION
BUL ;BULLETIN
KEY ;SECURITY KEY
HEL ;HELP FRAME
DIP ;PRINT TEMPLATE
DIE ;INPUT TEMPLATE
DIB ;SORT TEMPLATE
DIS ;FORM
 ;
SBF ;FILE AND SUB FILE NUMBERS
IX W "." S DIK="A" F %=0:0 S DIK=$O(^DD(D,DIK)) Q:DIK=""  K ^(DIK)
 S DA(1)=D,DIK="^DD("_D_"," D IXALL^DIK
 I $D(^DIC(D,"%",0)) S DIK="^DIC(D,""%""," G IXALL^DIK
 Q
B36(X) Q $$N(X\(36*36)#36+1)_$$N(X\36#36+1)_$$N(X#36+1)
N(%) Q $E("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",%)

XWBINIT2
XWBINIT2 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 ;
 ;
 K ^UTILITY("DIFROM",$J),DIC S DIDUZ=0 S:$D(DUZ)#2 DIDUZ=DUZ S DUZ=.5
 I $D(^DIC(9.2,0))#2,^(0)?1"HEL".E S (DIC,DLAYGO)=9.2,N="HEL",DIC(0)="LX" G ADD
 Q
 ;
ADD F R=0:0 S R=$O(^UTILITY(U,$J,N,R)) Q:R'>0  S X=$P(^(R,0),U,1) W "." K DA D ^DIC I Y>0,'$D(DIFQ(N))!$P(Y,U,3) S ^UTILITY("DIFROM",$J,N,X)=+Y K ^DIC(9.2,+Y,1),^(2),^(3),^(10) S %X="^UTILITY(U,$J,N,R,",%Y=DIC_"+Y,",DA=+Y D %XY^%RCR
 S DIK=DIC
HELP S R=$O(^UTILITY("DIFROM",$J,N,R)) Q:R=""  W !,"'"_R_"' Help Frame filed." S DA=^(R)
 F X=0:0 S X=$O(^DIC(9.2,DA,2,X)) Q:'X  S I=$S($D(^(X,0)):^(0),1:0),Y=$P(I,U,2) S:Y]"" Y=$O(^DIC(9.2,"B",Y,0)) S ^(0)=$P(^DIC(9.2,DA,2,X,0),U,1)_U_$S(Y>0:Y,1:"")_U_$P(^(0),U,3,99)
 S I=0 F X=0:0 S X=$O(^DIC(9.2,DA,10,X)) Q:'X  I $D(^(X,0)) S Y=$P(^(0),U),Y=$S(Y]"":$O(^MAG("B",Y,0)),1:0) S:Y $P(^DIC(9.2,DA,10,X,0),U)=Y,I=I+1,%=X I 'Y K ^DIC(9.2,DA,10,X,0)
 I I S $P(^DIC(9.2,DA,10,0),U,3,4)=%_U_I
IX D IX1^DIK G HELP
 ;
U I $D(DIRUT) S DIFQ=1
 W ! Q
REP S DIR(0)="Y",DIR("A")="Shall I change the NAME of the file to "_DIF
 S DIR("??")="^D REP^DIFROMH1",DIR("B")="NO" D ^DIR G U:$D(DIRUT)
 I Y S DIE=1,DIFQ=0,DA=N,DR=".01////"_DIF D ^DIE Q
 S DIR("A")="Shall I replace your file with mine"
 S DIR("??")="^D AG^DIFROMH1" D ^DIR G U:$D(DIRUT)!'Y
 S DIU(0)="E",DIR("A")="Do you want to keep the Data"
 S DIR("??")="^D CHG^DIFROMH1" D ^DIR G U:$D(DIRUT)
 S:'Y DIU(0)=DIU(0)_"D"
 S DIR("A")="Do you want to keep the Templates"
 S DIR("??")="^D TEMP^DIFROMH1" D ^DIR G U:$D(DIRUT) S:'Y DIU(0)=DIU(0)_"T"
 S DIFQ(N)=1,DIFKEP(N)=DIU(0) W !?15," (",DIF,") " Q

XWBINIT3
XWBINIT3 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 ;
 ;
 K ^UTILITY("DIFROM",$J) S DIC(0)="LX",(DIC,DLAYGO)=3.6,N="BUL" D ADD:$D(^XMB(3.6,0))
 S X=0 F R=0:0 S X=$O(^UTILITY("DIFROM",$J,N,X)) Q:X=""  W !,"'",X,"' BULLETIN FILED -- Remember to add mail groups for new bulletins."
 I $D(^DIC(9.4,0))#2,^(0)?1"PACK".E S N="PKG",(DIC,DLAYGO)=9.4 D ADD
 G NP:'$D(DA) S %=+$O(^DIC(9.4,DA,22,"B",DIFROM,0)) I $D(^DIC(9.4,DA,22,%,0)) S $P(^(0),U,3)=DT
 I $D(^DIC(9.4,DA,0))#2 S %=$P(^(0),U,4) I %]"" S %=$O(^DIC(9.2,"B",%,0)) S:%]"" $P(^DIC(9.4,DA,0),U,4)=%
OR I $D(^ORD(100.99))&$O(^UTILITY(U,$J,"OR","")) D EN^XWBINIT4
NP K DIC,^UTILITY("DIFROM",$J) S DIC(0)="LX" I $D(^DIC(19,0))#2,^(0)?1"OPTION".E S (DIC,DLAYGO)=19,N="OPT" D ADD,OP
 I $D(^DIC(19.1,0))#2,($P(^(0),U)?1"SECUR".E)!($P(^(0),U)="KEY") S (DIC,DLAYGO)=19.1,N="KEY" D ADD K ^UTILITY("DIFROM",$J)
 I $D(^DIC(9.8,0))#2,^(0)?1"ROUTINE^".E S (DIC,DLAYGO)=9.8,N="RTN" D ADD
 S DIC=.5,DLAYGO=0,N="FUN" D ADD
 S DIC("S")="I $P(^(0),U,4)=DIFL" F N="DIPT","DIBT","DIE" S DIC=U_N_"(" D ADD
 K DIC("S") S N="DIST(.404,",DIC=U_N,DLAYGO=.404 D ADD
 S DIC("S")="I $P(^(0),U,8)=DIFL",N="DIST(.403,",DIC=U_N,DLAYGO=.403 D ADD
 K ^UTILITY(U,$J),DIC,DLAYGO F DIFR="DIE","DIPT" D DIEZ
 K ^UTILITY("DIFROM",$J) Q
DIEZ I ^DD("VERSION")>17.4,'$D(DISYS) D OS^DII
 E  S DISYS=^DD("OS")
 Q:'$D(^DD("OS",DISYS,"ZS"))
 S DIFR1=""
DZ1 S DIFR1=$O(^UTILITY("DIFROM",$J,DIFR,DIFR1)) Q:DIFR1=""
 F DIFR2=0:0 S DIFR2=$O(^UTILITY("DIFROM",$J,DIFR,DIFR1,DIFR2)) Q:'DIFR2  S Y=DIFR2 I $D(@(U_DIFR_"(Y,""ROU"")")) K ^("ROU") I $D(^("ROUOLD")) S X=^("ROUOLD"),DMAX=^DD("ROU") D:X]"" @("EN^DI"_$E(DIFR,3)_"Z")
 G DZ1
 ;
OP S R=$O(^UTILITY("DIFROM",$J,N,R)) I R="" K ^UTILITY("DIFROM",$J) G Q
 W !,"'"_R_"' Option Filed" S DA=+^UTILITY("DIFROM",$J,N,R) G:$P(^(R),U,2,3)="XUCORE^"!($P(^(R),U,2,3)="XUCOMMAND^") OP
 I $D(^DIC(19,DA,220)) S %=$P(^(220),U) S:%]"" %=$O(^XMB(3.6,"B",%,0)) S $P(^DIC(19,DA,220),U)=%,%=$P(^(220),U,3) S:%]"" %=$O(^XMB(3.8,"B",%,0)) S $P(^DIC(19,DA,220),U,3)=%
 S %=$P(^DIC(19,DA,0),U,12) S:%]"" %=$O(^DIC(9.4,"B",%,0))
 S $P(^DIC(19,DA,0),U,12)=%,%=$P(^(0),U,7),(DZ,DIX)=0
 D:$D(^DIC(19,DA,10,"B")) KAD(DA) S:%]"" %=$O(^DIC(9.2,"B",%,0)) S $P(^DIC(19,DA,0),U,7)=%,%=$P(^(0),U,4),%="MOQXL"[% K ^(10,"B"),^("C")
 F X=0:0 S X=$O(^DIC(19,DA,10,X)) Q:'X  S I=$S($D(^(X,0)):^(0),1:0),Y=$S($D(^(U)):^(U),1:"") K ^DIC(19,DA,10,X) I Y]"",% S D=$O(^DIC(19,"B",Y,0)) I D S ^DIC(19,DA,10,X,0)=D_U_$P(I,U,2,9),DZ=DZ+1,DIX=X
 S:% ^DIC(19,DA,10,0)="^19.01PI^"_DIX_U_DZ D IX1^DIK G OP
 ;
ADD F R=0:0 S R=$O(^UTILITY(U,$J,N,R)) Q:R=""  S X=$P(^(R,0),U),DIFL=$S(N="DIST(.403,":$P(^(0),U,8),N="DIST(.404,":$P(^(0),U,2),1:$P(^(0),U,4)) W "." K DA D ^DIC I Y>0,'$D(DIFQ($E(N,1,3)))!$P(Y,U,3) S Y=Y_U D A
Q Q
A I N="BUL" K % S %(0)=$G(@(DIC_"+Y,2,0)")) F %=0:0 S %=$O(@(DIC_"+Y,2,%)")) Q:'%  S %(%)=$G(^(%,0))
 K:N'="KEY"&(N'="OPT") @(DIC_"+Y)") S ^UTILITY("DIFROM",$J,N,X)=Y S:$E(N,1,2)="DI" ^(X,+Y)="" S:N="PKG" DIFROM(0)=+Y Q:$P(Y,U,2,3)="XUCORE^"!($P(Y,U,2,3)="XUCOMMAND^")
 I N="BUL",%(0)]"" S @(DIC_"+Y,2,0)")=%(0) F %=0:0 S %=$O(%(%)) Q:'%  S @(DIC_"+Y,2,%,0)")=%(%)
 I $E(N,1,2)="DI",('DIFL)!('$D(^DD(+DIFL))) D
 .W !,"**WARNING--"_$S(N="DIE":"INPUT",N="DIPT":"PRINT",N="DIBT":"SORT",1:"FORM or BLOCK")_$S(N'["DIST":" template ",1:" ")_$P(Y,U,2)_" has been installed,",!,"but associated file "_DIFL_" is not on your system!"
 .Q
 I N="OPT" S:$P(^DIC(19,+Y,0),U,6)]"" DIOPT=$P(^(0),U,6) I $O(^UTILITY(U,$J,N,R,1,0)) K ^DIC(19,+Y,1)
 I N="DIST(.403," D BLK
 S %X="^UTILITY(U,$J,N,R,",%Y=DIC_"+Y,",DA=+Y,DIK=DIC D %XY^%RCR
 D IX1^DIK:N'="OPT" I N="OPT",$D(DIOPT) S:$P(^DIC(19,DA,0),U,6)="" $P(^(0),U,6)=DIOPT K DIOPT
 I N="DIST(.403," D
 .N DIFRVAL S DIFRVAL=$$VAL^DIFROMSS(.403,DA)
 .I DIFRVAL W !,"Compiling form: ",$P(^DIST(.403,DA,0),U) D EN^DDSZ(DA) Q
 .W !,"ERROR: Form: ",$P(^DIST(.403,DA,0),U)," cannot be compiled"
 .Q
 Q
BLK F J=0:0 S J=$O(^UTILITY(U,$J,N,R,40,J)) Q:'J  I $D(^(J,0)) S %=$P(^(0),U,2) S:%]"" %=$O(^DIST(.404,"B",%,0)) S:% $P(^UTILITY(U,$J,N,R,40,J,0),U,2)=% D B1
 K A0,A1,A2,J,L Q
B1 F L=0:0 S L=$O(^UTILITY(U,$J,N,R,40,J,40,L)) Q:'L  S A0=$G(^(L,0)),%=$P(A0,U) I %]"" S %=$O(^DIST(.404,"B",%,0)) I % S $P(A0,U)=%,^UTILITY(U,$J,N,R,40,J,"BLK",%,0)=A0 D
 .N X S X=0
 .F  S X=$O(^UTILITY(U,$J,N,R,40,J,40,L,X)) Q:X=""  S ^UTILITY(U,$J,N,R,40,J,"BLK",%,X)=^(X)
 .Q
 S A0=$G(^UTILITY(U,$J,N,R,40,J,40,0)) Q:A0=""  K ^UTILITY(U,$J,N,R,40,J,40) S (A1,A2)=0
 F L=0:0 S L=$O(^UTILITY(U,$J,N,R,40,J,"BLK",L)) Q:'L  S ^UTILITY(U,$J,N,R,40,J,40,L,0)=^(L,0),A1=L,A2=A2+1 D
 .N X S X=0
 .F  S X=$O(^UTILITY(U,$J,N,R,40,J,"BLK",L,X)) Q:X=""  S ^UTILITY(U,$J,N,R,40,J,40,L,X)=^(X)
 .Q
 S $P(A0,U,3,4)=A1_U_A2,^UTILITY(U,$J,N,R,40,J,40,0)=A0 K ^UTILITY(U,$J,N,R,40,J,"BLK")
 Q
KAD(D0) N D1,X
 S X=0 F  S X=$O(^DIC(19,D0,10,"B",X)) Q:X'>0  S D1=0 F  S D1=$O(^DIC(19,D0,10,"B",X,D1)) Q:D1'>0  K ^DIC(19,"AD",X,D0,D1)
 Q

XWBINIT4
XWBINIT4 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 ;
 ;
EN S DA(1)=1,DIK="^ORD(100.99,1,5," I $D(^ORD(100.99,1,5,DA)) D ^DIK
 S %X="^UTILITY(U,$J,""OR"","_$O(^UTILITY(U,$J,"OR",""))_",",%Y=DIK_DA_","
 S:'$D(^ORD(100.99,1,5,0)) ^(0)="^100.995P^^" S $P(^(0),U,3,4)=DA_U_($P(^(0),U,4)+1)
 D %XY^%RCR S $P(^ORD(100.99,1,5,DA,0),U)=DA,%=$P(^(0),U,4)
 I %]"" S %=$O(^ORD(100.98,"B",%,0)) I %>0 S $P(^ORD(100.99,1,5,DA,0),U,4)=%
 D OR
 S DA(1)=1 D IX1^DIK
 Q
OR S (N,I)=0,X=""
 F  S N=$O(^ORD(100.99,1,5,DA,1,N)) Q:'N  S X=$P(^(N,0),U) I X]"" S %=$O(^ORD(101,"B",X,0)) D:'% ADDP S:% ^ORD(100.99,1,5,DA,1,N,0)=% S X=N,I=I+1,(R,J)=0,Y="" D OR1
 S:I $P(^ORD(100.99,1,5,DA,1,0),U,3,4)=X_U_I S (N,I)=0,X=""
 F  S N=$O(^ORD(100.99,1,5,DA,5,N)) Q:'N  S X=$P(^(N,0),U,3) I X]"" S %=$O(^ORD(101,"B",X,0)) D:'% ADDP S:% $P(^ORD(100.99,1,5,DA,5,N,0),U,3)=% S X=N,I=I+1
 S:I $P(^ORD(100.99,1,5,DA,5,0),U,3,4)=X_U_I K N,R,X,Y,I,J
 Q
OR1 N X F  S R=$O(^ORD(100.99,1,5,DA,1,N,1,R)) Q:'R  S X=$P(^(R,0),U) I X]"" S %=$O(^ORD(101,"B",X,0)) D:'% ADDP S:% ^ORD(100.99,1,5,DA,1,N,1,R,0)=% S Y=R,J=J+1
 S:J $P(^ORD(100.99,1,5,DA,1,N,1,0),U,3,4)=Y_U_J
 Q
ADDP N I,J,N,R,DA,DLAYGO S %=""
 S DIC="^ORD(101,",DIC(0)="LX",DLAYGO=101 D FILE^DICN K DIC Q:Y=-1  S %=+Y Q

XWBINIT5
XWBINIT5 ; ; 24-FEB-1999
 ;;1.1T3;KERNEL BROKER PROTOTYPE;;NOV 19, 1996
 K ^UTILITY("DIF",$J) S DIFRDIFI=1 F I=1:1:2 S ^UTILITY("DIF",$J,DIFRDIFI)=$T(IXF+I),DIFRDIFI=DIFRDIFI+1
 Q
IXF ;;KERNEL BROKER PROTOTYPE^XWB
 ;;8994;REMOTE PROCEDURE;^XWB(8994,;0;y;;;;;;y;o
 ;;

XWBLIB
XWBLIB ;SFISC/VYD - Various remote procedure library ;01/26/96  13:20 [ 03/19/97  11:48 AM ]
 ;;1.1T3;RPC BROKER;;Nov 25, 1996
 Q
 ;
 ;
VARVAL(RESULT,VARIABLE) ;returns value of passed in variable
 S RESULT=VARIABLE ;can do this with the REFERENCE type parameter
 Q
 ;code bellow is needed if there is no REFERENCE type parameter
 N SPECVARS,X,Y
 S X=VARIABLE X ^%ZOSF("UPPERCASE") S VARIABLE=Y ;convert to uppercase
 S SPECVARS="$EC,$ECODE,$ES,$ESTACK,$ET,$ETRAP,$H,$HOROLOG,$I,$IO,$J,$JOB,$P,$PRINCIPAL,$S,$ST,$STACK,$STORAGE,$T,$TEST,$X,$Y,"
 S RESULT=""
 I $E(VARIABLE)="$",SPECVARS[(VARIABLE_",") X "S RESULT="_VARIABLE
 E  I $E(VARIABLE)'="$" S RESULT=$G(@VARIABLE)
ZZ Q

XWBSEC
XWBSEC ;SFISC/VYD - RPC BROKER ;05/13/96  15:39 [ 03/17/97  12:07 PM ]
 ;;1.1T3;RPC BROKER;;Nov 25, 1996
CHKPRMIT(XWBRP) ;checks to see if remote procedure is permited to run
 ;Input:  XWBRP - Remote procedure to check
 ;Q:$$KCHK^XUSRB("XUPROGMODE")  ;/IHS/HW UNCOMMENT AFTER TESTING
 N ERR,XWBPRMIT,XWBALLOW
 S U="^",XWBSEC="" ;clear
 ;I $E(XWBRP,1,3)'="XUS",XWBRP'="XWB CREATE CONTEXT",XWBRP'="XWB RPC LIST" D  ;check exemptions
 ;
 ;In the beginning, when no DUZ is defined and no context exist, setup
 ;default signon context
 S:'$G(DUZ) DUZ=0,XQY0="XUS SIGNON"   ;set up default context
 ;
 I XWBRP'="XWB CREATE CONTEXT",XWBRP'="XWB RPC LIST" D  ;check exemptions
 . I $D(XQY0) D
 . . S XWBALLOW=$$CHK^XQCS(DUZ,$P(XQY0,U),XWBRP)         ;do the check
 . . S:'XWBALLOW XWBSEC=XWBALLOW
 . E  S XWBSEC="Application context has not been created!"
 Q
 ;
 ;
CRCONTXT(RESULT,OPTION) ;creates context for the passed in option
 ;I $$KCHK^XUSRB("XUPROGMODE") S RESULT=1 Q  ;IHS/HW UNCOMMENT AFTER TEST
 S RESULT=0
 K XQY0
 S OPTION=$$DECRYP^XUSRB1(OPTION)
 S RESULT=$$CHK^XQCS(DUZ,OPTION)
 I RESULT S XQY0=OPTION
 E  S XWBSEC=RESULT
 Q
 ;
 ;
STATE(%) ;Return a state value
 Q:'$L($G(%)) $G(XWBSTATE)
 Q $G(XWBSTATE(%))
 ;
 ;
SET(%,VALUE) ;Set the state variable
 I $G(%)="" S XWBSTATE=VALUE
 S XWBSTATE(%)=VALUE
 Q
KILL(%) ;Kill state variable
 I $L($G(%)) K XWBSTATE(%)
 Q

XWBTCP
XWBTCP ;ISC-SF/EG - Control TCP listener [ 12/04/94  3:20 PM ] ;11/19/96  14:20
 ;;1.1T3;RPC BROKER;;Nov 25, 1996
 ;
EN ; -- entry point for interactive use
 N X1,X2,XWBTDBG,XWBIP
 S XWBIP=""
 IF ^%ZOSF("OS")["DSM" S XWBIP=$P($ZIO," ",2)
 W !,"Enter client address: "_XWBIP_"//" R X1:300 Q:'$T  Q:X1="^"
 W !,"   Enter client port: " R X2:300 Q:'$T  Q:X2="^"
 W ! S XWBTDBG=""
 IF X1="" S X1=XWBIP
 IF X1'="" D EN^XWBTCPC(X1,X2,"")
 Q
 ;
 ;
STATXFRM(STATUS) ;Port STATUS field output transform
 ;Don't recall why I needed this entry point.  If in future decide to
 ;use it, simply enter "D STATXFRM^XWBTCP(Y)" for the output x-form
 ;of the STATUS field.
 W !,"Output Transform!",!
 W STATUS,!
 Q
 ;
 ;
STATSCRN(XWBNEW) ;Port STATUS field screen
 ;DA: FileMan DA array.  See STATCHG tag bellow for detailed descr.
 ;XWBCUR: Current value of STATUS field
 ;XWBNEW: New/requested value of STATUS field
 ;        The domain for XWBCUR and XWBNEW is the same as for the
 ;        ACTION variable, described at STATCHG tag bellow.
 N C,XWBCUR,RESULT
 S C=","
 S XWBCUR=$$GET1^DIQ(8994.171,DA_C_DA(1)_C_DA(2)_C,"STATUS","I")
 S RESULT=0
 I XWBCUR=3,XWBNEW=4 S RESULT=1 ;if stopping a running listener
 I XWBCUR=6,XWBNEW=1 S RESULT=1 ;if starting a stopped listener
 ;    the next two cases are most usefull whenever some error occurs
 ;    and the STATUS field is stuck in STARTING or RUNNING state
 I XWBCUR=2,XWBNEW=3 S RESULT=1 ;change to RUNNING if it's starting
 I XWBCUR=5,XWBNEW=6 S RESULT=1 ;change to STOPPED if it's stopping
 Q RESULT
 ;
 ;
STATCHG(DA,ACTION) ;STATUS field X-ref SET logic
 ;DA: FileMan DA array
 ;  DA    =IEN of the port
 ;  DA(1) =IEN of the BOX-VOLUME
 ;  DA(2) =IEN of site/domain
 ;ACTION: Requested value for the STATUS field.  Possible values are:
 ;  1 = START, 2 = STARTING, 3 = RUNNING,
 ;  4 = STOP,  5 = STOPPING, 6 = STOPPED
 N C,ZTCPU,ZTUCI,XWBPORT,XWBFDA
 S C=","
 ;
 I ACTION=1!(ACTION=4) D
 . S ZTCPU=$$GET1^DIQ(8994.17,DA(1)_C_DA(2)_C,"BOX-VOLUME PAIR")
 . S XWBPORT=$$GET1^DIQ(8994.171,DA_C_DA(1)_C_DA(2)_C,"PORT")
 . ;S ZTUCI=$$GET1^DIQ(8994.171,DA_C_DA(1)_C_DA(2)_C,"UCI")
 . ;UCI is no longer derived from the file, but comes from current
 . ;environment.  The reason for that is it makes no sense to start
 . ;a listener in a UCI where ^XWB can't be reached to change status.
 . D GETENV^%ZOSV
 . S ZTUCI=$P(Y,U)
 . S ZTDTH=$H ;run it ASAP
 . S ZTIO=""
 . S ZTREQ="@"
 . I ACTION=1 D    ; -- START listener
 . . S ZTDESC="RPC Broker Listener START on "_ZTUCI_"-"_ZTCPU_", port "_XWBPORT
 . . S ZTRTN="EN^XWBTCPL("_XWBPORT_")"
 . E  D            ; -- STOP listener
 . . S ZTDESC="RPC Broker Listener STOP on "_ZTUCI_"-"_ZTCPU_", port "_XWBPORT
 . . S ZTRTN="STOP^XWBTCP("_XWBPORT_")"
 . D EN^DDIOL("Task: "_ZTDESC,"","!?10") ;inform user
 . D ^%ZTLOAD      ; queue it
 . D EN^DDIOL("has been queued as task "_ZTSK,"","!?10") ;inform user
 . ; --  change STATUS from START to STARTING or from STOP to STOPPING
 . D FDA^DILF(8994.171,DA_C_DA(1)_C_DA(2)_C,1,"R",ACTION+1,"XWBFDA")
 . D FILE^DIE("K","XWBFDA")
 Q
 ;
 ;
STRT(XWBTSKT) ;start TCP Listener.  Interactive entry point
 N IP,REF,Y,%
 S U="^"
 W "Start TCP Listener...",!
 X ^%ZOSF("UCI") S REF=Y
 S IP="0.0.0.0" ;get server IP at some point
 IF $G(XWBTSKT)="" S XWBTSKT=9000 ;default service port is 9000
 ;
 ; -- see if 'running flag' for listener is set
 ;L +^XWB(IP,REF,XWBTSKT,"RUNNING"):1
 ;D GETENV^%ZOSV ;get Y=UCI^VOL^NODE^BOXLOOKUP of current system
 ;L +^%ZIS(8994.171,"RPCB Listener",$P(Y,U,2),$P(Y,U),$P(Y,U,3),XWBTSKT):1
 ;I '$T W "TCP Listener on port "_XWBTSKT_" appears to be running already." Q
 I '$$SEMAPHOR^XWBTCPL(XWBTSKT,"LOCK") W "TCP Listener on port "_XWBTSKT_" appears to be running already.",! Q
 ;L -^XWB(IP,REF,XWBTSKT,"RUNNING")
 ;L -^%ZIS(8994.171,"RPCB Listener",$P(Y,U,2),$P(Y,U),$P(Y,U,3),XWBTSKT)
 S %=$$SEMAPHOR^XWBTCPL(XWBTSKT,"UNLOCK")
 ;
 ; -- set stop flag to false and start the listener
 ;S ^XWB(IP,REF,XWBTSKT,"STOP")=""
 S ^XWB(IP,REF,XWBTSKT,"PROBLEM MARKER")=""  ;record problem marker
 J EN^XWBTCPL(XWBTSKT)::5
 I '$T W "Unable to run TCP Listener in background.",! Q
 F %=1:1:5 D  Q:%=0
 . W "Checking if TCP Listener has started...",!
 . H 3
 . L +^XWB(IP,REF,XWBTSKT,"PROBLEM MARKER")
 . S:'$D(^XWB(IP,REF,XWBTSKT,"PROBLEM MARKER")) %=0
 . L -^XWB(IP,REF,XWBTSKT,"PROBLEM MARKER")
 I $D(^XWB(IP,REF,XWBTSKT,"PROBLEM MARKER")) D
 . W !,"TCP Listener could not be started!",!
 . W "Check if port "_XWBTSKT_" is busy on this CPU.",!
 . K ^XWB(IP,REF,XWBTSKT,"PROBLEM MARKER")   ;clear marker
 E  W "TCP Listener started successfully."
 Q
 ;
 ;
STRTALL ;XWB LISTENER STARTER option entry point
 ;here all listener entries in RPC Broker Site Parameters file that
 ;have CONTROLLED BY LISTENER STARTER set to 1/Yes will be started.
 N E,LSTN,LSTNID,LSTNIENS,PORTID,XWBSCR,XWBDA
 ;XWBDA: Namespaced FileMan DA array
 ;  XWBDA    =IEN of the port
 ;  XWBDA(1) =IEN of the BOX-VOLUME
 ;  XWBDA(2) =IEN of site/domain
 S E=""
 S XWBDA(2)=1 ;hard set IEN of site/domain
 ; -- screen out RUNNING (STATUS=3) listeners and those that aren't controlled by XWB LISTENER STARTER option.
 S XWBSCR="I $P(^(0),U,2)'=3,$P(^(0),U,4)"
 ; -- get top level listners box-volume
 D LIST^DIC(8994.17,",1,",E,E,E,E,E,E,E,E,$NA(LSTN("LSTNR")))
 S LSTNID=""
 F  S LSTNID=$O(LSTN("LSTNR","DILIST",1,LSTNID)) Q:LSTNID=""  D
 . S XWBDA(1)=LSTN("LSTNR","DILIST",2,LSTNID) ;IEN of each listener
 . S LSTNIENS=","_XWBDA(1)_","_XWBDA(2)_","
 . D LIST^DIC(8994.171,LSTNIENS,E,"P",E,E,E,E,XWBSCR,E,$NA(LSTN("PORT")))
 . S PORTID=0
 . F  S PORTID=$O(LSTN("PORT","DILIST",PORTID)) Q:PORTID=""  D
 . . ;W !,"--------------",! ZW LSTN
 . . S XWBDA=$P(LSTN("PORT","DILIST",PORTID,0),U,2)
 . . ;W !,"========",! ZW XWBDA
 . . D STATCHG(.XWBDA,1) ;use STATUS field X-ref SET logic to queue up start of a listener
 Q
 ;
 ;
STOP(XWBTSKT) ;stop TCP Listener.  Interactive and TaskMan entry point
 N IP,REF,X,DEV,XWBOS  ;**1**
 S U="^"
 W "Stop TCP Listener...",!
 X ^%ZOSF("UCI") S REF=Y
 S IP="0.0.0.0" ;get server IP
 IF $G(XWBTSKT)="" S XWBTSKT=9000 ;default service port is 9000
 ;
 S XWBOS=$S(^%ZOSF("OS")["DSM":"DSM",^("OS")["MSM":"MSM",^("OS")["OpenM":"OpenM",1:"") ;RWF
 ;
 ; -- make sure the listener is running
 ;L +^XWB(IP,REF,XWBTSKT,"RUNNING"):1
 ;D GETENV^%ZOSV ;get Y=UCI^VOL^NODE^BOXLOOKUP of current system
 ;L +^%ZIS(8994.171,"RPCB Listener",$P(Y,U,2),$P(Y,U),$P(Y,U,3),XWBTSKT):1
 ;I $T D  Q
 I $$SEMAPHOR^XWBTCPL(XWBTSKT,"LOCK") D  Q
 . ;L -^XWB(IP,REF,XWBTSKT,"RUNNING")
 . ;L -^%ZIS(8994.171,"RPCB Listener",$P(Y,U,2),$P(Y,U),$P(Y,U,3),XWBTSKT)
 . S %=$$SEMAPHOR^XWBTCPL(XWBTSKT,"UNLOCK")
 . D EN^DDIOL("TCP Listener does not appear to be running.")
 ;
 ; -- set the stop flag
 ;S ^XWB(IP,REF,XWBTSKT,"STOP")=1
 ;
 ; -- send the shutdown message to the TCP Listener process
 ;    using loopback address
 ; -- connect to 127.0.0.1 for DSM
 I XWBOS="DSM" O XWBTSKT:(TCPCHAN:ADDRESS="127.0.0.1") U XWBTSKT S DEV=XWBTSKT
 ; -- connect to 127.0.0.1 for MSM
 I XWBOS="MSM" O 56 U 56::"TCP" W /SOCKET("localhost",XWBTSKT) S DEV=56
 ; -- connect to 127.0.0.1 for OpenM
 I XWBOS="OpenM" D CALL^%ZISTCP("127.0.0.1",XWBTSKT) U IO S DEV=IO ;RWF
 ;
 S X=$T(+2),X=$P(X,";;",2),X=$P(X,";")
 IF X="" S X=0
 S X=$C($L(X))_X
 W "{XWB}00020|"_X_"00011TCPshutdown",!
 ;W "{XWB}00011TCPshutdown",!  ;**1**
 R X#3:5
 I XWBOS="OpenM" D CLOSE^%ZISTCP I 1 ;RWF
 E  C DEV ;RWF
 D EN^DDIOL("TCP Listener Response to Shutdown Request: "_X)  ;**1**
 IF X="ack" D EN^DDIOL("TCP Listener has been shutdown.")  ;**1**
 ELSE  D EN^DDIOL("Shutdown Failed!")  ;**1**
 ;change process name
 D CHPRN^XWBTCPC($J)
 Q

XWBTCPC
XWBTCPC ;ISC-SF/EG/VYD - TCP/IP PROCESS HANDLER ;11/19/96  14:01 [ 06/16/97  7:24 PM ]
 ;;1.1T3;RPC BROKER;;Nov 25, 1996
 ;Based on:
 ;XQORTCPH ;SLC/KCM - Service TCP Messages [ 12/04/94  9:06 PM ]
 ;Modified by ISC-SF/EG
 ; 0. No longer supports old style OERR messages
 ; 1. Makes call to RPC  broker
 ; 2. Handles MSM Server under Windows NT
 ; 3. Handles MSM under Unix - same as DSM
 ; 4. Result of an rpc call can be a closed form of global
 ; 5. Can receive a large local array, within limits of job
 ;    partition size.
 ; 6. Sets default device to NULL device prior to call, restores
 ;    at termination.  Prevents garbage from 'talking' calls.
 ; 7. All reads have a timeout.
 ; 8. Intro message is sent when first connected.
 ; 9. Uses callback model to connect to client
 ;
MSM ;entry point for MSERVER service - used by MSM
 N XWBVER,LEN,MSG,X
 S XWBVER=0
 R LEN#11 IF $E(LEN,1,5)'="{XWB}" D  Q  ;bad client, abort
 . W "RPC broker disconnect!",!
 . C 56
 . Q
 IF $E(LEN,11,11)="|" D
 . R X#1
 . R XWBVER#$A(X)
 . R LEN#5
 . R MSG#LEN
 . Q
 ELSE  S X=$E(LEN,11,11),LEN=$E(LEN,6,10)-1 R MSG#LEN S MSG=X_MSG
 IF $P(MSG,"^")="TCPconnect" D
 . D SNDERR W "accept",$C(4),!
 . C 56
 . D EN($P(MSG,"^",2),$P(MSG,"^",3),$P(X,"^"),XWBVER)
 IF $P(MSG,"^")="TCPdebug" D
 . D SNDERR W "accept",$C(4),!
 C 56
 Q
 ;
EN(XWBTIP,XWBTSKT,DUZ,XWBVER) ; -- Main entry point
 N TYPE,XWBTBUF,XWBTBUF1,XWBTDEV,XWBTLEN,XWBTOS,XWBTRTN,XWBWRAP
 N X,XWBL,XWB1,XWB2,Y,XWBTIME,XWBPTYPE,XWBPLEN,XWBNULL,XWBODEV
 N XWBERROR,XWBSEC ;new error variable available to rpc calls
 N XRTL,IO,IOP,L,XWBAPVER
 ;
 S ^HW("TCPC","EN")="XWBTIP="_XWBTIP_"XWBTSKT="_XWBTSKT
 S XWBOS=$S(^%ZOSF("OS")["DSM":"DSM",^("OS")["UNIX":"UNIX",^("OS")["OpenM":"OpenM",1:"MSM")
 ;IHS/HMW Commented next 2 and added 3
 ;IF $$NEWERR^%ZTER S $ETRAP="D ^%ZTER H"
 ;E  S X="^%ZTER",@^%ZOSF("TRAP")
 S X="^%ZTER",@^%ZOSF("TRAP")
 K XRTL IF XWBOS="DSM" S XRTL=1 ;log response time data for DSM
 S XWBTIME=1
 ;call client on new port
 IF XWBOS="DSM" D
 . ;IF '$D(%)#2 S %=$P($ZIO,":")_":" ; Call with dsm$xecute()
 . ;S %=+$P($ZIO,"Port: ",2)_":"
 . ;S (XWBTDEV,IO,IO(0))=%,X=$E(%_"WKSTA",1,15)
 . ;;D SETENV^%ZOSV
 . O XWBTSKT:(TCPCHAN:ADDRESS=XWBTIP:SHARE)
 . U XWBTSKT X ^%ZOSF("TRMOFF")
 . S XWBTDEV=XWBTSKT
 ;
 IF XWBOS="MSM"!(XWBOS="UNIX") D
 . O 56 U 56::"TCP"
 . W /SOCKET(XWBTIP,XWBTSKT)
 . ;S (XWBTDEV,IO,IO(0))=56
 . S XWBTDEV=56
 . S ^HW("TCPC","SOCKET")="GOT TO HERE"
 ;
 ;Open in stream mode, Standard terminators, Big buffers
 IF XWBOS="OpenM" D
 . S XWBTDEV="|TCP|"_XWBTSKT
 . O XWBTDEV:(XWBTIP:XWBTSKT:"ST":$C(13,10):512:512) ;RWF
 . U XWBTDEV ;RWF
 ;
 ;setup null device "NULL"
 S XWBNULL=$S(XWBOS="DSM":"_NLA0:",1:"")
 IF XWBOS="DSM" O XWBNULL
 ELSE  D
 . S ^HW("TCPC","ZIS1")="GOT TO HERE"
 . S (IO,IO(0))=XWBTDEV
 . ;S IOP="NULL" D ^%ZIS S XWBNULL=IO
 . S XWBNULL="" ;IHS/HMW CHANGE THIS WHEN I FIND THE $I FOR UNIX NULL
 . S ^HW("TCPC","ZIS2")="GOT TO HERE"
 ;
 ;change process name
 D CHPRN("ip"_$P(XWBTIP,".",3,4)_":"_XWBTSKT)
 S ^HW("TCPC","CHPRN")="GOT TO HERE"
RESTART ;IHS/HMW Commented next 2 and added 3
 ;IF $$NEWERR^%ZTER N $ESTACK S $ETRAP="S %ZTER11S=$STACK D ETRAP^XWBTCPC"
 ;E  S X="ETRAP^XWBTCPC",@^%ZOSF("TRAP")
 S X="ETRAP^XWBTCPC",@^%ZOSF("TRAP")
 S DIQUIET=1,U="^" D DT^DICRW
 U XWBTDEV D MAIN
 ;Turn off the error for the exit
 ;IHS/HMW Commented next 2 and added 3
 ;IF $$NEWERR^%ZTER S $ETRAP=""
 ;E  S X="",@^%ZOSF("TRAP")
 E  S X="",@^%ZOSF("TRAP")
 I $G(DUZ) D LOGOUT^XUSRB
 K XWBR,XWBARY
 C XWBTDEV
 IF XWBOS="DSM" C XWBNULL
 ELSE  D ^%ZISC
 Q
 ;
MAIN ; -- main message processing loop
 S ^HW("TCPC","MAIN0")="GOT TO HERE"
 F  D  Q:XWBTBUF="#BYE#"
 . S XWBAPVER=0
 . ;
 . ; -- read client request
 . ;R XWBTBUF#15:36000 IF '$T S XWBTBUF="#BYE#" D SNDERR W XWBTBUF,$C(4),! Q
 . R XWBTBUF#11:36000 S ^HW("TCPC","MAIN")="XWBTBUF="_XWBTBUF IF '$T S XWBTBUF="#BYE#" D SNDERR W XWBTBUF,$C(4),! Q
 . S TYPE=$S($E(XWBTBUF,1,5)="{XWB}":1,1:0)
 . I 'TYPE S XWBTBUF="#BYE#" D SNDERR W XWBTBUF,$C(4),! Q
 . S XWBTLEN=$E(XWBTBUF,6,10)
 . S L=$E(XWBTBUF,11,11) IF L="|" R L#1 S L=$A(L) R XWBAPVER#L R XWBTBUF#5
 . E  R XWBTBUF#4 S ^HW("TCPC","MAIN5")="XWBTBUF="_XWBTBUF S XWBTBUF=L_XWBTBUF S ^HW("TCPC","MAIN5B")="XWBTBUF="_XWBTBUF
 . S XWBPLEN=XWBTBUF
 . R XWBTBUF#XWBPLEN:XWBTIME S ^HW("TCPC","MAIN6")="XWBTBUF="_XWBTBUF
 . I $P(XWBTBUF,U)="TCPconnect" D  Q
 . . D SNDERR W "accept",$C(4),!  ;Ack
 . IF TYPE D
 . . K XWBR,XWBARY
 . . IF XWBTBUF="#BYE#" D SNDERR W "#BYE#",$C(4),! Q  ; -- clean disconnect
 . . S XWBTLEN=XWBTLEN-15
 . . ;IF XWBOS="DSM" X "ZDEBUG ON B  "
 . . S ^HW("TCPC","MAIN8")="XWBTBUF="_XWBTBUF
 . . D CALLP^XWBBRK(.XWBR,XWBTBUF)
 . . S XWBPTYPE=$S('$D(XWBPTYPE):1,XWBPTYPE<1:1,XWBPTYPE>6:1,1:XWBPTYPE)
 . IF XWBTBUF="#BYE#" Q
 . U XWBTDEV
 . D SNDERR
 . D:$D(XRTL) T0^%ZOSV ;start RTL
 . IF XWBOS="DSM"!(XWBOS="UNIX")!(XWBOS="OpenM") D SNDDSM ;RWF
 . IF XWBOS="MSM" D SND
 . S XWBSEC=""
 . W $C(4),! ;send eot and flush buffer
 . S:$D(XRT0) XRTN="RPC BROKER WRITE" D:$D(XRT0) T1^%ZOSV ;stop RTL
 Q  ;End Of Main
 ;
SNDERR ;send error information
 ;XWBSEC is the security packet, XWBERROR is application packet
 N X
 S X=$G(XWBSEC)
 W $C($L(X))_X W:($X+$L(X)+1)>512 !
 S X=$G(XWBERROR)
 W $C($L(X))_X W:($X+$L(X)+1)>512 !
 S XWBERROR="" ;clears parameters
 Q
 ;
SND ; -- Send data (all except DSM)
 N I,T
 ;
 ; -- error or abort occurred, send null
 IF $L(XWBSEC)>0 W "" Q
 ; -- RPC returned closed root of array, process it as global array
 IF XWBPTYPE=2,$D(XWBR)#2,$D(@XWBR)>1 S XWBPTYPE=4,XWBWRAP=1
 ; -- single value
 IF XWBPTYPE=1 S XWBR=$G(XWBR) W XWBR Q
 ; -- table delimited by CR+LF
 IF XWBPTYPE=2 D  Q
 . S I="" F  S I=$O(XWBR(I)) Q:I=""  W XWBR(I),$C(13,10)
 ; -- word processing
 IF XWBPTYPE=3 D  Q
 . S I="" F  S I=$O(XWBR(I)) Q:I=""  W XWBR(I) W:XWBWRAP $C(13,10)
 ; -- global array
 IF XWBPTYPE=4 D  Q
 . S I=XWBR,T=$E(I,1,$L(I)-1) W:$D(@I)>10 @I F  S I=$Q(@I) Q:I=""!(I'[T)  W @I W:XWBWRAP $C(13,10)
 ; -- global instance
 IF XWBPTYPE=5 S XWBR=$G(@XWBR) W XWBR Q
 ; -- variable length records
 IF XWBPTYPE=6 S I="" F  S I=$O(XWBR(I)) Q:I=""  W $C($L(XWBR(I))),XWBR(I)
 Q
SNDDSM ; -- send data for DSM (requires buffer flush (!) every 509 chars)
 N I,T
 ;
 ; -- error or abort occurred, send null
 IF $L(XWBSEC)>0 W "" Q
 ; -- RPC returned closed root of array, process it as global array
 IF XWBPTYPE=2,$D(XWBR)#2,$D(@XWBR)>1 S XWBPTYPE=4,XWBWRAP=1
 ; -- single value
 IF XWBPTYPE=1 S XWBR=$G(XWBR) W XWBR Q
 ; -- table delimited by CR+LF
 I XWBPTYPE=2 D  Q
 . S I="" F  S I=$O(XWBR(I)) Q:I=""  W:($X+$L(XWBR(I)))>509 ! W XWBR(I),$C(13,10)
 ; -- word processing
 IF XWBPTYPE=3 D  Q
 . S I="" F  S I=$O(XWBR(I)) Q:I=""  W:($X+$L(XWBR(I)))>509 ! W XWBR(I) W:XWBWRAP $C(13,10)
 ; -- global array
 IF XWBPTYPE=4 D  Q
 . S I=XWBR,T=$E(I,1,$L(I)-1) W:$D(@I)>10 @I F  S I=$Q(@I) Q:I=""!(I'[T)  W:($X+$L(@I))>509 ! W @I W:XWBWRAP&(@I'=$C(13,10)) $C(13,10)
 ; -- global instance
 IF XWBPTYPE=5 S XWBR=$G(@XWBR) W XWBR Q
 ; -- variable length records
 IF XWBPTYPE=6 S I="" F  S I=$O(XWBR(I)) Q:I=""  W:($X+$L(XWBR(I)))>509 ! W $C($L(XWBR(I))),XWBR(I)
 Q
 ;
ETRAP ; -- on trapped error, send error info to client
 N XWBERR
 S XWBERR=$C(24)_"M  ERROR="_$ZERROR_$C(13,10)_"LAST REF="_$ZR_$C(4)
 ;Turn off trapping during trap.
 ;IHS/HMW Commented next 2 and added 3
 ;IF $$NEWERR^%ZTER S $ETRAP=""
 ;E  S X="",@^%ZOSF("TRAP")
 S X="",@^%ZOSF("TRAP")
 U XWBTDEV
 D ^%ZTER
 IF XWBOS="DSM" D
 . I $D(XWBTLEN),XWBTLEN,$ZE'["SYSTEM-F" D SNDERR W XWBERR,!
 IF XWBOS'="DSM" D
 . D SNDERR W XWBERR,!
 I ($ZE["READERR")!($ZE["DISCON")!($ZE["SYSTEM-F") HALT
 ;IHS/HMW Commented next1 and added following  line
 ;I '$$NEWERR^%ZTER G RESTART
 G RESTART
 S $ETRAP="Q:($ESTACK&'$QUIT)  Q:$ESTACK 0 S $ECODE="""" G RESTART",$ECODE=",U99,"
 Q
 ;
BREAD(L) ;read tcp buffer, L is length
 N E,X,DONE
 S (E,DONE)=0
 R X#L:XWBTIME
 S E=X
 IF $L(E)<L F  D  Q:'DONE
 . IF $L(E)=L S DONE=1 Q
 . R X#(L-$L(E)):XWBTIME
 . S E=E_X
 Q E
 ;
CHPRN(N) ;change process name
 ;Change process name to N
 D SETNM^%ZOSV($E(N,1,15))
 Q
 ;

XWBTCPH
XWBTCPH ;ISC-SF/EG - TCP/IP PROCESS HANDLER ; 4/28/95
 ;;1.0T11;RPC BROKER;;Oct 31, 1995
 ;;V1.0T10;KERNEL RPC BROKER;
 ;Based on:
 ;XQORTCPH ;SLC/KCM - Service TCP Messages [ 12/04/94  9:06 PM ]
 ;XWBTCPH  ;XXX/KCMO converted to use UCX service; 4/28/95
 ;
 ;Modified by ISC-SF/EG
 ; 0. No longer supports old style OERR messages
 ; 1. Makes call to RPC  broker
 ; 2. Handles MSM Server under Windows NT
 ; 3. Handles MSM under Unix - same as DSM
 ; 4. Result of an rpc call can be a closed form of global
 ; 5. Can receive a large local array, within limits of job
 ;    partition size.
 ; 6. Sets default device to NULL device prior to call, restores
 ;    at termination.  Prevents garbage from 'talking' calls.
 ; 7. All reads have a timeout.
 ; 8. Intro message is sent when first connected.
 ;
EN ; -- Main entry point for the UCX service call
 N TYPE,XWBTBUF,XWBTBUF1,XWBTDEV,XWBTLEN,XWBTOS,XWBTRTN,XWBWRAP
 N X,XWBL,XWB1,XWB2,Y,XWBTIME,XWBPTYPE,XWBPLEN,XWBNULL,XWBODEV
 S XWBTIME=1
 S XWBOS=$S(^%ZOSF("OS")["DSM":"DSM",^("OS")["UNIX":"UNIX",1:"MSM")
 S XWBNULL=$S(XWBOS="DSM":"NLA0:",1:"")
 IF XWBOS="DSM" D
 . IF '$D(%)#2 S %=$P($ZIO,":")_":" ; Call with dsm$xecute()
 . S (XWBTDEV,IO,IO(0))=%,X=$E(%_"WKSTA",1,15)
 . D SETENV^%ZOSV
 . O IO:(SHARE) X ^%ZOSF("TRMOFF")
 IF XWBOS="MSM"!(XWBOS="UNIX") D
 . S (XWBTDEV,IO,IO(0))=56
 IF XWBOS="DSM" S $ETRAP="S %ZTER11S=$STACK D ETRAP^XWBTCPH"
 E  S X="ETRAP^XWBTCPH",@^%ZOSF("TRAP")
 S DIQUIET=1,X="ETRAP^XWBTCPH",@^%ZOSF("TRAP") D DT^DICRW
 ;S DIQUIET=1 D DT^DICRW
 S U="^"
 ;
MAIN ; -- main message processing loop
 F  D  Q:XWBTBUF="#BYE#"
 . ;
 . ; -- read client request
 . R XWBTBUF#15:600 IF '$T S XWBTBUF="#BYE#" W XWBTBUF,$C(4),! Q
 . IF $L(XWBTBUF)=0 S XWBTBUF="#BYE#" W XWBTBUF,$C(4),! Q
 . S TYPE=$S($E(XWBTBUF,1,5)="{XWB}":1,1:0)
 . S XWBTLEN=$E(XWBTBUF,6,10)
 . S XWBPLEN=$E(XWBTBUF,11,15)
 . R XWBTBUF#XWBPLEN:XWBTIME
 . I $P(XWBTBUF,U)="TCPconnect" D  Q
 . . W "accept",$C(4),!  ;Ack
 . IF TYPE D
 . . K XWBR
 . . IF XWBTBUF="#BYE#" W "#BYE#",$C(4),! Q  ; -- clean disconnect
 . . S XWBTLEN=XWBTLEN-15
 . . ;IF XWBTLEN>240 S XWBR=$$RCN()
 . . D CALLP^XWBBRK(.XWBR,XWBTBUF)
 . . S XWBPTYPE=$S('$D(XWBPTYPE):1,XWBPTYPE<1:1,XWBPTYPE>6:1,1:XWBPTYPE)
 . IF XWBTBUF="#BYE#" Q
 . IF XWBOS="DSM"!(XWBOS="UNIX") D SNDDSM
 . IF XWBOS="MSM" D SND
 . W $C(4),! ;send eot and flush buffer
 IF 'TYPE D
 . W "#UNKNOWN MESSAGE TYPE#",$C(4),! Q  ;end session
 ;
 C XWBTDEV Q
 ;
SND ; -- Send data (all except DSM)
 N I,T
 ; -- single value
 IF XWBPTYPE=1 S XWBR=$G(XWBR) W XWBR Q
 ; -- table delimited by CR+LF
 IF XWBPTYPE=2 D  Q
 . S I="" F  S I=$O(XWBR(I)) Q:I=""  W XWBR(I),$C(13,10)
 ; -- word processing
 IF XWBPTYPE=3 D  Q
 . S I="" F  S I=$O(XWBR(I)) Q:I=""  W XWBR(I) W:XWBWRAP $C(13,10)
 ; -- global array
 IF XWBPTYPE=4 D  Q
 . S I=XWBR,T=$E(I,1,$L(I)-1) W:$D(@I)>10 @I F  S I=$Q(@I) Q:I=""!(I'[T)  W @I W:XWBWRAP $C(13,10)
 ; -- global instance
 IF XWBPTYPE=5 S XWBR=$G(@XWBR) W XWBR Q
 ; -- variable length records
 IF XWBPTYPE=6 S I="" F  S I=$O(XWBR(I)) Q:I=""  W $C($L(XWBR(I))),XWBR(I)
 Q
SNDDSM ; -- send data for DSM (requires buffer flush (!) every 512 chars)
 N I,T
 ; -- single value
 IF XWBPTYPE=1 S XWBR=$G(XWBR) W XWBR Q
 ; -- table delimited by CR+LF
 I XWBPTYPE=2 D  Q
 . S I="" F  S I=$O(XWBR(I)) Q:I=""  W:($X+$L(XWBR(I)))>512 ! W XWBR(I),$C(13,10)
 ; -- word processing
 IF XWBPTYPE=3 D  Q
 . S I="" F  S I=$O(XWBR(I)) Q:I=""  W:($X+$L(XWBR(I)))>512 ! W XWBR(I) W:XWBWRAP $C(13,10)
 ; -- global array
 IF XWBPTYPE=4 D  Q
 . S I=XWBR,T=$E(I,1,$L(I)-1) W:$D(@I)>10 @I F  S I=$Q(@I) Q:I=""!(I'[T)  W:($X+$L(@I))>512 ! W @I W:XWBWRAP&(@I'=$C(13,10)) $C(13,10)
 ; -- global instance
 IF XWBPTYPE=5 S XWBR=$G(@XWBR) W XWBR Q
 ; -- variable length records
 IF XWBPTYPE=6 S I="" F  S I=$O(XWBR(I)) Q:I=""  W:($X+$L(XWBR(I)))>512 ! W $C($L(XWBR(I))),XWBR(I)
 Q
 ;
ETRAP ; -- on trapped error, send error info to client
 N XWBERR
 S XWBERR=$C(24)_"M  ERROR="_$ZERROR_$C(13,10)_"LAST REF="_$ZR_$C(4)
 U XWBTDEV
 IF XWBOS="DSM" D
 . I $D(XWBTLEN),XWBTLEN,$ZE'["SYSTEM-F" W XWBERR D @^%ZOSF("ERRTN")
 IF XWBOS="MSM" D
 . W XWBERR D @^%ZOSF("ERRTN")
 C XWBTDEV HALT
 ;
RCN() ;read entire buffer in chunks of 240 - save in global
 N I,T
T S T=$R(10000)+1
 L +^TMP("XWB",$J,T):3 IF '$T G T
 F I=1:1:(XWBTLEN\240) D
 . S ^TMP("XWB",$J,T,I)=$$BREAD(240)
 S ^TMP("XWB",$J,T,I+1)=$$BREAD(XWBTLEN#240)
 Q "^TMP(""XWB"","_$J_","_T_")"
 ;
BREAD(L) ;read tcp buffer, L is length
 N E,X,DONE
 S (E,DONE)=0
 R X#L:XWBTIME
 S E=X
 IF $L(E)<L F  D  Q:'DONE
 . IF $L(E)=L S DONE=1 Q
 . R X#(L-$L(E)):XWBTIME
 . S E=E_X
 Q E
 ;

XWBTCPL
XWBTCPL ;SLC/KCM - Listener for TCP connects [ 06/16/97  7:26 PM ]
 ;;1.1T3;RPC BROKER;;Nov 25, 1996
 ;ISC-SF/EG - DHCP Broker
 ;
 ; This routine is the background process that listens for client
 ; requests to connect to M.  When a request is received, This
 ; procedure will job a s small routine to listen for new requests
 ; on the known service port.
 ;
 ; This job may be started in the background with:  D STRT^XWBTCP(PORT)
 ;
 ; When running, this job may be stopped with:      D STOP^XWBTCP(PORT)
 ;
 ; Where port is the known service port to listen for connections
 ;
EN(XWBTSKT) ; -- accept clients and start the individual message handler
 N IP,REF,RETRY,XWBVER
 S U="^"
 S RETRY="START"
 X ^%ZOSF("UCI") S REF=Y
 S IP="0.0.0.0" ;get server IP
 IF $G(XWBTSKT)="" S XWBTSKT=9000 ; default service port
 S XWBTDEV=XWBTSKT
 ;
 D SETNM^%ZOSV($E("RPCB_Port:"_XWBTSKT,1,15)) ;change process name
 N LEN,MSG,XWBOS,DONE,DSMTCP,X
 ; -- check the TCP stop parameter
 ;IF $G(^XWB(IP,REF,XWBTSKT,"STOP")) K ^XWB(IP,REF,XWBTSKT) Q   ; -- change to param file later ***
 Q:'$$SEMAPHOR(XWBTSKT,"LOCK")  ; -- quit if job is already running
 ;
 D UPDTREC(XWBTSKT,3) ;updt RPC BROKER SITE PARAMETER record as RUNNING
 ;
RESTART ;
 S DONE=0
 S XWBOS=$S(^%ZOSF("OS")["DSM":"DSM",^("OS")["MSM":"MSM",^("OS")["OpenM":"OpenM",1:"")
 ;IHS/HMW Commented next two lines and added third. 
 ; after msm 4.3.2 installed, N $ESTACK generates a FUNCT error
 ;IF $$NEWERR^%ZTER N $ESTACK S $ETRAP="S %ZTER11S=$STACK D ETRAP^XWBTCPL"
 ;E  S X="ETRAP^XWBTCPL",@^%ZOSF("TRAP")
 S X="ETRAP^XWBTCPL",@^%ZOSF("TRAP")
 ;
 ; -- check the TCP stop parameter
 ;IF $G(^XWB(IP,REF,XWBTSKT,"STOP")) K ^XWB(IP,REF,XWBTSKT) Q   ; -- change to param file later ***
 ;
 I XWBOS="DSM" O XWBTSKT:TCPCHAN:5 ;Open listener
 ; -- loop until TCP stop parameter is set
 ;F  D  Q:$G(^XWB(IP,REF,XWBTSKT,"STOP"))
 F  D  Q:DONE
 . L +^XWB(IP,REF,XWBTSKT,"PROBLEM MARKER")
 . K ^XWB(IP,REF,XWBTSKT,"PROBLEM MARKER")   ;clear problem marker
 . L -^XWB(IP,REF,XWBTSKT,"PROBLEM MARKER")
 . ;
 . ; -- listen for connect & get the initial message from the client
 . I XWBOS="DSM" U XWBTSKT
 . I XWBOS="MSM" S XWBTDEV=56 O 56 U 56::"TCP" W /SOCKET("",XWBTSKT)
 . I XWBOS="OpenM" S XWBTDEV="|TCP|"_XWBTSKT O XWBTDEV:(:XWBTSKT:"AT") U XWBTDEV R *X
 . S XWBVER=0
 . R LEN#11 S ^HW("TCP","LEN11")=LEN IF $E(LEN,1,5)'="{XWB}" Q
 . IF $E(LEN,11,11)="|" D
 . . R X#1
 . . R XWBVER#$A(X)
 . . R LEN#5
 . . R MSG#LEN
 . ELSE  S X=$E(LEN,11,11),LEN=$E(LEN,6,10)-1 R MSG#LEN S MSG=X_MSG S ^HW("TCP","MSG")=MSG
 . ; -- msg should be:  action^client IP^client port^token
 . ;
 . ; -- if the action is TCPconnect (usual case)
 . I $P(MSG,"^")="TCPconnect" D
 . . ;-- decrypt token
 . . N X,%T S X="",%T=0
 . . IF XWBOS="DSM" J EN^XWBTCPC($P(MSG,"^",2),$P(MSG,"^",3),$P(X,"^"),XWBVER):OPTION="/SYMBOL=100000":5 S %T=$T
 . . IF XWBOS="MSM" J EN^XWBTCPC($P(MSG,"^",2),$P(MSG,"^",3),$P(X,"^"),XWBVER):100000:5 S %T=$T
 . . I XWBOS="OpenM" J EN^XWBTCPC($P(MSG,"^",2),$P(MSG,"^",3),$P(X,"^"),XWBVER)::5 S %T=$T
 . . I %T D SNDERR W "accept",$C(4),!
 . . E  D SNDERR W "reject",$C(4),! S ^TMP("TCP",$P($H,",",2))="REJECT"
 . ;
 . ; -- if the action is TCPdebug (when msg handler run interactively)
 . I $P(MSG,"^")="TCPdebug" D SNDERR W "accept",$C(4),!
 . ;
 . ; -- if the action is TCPshutdown, this listener will quit if the
 . ;    stop flag has been set.  This request comes from an M process.
 . I $P(MSG,"^")="TCPshutdown" S DONE=1 W "ack",!
 . ;Now release the connection.
 . I XWBOS="DSM" U XWBTSKT:DISCONNECT ; release this socket
 . I XWBOS="MSM" C 56
 . I XWBOS="OpenM" C XWBTDEV
 . Q
 ; -- loop end
 ;
 IF XWBOS="DSM" C XWBTSKT
 S %=$$SEMAPHOR(XWBTSKT,"UNLOCK") ; destroy 'running flag'
 ;K ^XWB(IP,REF,XWBTSKT,"STOP")
 D UPDTREC(XWBTSKT,6) ;updt RPC BROKER SITE PARAMETER record as STOPPED
 Q
 ;
ETRAP   ; -- on trapped error, send error info to client
 N XWBERR
 S XWBERR=$C(24)_"M  ERROR="_$ZERROR_$C(13,10)_"LAST REF="_$ZR_$C(4)
 D ^%ZTER ;Record it
 S RETRY=RETRY+1 H 3
 IF RETRY=5 H  ;give up trying, server should not restart
 ;IHS/HMW Commented next line
 ;IF $$NEWERR^%ZTER S $ETRAP="Q:($ESTACK&'$QUIT)  Q:$ESTACK 0 S $ECODE="""" G RESTART^XWBTCPL"
 IF XWBOS="DSM" D
 . I $D(XWBTLEN),XWBTLEN,$ZE'["SYSTEM-F" D SNDERR W XWBERR
 IF XWBOS'="DSM" D  G RESTART
 . D SNDERR W XWBERR
 S $ECODE=",U1," Q  ;Pass error up to pop stack.
 ;
SNDERR ;send error information
 ;XWBSEC is the security packet, XWBERROR is application packet
 N X
 S X=$G(XWBSEC)
 W $C($L(X))_X
 S X=$G(XWBERROR)
 W $C($L(X))_X W !
 S XWBERROR="" ;clears parameters
 Q
 ;
 ;
UPDTREC(XWBTSKT,STATE,XWBENV) ; -- update STATUS field and ^%ZIS X-ref of the
 ;RPC BROKER SITE PARAMETER file
 ;XWBTSKT: listener port
 N C,XWBOXIEN,XWBPOIEN,XWBFDA
 S C=",",U="^"
 I $G(XWBENV)'="" S Y=XWBENV
 E  D GETENV^%ZOSV ;get Y=UCI^VOL^NODE^BOXLOOKUP of current system
 I STATE=3 S ^%ZIS(8994.171,"RPCB Listener",$P(Y,U,2),$P(Y,U),$P(Y,U,4),XWBTSKT)=$J
 I STATE=6 K ^%ZIS(8994.171,"RPCB Listener",$P(Y,U,2),$P(Y,U),$P(Y,U,4),XWBTSKT)
 ;
 S XWBOXIEN=$$FIND1^DIC(8994.17,",1,","",$P(Y,U,4)) ;find rec for box
 S XWBPOIEN=$$FIND1^DIC(8994.171,C_XWBOXIEN_",1,","",XWBTSKT)
 D:XWBPOIEN>0  ;update STATUS field if entry was found
 . D FDA^DILF(8994.171,XWBPOIEN_C_XWBOXIEN_C_1_C,1,"R",STATE,"XWBFDA")
 . D FILE^DIE("","XWBFDA")
 Q
 ;
 ;
SEMAPHOR(XWBTSKT,XWBACT) ;Lock/Unlock listener semaphore
 ;XWBTSKT: listener port, XWBACT: "LOCK" | "UNLOCK" action to perform
 ;if LOCK is requested, it will be attempted with 1 sec timeout and if
 ;lock was obtained RESULT will be 1, otherwise it will be 0.  For
 ;unlock RESULT will always be 1.
 N RESULT
 S U="^",RESULT=1
 D GETENV^%ZOSV ;get Y=UCI^VOL^NODE^BOXLOOKUP of current system
 I XWBACT="LOCK" D
 . L +^%ZIS(8994.171,"RPCB Listener",$P(Y,U,2),$P(Y,U),$P(Y,U,4),XWBTSKT):1
 . S RESULT=$T
 E  L -^%ZIS(8994.171,"RPCB Listener",$P(Y,U,2),$P(Y,U),$P(Y,U,4),XWBTSKT)
 Q RESULT

XWBTCPT
XWBTCPT ;SLC/KCM - Test functions for TCP [ 12/05/94  10:45 PM ]
 ;;1.0T11;RPC BROKER;;Oct 31, 1995
 ;
ECHO(Y,X) ; -- echo string passed as parameter back to client
 ;  input:  X := string passed by client
 ; output:  Y := same string to be returned
 S Y=X
 Q
LIST(Y) ; -- return list box with 28 entries
 N I
 F I=1:1:28 S Y(I)="List Item #"_I
 Q
WP(Y) ; -- return text a word processing (50 lines)
 N I
 F I=1:1:50 S Y(I)="The quick brown fox jumped over the lazy dog."
 S Y(51)="End of document."
 Q
BIG(Y) ; -- send a 32K string
 N I
 F I=1:1:320 S $P(Y(I),"D",100)=""
 Q
WNP ; -- start Windows Notepad
 D STARTAPP^XWBTCPZ("c:\windows\notepad.exe",.ERR)
 I $L(ERR) W !,"Error starting Notepad: ",ERR
 Q
MSW ; -- start Microsoft Word
 D STARTAPP^XWBTCPZ("c:\winword\winword.exe",.ERR)
 I $L(ERR) W !,"Error starting MS Word: ",ERR
 Q
OE3 ; -- start windowed OE/RR
 D STARTAPP^XWBTCPZ("c:\dhcpapps\tcpchart.exe",.ERR,1)
 I $L(ERR) W !,"Error starting OE/RR: ",ERR
 Q
ZTST ; -- start ZZTEST program
 D STARTAPP^XWBTCPZ("c:\dhcpapps\zttest.exe",.ERR,1)
 I $L(ERR) W !,"Error starting ZZTEST: ",ERR
 Q
CRYPT ; -- test encryption
 R "Enter text: ",X
 S X=$$NCRYPT^XWBTCPZ(X,"SECRET") W !,"Encrypted: ",X
 S X=$$DCRYPT^XWBTCPZ(X,"SECRET") W !,"Decrypted: ",X
 Q

XWBTCPZ
XWBTCPZ ;SLC/KCM - calls to client listener [ 12/04/94  8:58 PM ]
 ;;1.0T11;RPC BROKER;;Oct 31, 1995
 ;
STARTAPP(APP,ERR,DHCP) ; Start a windowed application (use full path name)
 ; input:  X is name of windowed app
 ; output: ERR is returned error code (passed by reference)
 N X,I,DEV,LEN,OS,SKT
 S SKT=9100,ERR="unknown error" IF '$L(APP) S ERR="no app" Q
 S OS=$S(^%ZOSF("OS")["DSM":"DSM",^("OS")["MSM":"MSM",1:"")
 ; -- get the IP address of the client
 I OS="DSM" S IP=$P($&ZLIB.%GETDVI($P,"TT_ACCPORNAM")," ",2)
 I OS="MSM" S IP="152.131.1.125"    ; -- for laptop demo only
 I '$L(IP) S ERR="not telnet device" Q
 ; -- connect to client
 I OS="DSM" O SKT:(TCPCHAN:ADDRESS=IP) U SKT S DEV=SKT
 I OS="MSM" O 56 U 56::"TCP" W /SOCKET(IP,SKT) S DEV=56
 ; -- send StartApp message
 S X="StartApp^"_APP
 I $G(DHCP) S X=X_" "_$$NCRYPT^XWBTCPZ(DUZ_"^password^"_$H,$C(83,69,67,82,69,84))
 W X,$C(4),!
 ; -- get acknowledgement
 R *LEN R X#LEN
 I X'="ack" S ERR="not started"
 E  S ERR=""
 ; -- close socket
 C DEV
 U $P
 Q
 ;
NCRYPT(SRC,KEY) ; Encrypt the string in SRC, using KEY
 ; Input:  SRC, KEY
 ; Output: DEST returned as value of function
 N OFFSET,SRCPOS,SRCASC,KEYPOS,DEST
 S OFFSET=($R(10000)#255)+1
 S DEST=$TR($J($$HEX(OFFSET),2)," ","0")
 S KEYPOS=0 F SRCPOS=1:1:$L(SRC) D
 . S SRCASC=($A(SRC,SRCPOS)+OFFSET)#255
 . I KEYPOS<$L(KEY) S KEYPOS=KEYPOS+1
 . E  S KEYPOS=1
 . S SRCASC=$$XOR(SRCASC,$A(KEY,KEYPOS))
 . S DEST=DEST_$J($$HEX(SRCASC),2)
 . S OFFSET=SRCASC
 Q DEST
DCRYPT(SRC,KEY) ; Decrypt the string in SRC, using KEY
 ; Input:  SRC, KEY
 ; Output: DEST returned as value of function
 N OFFSET,SRCPOS,SRCASC,KEYPOS,TMPASC,DEST
 S OFFSET=$$DEC($E(SRC,1,2)),DEST="",KEYPOS=0
 F SRCPOS=3:2:$L(SRC) D
 . S SRCASC=$$DEC($TR($E(SRC,SRCPOS,SRCPOS+1)," ",""))
 . I KEYPOS<$L(KEY) S KEYPOS=KEYPOS+1
 . E  S KEYPOS=1
 . S TMPASC=$$XOR(SRCASC,$A(KEY,KEYPOS))
 . I TMPASC'>OFFSET S TMPASC=255+TMPASC-OFFSET
 . E  S TMPASC=TMPASC-OFFSET
 . S DEST=DEST_$C(TMPASC),OFFSET=SRCASC
 Q DEST
HEX(X) ; Return the hex value of the decimal number in X
 N I,X1,Y S Y="",X1=16
 F I=1:1 S Y=$E("0123456789ABCDEF",X#X1+1)_Y,X=X\X1 Q:X<1
 Q Y
DEC(X) ; Return the decimal value of the hex number in X
 N I,X1,Y S Y=0,X1=16
 F I=1:1:$L(X) S Y=Y*X1+($F("0123456789ABCDEF",$E(X,I))-2)
 Q Y
XOR(X1,X2) ;Exclusive OR two numbers
 I ^%ZOSF("OS")["DSM" Q $&ZLIB.%BOOLEAN(X1,X2,6)
 I ^%ZOSF("OS")["MSM" Q @("$ZBOOLEAN("_X1_","_X2_",6)")
 Q ""

XWBTEST
XWBTEST ;TEST to see if listener is running [ 02/14/96  1:08 PM ]
 ;
 J ENTRY^XWBTEST
 Q
ENTRY N YY
 L +^XWB("TMP","RUNNING"):1
 I $T D
 . L -^XWB("TMP","RUNNING")
 . D STRT^XWBTCP(9200)
 . S Y=$$NOW^XLFDT D DD^%DT
 . D OPEN^%ZMAGOSF(51,"C:\ANONYMOUS\IMAGING\XWBLOG.TXT","A")
 . U 51 W "TCP Listener restarted at: ",Y,!
 . C 51
 H 10 G ENTRY
 Q

XWBZ1
XWBZ1 ;ISC-SF/EG - DHCP BROKER PROTOYPE TESTER [ 02/22/95  11:07 PM ] ;08/22/96  15:43
 ;;1.1T3;RPC BROKER;;Nov 25, 1996
ECHO1(Y,X) ;don't call direct
 S Y=X
 Q
 ;
GLOB1(Y,N) ;callback for global parameter - don't call direct
 S Y=$NA(@N)
 Q
 ;
LIST(Y) ; -- return list box with 28 entries
 N I
 F I=1:1:28 S Y(I)="List Item #"_I
 Q
 ;
WP(Y) ; -- return text a word processing (50 lines)
 N I
 F I=1:1:50 S Y(I)="The quick brown fox jumped over the lazy dog."
 S Y(51)="End of document."
 Q
 ;
BIG(Y) ; -- send a 32K string
 N I,Z
 S $P(Z,"D",16)=""
 K ^TMP($J,"XWBBIG")
 F I=1:1:2048 S ^TMP($J,"XWBBIG",I)=Z
 S Y=$NA(^TMP($J,"XWBBIG"))
 Q
 ;
SRT(Y,D,X) ; -- sort array x and return in y
 N I,K,T
 S K=""
 IF D="LO" D  Q
 . F I=1:1 D  Q:K=""
 . . S K=$O(X(K)) Q:K=""
 . . S Y(I)=K
 IF D="HI" D
 . F I=1:1 D  Q:K=""
 . . S K=$O(X(K)) Q:K=""
 . . S T(99999999-I)=K
 . S K=0
 . F I=1:1 D  Q:K=""
 . . S K=$O(T(K)) Q:K=""
 . . S Y(I)=T(K)
 Q
 ;
MEMO(Y,X) ;
 K ^TMP("EG",$J,"MEMO")
 S ^TMP("EG",$J,"MEMO",-9000)="DHCP RECEIVED:"
 M ^TMP("EG",$J,"MEMO")=X
 S Y=$NA(^TMP("EG",$J,"MEMO"))
 Q
 ;



