Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: TIUO70

TIUO70.m

Go to the documentation of this file.
TIUO70 ; SLC/JM - TIU Object Export Routine ; 4/9/99@13:30:53 [ 06/19/2001  10:50 AM ]
 ;;1.0;TEXT INTEGRATION UTILITIES;**70**;Jun 20, 1997
 Q
INSTALL N FILENUM,TAG,ROUTINE,TEXTLINE,FLDNUMS,XPDIDTOT,DIERR,DISYS,%1
 S FILENUM=8925.1
 S U="^",ROUTINE=""
 S XPDIDTOT=1
 F TAG=1:1:1 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    ;_"+"_IDX_U_"TIUO70"
 ..I $L($T(@TEXTLINE+IDX^@("TIUO70"_ROUTINE)))'>0 D
 ...I ROUTINE="" S ROUTINE="A"
 ...E  S ROUTINE=$C($A(ROUTINE)+1)
 ..S RECORD=$P($T(@("EN"_TAG)+IDX^@("TIUO70"_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:PAIN
 ;;NAME^PAIN
 ;;ABBREVIATION^PAIN
 ;;PRINT NAME^PAIN
 ;;TYPE^OBJECT
 ;;CLASS OWNER^CLINICAL COORDINATOR
 ;;STATUS^ACTIVE
 ;;OBJECT METHOD^S X=$$PAIN^TIULO(+$G(DFN))
 ;;TIMESTAMP^57807,40699