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