VSITBUL ;ISD/RJP - Visit Error/Warning Bulletin ;4/21/97
;;1.0;PCE PATIENT CARE ENCOUNTER;**76,81**;Aug 12, 1996
; Patch PX*1*76 changes the 2nd line of all VSIT* routines to reflect
; the incorporation of the module into PCE. For historical reference,
; the old (VISIT TRACKING) 2nd line is included below to reference VSIT
; patches.
;
;;2.0;VISIT TRACKING;**2**;Aug 12, 1996;
;
Q ; - not an entry point
;
VAR(ERR) ; - log error messages
; - called by ^VSITPUT
;
; - pass ERR = <error message text>
; - rtns ^TMP($J,"VSIT-ERROR",
Q:$G(VSIT("IEN")) ;ADDED TO END UNNECESSARY MESSAGES
D:'$D(^TMP($J,"VSIT-ERROR")) INI
Q:$G(ERR)']"" N TXT
S TXT="",$P(TXT,"- ",25)="" D TXT(TXT)
I "LOC,VDT,TYP,PAT,INS,SVC,"[($P(ERR,"^")) D
. D TXT("*** Fatal Error - Required Variable Not Defined ***")
E D TXT("*** Warning - Non required Visit Data Field Invalid")
D TXT($P(ERR,"^",3)_" -> "_$P(ERR,"^",2))
Q
;
TXT(TXT) ; - put text
;
N LCT S LCT=$G(^TMP($J,"VSIT-ERROR",0))+1,^(0)=LCT,^(LCT)=$G(TXT)
Q
;
INI ; - initialize message
;
N TXT,X,Y,DIVIEN,DIVISION
K ^TMP($J,"VSIT-ERROR")
D NOW^%DTC S Y=% D DD^%DT
I +$G(DUZ(2)) S DIVIEN=+$G(DUZ(2))_"," S DIVISION=$$GET1^DIQ(4,DIVIEN,.01)
S:$L($G(DIVISION))<3 DIVISION="Unknown"
D TXT(" When: "_Y_" Option: "_$P($G(XQY0),"^"))
D TXT(" User: "_$S($D(DUZ):$P($G(^VA(200,+DUZ,0)),"^"),1:"Unknown")_" Division: "_DIVISION)
S TXT="",$P(TXT,"- ",25)="" D TXT(TXT)
; - required variables
D TXT("The following are a list of required variables.")
D TXT(" VSIT = "_$S($G(VSIT)]"":VSIT,1:"Undefined"))
D TXT(" DFN = "_$S($D(DFN):DFN,1:"Undefined")_" (patient)")
D:$G(VSIT(0))]"" TXT(" VSIT(0) = "_VSIT(0))
D TXT("Hospital Location = "_$G(VSIT("LOC")))
Q
;
SND ; - send bulletin to mail group 'VSIT CREATE ERROR'
; called by ^VSIT
N TXT I $G(VSIT("IEN"))>0 D
. S TXT="",$P(TXT,"- ",25)="" D TXT(TXT)
. D TXT("*** Reference Visit Record Number "_+$G(VSIT("IEN"))_" on "_$P($G(VSIT("IEN")),"^",2)_" ***")
;
N GRP,MBR,XMSUB,XMTEXT,XMDUZ,XMY
S XMY("G.VSIT CREATE ERROR")=""
S XMSUB="ERROR - Visit File Creation"
S XMTEXT="^TMP($J,""VSIT-ERROR"","
S XMDUZ=.5
I '$D(XMY),$D(DUZ)#10 S XMY(DUZ)=""
S:'$D(XMY) XMY(.5)=""
D ^XMD
K ^TMP($J,"VSIT-ERROR"),XMB
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVSITBUL 2334 printed Oct 16, 2024@18:33:03 Page 2
VSITBUL ;ISD/RJP - Visit Error/Warning Bulletin ;4/21/97
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**76,81**;Aug 12, 1996
+2 ; Patch PX*1*76 changes the 2nd line of all VSIT* routines to reflect
+3 ; the incorporation of the module into PCE. For historical reference,
+4 ; the old (VISIT TRACKING) 2nd line is included below to reference VSIT
+5 ; patches.
+6 ;
+7 ;;2.0;VISIT TRACKING;**2**;Aug 12, 1996;
+8 ;
+9 ; - not an entry point
QUIT
+10 ;
VAR(ERR) ; - log error messages
+1 ; - called by ^VSITPUT
+2 ;
+3 ; - pass ERR = <error message text>
+4 ; - rtns ^TMP($J,"VSIT-ERROR",
+5 ;ADDED TO END UNNECESSARY MESSAGES
if $GET(VSIT("IEN"))
QUIT
+6 if '$DATA(^TMP($JOB,"VSIT-ERROR"))
DO INI
+7 if $GET(ERR)']""
QUIT
NEW TXT
+8 SET TXT=""
SET $PIECE(TXT,"- ",25)=""
DO TXT(TXT)
+9 IF "LOC,VDT,TYP,PAT,INS,SVC,"[($PIECE(ERR,"^"))
Begin DoDot:1
+10 DO TXT("*** Fatal Error - Required Variable Not Defined ***")
End DoDot:1
+11 IF '$TEST
DO TXT("*** Warning - Non required Visit Data Field Invalid")
+12 DO TXT($PIECE(ERR,"^",3)_" -> "_$PIECE(ERR,"^",2))
+13 QUIT
+14 ;
TXT(TXT) ; - put text
+1 ;
+2 NEW LCT
SET LCT=$GET(^TMP($JOB,"VSIT-ERROR",0))+1
SET ^(0)=LCT
SET ^(LCT)=$GET(TXT)
+3 QUIT
+4 ;
INI ; - initialize message
+1 ;
+2 NEW TXT,X,Y,DIVIEN,DIVISION
+3 KILL ^TMP($JOB,"VSIT-ERROR")
+4 DO NOW^%DTC
SET Y=%
DO DD^%DT
+5 IF +$GET(DUZ(2))
SET DIVIEN=+$GET(DUZ(2))_","
SET DIVISION=$$GET1^DIQ(4,DIVIEN,.01)
+6 if $LENGTH($GET(DIVISION))<3
SET DIVISION="Unknown"
+7 DO TXT(" When: "_Y_" Option: "_$PIECE($GET(XQY0),"^"))
+8 DO TXT(" User: "_$SELECT($DATA(DUZ):$PIECE($GET(^VA(200,+DUZ,0)),"^"),1:"Unknown")_" Division: "_DIVISION)
+9 SET TXT=""
SET $PIECE(TXT,"- ",25)=""
DO TXT(TXT)
+10 ; - required variables
+11 DO TXT("The following are a list of required variables.")
+12 DO TXT(" VSIT = "_$SELECT($GET(VSIT)]"":VSIT,1:"Undefined"))
+13 DO TXT(" DFN = "_$SELECT($DATA(DFN):DFN,1:"Undefined")_" (patient)")
+14 if $GET(VSIT(0))]""
DO TXT(" VSIT(0) = "_VSIT(0))
+15 DO TXT("Hospital Location = "_$GET(VSIT("LOC")))
+16 QUIT
+17 ;
SND ; - send bulletin to mail group 'VSIT CREATE ERROR'
+1 ; called by ^VSIT
+2 NEW TXT
IF $GET(VSIT("IEN"))>0
Begin DoDot:1
+3 SET TXT=""
SET $PIECE(TXT,"- ",25)=""
DO TXT(TXT)
+4 DO TXT("*** Reference Visit Record Number "_+$GET(VSIT("IEN"))_" on "_$PIECE($GET(VSIT("IEN")),"^",2)_" ***")
End DoDot:1
+5 ;
+6 NEW GRP,MBR,XMSUB,XMTEXT,XMDUZ,XMY
+7 SET XMY("G.VSIT CREATE ERROR")=""
+8 SET XMSUB="ERROR - Visit File Creation"
+9 SET XMTEXT="^TMP($J,""VSIT-ERROR"","
+10 SET XMDUZ=.5
+11 IF '$DATA(XMY)
IF $DATA(DUZ)#10
SET XMY(DUZ)=""
+12 if '$DATA(XMY)
SET XMY(.5)=""
+13 DO ^XMD
+14 KILL ^TMP($JOB,"VSIT-ERROR"),XMB
+15 QUIT