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

INHBLD.m

Go to the documentation of this file.
  1. INHBLD ;DP;12:16 PM 12 Apr 1996;14 Feb 96 08:15
  1. ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
  1. ;COPYRIGHT 1991-2000 SAIC
  1. W # R "Number of records: ",NUM:$G(DTIME,300)
  1. Q:'NUM K ^UTIL(DUZ),DST,DEST
  1. N ZZ,ZZ1 F ZZ=1:1:6 S ZZ1(ZZ)=$P($T(ZZ1+ZZ),";;",2)
  1. ;Build an array of active destinations for this run
  1. W !,"Building array of active background processes",!
  1. F I=20:1:47 D
  1. .Q:'$D(^INRHB("RUN",I))
  1. .S DST=$P(^INTHPC(I,0),U,7) Q:'DST
  1. .W $P(^INTHPC(I,0),U),!
  1. .S DEST(DST)=""
  1. I '$D(DEST) W "No background processes are active. No messages generated!",! Q
  1. S DST="" F ZZ=1:1:NUM D
  1. .;Get next destination from array of active destinations
  1. .D
  1. ..S DST=$O(DEST(DST))
  1. ..;if DST="", start over
  1. ..S DST=$O(DEST(DST))
  1. .S X="NOW",DLAYGO=4001,DIC="^INTHU(",DIC(0)="FL" D ^DICN
  1. .S (INREQIEN,DA)=+Y L +^INTHU(DA) S ^UTIL(DUZ,ZZ)=INREQIEN K A1 D NAME
  1. .;B S $P(^INTHU(0),U,3)=DA
  1. .S DIE="^INTHU(",DR="[INH MESSAGE NEW]" D ^DIE
  1. .S TIM=$$CDATH2F^%ZTFDT($H),MID="CHCS"_INREQIEN
  1. .S ^INTHU("B",TIM,INREQIEN)="",^INTHU("C",MID,INREQIEN)=""
  1. .;Concatenate time (.01 field) and destination to remainder
  1. .S X1=ZZ1(1),X=TIM_U_DST_U_$P(X1,U,3,4)_U_MID_U_$P(X1,6,99)
  1. .;S X1=ZZ1(1),X=TIM_U_$P(X1,U,2,4)_U_MID_U_$P(X1,6,99)
  1. .S ^INTHU(INREQIEN,0)=X,^INTHU(INREQIEN,3,0)=ZZ1(2)
  1. .S X1=ZZ1(3),X=$P(X1,U,1,9)_U_MID_U_$P(X1,U,11,99)
  1. .S ^INTHU(INREQIEN,3,1,0)=X
  1. .S ^INTHU(INREQIEN,3,2,0)=ZZ1(4)
  1. .S ^INTHU(INREQIEN,3,4,0)=ZZ1(6)
  1. .S ^INTHU(INREQIEN,3,3,0)=NAME
  1. .;Queue the message
  1. .;S INDEST=$P(^INTHU(INREQIEN,0),U,2)
  1. .;S INQUE=$P($G(^INRHD(INDEST,0)),U,12)
  1. .;S ^INLHDEST(INDEST,0,$H,INREQIEN)=""
  1. .S ^INLHDEST(DST,0,$H,INREQIEN)=""
  1. .L -^INTHU(INREQIEN)
  1. Q
  1. NAME ;SET LIST OF NAMES
  1. S A=$R(1000) S:'$D(^DPT(A,0)) A=$O(^DPT(A))
  1. Q:'$D(^DPT(A,0))
  1. S A1=^DPT(A,0),A2=$G(^DPT(A,.11))
  1. S X=ZZ1(5),X1=$P(X,U,4),$P(X1,"\",1)=A,N=$P(A1,U)
  1. S NAME=$P(N,",")_"\"_$P($P(N,",",2)," ")_"\"_$P($P(N,",",2)," ",2)_"\\\"
  1. ;W !,X,!!,A1,!!,NAME
  1. S $P(X,U,6)=NAME,NAME=X ; W !,X
  1. S ZZ1(5)=X
  1. Q
  1. ZZ1 ;
  1. ;;2951220.183743^11019^N^0^CHCS485207^^^^^O^12122^^^^^0^^^56601,67063
  1. ;;^^4^4
  1. ;;MSH^\|~&^CHCSADT^A0101^^^19951220183700^^ADT\A04^CHCS485207^P^2.2^^^^|CR|
  1. ;;EVN^A04^^^|CR|
  1. ;;PID^1^^424385\\\A0101^20/567-67-7890^GREEN\CHILD\ONE\\\^^19190505000000^M^^C^\\UNIVERSITY CITY\CALIFORNIA\92122^^^^^S^^^567-67-7890^^^^^^^^4104\USA ACTIVE DUTY ENLISTED\99PAT|CR|
  1. ;;PV1^1^O^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^|CR|
  1. ;