Changeset 636 for FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMUTIL.m
- Timestamp:
- Dec 4, 2009, 8:26:01 PM (14 years ago)
- Location:
- FOIAVistA/tag/r
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMUTIL.m
r628 r636 1 PXRMUTIL ; SLC/PKR/PJH - Utility routines for use by PXRM. ; 10/02/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1233 ; 4 ;================================= 1 PXRMUTIL ; SLC/PKR/PJH - Utility routines for use by PXRM. ;05/25/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 ; 4 ;=========================================================== 5 5 ATTVALUE(STRING,ATTR,SEP,AVSEP) ;STRING contains a list of attribute value 6 6 ;pairs. Each pair is separated by SEP and the attribute value pair … … 14 14 Q VALUE 15 15 ; 16 ;================================= 17 ACOPY(REF,OUTPUT) ;Copy all the descendants of the array reference into a linear 18 ;array. REF is the starting array reference, for example A or 19 ;^TMP("PXRM",$J). OUTPUT is the linear array for the output. It 20 ;should be in the form of a closed root, i.e., A() or ^TMP($J,). 21 ;Note OUTPUT cannot be used as the name of the output array. 22 N DONE,IND,LEN,NL,OROOT,OUT,PROOT,ROOT,START,TEMP 23 I REF="" Q 24 S NL=0 25 S OROOT=$P(OUTPUT,")",1) 26 S PROOT=$P(REF,")",1) 27 ;Build the root so we can tell when we are done. 28 S TEMP=$NA(@REF) 29 S ROOT=$P(TEMP,")",1) 30 S REF=$Q(@REF) 31 I REF'[ROOT Q 32 S DONE=0 33 F Q:(REF="")!(DONE) D 34 . S START=$F(REF,ROOT) 35 . S LEN=$L(REF) 36 . S IND=$E(REF,START,LEN) 37 . S NL=NL+1 38 . S OUT=OROOT_NL_")" 39 . S @OUT=PROOT_IND_"="_@REF 40 . S REF=$Q(@REF) 41 . I REF'[ROOT S DONE=1 42 Q 43 ; 44 ;================================= 16 ;=========================================================== 45 17 AWRITE(REF) ;Write all the descendants of the array reference. 46 18 ;REF is the starting array reference, for example A or ^TMP("PXRM",$J). … … 63 35 Q 64 36 ; 65 ;================================= 37 ;=========================================================== 66 38 DIP(VAR,IEN,PXRMROOT,FLDS) ;Do general inquiry for IEN return formatted 67 39 ;output in VAR. VAR can be either a local variable or a global. … … 113 85 Q 114 86 ; 115 ;================================= 87 ;=========================================================== 116 88 FNFR(ROOT) ;Given the root of a file return the file number. 117 89 Q +$P(@(ROOT_"0)"),U,2) 118 90 ; 119 ;================================= 91 ;=========================================================== 120 92 NTOAN(NUMBER) ;Given an integer N return an alphabetic string that can be 121 93 ;used for sorting. This will be modulus 26. For example N=0 returns … … 140 112 Q ANUM 141 113 ; 142 ;================================= 143 RMEHIST(FILENUM,IEN) ;Remove the edit history for a reminder file. 144 I (FILENUM<800)!(FILENUM>811.9)!(FILENUM=811.8) Q 145 N DA,DIK,GLOBAL,ROOT 146 S GLOBAL=$$GET1^DID(FILENUM,"","","GLOBAL NAME") 147 ;Edit History is stored in node 110 for all files. 148 S DA(1)=IEN 149 S DIK=GLOBAL_IEN_",110," 150 S ROOT=GLOBAL_IEN_",110,DA)" 151 S DA=0 152 F S DA=+$O(@ROOT) Q:DA=0 D ^DIK 153 Q 154 ; 155 ;================================= 114 ;=========================================================== 156 115 SEHIST(FILENUM,ROOT,IEN) ;Set the edit date and edit by and prompt the 157 116 ;user for the edit comment. … … 186 145 Q 187 146 ; 188 ;================================= 147 ;=========================================================== 189 148 SFRES(SDIR,NRES,FIEVAL) ;Save the finding result. 190 149 I NRES=0 S FIEVAL=0 Q … … 202 161 Q 203 162 ; 204 ;================================= 163 ;=========================================================== 205 164 SSPAR(FIND0,NOCC,BDT,EDT) ;Set the finding search parameters. 206 165 S BDT=$P(FIND0,U,8),EDT=$P(FIND0,U,11),NOCC=$P(FIND0,U,14) 207 I +NOCC=0S NOCC=1166 I NOCC="" S NOCC=1 208 167 ;Convert the dates to FileMan dates. 209 168 S BDT=$S(BDT="":0,BDT=0:0,1:$$CTFMD^PXRMDATE(BDT)) … … 212 171 ;If EDT does not contain a time set it to the end of the day. 213 172 I EDT'["." S EDT=EDT_".235959" 214 I $G(PXRMDDOC)'=1 Q 215 S ^TMP("PXRMDDOC",$J,$P(FIND0,U,1,11))=BDT_U_EDT 216 Q 217 ; 218 ;================================= 173 Q 174 ; 175 ;=========================================================== 219 176 STRREP(STRING,TS,RS) ;Replace every occurrence of the target string (TS) 220 177 ;in STRING with the replacement string (RS). … … 234 191 Q STR 235 192 ; 236 ;================================= 193 ;=========================================================== 237 194 VEDIT(ROOT,IEN) ;This is used as a DIC("S") screen to select which entries 238 195 ;a user can edit.
Note:
See TracChangeset
for help on using the changeset viewer.