IS00029(INTT,INDA,INA,INDEST,INQUE,INORDUZ,INORDIV) ;Compiled from script 'Generated: HL IHS IZV04 V03VXR OUT-O' on AUG 15, 2018
;Part 1
;Copyright 2018 SAIC
EN S X="ERROR^IS00029",@^%ZOSF("TRAP")
G START
ERROR ;
S X="",@^%ZOSF("TRAP") X ^INTHOS(1,3) D ERROR^INHS($$GETERR^%ZTOS)
Q 2
START ;Initialize variables
K ^UTILITY("INH",$J) S (MESSID,INA("MESSID"))=$$MESSID^INHD
K INUIF6 M INUIF6=INDA
K INREQERR,INHERR,INHERCNT,INV D SETDT^UTDT S DUZ(0)="@",DUZ("AG")="^1",DTIME=1 S (LCT,GERR)=0,INMODE="O",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="12445"
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()
S INDELIMS=$$FIELD^INHUT_$$COMP^INHUT_$$REP^INHUT_$$ESC^INHUT_$$SUBCOMP^INHUT
;Entering MUMPS section.
D VST^BHLV,INS^BHLIN1
;Entering DATA section.
S DELIM="|"
S SUBDELIM="^"
SET INSETID=0
D ^BHLMSH
;SET MSH1 = INSGX\^INTHL7FT(1,3)\\4\@ENC
S D0=INDA S X=$G(INA("ENC"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,4)
S @INV@("MSH1")=X K DXS,D0
;SET MSH2 = INSGX\^INTHL7FT(1,3)\\180\@MSH3
S D0=INDA S X=$G(INA("MSH3"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,180)
S @INV@("MSH2")=X K DXS,D0
;SET MSH3 = INSGX\^INTHL7FT(1,3)\\180\@MSH4
S D0=INDA S X=$G(INA("MSH4"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,180)
S @INV@("MSH3")=X K DXS,D0
;SET MSH4 = INSGX\^INTHL7FT(1,3)\\180\@MSH5
S D0=INDA S X=$G(INA("MSH5"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,180)
S @INV@("MSH4")=X K DXS,D0
;SET MSH5 = INSGX\^INTHL7FT(1,3)\\180\@MSH6
S D0=INDA S X=$G(INA("MSH6"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,180)
S @INV@("MSH5")=X K DXS,D0
;SET MSH6 = INSGX\^INTHL7FT(1,3)\\20\@MSH7
S D0=INDA S X=$G(INA("MSH7"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,20)
S @INV@("MSH6")=X K DXS,D0
;SET MSH7 = INSGX\^INTHL7FT(1,3)\\20\@MSH8
S D0=INDA S X=$G(INA("MSH8"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,20)
S @INV@("MSH7")=X K DXS,D0
;SET MSH8 = INSGX\^INTHL7FT(1,3)\\50\@MSH9
S D0=INDA S X=$G(INA("MSH9"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,50)
S @INV@("MSH8")=X K DXS,D0
;SET MSH9 = INSGX\^INTHL7FT(1,3)\\20\@MSH10
S D0=INDA S X=$G(INA("MSH10"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,20)
S @INV@("MSH9")=X K DXS,D0
;SET MSH10 = $E(INTERNAL(@PRID),1,1)
S D0=INDA S X=$G(INA("PRID")),X=X S X=X,Y(1)=$G(X) S X=1,Y(2)=$G(X) S X=1,X=$E(Y(1),Y(2),X)
S @INV@("MSH10")=X K DXS,D0
;SET MSH11 = @MSH12
S D0=INDA S X=$G(INA("MSH12"))
S @INV@("MSH11")=X K DXS,D0
;SET MSH12 = ""
S D0=INDA S X=""
S @INV@("MSH12")=X K DXS,D0
;SET MSH13 = ""
S D0=INDA S X=""
S @INV@("MSH13")=X K DXS,D0
;SET MSH14 = $E(INTERNAL(@ACA),1,2)
S D0=INDA S X=$G(INA("ACA")),X=X S X=X,Y(1)=$G(X) S X=1,Y(2)=$G(X) S X=2,X=$E(Y(1),Y(2),X)
S @INV@("MSH14")=X K DXS,D0
;SET MSH15 = $E(INTERNAL(@APA),1,2)
S D0=INDA S X=$G(INA("APA")),X=X S X=X,Y(1)=$G(X) S X=1,Y(2)=$G(X) S X=2,X=$E(Y(1),Y(2),X)
S @INV@("MSH15")=X K DXS,D0
;SET MSH16 = INSGX\^INTHL7FT(1,3)\\3\"USA"
S D0=INDA S X="USA"
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,3)
S @INV@("MSH16")=X K DXS,D0
D:'INVS MC^INHS
K LINE S LINE="",CP=0 S L1="MSH" S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,1,L1,.CP) S L1=$G(@INV@("MSH1")) S:$TR(L1,$G(SUBDELIM))="" L1=""
D SETPIECE^INHU(.LINE,DELIM,2,L1,.CP) S L1=$G(@INV@("MSH2")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,3,L1,.CP) S L1=$G(@INV@("MSH3"))
S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,4,L1,.CP) S L1=$G(@INV@("MSH4")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,5,L1,.CP)
S L1=$G(@INV@("MSH5")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,6,L1,.CP) S L1=$G(@INV@("MSH6")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,7,L1,.CP)
S L1=$G(@INV@("MSH7")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,8,L1,.CP) S L1=$G(@INV@("MSH8")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,9,L1,.CP)
S L1=$G(@INV@("MSH9")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,10,L1,.CP) S L1=$G(@INV@("MSH10")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,11,L1,.CP)
S D0=INDA S X=@INV@("MSH11"),Y(1)=$G(X) S X=1,Y(2)=$G(X) S X=10,X=$E(Y(1),Y(2),X) S L1=X
S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,12,L1,.CP) S L1=$G(@INV@("MSH12")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,13,L1,.CP)
S L1=$G(@INV@("MSH13")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,14,L1,.CP) S L1=$G(@INV@("MSH14")) S:$TR(L1,$G(SUBDELIM))="" L1=""
D SETPIECE^INHU(.LINE,DELIM,15,L1,.CP) S L1=$G(@INV@("MSH15")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,16,L1,.CP) S L1=$G(@INV@("MSH16"))
S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,17,L1,.CP)
S LCT=LCT+1,^UTILITY("INH",$J,LCT)=LINE I $D(LINE)>9 M ^UTILITY("INH",$J,LCT)=LINE
SET INSETID=0
;SET MSA1 = INSGX\^INTHL7FT(1,3)\\2\@INSTAT
S D0=INDA S X=$G(INA("INSTAT"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,2)
S @INV@("MSA1")=X K DXS,D0
;SET MSA2 = INSGX\^INTHL7FT(1,3)\\20\@INORIGID
S D0=INDA S X=$G(INA("INORIGID"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,20)
S @INV@("MSA2")=X K DXS,D0
;SET MSA3 = INSGX\^INTHL7FT(1,3)\\80\@INACKTXT
S D0=INDA S X=$G(INA("INACKTXT"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,80)
S @INV@("MSA3")=X K DXS,D0
;SET MSA4 = INSGX\^INTHL7FT(1,3)\\15\@INEXPSEQ
S D0=INDA S X=$G(INA("INEXPSEQ"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,15)
S @INV@("MSA4")=X K DXS,D0
;SET MSA5 = INSGX\^INTHL7FT(1,3)\\1\@INDELAY
S D0=INDA S X=$G(INA("INDELAY"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,1)
S @INV@("MSA5")=X K DXS,D0
;SET MSA6 = INSGX\^INTHL7FT(1,3)\\100\@INACKERR
S D0=INDA S X=$G(INA("INACKERR"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,100)
S @INV@("MSA6")=X K DXS,D0
D:'INVS MC^INHS
K LINE S LINE="",CP=0 S L1="MSA" S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,1,L1,.CP) S L1=$G(@INV@("MSA1")) S:$TR(L1,$G(SUBDELIM))="" L1=""
D SETPIECE^INHU(.LINE,DELIM,2,L1,.CP) S L1=$G(@INV@("MSA2")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,3,L1,.CP) S L1=$G(@INV@("MSA3"))
S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,4,L1,.CP) S L1=$G(@INV@("MSA4")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,5,L1,.CP)
S L1=$G(@INV@("MSA5")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,6,L1,.CP) S L1=$G(@INV@("MSA6")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,7,L1,.CP)
S LCT=LCT+1,^UTILITY("INH",$J,LCT)=LINE I $D(LINE)>9 M ^UTILITY("INH",$J,LCT)=LINE
SET INSETID=0
;SET QRD1 = INSGX\^INTHL7FT(1,3)\\26\@QRD1
S D0=INDA S X=$G(INA("QRD1"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,26)
S @INV@("QRD1")=X K DXS,D0
;SET QRD2 = INSGX\^INTHL7FT(1,3)\\1\"R"
S D0=INDA S X="R"
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,1)
S @INV@("QRD2")=X K DXS,D0
;SET QRD3 = INSGX\^INTHL7FT(1,3)\\1\"I"
S D0=INDA S X="I"
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,1)
S @INV@("QRD3")=X K DXS,D0
;SET QRD4 = INSGX\^INTHL7FT(1,3)\\100\@QRD4
S D0=INDA S X=$G(INA("QRD4"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,100)
S @INV@("QRD4")=X K DXS,D0
;SET QRD7 = INSGX\^INTHL7FT(1,3)\\10\@QRD7
S D0=INDA S X=$G(INA("QRD7"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,10)
S @INV@("QRD7")=X K DXS,D0
;SET QRD8 = @QRD8
S D0=INDA S X=$G(INA("QRD8"))
S @INV@("QRD8")=X K DXS,D0
;SET QRD9 = INSGX\^INTHL7FT(1,3)\\60\@QRD9
S D0=INDA S X=$G(INA("QRD9"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,60)
S @INV@("QRD9")=X K DXS,D0
;SET QRD10 = INSGX\^INTHL7FT(17,3)\\60\@QRD10
S D0=INDA S X=$G(INA("QRD10"))
S X1="^INTHL7FT(17,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,60)
S @INV@("QRD10")=X K DXS,D0
;SET QRD12 = INSGX\^INTHL7FT(1,3)\\1\"T"
S D0=INDA S X="T"
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,1)
S @INV@("QRD12")=X K DXS,D0
D:'INVS MC^INHS
K LINE S LINE="",CP=0 S L1="QRD" S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,1,L1,.CP) S L1=$G(@INV@("QRD1")) S:$TR(L1,$G(SUBDELIM))="" L1=""
D SETPIECE^INHU(.LINE,DELIM,2,L1,.CP) S L1=$G(@INV@("QRD2")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,3,L1,.CP) S L1=$G(@INV@("QRD3"))
S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,4,L1,.CP) S L1=$G(@INV@("QRD4")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,5,L1,.CP)
S L1=$G(@INV@("QRD7")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,8,L1,.CP)
S D0=INDA S X=@INV@("QRD8"),Y(1)=$G(X) S X=1,Y(2)=$G(X) S X=100,X=$E(Y(1),Y(2),X) S L1=X
S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,9,L1,.CP) S L1=$G(@INV@("QRD9")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,10,L1,.CP)
S L1=$G(@INV@("QRD10")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,11,L1,.CP) S L1=$G(@INV@("QRD12")) S:$TR(L1,$G(SUBDELIM))="" L1=""
D SETPIECE^INHU(.LINE,DELIM,13,L1,.CP)
S LCT=LCT+1,^UTILITY("INH",$J,LCT)=LINE I $D(LINE)>9 M ^UTILITY("INH",$J,LCT)=LINE
SET INSETID=0
;SET QRF1 = INSGX\^INTHL7FT(1,3)\\20\@QRF1
S D0=INDA S X=$G(INA("QRF1"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,20)
S @INV@("QRF1")=X K DXS,D0
;SET QRF5 = INSGX\^INTHL7FT(1,3)\\240\@QRF5
S D0=INDA S X=$G(INA("QRF5"))
S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,240)
S @INV@("QRF5")=X K DXS,D0
D:'INVS MC^INHS
K LINE S LINE="",CP=0 S L1="QRF" S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,1,L1,.CP) S L1=$G(@INV@("QRF1")) S:$TR(L1,$G(SUBDELIM))="" L1=""
D SETPIECE^INHU(.LINE,DELIM,2,L1,.CP) S L1=$G(@INV@("QRF5")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,6,L1,.CP)
S LCT=LCT+1,^UTILITY("INH",$J,LCT)=LINE I $D(LINE)>9 M ^UTILITY("INH",$J,LCT)=LINE
SET INSETID=0
S INDA0=INDA,INI(1)=0 F S INI(1)=$O(INDA(2,INI(1))) Q:'INI(1) S INDA=$S(INDA(2,INI(1)):INDA(2,INI(1)),1:INI(1)) D
.Q:'$D(^DPT(INDA,0))
.D ^BHLPID
.;SET PID1 = INSGX\^INTHL7FT(11,3)\\4\"PID"
.S D0=INDA S X="PID"
.S X1="^INTHL7FT(11,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,4)
.S @INV@("PID1")=X K DXS,D0
.;SET PID3 = INSGX\^INTHL7FT(1,3)\\250\@PID3
.S D0=INDA S X=$G(INA("PID3",INI(1)))
.S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,250)
.S @INV@("PID3")=X K DXS,D0
.;SET PID5 = INSGX\^INTHL7FT(7,3)\\250\@PID5
.S D0=INDA S X=$G(INA("PID5",INI(1)))
.S X1="^INTHL7FT(7,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,250)
.S @INV@("PID5")=X K DXS,D0
.;SET PID6 = INSGX\^INTHL7FT(1,3)\\99\@PID6
.S D0=INDA S X=$G(INA("PID6",INI(1)))
.S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,99)
.S @INV@("PID6")=X K DXS,D0
.;SET PID7 = INSGX\^INTHL7FT(1,3)\\8\@PID7
.S D0=INDA S X=$G(INA("PID7",INI(1)))
.S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,8)
.S @INV@("PID7")=X K DXS,D0
.;SET PID8 = $E(INTERNAL(SEX),1,1)
.S D0=INDA S Y(1)=$S($D(^DPT(D0,0)):^(0),1:"") S X=$P(Y(1),U,2),X=X S X=X,Y(2)=$G(X) S X=1,Y(3)=$G(X) S X=1,X=$E(Y(2),Y(3),X)
.S @INV@("PID8")=X K DXS,D0
.;SET PID10 = INSGX\^INTHL7FT(1,3)\\99\@PID10
.S D0=INDA S X=$G(INA("PID10",INI(1)))
.S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,99)
.S @INV@("PID10")=X K DXS,D0
.;SET PID11 = INSGX\^INTHL7FT(1,3)\\250\@PID11
.S D0=INDA S X=$G(INA("PID11",INI(1)))
.S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,250)
.S @INV@("PID11")=X K DXS,D0
.;SET PID12 = $E(INTERNAL(#.117),1,4)
.S D0=INDA S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,7),X=X S X=X,Y(2)=$G(X) S X=1,Y(3)=$G(X) S X=4,X=$E(Y(2),Y(3),X)
.S @INV@("PID12")=X K DXS,D0
.;SET PID13 = INSGX\^INTHL7FT(1,3)\\250\@PID13
.S D0=INDA S X=$G(INA("PID13",INI(1)))
.S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,250)
.S @INV@("PID13")=X K DXS,D0
.;SET PID14 = INSGX\^INTHL7FT(1,3)\\250\@PID14
.S D0=INDA S X=$G(INA("PID14",INI(1)))
.S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,250)
.S @INV@("PID14")=X K DXS,D0
.;SET PID17 = INSGX\^INTHL7FT(17,3)\\250\#.08
.S D0=INDA S Y(1)=$S($D(^DPT(D0,0)):^(0),1:"") S X=$P($G(^DIC(13,+$P(Y(1),U,8),0)),U)
.S X1="^INTHL7FT(17,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,250)
.S @INV@("PID17")=X K DXS,D0
.;SET PID19 = INSGX\^INTHL7FT(1,3)\\80\@PID19
.S D0=INDA S X=$G(INA("PID19",INI(1)))
.S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,80)
.S @INV@("PID19")=X K DXS,D0
.;SET PID22 = INSGX\^INTHL7FT(1,3)\\200\@PID22
.S D0=INDA S X=$G(INA("PID22",INI(1)))
.S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,200)
.S @INV@("PID22")=X K DXS,D0
.;SET PID24 = INSGX\^INTHL7FT(1,3)\\10\@PID24
.S D0=INDA S X=$G(INA("PID24",INI(1)))
.S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,10)
.S @INV@("PID24")=X K DXS,D0
.D:'INVS MC^INHS
.K LINE S LINE="",CP=0 S L1="PID" S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,1,L1,.CP) S L1=$G(@INV@("PID1")) S:$TR(L1,$G(SUBDELIM))="" L1=""
.D SETPIECE^INHU(.LINE,DELIM,2,L1,.CP) S L1=$G(@INV@("PID3")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,4,L1,.CP) S L1=$G(@INV@("PID5"))
.S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,6,L1,.CP) S L1=$G(@INV@("PID6")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,7,L1,.CP)
.S L1=$G(@INV@("PID7")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,8,L1,.CP) S L1=$G(@INV@("PID8")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,9,L1,.CP)
.S L1=$G(@INV@("PID10")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,11,L1,.CP) S L1=$G(@INV@("PID11")) S:$TR(L1,$G(SUBDELIM))="" L1=""
.D SETPIECE^INHU(.LINE,DELIM,12,L1,.CP) S L1=$G(@INV@("PID12")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,13,L1,.CP) S L1=$G(@INV@("PID13"))
.S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,14,L1,.CP) S L1=$G(@INV@("PID14")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,15,L1,.CP)
9 .D EN^IS00029A
G A1^IS00029A
IS00029(INTT,INDA,INA,INDEST,INQUE,INORDUZ,INORDIV) ;Compiled from script 'Generated: HL IHS IZV04 V03VXR OUT-O' on AUG 15, 2018
+1 ;Part 1
+2 ;Copyright 2018 SAIC
EN SET X="ERROR^IS00029"
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 ^UTILITY("INH",$JOB)
SET (MESSID,INA("MESSID"))=$$MESSID^INHD
+2 KILL INUIF6
MERGE INUIF6=INDA
+3 KILL INREQERR,INHERR,INHERCNT,INV
DO SETDT^UTDT
SET DUZ(0)="@"
SET DUZ("AG")="^1"
SET DTIME=1
SET (LCT,GERR)=0
SET INMODE="O"
SET INVS=$PIECE(^INRHSITE(1,0),U,12)
SET INV=$SELECT(INVS<2:"INV",1:"^UTILITY(""INV"",$J)")
SET (MULT,INSTERR)=0
+4 SET INHLDUZ=$ORDER(^VA(200,"B","GIS,USER",0))
SET DUZ=$SELECT($GET(INHLDUZ):INHLDUZ,1:.5)
+5 SET BHLMIEN="12445"
+6 IF $GET(^INTHL7M(BHLMIEN,4,1,0))]""
XECUTE $GET(^INTHL7M(BHLMIEN,4,1,0))
+7 KILL INSETID
+8 SET INSMIN=$SELECT($PIECE($GET(^INRHSITE(1,0)),U,14):$PIECE(^(0),U,14),1:2500)
+9 SET (DELIM,INDELIM)=$$FIELD^INHUT()
SET (SUBDELIM,INSUBDEL)=$$COMP^INHUT()
SET INSUBCOM=$$SUBCOMP^INHUT()
+10 SET INDELIMS=$$FIELD^INHUT_$$COMP^INHUT_$$REP^INHUT_$$ESC^INHUT_$$SUBCOMP^INHUT
+11 ;Entering MUMPS section.
+12 DO VST^BHLV
DO INS^BHLIN1
+13 ;Entering DATA section.
+14 SET DELIM="|"
+15 SET SUBDELIM="^"
+16 SET INSETID=0
+17 DO ^BHLMSH
+18 ;SET MSH1 = INSGX\^INTHL7FT(1,3)\\4\@ENC
+19 SET D0=INDA
SET X=$GET(INA("ENC"))
+20 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,4)
+21 SET @INV@("MSH1")=X
KILL DXS,D0
+22 ;SET MSH2 = INSGX\^INTHL7FT(1,3)\\180\@MSH3
+23 SET D0=INDA
SET X=$GET(INA("MSH3"))
+24 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,180)
+25 SET @INV@("MSH2")=X
KILL DXS,D0
+26 ;SET MSH3 = INSGX\^INTHL7FT(1,3)\\180\@MSH4
+27 SET D0=INDA
SET X=$GET(INA("MSH4"))
+28 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,180)
+29 SET @INV@("MSH3")=X
KILL DXS,D0
+30 ;SET MSH4 = INSGX\^INTHL7FT(1,3)\\180\@MSH5
+31 SET D0=INDA
SET X=$GET(INA("MSH5"))
+32 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,180)
+33 SET @INV@("MSH4")=X
KILL DXS,D0
+34 ;SET MSH5 = INSGX\^INTHL7FT(1,3)\\180\@MSH6
+35 SET D0=INDA
SET X=$GET(INA("MSH6"))
+36 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,180)
+37 SET @INV@("MSH5")=X
KILL DXS,D0
+38 ;SET MSH6 = INSGX\^INTHL7FT(1,3)\\20\@MSH7
+39 SET D0=INDA
SET X=$GET(INA("MSH7"))
+40 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,20)
+41 SET @INV@("MSH6")=X
KILL DXS,D0
+42 ;SET MSH7 = INSGX\^INTHL7FT(1,3)\\20\@MSH8
+43 SET D0=INDA
SET X=$GET(INA("MSH8"))
+44 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,20)
+45 SET @INV@("MSH7")=X
KILL DXS,D0
+46 ;SET MSH8 = INSGX\^INTHL7FT(1,3)\\50\@MSH9
+47 SET D0=INDA
SET X=$GET(INA("MSH9"))
+48 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,50)
+49 SET @INV@("MSH8")=X
KILL DXS,D0
+50 ;SET MSH9 = INSGX\^INTHL7FT(1,3)\\20\@MSH10
+51 SET D0=INDA
SET X=$GET(INA("MSH10"))
+52 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,20)
+53 SET @INV@("MSH9")=X
KILL DXS,D0
+54 ;SET MSH10 = $E(INTERNAL(@PRID),1,1)
+55 SET D0=INDA
SET X=$GET(INA("PRID"))
SET X=X
SET X=X
SET Y(1)=$GET(X)
SET X=1
SET Y(2)=$GET(X)
SET X=1
SET X=$EXTRACT(Y(1),Y(2),X)
+56 SET @INV@("MSH10")=X
KILL DXS,D0
+57 ;SET MSH11 = @MSH12
+58 SET D0=INDA
SET X=$GET(INA("MSH12"))
+59 SET @INV@("MSH11")=X
KILL DXS,D0
+60 ;SET MSH12 = ""
+61 SET D0=INDA
SET X=""
+62 SET @INV@("MSH12")=X
KILL DXS,D0
+63 ;SET MSH13 = ""
+64 SET D0=INDA
SET X=""
+65 SET @INV@("MSH13")=X
KILL DXS,D0
+66 ;SET MSH14 = $E(INTERNAL(@ACA),1,2)
+67 SET D0=INDA
SET X=$GET(INA("ACA"))
SET X=X
SET X=X
SET Y(1)=$GET(X)
SET X=1
SET Y(2)=$GET(X)
SET X=2
SET X=$EXTRACT(Y(1),Y(2),X)
+68 SET @INV@("MSH14")=X
KILL DXS,D0
+69 ;SET MSH15 = $E(INTERNAL(@APA),1,2)
+70 SET D0=INDA
SET X=$GET(INA("APA"))
SET X=X
SET X=X
SET Y(1)=$GET(X)
SET X=1
SET Y(2)=$GET(X)
SET X=2
SET X=$EXTRACT(Y(1),Y(2),X)
+71 SET @INV@("MSH15")=X
KILL DXS,D0
+72 ;SET MSH16 = INSGX\^INTHL7FT(1,3)\\3\"USA"
+73 SET D0=INDA
SET X="USA"
+74 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,3)
+75 SET @INV@("MSH16")=X
KILL DXS,D0
+76 IF 'INVS
DO MC^INHS
+77 KILL LINE
SET LINE=""
SET CP=0
SET L1="MSH"
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,1,L1,.CP)
SET L1=$GET(@INV@("MSH1"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
+78 DO SETPIECE^INHU(.LINE,DELIM,2,L1,.CP)
SET L1=$GET(@INV@("MSH2"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,3,L1,.CP)
SET L1=$GET(@INV@("MSH3"))
+79 IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,4,L1,.CP)
SET L1=$GET(@INV@("MSH4"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,5,L1,.CP)
+80 SET L1=$GET(@INV@("MSH5"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,6,L1,.CP)
SET L1=$GET(@INV@("MSH6"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,7,L1,.CP)
+81 SET L1=$GET(@INV@("MSH7"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,8,L1,.CP)
SET L1=$GET(@INV@("MSH8"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,9,L1,.CP)
+82 SET L1=$GET(@INV@("MSH9"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,10,L1,.CP)
SET L1=$GET(@INV@("MSH10"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,11,L1,.CP)
+83 SET D0=INDA
SET X=@INV@("MSH11")
SET Y(1)=$GET(X)
SET X=1
SET Y(2)=$GET(X)
SET X=10
SET X=$EXTRACT(Y(1),Y(2),X)
SET L1=X
+84 IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,12,L1,.CP)
SET L1=$GET(@INV@("MSH12"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,13,L1,.CP)
+85 SET L1=$GET(@INV@("MSH13"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,14,L1,.CP)
SET L1=$GET(@INV@("MSH14"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
+86 DO SETPIECE^INHU(.LINE,DELIM,15,L1,.CP)
SET L1=$GET(@INV@("MSH15"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,16,L1,.CP)
SET L1=$GET(@INV@("MSH16"))
+87 IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,17,L1,.CP)
+88 SET LCT=LCT+1
SET ^UTILITY("INH",$JOB,LCT)=LINE
IF $DATA(LINE)>9
MERGE ^UTILITY("INH",$JOB,LCT)=LINE
+89 SET INSETID=0
+90 ;SET MSA1 = INSGX\^INTHL7FT(1,3)\\2\@INSTAT
+91 SET D0=INDA
SET X=$GET(INA("INSTAT"))
+92 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,2)
+93 SET @INV@("MSA1")=X
KILL DXS,D0
+94 ;SET MSA2 = INSGX\^INTHL7FT(1,3)\\20\@INORIGID
+95 SET D0=INDA
SET X=$GET(INA("INORIGID"))
+96 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,20)
+97 SET @INV@("MSA2")=X
KILL DXS,D0
+98 ;SET MSA3 = INSGX\^INTHL7FT(1,3)\\80\@INACKTXT
+99 SET D0=INDA
SET X=$GET(INA("INACKTXT"))
+100 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,80)
+101 SET @INV@("MSA3")=X
KILL DXS,D0
+102 ;SET MSA4 = INSGX\^INTHL7FT(1,3)\\15\@INEXPSEQ
+103 SET D0=INDA
SET X=$GET(INA("INEXPSEQ"))
+104 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,15)
+105 SET @INV@("MSA4")=X
KILL DXS,D0
+106 ;SET MSA5 = INSGX\^INTHL7FT(1,3)\\1\@INDELAY
+107 SET D0=INDA
SET X=$GET(INA("INDELAY"))
+108 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,1)
+109 SET @INV@("MSA5")=X
KILL DXS,D0
+110 ;SET MSA6 = INSGX\^INTHL7FT(1,3)\\100\@INACKERR
+111 SET D0=INDA
SET X=$GET(INA("INACKERR"))
+112 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,100)
+113 SET @INV@("MSA6")=X
KILL DXS,D0
+114 IF 'INVS
DO MC^INHS
+115 KILL LINE
SET LINE=""
SET CP=0
SET L1="MSA"
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,1,L1,.CP)
SET L1=$GET(@INV@("MSA1"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
+116 DO SETPIECE^INHU(.LINE,DELIM,2,L1,.CP)
SET L1=$GET(@INV@("MSA2"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,3,L1,.CP)
SET L1=$GET(@INV@("MSA3"))
+117 IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,4,L1,.CP)
SET L1=$GET(@INV@("MSA4"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,5,L1,.CP)
+118 SET L1=$GET(@INV@("MSA5"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,6,L1,.CP)
SET L1=$GET(@INV@("MSA6"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,7,L1,.CP)
+119 SET LCT=LCT+1
SET ^UTILITY("INH",$JOB,LCT)=LINE
IF $DATA(LINE)>9
MERGE ^UTILITY("INH",$JOB,LCT)=LINE
+120 SET INSETID=0
+121 ;SET QRD1 = INSGX\^INTHL7FT(1,3)\\26\@QRD1
+122 SET D0=INDA
SET X=$GET(INA("QRD1"))
+123 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,26)
+124 SET @INV@("QRD1")=X
KILL DXS,D0
+125 ;SET QRD2 = INSGX\^INTHL7FT(1,3)\\1\"R"
+126 SET D0=INDA
SET X="R"
+127 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,1)
+128 SET @INV@("QRD2")=X
KILL DXS,D0
+129 ;SET QRD3 = INSGX\^INTHL7FT(1,3)\\1\"I"
+130 SET D0=INDA
SET X="I"
+131 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,1)
+132 SET @INV@("QRD3")=X
KILL DXS,D0
+133 ;SET QRD4 = INSGX\^INTHL7FT(1,3)\\100\@QRD4
+134 SET D0=INDA
SET X=$GET(INA("QRD4"))
+135 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,100)
+136 SET @INV@("QRD4")=X
KILL DXS,D0
+137 ;SET QRD7 = INSGX\^INTHL7FT(1,3)\\10\@QRD7
+138 SET D0=INDA
SET X=$GET(INA("QRD7"))
+139 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,10)
+140 SET @INV@("QRD7")=X
KILL DXS,D0
+141 ;SET QRD8 = @QRD8
+142 SET D0=INDA
SET X=$GET(INA("QRD8"))
+143 SET @INV@("QRD8")=X
KILL DXS,D0
+144 ;SET QRD9 = INSGX\^INTHL7FT(1,3)\\60\@QRD9
+145 SET D0=INDA
SET X=$GET(INA("QRD9"))
+146 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,60)
+147 SET @INV@("QRD9")=X
KILL DXS,D0
+148 ;SET QRD10 = INSGX\^INTHL7FT(17,3)\\60\@QRD10
+149 SET D0=INDA
SET X=$GET(INA("QRD10"))
+150 SET X1="^INTHL7FT(17,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,60)
+151 SET @INV@("QRD10")=X
KILL DXS,D0
+152 ;SET QRD12 = INSGX\^INTHL7FT(1,3)\\1\"T"
+153 SET D0=INDA
SET X="T"
+154 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,1)
+155 SET @INV@("QRD12")=X
KILL DXS,D0
+156 IF 'INVS
DO MC^INHS
+157 KILL LINE
SET LINE=""
SET CP=0
SET L1="QRD"
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,1,L1,.CP)
SET L1=$GET(@INV@("QRD1"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
+158 DO SETPIECE^INHU(.LINE,DELIM,2,L1,.CP)
SET L1=$GET(@INV@("QRD2"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,3,L1,.CP)
SET L1=$GET(@INV@("QRD3"))
+159 IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,4,L1,.CP)
SET L1=$GET(@INV@("QRD4"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,5,L1,.CP)
+160 SET L1=$GET(@INV@("QRD7"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,8,L1,.CP)
+161 SET D0=INDA
SET X=@INV@("QRD8")
SET Y(1)=$GET(X)
SET X=1
SET Y(2)=$GET(X)
SET X=100
SET X=$EXTRACT(Y(1),Y(2),X)
SET L1=X
+162 IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,9,L1,.CP)
SET L1=$GET(@INV@("QRD9"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,10,L1,.CP)
+163 SET L1=$GET(@INV@("QRD10"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,11,L1,.CP)
SET L1=$GET(@INV@("QRD12"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
+164 DO SETPIECE^INHU(.LINE,DELIM,13,L1,.CP)
+165 SET LCT=LCT+1
SET ^UTILITY("INH",$JOB,LCT)=LINE
IF $DATA(LINE)>9
MERGE ^UTILITY("INH",$JOB,LCT)=LINE
+166 SET INSETID=0
+167 ;SET QRF1 = INSGX\^INTHL7FT(1,3)\\20\@QRF1
+168 SET D0=INDA
SET X=$GET(INA("QRF1"))
+169 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,20)
+170 SET @INV@("QRF1")=X
KILL DXS,D0
+171 ;SET QRF5 = INSGX\^INTHL7FT(1,3)\\240\@QRF5
+172 SET D0=INDA
SET X=$GET(INA("QRF5"))
+173 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,240)
+174 SET @INV@("QRF5")=X
KILL DXS,D0
+175 IF 'INVS
DO MC^INHS
+176 KILL LINE
SET LINE=""
SET CP=0
SET L1="QRF"
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,1,L1,.CP)
SET L1=$GET(@INV@("QRF1"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
+177 DO SETPIECE^INHU(.LINE,DELIM,2,L1,.CP)
SET L1=$GET(@INV@("QRF5"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,6,L1,.CP)
+178 SET LCT=LCT+1
SET ^UTILITY("INH",$JOB,LCT)=LINE
IF $DATA(LINE)>9
MERGE ^UTILITY("INH",$JOB,LCT)=LINE
+179 SET INSETID=0
+180 SET INDA0=INDA
SET INI(1)=0
FOR
SET INI(1)=$ORDER(INDA(2,INI(1)))
IF 'INI(1)
QUIT
SET INDA=$SELECT(INDA(2,INI(1)):INDA(2,INI(1)),1:INI(1))
Begin DoDot:1
+181 IF '$DATA(^DPT(INDA,0))
QUIT
+182 DO ^BHLPID
+183 ;SET PID1 = INSGX\^INTHL7FT(11,3)\\4\"PID"
+184 SET D0=INDA
SET X="PID"
+185 SET X1="^INTHL7FT(11,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,4)
+186 SET @INV@("PID1")=X
KILL DXS,D0
+187 ;SET PID3 = INSGX\^INTHL7FT(1,3)\\250\@PID3
+188 SET D0=INDA
SET X=$GET(INA("PID3",INI(1)))
+189 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,250)
+190 SET @INV@("PID3")=X
KILL DXS,D0
+191 ;SET PID5 = INSGX\^INTHL7FT(7,3)\\250\@PID5
+192 SET D0=INDA
SET X=$GET(INA("PID5",INI(1)))
+193 SET X1="^INTHL7FT(7,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,250)
+194 SET @INV@("PID5")=X
KILL DXS,D0
+195 ;SET PID6 = INSGX\^INTHL7FT(1,3)\\99\@PID6
+196 SET D0=INDA
SET X=$GET(INA("PID6",INI(1)))
+197 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,99)
+198 SET @INV@("PID6")=X
KILL DXS,D0
+199 ;SET PID7 = INSGX\^INTHL7FT(1,3)\\8\@PID7
+200 SET D0=INDA
SET X=$GET(INA("PID7",INI(1)))
+201 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,8)
+202 SET @INV@("PID7")=X
KILL DXS,D0
+203 ;SET PID8 = $E(INTERNAL(SEX),1,1)
+204 SET D0=INDA
SET Y(1)=$SELECT($DATA(^DPT(D0,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET X=X
SET Y(2)=$GET(X)
SET X=1
SET Y(3)=$GET(X)
SET X=1
SET X=$EXTRACT(Y(2),Y(3),X)
+205 SET @INV@("PID8")=X
KILL DXS,D0
+206 ;SET PID10 = INSGX\^INTHL7FT(1,3)\\99\@PID10
+207 SET D0=INDA
SET X=$GET(INA("PID10",INI(1)))
+208 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,99)
+209 SET @INV@("PID10")=X
KILL DXS,D0
+210 ;SET PID11 = INSGX\^INTHL7FT(1,3)\\250\@PID11
+211 SET D0=INDA
SET X=$GET(INA("PID11",INI(1)))
+212 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,250)
+213 SET @INV@("PID11")=X
KILL DXS,D0
+214 ;SET PID12 = $E(INTERNAL(#.117),1,4)
+215 SET D0=INDA
SET Y(1)=$SELECT($DATA(^DPT(D0,.11)):^(.11),1:"")
SET X=$PIECE(Y(1),U,7)
SET X=X
SET X=X
SET Y(2)=$GET(X)
SET X=1
SET Y(3)=$GET(X)
SET X=4
SET X=$EXTRACT(Y(2),Y(3),X)
+216 SET @INV@("PID12")=X
KILL DXS,D0
+217 ;SET PID13 = INSGX\^INTHL7FT(1,3)\\250\@PID13
+218 SET D0=INDA
SET X=$GET(INA("PID13",INI(1)))
+219 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,250)
+220 SET @INV@("PID13")=X
KILL DXS,D0
+221 ;SET PID14 = INSGX\^INTHL7FT(1,3)\\250\@PID14
+222 SET D0=INDA
SET X=$GET(INA("PID14",INI(1)))
+223 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,250)
+224 SET @INV@("PID14")=X
KILL DXS,D0
+225 ;SET PID17 = INSGX\^INTHL7FT(17,3)\\250\#.08
+226 SET D0=INDA
SET Y(1)=$SELECT($DATA(^DPT(D0,0)):^(0),1:"")
SET X=$PIECE($GET(^DIC(13,+$PIECE(Y(1),U,8),0)),U)
+227 SET X1="^INTHL7FT(17,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,250)
+228 SET @INV@("PID17")=X
KILL DXS,D0
+229 ;SET PID19 = INSGX\^INTHL7FT(1,3)\\80\@PID19
+230 SET D0=INDA
SET X=$GET(INA("PID19",INI(1)))
+231 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,80)
+232 SET @INV@("PID19")=X
KILL DXS,D0
+233 ;SET PID22 = INSGX\^INTHL7FT(1,3)\\200\@PID22
+234 SET D0=INDA
SET X=$GET(INA("PID22",INI(1)))
+235 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,200)
+236 SET @INV@("PID22")=X
KILL DXS,D0
+237 ;SET PID24 = INSGX\^INTHL7FT(1,3)\\10\@PID24
+238 SET D0=INDA
SET X=$GET(INA("PID24",INI(1)))
+239 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,10)
+240 SET @INV@("PID24")=X
KILL DXS,D0
+241 IF 'INVS
DO MC^INHS
+242 KILL LINE
SET LINE=""
SET CP=0
SET L1="PID"
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,1,L1,.CP)
SET L1=$GET(@INV@("PID1"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
+243 DO SETPIECE^INHU(.LINE,DELIM,2,L1,.CP)
SET L1=$GET(@INV@("PID3"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,4,L1,.CP)
SET L1=$GET(@INV@("PID5"))
+244 IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,6,L1,.CP)
SET L1=$GET(@INV@("PID6"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,7,L1,.CP)
+245 SET L1=$GET(@INV@("PID7"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,8,L1,.CP)
SET L1=$GET(@INV@("PID8"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,9,L1,.CP)
+246 SET L1=$GET(@INV@("PID10"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,11,L1,.CP)
SET L1=$GET(@INV@("PID11"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
+247 DO SETPIECE^INHU(.LINE,DELIM,12,L1,.CP)
SET L1=$GET(@INV@("PID12"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,13,L1,.CP)
SET L1=$GET(@INV@("PID13"))
+248 IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,14,L1,.CP)
SET L1=$GET(@INV@("PID14"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,15,L1,.CP)
9 DO EN^IS00029A
End DoDot:1
+1 GOTO A1^IS00029A