TIUO38 ; SLC/JM - TIU Object Export Routine ; 4/30/99 [ 06/19/2001 10:38 AM ]
;;1.0;TEXT INTEGRATION UTILITIES;**38**;Jun 20, 1997
Q
INSTALL N FILENUM,TAG,ROUTINE,TEXTLINE,FLDNUMS,XPDIDTOT,DIERR,DISYS,%1
K ^DD(8925.1,0,"ID",.04) ;Added to fix Beta Site prob, per DBIA #2813
S FILENUM=8925.1
S U="^",ROUTINE=""
S XPDIDTOT=6
F TAG=1:1:6 D
.N FLD,IDX,IEN,RECORD,DATA,FIELD,TIUFPRIV,ADDCMD
.S IDX=0,TIUFPRIV=1
.F D Q:RECORD=""
..S IDX=IDX+1
..S TEXTLINE="EN"_TAG
..I $L($T(@TEXTLINE+IDX^@("TIUO38"_ROUTINE)))'>0 D
...I ROUTINE="" S ROUTINE="A"
...E S ROUTINE=$C($A(ROUTINE)+1)
..S RECORD=$P($T(@("EN"_TAG)+IDX^@("TIUO38"_ROUTINE)),";;",2)
..I RECORD'="" D
...S FIELD=$P(RECORD,U,1)
...S DATA=$P(RECORD,U,2,99)
...I IDX=1 D
....S IEN=$$FIND1^DIC(FILENUM,"","X",DATA,"B","I $P(^(0),U,4)=""O""")
....I +IEN'>0 D I 1
.....N ADDCMD,IENLIST
.....D ADD("+1")
.....D UPDATE^DIE("",$NA(ADDCMD),$NA(IENLIST))
.....S IEN=IENLIST(1)
....E D
.....N DELCMD
.....K ^TMP("TIUOBJINS",$J)
.....D GETS^DIQ(FILENUM,IEN,"*","N",$NA(^TMP("TIUOBJINS",$J)))
.....S FLD=0
.....F S FLD=$O(^TMP("TIUOBJINS",$J,FILENUM,IEN_",",FLD)) Q:'FLD D
......I FLD'=.01 D
.......S DELCMD(FILENUM,IEN_",",FLD)="@"
.....D FILE^DIE("",$NA(DELCMD))
.....K ^TMP("TIUOBJINS",$J)
...D ADD(IEN)
.D FILE^DIE("E",$NA(ADDCMD))
.D UPDATE^XPDID(TAG)
K ^TMP("DIERR",$J)
Q
ADD(IEN) ;
I '$D(FLDNUMS(FIELD)) D
.S FLDNUMS(FIELD)=$$FLDNUM^DILFD(FILENUM,FIELD)
S ADDCMD(FILENUM,IEN_",",FLDNUMS(FIELD))=DATA
Q
EN1 ;TIU Object:ACTIVE MEDICATIONS
;;NAME^ACTIVE MEDICATIONS
;;ABBREVIATION^AMED
;;PRINT NAME^ACTIVE MEDICATIONS
;;TYPE^OBJECT
;;CLASS OWNER^CLINICAL COORDINATOR
;;STATUS^ACTIVE
;;NATIONAL STANDARD^NO
;;OK TO DISTRIBUTE^YES
;;OBJECT METHOD^S X=$$LIST^TIULMED(DFN,"^TMP(""TIUMED"",$J)",1)
;;TIMESTAMP^57652,49986
EN2 ;TIU Object:RECENT MEDICATIONS
;;NAME^RECENT MEDICATIONS
;;ABBREVIATION^RMED
;;PRINT NAME^RECENT MEDICATIONS
;;TYPE^OBJECT
;;CLASS OWNER^CLINICAL COORDINATOR
;;STATUS^ACTIVE
;;NATIONAL STANDARD^NO
;;OK TO DISTRIBUTE^YES
;;OBJECT METHOD^S X=$$LIST^TIULMED(DFN,"^TMP(""TIUMED"",$J)")
;;TIMESTAMP^57652,49384
EN3 ;TIU Object:DETAILED ACTIVE MEDS
;;NAME^DETAILED ACTIVE MEDS
;;ABBREVIATION^DAMD
;;PRINT NAME^DETAILED ACTIVE MEDS
;;TYPE^OBJECT
;;CLASS OWNER^CLINICAL COORDINATOR
;;STATUS^ACTIVE
;;NATIONAL STANDARD^NO
;;OK TO DISTRIBUTE^YES
;;OBJECT METHOD^S X=$$LIST^TIULMED(DFN,"^TMP(""TIUMED"",$J)",1,1)
;;TIMESTAMP^57740,41359
EN4 ;TIU Object:DETAILED RECENT MEDS
;;NAME^DETAILED RECENT MEDS
;;ABBREVIATION^DRMD
;;PRINT NAME^DETAILED RECENT MEDS
;;TYPE^OBJECT
;;CLASS OWNER^CLINICAL COORDINATOR
;;STATUS^ACTIVE
;;NATIONAL STANDARD^NO
;;OK TO DISTRIBUTE^YES
;;OBJECT METHOD^S X=$$LIST^TIULMED(DFN,"^TMP(""TIUMED"",$J)",0,1)
;;TIMESTAMP^57740,41600
EN5 ;TIU Object:ACTIVE MEDS COMBINED
;;NAME^ACTIVE MEDS COMBINED
;;ABBREVIATION^AMDC
;;PRINT NAME^ACTIVE MEDS COMBINED
;;TYPE^OBJECT
;;CLASS OWNER^CLINICAL COORDINATOR
;;STATUS^ACTIVE
;;NATIONAL STANDARD^NO
;;OK TO DISTRIBUTE^YES
;;OBJECT METHOD^S X=$$LIST^TIULMED(DFN,"^TMP(""TIUMED"",$J)",1,0,0,1)
;;TIMESTAMP^57772,59892
EN6 ;TIU Object:RECENT MEDS COMBINED
;;NAME^RECENT MEDS COMBINED
;;ABBREVIATION^RMDC
;;PRINT NAME^RECENT MEDS COMBINED
;;TYPE^OBJECT
;;CLASS OWNER^CLINICAL COORDINATOR
;;STATUS^ACTIVE
;;NATIONAL STANDARD^NO
;;OK TO DISTRIBUTE^YES
;;OBJECT METHOD^S X=$$LIST^TIULMED(DFN,"^TMP(""TIUMED"",$J)",0,0,0,1)
;;TIMESTAMP^57779,42006
TIUO38 ; SLC/JM - TIU Object Export Routine ; 4/30/99 [ 06/19/2001 10:38 AM ]
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**38**;Jun 20, 1997
+2 QUIT
INSTALL NEW FILENUM,TAG,ROUTINE,TEXTLINE,FLDNUMS,XPDIDTOT,DIERR,DISYS,%1
+1 ;Added to fix Beta Site prob, per DBIA #2813
KILL ^DD(8925.1,0,"ID",.04)
+2 SET FILENUM=8925.1
+3 SET U="^"
SET ROUTINE=""
+4 SET XPDIDTOT=6
+5 FOR TAG=1:1:6
Begin DoDot:1
+6 NEW FLD,IDX,IEN,RECORD,DATA,FIELD,TIUFPRIV,ADDCMD
+7 SET IDX=0
SET TIUFPRIV=1
+8 FOR
Begin DoDot:2
+9 SET IDX=IDX+1
+10 SET TEXTLINE="EN"_TAG
+11 IF $LENGTH($TEXT(@TEXTLINE+IDX^@("TIUO38"_ROUTINE)))'>0
Begin DoDot:3
+12 IF ROUTINE=""
SET ROUTINE="A"
+13 IF '$TEST
SET ROUTINE=$CHAR($ASCII(ROUTINE)+1)
End DoDot:3
+14 SET RECORD=$PIECE($TEXT(@("EN"_TAG)+IDX^@("TIUO38"_ROUTINE)),";;",2)
+15 IF RECORD'=""
Begin DoDot:3
+16 SET FIELD=$PIECE(RECORD,U,1)
+17 SET DATA=$PIECE(RECORD,U,2,99)
+18 IF IDX=1
Begin DoDot:4
+19 SET IEN=$$FIND1^DIC(FILENUM,"","X",DATA,"B","I $P(^(0),U,4)=""O""")
+20 IF +IEN'>0
Begin DoDot:5
+21 NEW ADDCMD,IENLIST
+22 DO ADD("+1")
+23 DO UPDATE^DIE("",$NAME(ADDCMD),$NAME(IENLIST))
+24 SET IEN=IENLIST(1)
End DoDot:5
IF 1
+25 IF '$TEST
Begin DoDot:5
+26 NEW DELCMD
+27 KILL ^TMP("TIUOBJINS",$JOB)
+28 DO GETS^DIQ(FILENUM,IEN,"*","N",$NAME(^TMP("TIUOBJINS",$JOB)))
+29 SET FLD=0
+30 FOR
SET FLD=$ORDER(^TMP("TIUOBJINS",$JOB,FILENUM,IEN_",",FLD))
IF 'FLD
QUIT
Begin DoDot:6
+31 IF FLD'=.01
Begin DoDot:7
+32 SET DELCMD(FILENUM,IEN_",",FLD)="@"
End DoDot:7
End DoDot:6
+33 DO FILE^DIE("",$NAME(DELCMD))
+34 KILL ^TMP("TIUOBJINS",$JOB)
End DoDot:5
End DoDot:4
+35 DO ADD(IEN)
End DoDot:3
End DoDot:2
IF RECORD=""
QUIT
+36 DO FILE^DIE("E",$NAME(ADDCMD))
+37 DO UPDATE^XPDID(TAG)
End DoDot:1
+38 KILL ^TMP("DIERR",$JOB)
+39 QUIT
ADD(IEN) ;
+1 IF '$DATA(FLDNUMS(FIELD))
Begin DoDot:1
+2 SET FLDNUMS(FIELD)=$$FLDNUM^DILFD(FILENUM,FIELD)
End DoDot:1
+3 SET ADDCMD(FILENUM,IEN_",",FLDNUMS(FIELD))=DATA
+4 QUIT
EN1 ;TIU Object:ACTIVE MEDICATIONS
+1 ;;NAME^ACTIVE MEDICATIONS
+2 ;;ABBREVIATION^AMED
+3 ;;PRINT NAME^ACTIVE MEDICATIONS
+4 ;;TYPE^OBJECT
+5 ;;CLASS OWNER^CLINICAL COORDINATOR
+6 ;;STATUS^ACTIVE
+7 ;;NATIONAL STANDARD^NO
+8 ;;OK TO DISTRIBUTE^YES
+9 ;;OBJECT METHOD^S X=$$LIST^TIULMED(DFN,"^TMP(""TIUMED"",$J)",1)
+10 ;;TIMESTAMP^57652,49986
EN2 ;TIU Object:RECENT MEDICATIONS
+1 ;;NAME^RECENT MEDICATIONS
+2 ;;ABBREVIATION^RMED
+3 ;;PRINT NAME^RECENT MEDICATIONS
+4 ;;TYPE^OBJECT
+5 ;;CLASS OWNER^CLINICAL COORDINATOR
+6 ;;STATUS^ACTIVE
+7 ;;NATIONAL STANDARD^NO
+8 ;;OK TO DISTRIBUTE^YES
+9 ;;OBJECT METHOD^S X=$$LIST^TIULMED(DFN,"^TMP(""TIUMED"",$J)")
+10 ;;TIMESTAMP^57652,49384
EN3 ;TIU Object:DETAILED ACTIVE MEDS
+1 ;;NAME^DETAILED ACTIVE MEDS
+2 ;;ABBREVIATION^DAMD
+3 ;;PRINT NAME^DETAILED ACTIVE MEDS
+4 ;;TYPE^OBJECT
+5 ;;CLASS OWNER^CLINICAL COORDINATOR
+6 ;;STATUS^ACTIVE
+7 ;;NATIONAL STANDARD^NO
+8 ;;OK TO DISTRIBUTE^YES
+9 ;;OBJECT METHOD^S X=$$LIST^TIULMED(DFN,"^TMP(""TIUMED"",$J)",1,1)
+10 ;;TIMESTAMP^57740,41359
EN4 ;TIU Object:DETAILED RECENT MEDS
+1 ;;NAME^DETAILED RECENT MEDS
+2 ;;ABBREVIATION^DRMD
+3 ;;PRINT NAME^DETAILED RECENT MEDS
+4 ;;TYPE^OBJECT
+5 ;;CLASS OWNER^CLINICAL COORDINATOR
+6 ;;STATUS^ACTIVE
+7 ;;NATIONAL STANDARD^NO
+8 ;;OK TO DISTRIBUTE^YES
+9 ;;OBJECT METHOD^S X=$$LIST^TIULMED(DFN,"^TMP(""TIUMED"",$J)",0,1)
+10 ;;TIMESTAMP^57740,41600
EN5 ;TIU Object:ACTIVE MEDS COMBINED
+1 ;;NAME^ACTIVE MEDS COMBINED
+2 ;;ABBREVIATION^AMDC
+3 ;;PRINT NAME^ACTIVE MEDS COMBINED
+4 ;;TYPE^OBJECT
+5 ;;CLASS OWNER^CLINICAL COORDINATOR
+6 ;;STATUS^ACTIVE
+7 ;;NATIONAL STANDARD^NO
+8 ;;OK TO DISTRIBUTE^YES
+9 ;;OBJECT METHOD^S X=$$LIST^TIULMED(DFN,"^TMP(""TIUMED"",$J)",1,0,0,1)
+10 ;;TIMESTAMP^57772,59892
EN6 ;TIU Object:RECENT MEDS COMBINED
+1 ;;NAME^RECENT MEDS COMBINED
+2 ;;ABBREVIATION^RMDC
+3 ;;PRINT NAME^RECENT MEDS COMBINED
+4 ;;TYPE^OBJECT
+5 ;;CLASS OWNER^CLINICAL COORDINATOR
+6 ;;STATUS^ACTIVE
+7 ;;NATIONAL STANDARD^NO
+8 ;;OK TO DISTRIBUTE^YES
+9 ;;OBJECT METHOD^S X=$$LIST^TIULMED(DFN,"^TMP(""TIUMED"",$J)",0,0,0,1)
+10 ;;TIMESTAMP^57779,42006