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

DGPTLMU2.m

Go to the documentation of this file.
  1. DGPTLMU2 ;ALM/MTC - Util used for the List Manager Cont; 9-22-92
  1. ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
  1. ;
  1. EN ;-- entry point
  1. D EN^VALM("DGPT A/P MAIN SELECT")
  1. Q
  1. ;
  1. TMPBYE ;-- exit code called from list template
  1. K ^TMP("ARCPTF",$J,"AP LIST")
  1. D CLEAR^VALM1
  1. Q
  1. ;
  1. TMPINT ;-- list manager init point
  1. K ^TMP("ARCPTF",$J,"AP LIST")
  1. S VALMCNT=$$TMPBLD()
  1. Q
  1. ;
  1. TMPEXIT ;-- This fuction will be used to rebuild the the list
  1. D TMPINT
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. TMPBLD() ;-- This function will take the entries in from file 45.62
  1. ; and build the display and index array.
  1. ; OUTPUT - total number of entries
  1. ;
  1. ; Format of display string:
  1. ; < date range> <status>
  1. N NUMREC,REC,DGX,DGY
  1. S NUMREC=0
  1. ;-- get a/p entry
  1. S DGX="" F S DGX=$O(^DGP(45.62,"B",DGX)) Q:DGX']"" D
  1. . S DGY=$O(^DGP(45.62,"B",DGX,0)),NUMREC=NUMREC+1,X=""
  1. . S X=$$BLDDIS(DGY)
  1. . S X=$$SETSTR^VALM1(NUMREC,X,6,2)
  1. . S ^TMP("ARCPTF",$J,"AP LIST",NUMREC,0)=X
  1. . S ^TMP("ARCPTF",$J,"AP LIST","IDX",NUMREC,NUMREC)=""
  1. . S ^TMP("ARCPTF",$J,"AP LIST","REC",NUMREC,DGY)=""
  1. TMPQ Q NUMREC
  1. ;
  1. TMPDEL ;-- tag entries to delete entry in file 45.62.
  1. N DGX
  1. D SEL^VALM2 I '$D(VALMY) G TMPDELQ
  1. W !,"Deleting PTF Archive/Purge History entry." H 1
  1. S DGX=$O(^TMP("ARCPTF",$J,"AP LIST","REC",+$O(VALMY(0)),0))
  1. S DIK="^DIBT(",DA=$P(^DGP(45.62,DGX,0),U,8) D ^DIK K DA,DIK
  1. S DIK="^DGP(45.62,",DA=DGX D ^DIK K DA,DIK
  1. TMPDELQ Q
  1. ;
  1. TMPADD ;-- build new entry in 45.62.
  1. D CRTEMP^DGPTAPSL
  1. Q
  1. ;
  1. TMPED ;-- edit PTF A/P Template
  1. N DGX,DGTMP
  1. D SEL^VALM2 I '$D(VALMY) G TMPEDQ
  1. S DGTMP=$O(^TMP("ARCPTF",$J,"AP LIST","REC",+$O(VALMY(0)),0))
  1. ;-- if data is purged quit
  1. I $P($G(^DGP(45.62,+DGTMP,0)),U,7) W !,*7,">>> Data Already Purged...Cannot Edit Template." G TMPEDQ
  1. D EN^VALM("DGPT A/P EDIT TEMPLATE")
  1. TMPEDQ Q
  1. ;
  1. BLDDIS(DGTMP) ; -- This function will build the entry for the display
  1. ; array used for the List Manager.
  1. ; INPUT : DGTMP
  1. ; OUTPUT: - <Date Range> <Status>
  1. N X
  1. S X="",X=$$SETSTR^VALM1($$FTIME^VALM1($P(^DGP(45.62,DGTMP,0),U,10))_" thru "_$$FTIME^VALM1($P(^DGP(45.62,DGTMP,0),U,11)),X,8,30)
  1. S X=$$SETSTR^VALM1($J($P(^DGP(45.62,DGTMP,0),U,9),10),X,45,10)
  1. S Y=$$STATUS(DGTMP)
  1. S X=$$SETSTR^VALM1($S(Y="P":"PURGED",Y="A":"ARCHIVED",1:"ACTIVE"),X,65,10)
  1. Q $$LOWER^VALM1(X)
  1. ;
  1. STATUS(REC) ;-- This function will return the currect status of the PTF
  1. ; A/P template. If the record has been Archived & Purged the 'P' will
  1. ; be returned if just Archived then 'A' else ""
  1. ;
  1. ; INPUT : REC - IFN of the record to check
  1. ; OUTPUT : "A" - Archived, "P" - Purged, or ""
  1. N X
  1. S X=$G(^DGP(45.62,REC,0)) G:X']"" STATQ
  1. STATQ Q $S($P(X,U,7):"P",$P(X,U,4):"A",1:"")
  1. ;