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

INHSYSU1.m

Go to the documentation of this file.
  1. INHSYSU1 ;utilities for GIS
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. ;
  1. Q
  1. CMPFLD ;Compile all messages related to field chosen
  1. N INCMP
  1. S INCMP=1
  1. D FLD
  1. Q
  1. FLD ;Lookup and display all Messages related to selected field
  1. N Y,DIC
  1. S DIC="^INTHL7F(",DIC(0)="AEQZ",DIC("A")="Enter Script Generator Field Name: "
  1. D ^DIC
  1. Q:Y<0
  1. D ZIS^INHUT3("PRFLD^INHSYSU1("_+Y_")","INCMP")
  1. Q
  1. PRFLD(INFLD) ;Print field
  1. ; Input: INFLD - ien of Script Generator Field
  1. N INSCR,INMSG,INGALL
  1. S INSCR=""
  1. I '$D(INCMP) W !!,"Script Generator Segment"
  1. F S INSCR=$O(^INTHL7S("FIELD",INFLD,INSCR)) Q:INSCR="" D
  1. .I '$D(INCMP) W !,$P($G(^INTHL7S(INSCR,0)),U),!!,"Script Generator Messages"
  1. .S INMSG="" F S INMSG=$O(^INTHL7M("SEG",INSCR,INMSG)) Q:INMSG="" D
  1. ..I '$D(INCMP) W !,$P($G(^INTHL7M(INMSG,0)),U)
  1. ..E S INMSG(INMSG)=""
  1. I $G(INCMP) S INMSG="",INGALL=1 F S (INMSG,Y)=$O(INMSG(INMSG)) Q:'Y D EN^INHSGZ
  1. Q
  1. CMPSEG ;Compile all messages related to segment
  1. N INCMP
  1. S INCMP=1
  1. D SEG
  1. Q
  1. SEG ;Display Script Generator Message pointing to Segment
  1. N Y,DIC
  1. S DIC="^INTHL7S(",DIC(0)="AEQZ",DIC("A")="Enter Script Generator Segment Name: "
  1. D ^DIC
  1. Q:Y<0
  1. D ZIS^INHUT3("PRSEG^INHSYSU1("_+Y_")","INCMP")
  1. Q
  1. PRSEG(INSCR) ;print segment
  1. ; Input: INSCR - ien of Script generator Message
  1. N INMSG,INGALL
  1. S INSCR=+Y
  1. I '$D(INCMP) W !!,"Script Generator Messages"
  1. S INMSG="" F S INMSG=$O(^INTHL7M("SEG",INSCR,INMSG)) Q:INMSG="" D
  1. .I '$D(INCMP) W !,$P($G(^INTHL7M(INMSG,0)),U)
  1. .E S INMSG(INMSG)=""
  1. I $G(INCMP) S INMSG="",INGALL=1 F S (INMSG,Y)=$O(INMSG(INMSG)) Q:'Y D EN^INHSGZ
  1. Q
  1. GETMSGF(INFL,INMS,INMSG) ;Get messages related to field
  1. ; Input: INFL - ien of Script Generator Field
  1. ; Output INMS - Array of Script Generator Messages
  1. ; In/Out(opt) INMSG - Array of messages
  1. N INSCR,INM
  1. S INSCR=""
  1. F S INSCR=$O(^INTHL7S("FIELD",INFL,INSCR)) Q:INSCR="" D
  1. .K INMSG(4010,INSCR)
  1. .S INM="" F S INM=$O(^INTHL7M("SEG",INSCR,INM)) Q:INM="" D
  1. ..S INMS(INM)=$P($G(^INTHL7M(INM,0)),U)
  1. ..K INMSG(4011,INM)
  1. Q
  1. GETMSGS(INSG,INMS,INMSG) ;Get messages related to segment
  1. ; Input: INSG - ien of Script Generator Segment
  1. ; Output INMS - Array of Script Generator Messages
  1. ; In/Out(opt) INMSG - Array of messages
  1. N INM
  1. S INM="" F S INM=$O(^INTHL7M("SEG",INSG,INM)) Q:INM="" D
  1. .S INMS(INM)=$P($G(^INTHL7M(INM,0)),U)
  1. .K INMSG(4011,INM)
  1. Q
  1. GETMSGDT(INM,INMS) ;Get messages related to Data Type
  1. ; Input: INM - array of Data types
  1. ; Output INMS - Array of Script Generator Messages
  1. ;Loop through fields looking for pointers to data type in array
  1. N INF
  1. S INF=0 F S INF=$O(^INTHL7F(INF)) Q:'INF D
  1. .I $D(INM(4012.1,+$P($G(^INTHL7F(INF,0)),U,2))) D
  1. ..D GETMSGF(INF,.INMS)
  1. ..K INM(4012,INF)
  1. Q