INXHR08 ; GENERATED FROM 'INHSG MESSAGE' PRINT TEMPLATE (#2828) ; 10/25/01 ; (FILE 4011, MARGIN=80)
G BEGIN
N W !
T W:$X ! I '$D(DIOT(2)),DN,$D(IOSL),$S('$D(DIWF):1,$P(DIWF,"B",2):$P(DIWF,"B",2),1:1)+$Y'<IOSL,$D(^UTILITY($J,1))#2,^(1)?1U1P1E.E X ^(1)
S DISTP=DISTP+1,DILCT=DILCT+1 D:'(DISTP#100) CSTP^DIO2
Q
DT I $G(DUZ("LANG"))>1,Y W $$OUT^DIALOGU(Y,"DD") Q
I Y W $P("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$E(Y,4,5))_" " W:Y#100 $J(Y#100\1,2)_"," W Y\10000+1700 W:Y#1 " "_$E(Y_0,9,10)_":"_$E(Y_"000",11,12) Q
W Y Q
M D @DIXX
Q
BEGIN ;
S:'$D(DN) DN=1 S DISTP=$G(DISTP),DILCT=$G(DILCT)
I $D(DXS)<9 F X=0:0 S X=$O(^DIPT(2828,"DXS",X)) Q:'X S Y=$O(^(X,"")) F X=X:0 Q:Y="" S DXS(X,Y)=^(Y),Y=$O(^(Y))
D N:$X>0 Q:'DN W ?0 W "***** Message *****************************************************************"
S X=$G(^INTHL7M(D0,0)) D T Q:'DN D N D N:$X>0 Q:'DN W ?0,$E($P(X,U,1),1,45)
D N:$X>66 Q:'DN W ?66 W "Inactive:"
D N:$X>76 Q:'DN W ?76 S Y=$P(X,U,8) W:Y]"" $S($D(DXS(17,Y)):DXS(17,Y),1:Y)
S I(1)=3,J(1)=4011.03 F D1=0:0 Q:$O(^INTHL7M(D0,3,D1))'>0 S D1=$O(^(D1)) D:$X>76 T Q:'DN D A1
G A1R
A1 ;
S X=$G(^INTHL7M(D0,3,D1,0)) S DIWL=5,DIWR=78 D ^DIWP
Q
A1R ;
D A^DIWW
D T Q:'DN D N D N:$X>5 Q:'DN W ?5 W "Standard:"
S X=$G(^INTHL7M(D0,0)) D N:$X>15 Q:'DN W ?15 S Y=$P(X,U,12) W:Y]"" $S($D(DXS(18,Y)):DXS(18,Y),1:Y)
D T Q:'DN D N D N:$X>3 Q:'DN W ?3 W "Event Type:"
D N:$X>15 Q:'DN W ?15,$E($P(X,U,2),1,20)
D N:$X>41 Q:'DN W ?41 W "Message Type:"
D N:$X>56 Q:'DN W ?56,$E($P(X,U,6),1,3)
D T Q:'DN D N D N:$X>1 Q:'DN W ?1 W "Send Applic.:"
S X=$G(^INTHL7M(D0,7)) D N:$X>15 Q:'DN W ?15,$E($P(X,U,1),1,25)
D N:$X>41 Q:'DN W ?41 W "Rec. Applic.:"
D N:$X>55 Q:'DN W ?55,$E($P(X,U,3),1,25)
D T Q:'DN D N D N:$X>5 Q:'DN W ?5 W "Facility:"
D N:$X>15 Q:'DN W ?15,$E($P(X,U,2),1,25)
D N:$X>45 Q:'DN W ?45 W "Facility:"
D N:$X>55 Q:'DN W ?55,$E($P(X,U,4),1,25)
D T Q:'DN D N D N:$X>0 Q:'DN W ?0 W "Processing ID:"
S X=$G(^INTHL7M(D0,0)) D N:$X>15 Q:'DN W ?15 S Y=$P(X,U,3) W:Y]"" $S($D(DXS(19,Y)):DXS(19,Y),1:Y)
D N:$X>28 Q:'DN W ?28 W "HL7 Version:"
D N:$X>41 Q:'DN W ?41,$E($P(X,U,4),1,5)
D N:$X>48 Q:'DN W ?48 W "Lookup Parameter:"
D N:$X>66 Q:'DN W ?66 S Y=$P(X,U,7) W:Y]"" $S($D(DXS(20,Y)):DXS(20,Y),1:Y)
D T Q:'DN D N D N:$X>3 Q:'DN W ?3 W "Accept Ack:"
D N:$X>15 Q:'DN W ?15 S Y=$P(X,U,10) W:Y]"" $S($D(DXS(21,Y)):DXS(21,Y),1:Y)
D N:$X>49 Q:'DN W ?49 W "Application Ack:"
D N:$X>66 Q:'DN W ?66 S Y=$P(X,U,11) W:Y]"" $S($D(DXS(22,Y)):DXS(22,Y),1:Y)
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "Root File:"
D N:$X>15 Q:'DN W ?15 S Y=$P(X,U,5) S Y=$S(Y="":Y,$D(^DIC(Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,40)
D N:$X>57 Q:'DN W ?57 W "Audited:"
D N:$X>66 Q:'DN W ?66 S Y=$P(X,U,9) W:Y]"" $S($D(DXS(23,Y)):DXS(23,Y),1:Y)
D T Q:'DN D N D N:$X>0 Q:'DN W ?0 W "Routine for Lookup/Store:"
S X=$G(^INTHL7M(D0,5)) D N:$X>26 Q:'DN W ?26,$E($E(X,1,200),1,54)
D T Q:'DN D N D N:$X>0 Q:'DN W ?0 W "Transaction Types:"
D T Q:'DN D N D N:$X>3 Q:'DN W ?3 W ""
D RPTRANS^INHMG1(D0,"D T^DIWW") K DIP K:DN Y
D T Q:'DN D N D N:$X>0 Q:'DN W ?0 W "MUMPS Code for Lookup:"
S:'$D(DIWF) DIWF="" S:DIWF'["N" DIWF=DIWF_"N" S X="" S I(1)=4,J(1)=4011.06 F D1=0:0 Q:$O(^INTHL7M(D0,4,D1))'>0 S D1=$O(^(D1)) D:$X>0 T Q:'DN D B1
G B1R
B1 ;
S X=$G(^INTHL7M(D0,4,D1,0)) S DIWL=4,DIWR=80 D ^DIWP
Q
B1R ;
D A^DIWW
D T Q:'DN D N D N:$X>0 Q:'DN W ?0 W "Outgoing Initial MUMPS Code:"
S:'$D(DIWF) DIWF="" S:DIWF'["N" DIWF=DIWF_"N" S X="" S I(1)=6,J(1)=4011.08 F D1=0:0 Q:$O(^INTHL7M(D0,6,D1))'>0 S D1=$O(^(D1)) D:$X>0 T Q:'DN D C1
G C1R
C1 ;
S X=$G(^INTHL7M(D0,6,D1,0)) S DIWL=4,DIWR=80 D ^DIWP
Q
C1R ;
D A^DIWW
D T Q:'DN D N D N:$X>0 Q:'DN W ?0 W "Generated Scripts -"
D T Q:'DN D N D N:$X>3 Q:'DN W ?3 W "Input:"
S X=$G(^INTHL7M(D0,"S")) D N:$X>10 Q:'DN W ?10 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^INRHS(Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,60)
D T Q:'DN D N D N:$X>2 Q:'DN W ?2 W "Output:"
D N:$X>10 Q:'DN W ?10 S Y=$P(X,U,2) S Y=$S(Y="":Y,$D(^INRHS(Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,60)
S I(1)=1,J(1)=4011.01 F D1=0:0 Q:$O(^INTHL7M(D0,1,D1))'>0 X:$D(DSC(4011.01)) DSC(4011.01) S D1=$O(^(D1)) Q:D1'>0 D:$X>10 T Q:'DN D D1
G D1R^INXHR082
D1 ;
D T Q:'DN D N D N:$X>0 Q:'DN W ?0 W "=====Segment Name==================================ID=====Seq No==Req==Rep==OF=="
S X=$G(^INTHL7M(D0,1,D1,0)) D T Q:'DN D N D N:$X>0 Q:'DN W ?0 S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^INTHL7S(Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,45)
G ^INXHR081
INXHR08 ; GENERATED FROM 'INHSG MESSAGE' PRINT TEMPLATE (#2828) ; 10/25/01 ; (FILE 4011, MARGIN=80)
+1 GOTO BEGIN
N WRITE !
T IF $X
WRITE !
IF '$DATA(DIOT(2))
IF DN
IF $DATA(IOSL)
IF $SELECT('$DATA(DIWF):1,$PIECE(DIWF,"B",2):$PIECE(DIWF,"B",2),1:1)+$Y'<IOSL
IF $DATA(^UTILITY($JOB,1))#2
IF ^(1)?1U1P1E.E
XECUTE ^(1)
+1 SET DISTP=DISTP+1
SET DILCT=DILCT+1
IF '(DISTP#100)
DO CSTP^DIO2
+2 QUIT
DT IF $GET(DUZ("LANG"))>1
IF Y
WRITE $$OUT^DIALOGU(Y,"DD")
QUIT
+1 IF Y
WRITE $PIECE("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$EXTRACT(Y,4,5))_" "
IF Y#100
WRITE $JUSTIFY(Y#100\1,2)_","
WRITE Y\10000+1700
IF Y#1
WRITE " "_$EXTRACT(Y_0,9,10)_":"_$EXTRACT(Y_"000",11,12)
QUIT
+2 WRITE Y
QUIT
M DO @DIXX
+1 QUIT
BEGIN ;
+1 IF '$DATA(DN)
SET DN=1
SET DISTP=$GET(DISTP)
SET DILCT=$GET(DILCT)
+2 IF $DATA(DXS)<9
FOR X=0:0
SET X=$ORDER(^DIPT(2828,"DXS",X))
IF 'X
QUIT
SET Y=$ORDER(^(X,""))
FOR X=X:0
IF Y=""
QUIT
SET DXS(X,Y)=^(Y)
SET Y=$ORDER(^(Y))
+3 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "***** Message *****************************************************************"
+4 SET X=$GET(^INTHL7M(D0,0))
DO T
IF 'DN
QUIT
DO N
IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0,$EXTRACT($PIECE(X,U,1),1,45)
+5 IF $X>66
DO N
IF 'DN
QUIT
WRITE ?66
WRITE "Inactive:"
+6 IF $X>76
DO N
IF 'DN
QUIT
WRITE ?76
SET Y=$PIECE(X,U,8)
IF Y]""
WRITE $SELECT($DATA(DXS(17,Y)):DXS(17,Y),1:Y)
+7 SET I(1)=3
SET J(1)=4011.03
FOR D1=0:0
IF $ORDER(^INTHL7M(D0,3,D1))'>0
QUIT
SET D1=$ORDER(^(D1))
IF $X>76
DO T
IF 'DN
QUIT
DO A1
+8 GOTO A1R
A1 ;
+1 SET X=$GET(^INTHL7M(D0,3,D1,0))
SET DIWL=5
SET DIWR=78
DO ^DIWP
+2 QUIT
A1R ;
+1 DO A^DIWW
+2 DO T
IF 'DN
QUIT
DO N
IF $X>5
DO N
IF 'DN
QUIT
WRITE ?5
WRITE "Standard:"
+3 SET X=$GET(^INTHL7M(D0,0))
IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15
SET Y=$PIECE(X,U,12)
IF Y]""
WRITE $SELECT($DATA(DXS(18,Y)):DXS(18,Y),1:Y)
+4 DO T
IF 'DN
QUIT
DO N
IF $X>3
DO N
IF 'DN
QUIT
WRITE ?3
WRITE "Event Type:"
+5 IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,2),1,20)
+6 IF $X>41
DO N
IF 'DN
QUIT
WRITE ?41
WRITE "Message Type:"
+7 IF $X>56
DO N
IF 'DN
QUIT
WRITE ?56,$EXTRACT($PIECE(X,U,6),1,3)
+8 DO T
IF 'DN
QUIT
DO N
IF $X>1
DO N
IF 'DN
QUIT
WRITE ?1
WRITE "Send Applic.:"
+9 SET X=$GET(^INTHL7M(D0,7))
IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,1),1,25)
+10 IF $X>41
DO N
IF 'DN
QUIT
WRITE ?41
WRITE "Rec. Applic.:"
+11 IF $X>55
DO N
IF 'DN
QUIT
WRITE ?55,$EXTRACT($PIECE(X,U,3),1,25)
+12 DO T
IF 'DN
QUIT
DO N
IF $X>5
DO N
IF 'DN
QUIT
WRITE ?5
WRITE "Facility:"
+13 IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15,$EXTRACT($PIECE(X,U,2),1,25)
+14 IF $X>45
DO N
IF 'DN
QUIT
WRITE ?45
WRITE "Facility:"
+15 IF $X>55
DO N
IF 'DN
QUIT
WRITE ?55,$EXTRACT($PIECE(X,U,4),1,25)
+16 DO T
IF 'DN
QUIT
DO N
IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "Processing ID:"
+17 SET X=$GET(^INTHL7M(D0,0))
IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15
SET Y=$PIECE(X,U,3)
IF Y]""
WRITE $SELECT($DATA(DXS(19,Y)):DXS(19,Y),1:Y)
+18 IF $X>28
DO N
IF 'DN
QUIT
WRITE ?28
WRITE "HL7 Version:"
+19 IF $X>41
DO N
IF 'DN
QUIT
WRITE ?41,$EXTRACT($PIECE(X,U,4),1,5)
+20 IF $X>48
DO N
IF 'DN
QUIT
WRITE ?48
WRITE "Lookup Parameter:"
+21 IF $X>66
DO N
IF 'DN
QUIT
WRITE ?66
SET Y=$PIECE(X,U,7)
IF Y]""
WRITE $SELECT($DATA(DXS(20,Y)):DXS(20,Y),1:Y)
+22 DO T
IF 'DN
QUIT
DO N
IF $X>3
DO N
IF 'DN
QUIT
WRITE ?3
WRITE "Accept Ack:"
+23 IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15
SET Y=$PIECE(X,U,10)
IF Y]""
WRITE $SELECT($DATA(DXS(21,Y)):DXS(21,Y),1:Y)
+24 IF $X>49
DO N
IF 'DN
QUIT
WRITE ?49
WRITE "Application Ack:"
+25 IF $X>66
DO N
IF 'DN
QUIT
WRITE ?66
SET Y=$PIECE(X,U,11)
IF Y]""
WRITE $SELECT($DATA(DXS(22,Y)):DXS(22,Y),1:Y)
+26 DO T
IF 'DN
QUIT
DO N
IF $X>4
DO N
IF 'DN
QUIT
WRITE ?4
WRITE "Root File:"
+27 IF $X>15
DO N
IF 'DN
QUIT
WRITE ?15
SET Y=$PIECE(X,U,5)
SET Y=$SELECT(Y="":Y,$DATA(^DIC(Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,40)
+28 IF $X>57
DO N
IF 'DN
QUIT
WRITE ?57
WRITE "Audited:"
+29 IF $X>66
DO N
IF 'DN
QUIT
WRITE ?66
SET Y=$PIECE(X,U,9)
IF Y]""
WRITE $SELECT($DATA(DXS(23,Y)):DXS(23,Y),1:Y)
+30 DO T
IF 'DN
QUIT
DO N
IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "Routine for Lookup/Store:"
+31 SET X=$GET(^INTHL7M(D0,5))
IF $X>26
DO N
IF 'DN
QUIT
WRITE ?26,$EXTRACT($EXTRACT(X,1,200),1,54)
+32 DO T
IF 'DN
QUIT
DO N
IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "Transaction Types:"
+33 DO T
IF 'DN
QUIT
DO N
IF $X>3
DO N
IF 'DN
QUIT
WRITE ?3
WRITE ""
+34 DO RPTRANS^INHMG1(D0,"D T^DIWW")
KILL DIP
IF DN
KILL Y
+35 DO T
IF 'DN
QUIT
DO N
IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "MUMPS Code for Lookup:"
+36 IF '$DATA(DIWF)
SET DIWF=""
IF DIWF'["N"
SET DIWF=DIWF_"N"
SET X=""
SET I(1)=4
SET J(1)=4011.06
FOR D1=0:0
IF $ORDER(^INTHL7M(D0,4,D1))'>0
QUIT
SET D1=$ORDER(^(D1))
IF $X>0
DO T
IF 'DN
QUIT
DO B1
+37 GOTO B1R
B1 ;
+1 SET X=$GET(^INTHL7M(D0,4,D1,0))
SET DIWL=4
SET DIWR=80
DO ^DIWP
+2 QUIT
B1R ;
+1 DO A^DIWW
+2 DO T
IF 'DN
QUIT
DO N
IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "Outgoing Initial MUMPS Code:"
+3 IF '$DATA(DIWF)
SET DIWF=""
IF DIWF'["N"
SET DIWF=DIWF_"N"
SET X=""
SET I(1)=6
SET J(1)=4011.08
FOR D1=0:0
IF $ORDER(^INTHL7M(D0,6,D1))'>0
QUIT
SET D1=$ORDER(^(D1))
IF $X>0
DO T
IF 'DN
QUIT
DO C1
+4 GOTO C1R
C1 ;
+1 SET X=$GET(^INTHL7M(D0,6,D1,0))
SET DIWL=4
SET DIWR=80
DO ^DIWP
+2 QUIT
C1R ;
+1 DO A^DIWW
+2 DO T
IF 'DN
QUIT
DO N
IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "Generated Scripts -"
+3 DO T
IF 'DN
QUIT
DO N
IF $X>3
DO N
IF 'DN
QUIT
WRITE ?3
WRITE "Input:"
+4 SET X=$GET(^INTHL7M(D0,"S"))
IF $X>10
DO N
IF 'DN
QUIT
WRITE ?10
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^INRHS(Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,60)
+5 DO T
IF 'DN
QUIT
DO N
IF $X>2
DO N
IF 'DN
QUIT
WRITE ?2
WRITE "Output:"
+6 IF $X>10
DO N
IF 'DN
QUIT
WRITE ?10
SET Y=$PIECE(X,U,2)
SET Y=$SELECT(Y="":Y,$DATA(^INRHS(Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,60)
+7 SET I(1)=1
SET J(1)=4011.01
FOR D1=0:0
IF $ORDER(^INTHL7M(D0,1,D1))'>0
QUIT
IF $DATA(DSC(4011.01))
XECUTE DSC(4011.01)
SET D1=$ORDER(^(D1))
IF D1'>0
QUIT
IF $X>10
DO T
IF 'DN
QUIT
DO D1
+8 GOTO D1R^INXHR082
D1 ;
+1 DO T
IF 'DN
QUIT
DO N
IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "=====Segment Name==================================ID=====Seq No==Req==Rep==OF=="
+2 SET X=$GET(^INTHL7M(D0,1,D1,0))
DO T
IF 'DN
QUIT
DO N
IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^INTHL7S(Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,45)
+3 GOTO ^INXHR081