IS00020(INTT,INDA,INA,INDEST,INQUE,INORDUZ,INORDIV) ;Compiled from script 'Generated: HL IHS LAB O01 SONORA QUEST-O' on AUG 14, 2006
;Part 1
;Copyright 2006 SAIC
EN S X="ERROR^IS00020",@^%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="12436"
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,^BHLMSH,^BHLPID
;Entering DATA section.
S DELIM="|"
S SUBDELIM="^"
SET INSETID=0
;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\@SAP
S D0=INDA S X=$G(INA("SAP"))
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\@SF
S D0=INDA S X=$G(INA("SF"))
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\@RAP
S D0=INDA S X=$G(INA("RAP"))
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\@RF
S D0=INDA S X=$G(INA("RF"))
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(6,3)\\26\@EVDT
S D0=INDA S X=$G(INA("EVDT"))
S X1="^INTHL7FT(6,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,26)
S @INV@("MSH6")=X K DXS,D0
;SET MSH8 = $E(INTERNAL(@MET),1,7)
S D0=INDA S X=$G(INA("MET")),X=X S X=X,Y(1)=$G(X) S X=1,Y(2)=$G(X) S X=7,X=$E(Y(1),Y(2),X)
S @INV@("MSH8")=X K DXS,D0
;SET MSH9 = INSGX\^INTHL7FT(1,3)\\20\@MESSID
S D0=INDA S X=$G(INA("MESSID"))
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 = @VER
S D0=INDA S X=$G(INA("VER"))
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 = ""
S D0=INDA S X=""
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@("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=8,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
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))
.;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 PID2 = INSGX\^INTHL7F(16954,5)\\999\"OUTPUT TRANSFORM"
.S D0=INDA S X="OUTPUT TRANSFORM"
.S X1="^INTHL7F(16954,5)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,999)
.S @INV@("PID2")=X K DXS,D0
.;SET PID3 = INSGX\^INTHL7F(15151,5)\\250\@PID3
.S D0=INDA S X=$G(INA("PID3",INI(1)))
.S X1="^INTHL7F(15151,5)" 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\#.01
.S D0=INDA S Y(1)=$S($D(^DPT(D0,0)):^(0),1:"") S X=$P(Y(1),U,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 PID7 = INSGX\^INTHL7F(14454,5)\\8\"OUTPUT TRANSFORM"
.S D0=INDA S X="OUTPUT TRANSFORM"
.S X1="^INTHL7F(14454,5)" 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 PID18 = INSGX\^INTHL7FT(1,3)\\999\@PID20LABO
.S D0=INDA S X=$G(INA("PID20LABO",INI(1)))
.S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,999)
.S @INV@("PID18")=X K DXS,D0
.;SET PID19 = INSGX\^INTHL7FT(1,3)\\16\#.09
.S D0=INDA S Y(1)=$S($D(^DPT(D0,0)):^(0),1:"") S X=$P(Y(1),U,9)
.S X1="^INTHL7FT(1,3)" X:$L($G(@X1)) $G(@X1) S X=$E(X,1,16)
.S @INV@("PID19")=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@("PID2")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,3,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@("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@("PID18")) S:$TR(L1,$G(SUBDELIM))="" L1="" D SETPIECE^INHU(.LINE,DELIM,19,L1,.CP) S L1=$G(@INV@("PID19")) S:$TR(L1,$G(SUBDELIM))="" L1=""
.D SETPIECE^INHU(.LINE,DELIM,20,L1,.CP)
.S LCT=LCT+1,^UTILITY("INH",$J,LCT)=LINE I $D(LINE)>9 M ^UTILITY("INH",$J,LCT)=LINE
.Q
S INDA=INDA0 K INDA0
9 G EN^IS00020A
IS00020(INTT,INDA,INA,INDEST,INQUE,INORDUZ,INORDIV) ;Compiled from script 'Generated: HL IHS LAB O01 SONORA QUEST-O' on AUG 14, 2006
+1 ;Part 1
+2 ;Copyright 2006 SAIC
EN SET X="ERROR^IS00020"
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="12436"
+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 ^BHLMSH
DO ^BHLPID
+13 ;Entering DATA section.
+14 SET DELIM="|"
+15 SET SUBDELIM="^"
+16 SET INSETID=0
+17 ;SET MSH1 = INSGX\^INTHL7FT(1,3)\\4\@ENC
+18 SET D0=INDA
SET X=$GET(INA("ENC"))
+19 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,4)
+20 SET @INV@("MSH1")=X
KILL DXS,D0
+21 ;SET MSH2 = INSGX\^INTHL7FT(1,3)\\180\@SAP
+22 SET D0=INDA
SET X=$GET(INA("SAP"))
+23 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,180)
+24 SET @INV@("MSH2")=X
KILL DXS,D0
+25 ;SET MSH3 = INSGX\^INTHL7FT(1,3)\\180\@SF
+26 SET D0=INDA
SET X=$GET(INA("SF"))
+27 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,180)
+28 SET @INV@("MSH3")=X
KILL DXS,D0
+29 ;SET MSH4 = INSGX\^INTHL7FT(1,3)\\180\@RAP
+30 SET D0=INDA
SET X=$GET(INA("RAP"))
+31 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,180)
+32 SET @INV@("MSH4")=X
KILL DXS,D0
+33 ;SET MSH5 = INSGX\^INTHL7FT(1,3)\\180\@RF
+34 SET D0=INDA
SET X=$GET(INA("RF"))
+35 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,180)
+36 SET @INV@("MSH5")=X
KILL DXS,D0
+37 ;SET MSH6 = INSGX\^INTHL7FT(6,3)\\26\@EVDT
+38 SET D0=INDA
SET X=$GET(INA("EVDT"))
+39 SET X1="^INTHL7FT(6,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,26)
+40 SET @INV@("MSH6")=X
KILL DXS,D0
+41 ;SET MSH8 = $E(INTERNAL(@MET),1,7)
+42 SET D0=INDA
SET X=$GET(INA("MET"))
SET X=X
SET X=X
SET Y(1)=$GET(X)
SET X=1
SET Y(2)=$GET(X)
SET X=7
SET X=$EXTRACT(Y(1),Y(2),X)
+43 SET @INV@("MSH8")=X
KILL DXS,D0
+44 ;SET MSH9 = INSGX\^INTHL7FT(1,3)\\20\@MESSID
+45 SET D0=INDA
SET X=$GET(INA("MESSID"))
+46 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,20)
+47 SET @INV@("MSH9")=X
KILL DXS,D0
+48 ;SET MSH10 = $E(INTERNAL(@PRID),1,1)
+49 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)
+50 SET @INV@("MSH10")=X
KILL DXS,D0
+51 ;SET MSH11 = @VER
+52 SET D0=INDA
SET X=$GET(INA("VER"))
+53 SET @INV@("MSH11")=X
KILL DXS,D0
+54 ;SET MSH12 = ""
+55 SET D0=INDA
SET X=""
+56 SET @INV@("MSH12")=X
KILL DXS,D0
+57 ;SET MSH13 = ""
+58 SET D0=INDA
SET X=""
+59 SET @INV@("MSH13")=X
KILL DXS,D0
+60 ;SET MSH14 = $E(INTERNAL(@ACA),1,2)
+61 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)
+62 SET @INV@("MSH14")=X
KILL DXS,D0
+63 ;SET MSH15 = $E(INTERNAL(@APA),1,2)
+64 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)
+65 SET @INV@("MSH15")=X
KILL DXS,D0
+66 ;SET MSH16 = ""
+67 SET D0=INDA
SET X=""
+68 SET @INV@("MSH16")=X
KILL DXS,D0
+69 IF 'INVS
DO MC^INHS
+70 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=""
+71 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"))
+72 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)
+73 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)
+74 SET L1=$GET(@INV@("MSH8"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,9,L1,.CP)
SET L1=$GET(@INV@("MSH9"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,10,L1,.CP)
+75 SET L1=$GET(@INV@("MSH10"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,11,L1,.CP)
+76 SET D0=INDA
SET X=@INV@("MSH11")
SET Y(1)=$GET(X)
SET X=1
SET Y(2)=$GET(X)
SET X=8
SET X=$EXTRACT(Y(1),Y(2),X)
SET L1=X
+77 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)
+78 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=""
+79 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"))
+80 IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,17,L1,.CP)
+81 SET LCT=LCT+1
SET ^UTILITY("INH",$JOB,LCT)=LINE
IF $DATA(LINE)>9
MERGE ^UTILITY("INH",$JOB,LCT)=LINE
+82 SET INSETID=0
+83 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
+84 IF '$DATA(^DPT(INDA,0))
QUIT
+85 ;SET PID1 = INSGX\^INTHL7FT(11,3)\\4\"PID"
+86 SET D0=INDA
SET X="PID"
+87 SET X1="^INTHL7FT(11,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,4)
+88 SET @INV@("PID1")=X
KILL DXS,D0
+89 ;SET PID2 = INSGX\^INTHL7F(16954,5)\\999\"OUTPUT TRANSFORM"
+90 SET D0=INDA
SET X="OUTPUT TRANSFORM"
+91 SET X1="^INTHL7F(16954,5)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,999)
+92 SET @INV@("PID2")=X
KILL DXS,D0
+93 ;SET PID3 = INSGX\^INTHL7F(15151,5)\\250\@PID3
+94 SET D0=INDA
SET X=$GET(INA("PID3",INI(1)))
+95 SET X1="^INTHL7F(15151,5)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,250)
+96 SET @INV@("PID3")=X
KILL DXS,D0
+97 ;SET PID5 = INSGX\^INTHL7FT(7,3)\\250\#.01
+98 SET D0=INDA
SET Y(1)=$SELECT($DATA(^DPT(D0,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,1)
+99 SET X1="^INTHL7FT(7,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,250)
+100 SET @INV@("PID5")=X
KILL DXS,D0
+101 ;SET PID7 = INSGX\^INTHL7F(14454,5)\\8\"OUTPUT TRANSFORM"
+102 SET D0=INDA
SET X="OUTPUT TRANSFORM"
+103 SET X1="^INTHL7F(14454,5)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,8)
+104 SET @INV@("PID7")=X
KILL DXS,D0
+105 ;SET PID8 = $E(INTERNAL(SEX),1,1)
+106 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)
+107 SET @INV@("PID8")=X
KILL DXS,D0
+108 ;SET PID18 = INSGX\^INTHL7FT(1,3)\\999\@PID20LABO
+109 SET D0=INDA
SET X=$GET(INA("PID20LABO",INI(1)))
+110 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,999)
+111 SET @INV@("PID18")=X
KILL DXS,D0
+112 ;SET PID19 = INSGX\^INTHL7FT(1,3)\\16\#.09
+113 SET D0=INDA
SET Y(1)=$SELECT($DATA(^DPT(D0,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,9)
+114 SET X1="^INTHL7FT(1,3)"
IF $LENGTH($GET(@X1))
XECUTE $GET(@X1)
SET X=$EXTRACT(X,1,16)
+115 SET @INV@("PID19")=X
KILL DXS,D0
+116 IF 'INVS
DO MC^INHS
+117 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=""
+118 DO SETPIECE^INHU(.LINE,DELIM,2,L1,.CP)
SET L1=$GET(@INV@("PID2"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,3,L1,.CP)
SET L1=$GET(@INV@("PID3"))
+119 IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,4,L1,.CP)
SET L1=$GET(@INV@("PID5"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,6,L1,.CP)
+120 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)
+121 SET L1=$GET(@INV@("PID18"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
DO SETPIECE^INHU(.LINE,DELIM,19,L1,.CP)
SET L1=$GET(@INV@("PID19"))
IF $TRANSLATE(L1,$GET(SUBDELIM))=""
SET L1=""
+122 DO SETPIECE^INHU(.LINE,DELIM,20,L1,.CP)
+123 SET LCT=LCT+1
SET ^UTILITY("INH",$JOB,LCT)=LINE
IF $DATA(LINE)>9
MERGE ^UTILITY("INH",$JOB,LCT)=LINE
+124 QUIT
End DoDot:1
+125 SET INDA=INDA0
KILL INDA0
9 GOTO EN^IS00020A