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

INTSTO1.m

Go to the documentation of this file.
  1. INTSTO1 ;DGH; 22 May 97 11:25;Unit test Ouput Controller, part II
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. ; Called from INTSTO, this processes outgoing transactions,
  1. ; including replicated transactions.
  1. ;
  1. OUT(UIF,INEXPND,DEST) ;process outgoing message
  1. ;INPUT:
  1. ; UIF = Entry in Universal Interface file to process
  1. ; INEXPND = 1 to expand, 0 to not
  1. ; DEST = Pointer to Interface Destination File
  1. N ROU,ACT,ER,ERR,INEDIT,REP,STAT,INENVSDB,INHERR,INTT,Z,REPDST,INPOP
  1. S INPOP=1
  1. ;;FOLLOWING COPIED FROM D ^INHOT(IEN,1,DEV)
  1. S ROU=$P(^INRHD(DEST,0),U,3) I ROU="" S INMSG="Destination: "_$P(^INRHD(DEST,0),U)_" is missing a routine name." D DISPLAY^INTSUT1(INMSG,0) Q
  1. S INMSG="Processing outgoing message to destination "_$P(^INRHD(DEST,0),U)_" with routine "_ROU D DISPLAY^INTSUT1(INMSG,0)
  1. I $P(^INRHD(DEST,0),U)["REPLICATOR" D
  1. .;Activity log multiple should have been killed. But be sure.
  1. .K ^INTHU(UIF,1)
  1. .;Replicator won't process "complete" transactions
  1. .S $P(^INTHU(UIF,0),U,3)=""
  1. .;Set debug flag, INENVSDB "on". The replicator will then store
  1. .;selective routing results in Activity Log Multiple.
  1. .;S INENVSDB=$P($G(^INRHSITE(1,0)),U,16),$P(^INRHSITE(1,0),U,16)=1
  1. .S INENVSDB=1
  1. Q:'INPOP
  1. S:ROU'["^" ROU="^"_ROU
  1. K INHERR S Z="N MODE,DEST S ER=$$"_ROU_"("_UIF_",.INHERR)" X Z
  1. K INTT D:ER>-1 DONE^INHOS
  1. ;
  1. ;--If destination was not the replicator, probably was a queue move.
  1. ;--Queue move won't create new entries in activity log multiple, but
  1. ;--other transceiver operations might. Display if there are any.
  1. I $P(^INRHD(DEST,0),U)'["REPLICATOR" D
  1. .D DISPLAY^INTSUT1("Output controller processing completed",0)
  1. .S STAT=$$CVTCODE^INHUTC3($P(^INTHU(UIF,0),U,3),4001,.03)
  1. .S INMSG="Status of message is: "_STAT D DISPLAY^INTSUT1(INMSG,0,UIF)
  1. .D ACTLOG^INTSTO(UIF)
  1. ;
  1. ;--If destination was the replicator
  1. I $P(^INRHD(DEST,0),U)["REPLICATOR" D
  1. .;Restore original debug value
  1. .;;;S $P(^INRHSITE(1,0),U,16)=INENVSDB
  1. .D DISPLAY^INTSUT1("Processing through replicator completed",0)
  1. .;S STAT=$P(^INTHU(UIF,0),U,3),STAT=$S(STAT="C":"Complete",STAT="E":"Error",1:"Other")
  1. .S STAT=$$CVTCODE^INHUTC3($P(^INTHU(UIF,0),U,3),4001,.03)
  1. .S INMSG="Status of base message is: "_STAT D DISPLAY^INTSUT1(INMSG,0)
  1. .;Loop through activity log. Display replicants and screened messages.
  1. .S ACT=0 F S ACT=$O(^INTHU(UIF,1,ACT)) Q:'ACT D
  1. ..S LOG=^INTHU(UIF,1,ACT,0)
  1. ..I $P(LOG,U,2)="R" D
  1. ...S REP=$P(LOG,U,3) Q:'REP
  1. ...S REPDST=$P($G(^INRHD($P(^INTHU(REP,0),U,2),0)),U)
  1. ...S INMSG="Replicated message "_$P(^INTHU(REP,0),U,5)_" created for destination "_REPDST D DISPLAY^INTSUT1(INMSG,0)
  1. ...I REPDST["HL REPLICATOR" D DISPLAY^INTSUT1("!!! WARNING - Potential run away message. Check replicator definiton.",0)
  1. ...;In expanded mode, display text of replicated messages
  1. ...D:INEXPND EXPNDIS^INTSUT1(UIF)
  1. ..Q:'INPOP
  1. ..;If activity log shows replicant was screened
  1. ..I $P(LOG,U,2)="X" D
  1. ...D DISPLAY^INTSUT1("Replication suppressed",0)
  1. ...;if debugging is on, there will be subnodes
  1. ...Q:'$D(^INTHU(UIF,1,ACT,1))
  1. ...S L1=0 F S L1=$O(^INTHU(UIF,1,ACT,1,L1)) Q:'L1 D
  1. ....S INMSG=$G(^INTHU(UIF,1,ACT,1,L1,0)) D DISPLAY^INTSUT1(INMSG,0)
  1. ;display errors
  1. D:$D(INHERR) ERRS^INTSTO(.INHERR)
  1. Q
  1. ;