source: WorldVistAEHR/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMXQUE.m@ 862

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

revised back to 6/30/08 version

File size: 3.9 KB
RevLine 
[623]1PXRMXQUE ; SLC/PJH - Reminder reports general queuing routine.;02/24/2006
2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
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(ZTRTN,ZTDESC,ZTSAVE,%ZIS,ZTSK) ;
45 W !
46 D EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE,.%ZIS,.ZTSK)
47 I $D(ZTSK)>1 W !!,ZTDESC," has been queued, task number "_$G(ZTSK) H 2
48 I $G(ZTSK)="" S ZTSK=0
49 Q ZTSK
50 ;
51 ;=======================================================================
52REQUE(DESC,ROUTINE,TASK) ;Reque a task.
53 N ZTDTH,ZTRTN,ZTIO,ZTDESC,ZTSK
54 S ZTDESC=DESC
55 S ZTRTN=ROUTINE
56 S ZTSK=TASK
57 S ZTDTH=$$NOW^XLFDT
58 D REQ^%ZTLOAD
59 I ZTSK(0)=1 Q
60 ;There was a problem, send an error message.
61 K ZTSK S ZTSK=TASK
62 D ISQED^%ZTLOAD
63 N LC,SUB
64 K ^TMP("PXRMXMZ",$J)
65 S ^TMP("PXRMXMZ",$J,1,0)="Could not start the print task, task information:"
66 S ^TMP("PXRMXMZ",$J,2,0)=" Task number "_TASK
67 S LC=2,SUB=""
68 F S SUB=$O(ZTSK(SUB)) Q:SUB="" D
69 . S LC=LC+1
70 . S ^TMP("PXRMXMZ",$J,LC,0)=" ZTSK("_SUB_")="_ZTSK(SUB)
71 S LC=LC+1,^TMP("PXRMXMZ",$J,LC,0)=" Print start time="_ZTDTH
72 S LC=LC+1,^TMP("PXRMXMZ",$J,LC,0)=" Submit time="_$P(PXRMXTMP,"PXRMX",2)
73 S LC=LC+1,^TMP("PXRMXMZ",$J,LC,0)="PXRMXTMP="_$G(PXRMXTMP)
74 D SEND^PXRMMSG("REMINDER REPORT ERROR",DUZ)
75 Q
76 ;
77 ;=======================================================================
78SAVE ;Save the variables for queing.
79 S ZTSAVE("PXRMBDT")="",ZTSAVE("PXRMEDT")="",ZTSAVE("PXRMSDT")=""
80 S ZTSAVE("PXRMCS(")="",ZTSAVE("NCS")=""
81 S ZTSAVE("PXRMCGRP(")="",ZTSAVE("NCGRP")=""
82 S ZTSAVE("PXRMFAC(")="",ZTSAVE("NFAC")=""
83 S ZTSAVE("PXRMFACN(")=""
84 S ZTSAVE("PXRMFCMB")=""
85 S ZTSAVE("PXRMFUT")="",ZTSAVE("PXRMDLOC")=""
86 S ZTSAVE("PXRMFD")=""
87 S ZTSAVE("PXRMINP")=""
88 S ZTSAVE("PXRMIOD")=""
89 S ZTSAVE("PXRMLCHL(")="",ZTSAVE("NHL")=""
90 S ZTSAVE("PXRMLCMB")=""
91 S ZTSAVE("PXRMLCSC")=""
92 S ZTSAVE("PXRMPRIM")=""
93 S ZTSAVE("PXRMQUE")=""
94 S ZTSAVE("PXRMREP")=""
95 S ZTSAVE("PXRMRT")=""
96 S ZTSAVE("PXRMSCAT")="",ZTSAVE("PXRMSCAT(")=""
97 S ZTSAVE("PXRMSEL")=""
98 S ZTSAVE("PXRMSRT")=""
99 S ZTSAVE("PXRMSSN")=""
100 S ZTSAVE("PXRMTABC")=""
101 S ZTSAVE("PXRMTABS")=""
102 S ZTSAVE("PXRMTCMB")=""
103 S ZTSAVE("PXRMTMP")=""
104 S ZTSAVE("PXRMTOT")=""
105 S ZTSAVE("PXRMXTMP")=""
106 ; Time initiated
107 S ZTSAVE("PXRMXST")=""
108 ; New selection criteria
109 S ZTSAVE("PXRMOTM(")="",ZTSAVE("NOTM")=""
110 S ZTSAVE("PXRMPRV(")="",ZTSAVE("NPRV")=""
111 S ZTSAVE("PXRMPAT(")="",ZTSAVE("NPAT")=""
112 S ZTSAVE("PXRMPCM(")="",ZTSAVE("NPCM")=""
113 S ZTSAVE("PXRMREM(")="",ZTSAVE("NREM")=""
114 S ZTSAVE("PXRMRCAT(")="",ZTSAVE("NCAT")=""
115 S ZTSAVE("PXRMUSER")=""
116 ;Reminder list
117 S ZTSAVE("REMINDER(")=""
118 ; Arrays by IEN
119 S ZTSAVE("PXRMLOCN(")=""
120 S ZTSAVE("PXRMCSN(")=""
121 S ZTSAVE("PXRMCGRN(")=""
122 ;Patient List
123 S ZTSAVE("PATCREAT")=""
124 S ZTSAVE("PATLST")=""
125 S ZTSAVE("PXRMLIST(")=""
126 S ZTSAVE("PXRMLIS1")=""
127 S ZTSAVE("PLISTPUG")=""
128 ;User DUZ
129 S ZTSAVE("DBDUZ")=""
130 S ZTSAVE("DBERR")=""
131 S ZTSAVE("PXRMRERR(")=""
132 ;Dubug information
133 S ZTSAVE("PXRMDBUG")=""
134 S ZTSAVE("PXRMDBUS")=""
135 ;Patient Information
136 S ZTSAVE("PXRMTPAT")=""
137 S ZTSAVE("PXRMDPAT")=""
138 I +$G(PXRMIDOD)>0 S ZTSAVE("PXRMIDOD")=""
139 Q
Note: See TracBrowser for help on using the repository browser.