source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SD53138B.m@ 931

Last change on this file since 931 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.4 KB
Line 
1SD53138B ;ALB/SEK - BULLETIN FOR PATCH 138;12-JAN-1998
2 ;;5.3;Scheduling;**138**;Aug 13, 1993
3 ;
4BULL1 ;Generate/send completion bulletin for clean-up (see EN^SD53138A)
5 ;
6 ;Input : ^TMP($J,"SD53138A") defined as follows
7 ; ^("XMIT") = Total Checked
8 ; ^ Total marked for retransmission
9 ; ^("TIME") = Start (FM) ^ End (FM)
10 ; ^("STOP") = Task asked to stop (1/0)
11 ;Output : None
12 ;Notes : Existance of ^TMP($J,"SD53138A") is assumed
13 ;
14 ;Declare varibales
15 N XMB,XMTEXT,XMY,XMDUZ,XMZ,NODE,LINE
16 ;Initialize bulletin space
17 K ^TMP($J,"SD53138-BULL1")
18 S LINE=1
19 ;Asked to stop
20 I (^TMP($J,"SD53138A","STOP")) D
21 .S ^TMP($J,"SD53138-BULL1",LINE)="*** Note that process was asked to stop and did not run to completion ***"
22 .S ^TMP($J,"SD53138-BULL1",(LINE+1))=" "
23 .S LINE=LINE+2
24 ;Time summary
25 S NODE=^TMP($J,"SD53138A","TIME")
26 S ^TMP($J,"SD53138-BULL1",LINE)="Process began on "_$$FMTE^XLFDT($P(NODE,"^",1))_" and completed on "_$$FMTE^XLFDT($P(NODE,"^",2))
27 S ^TMP($J,"SD53138-BULL1",(LINE+1))=" "
28 S LINE=LINE+2
29 ;Transmitted Outpatient Encounter file summary
30 S NODE=^TMP($J,"SD53138A","XMIT")
31 S ^TMP($J,"SD53138-BULL1",LINE)="A total of "_(+$P(NODE,"^",1))_" entries in the Transmitted Outpatient Encounter file were"
32 S ^TMP($J,"SD53138-BULL1",(LINE+1))="checked and "_(+$P(NODE,"^",2))_" entries were marked for re-transmission because they were"
33 S ^TMP($J,"SD53138-BULL1",(LINE+2))="rejected and did not contain a reason for rejection in the"
34 S ^TMP($J,"SD53138-BULL1",(LINE+3))="Transmitted Outpatient Encounter Error file."
35 S ^TMP($J,"SD53138-BULL1",(LINE+4))=" "
36 S LINE=LINE+5
37 ;Send completion bulletin
38 S XMB="SCDX AMBCARE TO NPCDB SUMMARY"
39 S XMB(1)="ACRP clean-up of file 409.75"
40 S XMTEXT="^TMP($J,""SD53138-BULL1"","
41 S XMY(DUZ)=""
42 S XMDUZ="ACRP - SD*5.3*138"
43 D ^XMB
44 ;Done - clean-up and quit
45 K ^TMP($J,"SD53138-BULL1")
46 Q
47 ;
48 ;
49LATEBULL() ;Determine if user wishes to prevent generation of Late ACRP
50 ; Related Activity bulletin
51 ;
52 ;Input : None
53 ;Output : 1 = Yes
54 ; 0 = No
55 ; -1 = User abort/time out
56 ;
57 ;Declare variables
58 N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
59 ;Set up call to Reader
60 S DIR("?",1)="Generation of the Late ACRP Related Activity bulletin will be prevented"
61 S DIR("?",2)="by removing the mail group contained in the LATE ACTIVITY MAIL GROUP"
62 S DIR("?",3)="field (#217) of the MAS PARAMETERS file (#43) at the beginning of the"
63 S DIR("?")="process and restoring it at the end of the process"
64 S DIR(0)="Y"
65 S DIR("A")="Prevent generation of Late ACRP Related Activity bulletin"
66 S DIR("B")="NO"
67 ;Call Reader
68 D ^DIR
69 ;Abort/time out
70 Q:($D(DIRUT)) -1
71 ;Convert answer to proper output
72 Q $S((+Y<1):0,1:1)
73 ;
74OK() ;Determine if user wishes to continue
75 ;
76 ;Input : None
77 ;Output : 1 = Yes
78 ; 0 = No
79 ;Notes : Zero (0) is returned on user abort/time out
80 ;
81 ;Declare variables
82 N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
83 ;Set up call to Reader
84 S DIR(0)="Y"
85 S DIR("A")="OK to continue"
86 S DIR("B")="NO"
87 ;Call Reader
88 D ^DIR
89 ;Convert answer to proper output
90 Q $S((+Y<1):0,1:1)
91 ;
92GETLAMG() ;Return pointer to and name of mail group contained in LATE
93 ; ACTIVITY MAIL GROUP field (#217) of the MAS PARAMETERS file (#43)
94 ;
95 ;Input : None
96 ;Output : Ptr ^ Name - Pointer to mail group ^ Name of mail group
97 ;Notes : NULL will be returned if a valid mail group isn't found
98 ;
99 ;Declare variables
100 N MGPTR,MGNAME,SD53138T,SD53138M
101 ;Get internal & external value of field
102 D GETS^DIQ(43,"1,",217,"IE","SD53138T","SD53138M")
103 Q:($D(SD53138M)) ""
104 ;Grab pointer and name from array
105 S MGPTR=SD53138T(43,"1,",217,"I")
106 S MGNAME=SD53138T(43,"1,",217,"E")
107 ;No value - return NULL
108 Q:(('MGPTR)!(MGNAME="")) ""
109 ;Done
110 Q MGPTR_"^"_MGNAME
111 ;
112SETLAMG(MGPTR,DELOK) ;Update value contained in the LATE ACTIVITY MAIL GROUP
113 ; field (#217) of the MAS PARAMETERS file (#43)
114 ;
115 ;Input : MGPTR - Pointer to mail group
116 ; DELOK - Flag indicating if deletion is allowed
117 ; 1 = Yes - MGPTR can be zero
118 ; 0 = No - MGPTR can not be zero (default)
119 ;Output : None
120 ;
121 ;Check input
122 S MGPTR=+$G(MGPTR)
123 S DELOK=+$G(DELOK)
124 Q:(('MGPTR)&('DELOK))
125 ;Declare variables
126 N SD53138F,SD53138M
127 ;Validate pointer
128 I (MGPTR) Q:($$EXTERNAL^DILFD(43,217,"",MGPTR,"SD53138M")="")
129 ;Convert 0 to @ (if deleting)
130 S:('MGPTR) MGPTR="@"
131 ;Set up FDA array
132 S SD53138F(43,"1,",217)=MGPTR
133 ;Update
134 D FILE^DIE("S","SD53138F","SD53138M")
135 ;Done
136 Q
Note: See TracBrowser for help on using the repository browser.