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

BCHKERM.m

Go to the documentation of this file.
BCHKERM ; IHS/TUCSON/LAB - MOVES KERMIT FILE TO HL7 VIA MAIL SERVER//FJ ;  [ 10/28/96  2:05 PM ]
 ;;1.0;IHS RPMS CHR SYSTEM;;OCT 28, 1996
 ;
 D INIT
 D GENMSG
 D CALLXMB
 D EOJ
 Q
 ;
INIT ;INIT VARS
 K ^TMP("BCH",$J)
 S BCHNUM=0,BCHLINE=$P(^DIZ(8980,XTKDA,2,0),U,3)
 Q
 ;
GENMSG ;GENERATE MAIL MSG
 F BCHX=1:1:BCHLINE D
 .S:$P(^DIZ(8980,XTKDA,2,BCHX,0),U,1)="MSH" BCHCTR=1,BCHNUM=BCHNUM+1
 .S ^TMP("BCH",$J,BCHNUM,BCHCTR)=^DIZ(8980,XTKDA,2,BCHX,0),BCHCTR=BCHCTR+1
 Q
 ;
CALLXMB ;LOOP THRU TMP GLOBAL BY FILE MSG NUMBER
 S BCHX=0 F  S BCHX=$O(^TMP("BCH",$J,BCHX)) Q:'BCHX  D MAIL
 Q
 ;
MAIL ;CREATE SINGLE MAIL MESSAGE FOR EACH ABOVE FILE MSG NUM
 S XMDUZ=.5
 S XMTEXT="^TMP(""BCH"",$J,"_BCHX_","
 S XMSUB="KERMIT TO HL7 INTEGRATION MESSAGE "_BCHX_" FROM "_XTKFILE
 S Y=$G(^XMB(1,1,0)),Y=$P(Y,U) I Y S Y=$G(^DIC(4.2,Y,0)),Y=$P(Y,U)
 S BCHVAR("IS DOMAIN")=Y
 S BCHVAR("S.RTM")="S.HL V16 SERVER"
 S X=BCHVAR("S.RTM"),Y=BCHVAR("IS DOMAIN")
 S XMY(X_"@"_Y)=""
 D ^XMD K XMY,XMTEXT,XMSUB
 Q
 ;
EOJ ;KILL VARS
 K BCHCTR,BCHNUM,BCHX,BCHVAR,XTKFILE,XTKDA
 K ^TMP("BCH",$J)
 Q
 ;