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

TIUFZZ8.m

Go to the documentation of this file.
  1. TIUFZZ8 ; SLC/MAM - Post Patch TIU*1*27 Cleanup. Scratch. Updates fld .04 for documents in TIU DOCUMENT FILE ;8/27/97 14:02
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**27**;Jun 20, 1997
  1. ;
  1. ZZUPDATE ; Update Parent Document Type for all documents, one title at a time. Scratch tool, needed by sites that have moved documents before having patch 27.
  1. S %ZIS="Q" D ^%ZIS I POP G UPDAX
  1. I '$D(IO("Q")) G ZZUP1
  1. S ZTRTN="ZZUP1^TIUFZZ8",ZTDESC="TIU Document File - Update Parent Document Type"
  1. D ^%ZTLOAD G UPDAX
  1. ;
  1. ZZUP1 N TITLEDA,FILEDA,NUPDATE,TIUFMOVE
  1. S TIUFMOVE="",(TITLEDA,NUPDATE)=0 W !!
  1. K ^XTMP("TIUFZZ8"),^XTMP("TIUFZZ8P")
  1. S ^XTMP("TIUFZZ8",0)=+$$FMADD^XLFDT(DT,30)_U_DT
  1. S ^XTMP("TIUFZZ8P",0)=+$$FMADD^XLFDT(DT,30)_U_DT
  1. F S TITLEDA=$O(^TIU(8925.1,"AT","DOC",TITLEDA)) Q:'TITLEDA K ^XTMP("TIUFMOVE"_TITLEDA) D:$D(^TIU(8925,"B",TITLEDA)) MTRPOINT(TITLEDA,.NUPDATE)
  1. U IO
  1. W !!!," *** RESULTS: TIU Document File - Update Parent Document Type ***",!
  1. I NUPDATE D G UPDAX
  1. . I $O(^XTMP("TIUFZZ8P",0)) D
  1. . . W !!,"The following titles have documents but are orphan Titles. Please make sure you",!,"own each title. Then add them to the hierarchy using option Edit Document"
  1. . . W !,"Definitions, action Items for the desired parent, action Add/Create. Then",!,"update each title, using action Update Documents (under action Copy/Move)."
  1. . . W !,"If needed, this list can be found in ^XTMP(""TIUFZZ8P"",TITLEDA).",!
  1. . . W !,"IEN Title:"
  1. . . S TITLEDA=0 F S TITLEDA=$O(^XTMP("TIUFZZ8P",TITLEDA)) Q:'TITLEDA W !,TITLEDA," ",$P(^TIU(8925.1,TITLEDA,0),U)
  1. . I $O(^XTMP("TIUFZZ8",0)) D
  1. . . W !!,"The following titles have documents that were not able to be updated. Please",!,"update them, using regular Document Definition action Update Documents"
  1. . . W !,"(under action Copy/Move) for each listed title. If needed, this list can be",!,"found in ^XTMP(""TIUFZZ8"",TITLEDA).",!
  1. . . W !,"IEN Title:"
  1. . . S TITLEDA=0 F S TITLEDA=$O(^XTMP("TIUFZZ8",TITLEDA)) Q:'TITLEDA W !,TITLEDA," ",$P(^TIU(8925.1,TITLEDA,0),U)
  1. W !!,"All documents updated for all Titles.",!
  1. K ^XTMP("TIUFZZ8"),^XTMP("TIUFZZ8P")
  1. UPDAX D ^%ZISC,HOME^%ZIS
  1. I $D(ZTQUEUED) S ZTREQ="@"
  1. Q
  1. ;
  1. MTRPOINT(TITLEDA,NUPDATE) ; Repoints PARENT DOCUMENT TYPE to parent of TITLEDA for documents using title TITLEDA.
  1. N DIE,DR,DA,FILEDA,XDCDA,NOLOCK,TIUFI
  1. Q:TITLEDA=81 ;ADDENDUM
  1. I $E(IOST,1,2)="C-" W !!,"Processing documents that use Title ",TITLEDA," ..."
  1. S (FILEDA,NOLOCK,TIUFI)=0,XDCDA=+$O(^TIU(8925.1,"AD",TITLEDA,0))
  1. I 'XDCDA D Q
  1. . I $O(^TIU(8925,"B",TITLEDA,FILEDA)) S ^XTMP("TIUFZZ8P",TITLEDA)="",NUPDATE=1
  1. F S FILEDA=$O(^TIU(8925,"B",TITLEDA,FILEDA)) Q:'FILEDA D
  1. . S TIUFI=TIUFI+1
  1. . I $E(IOST,1,2)="C-",(TIUFI#1000)=1 W "."
  1. . D MTRPT1(TITLEDA,FILEDA,XDCDA,.NOLOCK)
  1. I NOLOCK D Q
  1. . S NUPDATE=1,^XTMP("TIUFZZ8",TITLEDA)=""
  1. . S ^XTMP("TIUFMOVE"_TITLEDA,0)=+$$FMADD^XLFDT(DT,30)_U_DT
  1. . S ^XTMP("TIUFMOVE"_TITLEDA,"ONCETHRU")=""
  1. Q
  1. ;
  1. MTRPT1(TITLEDA,DA,XDCDA,NOLOCK) ; Repoint 1 docmt for Move TL.
  1. ; Requires TITLEDA,DA,XDCDA.
  1. I '$G(^TIU(8925,DA,0)) W !!,"Document ",DA,", from B Cross Reference, doesn't exist in file 8925.",! Q
  1. I XDCDA=$P(^TIU(8925,DA,0),U,4) Q ; Parent Docmt Type already ok.
  1. L +^TIU(8925,DA,0):1 I '$T S NOLOCK=1 S ^XTMP("TIUFMOVE"_TITLEDA,DA)="" Q
  1. S DR=".04////"_XDCDA,DIE=8925 D ^DIE
  1. L -^TIU(8925,DA,0)
  1. Q
  1. ;