Ignore:
Timestamp:
Dec 4, 2009, 8:26:01 PM (14 years ago)
Author:
George Lilly
Message:

WorldVistAEHR overlayed on FOIAVistA

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/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
    3  ;
    4  ;=================================
     1PXRMUTIL ; 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 ;===========================================================
    55ATTVALUE(STRING,ATTR,SEP,AVSEP) ;STRING contains a list of attribute value
    66 ;pairs. Each pair is separated by SEP and the attribute value pair
     
    1414 Q VALUE
    1515 ;
    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 ;===========================================================
    4517AWRITE(REF) ;Write all the descendants of the array reference.
    4618 ;REF is the starting array reference, for example A or ^TMP("PXRM",$J).
     
    6335 Q
    6436 ;
    65  ;=================================
     37 ;===========================================================
    6638DIP(VAR,IEN,PXRMROOT,FLDS) ;Do general inquiry for IEN return formatted
    6739 ;output in VAR. VAR can be either a local variable or a global.
     
    11385 Q
    11486 ;
    115  ;=================================
     87 ;===========================================================
    11688FNFR(ROOT) ;Given the root of a file return the file number.
    11789 Q +$P(@(ROOT_"0)"),U,2)
    11890 ;
    119  ;=================================
     91 ;===========================================================
    12092NTOAN(NUMBER) ;Given an integer N return an alphabetic string that can be
    12193 ;used for sorting. This will be modulus 26. For example N=0 returns
     
    140112 Q ANUM
    141113 ;
    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 ;===========================================================
    156115SEHIST(FILENUM,ROOT,IEN) ;Set the edit date and edit by and prompt the
    157116 ;user for the edit comment.
     
    186145 Q
    187146 ;
    188  ;=================================
     147 ;===========================================================
    189148SFRES(SDIR,NRES,FIEVAL) ;Save the finding result.
    190149 I NRES=0 S FIEVAL=0 Q
     
    202161 Q
    203162 ;
    204  ;=================================
     163 ;===========================================================
    205164SSPAR(FIND0,NOCC,BDT,EDT) ;Set the finding search parameters.
    206165 S BDT=$P(FIND0,U,8),EDT=$P(FIND0,U,11),NOCC=$P(FIND0,U,14)
    207  I +NOCC=0 S NOCC=1
     166 I NOCC="" S NOCC=1
    208167 ;Convert the dates to FileMan dates.
    209168 S BDT=$S(BDT="":0,BDT=0:0,1:$$CTFMD^PXRMDATE(BDT))
     
    212171 ;If EDT does not contain a time set it to the end of the day.
    213172 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 ;===========================================================
    219176STRREP(STRING,TS,RS) ;Replace every occurrence of the target string (TS)
    220177 ;in STRING with the replacement string (RS).
     
    234191 Q STR
    235192 ;
    236  ;=================================
     193 ;===========================================================
    237194VEDIT(ROOT,IEN) ;This is used as a DIC("S") screen to select which entries
    238195 ;a user can edit.
Note: See TracChangeset for help on using the changeset viewer.