TIURL1 ; SLC/JER - List Management Library ;11/26/00
;;1.0;TEXT INTEGRATION UTILITIES;**100**;Jun 20, 1997
; New rtn created 11/14/00 by splitting TIURL
;
UPIDDATA(TIUDA) ; Update (or kill) ^TMP("TIUR",$J,"IDDATA",TIUDA)
K ^TMP("TIUR",$J,"IDDATA",TIUDA)
Q:'$D(^TIU(8925,TIUDA))
S IDDATA=$$IDDATA^TIURECL1(TIUDA) ; =TIUDA^hasIDkid^IDdadDA^prmsort
I IDDATA S ^TMP("TIUR",$J,"IDDATA",TIUDA)=IDDATA
Q
;
UPPFIX(TIUDA,OLDPFIX) ; Returns prefix with indicators updated
;for changes to record TIUDA (e.g. has new addendum).
; Returned prefix has same level as received prefix OLDPFIX.
; Returned prefix is set for UNEXPANDED state of record.
; OLDPFIX may be that of a record at any level of the treeview,
;in any state of expansion.
N ORIGPFIX,NEWPFIX
S ORIGPFIX=$$PREFIX^TIULA2(TIUDA,0)
I OLDPFIX["|_" S NEWPFIX=$P(OLDPFIX,"|_")_"|_"_ORIGPFIX
E S NEWPFIX=ORIGPFIX
Q NEWPFIX
;
SETPT(LINENO) ; Set prefix_patient column of ^TMP("TIUR",$J,LINENO,0)
;after item prefix is changed (e.g. item has new addendum).
; Updated prefix is at same level of treeview as received prefix,
;has updated indicators, but is in UNEXPANDED state.
N CURPFIX,TEXT,TIUDA,IDDATA,NEWPFIX,ITEMNODE
S ITEMNODE=^TMP("TIURIDX",$J,LINENO)
S TIUDA=$P(ITEMNODE,U,2),CURPFIX=$P(ITEMNODE,U,3)
S NEWPFIX=$$UPPFIX(TIUDA,CURPFIX)
S TEXT=^TMP("TIUR",$J,LINENO,0)
S TEXT=$$SETTLPT^TIURECL1(TEXT,TIUDA,NEWPFIX)
S ^TMP("TIUR",$J,LINENO,0)=TEXT
S $P(^TMP("TIURIDX",$J,LINENO),U,3)=NEWPFIX
Q
;
ITEM(TIUDA) ; Find which item in the list is occupied by TIUDA
N TIUI,TIUY S (TIUI,TIUY)=0
F S TIUI=$O(^TMP("TIURIDX",$J,TIUI)) Q:+TIUI'>0!+TIUY D
. I $P(^TMP("TIURIDX",$J,TIUI),U,2)=TIUDA S TIUY=TIUI
Q TIUY
BREATHE(ITEM,ONCE) ; Collapse/Expand treeview on changes
D EC1^TIURECL(ITEM,1) ; Collapse or expand once
D:'+$D(ONCE) EC1^TIURECL(ITEM,1) ; if ONCE is not sent, do it again
Q
TIURL1 ; SLC/JER - List Management Library ;11/26/00
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**100**;Jun 20, 1997
+2 ; New rtn created 11/14/00 by splitting TIURL
+3 ;
UPIDDATA(TIUDA) ; Update (or kill) ^TMP("TIUR",$J,"IDDATA",TIUDA)
+1 KILL ^TMP("TIUR",$JOB,"IDDATA",TIUDA)
+2 IF '$DATA(^TIU(8925,TIUDA))
QUIT
+3 ; =TIUDA^hasIDkid^IDdadDA^prmsort
SET IDDATA=$$IDDATA^TIURECL1(TIUDA)
+4 IF IDDATA
SET ^TMP("TIUR",$JOB,"IDDATA",TIUDA)=IDDATA
+5 QUIT
+6 ;
UPPFIX(TIUDA,OLDPFIX) ; Returns prefix with indicators updated
+1 ;for changes to record TIUDA (e.g. has new addendum).
+2 ; Returned prefix has same level as received prefix OLDPFIX.
+3 ; Returned prefix is set for UNEXPANDED state of record.
+4 ; OLDPFIX may be that of a record at any level of the treeview,
+5 ;in any state of expansion.
+6 NEW ORIGPFIX,NEWPFIX
+7 SET ORIGPFIX=$$PREFIX^TIULA2(TIUDA,0)
+8 IF OLDPFIX["|_"
SET NEWPFIX=$PIECE(OLDPFIX,"|_")_"|_"_ORIGPFIX
+9 IF '$TEST
SET NEWPFIX=ORIGPFIX
+10 QUIT NEWPFIX
+11 ;
SETPT(LINENO) ; Set prefix_patient column of ^TMP("TIUR",$J,LINENO,0)
+1 ;after item prefix is changed (e.g. item has new addendum).
+2 ; Updated prefix is at same level of treeview as received prefix,
+3 ;has updated indicators, but is in UNEXPANDED state.
+4 NEW CURPFIX,TEXT,TIUDA,IDDATA,NEWPFIX,ITEMNODE
+5 SET ITEMNODE=^TMP("TIURIDX",$JOB,LINENO)
+6 SET TIUDA=$PIECE(ITEMNODE,U,2)
SET CURPFIX=$PIECE(ITEMNODE,U,3)
+7 SET NEWPFIX=$$UPPFIX(TIUDA,CURPFIX)
+8 SET TEXT=^TMP("TIUR",$JOB,LINENO,0)
+9 SET TEXT=$$SETTLPT^TIURECL1(TEXT,TIUDA,NEWPFIX)
+10 SET ^TMP("TIUR",$JOB,LINENO,0)=TEXT
+11 SET $PIECE(^TMP("TIURIDX",$JOB,LINENO),U,3)=NEWPFIX
+12 QUIT
+13 ;
ITEM(TIUDA) ; Find which item in the list is occupied by TIUDA
+1 NEW TIUI,TIUY
SET (TIUI,TIUY)=0
+2 FOR
SET TIUI=$ORDER(^TMP("TIURIDX",$JOB,TIUI))
IF +TIUI'>0!+TIUY
QUIT
Begin DoDot:1
+3 IF $PIECE(^TMP("TIURIDX",$JOB,TIUI),U,2)=TIUDA
SET TIUY=TIUI
End DoDot:1
+4 QUIT TIUY
BREATHE(ITEM,ONCE) ; Collapse/Expand treeview on changes
+1 ; Collapse or expand once
DO EC1^TIURECL(ITEM,1)
+2 ; if ONCE is not sent, do it again
IF '+$DATA(ONCE)
DO EC1^TIURECL(ITEM,1)
+3 QUIT