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

INTSUSN1.m

Go to the documentation of this file.
  1. INTSUSN1 ;JD; 28 Jun 96 19:22; processing functions and utilities
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. VERIF(INGBL,INMSH,INTYP,INEVN,INERR) ;Determine HL7 message type and event
  1. ;INPUT
  1. ;--INGBL = global being checked, can be ^INTHU
  1. ;--------If numeric, assumed to be IEN for ^INTHU
  1. ;--------If non-numeric, assumed to be global reference
  1. ;--INMSH = variable for MSH segment (Pass by reference)
  1. ;--INTYP = Message type in format (PBR)
  1. ;--INEVN = Trigger event (PBR)
  1. ;--INERR = error message array (PBR)
  1. ;RETURN
  1. ;0=success 1=failure 2=fatal error
  1. N LCT,EVN,TYPE
  1. I +INGBL S LCT=0 D GETLINE^INHOU(INGBL,.LCT,.INMSH)
  1. I 'INGBL S INMSH=$G(@INGBL@(1))
  1. I $E(INMSH,1,3)'="MSH" S MSG(1)="Message from receiver Test Utility does not have the MSH segment in the correct location",MSG(2)=$E(INMSH,1,250) D ERRADD^INHUSEN3(.INERR,.MSG) Q 2
  1. S INDELIM=$E(INMSH,4),INSUBDEL=$E(INMSH,5)
  1. D
  1. . ;First get message type from MSH-9. Trigger Event may be
  1. . ;second component of type.
  1. . S TYPE=$P(INMSH,INDELIM,9) S INEVN=$P(TYPE,INSUBDEL,2),INTYP=$P(TYPE,INSUBDEL) Q:$L(INEVN)
  1. . ;If no EVENT, check for EVN segment in next 5 lines
  1. . I INGBL F I=1:1:5 D Q:$L(INEVN)
  1. .. D GETLINE^INHOU(INGBL,.LCT,.EVN)
  1. .. S:$P(EVN,INDELIM)="EVN" INEVN=$P(EVN,INDELIM,2)
  1. . I 'INGBL F I=2:1:5 D Q:$L(INEVN)
  1. .. S EVN=$G(@INGBL@(I))
  1. .. S:$P(EVN,INDELIM)="EVN" INEVN=$P(EVN,INDELIM,2)
  1. Q 0
  1. ;