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

SD53138B.m

Go to the documentation of this file.
  1. SD53138B ;ALB/SEK - BULLETIN FOR PATCH 138;12-JAN-1998
  1. ;;5.3;Scheduling;**138**;Aug 13, 1993
  1. ;
  1. BULL1 ;Generate/send completion bulletin for clean-up (see EN^SD53138A)
  1. ;
  1. ;Input : ^TMP($J,"SD53138A") defined as follows
  1. ; ^("XMIT") = Total Checked
  1. ; ^ Total marked for retransmission
  1. ; ^("TIME") = Start (FM) ^ End (FM)
  1. ; ^("STOP") = Task asked to stop (1/0)
  1. ;Output : None
  1. ;Notes : Existance of ^TMP($J,"SD53138A") is assumed
  1. ;
  1. ;Declare varibales
  1. N XMB,XMTEXT,XMY,XMDUZ,XMZ,NODE,LINE
  1. ;Initialize bulletin space
  1. K ^TMP($J,"SD53138-BULL1")
  1. S LINE=1
  1. ;Asked to stop
  1. I (^TMP($J,"SD53138A","STOP")) D
  1. .S ^TMP($J,"SD53138-BULL1",LINE)="*** Note that process was asked to stop and did not run to completion ***"
  1. .S ^TMP($J,"SD53138-BULL1",(LINE+1))=" "
  1. .S LINE=LINE+2
  1. ;Time summary
  1. S NODE=^TMP($J,"SD53138A","TIME")
  1. S ^TMP($J,"SD53138-BULL1",LINE)="Process began on "_$$FMTE^XLFDT($P(NODE,"^",1))_" and completed on "_$$FMTE^XLFDT($P(NODE,"^",2))
  1. S ^TMP($J,"SD53138-BULL1",(LINE+1))=" "
  1. S LINE=LINE+2
  1. ;Transmitted Outpatient Encounter file summary
  1. S NODE=^TMP($J,"SD53138A","XMIT")
  1. S ^TMP($J,"SD53138-BULL1",LINE)="A total of "_(+$P(NODE,"^",1))_" entries in the Transmitted Outpatient Encounter file were"
  1. S ^TMP($J,"SD53138-BULL1",(LINE+1))="checked and "_(+$P(NODE,"^",2))_" entries were marked for re-transmission because they were"
  1. S ^TMP($J,"SD53138-BULL1",(LINE+2))="rejected and did not contain a reason for rejection in the"
  1. S ^TMP($J,"SD53138-BULL1",(LINE+3))="Transmitted Outpatient Encounter Error file."
  1. S ^TMP($J,"SD53138-BULL1",(LINE+4))=" "
  1. S LINE=LINE+5
  1. ;Send completion bulletin
  1. S XMB="SCDX AMBCARE TO NPCDB SUMMARY"
  1. S XMB(1)="ACRP clean-up of file 409.75"
  1. S XMTEXT="^TMP($J,""SD53138-BULL1"","
  1. S XMY(DUZ)=""
  1. S XMDUZ="ACRP - SD*5.3*138"
  1. D ^XMB
  1. ;Done - clean-up and quit
  1. K ^TMP($J,"SD53138-BULL1")
  1. Q
  1. ;
  1. ;
  1. LATEBULL() ;Determine if user wishes to prevent generation of Late ACRP
  1. ; Related Activity bulletin
  1. ;
  1. ;Input : None
  1. ;Output : 1 = Yes
  1. ; 0 = No
  1. ; -1 = User abort/time out
  1. ;
  1. ;Declare variables
  1. N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
  1. ;Set up call to Reader
  1. S DIR("?",1)="Generation of the Late ACRP Related Activity bulletin will be prevented"
  1. S DIR("?",2)="by removing the mail group contained in the LATE ACTIVITY MAIL GROUP"
  1. S DIR("?",3)="field (#217) of the MAS PARAMETERS file (#43) at the beginning of the"
  1. S DIR("?")="process and restoring it at the end of the process"
  1. S DIR(0)="Y"
  1. S DIR("A")="Prevent generation of Late ACRP Related Activity bulletin"
  1. S DIR("B")="NO"
  1. ;Call Reader
  1. D ^DIR
  1. ;Abort/time out
  1. Q:($D(DIRUT)) -1
  1. ;Convert answer to proper output
  1. Q $S((+Y<1):0,1:1)
  1. ;
  1. OK() ;Determine if user wishes to continue
  1. ;
  1. ;Input : None
  1. ;Output : 1 = Yes
  1. ; 0 = No
  1. ;Notes : Zero (0) is returned on user abort/time out
  1. ;
  1. ;Declare variables
  1. N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
  1. ;Set up call to Reader
  1. S DIR(0)="Y"
  1. S DIR("A")="OK to continue"
  1. S DIR("B")="NO"
  1. ;Call Reader
  1. D ^DIR
  1. ;Convert answer to proper output
  1. Q $S((+Y<1):0,1:1)
  1. ;
  1. GETLAMG() ;Return pointer to and name of mail group contained in LATE
  1. ; ACTIVITY MAIL GROUP field (#217) of the MAS PARAMETERS file (#43)
  1. ;
  1. ;Input : None
  1. ;Output : Ptr ^ Name - Pointer to mail group ^ Name of mail group
  1. ;Notes : NULL will be returned if a valid mail group isn't found
  1. ;
  1. ;Declare variables
  1. N MGPTR,MGNAME,SD53138T,SD53138M
  1. ;Get internal & external value of field
  1. D GETS^DIQ(43,"1,",217,"IE","SD53138T","SD53138M")
  1. Q:($D(SD53138M)) ""
  1. ;Grab pointer and name from array
  1. S MGPTR=SD53138T(43,"1,",217,"I")
  1. S MGNAME=SD53138T(43,"1,",217,"E")
  1. ;No value - return NULL
  1. Q:(('MGPTR)!(MGNAME="")) ""
  1. ;Done
  1. Q MGPTR_"^"_MGNAME
  1. ;
  1. SETLAMG(MGPTR,DELOK) ;Update value contained in the LATE ACTIVITY MAIL GROUP
  1. ; field (#217) of the MAS PARAMETERS file (#43)
  1. ;
  1. ;Input : MGPTR - Pointer to mail group
  1. ; DELOK - Flag indicating if deletion is allowed
  1. ; 1 = Yes - MGPTR can be zero
  1. ; 0 = No - MGPTR can not be zero (default)
  1. ;Output : None
  1. ;
  1. ;Check input
  1. S MGPTR=+$G(MGPTR)
  1. S DELOK=+$G(DELOK)
  1. Q:(('MGPTR)&('DELOK))
  1. ;Declare variables
  1. N SD53138F,SD53138M
  1. ;Validate pointer
  1. I (MGPTR) Q:($$EXTERNAL^DILFD(43,217,"",MGPTR,"SD53138M")="")
  1. ;Convert 0 to @ (if deleting)
  1. S:('MGPTR) MGPTR="@"
  1. ;Set up FDA array
  1. S SD53138F(43,"1,",217)=MGPTR
  1. ;Update
  1. D FILE^DIE("S","SD53138F","SD53138M")
  1. ;Done
  1. Q