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

Last change on this file since 1676 was 1586, checked in by Sam Habiel, 12 years ago

Changed license to AGPL. Some clean-up for XINDEX

  • Property svn:mergeinfo set to (toggle deleted branches)
    /ccr/branches/ohum/o-old/p/C0CPARMS.m1290
    /ccr/branches/ohum/p/C0CPARMS.m1291-1543
    /ccr/branches/ohum/p/p/C0CPARMS.m1287-1289
File size: 4.5 KB
RevLine 
[1544]1C0CPARMS ; CCDCCR/GPL - CCR/CCD PARAMETER PROCESSING ; 1/29/09 ; 6/15/12 3:46pm
[1586]2 ;;1.2;CCD/CCR GENERATION UTILITIES;;Oct 30, 2012;Build 50
3 ;Copyright 2008 WorldVistA.
[1544]4 ;
[1586]5 ; This program is free software: you can redistribute it and/or modify
6 ; it under the terms of the GNU Affero General Public License as
7 ; published by the Free Software Foundation, either version 3 of the
8 ; License, or (at your option) any later version.
[1544]9 ;
[1586]10 ; This program is distributed in the hope that it will be useful,
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ; GNU Affero General Public License for more details.
[1544]14 ;
[1586]15 ; You should have received a copy of the GNU Affero General Public License
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
[1544]17 ;
18SET(INPARMS) ;INITIALIZE RUNTIME PARMS USING INPARMS TO OVERRIDE DEFAULTS
19 ; PARAMETERS ARE PASSED AS A STRING: "PARM1:VALUE1^PARM2:VALUE2^ETC"
20 ; THE SAME FORMAT IS USED BY RPC AND COMMAND LINE ENTRY POINTS
21 ;
22 N PTMP ;
23 S C0CPARMS=$NA(^TMP("C0CPARMS",$J)) ;BASE FOR THIS RUN
24 K @C0CPARMS ;START WITH EMPTY PARMS; MAY NOT WANT TO DO THIS KILL
25 I $G(INPARMS)'="" D ; OVERRIDES PROVIDED
26 . N C0CI S C0CI=""
27 . N C0CN S C0CN=1
28 . F S C0CI=$P(INPARMS,"^",C0CN) Q:C0CI="" D ;
29 . . S C0CN=C0CN+1 ;NEXT PARM
30 . . N C1,C2
31 . . S C1=$P(C0CI,":",1) ; PARAMETER
32 . . S C2=$P(C0CI,":",2) ; VALUE
33 . . I C2="" S C2=1
34 . . S @C0CPARMS@(C1)=C2
35 . I C0CN=1 S @C0CPARMS@($P(INPARMS,":",1))=$P(C0CI,":",2) ; ONLY ONE
36 ; THIS IS WHERE WE WILL INSERT CALLS TO THE PARAMETER FILE FOR DEFAULTS
37 ; IF THEY FAIL, THE FOLLOWING WILL BE HARDCODED DEFAULTS
38 ;OHUM/RUT commented the hardcoded limits
39 ;I '$D(@C0CPARMS@("LABLIMIT")) S @C0CPARMS@("LABLIMIT")="T-360" ;ONE YR WORTH
40 ;I '$D(@C0CPARMS@("LABSTART")) S @C0CPARMS@("LABSTART")="T" ;TODAY
41 ;I '$D(@C0CPARMS@("VITLIMIT")) S @C0CPARMS@("VITLIMIT")="T-360" ;ONE YR VITALS
42 ;I '$D(@C0CPARMS@("VITSTART")) S @C0CPARMS@("VITSTART")="T" ;TODAY
43 ;I '$D(@C0CPARMS@("MEDSTART")) S @C0CPARMS@("MEDSTART")="T" ; TODAY
44 ;I '$D(@C0CPARMS@("MEDSLIMIT")) S @C0CPARMS@("MEDLIMIT")="T-360" ; ONE YR MEDS
45 ;I '$D(@C0CPARMS@("MEDACTIVE")) S @C0CPARMS@("MEDACTIVE")=1 ; YES
46 ;I '$D(@C0CPARMS@("MEDPENDING")) S @C0CPARMS@("MEDPENDING")=0 ; NO
47 ;I '$D(@C0CPARMS@("MEDALL")) S @C0CPARMS@("MEDALL")=0 ; NON-PENDING NON-ACTIVE
48 ;OHUM/RUT 3120109 ; commented all limits
49 ;S @C0CPARMS@("LABLIMIT")=^TMP("C0CCCR","LABLIMIT"),@C0CPARMS@("VITLIMIT")=^TMP("C0CCCR","VITLIMIT"),@C0CPARMS@("TIULIMIT")=^TMP("C0CCCR","TIULIMIT"),@C0CPARMS@("MEDLIMIT")=^TMP("C0CCCR","MEDLIMIT")
50 ;I '$D(@C0CPARMS@("LABSTART")) S @C0CPARMS@("LABSTART")="T" ;TODAY
51 ;I '$D(@C0CPARMS@("VITSTART")) S @C0CPARMS@("VITSTART")="T" ;TODAY
52 ;I '$D(@C0CPARMS@("MEDSTART")) S @C0CPARMS@("MEDSTART")="T" ; TODAY
53 ;I '$D(@C0CPARMS@("MEDACTIVE")) S @C0CPARMS@("MEDACTIVE")=1 ; YES
54 ;I '$D(@C0CPARMS@("MEDPENDING")) S @C0CPARMS@("MEDPENDING")=0 ; NO
55 ;I '$D(@C0CPARMS@("MEDALL")) S @C0CPARMS@("MEDALL")=1 ; NON-PENDING NON-ACTIVE
56 ;;I '$D(@C0CPARMS@("RALIMIT")) S @C0CPARMS@("RALIMIT")="T-36500" ;ONE YR WORTH
57 ;;I '$D(@C0CPARMS@("RASTART")) S @C0CPARMS@("RASTART")="T" ;TODAY
58 ;I '$D(@C0CPARMS@("TIUSTART")) S @C0CPARMS@("TIUSTART")="T" ;TODAY
59 ;;OHUM/RUT
60 S @C0CPARMS@("LABLIMIT")=$P(^C0CPARM(1,0),"^",2)
61 S @C0CPARMS@("LABSTART")=$P(^C0CPARM(1,0),"^",3)
62 S @C0CPARMS@("VITLIMIT")=$P(^C0CPARM(1,0),"^",4)
63 S @C0CPARMS@("VITSTART")=$P(^C0CPARM(1,1),"^",1)
64 S @C0CPARMS@("MEDLIMIT")=$P(^C0CPARM(1,1),"^",2)
65 S @C0CPARMS@("MEDSTART")=$P(^C0CPARM(1,1),"^",3)
66 S @C0CPARMS@("MEDACTIVE")=0
67 S @C0CPARMS@("MEDPENDING")=0
68 S @C0CPARMS@("MEDALL")=0 ;OHUM/RUT 3120504 INITIALISING MEDICATION STATUS VARIABLES WITH ZERO
69 I $P(^C0CPARM(1,1),"^",4)="ACT" S @C0CPARMS@("MEDACTIVE")=1
70 I $P(^C0CPARM(1,1),"^",4)="PEN" S @C0CPARMS@("MEDPENDING")=1
71 I $P(^C0CPARM(1,1),"^",4)="ALL" S @C0CPARMS@("MEDALL")=1,@C0CPARMS@("MEDPENDING")=1 ;OHUM/RUT 3120504 ADDED FOR INCLUDING PENDING MEDICATIONS FOR STATUS "ALL"
72 ;S ^TMP("C0CCCR","TIULIMIT")="",^TMP("C0CCCR","TIUSTART")=""
73 I $P(^C0CPARM(1,2),"^",3)=1 S @C0CPARMS@("TIULIMIT")=$P(^C0CPARM(1,2),"^",1),@C0CPARMS@("TIUSTART")=$P(^C0CPARM(1,2),"^",2)
74 ;OHUM/RUT
75 Q
76 ;
77CHECK ; CHECK TO SEE IF PARMS ARE PRESENT, ELSE RUN SET
78 ;
79 I '$D(C0CPARMS) S C0CPARMS=$NA(^TMP("C0CPARMS",$J)) ;SHOULDN'T HAPPEN
80 I '$D(@C0CPARMS) D SET("SETWITHCHECK:1")
81 Q
82 ;
83GET(WHICHP) ;EXTRINSIC TO RETURN THE VALUE OF PARAMETER WHICHP
84 ;
85 D CHECK ; SHOULDN'T HAPPEN BUT TO BE SAFE
86 N GTMP
87 Q $G(@C0CPARMS@(WHICHP)) ;PULL THE PARM FROM THE TABLE
88 ;
Note: See TracBrowser for help on using the repository browser.