IS00010(UIF,INOA,INODA) ;Compiled from script 'Generated: HL IHS IZV04 IN-I' on AUG 15, 2018
;Part 1
;Copyright 2018 SAIC
EN S X="ERROR^IS00010",@^%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="12425"
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("EVN",0)=0
S INDEFSEG("PID",0)=0
S INDEFSEG("NK1",1)=1
S INDEFSEG("ORC",1)=1
S INDEFSEG("RXA",1)=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"E"1"V"1"N".ANPC S DO=1,MATCH=1
.E S LCT=LCT-CNT,DO=0
.S:DO @("@INV@(""EVN1"")")=$$PIECE^INHU(.LINE,DELIM,2)
.S:DO @("@INV@(""EVN2"")")=$$PIECE^INHU(.LINE,DELIM,3)
.Q:MATCH
.D:'INVS MC^INHS
.D GET^INHOU(UIF,0) S LINE=$G(LINE),DO=0
.I 'MATCH,LINE?1"P"1"I"1"D".ANPC S DO=1,MATCH=1
.E S LCT=LCT-CNT,DO=0
.S:DO @("@INV@(""PID3"")")=$$PIECE^INHU(.LINE,DELIM,4)
.S:DO @("@INV@(""PID4"")")=$$PIECE^INHU(.LINE,DELIM,5)
.S:DO @("@INV@(""PID5"")")=$$PIECE^INHU(.LINE,DELIM,6)
.S:DO @("@INV@(""PID6"")")=$$PIECE^INHU(.LINE,DELIM,7)
.S:DO @("@INV@(""PID7"")")=$$PIECE^INHU(.LINE,DELIM,8)
.S:DO @("@INV@(""PID8"")")=$$PIECE^INHU(.LINE,DELIM,9)
.S:DO @("@INV@(""PID11"")")=$$PIECE^INHU(.LINE,DELIM,12)
.S:DO @("@INV@(""PID12"")")=$$PIECE^INHU(.LINE,DELIM,13)
.S:DO @("@INV@(""PID13"")")=$$PIECE^INHU(.LINE,DELIM,14)
.S:DO @("@INV@(""PID14"")")=$$PIECE^INHU(.LINE,DELIM,15)
.S:DO @("@INV@(""PID17"")")=$$PIECE^INHU(.LINE,DELIM,18)
.S:DO @("@INV@(""PID18"")")=$$PIECE^INHU(.LINE,DELIM,19)
.S:DO @("@INV@(""PID19"")")=$$PIECE^INHU(.LINE,DELIM,20)
.S:DO @("@INV@(""PID26"")")=$$PIECE^INHU(.LINE,DELIM,27)
.Q:MATCH
.Q
;WHILE $P(DATA,DELIM)="NK1"
S INI(1)=1 F S DATA=$$GL^INHOU(UIF,LCT) Q:'$$CHECKSEG^INHOU("NK1",0,1) D S INI(1)=INI(1)+1
.D:'INVS MC^INHS
.D GET^INHOU(UIF,0) S LINE=$G(LINE),DO=1
.S:DO @("@INV@(""NK11"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,2)
.S:DO @("@INV@(""NK12"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,3)
.S:DO @("@INV@(""NK13"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,4)
.S:DO @("@INV@(""NK14"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,5)
.S:DO @("@INV@(""NK15"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,6)
.S:DO @("@INV@(""NK17"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,8)
.S:DO @("@INV@(""NK113"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,14)
.Q
;WHILE $P(DATA,DELIM)="ORC"
S INI(1)=1 F S DATA=$$GL^INHOU(UIF,LCT) Q:'$$CHECKSEG^INHOU("ORC",0,1) D S INI(1)=INI(1)+1
.D:'INVS MC^INHS
.D GET^INHOU(UIF,0) S LINE=$G(LINE),DO=1
.S:DO @("@INV@(""ORC1"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,2)
.S:DO @("@INV@(""ORC2"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,3)
.S:DO @("@INV@(""ORC3"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,4)
.S:DO @("@INV@(""ORC5"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,6)
.S:DO @("@INV@(""ORC7"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,8)
.S:DO @("@INV@(""ORC9"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,10)
.S:DO @("@INV@(""ORC12"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,13)
.S:DO @("@INV@(""ORC15"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,16)
.D:'INVS MC^INHS
.D GET^INHOU(UIF,0) S LINE=$G(LINE),DO=1
.I LINE?1"R"1"X"1"A".ANPC S DO=1
.E S LCT=LCT-CNT,DO=0
.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@("EVN1"))
I $D(@INV@("EVN1"))
D:$T
.S (INX,X)=$G(@INV@("EVN1"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("EVN1")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'EVN1' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("EVN2"))
.I X]"" S X=$$TIMEIO^INHUT10(X,$P($G(INTHL7F2),U),$P($G(INTHL7F2),U,2),$P($G(INTHL7F2),U,3),1)
.S @INV@("EVN2")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'EVN2' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.Q
;IF $D(@INV@("PID1"))
I $D(@INV@("PID1"))
D:$T
.S (INX,X)=$G(@INV@("PID3"))
.S:X]"" X=$$HLPN^INHUT(X,INSUBDEL,INDELIMS,$P($G(INTHL7F2),U,4),"I")
.S @INV@("PID3")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'PID3' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("PID4"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("PID4")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'PID4' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("PID5"))
.S:X]"" X=$$HLPN^INHUT(X,INSUBDEL,INDELIMS,$P($G(INTHL7F2),U,4),"I")
.S @INV@("PID5")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'PID5' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("PID6"))
.S:X]"" X=$$HLPN^INHUT(X,INSUBDEL,INDELIMS,$P($G(INTHL7F2),U,4),"I")
.S @INV@("PID6")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'PID6' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("PID7"))
.I X]"" S X=$E(X,1,4)-1700_$E(X,5,8)
.S @INV@("PID7")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'PID7' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("PID11"))
.I $L(X) S:$P(X,INSUBDEL,4)="" $P(X,INSUBDEL,4)=INSUBDEL
.S @INV@("PID11")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'PID11' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("PID13"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("PID13")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'PID13' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("PID14"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("PID14")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'PID14' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("PID17"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("PID17")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'PID17' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("PID19"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("PID19")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'PID19' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.S (INX,X)=$G(@INV@("PID26"))
.I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
.S @INV@("PID26")=$G(X)
.I '$D(X) D ERROR^INHS("Variable 'PID26' failed input transform. Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
.K DXS
.Q
;IF $D(@INV@("NK11"))
I $D(@INV@("NK11"))
D:$T
.S INI(1)=0 F S INI(1)=$O(@INV@("NK12",INI(1))) Q:'INI(1) S INI=INI(1) D
..S (INX,X)=@INV@("NK12",INI(1))
..S:X]"" X=$$HLPN^INHUT(X,INSUBDEL,INDELIMS,$P($G(INTHL7F2),U,4),"I")
..S @INV@("NK12",INI(1))=$G(X) I '$D(X) D ERROR^INHS("Variable 'NK12' failed input transform in iteration #"_INI(1)_". Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
..Q
.K DXS
.S INI(1)=0 F S INI(1)=$O(@INV@("NK13",INI(1))) Q:'INI(1) S INI=INI(1) D
..S (INX,X)=@INV@("NK13",INI(1))
..I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
..S @INV@("NK13",INI(1))=$G(X) I '$D(X) D ERROR^INHS("Variable 'NK13' failed input transform in iteration #"_INI(1)_". Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
..Q
.K DXS
.S INI(1)=0 F S INI(1)=$O(@INV@("NK14",INI(1))) Q:'INI(1) S INI=INI(1) D
..S (INX,X)=@INV@("NK14",INI(1))
..I $L(X) S:$P(X,INSUBDEL,4)="" $P(X,INSUBDEL,4)=INSUBDEL
..S @INV@("NK14",INI(1))=$G(X) I '$D(X) D ERROR^INHS("Variable 'NK14' failed input transform in iteration #"_INI(1)_". Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
..Q
.K DXS
.S INI(1)=0 F S INI(1)=$O(@INV@("NK15",INI(1))) Q:'INI(1) S INI=INI(1) D
..S (INX,X)=@INV@("NK15",INI(1))
..I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
..S @INV@("NK15",INI(1))=$G(X) I '$D(X) D ERROR^INHS("Variable 'NK15' failed input transform in iteration #"_INI(1)_". Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
..Q
.K DXS
.S INI(1)=0 F S INI(1)=$O(@INV@("NK17",INI(1))) Q:'INI(1) S INI=INI(1) D
..S (INX,X)=@INV@("NK17",INI(1))
..I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
..S @INV@("NK17",INI(1))=$G(X) I '$D(X) D ERROR^INHS("Variable 'NK17' failed input transform in iteration #"_INI(1)_". Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
..Q
.K DXS
.S INI(1)=0 F S INI(1)=$O(@INV@("NK113",INI(1))) Q:'INI(1) S INI=INI(1) D
..S (INX,X)=@INV@("NK113",INI(1))
..I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
..S @INV@("NK113",INI(1))=$G(X) I '$D(X) D ERROR^INHS("Variable 'NK113' failed input transform in iteration #"_INI(1)_". Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
..Q
.K DXS
.Q
;IF $D(@INV@("ORC1"))
I $D(@INV@("ORC1"))
D:$T
.S INI(1)=0 F S INI(1)=$O(@INV@("ORC5",INI(1))) Q:'INI(1) S INI=INI(1) D
..S (INX,X)=@INV@("ORC5",INI(1))
..I $P($G(INTHL7F2),U,4) S X=$$SUBESC^INHUT7(X,INDELIMS,"I")
..S @INV@("ORC5",INI(1))=$G(X) I '$D(X) D ERROR^INHS("Variable 'ORC5' failed input transform in iteration #"_INI(1)_". Processing continues.",0),ERROR^INHS(" Value = '"_INX_"'",0)
..Q
.K DXS
.S INI(1)=0 F S INI(1)=$O(@INV@("ORC9",INI(1))) Q:'INI(1) S INI=INI(1) D
9 ..D EN^IS00010A
.D H2^IS00010A
G H1^IS00010A
IS00010(UIF,INOA,INODA) ;Compiled from script 'Generated: HL IHS IZV04 IN-I' on AUG 15, 2018
+1 ;Part 1
+2 ;Copyright 2018 SAIC
EN SET X="ERROR^IS00010"
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="12425"
+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("EVN",0)=0
+15 SET INDEFSEG("PID",0)=0
+16 SET INDEFSEG("NK1",1)=1
+17 SET INDEFSEG("ORC",1)=1
+18 SET INDEFSEG("RXA",1)=0
+19 ;Start of GROUP
+20 FOR
SET MATCH=0
Begin DoDot:1
+21 IF 'INVS
DO MC^INHS
+22 DO GET^INHOU(UIF,0)
SET LINE=$GET(LINE)
SET DO=0
+23 IF 'MATCH
IF LINE?1"M"1"S"1"H".ANPC
SET DO=1
SET MATCH=1
+24 IF '$TEST
SET LCT=LCT-CNT
SET DO=0
+25 IF DO
SET @("@INV@(""MSH1"")")=$EXTRACT($GET(LINE),4)
+26 IF DO
SET @("@INV@(""MSH2"")")=$$PIECE^INHU(.LINE,DELIM,2)
+27 IF DO
SET @("@INV@(""MSH3"")")=$$PIECE^INHU(.LINE,DELIM,3)
+28 IF DO
SET @("@INV@(""MSH4"")")=$$PIECE^INHU(.LINE,DELIM,4)
+29 IF DO
SET @("@INV@(""MSH5"")")=$$PIECE^INHU(.LINE,DELIM,5)
+30 IF DO
SET @("@INV@(""MSH6"")")=$$PIECE^INHU(.LINE,DELIM,6)
+31 IF DO
SET @("@INV@(""MSH7"")")=$$PIECE^INHU(.LINE,DELIM,7)
+32 IF DO
SET @("@INV@(""MSH8"")")=$$PIECE^INHU(.LINE,DELIM,8)
+33 IF DO
SET @("@INV@(""MSH9"")")=$$PIECE^INHU(.LINE,DELIM,9)
+34 IF DO
SET @("@INV@(""MSH10"")")=$$PIECE^INHU(.LINE,DELIM,10)
+35 IF DO
SET @("@INV@(""MSH11"")")=$$PIECE^INHU(.LINE,DELIM,11)
+36 IF DO
SET @("@INV@(""MSH12"")")=$$PIECE^INHU(.LINE,DELIM,12)
+37 IF DO
SET @("@INV@(""MSH13"")")=$$PIECE^INHU(.LINE,DELIM,13)
+38 IF DO
SET @("@INV@(""MSH14"")")=$$PIECE^INHU(.LINE,DELIM,14)
+39 IF DO
SET @("@INV@(""MSH15"")")=$$PIECE^INHU(.LINE,DELIM,15)
+40 IF DO
SET @("@INV@(""MSH16"")")=$$PIECE^INHU(.LINE,DELIM,16)
+41 IF DO
SET @("@INV@(""MSH17"")")=$$PIECE^INHU(.LINE,DELIM,17)
+42 IF MATCH
QUIT
+43 IF 'INVS
DO MC^INHS
+44 DO GET^INHOU(UIF,0)
SET LINE=$GET(LINE)
SET DO=0
+45 IF 'MATCH
IF LINE?1"E"1"V"1"N".ANPC
SET DO=1
SET MATCH=1
+46 IF '$TEST
SET LCT=LCT-CNT
SET DO=0
+47 IF DO
SET @("@INV@(""EVN1"")")=$$PIECE^INHU(.LINE,DELIM,2)
+48 IF DO
SET @("@INV@(""EVN2"")")=$$PIECE^INHU(.LINE,DELIM,3)
+49 IF MATCH
QUIT
+50 IF 'INVS
DO MC^INHS
+51 DO GET^INHOU(UIF,0)
SET LINE=$GET(LINE)
SET DO=0
+52 IF 'MATCH
IF LINE?1"P"1"I"1"D".ANPC
SET DO=1
SET MATCH=1
+53 IF '$TEST
SET LCT=LCT-CNT
SET DO=0
+54 IF DO
SET @("@INV@(""PID3"")")=$$PIECE^INHU(.LINE,DELIM,4)
+55 IF DO
SET @("@INV@(""PID4"")")=$$PIECE^INHU(.LINE,DELIM,5)
+56 IF DO
SET @("@INV@(""PID5"")")=$$PIECE^INHU(.LINE,DELIM,6)
+57 IF DO
SET @("@INV@(""PID6"")")=$$PIECE^INHU(.LINE,DELIM,7)
+58 IF DO
SET @("@INV@(""PID7"")")=$$PIECE^INHU(.LINE,DELIM,8)
+59 IF DO
SET @("@INV@(""PID8"")")=$$PIECE^INHU(.LINE,DELIM,9)
+60 IF DO
SET @("@INV@(""PID11"")")=$$PIECE^INHU(.LINE,DELIM,12)
+61 IF DO
SET @("@INV@(""PID12"")")=$$PIECE^INHU(.LINE,DELIM,13)
+62 IF DO
SET @("@INV@(""PID13"")")=$$PIECE^INHU(.LINE,DELIM,14)
+63 IF DO
SET @("@INV@(""PID14"")")=$$PIECE^INHU(.LINE,DELIM,15)
+64 IF DO
SET @("@INV@(""PID17"")")=$$PIECE^INHU(.LINE,DELIM,18)
+65 IF DO
SET @("@INV@(""PID18"")")=$$PIECE^INHU(.LINE,DELIM,19)
+66 IF DO
SET @("@INV@(""PID19"")")=$$PIECE^INHU(.LINE,DELIM,20)
+67 IF DO
SET @("@INV@(""PID26"")")=$$PIECE^INHU(.LINE,DELIM,27)
+68 IF MATCH
QUIT
+69 QUIT
End DoDot:1
IF 'MATCH
QUIT
+70 ;WHILE $P(DATA,DELIM)="NK1"
+71 SET INI(1)=1
FOR
SET DATA=$$GL^INHOU(UIF,LCT)
IF '$$CHECKSEG^INHOU("NK1",0,1)
QUIT
Begin DoDot:1
+72 IF 'INVS
DO MC^INHS
+73 DO GET^INHOU(UIF,0)
SET LINE=$GET(LINE)
SET DO=1
+74 IF DO
SET @("@INV@(""NK11"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,2)
+75 IF DO
SET @("@INV@(""NK12"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,3)
+76 IF DO
SET @("@INV@(""NK13"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,4)
+77 IF DO
SET @("@INV@(""NK14"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,5)
+78 IF DO
SET @("@INV@(""NK15"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,6)
+79 IF DO
SET @("@INV@(""NK17"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,8)
+80 IF DO
SET @("@INV@(""NK113"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,14)
+81 QUIT
End DoDot:1
SET INI(1)=INI(1)+1
+82 ;WHILE $P(DATA,DELIM)="ORC"
+83 SET INI(1)=1
FOR
SET DATA=$$GL^INHOU(UIF,LCT)
IF '$$CHECKSEG^INHOU("ORC",0,1)
QUIT
Begin DoDot:1
+84 IF 'INVS
DO MC^INHS
+85 DO GET^INHOU(UIF,0)
SET LINE=$GET(LINE)
SET DO=1
+86 IF DO
SET @("@INV@(""ORC1"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,2)
+87 IF DO
SET @("@INV@(""ORC2"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,3)
+88 IF DO
SET @("@INV@(""ORC3"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,4)
+89 IF DO
SET @("@INV@(""ORC5"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,6)
+90 IF DO
SET @("@INV@(""ORC7"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,8)
+91 IF DO
SET @("@INV@(""ORC9"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,10)
+92 IF DO
SET @("@INV@(""ORC12"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,13)
+93 IF DO
SET @("@INV@(""ORC15"",INI(1))")=$$PIECE^INHU(.LINE,DELIM,16)
+94 IF 'INVS
DO MC^INHS
+95 DO GET^INHOU(UIF,0)
SET LINE=$GET(LINE)
SET DO=1
+96 IF LINE?1"R"1"X"1"A".ANPC
SET DO=1
+97 IF '$TEST
SET LCT=LCT-CNT
SET DO=0
+98 QUIT
End DoDot:1
SET INI(1)=INI(1)+1
+99 IF 'INVS
DO MC^INHS
+100 ;Entering TRANS section.
+101 ;IF $D(@INV@("MSH1"))
+102 IF $DATA(@INV@("MSH1"))
+103 IF $TEST
Begin DoDot:1
+104 SET (INX,X)=$GET(@INV@("MSH1"))
+105 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+106 SET @INV@("MSH1")=$GET(X)
+107 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH1' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+108 KILL DXS
+109 SET (INX,X)=$GET(@INV@("MSH2"))
+110 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+111 SET @INV@("MSH2")=$GET(X)
+112 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH2' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+113 KILL DXS
+114 SET (INX,X)=$GET(@INV@("MSH3"))
+115 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+116 SET @INV@("MSH3")=$GET(X)
+117 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH3' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+118 KILL DXS
+119 SET (INX,X)=$GET(@INV@("MSH4"))
+120 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+121 SET @INV@("MSH4")=$GET(X)
+122 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH4' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+123 KILL DXS
+124 SET (INX,X)=$GET(@INV@("MSH5"))
+125 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+126 SET @INV@("MSH5")=$GET(X)
+127 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH5' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+128 KILL DXS
+129 SET (INX,X)=$GET(@INV@("MSH6"))
+130 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+131 SET @INV@("MSH6")=$GET(X)
+132 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH6' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+133 KILL DXS
+134 SET (INX,X)=$GET(@INV@("MSH7"))
+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@("MSH7")=$GET(X)
+137 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH7' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+138 KILL DXS
+139 SET (INX,X)=$GET(@INV@("MSH8"))
+140 IF X]""
SET X=$$TIMEIO^INHUT10(X,$PIECE($GET(INTHL7F2),U),$PIECE($GET(INTHL7F2),U,2),$PIECE($GET(INTHL7F2),U,3),1)
+141 SET @INV@("MSH8")=$GET(X)
+142 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH8' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+143 KILL DXS
+144 SET (INX,X)=$GET(@INV@("MSH10"))
+145 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+146 SET @INV@("MSH10")=$GET(X)
+147 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH10' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+148 KILL DXS
+149 SET (INX,X)=$GET(@INV@("MSH12"))
+150 IF $LENGTH(X)
SET X=+X
+151 SET @INV@("MSH12")=$GET(X)
+152 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH12' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+153 KILL DXS
+154 SET (INX,X)=$GET(@INV@("MSH13"))
+155 IF $LENGTH(X)
SET X=+X
+156 SET @INV@("MSH13")=$GET(X)
+157 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH13' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+158 KILL DXS
+159 SET (INX,X)=$GET(@INV@("MSH14"))
+160 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+161 SET @INV@("MSH14")=$GET(X)
+162 IF '$DATA(X)
DO ERROR^INHS("Variable 'MSH14' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+163 KILL DXS
+164 QUIT
End DoDot:1
+165 ;IF $D(@INV@("EVN1"))
+166 IF $DATA(@INV@("EVN1"))
+167 IF $TEST
Begin DoDot:1
+168 SET (INX,X)=$GET(@INV@("EVN1"))
+169 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+170 SET @INV@("EVN1")=$GET(X)
+171 IF '$DATA(X)
DO ERROR^INHS("Variable 'EVN1' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+172 KILL DXS
+173 SET (INX,X)=$GET(@INV@("EVN2"))
+174 IF X]""
SET X=$$TIMEIO^INHUT10(X,$PIECE($GET(INTHL7F2),U),$PIECE($GET(INTHL7F2),U,2),$PIECE($GET(INTHL7F2),U,3),1)
+175 SET @INV@("EVN2")=$GET(X)
+176 IF '$DATA(X)
DO ERROR^INHS("Variable 'EVN2' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+177 KILL DXS
+178 QUIT
End DoDot:1
+179 ;IF $D(@INV@("PID1"))
+180 IF $DATA(@INV@("PID1"))
+181 IF $TEST
Begin DoDot:1
+182 SET (INX,X)=$GET(@INV@("PID3"))
+183 IF X]""
SET X=$$HLPN^INHUT(X,INSUBDEL,INDELIMS,$PIECE($GET(INTHL7F2),U,4),"I")
+184 SET @INV@("PID3")=$GET(X)
+185 IF '$DATA(X)
DO ERROR^INHS("Variable 'PID3' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+186 KILL DXS
+187 SET (INX,X)=$GET(@INV@("PID4"))
+188 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+189 SET @INV@("PID4")=$GET(X)
+190 IF '$DATA(X)
DO ERROR^INHS("Variable 'PID4' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+191 KILL DXS
+192 SET (INX,X)=$GET(@INV@("PID5"))
+193 IF X]""
SET X=$$HLPN^INHUT(X,INSUBDEL,INDELIMS,$PIECE($GET(INTHL7F2),U,4),"I")
+194 SET @INV@("PID5")=$GET(X)
+195 IF '$DATA(X)
DO ERROR^INHS("Variable 'PID5' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+196 KILL DXS
+197 SET (INX,X)=$GET(@INV@("PID6"))
+198 IF X]""
SET X=$$HLPN^INHUT(X,INSUBDEL,INDELIMS,$PIECE($GET(INTHL7F2),U,4),"I")
+199 SET @INV@("PID6")=$GET(X)
+200 IF '$DATA(X)
DO ERROR^INHS("Variable 'PID6' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+201 KILL DXS
+202 SET (INX,X)=$GET(@INV@("PID7"))
+203 IF X]""
SET X=$EXTRACT(X,1,4)-1700_$EXTRACT(X,5,8)
+204 SET @INV@("PID7")=$GET(X)
+205 IF '$DATA(X)
DO ERROR^INHS("Variable 'PID7' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+206 KILL DXS
+207 SET (INX,X)=$GET(@INV@("PID11"))
+208 IF $LENGTH(X)
IF $PIECE(X,INSUBDEL,4)=""
SET $PIECE(X,INSUBDEL,4)=INSUBDEL
+209 SET @INV@("PID11")=$GET(X)
+210 IF '$DATA(X)
DO ERROR^INHS("Variable 'PID11' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+211 KILL DXS
+212 SET (INX,X)=$GET(@INV@("PID13"))
+213 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+214 SET @INV@("PID13")=$GET(X)
+215 IF '$DATA(X)
DO ERROR^INHS("Variable 'PID13' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+216 KILL DXS
+217 SET (INX,X)=$GET(@INV@("PID14"))
+218 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+219 SET @INV@("PID14")=$GET(X)
+220 IF '$DATA(X)
DO ERROR^INHS("Variable 'PID14' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+221 KILL DXS
+222 SET (INX,X)=$GET(@INV@("PID17"))
+223 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+224 SET @INV@("PID17")=$GET(X)
+225 IF '$DATA(X)
DO ERROR^INHS("Variable 'PID17' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+226 KILL DXS
+227 SET (INX,X)=$GET(@INV@("PID19"))
+228 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+229 SET @INV@("PID19")=$GET(X)
+230 IF '$DATA(X)
DO ERROR^INHS("Variable 'PID19' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+231 KILL DXS
+232 SET (INX,X)=$GET(@INV@("PID26"))
+233 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+234 SET @INV@("PID26")=$GET(X)
+235 IF '$DATA(X)
DO ERROR^INHS("Variable 'PID26' failed input transform. Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+236 KILL DXS
+237 QUIT
End DoDot:1
+238 ;IF $D(@INV@("NK11"))
+239 IF $DATA(@INV@("NK11"))
+240 IF $TEST
Begin DoDot:1
+241 SET INI(1)=0
FOR
SET INI(1)=$ORDER(@INV@("NK12",INI(1)))
IF 'INI(1)
QUIT
SET INI=INI(1)
Begin DoDot:2
+242 SET (INX,X)=@INV@("NK12",INI(1))
+243 IF X]""
SET X=$$HLPN^INHUT(X,INSUBDEL,INDELIMS,$PIECE($GET(INTHL7F2),U,4),"I")
+244 SET @INV@("NK12",INI(1))=$GET(X)
IF '$DATA(X)
DO ERROR^INHS("Variable 'NK12' failed input transform in iteration #"_INI(1)_". Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+245 QUIT
End DoDot:2
+246 KILL DXS
+247 SET INI(1)=0
FOR
SET INI(1)=$ORDER(@INV@("NK13",INI(1)))
IF 'INI(1)
QUIT
SET INI=INI(1)
Begin DoDot:2
+248 SET (INX,X)=@INV@("NK13",INI(1))
+249 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+250 SET @INV@("NK13",INI(1))=$GET(X)
IF '$DATA(X)
DO ERROR^INHS("Variable 'NK13' failed input transform in iteration #"_INI(1)_". Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+251 QUIT
End DoDot:2
+252 KILL DXS
+253 SET INI(1)=0
FOR
SET INI(1)=$ORDER(@INV@("NK14",INI(1)))
IF 'INI(1)
QUIT
SET INI=INI(1)
Begin DoDot:2
+254 SET (INX,X)=@INV@("NK14",INI(1))
+255 IF $LENGTH(X)
IF $PIECE(X,INSUBDEL,4)=""
SET $PIECE(X,INSUBDEL,4)=INSUBDEL
+256 SET @INV@("NK14",INI(1))=$GET(X)
IF '$DATA(X)
DO ERROR^INHS("Variable 'NK14' failed input transform in iteration #"_INI(1)_". Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+257 QUIT
End DoDot:2
+258 KILL DXS
+259 SET INI(1)=0
FOR
SET INI(1)=$ORDER(@INV@("NK15",INI(1)))
IF 'INI(1)
QUIT
SET INI=INI(1)
Begin DoDot:2
+260 SET (INX,X)=@INV@("NK15",INI(1))
+261 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+262 SET @INV@("NK15",INI(1))=$GET(X)
IF '$DATA(X)
DO ERROR^INHS("Variable 'NK15' failed input transform in iteration #"_INI(1)_". Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+263 QUIT
End DoDot:2
+264 KILL DXS
+265 SET INI(1)=0
FOR
SET INI(1)=$ORDER(@INV@("NK17",INI(1)))
IF 'INI(1)
QUIT
SET INI=INI(1)
Begin DoDot:2
+266 SET (INX,X)=@INV@("NK17",INI(1))
+267 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+268 SET @INV@("NK17",INI(1))=$GET(X)
IF '$DATA(X)
DO ERROR^INHS("Variable 'NK17' failed input transform in iteration #"_INI(1)_". Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+269 QUIT
End DoDot:2
+270 KILL DXS
+271 SET INI(1)=0
FOR
SET INI(1)=$ORDER(@INV@("NK113",INI(1)))
IF 'INI(1)
QUIT
SET INI=INI(1)
Begin DoDot:2
+272 SET (INX,X)=@INV@("NK113",INI(1))
+273 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+274 SET @INV@("NK113",INI(1))=$GET(X)
IF '$DATA(X)
DO ERROR^INHS("Variable 'NK113' failed input transform in iteration #"_INI(1)_". Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+275 QUIT
End DoDot:2
+276 KILL DXS
+277 QUIT
End DoDot:1
+278 ;IF $D(@INV@("ORC1"))
+279 IF $DATA(@INV@("ORC1"))
+280 IF $TEST
Begin DoDot:1
+281 SET INI(1)=0
FOR
SET INI(1)=$ORDER(@INV@("ORC5",INI(1)))
IF 'INI(1)
QUIT
SET INI=INI(1)
Begin DoDot:2
+282 SET (INX,X)=@INV@("ORC5",INI(1))
+283 IF $PIECE($GET(INTHL7F2),U,4)
SET X=$$SUBESC^INHUT7(X,INDELIMS,"I")
+284 SET @INV@("ORC5",INI(1))=$GET(X)
IF '$DATA(X)
DO ERROR^INHS("Variable 'ORC5' failed input transform in iteration #"_INI(1)_". Processing continues.",0)
DO ERROR^INHS(" Value = '"_INX_"'",0)
+285 QUIT
End DoDot:2
+286 KILL DXS
+287 SET INI(1)=0
FOR
SET INI(1)=$ORDER(@INV@("ORC9",INI(1)))
IF 'INI(1)
QUIT
SET INI=INI(1)
Begin DoDot:2
9 DO EN^IS00010A
End DoDot:2
+1 DO H2^IS00010A
End DoDot:1
+2 GOTO H1^IS00010A