[613] | 1 | TIUBR1 ;SLC/JER - Enter TIU Browse with DFN and TIUDA ;8/21/01 [12/15/04 9:18am]
|
---|
| 2 | ;;1.0;TEXT INTEGRATION UTILITIES;**31,100,123,176,157**;Jun 20, 1997
|
---|
| 3 | ; Move LOADSIG, XTRASIG, LOADFOR, LOADREC from TIUBR. **100**
|
---|
| 4 | ;
|
---|
| 5 | LOADREC(TIUDA,TIUL,TIUGDATA,TIUGWHOL) ; Load ^TMP
|
---|
| 6 | ;Requires TIUDA, array TIUL, TIUGDATA
|
---|
| 7 | ;Optional TIUGWHOL = 1 if we're mid-load for browse, and we're already
|
---|
| 8 | ; loading the whole note after the selected child,
|
---|
| 9 | ; so DON'T load the whole note again.
|
---|
| 10 | N TIUKID,TIUI,CANSEE,TIUPARNT,TIUPNAME,TIUPDATE
|
---|
| 11 | N TIUGPRNT,TIUPDATA,TIUHASKD
|
---|
| 12 | S TIUI=0
|
---|
| 13 | ; ---- If user cannot view TIUDA, say so,
|
---|
| 14 | ; [load the rest of the ID note], & quit: ----
|
---|
| 15 | S CANSEE=$S(+$$ISCOMP^TIUBR(TIUDA)>0:1,1:$$CANDO^TIULP(+TIUDA,"VIEW"))
|
---|
| 16 | I +CANSEE'>0 D Q
|
---|
| 17 | . S TIUL=+$G(TIUL)+1
|
---|
| 18 | . S @VALMAR@(TIUL,0)=$P(CANSEE,U,2)
|
---|
| 19 | . I $P(TIUGDATA,U,2)!$P(TIUGDATA,U,3) D IDREST(TIUDA,.TIUL,TIUGDATA,.TIUGWHOL)
|
---|
| 20 | ; ---- Load text of TIUDA: ----
|
---|
| 21 | F S TIUI=$O(^TIU(8925,+TIUDA,"TEXT",TIUI)) Q:+TIUI'>0 D
|
---|
| 22 | . S TIUL=+$G(TIUL)+1
|
---|
| 23 | . S @VALMAR@(TIUL,0)=$G(^TIU(8925,+TIUDA,"TEXT",+TIUI,0))
|
---|
| 24 | ; ---- If TIUDA is a COMPONENT, QUIT
|
---|
| 25 | Q:+$$ISCOMP^TIUBR(TIUDA)
|
---|
| 26 | ; ---- If TIUDA **IS** an addendum, load addm signature,
|
---|
| 27 | ; load original document, quit: ----
|
---|
| 28 | I +$$ISADDNDM^TIULC1(+TIUDA) D Q
|
---|
| 29 | . N TIULINE S $P(TIULINE,"=",79)=""
|
---|
| 30 | . D LOADSIG(TIUDA,.TIUL)
|
---|
| 31 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=""
|
---|
| 32 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=TIULINE
|
---|
| 33 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=""
|
---|
| 34 | . S TIUPARNT=+$P(^TIU(8925,+TIUDA,0),U,6)
|
---|
| 35 | . S TIUPNAME=$$PNAME^TIULC1(+^TIU(8925,TIUPARNT,0))
|
---|
| 36 | . S TIUPDATE=+$G(^TIU(8925,TIUPARNT,13))
|
---|
| 37 | . S TIUPDATE=$$DATE^TIULS(TIUPDATE,"MM/DD/YY")
|
---|
| 38 | . S TIUPDATA=$$IDDATA^TIURECL1(TIUPARNT)
|
---|
| 39 | . S TIUHASKD=$P(TIUPDATA,U,2),TIUGPRNT=+$P(TIUPDATA,U,3)
|
---|
| 40 | . S TIUL=+$G(TIUL)+1
|
---|
| 41 | . I 'TIUHASKD,'TIUGPRNT D
|
---|
| 42 | . . S @VALMAR@(TIUL,0)=" --- Original Document ---"
|
---|
| 43 | . . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=""
|
---|
| 44 | . . S TIUL=+$G(TIUL)+1
|
---|
| 45 | . . S @VALMAR@(TIUL,0)=TIUPDATE_" "_TIUPNAME_":"
|
---|
| 46 | . . D LOADREC(TIUPARNT,.TIUL,TIUGDATA)
|
---|
| 47 | . I TIUHASKD D
|
---|
| 48 | . . S @VALMAR@(TIUL,0)=" --- Addended Interdisciplinary Note ---"
|
---|
| 49 | . . D LOADID^TIUGBR(TIUPARNT,.TIUL,TIUPDATA,1)
|
---|
| 50 | . I TIUGPRNT D
|
---|
| 51 | . . S @VALMAR@(TIUL,0)=" --- Original Interdisciplinary Entry ---"
|
---|
| 52 | . . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=""
|
---|
| 53 | . . S TIUL=+$G(TIUL)+1
|
---|
| 54 | . . S @VALMAR@(TIUL,0)=TIUPDATE_" "_TIUPNAME_":"
|
---|
| 55 | . . D LOADREC(TIUPARNT,.TIUL,TIUGDATA)
|
---|
| 56 | . . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=""
|
---|
| 57 | . . S TIUL=+$G(TIUL)+1
|
---|
| 58 | . . S @VALMAR@(TIUL,0)=" --- Interdisciplinary Note ---"
|
---|
| 59 | . . D LOADID^TIUGBR(TIUGPRNT,.TIUL,TIUPDATA,1)
|
---|
| 60 | ; ---- Load components of TIUDA: ----
|
---|
| 61 | S TIUKID=0
|
---|
| 62 | F S TIUKID=$O(^TIU(8925,"DAD",+TIUDA,TIUKID)) Q:+TIUKID'>0 D
|
---|
| 63 | . I +$$ISADDNDM^TIULC1(TIUKID)'>0 D LOADREC(TIUKID,.TIUL,TIUGDATA)
|
---|
| 64 | ; ---- Load signature of TIUDA if TIUDA is not addm
|
---|
| 65 | ; or comp: ----
|
---|
| 66 | I '$$ISCOMP^TIUBR(TIUDA) D LOADSIG(TIUDA,.TIUL)
|
---|
| 67 | ; ---- Load addenda of TIUDA: ----
|
---|
| 68 | S TIUKID=0
|
---|
| 69 | F S TIUKID=$O(^TIU(8925,"DAD",+TIUDA,TIUKID)) Q:+TIUKID'>0 D
|
---|
| 70 | . ; If an addendum has focus, don't show it again unless
|
---|
| 71 | . ; loading whole ID note:
|
---|
| 72 | . I '$G(TIUGWHOL),+TIUKID=+$G(^TMP("TIU FOCUS",$J)) Q
|
---|
| 73 | . I +$$ISADDNDM^TIULC1(TIUKID) D LOADADD^TIUBR(TIUKID,.TIUL)
|
---|
| 74 | ; ---- Load the rest of the ID note display: ----
|
---|
| 75 | I $P(TIUGDATA,U,2)!$P(TIUGDATA,U,3) D IDREST(TIUDA,.TIUL,TIUGDATA,.TIUGWHOL)
|
---|
| 76 | Q
|
---|
| 77 | ;
|
---|
| 78 | IDREST(TIUDA,TIUL,TIUGDATA,TIUGWHOL) ; Load rest of ID note display
|
---|
| 79 | N IDDAD
|
---|
| 80 | S IDDAD=+$P(TIUGDATA,U,3)
|
---|
| 81 | ; ---- If Browsed Record is an ID child, & this cycle hasn't begun
|
---|
| 82 | ; loading the whole note, then load the whole ID Note after
|
---|
| 83 | ; the browsed child: ----
|
---|
| 84 | I IDDAD,'$G(TIUGWHOL) D Q
|
---|
| 85 | . S TIUGWHOL=1
|
---|
| 86 | . N TIULINE S $P(TIULINE,"=",79)=""
|
---|
| 87 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=""
|
---|
| 88 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=TIULINE
|
---|
| 89 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=""
|
---|
| 90 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=" --- Interdisciplinary Note ---"
|
---|
| 91 | . D LOADID^TIUGBR(IDDAD,.TIUL,TIUGDATA,TIUGWHOL)
|
---|
| 92 | ; ---- If Browsed Record is an ID parent, & this cycle has
|
---|
| 93 | ; just loaded the parent entry, OR
|
---|
| 94 | ; If Browsed Record is an ID child, & this cycle has begun
|
---|
| 95 | ; loading the whole ID note, and is currently loading the first
|
---|
| 96 | ; entry of the whole note,
|
---|
| 97 | ; Then load kids: ----
|
---|
| 98 | I $P(TIUGDATA,U,2)&(TIUDA=+TIUGDATA)!(IDDAD&$G(TIUGWHOL)&(TIUDA=IDDAD)) D
|
---|
| 99 | . D LOADKIDS^TIUBR(TIUDA,.TIUL,TIUGDATA,$G(TIUGWHOL)) K TIUGWHOL
|
---|
| 100 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=""
|
---|
| 101 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=" << Interdisciplinary Note - End >>"
|
---|
| 102 | Q
|
---|
| 103 | EXSTNOTE(DFN,TIUDA) ; Sample/display existing notes
|
---|
| 104 | N TIU,TIUPRM0,TIUPRM1,TIUSEE,TIUOUT,TIUY,TIUQUIT
|
---|
| 105 | D SETPARM^TIULE
|
---|
| 106 | Q:TIUDA'>0
|
---|
| 107 | D GETTIU^TIULD(.TIU,+TIUDA)
|
---|
| 108 | I $D(TIU) D
|
---|
| 109 | . S TIUSEE=$$CANDO^TIULP(TIUDA,"VIEW")
|
---|
| 110 | . I 'TIUSEE D Q
|
---|
| 111 | . . W !!,$C(7),$P(TIUSEE,U,2),!
|
---|
| 112 | . . W:$$READ^TIUU("FOA","Press RETURN to continue...") ""
|
---|
| 113 | . D EN^VALM("TIU BROWSE FOR CLINICIAN")
|
---|
| 114 | . K ^TMP("TIUVIEW",$J)
|
---|
| 115 | . S:$D(TIUQUIT) TIUOUT=1
|
---|
| 116 | Q
|
---|
| 117 | ;
|
---|
| 118 | LOADSIG(DA,TIUL) ; Get signature and co-signature blocks
|
---|
| 119 | N DIC,DIQ,DR,TIUSIG,TIUESIG1,TIUESIG2,TIUSIG1,TIUSIG2,TIUS1,TIUS2
|
---|
| 120 | N TIUSNM,TIUSTTL,TIUS1DT,TIUS2DT,TIUSDT
|
---|
| 121 | Q:'$D(^TIU(8925,DA,15))
|
---|
| 122 | S DIC=8925,DIQ="TIUSIG(",DIQ(0)="IE",DR="1204;1208;1501:1505;1507:1513;1601:1605"
|
---|
| 123 | D EN^DIQ1 I '$D(TIUSIG) Q
|
---|
| 124 | S TIUS1=$S(TIUSIG(8925,DA,1505,"I")="E":"/es/ ",TIUSIG(8925,DA,1505,"I")="C":"/s/ ",1:"")_$G(TIUSIG(8925,DA,1503,"E"))
|
---|
| 125 | S TIUS2=$S(TIUSIG(8925,DA,1511,"I")="E":"/es/ ",TIUSIG(8925,DA,1511,"I")="C":"/s/ ",1:"")_$G(TIUSIG(8925,DA,1509,"E"))
|
---|
| 126 | S TIUESIG1=$G(TIUSIG(8925,DA,1204,"I"))
|
---|
| 127 | S TIUSIG1=$G(TIUSIG(8925,DA,1502,"I"))
|
---|
| 128 | S TIUS1DT=$S(+$G(TIUSIG(8925,DA,1501,"I")):"Signed: "_$$DATE^TIULS($G(TIUSIG(8925,DA,1501,"I")),"MM/DD/CCYY HR:MIN"),1:"")
|
---|
| 129 | S TIUESIG2=$G(TIUSIG(8925,DA,1208,"I"))
|
---|
| 130 | S TIUS2DT=$S(+$G(TIUSIG(8925,DA,1507,"I")):"Cosigned: "_$$DATE^TIULS($G(TIUSIG(8925,DA,1507,"I")),"MM/DD/CCYY HR:MIN"),1:"")
|
---|
| 131 | S TIUSIG2=$G(TIUSIG(8925,DA,1508,"I"))
|
---|
| 132 | S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=" "
|
---|
| 133 | S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=TIUS1
|
---|
| 134 | S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=$G(TIUSIG(8925,DA,1504,"E"))
|
---|
| 135 | S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=TIUS1DT
|
---|
| 136 | I $G(TIUSIG(8925,DA,1505,"I"))="C" D
|
---|
| 137 | . N TIUONCH
|
---|
| 138 | . S TIUONCH=$G(TIUSIG(8925,DA,1512,"E")) I '$L(TIUONCH) S TIUONCH=$G(TIUSIG(8925,DA,1513,"E"))
|
---|
| 139 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)="Marked signed on chart by: "_TIUONCH
|
---|
| 140 | I TIUSIG1]"",(TIUSIG1'=TIUESIG1) D LOADFOR(TIUSIG1,TIUESIG1,.TIUL)
|
---|
| 141 | I +$G(TIUSIG(8925,DA,1507,"I"))>0 D
|
---|
| 142 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=" "
|
---|
| 143 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=TIUS2
|
---|
| 144 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=$G(TIUSIG(8925,DA,1510,"E"))
|
---|
| 145 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=TIUS2DT
|
---|
| 146 | . I $G(TIUSIG(8925,DA,1511,"I"))="C" D
|
---|
| 147 | . . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)="Marked cosigned on chart by: "_$G(TIUSIG(8925,DA,1513,"E"))
|
---|
| 148 | I TIUSIG2]"",(TIUSIG2'=TIUESIG2) D LOADFOR(TIUSIG2,TIUESIG2,.TIUL)
|
---|
| 149 | XTRA I +$O(^TIU(8925.7,"B",DA,0)) D XTRASIG(DA,.TIUL)
|
---|
| 150 | I +$G(TIUSIG(8925,DA,1601,"I")) D
|
---|
| 151 | . N TIUMODE
|
---|
| 152 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=""
|
---|
| 153 | . S TIUL=+$G(TIUL)+1
|
---|
| 154 | . S @VALMAR@(TIUL,0)=$$DATE^TIULS(TIUSIG(8925,DA,1601,"I"),"MM/DD/CCYY HR:MIN")_" AMENDMENT FILED:"
|
---|
| 155 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)="",TIUL=+$G(TIUL)+1
|
---|
| 156 | . S TIUMODE=$S(+$G(TIUSIG(8925,DA,1603,"I")):"/es/ ",1:" /s/ ")
|
---|
| 157 | . S @VALMAR@(TIUL,0)=TIUMODE_$S($G(TIUSIG(8925,DA,1604,"E"))]"":$G(TIUSIG(8925,DA,1604,"E")),1:$G(TIUSIG(8925,DA,1602,"E")))
|
---|
| 158 | . I $L($G(TIUSIG(8925,DA,1605,"E"))) D
|
---|
| 159 | . . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=$G(TIUSIG(8925,DA,1605,"E"))
|
---|
| 160 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=$P($G(TIUPRM1),U,5)
|
---|
| 161 | Q
|
---|
| 162 | XTRASIG(TIUDA,TIUL) ; Load additional signature blocks
|
---|
| 163 | N TIUI,DA,DR,DIC,DIQ,TIUXTRA S TIUI=0
|
---|
| 164 | S DIC="^TIU(8925.7,",DIQ="TIUXTRA"
|
---|
| 165 | S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=" "
|
---|
| 166 | S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)="Receipt Acknowledged By:"
|
---|
| 167 | F S TIUI=$O(^TIU(8925.7,"B",TIUDA,TIUI)) Q:+TIUI'>0 D
|
---|
| 168 | . N TIUX,TIUSGNR,TIUSDT
|
---|
| 169 | . S DA=TIUI,DR=".03:.08",DIQ(0)="IE" D EN^DIQ1 Q:+$D(TIUXTRA)'>9
|
---|
| 170 | . S TIUSGNR=$S($L($G(TIUXTRA(8925.7,DA,.06,"E"))):"/es/ "_$G(TIUXTRA(8925.7,DA,.06,"E")),1:" "_$G(TIUXTRA(8925.7,DA,.03,"E")))
|
---|
| 171 | . S TIUSDT=$S(+$G(TIUXTRA(8925.7,DA,.04,"I")):$$DATE^TIULS(TIUXTRA(8925.7,DA,.04,"I"),"MM/DD/CCYY HR:MIN"),1:"* AWAITING SIGNATURE *")
|
---|
| 172 | . S TIUX=$$SETSTR^VALM1(TIUSDT,$G(TIUX),1,38)
|
---|
| 173 | . S TIUX=$$SETSTR^VALM1(TIUSGNR,$G(TIUX),25,55)
|
---|
| 174 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=TIUX,TIUX=""
|
---|
| 175 | . S TIUX=$$SETSTR^VALM1($G(TIUXTRA(8925.7,DA,.07,"E")),$G(TIUX),30,50)
|
---|
| 176 | . S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=TIUX
|
---|
| 177 | . I $G(TIUXTRA(8925.7,DA,.05,"I")),$G(TIUXTRA(8925.7,DA,.05,"I"))'=$G(TIUXTRA(8925.7,DA,.03,"I")) D
|
---|
| 178 | . . N TIUFOR
|
---|
| 179 | . . S TIUX=""
|
---|
| 180 | . . S TIUFOR="for "_$P($G(TIUXTRA(8925.7,DA,.03,"E")),",",2)_" "_$P($G(TIUXTRA(8925.7,DA,.03,"E")),",")
|
---|
| 181 | . . S TIUX=$$SETSTR^VALM1(TIUFOR,$G(TIUX),26,55)
|
---|
| 182 | . . S TIUL=TIUL+1,@VALMAR@(TIUL,0)=TIUX
|
---|
| 183 | Q
|
---|
| 184 | LOADFOR(TIUS1,TIUES1,TIUL) ; Apply "for" block
|
---|
| 185 | N TIUESN1,TIUEST1,TIUFORN,TIUFORT
|
---|
| 186 | S TIUESN1="for "_$$SIGNAME^TIULS(TIUES1),TIUEST1=$$SIGTITL^TIULS(TIUES1)
|
---|
| 187 | I +$G(TIUS1),($G(TIUS1)'=$G(TIUES1)) S TIUFORN=$$SETSTR^VALM1(TIUESN1,$G(TIUFORN),1,50),TIUFORT=$$SETSTR^VALM1(TIUEST1,$G(TIUFORT),1,50)
|
---|
| 188 | S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=TIUFORN
|
---|
| 189 | S TIUL=+$G(TIUL)+1,@VALMAR@(TIUL,0)=TIUFORT
|
---|
| 190 | Q
|
---|