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

GMRCP50A.m

Go to the documentation of this file.
  1. GMRCP50A ;ISP/TDP - PRE INSTALL ROUTINE FOR GMRC*3*50 ; 11/15/2006
  1. ;;3.0;CONSULT/REQUEST TRACKING;**50**;DEC 27, 1997;Build 8
  1. Q
  1. MSG ;Send Mailman message to installer
  1. N GMRC0,GMRCACT,GMRCADT,GMRCC,GMRCCIEN,GMRCCNT,GMRCCPRS,GMRCDFN,GMRCDT
  1. N GMRCFDT,GMRCID,GMRCIEN,GMRCIFC,GMRCMSG,GMRCPARM,GMRCPG,GMRCPRV,GMRCSPC
  1. N GMRCSVC,GMRCTPG,GMRCTXT,GMRCWHO,XMDUZ,XMERR,XMSUB,XMTEXT,XMY,Y
  1. S GMRCTTL=GMRCTTL-GMRCITL
  1. I DUZ="" N DUZ S DUZ=.5
  1. S XMDUZ=DUZ,XMTEXT="GMRCTXT"
  1. S GMRCPARM("FROM")="PATCH GMRC*3.0*50 PRE-INIT"
  1. S XMY(DUZ)=""
  1. S GMRCDFN=""
  1. F GMRCIFC="GMRCP50","GMRCP50 IFC" D
  1. . S GMRCPG=0
  1. . I GMRCIFC="GMRCP50" S GMRCTPG=GMRCTTL/500 I GMRCTPG#1 S GMRCTPG=$P(GMRCTPG,".")+1
  1. . I GMRCIFC="GMRCP50 IFC" S GMRCTPG=GMRCITL/500 I GMRCTPG#1 S GMRCTPG=$P(GMRCTPG,".")+1
  1. . F GMRCPG=1:1:GMRCTPG D
  1. .. K GMRCTXT
  1. .. S GMRCC=0
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="This message ("_GMRCPG_" of "_GMRCTPG_") has been sent by patch GMRC*3.0*50 at the"
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="completion of the pre-init routine."
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" "
  1. .. I GMRCIFC="GMRCP50" D
  1. ... S XMSUB="SIGNIFICANT FINDINGS VALUES ARE INVALID (MSG "_GMRCPG_" of "_GMRCTPG_")"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="This message was sent because Consult records were found which contained an"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="Ampersand as the Significant Finding. Since these can not be corrected"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="automatically, this message was created to assist in a manual correction of"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="this data. We are hopeful that the following data will contain enough"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="information to allow your site to make the corrections, or at least give you"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="the information needed to research the specific consult and determine what"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="the Significant Finding should have been. It is important to understand the"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="comments from the Significant Finding are fine and the only problem"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="needing correction is the Significant Finding value itself (Yes/No/Unknown)."
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="Per guidance from HIMSS, it is preferable that an audit trail exist for this"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="fix. A disclaimer should be added, if possible. To correct the"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="Significant Finding, you can use the Action, Consult Tracking menu on the"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="Consults tab of CPRS GUI. The person making this change will need the"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="appropriate update authority for the Consult Services involved. It should"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="also be noted the significant finding will display as ""Unknown"" despite"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="the ampersand (""&"") stored in the data file."
  1. .. I GMRCIFC="GMRCP50 IFC" D
  1. ... S XMSUB="IFC SIGNIFICANT FINDINGS VALUES ARE INVALID (MSG "_GMRCPG_" of "_GMRCTPG_")"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="This message was sent because Inter-Facility Consult records were found"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="which contained an Ampersand as the Significant Finding. Since these can"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="not be corrected by the requesting (sending) site, this message was created"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="to alert you of these entries. The Consulting (receiving) site(s) will need"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="to correct these entries and should receive a similar message when they"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="install this patch. You can use this list as a record of Inter-Facility"
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="Consults needing to be corrected by the Consulting (receiving) site(s)."
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" "
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="PATIENT IDENTIFIER"
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" CONSULT DATE(IEN)"
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" TO SERVICE STATUS"
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" ACTIVITY ACTIVITY DATE RESPONSIBLE PERSON"
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" ACTIVITY COMMENTS"
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="==============================================================================="
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" "
  1. .. S GMRCSPC=" "
  1. .. S GMRCCNT=0
  1. .. F S GMRCDFN=$O(^TMP(GMRCIFC,$J,GMRCDFN)) Q:GMRCDFN="" D Q:GMRCCNT>499
  1. ... S GMRCID=$S(NMFLG:GMRCDFN,1:$G(^TMP(GMRCIFC,$J,GMRCDFN,0)))
  1. ... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=GMRCID
  1. ... S GMRCDT=0
  1. ... F S GMRCDT=$O(^TMP(GMRCIFC,$J,GMRCDFN,GMRCDT)) Q:GMRCDT="" D
  1. .... S GMRCIEN=0
  1. .... F S GMRCIEN=$O(^TMP(GMRCIFC,$J,GMRCDFN,GMRCDT,GMRCIEN)) Q:GMRCIEN="" D
  1. ..... S GMRCCIEN=0
  1. ..... S GMRC0=$G(^TMP(GMRCIFC,$J,GMRCDFN,GMRCDT,GMRCIEN,0))
  1. ..... ;S GMRCIEN=$P(GMRC0,U,1)
  1. ..... S Y=GMRCDT
  1. ..... D DD^%DT
  1. ..... I Y=-1 S Y="DATE ERROR"
  1. ..... S GMRCFDT=Y
  1. ..... S GMRCFDT=$E(GMRCFDT_" ("_GMRCIEN_")"_GMRCSPC,1,33)
  1. ..... S GMRCSVC=$E($P(GMRC0,U,2)_GMRCSPC,1,60)_" "
  1. ..... S GMRCCPRS=$E($P(GMRC0,U,3)_GMRCSPC,1,15)
  1. ..... S GMRCACT=$E($P(GMRC0,U,4)_GMRCSPC,1,20)
  1. ..... S GMRCADT=$P(GMRC0,U,5)
  1. ..... S Y=0
  1. ..... I GMRCADT S Y=GMRCADT D DD^%DT I Y=-1 S Y="DATE ERROR"
  1. ..... I 'GMRCADT S Y="ACTIVITY DATE UNK"
  1. ..... S GMRCADT=$E(Y_GMRCSPC,1,23)
  1. ..... S GMRCWHO=$E($P(GMRC0,U,6)_GMRCSPC,1,32)
  1. ..... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" "_GMRCFDT
  1. ..... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" "_GMRCSVC_GMRCCPRS
  1. ..... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" "_GMRCACT_GMRCADT_GMRCWHO
  1. ..... F S GMRCCIEN=$O(^TMP(GMRCIFC,$J,GMRCDFN,GMRCDT,GMRCIEN,GMRCCIEN)) Q:GMRCCIEN="" D
  1. ...... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" "_$G(^TMP(GMRCIFC,$J,GMRCDFN,GMRCDT,GMRCIEN,GMRCCIEN))
  1. ..... S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" "
  1. ..... S GMRCCNT=GMRCCNT+1
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" "
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)=" "
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="Total records in this message: "_GMRCCNT
  1. .. S GMRCC=GMRCC+1,GMRCTXT(GMRCC)="Total records containing a Significant Finding of an ampersand: "_$S(GMRCIFC="GMRCP50":GMRCTTL,1:GMRCITL)
  1. .. D SENDMSG^XMXAPI(XMDUZ,XMSUB,XMTEXT,.XMY,.GMRCPARM,"","")
  1. .. S GMRCMSG(1)=" "
  1. .. S GMRCMSG(2)="******************************************************************************"
  1. .. I GMRCIFC="GMRCP50" D
  1. ... S GMRCMSG(3)="** Message ("_$S($L(GMRCPG)=1:$J("0"_GMRCPG,2),1:GMRCPG)_" of "_$S($L(GMRCTPG)=1:$J("0"_GMRCTPG,2),1:GMRCTPG)_") containing Consult records which have an ampersand as **"
  1. ... S GMRCMSG(4)="** the Significant Finding was "_$S($D(XMERR):"not sent due to an error in the message **",1:"sent to the "_$S(DUZ=.5:"postmaster. Please forward this **",1:"user. Please forward this **"))
  1. ... I $D(XMERR) S GMRCMSG(5)="** setup. **"
  1. ... I $D(XMERR) S GMRCMSG(6)="** Dumping message to screen. **"
  1. ... I '$D(XMERR) S GMRCMSG(5)="** message to the appropriate staff, which includes the clinical **"
  1. ... I '$D(XMERR) S GMRCMSG(6)="** coordinator, for further action. **"
  1. .. I GMRCIFC="GMRCP50 IFC" D
  1. ... S GMRCMSG(3)="** Message ("_$S($L(GMRCPG)=1:$J("0"_GMRCPG,2),1:GMRCPG)_" of "_$S($L(GMRCTPG)=1:$J("0"_GMRCTPG,2),1:GMRCTPG)_") containing Inter-Facility Consult records which have **"
  1. ... S GMRCMSG(4)="** an ampersand as the Significant Finding was "_$S($D(XMERR):"not sent due to an error in **",1:"sent to the "_$S(DUZ=.5:"postmaster. **",1:"user. **"))
  1. ... I $D(XMERR) S GMRCMSG(5)="** the message setup. **"
  1. ... I $D(XMERR) S GMRCMSG(6)="** Dumping message to screen. **"
  1. ... I '$D(XMERR) S GMRCMSG(5)="** Please forward this message to the appropriate staff, which includes the **"
  1. ... I '$D(XMERR) S GMRCMSG(6)="** clinical coordinator, for further action. **"
  1. .. S GMRCMSG(7)="******************************************************************************"
  1. .. D BMES^XPDUTL(.GMRCMSG)
  1. .. I $D(XMERR) D BMES^XPDUTL(" "),BMES^XPDUTL(.GMRCTXT)
  1. . K ^TMP(GMRCIFC,$J)
  1. Q