TIUMLIST ; ISL/JER - Review Unmapped Titles ; 03/21/07
;;1.0;TEXT INTEGRATION UTILITIES;**211,225**;Jun 20, 1997;Build 13
EN ; Invoke List Manager
D EN^VALM("TIU REVIEW UNMAPPED TITLES")
S VALMBCK="Q"
Q
;
MAKELIST ; Prompt for search criteria
N MAPSTAT,TIUEDT,TIULDT,USER
S MAPSTAT="U^unmapped",TIUEDT=0,TIULDT=0,USER=DUZ_U_$$PERSNAME^TIULC1(DUZ)
S MAPSTAT=$$SELSTAT("unmapped (ACTIVE)")
I +$G(DIRUT) S VALMQUIT=1 Q
I $S(MAPSTAT="*":0,MAPSTAT="U":0,MAPSTAT="A":0,MAPSTAT="I":0,1:1) D Q:+$G(VALMQUIT)
. S USER=$$SELUSER(DUZ)
. I '$S(+USER:1,USER="A":1,1:0)!+$G(DIRUT) S VALMQUIT=1 Q
. S TIUEDT=+$$EDATE^TIULA("Mapping","T-30")
. I TIUEDT'>0!+$G(DIRUT) S VALMQUIT=1 Q
. S TIULDT=+$$LDATE^TIULA("Mapping")
. I TIULDT'>0!+$G(DIRUT) S VALMQUIT=1 Q
. ; If TIUEDT is NOT earlier than TIULDT, then swap
. I TIUEDT>TIULDT S TIUTMP=TIUEDT,TIUEDT=TIULDT,TIULDT=TIUTMP
W !,"Searching for the events."
D BUILD(MAPSTAT,TIUEDT,TIULDT,USER)
K TIUDI,SELDIV
Q
;
SELSTAT(DFLT) ; Select Mapping Status
N PRMT,READTYPE,X,Y
S PRMT="Select Mapping Status: "
S READTYPE="SMA^M:mapped;U:unmapped (ACTIVE);F:failed mappings;A:active;I:inactive;*:standard title inactivated"
S Y=$P($$READ^TIUU(READTYPE,PRMT,DFLT),U)
Q Y
;
SELUSER(DFLT) ; Select Resolution status
N PRMT,READTYPE,X,Y
I +DFLT>0 S DFLT=$$PERSNAME^TIULC1(DFLT)
S PRMT="Select USER: "
S READTYPE="SMA^A:any;S:selected user"
S Y=$P($$READ^TIUU(READTYPE,PRMT,"ANY"),U)
I Y="S" D
. S READTYPE="PA^200:AEMQ"
. S Y=+$$READ^TIUU(READTYPE,PRMT,DFLT)
Q Y
;
BUILD(MAPSTAT,TIUEDT,TIULDT,USER) ; Build review screen list
N TIUCNT,TIUTTL
S (TIUCNT,VALMCNT)=0
K ^TMP("TIUMLIST",$J),^TMP("TIUMLISTIDX",$J)
; If MAPSTAT="M^mapped"
; Loop through ^TIU(8925.1,"ALOINC")
I $P(MAPSTAT,U)="M"!($P(MAPSTAT,U)="*") D
. N TIUSDA S TIUSDA=0
. F S TIUSDA=$O(^TIU(8925.1,"ALOINC",TIUSDA)) Q:+TIUSDA'>0 D
. . N TIUTDA S TIUTDA=0
. . F S TIUTDA=$O(^TIU(8925.1,"ALOINC",TIUSDA,TIUTDA)) Q:+TIUTDA'>0 D:$$PASS(MAPSTAT,TIUTDA,USER,TIUEDT,TIULDT) SORT(TIUTDA)
. N TIUNM S TIUNM=""
. F S TIUNM=$O(^TMP("TIUMLIST",$J,"ALPHA",TIUNM)) Q:TIUNM']"" D
. . N TIUTDA S TIUTDA=0
. . F S TIUTDA=$O(^TMP("TIUMLIST",$J,"ALPHA",TIUNM,TIUTDA)) Q:+TIUTDA'>0 D
. . . S TIUCNT=+$G(TIUCNT)+1
. . . D SETLSTEL(TIUTDA,TIUCNT)
; If MAPSTAT="U^unmapped" or MAPSTAT="A^all active titles"
; Loop through ^TIU(8925.1,"AT","DOC")
I $S($P(MAPSTAT,U)="U":1,$P(MAPSTAT,U)="A":1,$P(MAPSTAT,U)="I":1,1:0) D
. N TIUTDA S TIUTDA=0
. F S TIUTDA=$O(^TIU(8925.1,"AT","DOC",TIUTDA)) Q:+TIUTDA'>0 D
. . I ($P(MAPSTAT,U)'="I"),(+$P($G(^TIU(8925.1,TIUTDA,0)),U,7)'=11) Q
. . I ($P(MAPSTAT,U)="I"),(+$P($G(^TIU(8925.1,TIUTDA,0)),U,7)'=13) Q
. . I $P(MAPSTAT,U)="U",(+$P($G(^TIU(8925.1,TIUTDA,15)),U)>0) Q
. . D:$S($P(MAPSTAT,U)="U":1,$P(MAPSTAT,U)="A":1,$P(MAPSTAT,U)="I":1,$$PASS(TIUTDA,USER,TIUEDT,TIULDT):1,1:0) SORT(TIUTDA)
. N TIUNM S TIUNM=""
. F S TIUNM=$O(^TMP("TIUMLIST",$J,"ALPHA",TIUNM)) Q:TIUNM']"" D
. . N TIUTDA S TIUTDA=0
. . F S TIUTDA=$O(^TMP("TIUMLIST",$J,"ALPHA",TIUNM,TIUTDA)) Q:+TIUTDA'>0 D
. . . S TIUCNT=+$G(TIUCNT)+1
. . . D SETLSTEL(TIUTDA,TIUCNT)
; If MAPSTAT="F^failed mappings"
; Loop through ^XTMP("TIUMAP","FAIL")
I $P(MAPSTAT,U)="F" D
. S TIUTTL="" F S TIUTTL=$O(^XTMP("TIUMAP","FAIL",TIUTTL)) Q:TIUTTL']"" D
. . N TIUTDA S TIUTDA=0
. . F S TIUTDA=$O(^XTMP("TIUMAP","FAIL",TIUTTL,TIUTDA)) Q:+TIUTDA'>0 D
. . . I '$$PASS(TIUTDA,USER,TIUEDT,TIULDT) Q
. . . S TIUCNT=+$G(TIUCNT)+1
. . . D SETLSTEL(TIUTDA,TIUCNT)
;
S ^TMP("TIUMLIST",$J,0)=+$G(TIUCNT)_U_MAPSTAT,VALMCNT=2*TIUCNT
S TIUPICK=+$O(^ORD(101,"B","TIU ACTION SELECT LIST ELEMENT",0))
S ^TMP("TIUMLIST",$J,"#")=TIUPICK_"^1:"_+$G(TIUCNT)
I $D(VALMHDR)>9 D HDR
I +$G(TIUCNT)'>0 D
. S ^TMP("TIUMLIST",$J,1,0)="",VALMCNT=2
. S ^TMP("TIUMLIST",$J,2,0)="No "_$$STATXFRM(MAPSTAT)_$S(MAPSTAT'="F":" Local Titles",1:"")_" found meeting the search criteria"
. D RESTORE^VALM10(2)
Q
;
PASS(MAPSTAT,TIUTDA,USER,TIUEDT,TIULDT) ; Does record passes criteria?
N Y,TIUTD15,TIUDT,TIUDUZ S Y=0
S TIUTD15=$G(^TIU(8925.1,TIUTDA,15))
I $P(MAPSTAT,U)="*",$$SCREEN^XTID(8926.1,"",+TIUTD15_",") S Y=1 G PASSX
S TIUDT=$P(TIUTD15,U,2),TIUDUZ=$P(TIUTD15,U,3)
I (TIUDT'<TIUEDT),(TIUDT'>TIULDT_".235959"),$S(USER="A":1,USER=TIUDUZ:1,1:0) S Y=1
PASSX Q Y
;
SORT(TIUTDA) ; Alpha sort titles
N TIUNM S TIUNM=$P($G(^TIU(8925.1,TIUTDA,0)),U)
S ^TMP("TIUMLIST",$J,"ALPHA",TIUNM,TIUTDA)=""
Q
;
SETLSTEL(TIUTDA,TIUCNT) ; Set List element for each title
N ATTEMPT,USER,LOCAL,VHATITLE,VHATDA,USERDUZ,TIUD15,TIUTTL,TIUS
S TIUTTL=$P($G(^TIU(8925.1,TIUTDA,0)),U)
S TIUD15=$G(^TIU(8925.1,TIUTDA,15))
S USERDUZ=$P(TIUD15,U,3),USER=$S(+USERDUZ>0:$$GET1^DIQ(200,USERDUZ,.01),1:"UNKNOWN")
S ATTEMPT=$P(TIUD15,U,2)
S:USER'="UNKNOWN" USER=$$NAME^TIULS(USER,"LAST, FIRST")
S ATTEMPT=$S(+ATTEMPT>0:$$DATE^TIULS(ATTEMPT,"MM/DD/YY HR:MIN"),1:"N/A")
S VHATDA=0,VHATDA=$P(TIUD15,U)
S VHATITLE=$S(+VHATDA:$P($G(^TIU(8926.1,+VHATDA,0)),U),1:"")
S TIUREC=$$SETFLD^VALM1(TIUCNT,"","NUMBER")
S TIUREC=$$SETFLD^VALM1(TIUTTL,TIUREC,"LOCAL")
S TIUREC=$$SETFLD^VALM1(ATTEMPT,TIUREC,"ATTEMPTED")
S TIUREC=$$SETFLD^VALM1(USER,TIUREC,"USER")
S TIUS=(2*TIUCNT)-1
S ^TMP("TIUMLIST",$J,TIUS,0)=TIUREC
D RESTORE^TIULM(TIUS)
S ^TMP("TIUMLIST",$J,"IDX",TIUS,TIUCNT)=""
S ^TMP("TIUMLIST",$J,"PICK",TIUCNT,TIUS)=""
S ^TMP("TIUMLISTIDX",$J,TIUCNT)=TIUS_U_TIUTDA_U_TIUTTL
S TIUS=+$G(TIUS)+1 W:TIUS#5'>0 "."
S ^TMP("TIUMLIST",$J,TIUS,0)=$$SETFLD^VALM1(VHATITLE,"","VHATITLE")
D RESTORE^TIULM(TIUS)
S ^TMP("TIUMLIST",$J,"IDX",TIUS,TIUCNT)=""
S ^TMP("TIUMLIST",$J,"PICK",TIUCNT,TIUS)=""
Q
;
STATXFRM(STATUS) ; Transform status
Q $S(STATUS="M":"MAPPED",STATUS="U":"UNMAPPED (ACTIVE)",STATUS="F":"FAILED Mapping Attempts",STATUS="A":"ACTIVE",STATUS="*":"MAPPED to INACTIVE STANDARD",1:"INACTIVE")
;
HDR ; Initialize header for review screen
N TITLE,STATUS,MAPSTAT S STATUS=$P(@VALMAR@(0),U,2)
S MAPSTAT=$$STATXFRM(STATUS)
S TITLE=MAPSTAT_$S(STATUS'="F":" Titles",1:"")
S VALMHDR(1)=$$CENTER^TIULS(TITLE)
S VALMHDR(2)=" LOCAL Title"
Q
;
VIDATTS(LINE) ; Set default video attributes for LINE
D RESTORE^TIULM(LINE),FLDCTRL^VALM10(LINE,"NUMBER",IOINHI,IOINORM)
Q
;
CLEAN ; Clean up your mess!
K ^TMP("TIUMLIST",$J),^TMP("TIUMLISTIDX",$J) D CLEAN^VALM10
K VALMY
Q
TIUMLIST ; ISL/JER - Review Unmapped Titles ; 03/21/07
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**211,225**;Jun 20, 1997;Build 13
EN ; Invoke List Manager
+1 DO EN^VALM("TIU REVIEW UNMAPPED TITLES")
+2 SET VALMBCK="Q"
+3 QUIT
+4 ;
MAKELIST ; Prompt for search criteria
+1 NEW MAPSTAT,TIUEDT,TIULDT,USER
+2 SET MAPSTAT="U^unmapped"
SET TIUEDT=0
SET TIULDT=0
SET USER=DUZ_U_$$PERSNAME^TIULC1(DUZ)
+3 SET MAPSTAT=$$SELSTAT("unmapped (ACTIVE)")
+4 IF +$GET(DIRUT)
SET VALMQUIT=1
QUIT
+5 IF $SELECT(MAPSTAT="*":0,MAPSTAT="U":0,MAPSTAT="A":0,MAPSTAT="I":0,1:1)
Begin DoDot:1
+6 SET USER=$$SELUSER(DUZ)
+7 IF '$SELECT(+USER:1,USER="A":1,1:0)!+$GET(DIRUT)
SET VALMQUIT=1
QUIT
+8 SET TIUEDT=+$$EDATE^TIULA("Mapping","T-30")
+9 IF TIUEDT'>0!+$GET(DIRUT)
SET VALMQUIT=1
QUIT
+10 SET TIULDT=+$$LDATE^TIULA("Mapping")
+11 IF TIULDT'>0!+$GET(DIRUT)
SET VALMQUIT=1
QUIT
+12 ; If TIUEDT is NOT earlier than TIULDT, then swap
+13 IF TIUEDT>TIULDT
SET TIUTMP=TIUEDT
SET TIUEDT=TIULDT
SET TIULDT=TIUTMP
End DoDot:1
IF +$GET(VALMQUIT)
QUIT
+14 WRITE !,"Searching for the events."
+15 DO BUILD(MAPSTAT,TIUEDT,TIULDT,USER)
+16 KILL TIUDI,SELDIV
+17 QUIT
+18 ;
SELSTAT(DFLT) ; Select Mapping Status
+1 NEW PRMT,READTYPE,X,Y
+2 SET PRMT="Select Mapping Status: "
+3 SET READTYPE="SMA^M:mapped;U:unmapped (ACTIVE);F:failed mappings;A:active;I:inactive;*:standard title inactivated"
+4 SET Y=$PIECE($$READ^TIUU(READTYPE,PRMT,DFLT),U)
+5 QUIT Y
+6 ;
SELUSER(DFLT) ; Select Resolution status
+1 NEW PRMT,READTYPE,X,Y
+2 IF +DFLT>0
SET DFLT=$$PERSNAME^TIULC1(DFLT)
+3 SET PRMT="Select USER: "
+4 SET READTYPE="SMA^A:any;S:selected user"
+5 SET Y=$PIECE($$READ^TIUU(READTYPE,PRMT,"ANY"),U)
+6 IF Y="S"
Begin DoDot:1
+7 SET READTYPE="PA^200:AEMQ"
+8 SET Y=+$$READ^TIUU(READTYPE,PRMT,DFLT)
End DoDot:1
+9 QUIT Y
+10 ;
BUILD(MAPSTAT,TIUEDT,TIULDT,USER) ; Build review screen list
+1 NEW TIUCNT,TIUTTL
+2 SET (TIUCNT,VALMCNT)=0
+3 KILL ^TMP("TIUMLIST",$JOB),^TMP("TIUMLISTIDX",$JOB)
+4 ; If MAPSTAT="M^mapped"
+5 ; Loop through ^TIU(8925.1,"ALOINC")
+6 IF $PIECE(MAPSTAT,U)="M"!($PIECE(MAPSTAT,U)="*")
Begin DoDot:1
+7 NEW TIUSDA
SET TIUSDA=0
+8 FOR
SET TIUSDA=$ORDER(^TIU(8925.1,"ALOINC",TIUSDA))
IF +TIUSDA'>0
QUIT
Begin DoDot:2
+9 NEW TIUTDA
SET TIUTDA=0
+10 FOR
SET TIUTDA=$ORDER(^TIU(8925.1,"ALOINC",TIUSDA,TIUTDA))
IF +TIUTDA'>0
QUIT
IF $$PASS(MAPSTAT,TIUTDA,USER,TIUEDT,TIULDT)
DO SORT(TIUTDA)
End DoDot:2
+11 NEW TIUNM
SET TIUNM=""
+12 FOR
SET TIUNM=$ORDER(^TMP("TIUMLIST",$JOB,"ALPHA",TIUNM))
IF TIUNM']""
QUIT
Begin DoDot:2
+13 NEW TIUTDA
SET TIUTDA=0
+14 FOR
SET TIUTDA=$ORDER(^TMP("TIUMLIST",$JOB,"ALPHA",TIUNM,TIUTDA))
IF +TIUTDA'>0
QUIT
Begin DoDot:3
+15 SET TIUCNT=+$GET(TIUCNT)+1
+16 DO SETLSTEL(TIUTDA,TIUCNT)
End DoDot:3
End DoDot:2
End DoDot:1
+17 ; If MAPSTAT="U^unmapped" or MAPSTAT="A^all active titles"
+18 ; Loop through ^TIU(8925.1,"AT","DOC")
+19 IF $SELECT($PIECE(MAPSTAT,U)="U":1,$PIECE(MAPSTAT,U)="A":1,$PIECE(MAPSTAT,U)="I":1,1:0)
Begin DoDot:1
+20 NEW TIUTDA
SET TIUTDA=0
+21 FOR
SET TIUTDA=$ORDER(^TIU(8925.1,"AT","DOC",TIUTDA))
IF +TIUTDA'>0
QUIT
Begin DoDot:2
+22 IF ($PIECE(MAPSTAT,U)'="I")
IF (+$PIECE($GET(^TIU(8925.1,TIUTDA,0)),U,7)'=11)
QUIT
+23 IF ($PIECE(MAPSTAT,U)="I")
IF (+$PIECE($GET(^TIU(8925.1,TIUTDA,0)),U,7)'=13)
QUIT
+24 IF $PIECE(MAPSTAT,U)="U"
IF (+$PIECE($GET(^TIU(8925.1,TIUTDA,15)),U)>0)
QUIT
+25 IF $SELECT($PIECE(MAPSTAT,U)="U"
DO SORT(TIUTDA)
End DoDot:2
+26 NEW TIUNM
SET TIUNM=""
+27 FOR
SET TIUNM=$ORDER(^TMP("TIUMLIST",$JOB,"ALPHA",TIUNM))
IF TIUNM']""
QUIT
Begin DoDot:2
+28 NEW TIUTDA
SET TIUTDA=0
+29 FOR
SET TIUTDA=$ORDER(^TMP("TIUMLIST",$JOB,"ALPHA",TIUNM,TIUTDA))
IF +TIUTDA'>0
QUIT
Begin DoDot:3
+30 SET TIUCNT=+$GET(TIUCNT)+1
+31 DO SETLSTEL(TIUTDA,TIUCNT)
End DoDot:3
End DoDot:2
End DoDot:1
+32 ; If MAPSTAT="F^failed mappings"
+33 ; Loop through ^XTMP("TIUMAP","FAIL")
+34 IF $PIECE(MAPSTAT,U)="F"
Begin DoDot:1
+35 SET TIUTTL=""
FOR
SET TIUTTL=$ORDER(^XTMP("TIUMAP","FAIL",TIUTTL))
IF TIUTTL']""
QUIT
Begin DoDot:2
+36 NEW TIUTDA
SET TIUTDA=0
+37 FOR
SET TIUTDA=$ORDER(^XTMP("TIUMAP","FAIL",TIUTTL,TIUTDA))
IF +TIUTDA'>0
QUIT
Begin DoDot:3
+38 IF '$$PASS(TIUTDA,USER,TIUEDT,TIULDT)
QUIT
+39 SET TIUCNT=+$GET(TIUCNT)+1
+40 DO SETLSTEL(TIUTDA,TIUCNT)
End DoDot:3
End DoDot:2
End DoDot:1
+41 ;
+42 SET ^TMP("TIUMLIST",$JOB,0)=+$GET(TIUCNT)_U_MAPSTAT
SET VALMCNT=2*TIUCNT
+43 SET TIUPICK=+$ORDER(^ORD(101,"B","TIU ACTION SELECT LIST ELEMENT",0))
+44 SET ^TMP("TIUMLIST",$JOB,"#")=TIUPICK_"^1:"_+$GET(TIUCNT)
+45 IF $DATA(VALMHDR)>9
DO HDR
+46 IF +$GET(TIUCNT)'>0
Begin DoDot:1
+47 SET ^TMP("TIUMLIST",$JOB,1,0)=""
SET VALMCNT=2
+48 SET ^TMP("TIUMLIST",$JOB,2,0)="No "_$$STATXFRM(MAPSTAT)_$SELECT(MAPSTAT'="F":" Local Titles",1:"")_" found meeting the search criteria"
+49 DO RESTORE^VALM10(2)
End DoDot:1
+50 QUIT
+51 ;
PASS(MAPSTAT,TIUTDA,USER,TIUEDT,TIULDT) ; Does record passes criteria?
+1 NEW Y,TIUTD15,TIUDT,TIUDUZ
SET Y=0
+2 SET TIUTD15=$GET(^TIU(8925.1,TIUTDA,15))
+3 IF $PIECE(MAPSTAT,U)="*"
IF $$SCREEN^XTID(8926.1,"",+TIUTD15_",")
SET Y=1
GOTO PASSX
+4 SET TIUDT=$PIECE(TIUTD15,U,2)
SET TIUDUZ=$PIECE(TIUTD15,U,3)
+5 IF (TIUDT'<TIUEDT)
IF (TIUDT'>TIULDT_".235959")
IF $SELECT(USER="A":1,USER=TIUDUZ:1,1:0)
SET Y=1
PASSX QUIT Y
+1 ;
SORT(TIUTDA) ; Alpha sort titles
+1 NEW TIUNM
SET TIUNM=$PIECE($GET(^TIU(8925.1,TIUTDA,0)),U)
+2 SET ^TMP("TIUMLIST",$JOB,"ALPHA",TIUNM,TIUTDA)=""
+3 QUIT
+4 ;
SETLSTEL(TIUTDA,TIUCNT) ; Set List element for each title
+1 NEW ATTEMPT,USER,LOCAL,VHATITLE,VHATDA,USERDUZ,TIUD15,TIUTTL,TIUS
+2 SET TIUTTL=$PIECE($GET(^TIU(8925.1,TIUTDA,0)),U)
+3 SET TIUD15=$GET(^TIU(8925.1,TIUTDA,15))
+4 SET USERDUZ=$PIECE(TIUD15,U,3)
SET USER=$SELECT(+USERDUZ>0:$$GET1^DIQ(200,USERDUZ,.01),1:"UNKNOWN")
+5 SET ATTEMPT=$PIECE(TIUD15,U,2)
+6 IF USER'="UNKNOWN"
SET USER=$$NAME^TIULS(USER,"LAST, FIRST")
+7 SET ATTEMPT=$SELECT(+ATTEMPT>0:$$DATE^TIULS(ATTEMPT,"MM/DD/YY HR:MIN"),1:"N/A")
+8 SET VHATDA=0
SET VHATDA=$PIECE(TIUD15,U)
+9 SET VHATITLE=$SELECT(+VHATDA:$PIECE($GET(^TIU(8926.1,+VHATDA,0)),U),1:"")
+10 SET TIUREC=$$SETFLD^VALM1(TIUCNT,"","NUMBER")
+11 SET TIUREC=$$SETFLD^VALM1(TIUTTL,TIUREC,"LOCAL")
+12 SET TIUREC=$$SETFLD^VALM1(ATTEMPT,TIUREC,"ATTEMPTED")
+13 SET TIUREC=$$SETFLD^VALM1(USER,TIUREC,"USER")
+14 SET TIUS=(2*TIUCNT)-1
+15 SET ^TMP("TIUMLIST",$JOB,TIUS,0)=TIUREC
+16 DO RESTORE^TIULM(TIUS)
+17 SET ^TMP("TIUMLIST",$JOB,"IDX",TIUS,TIUCNT)=""
+18 SET ^TMP("TIUMLIST",$JOB,"PICK",TIUCNT,TIUS)=""
+19 SET ^TMP("TIUMLISTIDX",$JOB,TIUCNT)=TIUS_U_TIUTDA_U_TIUTTL
+20 SET TIUS=+$GET(TIUS)+1
IF TIUS#5'>0
WRITE "."
+21 SET ^TMP("TIUMLIST",$JOB,TIUS,0)=$$SETFLD^VALM1(VHATITLE,"","VHATITLE")
+22 DO RESTORE^TIULM(TIUS)
+23 SET ^TMP("TIUMLIST",$JOB,"IDX",TIUS,TIUCNT)=""
+24 SET ^TMP("TIUMLIST",$JOB,"PICK",TIUCNT,TIUS)=""
+25 QUIT
+26 ;
STATXFRM(STATUS) ; Transform status
+1 QUIT $SELECT(STATUS="M":"MAPPED",STATUS="U":"UNMAPPED (ACTIVE)",STATUS="F":"FAILED Mapping Attempts",STATUS="A":"ACTIVE",STATUS="*":"MAPPED to INACTIVE STANDARD",1:"INACTIVE")
+2 ;
HDR ; Initialize header for review screen
+1 NEW TITLE,STATUS,MAPSTAT
SET STATUS=$PIECE(@VALMAR@(0),U,2)
+2 SET MAPSTAT=$$STATXFRM(STATUS)
+3 SET TITLE=MAPSTAT_$SELECT(STATUS'="F":" Titles",1:"")
+4 SET VALMHDR(1)=$$CENTER^TIULS(TITLE)
+5 SET VALMHDR(2)=" LOCAL Title"
+6 QUIT
+7 ;
VIDATTS(LINE) ; Set default video attributes for LINE
+1 DO RESTORE^TIULM(LINE)
DO FLDCTRL^VALM10(LINE,"NUMBER",IOINHI,IOINORM)
+2 QUIT
+3 ;
CLEAN ; Clean up your mess!
+1 KILL ^TMP("TIUMLIST",$JOB),^TMP("TIUMLISTIDX",$JOB)
DO CLEAN^VALM10
+2 KILL VALMY
+3 QUIT