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

VSITBUL.m

Go to the documentation of this file.
  1. VSITBUL ;ISD/RJP - Visit Error/Warning Bulletin ;4/21/97
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**76,81**;Aug 12, 1996
  1. ; Patch PX*1*76 changes the 2nd line of all VSIT* routines to reflect
  1. ; the incorporation of the module into PCE. For historical reference,
  1. ; the old (VISIT TRACKING) 2nd line is included below to reference VSIT
  1. ; patches.
  1. ;
  1. ;;2.0;VISIT TRACKING;**2**;Aug 12, 1996;
  1. ;
  1. Q ; - not an entry point
  1. ;
  1. VAR(ERR) ; - log error messages
  1. ; - called by ^VSITPUT
  1. ;
  1. ; - pass ERR = <error message text>
  1. ; - rtns ^TMP($J,"VSIT-ERROR",
  1. Q:$G(VSIT("IEN")) ;ADDED TO END UNNECESSARY MESSAGES
  1. D:'$D(^TMP($J,"VSIT-ERROR")) INI
  1. Q:$G(ERR)']"" N TXT
  1. S TXT="",$P(TXT,"- ",25)="" D TXT(TXT)
  1. I "LOC,VDT,TYP,PAT,INS,SVC,"[($P(ERR,"^")) D
  1. . D TXT("*** Fatal Error - Required Variable Not Defined ***")
  1. E D TXT("*** Warning - Non required Visit Data Field Invalid")
  1. D TXT($P(ERR,"^",3)_" -> "_$P(ERR,"^",2))
  1. Q
  1. ;
  1. TXT(TXT) ; - put text
  1. ;
  1. N LCT S LCT=$G(^TMP($J,"VSIT-ERROR",0))+1,^(0)=LCT,^(LCT)=$G(TXT)
  1. Q
  1. ;
  1. INI ; - initialize message
  1. ;
  1. N TXT,X,Y,DIVIEN,DIVISION
  1. K ^TMP($J,"VSIT-ERROR")
  1. D NOW^%DTC S Y=% D DD^%DT
  1. I +$G(DUZ(2)) S DIVIEN=+$G(DUZ(2))_"," S DIVISION=$$GET1^DIQ(4,DIVIEN,.01)
  1. S:$L($G(DIVISION))<3 DIVISION="Unknown"
  1. D TXT(" When: "_Y_" Option: "_$P($G(XQY0),"^"))
  1. D TXT(" User: "_$S($D(DUZ):$P($G(^VA(200,+DUZ,0)),"^"),1:"Unknown")_" Division: "_DIVISION)
  1. S TXT="",$P(TXT,"- ",25)="" D TXT(TXT)
  1. ; - required variables
  1. D TXT("The following are a list of required variables.")
  1. D TXT(" VSIT = "_$S($G(VSIT)]"":VSIT,1:"Undefined"))
  1. D TXT(" DFN = "_$S($D(DFN):DFN,1:"Undefined")_" (patient)")
  1. D:$G(VSIT(0))]"" TXT(" VSIT(0) = "_VSIT(0))
  1. D TXT("Hospital Location = "_$G(VSIT("LOC")))
  1. Q
  1. ;
  1. SND ; - send bulletin to mail group 'VSIT CREATE ERROR'
  1. ; called by ^VSIT
  1. N TXT I $G(VSIT("IEN"))>0 D
  1. . S TXT="",$P(TXT,"- ",25)="" D TXT(TXT)
  1. . D TXT("*** Reference Visit Record Number "_+$G(VSIT("IEN"))_" on "_$P($G(VSIT("IEN")),"^",2)_" ***")
  1. ;
  1. N GRP,MBR,XMSUB,XMTEXT,XMDUZ,XMY
  1. S XMY("G.VSIT CREATE ERROR")=""
  1. S XMSUB="ERROR - Visit File Creation"
  1. S XMTEXT="^TMP($J,""VSIT-ERROR"","
  1. S XMDUZ=.5
  1. I '$D(XMY),$D(DUZ)#10 S XMY(DUZ)=""
  1. S:'$D(XMY) XMY(.5)=""
  1. D ^XMD
  1. K ^TMP($J,"VSIT-ERROR"),XMB
  1. Q