- INHQRIN1 ;KAC ; 9 Jul 99 16:24; GIS Query/Response - Supporting Utilities
- ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
- ;COPYRIGHT 1991-2000 SAIC
- ;
- Q
- ;
- DEST ; Determine destination for an inbound query response messages
- ;
- ; Called by:
- ; - eXec'd from IN^INHUSEN where the context includes the input vars
- ; & expects the output vars documented below - called by
- ; querying system receiver
- ; Input:
- ; ING - (req) var name for inbound data array
- ; INTYP - (req) msg type
- ; INEVN - (req) event type
- ; INMSH - (req) MSH segment
- ; INDELIM - (req) segment delimiter
- ;
- ; Variables:
- ; CPX - scratch
- ; INBLDST - entry reference to build array of valid inbound
- ; destinations based on sending application
- ; INMESSID - message control ID (MSH:10)
- ; INRECV - receiving app (MSH:5) - Not currently used.
- ; INSEND - sending app (MSH:3)
- ;
- ; Output:
- ; INDST - INTERFACE DESTINATION name
- ; INDSTP - INTERFACE DESTINATION ptr
- ; Undefined if destination determination fails.
- ; INDEST - array containing valid inbound destinations based
- ; on sending application
- ; Format: INDEST(msg-type_event-type)=
- ; INTERFACE DESTINATION name for inbound msg
- ; INERR - array containing error msg used to log an error
- ; unaltered if destination determination succeeds.
- ;
- K INDSTP
- N INBLDST,INMESSID,INRECV,INSEND,CPX
- S INSEND=$P(INMSH,INDELIM,3),INRECV=$P(INMSH,INDELIM,5),INMESSID=$P(INMSH,INDELIM,10)
- ;
- ; Build INDEST array
- D QR
- ;
- S CPX=$G(INTYP)_$G(INEVN)
- I $D(INDEST(CPX)) S INDST=INDEST(CPX) I $D(^INRHD("B",INDST)) S INDSTP=$O(^(INDST,0))
- Q
- ;
- QR ; Build array containing valid inbound GIS QR destinations.
- ; Output:
- ; INDEST - array containing valid inbound destinations
- ; Format: INDEST(msg-type_event-type) = INTERFACE DESTINATION name for inbound msg
- Q:$G(INDEST)="QR" ; array already exists
- K INDEST
- S INDEST="QR"
- ;network
- S INDEST("QRYQ02")="HL GIS QUERY IN"
- S INDEST("ACKACK")="INCOMING ACK"
- Q
- ;
- ;
- INHQRIN1 ;KAC ; 9 Jul 99 16:24; GIS Query/Response - Supporting Utilities
- +1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
- +2 ;COPYRIGHT 1991-2000 SAIC
- +3 ;
- +4 QUIT
- +5 ;
- DEST ; Determine destination for an inbound query response messages
- +1 ;
- +2 ; Called by:
- +3 ; - eXec'd from IN^INHUSEN where the context includes the input vars
- +4 ; & expects the output vars documented below - called by
- +5 ; querying system receiver
- +6 ; Input:
- +7 ; ING - (req) var name for inbound data array
- +8 ; INTYP - (req) msg type
- +9 ; INEVN - (req) event type
- +10 ; INMSH - (req) MSH segment
- +11 ; INDELIM - (req) segment delimiter
- +12 ;
- +13 ; Variables:
- +14 ; CPX - scratch
- +15 ; INBLDST - entry reference to build array of valid inbound
- +16 ; destinations based on sending application
- +17 ; INMESSID - message control ID (MSH:10)
- +18 ; INRECV - receiving app (MSH:5) - Not currently used.
- +19 ; INSEND - sending app (MSH:3)
- +20 ;
- +21 ; Output:
- +22 ; INDST - INTERFACE DESTINATION name
- +23 ; INDSTP - INTERFACE DESTINATION ptr
- +24 ; Undefined if destination determination fails.
- +25 ; INDEST - array containing valid inbound destinations based
- +26 ; on sending application
- +27 ; Format: INDEST(msg-type_event-type)=
- +28 ; INTERFACE DESTINATION name for inbound msg
- +29 ; INERR - array containing error msg used to log an error
- +30 ; unaltered if destination determination succeeds.
- +31 ;
- +32 KILL INDSTP
- +33 NEW INBLDST,INMESSID,INRECV,INSEND,CPX
- +34 SET INSEND=$PIECE(INMSH,INDELIM,3)
- SET INRECV=$PIECE(INMSH,INDELIM,5)
- SET INMESSID=$PIECE(INMSH,INDELIM,10)
- +35 ;
- +36 ; Build INDEST array
- +37 DO QR
- +38 ;
- +39 SET CPX=$GET(INTYP)_$GET(INEVN)
- +40 IF $DATA(INDEST(CPX))
- SET INDST=INDEST(CPX)
- IF $DATA(^INRHD("B",INDST))
- SET INDSTP=$ORDER(^(INDST,0))
- +41 QUIT
- +42 ;
- QR ; Build array containing valid inbound GIS QR destinations.
- +1 ; Output:
- +2 ; INDEST - array containing valid inbound destinations
- +3 ; Format: INDEST(msg-type_event-type) = INTERFACE DESTINATION name for inbound msg
- +4 ; array already exists
- IF $GET(INDEST)="QR"
- QUIT
- +5 KILL INDEST
- +6 SET INDEST="QR"
- +7 ;network
- +8 SET INDEST("QRYQ02")="HL GIS QUERY IN"
- +9 SET INDEST("ACKACK")="INCOMING ACK"
- +10 QUIT
- +11 ;
- +12 ;