IS00025(UIF,INOA,INODA) ;Compiled from script 'Generated: HL IHS IZV04 V01VXQ IN-I' on AUG 15, 2018
;Part 1
;Copyright 2018 SAIC
EN S X="ERROR^IS00025",@^%ZOSF("TRAP")
G START
ERROR ;
S X="",@^%ZOSF("TRAP") X ^INTHOS(1,3) D ERROR^INHS($$GETERR^%ZTOS)
Q 2
START ;Initialize variables
K FIELD,MDESC,INDA,DIPA S (INAUDIT,INLAYGO)=0
K INREQERR,INHERR,INHERCNT,INV D SETDT^UTDT S DUZ(0)="@",DUZ("AG")="^1",DTIME=1 S (LCT,GERR)=0,INMODE="I",INVS=$P(^INRHSITE(1,0),U,12),INV=$S(INVS<2:"INV",1:"^UTILITY(""INV"",$J)"),(MULT,INSTERR)=0
S INHLDUZ=$O(^VA(200,"B","GIS,USER",0)),DUZ=$S($G(INHLDUZ):INHLDUZ,1:.5)
S BHLMIEN="12441"
I $G(^INTHL7M(BHLMIEN,4,1,0))]"" X $G(^INTHL7M(BHLMIEN,4,1,0))
K INSETID
S INSMIN=$S($P($G(^INRHSITE(1,0)),U,14):$P(^(0),U,14),1:2500)
S (DELIM,INDELIM)=$$FIELD^INHUT(),(SUBDELIM,INSUBDEL)=$$COMP^INHUT(),INSUBCOM=$$SUBCOMP^INHUT()
;Entering DATA section.
S X=$$GL^INHOU(UIF,LCT),Y(1)=$G(X) S X=4,X=$E(Y(1),X) S DELIM=X K DXS
S X=$$GL^INHOU(UIF,LCT),Y(1)=$G(X) S X=5,X=$E(Y(1),X) S SUBDELIM=X K DXS S INDELIMS=DELIM_$P(Y(1),DELIM,2)
N INDEFSEG
S INDEFSEG("MSH",0)=0
S INDEFSEG("QRD",0)=0
S INDEFSEG("QRF",0)=0
;Start of GROUP
F S MATCH=0 D Q:'MATCH
.D:'INVS MC^INHS
.D GET^INHOU(UIF,0) S LINE=$G(LINE),DO=0
.I 'MATCH,LINE?1"M"1"S"1"H".ANPC S DO=1,MATCH=1
.E S LCT=LCT-CNT,DO=0
.S:DO @("@INV@(""MSH1"")")=$E($G(LINE),4)
.S:DO @("@INV@(""MSH2"")")=$$PIECE^INHU(.LINE,DELIM,2)
.S:DO @("@INV@(""MSH3"")")=$$PIECE^INHU(.LINE,DELIM,3)
.S:DO @("@INV@(""MSH4"")")=$$PIECE^INHU(.LINE,DELIM,4)
.S:DO @("@INV@(""MSH5"")")=$$PIECE^INHU(.LINE,DELIM,5)
.S:DO @("@INV@(""MSH6"")")=$$PIECE^INHU(.LINE,DELIM,6)
.S:DO @("@INV@(""MSH7"")")=$$PIECE^INHU(.LINE,DELIM,7)
.S:DO @("@INV@(""MSH8"")")=$$PIECE^INHU(.LINE,DELIM,8)
.S:DO @("@INV@(""MSH9"")")=$$PIECE^INHU(.LINE,DELIM,9)
.S:DO @("@INV@(""MSH10"")")=$$PIECE^INHU(.LINE,DELIM,10)
.S:DO @("@INV@(""MSH11"")")=$$PIECE^INHU(.LINE,DELIM,11)
.S:DO @("@INV@(""MSH12"")")=$$PIECE^INHU(.LINE,DELIM,12)
.S:DO @("@INV@(""MSH13"")")=$$PIECE^INHU(.LINE,DELIM,13)
.S:DO @("@INV@(""MSH14"")")=$$PIECE^INHU(.LINE,DELIM,14)
.S:DO @("@INV@(""MSH15"")")=$$PIECE^INHU(.LINE,DELIM,15)
.S:DO @("@INV@(""MSH16"")")=$$PIECE^INHU(.LINE,DELIM,16)
.S:DO @("@INV@(""MSH17"")")=$$PIECE^INHU(.LINE,DELIM,17)
.Q:MATCH
.D:'INVS MC^INHS
.D GET^INHOU(UIF,0) S LINE=$G(LINE),DO=0
.I 'MATCH,LINE?1"Q"1"R"1"D".ANPC S DO=1,MATCH=1
.E S LCT=LCT-CNT,DO=0
.S:DO @("@INV@(""QRD1"")")=$$PIECE^INHU(.LINE,DELIM,2)
.S:DO @("@INV@(""QRD2"")")=$$PIECE^INHU(.LINE,DELIM,3)
.S:DO @("@INV@(""QRD3"")")=$$PIECE^INHU(.LINE,DELIM,4)
.S:DO @("@INV@(""QRD4"")")=$$PIECE^INHU(.LINE,DELIM,5)
.S:DO @("@INV@(""QRD7"")")=$$PIECE^INHU(.LINE,DELIM,8)
.S:DO @("@INV@(""QRD8"")")=$$PIECE^INHU(.LINE,DELIM,9)
.S:DO @("@INV@(""QRD9"")")=$$PIECE^INHU(.LINE,DELIM,10)
.S:DO @("@INV@(""QRD12"")")=$$PIECE^INHU(.LINE,DELIM,13)
.Q:MATCH
.D:'INVS MC^INHS
.D GET^INHOU(UIF,0) S LINE=$G(LINE),DO=0
.I 'MATCH,LINE?1"Q"1"R"1"F".ANPC S DO=1,MATCH=1
.E S LCT=LCT-CNT,DO=0
.S:DO @("@INV@(""QRF1"")")=$$PIECE^INHU(.LINE,DELIM,2)
.S:DO @("@INV@(""QRF5"")")=$$PIECE^INHU(.LINE,DELIM,6)
.S:DO @("@INV@(""QRF6"")")=$$PIECE^INHU(.LINE,DELIM,7)
.S:DO @("@INV@(""QRF7"")")=$$PIECE^INHU(.LINE,DELIM,8)
.S:DO @("@INV@(""QRF8"")")=$$PIECE^INHU(.LINE,DELIM,9)
.S:DO @("@INV@(""QRF9"")")=$$PIECE^INHU(.LINE,DELIM,10)
.Q:MATCH
.Q
D:'INVS MC^INHS
;Entering TRANS section.
;IF $D(@INV@("MSH1"))
I $D(@INV@("MSH1"))
D:$T
.S (INX,X)=$G(@INV@("MSH1"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("MSH1")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'MSH1' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("MSH2"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("MSH2")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'MSH2' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("MSH3"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("MSH3")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'MSH3' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("MSH4"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("MSH4")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'MSH4' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("MSH5"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("MSH5")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'MSH5' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("MSH6"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("MSH6")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'MSH6' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("MSH7"))
.I X]"" S X=$$TIMEIO^INHUT10(X,$P($G(INTHL7F2),U),$P($G(INTHL7F2),U,2),$P($G(INTHL7F2),U,3),1)
.S @INV@("MSH7")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'MSH7' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("MSH8"))
.I X]"" S X=$$TIMEIO^INHUT10(X,$P($G(INTHL7F2),U),$P($G(INTHL7F2),U,2),$P($G(INTHL7F2),U,3),1)
.S @INV@("MSH8")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'MSH8' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("MSH10"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("MSH10")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'MSH10' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("MSH12"))
.S:$L(X) X=+X
.S @INV@("MSH12")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'MSH12' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("MSH13"))
.S:$L(X) X=+X
.S @INV@("MSH13")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'MSH13' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("MSH14"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("MSH14")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'MSH14' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.Q
;IF $D(@INV@("QRD1"))
I $D(@INV@("QRD1"))
D:$T
.S (INX,X)=$G(@INV@("QRD1"))
.I X]"" S X=$$TIMEIO^INHUT10(X,$P($G(INTHL7F2),U),$P($G(INTHL7F2),U,2),$P($G(INTHL7F2),U,3),1)
.S @INV@("QRD1")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'QRD1' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("QRD4"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("QRD4")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'QRD4' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("QRD9"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("QRD9")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'QRD9' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.Q
;IF $D(@INV@("QRF1"))
I $D(@INV@("QRF1"))
D:$T
.S (INX,X)=$G(@INV@("QRF1"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("QRF1")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'QRF1' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("QRF5"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("QRF5")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'QRF5' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.Q
;Entering REQUIRED section.
I $D(@INV@("MSH1"))#2,$G(@INV@("MSH1"))="" S INREQERR=2 D KILL^INHVA1("MSH","HL FIELD SEPARATOR")
I $D(@INV@("MSH1"))#2,$G(@INV@("MSH2"))="" S INREQERR=2 D KILL^INHVA1("MSH","HL ENCODING CHARACTERS")
I $D(@INV@("MSH1"))#2,$G(@INV@("MSH9"))="" S INREQERR=2 D KILL^INHVA1("MSH","HL MESSAGE TYPE")
I $D(@INV@("MSH1"))#2,$G(@INV@("MSH11"))="" S INREQERR=2 D KILL^INHVA1("MSH","HL PROCESSING ID")
I $D(@INV@("QRD1"))#2,$G(@INV@("QRD1"))="" S INREQERR=2 D KILL^INHVA1("QRD","HL IHS QRD IN QDTM (QRD-1)")
I $D(@INV@("QRD1"))#2,$G(@INV@("QRD2"))="" S INREQERR=2 D KILL^INHVA1("QRD","HL IHS QRD IN QFC (QRD-2)")
I $D(@INV@("QRD1"))#2,$G(@INV@("QRD3"))="" S INREQERR=2 D KILL^INHVA1("QRD","HL IHS QRD IN QP (QRD-3)")
I $D(@INV@("QRD1"))#2,$G(@INV@("QRD4"))="" S INREQERR=2 D KILL^INHVA1("QRD","HL IHS QRD IN QID (QRD-4)")
I $D(@INV@("QRD1"))#2,$G(@INV@("QRD7"))="" S INREQERR=2 D KILL^INHVA1("QRD","HL IHS QRD IN QTY (QRD-7)")
I $D(@INV@("QRD1"))#2,$G(@INV@("QRD8"))="" S INREQERR=2 D KILL^INHVA1("QRD","HL IHS QRD IN WHO (QRD-8)")
I $D(@INV@("QRD1"))#2,$G(@INV@("QRD9"))="" S INREQERR=2 D KILL^INHVA1("QRD","HL IHS QRD IN WHAT (QRD-9)")
I $D(@INV@("QRF1"))#2,$G(@INV@("QRF1"))="" S INREQERR=2 D KILL^INHVA1("QRF","HL IHS QRF IN WHERE (QRF-1)")
Q:$G(INSTERR) $S($G(INREQERR)>INSTERR:INREQERR,1:INSTERR) D MAIN^BHLV01I
I $G(INSTERR) Q $S($G(INREQERR)>INSTERR:INREQERR,1:INSTERR)
;Entering END section.
I $G(INSTERR) Q $S($G(INREQERR)>INSTERR:INREQERR,1:INSTERR)
K @INV,INV,INDA,DIPA Q +$G(INREQERR)
IS00025(UIF,INOA,INODA) ;Compiled from script 'Generated: HL IHS IZV04 V01VXQ IN-I' on AUG 15, 2018
+1 ;Part 1
+2 ;Copyright 2018 SAIC
EN SET X="ERROR^IS00025"
SET @^%ZOSF("TRAP")
+1 GOTO START
ERROR ;
+1 SET X=""
SET @^%ZOSF("TRAP")
XECUTE ^INTHOS(1,3)
DO ERROR^INHS($$GETERR^%ZTOS)
+2 QUIT 2
START ;Initialize variables
+1 KILL FIELD,MDESC,INDA,DIPA
SET (INAUDIT,INLAYGO)=0
+2 KILL INREQERR,INHERR,INHERCNT,INV
DO SETDT^UTDT
SET DUZ(0)="@"
SET DUZ("AG")="^1"
SET DTIME=1
SET (LCT,GERR)=0
SET INMODE="I"
SET INVS=$PIECE(^INRHSITE(1,0),U,12)
SET INV=$SELECT(INVS<2:"INV",1:"^UTILITY(""INV"",$J)")
SET (MULT,INSTERR)=0
+3 SET INHLDUZ=$ORDER(^VA(200,"B","GIS,USER",0))
SET DUZ=$SELECT($GET(INHLDUZ):INHLDUZ,1:.5)
+4 SET BHLMIEN="12441"
+5 IF $GET(^INTHL7M(BHLMIEN,4,1,0))]""
XECUTE $GET(^INTHL7M(BHLMIEN,4,1,0))
+6 KILL INSETID
+7 SET INSMIN=$SELECT($PIECE($GET(^INRHSITE(1,0)),U,14):$PIECE(^(0),U,14),1:2500)
+8 SET (DELIM,INDELIM)=$$FIELD^INHUT()
SET (SUBDELIM,INSUBDEL)=$$COMP^INHUT()
SET INSUBCOM=$$SUBCOMP^INHUT()
+9 ;Entering DATA section.
+10 SET X=$$GL^INHOU(UIF,LCT)
SET Y(1)=$GET(X)
SET X=4
SET X=$EXTRACT(Y(1),X)
SET DELIM=X
KILL DXS
+11 SET X=$$GL^INHOU(UIF,LCT)
SET Y(1)=$GET(X)
SET X=5
SET X=$EXTRACT(Y(1),X)
SET SUBDELIM=X
KILL DXS
SET INDELIMS=DELIM_$PIECE(Y(1),DELIM,2)
+12 NEW INDEFSEG
+13 SET INDEFSEG("MSH",0)=0
+14 SET INDEFSEG("QRD",0)=0
+15 SET INDEFSEG("QRF",0)=0
+16 ;Start of GROUP
+17 FOR
SET MATCH=0
Begin DoDot:1
+18 IF 'INVS
DO MC^INHS
+19 DO GET^INHOU(UIF,0)
SET LINE=$GET(LINE)
SET DO=0
+20 IF 'MATCH
IF LINE?1"M"1"S"1"H".ANPC
SET DO=1
SET MATCH=1
+21 IF '$TEST
SET LCT=LCT-CNT
SET DO=0
+22 IF DO
SET @("@INV@(""MSH1"")")=$EXTRACT($GET(LINE),4)
+23 IF DO
SET @("@INV@(""MSH2"")")=$$PIECE^INHU(.LINE,DELIM,2)
+24 IF DO
SET @("@INV@(""MSH3"")")=$$PIECE^INHU(.LINE,DELIM,3)
+25 IF DO
SET @("@INV@(""MSH4"")")=$$PIECE^INHU(.LINE,DELIM,4)
+26 IF DO
SET @("@INV@(""MSH5"")")=$$PIECE^INHU(.LINE,DELIM,5)
+27 IF DO
SET @("@INV@(""MSH6"")")=$$PIECE^INHU(.LINE,DELIM,6)
+28 IF DO
SET @("@INV@(""MSH7"")")=$$PIECE^INHU(.LINE,DELIM,7)
+29 IF DO
SET @("@INV@(""MSH8"")")=$$PIECE^INHU(.LINE,DELIM,8)
+30 IF DO
SET @("@INV@(""MSH9"")")=$$PIECE^INHU(.LINE,DELIM,9)
+31 IF DO
SET @("@INV@(""MSH10"")")=$$PIECE^INHU(.LINE,DELIM,10)
+32 IF DO
SET @("@INV@(""MSH11"")")=$$PIECE^INHU(.LINE,DELIM,11)
+33 IF DO
SET @("@INV@(""MSH12"")")=$$PIECE^INHU(.LINE,DELIM,12)
+34 IF DO
SET @("@INV@(""MSH13"")")=$$PIECE^INHU(.LINE,DELIM,13)
+35 IF DO
SET @("@INV@(""MSH14"")")=$$PIECE^INHU(.LINE,DELIM,14)
+36 IF DO
SET @("@INV@(""MSH15"")")=$$PIECE^INHU(.LINE,DELIM,15)
+37 IF DO
SET @("@INV@(""MSH16"")")=$$PIECE^INHU(.LINE,DELIM,16)
+38 IF DO
SET @("@INV@(""MSH17"")")=$$PIECE^INHU(.LINE,DELIM,17)
+39 IF MATCH
QUIT
+40 IF 'INVS
DO MC^INHS
+41 DO GET^INHOU(UIF,0)
SET LINE=$GET(LINE)
SET DO=0
+42 IF 'MATCH
IF LINE?1"Q"1"R"1"D".ANPC
SET DO=1
SET MATCH=1
+43 IF '$TEST
SET LCT=LCT-CNT
SET DO=0
+44 IF DO
SET @("@INV@(""QRD1"")")=$$PIECE^INHU(.LINE,DELIM,2)
+45 IF DO
SET @("@INV@(""QRD2"")")=$$PIECE^INHU(.LINE,DELIM,3)
+46 IF DO
SET @("@INV@(""QRD3"")")=$$PIECE^INHU(.LINE,DELIM,4)
+47 IF DO
SET @("@INV@(""QRD4"")")=$$PIECE^INHU(.LINE,DELIM,5)
+48 IF DO
SET @("@INV@(""QRD7"")")=$$PIECE^INHU(.LINE,DELIM,8)
+49 IF DO
SET @("@INV@(""QRD8"")")=$$PIECE^INHU(.LINE,DELIM,9)
+50 IF DO
SET @("@INV@(""QRD9"")")=$$PIECE^INHU(.LINE,DELIM,10)
+51 IF DO
SET @("@INV@(""QRD12"")")=$$PIECE^INHU(.LINE,DELIM,13)
+52 IF MATCH
QUIT
+53 IF 'INVS
DO MC^INHS
+54 DO GET^INHOU(UIF,0)
SET LINE=$GET(LINE)
SET DO=0
+55 IF 'MATCH
IF LINE?1"Q"1"R"1"F".ANPC
SET DO=1
SET MATCH=1
+56 IF '$TEST
SET LCT=LCT-CNT
SET DO=0
+57 IF DO
SET @("@INV@(""QRF1"")")=$$PIECE^INHU(.LINE,DELIM,2)
+58 IF DO
SET @("@INV@(""QRF5"")")=$$PIECE^INHU(.LINE,DELIM,6)
+59 IF DO
SET @("@INV@(""QRF6"")")=$$PIECE^INHU(.LINE,DELIM,7)
+60 IF DO
SET @("@INV@(""QRF7"")")=$$PIECE^INHU(.LINE,DELIM,8)
+61 IF DO
SET @("@INV@(""QRF8"")")=$$PIECE^INHU(.LINE,DELIM,9)
+62 IF DO
SET @("@INV@(""QRF9"")")=$$PIECE^INHU(.LINE,DELIM,10)
+63 IF MATCH
QUIT
+64 QUIT
End DoDot:1
IF 'MATCH
QUIT
+65 IF 'INVS
DO MC^INHS
+66 ;Entering TRANS section.
+67 ;IF $D(@INV@("MSH1"))
+68 IF $DATA(@INV@("MSH1"))
+69 IF $TEST
Begin DoDot:1
+70 SET (INX,X)=$GET(@INV@("MSH1"))
+71 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+72 SET @INV@("MSH1")=$GET(X)
+73 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH1' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+74 KILL DXS
+75 SET (INX,X)=$GET(@INV@("MSH2"))
+76 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+77 SET @INV@("MSH2")=$GET(X)
+78 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH2' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+79 KILL DXS
+80 SET (INX,X)=$GET(@INV@("MSH3"))
+81 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+82 SET @INV@("MSH3")=$GET(X)
+83 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH3' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+84 KILL DXS
+85 SET (INX,X)=$GET(@INV@("MSH4"))
+86 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+87 SET @INV@("MSH4")=$GET(X)
+88 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH4' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+89 KILL DXS
+90 SET (INX,X)=$GET(@INV@("MSH5"))
+91 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+92 SET @INV@("MSH5")=$GET(X)
+93 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH5' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+94 KILL DXS
+95 SET (INX,X)=$GET(@INV@("MSH6"))
+96 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+97 SET @INV@("MSH6")=$GET(X)
+98 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH6' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+99 KILL DXS
+100 SET (INX,X)=$GET(@INV@("MSH7"))
+101 IF X]""
SET X=$$TIMEIO^INHUT10(X,$PIECE($GET(INTHL7F2),U),$PIECE($GET(INTHL7F2),U,2),$PIECE($GET(INTHL7F2),U,3),1)
+102 SET @INV@("MSH7")=$GET(X)
+103 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH7' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+104 KILL DXS
+105 SET (INX,X)=$GET(@INV@("MSH8"))
+106 IF X]""
SET X=$$TIMEIO^INHUT10(X,$PIECE($GET(INTHL7F2),U),$PIECE($GET(INTHL7F2),U,2),$PIECE($GET(INTHL7F2),U,3),1)
+107 SET @INV@("MSH8")=$GET(X)
+108 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH8' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+109 KILL DXS
+110 SET (INX,X)=$GET(@INV@("MSH10"))
+111 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+112 SET @INV@("MSH10")=$GET(X)
+113 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH10' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+114 KILL DXS
+115 SET (INX,X)=$GET(@INV@("MSH12"))
+116 IF $LENGTH(X)
SET X=+X
+117 SET @INV@("MSH12")=$GET(X)
+118 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH12' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+119 KILL DXS
+120 SET (INX,X)=$GET(@INV@("MSH13"))
+121 IF $LENGTH(X)
SET X=+X
+122 SET @INV@("MSH13")=$GET(X)
+123 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH13' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+124 KILL DXS
+125 SET (INX,X)=$GET(@INV@("MSH14"))
+126 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+127 SET @INV@("MSH14")=$GET(X)
+128 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH14' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+129 KILL DXS
+130 QUIT
End DoDot:1
+131 ;IF $D(@INV@("QRD1"))
+132 IF $DATA(@INV@("QRD1"))
+133 IF $TEST
Begin DoDot:1
+134 SET (INX,X)=$GET(@INV@("QRD1"))
+135 IF X]""
SET X=$$TIMEIO^INHUT10(X,$PIECE($GET(INTHL7F2),U),$PIECE($GET(INTHL7F2),U,2),$PIECE($GET(INTHL7F2),U,3),1)
+136 SET @INV@("QRD1")=$GET(X)
+137 IF '$DATA(X)
DO ERROR^INHS("Variable 'QRD1' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+138 KILL DXS
+139 SET (INX,X)=$GET(@INV@("QRD4"))
+140 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+141 SET @INV@("QRD4")=$GET(X)
+142 IF '$DATA(X)
DO ERROR^INHS("Variable 'QRD4' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+143 KILL DXS
+144 SET (INX,X)=$GET(@INV@("QRD9"))
+145 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+146 SET @INV@("QRD9")=$GET(X)
+147 IF '$DATA(X)
DO ERROR^INHS("Variable 'QRD9' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+148 KILL DXS
+149 QUIT
End DoDot:1
+150 ;IF $D(@INV@("QRF1"))
+151 IF $DATA(@INV@("QRF1"))
+152 IF $TEST
Begin DoDot:1
+153 SET (INX,X)=$GET(@INV@("QRF1"))
+154 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+155 SET @INV@("QRF1")=$GET(X)
+156 IF '$DATA(X)
DO ERROR^INHS("Variable 'QRF1' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+157 KILL DXS
+158 SET (INX,X)=$GET(@INV@("QRF5"))
+159 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+160 SET @INV@("QRF5")=$GET(X)
+161 IF '$DATA(X)
DO ERROR^INHS("Variable 'QRF5' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+162 KILL DXS
+163 QUIT
End DoDot:1
+164 ;Entering REQUIRED section.
+165 IF $DATA(@INV@("MSH1"))#2
IF $GET(@INV@("MSH1"))=""
SET INREQERR=2
DO KILL^INHVA1("MSH","HL FIELD SEPARATOR")
+166 IF $DATA(@INV@("MSH1"))#2
IF $GET(@INV@("MSH2"))=""
SET INREQERR=2
DO KILL^INHVA1("MSH","HL ENCODING CHARACTERS")
+167 IF $DATA(@INV@("MSH1"))#2
IF $GET(@INV@("MSH9"))=""
SET INREQERR=2
DO KILL^INHVA1("MSH","HL MESSAGE TYPE")
+168 IF $DATA(@INV@("MSH1"))#2
IF $GET(@INV@("MSH11"))=""
SET INREQERR=2
DO KILL^INHVA1("MSH","HL PROCESSING ID")
+169 IF $DATA(@INV@("QRD1"))#2
IF $GET(@INV@("QRD1"))=""
SET INREQERR=2
DO KILL^INHVA1("QRD","HL IHS QRD IN QDTM (QRD-1)")
+170 IF $DATA(@INV@("QRD1"))#2
IF $GET(@INV@("QRD2"))=""
SET INREQERR=2
DO KILL^INHVA1("QRD","HL IHS QRD IN QFC (QRD-2)")
+171 IF $DATA(@INV@("QRD1"))#2
IF $GET(@INV@("QRD3"))=""
SET INREQERR=2
DO KILL^INHVA1("QRD","HL IHS QRD IN QP (QRD-3)")
+172 IF $DATA(@INV@("QRD1"))#2
IF $GET(@INV@("QRD4"))=""
SET INREQERR=2
DO KILL^INHVA1("QRD","HL IHS QRD IN QID (QRD-4)")
+173 IF $DATA(@INV@("QRD1"))#2
IF $GET(@INV@("QRD7"))=""
SET INREQERR=2
DO KILL^INHVA1("QRD","HL IHS QRD IN QTY (QRD-7)")
+174 IF $DATA(@INV@("QRD1"))#2
IF $GET(@INV@("QRD8"))=""
SET INREQERR=2
DO KILL^INHVA1("QRD","HL IHS QRD IN WHO (QRD-8)")
+175 IF $DATA(@INV@("QRD1"))#2
IF $GET(@INV@("QRD9"))=""
SET INREQERR=2
DO KILL^INHVA1("QRD","HL IHS QRD IN WHAT (QRD-9)")
+176 IF $DATA(@INV@("QRF1"))#2
IF $GET(@INV@("QRF1"))=""
SET INREQERR=2
DO KILL^INHVA1("QRF","HL IHS QRF IN WHERE (QRF-1)")
+177 IF $GET(INSTERR)
QUIT $SELECT($GET(INREQERR)>INSTERR:INREQERR,1:INSTERR)
DO MAIN^BHLV01I
+178 IF $GET(INSTERR)
QUIT $SELECT($GET(INREQERR)>INSTERR:INREQERR,1:INSTERR)
+179 ;Entering END section.
+180 IF $GET(INSTERR)
QUIT $SELECT($GET(INREQERR)>INSTERR:INREQERR,1:INSTERR)
+181 KILL @INV,INV,INDA,DIPA
QUIT +$GET(INREQERR)