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

TIUSRVLR.m

Go to the documentation of this file.
  1. TIUSRVLR ; SLC/JER - TIU RPCs ; 02/25/04
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**112**;Jun 20, 1997
  1. GETDOCS(TIUY,OVP,SEQUENCE) ; Get TIU Documents for a given Consult or
  1. ; Surgical Case
  1. N TIUDA,TIUI
  1. ;Initialize vars
  1. S (TIUDA,TIUI)=0,TIUY=$NA(^TMP("TIULIST",$J)) K @TIUY
  1. S SEQUENCE=$S($G(SEQUENCE)]"":$G(SEQUENCE),1:"D")
  1. ;Loop through "G" X-ref in 8925 to find associated documents
  1. F S TIUDA=$O(^TIU(8925,"G",OVP,TIUDA)) Q:+TIUDA'>0 D
  1. . S TIUI=TIUI+1
  1. . ; Cross-check value of field 1405 with x-ref value
  1. . I OVP'=$P($G(^TIU(8925,TIUDA,14)),U,5) Q
  1. . ; If a document is an ID Entry, get its parent
  1. . ; I +$G(^TIU(8925,TIUDA,21)) S TIUDA=+$G(^TIU(8925,TIUDA,21))
  1. . ; Don't include entry in list more than once
  1. . I +$O(@TIUY@("INDX",TIUDA,0)) Q
  1. . ; Don't include entry in list if RETRACTED
  1. . I $P($G(^TIU(8925,TIUDA,0)),U,5)=15 Q
  1. . S @TIUY@(TIUI)=TIUDA_U_$$RESOLVE^TIUSRVLO(TIUDA)
  1. . S @TIUY@("INDX",TIUDA,TIUI)=""
  1. . I +$$HASDAD^TIUSRVLI(TIUDA) D SETDAD^TIUSRVLI(.TIUY,TIUDA,.TIUI)
  1. . I +$$HASKIDS^TIUSRVLI(TIUDA) D SETKIDS^TIUSRVLI(.TIUY,TIUDA,.TIUI)
  1. Q