HLOAPI6 ;OIFO-OAK/RBN - VDEF HLO User interface API ;10/02/2008
;;1.6;HEALTH LEVEL SEVEN;**139**;Oct 13, 1995;Build 11
;Per VHA Directive 2004-038, this routine should not be modified.
;
;
; No direct calls - must use $$VDEFPCK^HLOAPI5
;
Q
;
VDEFPCK(LINK,APP,TYPE,EVENT) ;; VDEF PARAMETER CHECK function
;;
;; REQUIREMENT #4 HL*1.6*139
;;
;;
;; Description:
;; This API is provided to allow VDEF to verify that HLO is installed,
;; running and has all the required parameters for a specific HL7
;; message type and HL7 event type. These parameters must be defined
;; prior to use by VDEF users before VDEF can use HLO.
;;
;; Inputs :
;; The input parameters are all required if used.
;; 1 LINK : Name of HL7 logical link.
;; 2 APP : Name of HLO application.
;; 3 TYPE : HL7 Message Type.
;; 4 EVENT: HL7 Event type.
;;
;; Outputs: Returns
;; With input parameters:
;; 1 VDEF Event 'xxxxx' parameters exists HLO Engine.
;; 0 HLO running but parameters for VDEF Event 'xxxx'don't exist.
;; -1 HLO installed but not running on target system.
;; -2 HLO not installed on target system.
;;
;; If input parameters are null:
;; 1 HLO installed and running.
;; -1 HLO installed but not running on target system.
;; -2 HLO not installed on target system.
;;
;; Variables used:
;; .
;; PARM1 - IEN of link in HL&7 Logical Link file (#870)
;; PARM2 - IEN of application in HLO APPLICATION registry file (#779.2)
;; PARM3 - IEN of message type in MESSAGE TYPE ACTION subfile (#779.21)
;; RESULT - Return value.
;;
;
N RESULT,PARM1,PARM2,PARM3
S RESULT=-2
; Is HLO installed?
Q:$D(^HLD(779.1))=0 RESULT
;
; Is HLO running?
S RESULT=-1
Q:$P($G(^HLD(779.1,1,0)),"^",9)=0 RESULT
;
; null parameters, so exit with a 1
S RESULT=1
Q:'$G(LINK)&'$G(APP)&'$G(TYPE)&'$G(EVENT) RESULT
;
; Are the link, app and event setup?
S RESULT=0
S (PARM1,PARM2,PARM3)=""
S PARM1=$O(^HLCS(870,"B",LINK,PARM1))
S PARM2=$O(^HLD(779.2,"B",APP,PARM2))
I (PARM1&PARM2) D
. S PARM3=$O(^HLD(779.2,PARM2,1,"B",TYPE,PARM3))
. ; Yes, so return a 1
. I PARM3 D
. . S:$P(^HLD(779.2,PARM2,1,PARM3,0),"^",2)=EVENT RESULT=1
Q RESULT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHLOAPI6 2602 printed Dec 13, 2024@01:58:30 Page 2
HLOAPI6 ;OIFO-OAK/RBN - VDEF HLO User interface API ;10/02/2008
+1 ;;1.6;HEALTH LEVEL SEVEN;**139**;Oct 13, 1995;Build 11
+2 ;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 ;
+5 ; No direct calls - must use $$VDEFPCK^HLOAPI5
+6 ;
+7 QUIT
+8 ;
VDEFPCK(LINK,APP,TYPE,EVENT) ;; VDEF PARAMETER CHECK function
+1 ;;
+2 ;; REQUIREMENT #4 HL*1.6*139
+3 ;;
+4 ;;
+5 ;; Description:
+6 ;; This API is provided to allow VDEF to verify that HLO is installed,
+7 ;; running and has all the required parameters for a specific HL7
+8 ;; message type and HL7 event type. These parameters must be defined
+9 ;; prior to use by VDEF users before VDEF can use HLO.
+10 ;;
+11 ;; Inputs :
+12 ;; The input parameters are all required if used.
+13 ;; 1 LINK : Name of HL7 logical link.
+14 ;; 2 APP : Name of HLO application.
+15 ;; 3 TYPE : HL7 Message Type.
+16 ;; 4 EVENT: HL7 Event type.
+17 ;;
+18 ;; Outputs: Returns
+19 ;; With input parameters:
+20 ;; 1 VDEF Event 'xxxxx' parameters exists HLO Engine.
+21 ;; 0 HLO running but parameters for VDEF Event 'xxxx'don't exist.
+22 ;; -1 HLO installed but not running on target system.
+23 ;; -2 HLO not installed on target system.
+24 ;;
+25 ;; If input parameters are null:
+26 ;; 1 HLO installed and running.
+27 ;; -1 HLO installed but not running on target system.
+28 ;; -2 HLO not installed on target system.
+29 ;;
+30 ;; Variables used:
+31 ;; .
+32 ;; PARM1 - IEN of link in HL&7 Logical Link file (#870)
+33 ;; PARM2 - IEN of application in HLO APPLICATION registry file (#779.2)
+34 ;; PARM3 - IEN of message type in MESSAGE TYPE ACTION subfile (#779.21)
+35 ;; RESULT - Return value.
+36 ;;
+37 ;
+38 NEW RESULT,PARM1,PARM2,PARM3
+39 SET RESULT=-2
+40 ; Is HLO installed?
+41 if $DATA(^HLD(779.1))=0
QUIT RESULT
+42 ;
+43 ; Is HLO running?
+44 SET RESULT=-1
+45 if $PIECE($GET(^HLD(779.1,1,0)),"^",9)=0
QUIT RESULT
+46 ;
+47 ; null parameters, so exit with a 1
+48 SET RESULT=1
+49 if '$GET(LINK)&'$GET(APP)&'$GET(TYPE)&'$GET(EVENT)
QUIT RESULT
+50 ;
+51 ; Are the link, app and event setup?
+52 SET RESULT=0
+53 SET (PARM1,PARM2,PARM3)=""
+54 SET PARM1=$ORDER(^HLCS(870,"B",LINK,PARM1))
+55 SET PARM2=$ORDER(^HLD(779.2,"B",APP,PARM2))
+56 IF (PARM1&PARM2)
Begin DoDot:1
+57 SET PARM3=$ORDER(^HLD(779.2,PARM2,1,"B",TYPE,PARM3))
+58 ; Yes, so return a 1
+59 IF PARM3
Begin DoDot:2
+60 if $PIECE(^HLD(779.2,PARM2,1,PARM3,0),"^",2)=EVENT
SET RESULT=1
End DoDot:2
End DoDot:1
+61 QUIT RESULT