TIUCHLP ; SLC/SBW - Help for Clinician ;11/29/02
;;1.0;TEXT INTEGRATION UTILITIES;**3,21,109,148,156**;Jun 20, 1997
MAIN ; Control branching
N DIC,X,Y,TIUI,TIUROOT,TIUFPRIV S TIUFPRIV=1
I '$D(TIUPRM0)!'$D(TIUPRM1) D SETPARM^TIULE
S DIC=8925.1,DIC(0)="AEMQZ",DIC("A")="Select DOCUMENT TYPE: "
S DIC("B")=$G(^DISV(+DUZ,"^TIU(8925.1,"))
D ^DIC I +Y'>0 D
. W !!,"Required information for dictation help not set up for this report type."
I +Y>0 D
. I $P(TIUPRM0,U,16)="D" S TIUROOT="ITEM"
. E I $P(TIUPRM0,U,16)="C" S TIUROOT="HEAD"
. I $G(TIUROOT)']"" W !!,"Required information for dictation help not set up for this report type." Q
. W !!,"A Dictated ",$P(Y(0),U),", requires the following:"
. S TIUI=0
. F S TIUI=$O(^TIU(8925.1,+Y,TIUROOT,TIUI)) Q:+TIUI'>0 D
. . I +$P($G(^TIU(8925.1,+Y,TIUROOT,TIUI,0)),U,6) W !?10,$P($G(^(0)),U,2)
W !!
I $$READ^TIUU("YO","Do you want to get patient data","YES") D GETPAT
Q
GETPAT ; Gets Dictation data for a specific patient
N TIU,TIUOUT,DFN,SUCCESS,TITLE
F D Q:$D(DUOUT)!$D(DIROUT)!+$G(TIUOUT)
. S DFN=+$$PATIENT^TIULA
. D MAIN^TIUMOVE(.TIU,DFN)
. I $D(TIU) D PATDATA(.TIU)
. S TIUOUT=$$READ^TIUU("Y","... OK","YES")
D MAKE^TIUPEFIX(.SUCCESS,DFN,.TITLE,.TIU,$S(+$G(XQADATA):+$G(XQADATA),+$G(BUFDA):+$G(BUFDA),1:""))
I +SUCCESS S TIUDONE=1
Q
PATDATA(X) ; Display/validate correct patient/treatment episode
N DIR,Y,TIURC
W !!?1,"Patient: ",$$NAME^TIULS(X("PNM"),"LAST, FIRST MI"),?40,"SSN: ",X("SSN"),?62,"Sex: ",$P(X("SEX"),U,2),!
W ?4,"Ward: ",$P(X("WARD"),U,2),?40,"Age: ",X("AGE"),!
W "Att Phys: ",$P(X("AMD"),U,2),?34,"Prim Phys: ",$P(X("PMD"),U,2),!
W "Adm Date: ",$$DATE^TIULS(+X("EDT"),"MM/DD/YY@HR:MIN:SEC")
W:X("LDT")]"" ?35,"Dis Date: ",$$DATE^TIULS(X("LDT"),"MM/DD/YY")
W !
W ?2,"Adm Dx: ",X("ADDX")
; Below TIU*148
I $G(X("NUMRACE"))>0 D
. W !?4,"Race: " F TIURC=1:1:X("NUMRACE") W ?10,$P(X("RACE",TIURC),U,2),!
I $G(X("RACENO"))=0 W !?4,"Race: ",$P($G(X("RACE")),U,2),!
I $D(X("DICTDT")) D
. W !,"A DISCHARGE SUMMARY is already on file:",!
. W ?2,"Dict'd: ",X("DICTDT"),?41,"By: ",X("AUTHOR"),!
. W ?2,"Signed: ",X("SIGDT"),?35,"Cosigned: ",X("COSDT"),!
Q
GETPN ; Help get Fields for PN Dictation/Error Resolution
N TIU,DFN,TIUY,TITLE
S DFN=+$$PATIENT^TIULA Q:+DFN'>0
D ENPN^TIUVSIT(.TIU,+DFN,1)
I '$D(TIU) Q
S TIUY=$$CHEKPN(.TIU)
D MAKE^TIUPEFIX(.SUCCESS,DFN,.TITLE,.TIU,$S(+$G(XQADATA):+$G(XQADATA),+$G(BUFDA):+$G(BUFDA),1:""))
I +SUCCESS S TIUDONE=1
Q
CHEKPN(X,TIUBY) ; Display/validate demographic/visit information
W !!,"Document Identifiers..."
W !?14,"Patient Name: ",$S($G(X("PNM"))]"":$G(X("PNM")),1:"UNKNOWN")
W !?15,"Patient SSN: ",$S($G(X("SSN"))]"":$G(X("SSN")),1:"UNKNOWN")
W !?10,"Patient Location: ",$S(+$G(X("LOC")):$P($G(X("LOC")),U,2),1:"UNKNOWN")
W !?8,"Date/time of Visit: ",$S($L($G(X("VSTR"))):$$DATE^TIULS($P(X("VSTR"),";",2),"MM/DD/YY HR:MIN"),1:"UNKNOWN")
S Y=$$READ^TIUU("YO"," ...OK","YES")
I $S($D(DIROUT):1,$D(DUOUT):1,$D(DTOUT):1,1:0) Q 0
I +Y'>0 D
. K X N TIUINOUT
. S TIUINOUT=$$INOUT^TIUVSIT
. I $S($D(DIROUT):1,$D(DUOUT):1,$D(DTOUT):1,1:0) Q
. I $P(TIUINOUT,U)="o" D MAIN^TIUVSIT(.X,DFN,"","","","",1,"",20,1)
. I $P(TIUINOUT,U)'="o" D MAIN^TIUMOVE(.X,DFN,"","","",1,"LAST",1)
. S Y=$S($D(X)>9:$$CHEKPN(.X,.TIUBY),1:0)
Q Y
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HTIUCHLP 3357 printed Dec 13, 2024@02:39:16 Page 2
TIUCHLP ; SLC/SBW - Help for Clinician ;11/29/02
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**3,21,109,148,156**;Jun 20, 1997
MAIN ; Control branching
+1 NEW DIC,X,Y,TIUI,TIUROOT,TIUFPRIV
SET TIUFPRIV=1
+2 IF '$DATA(TIUPRM0)!'$DATA(TIUPRM1)
DO SETPARM^TIULE
+3 SET DIC=8925.1
SET DIC(0)="AEMQZ"
SET DIC("A")="Select DOCUMENT TYPE: "
+4 SET DIC("B")=$GET(^DISV(+DUZ,"^TIU(8925.1,"))
+5 DO ^DIC
IF +Y'>0
Begin DoDot:1
+6 WRITE !!,"Required information for dictation help not set up for this report type."
End DoDot:1
+7 IF +Y>0
Begin DoDot:1
+8 IF $PIECE(TIUPRM0,U,16)="D"
SET TIUROOT="ITEM"
+9 IF '$TEST
IF $PIECE(TIUPRM0,U,16)="C"
SET TIUROOT="HEAD"
+10 IF $GET(TIUROOT)']""
WRITE !!,"Required information for dictation help not set up for this report type."
QUIT
+11 WRITE !!,"A Dictated ",$PIECE(Y(0),U),", requires the following:"
+12 SET TIUI=0
+13 FOR
SET TIUI=$ORDER(^TIU(8925.1,+Y,TIUROOT,TIUI))
if +TIUI'>0
QUIT
Begin DoDot:2
+14 IF +$PIECE($GET(^TIU(8925.1,+Y,TIUROOT,TIUI,0)),U,6)
WRITE !?10,$PIECE($GET(^(0)),U,2)
End DoDot:2
End DoDot:1
+15 WRITE !!
+16 IF $$READ^TIUU("YO","Do you want to get patient data","YES")
DO GETPAT
+17 QUIT
GETPAT ; Gets Dictation data for a specific patient
+1 NEW TIU,TIUOUT,DFN,SUCCESS,TITLE
+2 FOR
Begin DoDot:1
+3 SET DFN=+$$PATIENT^TIULA
+4 DO MAIN^TIUMOVE(.TIU,DFN)
+5 IF $DATA(TIU)
DO PATDATA(.TIU)
+6 SET TIUOUT=$$READ^TIUU("Y","... OK","YES")
End DoDot:1
if $DATA(DUOUT)!$DATA(DIROUT)!+$GET(TIUOUT)
QUIT
+7 DO MAKE^TIUPEFIX(.SUCCESS,DFN,.TITLE,.TIU,$SELECT(+$GET(XQADATA):+$GET(XQADATA),+$GET(BUFDA):+$GET(BUFDA),1:""))
+8 IF +SUCCESS
SET TIUDONE=1
+9 QUIT
PATDATA(X) ; Display/validate correct patient/treatment episode
+1 NEW DIR,Y,TIURC
+2 WRITE !!?1,"Patient: ",$$NAME^TIULS(X("PNM"),"LAST, FIRST MI"),?40,"SSN: ",X("SSN"),?62,"Sex: ",$PIECE(X("SEX"),U,2),!
+3 WRITE ?4,"Ward: ",$PIECE(X("WARD"),U,2),?40,"Age: ",X("AGE"),!
+4 WRITE "Att Phys: ",$PIECE(X("AMD"),U,2),?34,"Prim Phys: ",$PIECE(X("PMD"),U,2),!
+5 WRITE "Adm Date: ",$$DATE^TIULS(+X("EDT"),"MM/DD/YY@HR:MIN:SEC")
+6 if X("LDT")]""
WRITE ?35,"Dis Date: ",$$DATE^TIULS(X("LDT"),"MM/DD/YY")
+7 WRITE !
+8 WRITE ?2,"Adm Dx: ",X("ADDX")
+9 ; Below TIU*148
+10 IF $GET(X("NUMRACE"))>0
Begin DoDot:1
+11 WRITE !?4,"Race: "
FOR TIURC=1:1:X("NUMRACE")
WRITE ?10,$PIECE(X("RACE",TIURC),U,2),!
End DoDot:1
+12 IF $GET(X("RACENO"))=0
WRITE !?4,"Race: ",$PIECE($GET(X("RACE")),U,2),!
+13 IF $DATA(X("DICTDT"))
Begin DoDot:1
+14 WRITE !,"A DISCHARGE SUMMARY is already on file:",!
+15 WRITE ?2,"Dict'd: ",X("DICTDT"),?41,"By: ",X("AUTHOR"),!
+16 WRITE ?2,"Signed: ",X("SIGDT"),?35,"Cosigned: ",X("COSDT"),!
End DoDot:1
+17 QUIT
GETPN ; Help get Fields for PN Dictation/Error Resolution
+1 NEW TIU,DFN,TIUY,TITLE
+2 SET DFN=+$$PATIENT^TIULA
if +DFN'>0
QUIT
+3 DO ENPN^TIUVSIT(.TIU,+DFN,1)
+4 IF '$DATA(TIU)
QUIT
+5 SET TIUY=$$CHEKPN(.TIU)
+6 DO MAKE^TIUPEFIX(.SUCCESS,DFN,.TITLE,.TIU,$SELECT(+$GET(XQADATA):+$GET(XQADATA),+$GET(BUFDA):+$GET(BUFDA),1:""))
+7 IF +SUCCESS
SET TIUDONE=1
+8 QUIT
CHEKPN(X,TIUBY) ; Display/validate demographic/visit information
+1 WRITE !!,"Document Identifiers..."
+2 WRITE !?14,"Patient Name: ",$SELECT($GET(X("PNM"))]"":$GET(X("PNM")),1:"UNKNOWN")
+3 WRITE !?15,"Patient SSN: ",$SELECT($GET(X("SSN"))]"":$GET(X("SSN")),1:"UNKNOWN")
+4 WRITE !?10,"Patient Location: ",$SELECT(+$GET(X("LOC")):$PIECE($GET(X("LOC")),U,2),1:"UNKNOWN")
+5 WRITE !?8,"Date/time of Visit: ",$SELECT($LENGTH($GET(X("VSTR"))):$$DATE^TIULS($PIECE(X("VSTR"),";",2),"MM/DD/YY HR:MIN"),1:"UNKNOWN")
+6 SET Y=$$READ^TIUU("YO"," ...OK","YES")
+7 IF $SELECT($DATA(DIROUT):1,$DATA(DUOUT):1,$DATA(DTOUT):1,1:0)
QUIT 0
+8 IF +Y'>0
Begin DoDot:1
+9 KILL X
NEW TIUINOUT
+10 SET TIUINOUT=$$INOUT^TIUVSIT
+11 IF $SELECT($DATA(DIROUT):1,$DATA(DUOUT):1,$DATA(DTOUT):1,1:0)
QUIT
+12 IF $PIECE(TIUINOUT,U)="o"
DO MAIN^TIUVSIT(.X,DFN,"","","","",1,"",20,1)
+13 IF $PIECE(TIUINOUT,U)'="o"
DO MAIN^TIUMOVE(.X,DFN,"","","",1,"LAST",1)
+14 SET Y=$SELECT($DATA(X)>9:$$CHEKPN(.X,.TIUBY),1:0)
End DoDot:1
+15 QUIT Y