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