- INHVCRL3 ;KAC ; 8 Jul 95 15:58; Logon Server (LoS) Background Controller (continued)
- ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
- ;COPYRIGHT 1991-2000 SAIC
- ;
- Q
- ;
- RUNIN(INUIF,INPARMS,INDSTP,INOA,INODA,INHERR) ; $$function - Execute inbound script.
- ; Script sets up array w/ incoming data and calls lookup/store routine
- ; for this msg. Upon return from inbound script execution, logs msg
- ; status (and any error text) in UNIVERSAL INTERFACE entry for this
- ; inbound msg.
- ;
- ; Input:
- ; INDSTP - (opt) INTERFACE DESTINATION IEN for original msg from
- ; UNIVERSAL INTERFACE file
- ; INHERR - (pbr) array containing error msg used to log an error
- ; INOA - (pbr) array receiving application-specific information
- ; from lookup/store routine
- ; INODA - (pbr) array receiving application-specific information
- ; from lookup/store routine
- ; INPARMS - (opt) inbound msg parameter array
- ; INPARMS(INDSTP,"SCIN") = script # for inbound msg
- ; transaction type
- ; INUIF - (req) UNIVERSAL INTERFACE IEN for inbound msg
- ;
- ; Variables:
- ; INERRSCR - flag - 0 = script executed w/out error
- ; >0 = script encountered errors during execution
- ; INSTATUS - flag - UNIVERSAL INTERFACE file message status
- ; C,Z - scratch
- ;
- ; Output:
- ; 0 = script executed w/out error
- ; >0 = script encountered errors during execution
- ; e.g. failed input transform, required data is missing
- ; INHERR = error msg
- ;
- N C,INERRSCR,INSTATUS,Z
- S C=","
- ;
- ; Get parameters associated with inbound msg (INUIF)
- Q:$$INPARMS^INHVCRL2(.INDSTP,.INPARMS,.INHERR,INUIF) 2
- ;
- ; Execute inbound script
- S Z="S INERRSCR=$$^IS"_$E(INPARMS(INDSTP,"SCIN")#100000+100000,2,6)_"("_INUIF_",.INOA,.INODA)"
- X Z
- ;
- ; Log msg status (and any error text) in UNIVERSAL INTERFACE entry
- ; for this inbound msg. Script returns error msg text in INHERR if
- ; script or lookup/store routine encounters error(s).
- S INSTATUS=$S(INERRSCR:"E",1:"C") ; E=error, C=Complete
- D ULOG^INHU(INUIF,INSTATUS,.INHERR) ; log msg status
- Q INERRSCR
- ;
- RUNOUT(INDA,INA,INPARMS,INDSTP,INQUE,UIF,INHERR) ; $$function - Execute
- ; outbound script.
- ; Script creates new outbound entry in UNIVERSAL INTERFACE file and
- ; returns the IEN of this entry in the variable, UIF. Upon return
- ; from outbound script execution, logs msg status (and any error text)
- ; in UNIVERSAL INTERFACE entry for this outbound msg.
- ;
- ; Input:
- ; INA - (req) array containing information to be sent to an
- ; outbound destination
- ; INDA - (opt) array containing information to be sent to an
- ; outbound destination
- ; INDA = IEN in base file used by outbound script
- ; Subscripts may hold subfile IENs in the format:
- ; INDA(subfile #,DA)=""
- ; If NOT passed, set to -1 prior to running outbound
- ; script.
- ; INDSTP - (req) INTERFACE DESTINATION IEN for original msg from
- ; UNIVERSAL INTERFACE file
- ; INHERR - (pbr) array containing error msg used to log an error
- ; INPARMS - (req) inbound msg parameter array
- ; INPARMS(INDSTP,"DSOUT") = INTERFACE DESTINATION IEN
- ; for outbound msg
- ; INPARMS(INDSTP,"SCOUT") = script # for outbound
- ; msg transaction type
- ; INPARMS(INDSTP,"TTOUT") = INTERFACE TRANSACTION TYPE
- ; IEN for outbound msg
- ;
- ; INQUE - (opt) flag - 1 = do NOT queue outbound msg to o/p ctlr
- ; - 0 = queue outbound msg to o/p ctlr
- ; UIF - (pbr) UNIVERSAL INTERFACE IEN for new outbound entry
- ; Returned by outbound script.
- ;
- ; Variables:
- ; INERRSCR - flag - 0 = script executed w/out error
- ; >0 = script encountered errors during execution
- ; Z - scratch
- ;
- ; Output:
- ; 0 = script executed w/out error
- ; >0 = script encountered errors during execution
- ; e.g. UIF creation failed
- ; INERR = error msg
- ;
- N DA,DIE,DR,DIC,INERRSCR,Z
- ;
- S:'$L($G(INDA)) INDA=-1
- S Z="S INERRSCR=$$^IS"_$E(INPARMS(INDSTP,"SCOUT")#100000+100000,2,6)_"("_INPARMS(INDSTP,"TTOUT")_",.INDA,.INA,"_INPARMS(INDSTP,"DSOUT")_","_$G(INQUE)_")"
- X Z
- I $G(UIF)<0 S UIF="" Q INERRSCR ; failed to created UIF entry
- ;
- ; Log msg status (and any error text) in UNIVERSAL INTERFACE entry
- ; for this outbound msg. Script returns error msg text in INHERR if
- ; script routine encounters error(s).
- S INSTATUS=$S(INERRSCR:"E",$P(^INTHU(UIF,0),U,4):"S",1:"C")
- D ULOG^INHU(UIF,INSTATUS,.INHERR) ; log msg status
- Q INERRSCR
- ;
- INHVCRL3 ;KAC ; 8 Jul 95 15:58; Logon Server (LoS) Background Controller (continued)
- +1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
- +2 ;COPYRIGHT 1991-2000 SAIC
- +3 ;
- +4 QUIT
- +5 ;
- RUNIN(INUIF,INPARMS,INDSTP,INOA,INODA,INHERR) ; $$function - Execute inbound script.
- +1 ; Script sets up array w/ incoming data and calls lookup/store routine
- +2 ; for this msg. Upon return from inbound script execution, logs msg
- +3 ; status (and any error text) in UNIVERSAL INTERFACE entry for this
- +4 ; inbound msg.
- +5 ;
- +6 ; Input:
- +7 ; INDSTP - (opt) INTERFACE DESTINATION IEN for original msg from
- +8 ; UNIVERSAL INTERFACE file
- +9 ; INHERR - (pbr) array containing error msg used to log an error
- +10 ; INOA - (pbr) array receiving application-specific information
- +11 ; from lookup/store routine
- +12 ; INODA - (pbr) array receiving application-specific information
- +13 ; from lookup/store routine
- +14 ; INPARMS - (opt) inbound msg parameter array
- +15 ; INPARMS(INDSTP,"SCIN") = script # for inbound msg
- +16 ; transaction type
- +17 ; INUIF - (req) UNIVERSAL INTERFACE IEN for inbound msg
- +18 ;
- +19 ; Variables:
- +20 ; INERRSCR - flag - 0 = script executed w/out error
- +21 ; >0 = script encountered errors during execution
- +22 ; INSTATUS - flag - UNIVERSAL INTERFACE file message status
- +23 ; C,Z - scratch
- +24 ;
- +25 ; Output:
- +26 ; 0 = script executed w/out error
- +27 ; >0 = script encountered errors during execution
- +28 ; e.g. failed input transform, required data is missing
- +29 ; INHERR = error msg
- +30 ;
- +31 NEW C,INERRSCR,INSTATUS,Z
- +32 SET C=","
- +33 ;
- +34 ; Get parameters associated with inbound msg (INUIF)
- +35 IF $$INPARMS^INHVCRL2(.INDSTP,.INPARMS,.INHERR,INUIF)
- QUIT 2
- +36 ;
- +37 ; Execute inbound script
- +38 SET Z="S INERRSCR=$$^IS"_$EXTRACT(INPARMS(INDSTP,"SCIN")#100000+100000,2,6)_"("_INUIF_",.INOA,.INODA)"
- +39 XECUTE Z
- +40 ;
- +41 ; Log msg status (and any error text) in UNIVERSAL INTERFACE entry
- +42 ; for this inbound msg. Script returns error msg text in INHERR if
- +43 ; script or lookup/store routine encounters error(s).
- +44 ; E=error, C=Complete
- SET INSTATUS=$SELECT(INERRSCR:"E",1:"C")
- +45 ; log msg status
- DO ULOG^INHU(INUIF,INSTATUS,.INHERR)
- +46 QUIT INERRSCR
- +47 ;
- RUNOUT(INDA,INA,INPARMS,INDSTP,INQUE,UIF,INHERR) ; $$function - Execute
- +1 ; outbound script.
- +2 ; Script creates new outbound entry in UNIVERSAL INTERFACE file and
- +3 ; returns the IEN of this entry in the variable, UIF. Upon return
- +4 ; from outbound script execution, logs msg status (and any error text)
- +5 ; in UNIVERSAL INTERFACE entry for this outbound msg.
- +6 ;
- +7 ; Input:
- +8 ; INA - (req) array containing information to be sent to an
- +9 ; outbound destination
- +10 ; INDA - (opt) array containing information to be sent to an
- +11 ; outbound destination
- +12 ; INDA = IEN in base file used by outbound script
- +13 ; Subscripts may hold subfile IENs in the format:
- +14 ; INDA(subfile #,DA)=""
- +15 ; If NOT passed, set to -1 prior to running outbound
- +16 ; script.
- +17 ; INDSTP - (req) INTERFACE DESTINATION IEN for original msg from
- +18 ; UNIVERSAL INTERFACE file
- +19 ; INHERR - (pbr) array containing error msg used to log an error
- +20 ; INPARMS - (req) inbound msg parameter array
- +21 ; INPARMS(INDSTP,"DSOUT") = INTERFACE DESTINATION IEN
- +22 ; for outbound msg
- +23 ; INPARMS(INDSTP,"SCOUT") = script # for outbound
- +24 ; msg transaction type
- +25 ; INPARMS(INDSTP,"TTOUT") = INTERFACE TRANSACTION TYPE
- +26 ; IEN for outbound msg
- +27 ;
- +28 ; INQUE - (opt) flag - 1 = do NOT queue outbound msg to o/p ctlr
- +29 ; - 0 = queue outbound msg to o/p ctlr
- +30 ; UIF - (pbr) UNIVERSAL INTERFACE IEN for new outbound entry
- +31 ; Returned by outbound script.
- +32 ;
- +33 ; Variables:
- +34 ; INERRSCR - flag - 0 = script executed w/out error
- +35 ; >0 = script encountered errors during execution
- +36 ; Z - scratch
- +37 ;
- +38 ; Output:
- +39 ; 0 = script executed w/out error
- +40 ; >0 = script encountered errors during execution
- +41 ; e.g. UIF creation failed
- +42 ; INERR = error msg
- +43 ;
- +44 NEW DA,DIE,DR,DIC,INERRSCR,Z
- +45 ;
- +46 IF '$LENGTH($GET(INDA))
- SET INDA=-1
- +47 SET Z="S INERRSCR=$$^IS"_$EXTRACT(INPARMS(INDSTP,"SCOUT")#100000+100000,2,6)_"("_INPARMS(INDSTP,"TTOUT")_",.INDA,.INA,"_INPARMS(INDSTP,"DSOUT")_","_$GET(INQUE)_")"
- +48 XECUTE Z
- +49 ; failed to created UIF entry
- IF $GET(UIF)<0
- SET UIF=""
- QUIT INERRSCR
- +50 ;
- +51 ; Log msg status (and any error text) in UNIVERSAL INTERFACE entry
- +52 ; for this outbound msg. Script returns error msg text in INHERR if
- +53 ; script routine encounters error(s).
- +54 SET INSTATUS=$SELECT(INERRSCR:"E",$PIECE(^INTHU(UIF,0),U,4):"S",1:"C")
- +55 ; log msg status
- DO ULOG^INHU(UIF,INSTATUS,.INHERR)
- +56 QUIT INERRSCR
- +57 ;