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

TIUGBR.m

Go to the documentation of this file.
  1. TIUGBR ; SLC/MAM - ID Browse Action Subroutines: HASIDKID, HASIDDAD, DADORKID, IDTOP, LOADID, GETKIDS ;8/16/06 13:32
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**100,211**;Jun 20, 1997;Build 26
  1. ; Similar to TIUBR, but for ID notes
  1. ;
  1. GETKIDS(TIUDA) ; Set ID kids of TIUDA into array
  1. ; ^TMP("TIUGKID",$J,REFERENCE DATE,TIUKID)="":
  1. N TIUKID,REFDATE
  1. S TIUKID=0
  1. F S TIUKID=$O(^TIU(8925,"GDAD",+TIUDA,TIUKID)) Q:+TIUKID'>0 D
  1. . S REFDATE=+$G(^TIU(8925,TIUKID,13))
  1. . S ^TMP("TIUGKID",$J,REFDATE,TIUKID)=""
  1. Q
  1. ;
  1. HASIDKID(DA) ; Function returns 1 if DA has ID kid, else 0.
  1. N TIUY
  1. S TIUY=0
  1. I $O(^TIU(8925,"GDAD",+DA,0)) S TIUY=1
  1. Q TIUY
  1. ;
  1. HASIDDAD(DA) ; Function returns ID parent of DA if DA has parent; else 0.
  1. Q +$G(^TIU(8925,DA,21),0)
  1. ;
  1. DADORKID(DA) ; Function returns DA if DA has ID kid,
  1. ;or ID dad IFN if DA has ID dad, else 0.
  1. N TIUY
  1. S TIUY=0
  1. I $O(^TIU(8925,"GDAD",+DA,0)) S TIUY=DA G ORKIDX
  1. I +$G(^TIU(8925,DA,21)) S TIUY=^TIU(8925,DA,21)
  1. ORKIDX Q TIUY
  1. ;
  1. IDTOP(TIUDA,TIUL,SHORT,CURPRNT) ; Load entry-specific info:
  1. ;Title, [Location, Visit] for ID entry.
  1. ; Called by LOADTOP^TIUBR
  1. N TIUY,TIU,DFN
  1. I CURPRNT S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=" << Interdisciplinary Note >>"
  1. I SHORT S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=" << Interdisciplinary Note - Cont. >>"
  1. D GETTIU^TIULD(.TIU,+TIUDA)
  1. I 'SHORT D
  1. . S TIUL=$G(TIUL)+1,TIUY=""
  1. . S TIUY=$$SETSTR^VALM1("LOCATION: "_$P($G(TIU("LOC")),U,2),$G(TIUY),1,31)
  1. . I $L($G(TIU("WARD"))) S TIUY=$$SETSTR^VALM1("ADMISSION DATE: "_$P($G(TIU("EDT")),U,2),$G(TIUY),34,37) I 1
  1. . E S TIUY=$$SETSTR^VALM1("VISIT DATE: "_$P($G(TIU("EDT")),U,2),$G(TIUY),38,33)
  1. . S @VALMAR@(TIUL,0)=TIUY
  1. S TIUL=+$G(TIUL)+1,TIUY=""
  1. S TIUY=$$SETSTR^VALM1("LOCAL TITLE: "_$P($G(TIU("DOCTYP")),U,2),$G(TIUY),1,67)
  1. S @VALMAR@(TIUL,0)=TIUY
  1. Q
  1. ;
  1. LOADID(TIUDA,TIUL,TIUGDATA,TIUGWHOL) ; Load ID entry TIUDA for browse
  1. ; Requires TIUDA, array TIUL, TIUGDATA;
  1. ; Optional TIUGWHOL (see rtn TIUBR).
  1. N TIUREC,TIU,DFN
  1. I '$D(^TIU(8925,+TIUDA,0)) S VALMQUIT=1 Q
  1. ; ---- If ID Kid has focus, don't show it again ----
  1. ; I +$G(^TMP("TIU FOCUS",$J))=TIUDA Q
  1. S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=""
  1. D GETTIU^TIULD(.TIU,+TIUDA)
  1. D INQUIRE(TIUDA,.TIUREC)
  1. ; ---- Load info missing from header since this is ID note entry: ----
  1. ; ---- Load dictation, transcription data, etc.: ----
  1. D LOADTOP^TIUBR(.TIUREC,TIUDA,.TIUL,TIUGDATA)
  1. ; ---- Load the remainder of the record: ----
  1. D LOADREC^TIUBR1(TIUDA,.TIUL,TIUGDATA,$G(TIUGWHOL))
  1. Q
  1. ;
  1. INQUIRE(TIUDA,TIUREC) ; Inquire to document TIUDA and set TIUREC
  1. N DA,DIC,DIQ,DR
  1. S DA=TIUDA,DIC=8925,DIQ="TIUREC("
  1. S DR=".01;.02;.05;.09;1201;1202;1208;1209;1301;1307;1501;1502;1505;1506;89261"
  1. D EN^DIQ1
  1. Q