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

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

Vitals date limits and restored Labs date limits

File size: 2.3 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 I '$D(@C0CPARMS@("VITLIMIT")) S @C0CPARMS@("VITLIMIT")="T-360" ;ONE YEAR VITALS
39 I '$D(@C0CPARMS@("VITSTART")) S @C0CPARMS@("VITSTART")="T" ;TODAY
40 Q
41 ;
42CHECK ; CHECK TO SEE IF PARMS ARE PRESENT, ELSE RUN SET
43 ;
44 I '$D(C0CPARMS) S C0CPARMS=$NA(^TMP("C0CPARMS",$J)) ;SHOULDN'T HAPPEN
45 I '$D(@C0CPARMS) D SET("SETWITHCHECK:1")
46 Q
47 ;
48GET(WHICHP) ;EXTRINSIC TO RETURN THE VALUE OF PARAMETER WHICHP
49 ;
50 D CHECK ; SHOULDN'T HAPPEN BUT TO BE SAFE
51 N GTMP
52 Q $G(@C0CPARMS@(WHICHP)) ;PULL THE PARM FROM THE TABLE
53 ;
Note: See TracBrowser for help on using the repository browser.