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

INHVCRL3.m

Go to the documentation of this file.
  1. INHVCRL3 ;KAC ; 8 Jul 95 15:58; Logon Server (LoS) Background Controller (continued)
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. Q
  1. ;
  1. RUNIN(INUIF,INPARMS,INDSTP,INOA,INODA,INHERR) ; $$function - Execute inbound script.
  1. ; Script sets up array w/ incoming data and calls lookup/store routine
  1. ; for this msg. Upon return from inbound script execution, logs msg
  1. ; status (and any error text) in UNIVERSAL INTERFACE entry for this
  1. ; inbound msg.
  1. ;
  1. ; Input:
  1. ; INDSTP - (opt) INTERFACE DESTINATION IEN for original msg from
  1. ; UNIVERSAL INTERFACE file
  1. ; INHERR - (pbr) array containing error msg used to log an error
  1. ; INOA - (pbr) array receiving application-specific information
  1. ; from lookup/store routine
  1. ; INODA - (pbr) array receiving application-specific information
  1. ; from lookup/store routine
  1. ; INPARMS - (opt) inbound msg parameter array
  1. ; INPARMS(INDSTP,"SCIN") = script # for inbound msg
  1. ; transaction type
  1. ; INUIF - (req) UNIVERSAL INTERFACE IEN for inbound msg
  1. ;
  1. ; Variables:
  1. ; INERRSCR - flag - 0 = script executed w/out error
  1. ; >0 = script encountered errors during execution
  1. ; INSTATUS - flag - UNIVERSAL INTERFACE file message status
  1. ; C,Z - scratch
  1. ;
  1. ; Output:
  1. ; 0 = script executed w/out error
  1. ; >0 = script encountered errors during execution
  1. ; e.g. failed input transform, required data is missing
  1. ; INHERR = error msg
  1. ;
  1. N C,INERRSCR,INSTATUS,Z
  1. S C=","
  1. ;
  1. ; Get parameters associated with inbound msg (INUIF)
  1. Q:$$INPARMS^INHVCRL2(.INDSTP,.INPARMS,.INHERR,INUIF) 2
  1. ;
  1. ; Execute inbound script
  1. S Z="S INERRSCR=$$^IS"_$E(INPARMS(INDSTP,"SCIN")#100000+100000,2,6)_"("_INUIF_",.INOA,.INODA)"
  1. X Z
  1. ;
  1. ; Log msg status (and any error text) in UNIVERSAL INTERFACE entry
  1. ; for this inbound msg. Script returns error msg text in INHERR if
  1. ; script or lookup/store routine encounters error(s).
  1. S INSTATUS=$S(INERRSCR:"E",1:"C") ; E=error, C=Complete
  1. D ULOG^INHU(INUIF,INSTATUS,.INHERR) ; log msg status
  1. Q INERRSCR
  1. ;
  1. RUNOUT(INDA,INA,INPARMS,INDSTP,INQUE,UIF,INHERR) ; $$function - Execute
  1. ; outbound script.
  1. ; Script creates new outbound entry in UNIVERSAL INTERFACE file and
  1. ; returns the IEN of this entry in the variable, UIF. Upon return
  1. ; from outbound script execution, logs msg status (and any error text)
  1. ; in UNIVERSAL INTERFACE entry for this outbound msg.
  1. ;
  1. ; Input:
  1. ; INA - (req) array containing information to be sent to an
  1. ; outbound destination
  1. ; INDA - (opt) array containing information to be sent to an
  1. ; outbound destination
  1. ; INDA = IEN in base file used by outbound script
  1. ; Subscripts may hold subfile IENs in the format:
  1. ; INDA(subfile #,DA)=""
  1. ; If NOT passed, set to -1 prior to running outbound
  1. ; script.
  1. ; INDSTP - (req) INTERFACE DESTINATION IEN for original msg from
  1. ; UNIVERSAL INTERFACE file
  1. ; INHERR - (pbr) array containing error msg used to log an error
  1. ; INPARMS - (req) inbound msg parameter array
  1. ; INPARMS(INDSTP,"DSOUT") = INTERFACE DESTINATION IEN
  1. ; for outbound msg
  1. ; INPARMS(INDSTP,"SCOUT") = script # for outbound
  1. ; msg transaction type
  1. ; INPARMS(INDSTP,"TTOUT") = INTERFACE TRANSACTION TYPE
  1. ; IEN for outbound msg
  1. ;
  1. ; INQUE - (opt) flag - 1 = do NOT queue outbound msg to o/p ctlr
  1. ; - 0 = queue outbound msg to o/p ctlr
  1. ; UIF - (pbr) UNIVERSAL INTERFACE IEN for new outbound entry
  1. ; Returned by outbound script.
  1. ;
  1. ; Variables:
  1. ; INERRSCR - flag - 0 = script executed w/out error
  1. ; >0 = script encountered errors during execution
  1. ; Z - scratch
  1. ;
  1. ; Output:
  1. ; 0 = script executed w/out error
  1. ; >0 = script encountered errors during execution
  1. ; e.g. UIF creation failed
  1. ; INERR = error msg
  1. ;
  1. N DA,DIE,DR,DIC,INERRSCR,Z
  1. ;
  1. S:'$L($G(INDA)) INDA=-1
  1. S Z="S INERRSCR=$$^IS"_$E(INPARMS(INDSTP,"SCOUT")#100000+100000,2,6)_"("_INPARMS(INDSTP,"TTOUT")_",.INDA,.INA,"_INPARMS(INDSTP,"DSOUT")_","_$G(INQUE)_")"
  1. X Z
  1. I $G(UIF)<0 S UIF="" Q INERRSCR ; failed to created UIF entry
  1. ;
  1. ; Log msg status (and any error text) in UNIVERSAL INTERFACE entry
  1. ; for this outbound msg. Script returns error msg text in INHERR if
  1. ; script routine encounters error(s).
  1. S INSTATUS=$S(INERRSCR:"E",$P(^INTHU(UIF,0),U,4):"S",1:"C")
  1. D ULOG^INHU(UIF,INSTATUS,.INHERR) ; log msg status
  1. Q INERRSCR
  1. ;