160 lines
7.0 KiB
Mathematica
160 lines
7.0 KiB
Mathematica
TIUSRVR1 ; SLC/JER - RPC for record-wise GET ;8/16/06 11:48
|
|
;;1.0;TEXT INTEGRATION UTILITIES;**19,32,87,89,100,109,112,173,186,208,211,222**;Jun 20, 1997
|
|
TGET(TIUY,TIUDA,ACTION) ; Build ^TMP("TIUVIEW",$J,
|
|
N TIUL,TIUREC,TIUARR,TIUGDATA,TIUNAME,TIUPRM0,TIUPRM1,X,Y,TIUCPF,ONBROWSE
|
|
K ^TMP("TIUVIEW",$J),^TMP("TIU FOCUS",$J)
|
|
S ACTION=$G(ACTION,"VIEW"),TIUL=0
|
|
D SETPARM^TIULE
|
|
S TIUGDATA=$$SETGDATA(TIUDA)
|
|
S TIUY=$NA(^TMP("TIUVIEW",$J))
|
|
S TIUARR="^TMP(""TIUVIEW"",$J)"
|
|
I '$D(^TIU(8925,+TIUDA,0)) S VALMQUIT=1 Q
|
|
; Initialize ^TMP("TIU FOCUS",$J) to the entry that has focus
|
|
S ^TMP("TIU FOCUS",$J)=TIUDA
|
|
; if the document has a browse action, execute it
|
|
S ONBROWSE=$$ONBROWSE^TIULC1(+$G(^TIU(8925,+TIUDA,0)))
|
|
I $L(ONBROWSE) D LOADSUPP(ONBROWSE,TIUDA,.TIUL)
|
|
; Call INQUIRE to get record
|
|
;Set a flag to indicate whether or not a Title is a memer of the
|
|
;Clinical Procedures Class (1=Yes and 0=No)
|
|
S TIUCPF=+$$ISA^TIULX(+$G(^TIU(8925,TIUDA,0)),+$$CLASS^TIUCP)
|
|
; Call INQUIRE to get record
|
|
D INQUIRE^TIUSRVR2(TIUDA,.TIUREC,TIUCPF)
|
|
; First, load dictation, transcription data, etc.
|
|
D LOADTOP(.TIUREC,TIUDA,.TIUL,TIUGDATA,TIUCPF)
|
|
; Next, load the remainder of the record
|
|
D LOADREC^TIUSRVR2(TIUDA,.TIUL,TIUGDATA,0,ACTION)
|
|
;
|
|
; *222 display closing & footer data for FORM LETTERS only
|
|
I +$$MEMBEROF^TIUPR222(+$G(^TIU(8925,+TIUDA,0)),"FORM LETTERS") D
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)="" D GUIVIEW^TIUFLP1(TIUDA,"CLS",.TIUL,.TIUARR)
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)="" D GUIVIEW^TIUFLP1(TIUDA,"FTR",.TIUL,.TIUARR)
|
|
;
|
|
K ^TMP("TIU FOCUS",$J)
|
|
S VALMCNT=+$G(TIUL)
|
|
Q
|
|
SETGDATA(TIUDA) ; Set TIUGDATA
|
|
N TIUDPRM,TIUY,SORT S TIUY=""
|
|
D DOCPRM^TIULC1(+$G(^TIU(8925,TIUDA,0)),.TIUDPRM,TIUDA)
|
|
S SORT=$S(+$P(TIUDPRM(0),U,18):"TITLE",1:"REFDT")
|
|
I +$G(^TIU(8925,TIUDA,21)) S TIUY=TIUDA_U_0_U_+$G(^(21))_U_SORT G SETGX
|
|
I +$O(^TIU(8925,"GDAD",TIUDA,0)) S TIUY=TIUDA_U_1_U_0_U_SORT
|
|
SETGX Q TIUY
|
|
LOADSUPP(METHOD,TIUDA,TIUL) ; Execute OnBrowse/Load Supplementary data
|
|
N TIUY,TIUI S TIUI=0
|
|
X METHOD I '$D(@TIUY) Q
|
|
F S TIUI=$O(@TIUY@(TIUI)) Q:+TIUI'>0 D
|
|
. S TIUL=+$G(TIUL)+1,@TIUARR@(TIUL,0)=$G(@TIUY@(TIUI))
|
|
S TIUL=+$G(TIUL)+1,@TIUARR@(TIUL,0)=" "
|
|
K @TIUY
|
|
Q
|
|
LOADTOP(TIUREC,TIUDA,TIUL,TIUGDATA,TIUCPF) ; Load top information
|
|
N TIUY,SHORT,CURCHLD,CURPRNT,SELCHLD,SELPRNT
|
|
; ---- For ID note, include Title, [Location, & Visit] with each
|
|
; entry, since they vary by entry.
|
|
; ---- Follow with Date, Author, etc.
|
|
; ---- For ID children in whole note display, shorten top info:
|
|
; Instead of Title, Location, Visit, Date, Author, etc.,
|
|
; use just Title, followed by just Date and Status:
|
|
S (SHORT,CURCHLD,CURPRNT,SELCHLD,SELPRNT)=0
|
|
I $P(TIUGDATA,U,3) S SELCHLD=1 ; Selected record was IDchild
|
|
I $P(TIUGDATA,U,2) S SELPRNT=1
|
|
I SELCHLD,TIUDA'=$P(TIUGDATA,U,3) S CURCHLD=1 ; Current rec is IDchild
|
|
I SELCHLD,TIUDA=$P(TIUGDATA,U,3) S CURPRNT=1
|
|
I SELPRNT,TIUDA=+TIUGDATA S CURPRNT=1
|
|
I SELPRNT,TIUDA'=+TIUGDATA S CURCHLD=1
|
|
I SELPRNT,CURCHLD S SHORT=1 ;Child in whole note: shorten top info
|
|
I SELCHLD,CURCHLD,$G(TIUGWHOL) S SHORT=1
|
|
I SELCHLD!SELPRNT D IDTOP(TIUDA,.TIUL,SHORT,CURPRNT) I 1
|
|
S TIUY=""
|
|
E I $L(TIUREC(8925,+TIUDA,.01)) D
|
|
. S TIUY=$$SETSTR^VALM1("LOCAL TITLE: "_TIUREC(8925,+TIUDA,.01),TIUY,2,64)
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)=TIUY
|
|
S TIUY=""
|
|
I $L($G(TIUREC(8925,+TIUDA,89261))) D
|
|
. S TIUY=$$SETSTR^VALM1("STANDARD TITLE: "_TIUREC(8925,+TIUDA,89261),TIUY,1,64)
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)=TIUY
|
|
S TIUY=""
|
|
I SHORT D
|
|
. S TIUY=$$SETSTR^VALM1("DATE OF NOTE: "_TIUREC(8925,+TIUDA,1301),TIUY,1,39)
|
|
. S TIUY=$$SETSTR^VALM1("STATUS: "_TIUREC(8925,+TIUDA,.05),TIUY,42,38)
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)=TIUY
|
|
S TIUY=""
|
|
I 'SHORT D
|
|
. I $L(TIUREC(8925,+TIUDA,1307)) D I 1
|
|
. . S TIUY=$$SETSTR^VALM1("DICT DATE: "_TIUREC(8925,+TIUDA,1307),TIUY,4,39)
|
|
. E S TIUY=$$SETSTR^VALM1("DATE OF NOTE: "_TIUREC(8925,+TIUDA,1301),TIUY,1,39)
|
|
. S TIUY=$$SETSTR^VALM1("ENTRY DATE: "_TIUREC(8925,+TIUDA,1201),$G(TIUY),38,39)
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)=TIUY
|
|
. S TIUY=""
|
|
. I $L(TIUREC(8925,+TIUDA,1307)) D I 1
|
|
. . S TIUY=$$SETSTR^VALM1("DICTATED BY: "_TIUREC(8925,+TIUDA,1202),TIUY,2,32)
|
|
. E S TIUY=$$SETSTR^VALM1("AUTHOR: "_TIUREC(8925,+TIUDA,1202),TIUY,7,27)
|
|
. I +$G(^TIU(8925,+TIUDA,0))=$$CHKFILE^TIUADCL(8925.1,"OPERATION REPORT","I $P(^(0),U,4)=""DOC""") S TIUY=$$SETSTR^VALM1(" SURGEON: "_TIUREC(8925,+TIUDA,1202),TIUY,2,32)
|
|
. I $L(TIUREC(8925,+TIUDA,1209)) D I 1
|
|
. . S TIUY=$$SETSTR^VALM1("ATTENDING: "_TIUREC(8925,+TIUDA,1209),TIUY,39,40)
|
|
. E S TIUY=$$SETSTR^VALM1("EXP COSIGNER: "_TIUREC(8925,+TIUDA,1208),TIUY,36,40)
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)=TIUY
|
|
. S TIUY=""
|
|
. S TIUY=$$SETSTR^VALM1("URGENCY: "_TIUREC(8925,+TIUDA,.09),TIUY,6,36)
|
|
. S TIUY=$$SETSTR^VALM1("STATUS: "_TIUREC(8925,+TIUDA,.05),TIUY,42,38)
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)=TIUY
|
|
; * 173
|
|
I TIUREC(8925,+TIUDA,.05)="UNCOSIGNED" D
|
|
. S TIUY="",TIUL=TIUL+1,@TIUARR@(TIUL)=TIUY
|
|
. S TIUY="",TIUL=TIUL+1,TIUY=$$SETSTR^VALM1("*** NOT YET COSIGNED ***",TIUY,20,51),@TIUARR@(TIUL)=TIUY
|
|
S TIUY=""
|
|
I '$L($G(^TIU(8925,+TIUDA,17))) D I 1
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)=TIUY
|
|
E D
|
|
. S TIUY=$$SETSTR^VALM1("SUBJECT: "_$G(^TIU(8925,+TIUDA,17)),TIUY,6,74)
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)=TIUY
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)=""
|
|
;If the document is a member of the Clinical Procedures Class, include the
|
|
; Procedure Summary Code field and the Date/Time Performed field
|
|
I $G(TIUCPF) D
|
|
. S TIUL=TIUL+1,TIUY=""
|
|
. S TIUY=$$SETSTR^VALM1("PROCEDURE SUMMARY CODE: "_TIUREC(8925,+TIUDA,70201),$G(TIUY),1,54)
|
|
. S @TIUARR@(TIUL)=TIUY
|
|
. S TIUL=TIUL+1,TIUY=""
|
|
. S TIUY=$$SETSTR^VALM1("DATE/TIME PERFORMED: "_TIUREC(8925,+TIUDA,70202),$G(TIUY),1,41)
|
|
. S @TIUARR@(TIUL)=TIUY
|
|
. S TIUL=TIUL+1,TIUY="",@TIUARR@(TIUL)=TIUY
|
|
I +$$HASADDEN^TIULC1(TIUDA) D
|
|
. S TIUY=" *** "_$$PNAME^TIULC1(+$G(^TIU(8925,TIUDA,0)))
|
|
. S TIUY=TIUY_" Has ADDENDA ***"
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)=TIUY
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)=""
|
|
; *222 display header data for FORM LETTERS only
|
|
I +$$MEMBEROF^TIUPR222(+$G(^TIU(8925,+TIUDA,0)),"FORM LETTERS") D
|
|
. D GUIVIEW^TIUFLP1(TIUDA,"HDR",.TIUL,.TIUARR)
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)=""
|
|
Q
|
|
;
|
|
ISCOMP(DA) ; Evaluate whether a given record is a component
|
|
N TIUY,TIUTYP
|
|
S TIUTYP=+$G(^TIU(8925,DA,0))
|
|
S TIUY=$S($P($G(^TIU(8925.1,+TIUTYP,0)),U,4)="CO":1,1:0)
|
|
Q TIUY
|
|
IDTOP(TIUDA,TIUL,SHORT,CURPRNT) ; Load entry-specific info:
|
|
;Title, [Location, Visit] for ID entry.
|
|
; Called by LOADTOP
|
|
N TIUY,TIUX,TIU
|
|
I CURPRNT S TIUL=+$G(TIUL)+1,@TIUARR@(TIUL)=" << Interdisciplinary Note >>"
|
|
I SHORT S TIUL=+$G(TIUL)+1,@TIUARR@(TIUL)=" << Interdisciplinary Note - Cont. >>"
|
|
D GETTIU^TIULD(.TIU,+TIUDA)
|
|
I 'SHORT D
|
|
. S TIUY="",TIUX="LOCATION: "_$P($G(TIU("LOC")),U,2)
|
|
. S TIUY=$$SETSTR^VALM1(TIUX,TIUY,1,31)
|
|
. I $L($G(TIU("WARD"))) D I 1
|
|
. . S TIUX="ADMISSION DATE: "_$P($G(TIU("EDT")),U,2)
|
|
. . S TIUY=$$SETSTR^VALM1(TIUX,TIUY,34,37)
|
|
. E D
|
|
. . S TIUX="VISIT DATE: "_$P($G(TIU("EDT")),U,2)
|
|
. . S TIUY=$$SETSTR^VALM1(TIUX,TIUY,38,33)
|
|
. S TIUL=TIUL+1,@TIUARR@(TIUL)=TIUY
|
|
S TIUY="",TIUX="LOCAL TITLE: "_$P($G(TIU("DOCTYP")),U,2)
|
|
S TIUY=$$SETSTR^VALM1(TIUX,TIUY,1,67)
|
|
S TIUL=TIUL+1,@TIUARR@(TIUL)=TIUY
|
|
Q
|