source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMXQUE.m@ 1458

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

initial load of FOIAVistA 6/30/08 version

File size: 4.0 KB
Line 
1PXRMXQUE ; SLC/PJH - Reminder reports general queuing routine.;03/23/2007
2 ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
3 ;
4 ;Determine whether the report should be queued.
5JOB ;
6 N %ZIS S %ZIS="Q"
7 W !
8 D ^%ZIS
9 I POP G EXIT^PXRMXD
10 S PXRMIOD=ION_";"_IOST_";"_IOM_";"_IOSL
11 S PXRMQUE=$G(IO("Q"))
12 ;
13 I PXRMQUE D Q
14 . ;Queue the report.
15 . N DESC,PXRMIOV,ROUTINE,TASK,ZTDTH
16 . S DESC="Reminder Due Report - sort"
17 . S PXRMIOV=""
18 . S ROUTINE="^PXRMXSE1"
19 . M ^TMP("PXRM-MESS",$J)=^TMP("XM-MESS",$J)
20 . S TASK=$$QUE^PXRMXQUE(DESC,PXRMIOV,ROUTINE,"SAVE^PXRMXQUE") Q:TASK=""
21 . S ^XTMP(PXRMXTMP,"SORTZTSK")=TASK
22 . M ^TMP("XM-MESS",$J)=^TMP("PXRM-MESS",$J)
23 . K ^TMP("PXRM-MESS",$J)
24 .;
25 . S DESC="Reminder Due Report - print"
26 . S PXRMIOV=PXRMIOD
27 . S ROUTINE="^PXRMXPR"
28 . S ZTDTH="@"
29 . S ^XTMP(PXRMXTMP,"PRZTSK")=$$QUE^PXRMXQUE(DESC,PXRMIOV,ROUTINE,"SAVE^PXRMXQUE")
30 I 'PXRMQUE D ^PXRMXSE1
31 Q
32 ;
33QUE(DESC,PXRMIOV,ROUTINE,SAVE) ;Queue a task.
34 N ZTDESC,ZTIO,ZTRTN,ZTSAVE
35 D @SAVE
36 S ZTDESC=DESC
37 S ZTIO=PXRMIOV
38 S ZTRTN=ROUTINE
39 D ^%ZTLOAD
40 I $D(ZTSK)=0 W !!,DESC," cancelled"
41 E W !!,DESC," has been queued, task number ",ZTSK
42 Q $G(ZTSK)
43 ;
44DEVICE(RTN,DESC,SAVE,%ZIS,RETZTSK) ;
45 ;Pass RETZTSK as number such as 1 if you want to get ZTSK.
46 N ZTSK
47 W !
48 D EN^XUTMDEVQ(RTN,DESC,.SAVE,.%ZIS,RETZTSK)
49 I $D(ZTSK) W !!,DESC," has been queued, task number "_ZTSK H 2
50 Q $G(ZTSK)
51 ;
52 ;=======================================================================
53REQUE(DESC,ROUTINE,TASK) ;Reque a task.
54 N ZTDTH,ZTRTN,ZTIO,ZTDESC,ZTSK
55 S ZTDESC=DESC
56 S ZTRTN=ROUTINE
57 S ZTSK=TASK
58 S ZTDTH=$$NOW^XLFDT
59 D REQ^%ZTLOAD
60 I ZTSK(0)=1 Q
61 ;There was a problem, send an error message.
62 K ZTSK S ZTSK=TASK
63 D ISQED^%ZTLOAD
64 N LC,SUB
65 K ^TMP("PXRMXMZ",$J)
66 S ^TMP("PXRMXMZ",$J,1,0)="Could not start the print task, task information:"
67 S ^TMP("PXRMXMZ",$J,2,0)=" Task number "_TASK
68 S LC=2,SUB=""
69 F S SUB=$O(ZTSK(SUB)) Q:SUB="" D
70 . S LC=LC+1
71 . S ^TMP("PXRMXMZ",$J,LC,0)=" ZTSK("_SUB_")="_ZTSK(SUB)
72 S LC=LC+1,^TMP("PXRMXMZ",$J,LC,0)=" Print start time="_ZTDTH
73 S LC=LC+1,^TMP("PXRMXMZ",$J,LC,0)=" Submit time="_$P(PXRMXTMP,"PXRMX",2)
74 S LC=LC+1,^TMP("PXRMXMZ",$J,LC,0)="PXRMXTMP="_$G(PXRMXTMP)
75 D SEND^PXRMMSG("REMINDER REPORT ERROR",DUZ)
76 Q
77 ;
78 ;=======================================================================
79SAVE ;Save the variables for queing.
80 S ZTSAVE("PXRMBDT")="",ZTSAVE("PXRMEDT")="",ZTSAVE("PXRMSDT")=""
81 S ZTSAVE("PXRMCS(")="",ZTSAVE("NCS")=""
82 S ZTSAVE("PXRMCGRP(")="",ZTSAVE("NCGRP")=""
83 S ZTSAVE("PXRMFAC(")="",ZTSAVE("NFAC")=""
84 S ZTSAVE("PXRMFACN(")=""
85 S ZTSAVE("PXRMFCMB")=""
86 S ZTSAVE("PXRMFUT")="",ZTSAVE("PXRMDLOC")=""
87 S ZTSAVE("PXRMFD")=""
88 S ZTSAVE("PXRMINP")=""
89 S ZTSAVE("PXRMIOD")=""
90 S ZTSAVE("PXRMLCHL(")="",ZTSAVE("NHL")=""
91 S ZTSAVE("PXRMLCMB")=""
92 S ZTSAVE("PXRMLCSC")=""
93 S ZTSAVE("PXRMPRIM")=""
94 S ZTSAVE("PXRMQUE")=""
95 S ZTSAVE("PXRMREP")=""
96 S ZTSAVE("PXRMRT")=""
97 S ZTSAVE("PXRMSCAT")="",ZTSAVE("PXRMSCAT(")=""
98 S ZTSAVE("PXRMSEL")=""
99 S ZTSAVE("PXRMSRT")=""
100 S ZTSAVE("PXRMSSN")=""
101 S ZTSAVE("PXRMTABC")=""
102 S ZTSAVE("PXRMTABS")=""
103 S ZTSAVE("PXRMTCMB")=""
104 S ZTSAVE("PXRMTMP")=""
105 S ZTSAVE("PXRMTOT")=""
106 S ZTSAVE("PXRMXTMP")=""
107 ; Time initiated
108 S ZTSAVE("PXRMXST")=""
109 ; New selection criteria
110 S ZTSAVE("PXRMOTM(")="",ZTSAVE("NOTM")=""
111 S ZTSAVE("PXRMPRV(")="",ZTSAVE("NPRV")=""
112 S ZTSAVE("PXRMPAT(")="",ZTSAVE("NPAT")=""
113 S ZTSAVE("PXRMPCM(")="",ZTSAVE("NPCM")=""
114 S ZTSAVE("PXRMREM(")="",ZTSAVE("NREM")=""
115 S ZTSAVE("PXRMRCAT(")="",ZTSAVE("NCAT")=""
116 S ZTSAVE("PXRMUSER")=""
117 ;Reminder list
118 S ZTSAVE("REMINDER(")=""
119 ; Arrays by IEN
120 S ZTSAVE("PXRMLOCN(")=""
121 S ZTSAVE("PXRMCSN(")=""
122 S ZTSAVE("PXRMCGRN(")=""
123 ;Patient List
124 S ZTSAVE("PATCREAT")=""
125 S ZTSAVE("PATLST")=""
126 S ZTSAVE("PXRMLIST(")=""
127 S ZTSAVE("PXRMLIS1")=""
128 S ZTSAVE("PLISTPUG")=""
129 ;User DUZ
130 S ZTSAVE("DBDUZ")=""
131 S ZTSAVE("DBERR")=""
132 S ZTSAVE("PXRMRERR(")=""
133 ;Dubug information
134 S ZTSAVE("PXRMDBUG")=""
135 S ZTSAVE("PXRMDBUS")=""
136 ;Patient Information
137 S ZTSAVE("PXRMTPAT")=""
138 S ZTSAVE("PXRMDPAT")=""
139 I +$G(PXRMIDOD)>0 S ZTSAVE("PXRMIDOD")=""
140 S ZTSAVE("PXRMPML")=""
141 Q
Note: See TracBrowser for help on using the repository browser.