TIURH ; SLC/JER - Review Screen Header ;5/7/03
;;1.0;TEXT INTEGRATION UTILITIES;**113,207**;Jun 20, 1997
HDR ; Initialize header for clinician's review screen
N BY,TIUI,TIUX,SCREEN,STATUS,RANGE,TIUBY,TIUDOCS,XREF,TIUNAME
S TIUX=$G(^TMP("TIUR",$J,0)),STATUS=$P(TIUX,U,2),SCREEN=$P(TIUX,U,3,99)
S VALM("TITLE")=$S($L(STATUS,",")>1:$S(VALM("ENTITY")="Document":"Clinical",1:""),1:STATUS)
I $G(XQY0)["MY UNSIGNED" S VALM("TITLE")="MY UNSIGNED"
S:$L(VALM("TITLE")) VALM("TITLE")=VALM("TITLE")_" "
S VALM("TITLE")=VALM("TITLE")_$S($L(VALM("ENTITY")):$$NTTNM(VALM("ENTITY")),1:"Document")_"s"
I +TIUEDT>1 S RANGE=" from "_$$DATE^TIULS(TIUEDT,"MM/DD/YY")_" to "_$$DATE^TIULS(TIULDT,"MM/DD/YY")
F TIUI=1:1:$L(SCREEN,";") D
. S XREF=$P($P(SCREEN,";",TIUI),U),XREF=$O(^TIU(8925.8,"C",XREF,0))
. I $D(TIUQUIK) D
. . S TIUBY=$G(TIUBY)_$S($G(TIUBY)]"":" or ",1:"")
. E D
. . S TIUBY=$G(TIUBY)_$S($G(TIUBY)]"":" and ",1:"")
. S TIUNAME=$P($G(^TIU(8925.8,+XREF,0)),U)
. I TIUNAME="ALL CATEGORIES",$G(^TMP("TIUR",$J,"TITLE OVERRIDE"))["TITLE" S TIUNAME="TITLE"
. S TIUBY=$G(TIUBY)_TIUNAME
. S:$P($P(SCREEN,";",TIUI),U,3)]"" TIUBY=$G(TIUBY)_" ("_$P($P(SCREEN,";",TIUI),U,3)_")"
S BY="by "_TIUBY
; I BY'["ALL",(BY'["SUBJECT") S BY=BY_" for "_$P($P(SCREEN,U,3),";")
S VALMHDR(1)=$$CENTER^TIULS(BY_$S($L(SCREEN,";")=1:$G(RANGE),1:""))
S TIUDOCS=$J(+$G(^TMP("TIUR",$J,0)),4)_" documents"
S VALMHDR(1)=$$SETSTR^VALM1(TIUDOCS,VALMHDR(1),(IOM-$L(TIUDOCS)),$L(TIUDOCS))
; I $L($G(RANGE)) S VALMHDR(2)=$$CENTER^TIULS(RANGE)
Q
NTTNM(NAME) ; Handle plural names appropriately
I "Yy"[$E(NAME,$L(NAME)) S NAME=$E(NAME,1,($L(NAME)-1))_"ie"
I NAME="Discharge Summarie" S NAME="Disch Summarie"
Q NAME
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HTIURH 1727 printed Dec 13, 2024@02:45:18 Page 2
TIURH ; SLC/JER - Review Screen Header ;5/7/03
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**113,207**;Jun 20, 1997
HDR ; Initialize header for clinician's review screen
+1 NEW BY,TIUI,TIUX,SCREEN,STATUS,RANGE,TIUBY,TIUDOCS,XREF,TIUNAME
+2 SET TIUX=$GET(^TMP("TIUR",$JOB,0))
SET STATUS=$PIECE(TIUX,U,2)
SET SCREEN=$PIECE(TIUX,U,3,99)
+3 SET VALM("TITLE")=$SELECT($LENGTH(STATUS,",")>1:$SELECT(VALM("ENTITY")="Document":"Clinical",1:""),1:STATUS)
+4 IF $GET(XQY0)["MY UNSIGNED"
SET VALM("TITLE")="MY UNSIGNED"
+5 if $LENGTH(VALM("TITLE"))
SET VALM("TITLE")=VALM("TITLE")_" "
+6 SET VALM("TITLE")=VALM("TITLE")_$SELECT($LENGTH(VALM("ENTITY")):$$NTTNM(VALM("ENTITY")),1:"Document")_"s"
+7 IF +TIUEDT>1
SET RANGE=" from "_$$DATE^TIULS(TIUEDT,"MM/DD/YY")_" to "_$$DATE^TIULS(TIULDT,"MM/DD/YY")
+8 FOR TIUI=1:1:$LENGTH(SCREEN,";")
Begin DoDot:1
+9 SET XREF=$PIECE($PIECE(SCREEN,";",TIUI),U)
SET XREF=$ORDER(^TIU(8925.8,"C",XREF,0))
+10 IF $DATA(TIUQUIK)
Begin DoDot:2
+11 SET TIUBY=$GET(TIUBY)_$SELECT($GET(TIUBY)]"":" or ",1:"")
End DoDot:2
+12 IF '$TEST
Begin DoDot:2
+13 SET TIUBY=$GET(TIUBY)_$SELECT($GET(TIUBY)]"":" and ",1:"")
End DoDot:2
+14 SET TIUNAME=$PIECE($GET(^TIU(8925.8,+XREF,0)),U)
+15 IF TIUNAME="ALL CATEGORIES"
IF $GET(^TMP("TIUR",$JOB,"TITLE OVERRIDE"))["TITLE"
SET TIUNAME="TITLE"
+16 SET TIUBY=$GET(TIUBY)_TIUNAME
+17 if $PIECE($PIECE(SCREEN,";",TIUI),U,3)]""
SET TIUBY=$GET(TIUBY)_" ("_$PIECE($PIECE(SCREEN,";",TIUI),U,3)_")"
End DoDot:1
+18 SET BY="by "_TIUBY
+19 ; I BY'["ALL",(BY'["SUBJECT") S BY=BY_" for "_$P($P(SCREEN,U,3),";")
+20 SET VALMHDR(1)=$$CENTER^TIULS(BY_$SELECT($LENGTH(SCREEN,";")=1:$GET(RANGE),1:""))
+21 SET TIUDOCS=$JUSTIFY(+$GET(^TMP("TIUR",$JOB,0)),4)_" documents"
+22 SET VALMHDR(1)=$$SETSTR^VALM1(TIUDOCS,VALMHDR(1),(IOM-$LENGTH(TIUDOCS)),$LENGTH(TIUDOCS))
+23 ; I $L($G(RANGE)) S VALMHDR(2)=$$CENTER^TIULS(RANGE)
+24 QUIT
NTTNM(NAME) ; Handle plural names appropriately
+1 IF "Yy"[$EXTRACT(NAME,$LENGTH(NAME))
SET NAME=$EXTRACT(NAME,1,($LENGTH(NAME)-1))_"ie"
+2 IF NAME="Discharge Summarie"
SET NAME="Disch Summarie"
+3 QUIT NAME