source: ccr/trunk/p/C0CPARMS.m@ 368

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

added Immunizations to RIM variable analysis code.. changed global for
parms to TMP("C0CPARMS",$J)

File size: 2.2 KB
Line 
1GPLPARMS ; CCDCCR/GPL - CCR/CCD PARAMETER PROCESSING ; 1/29/09
2 ;;0.3;CCDCCR;nopatch;noreleasedate
3 ;Copyright 2008 WorldVistA. Licensed under the terms of the GNU
4 ;General Public License See attached copy of the License.
5 ;
6 ;This program is free software; you can redistribute it and/or modify
7 ;it under the terms of the GNU General Public License as published by
8 ;the Free Software Foundation; either version 2 of the License, or
9 ;(at your option) any later version.
10 ;
11 ;This program is distributed in the hope that it will be useful,
12 ;but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;GNU General Public License for more details.
15 ;
16 ;You should have received a copy of the GNU General Public License along
17 ;with this program; if not, write to the Free Software Foundation, Inc.,
18 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 ;
20SET(INPARMS) ;INITIALIZE RUNTIME PARMS USING INPARMS TO OVERRIDE DEFAULTS
21 ; PARAMETERS ARE PASSED AS A STRING: "PARM1:VALUE1^PARM2:VALUE2^ETC"
22 ; THE SAME FORMAT IS USED BY RPC AND COMMAND LINE ENTRY POINTS
23 ;
24 N PTMP ;
25 S C0CPARMS=$NA(^TMP("C0CPARMS",$J)) ;BASE FOR THIS RUN
26 ;K @C0CPARMS ;START WITH EMPTY PARMS; MAY NOT WANT TO DO THIS KILL
27 I $G(INPARMS)'="" D ; OVERRIDES PROVIDED
28 . N C0CI S C0CI=""
29 . N C0CN S C0CN=1
30 . F S C0CI=$P(INPARMS,"^",C0CN) Q:C0CI="" D ;
31 . . S C0CN=C0CN+1 ;NEXT PARM
32 . . S @C0CPARMS@($P(C0CI,":",1))=$P(C0CI,":",2) ; SET THE PARM
33 . I C0CN=1 S @C0CPARMS@($P(INPARMS,":",1))=$P(C0CI,":",2) ; ONLY ONE
34 ; THIS IS WHERE WE WILL INSERT CALLS TO THE PARAMETER FILE FOR DEFAULTS
35 ; IF THEY FAIL, THE FOLLOWING WILL BE HARDCODED DEFAULTS
36 I '$D(@C0CPARMS@("LABLIMIT")) S @C0CPARMS@("LABLIMIT")="T-360" ;ONE YR WORTH
37 I '$D(@C0CPARMS@("LABSTART")) S @C0CPARMS@("LABSTART")="T" ;TODAY
38 Q
39 ;
40CHECK ; CHECK TO SEE IF PARMS ARE PRESENT, ELSE RUN SET
41 ;
42 I '$D(C0CPARMS) S C0CPARMS=$NA(^TMP("C0CPARMS",$J)) ;SHOULDN'T HAPPEN
43 I '$D(@C0CPARMS) D SET("SETWITHCHECK:1")
44 Q
45 ;
46GET(WHICHP) ;EXTRINSIC TO RETURN THE VALUE OF PARAMETER WHICHP
47 ;
48 D CHECK ; SHOULDN'T HAPPEN BUT TO BE SAFE
49 N GTMP
50 Q $G(@C0CPARMS@(WHICHP)) ;PULL THE PARM FROM THE TABLE
51 ;
Note: See TracBrowser for help on using the repository browser.