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/PXRMLOCL.m

    r628 r636  
    1 PXRMLOCL ; SLC/PKR - Handle location findings. ;07/26/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMLOCL ; SLC/PKR - Handle location findings. ;07/17/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;This routine is for location list patient lists.
    44 ;=============================================
     
    3333 ;a visit to a hospital location. Return the list in ^TMP($J,PLIST).
    3434 N BTIME,DAS,DATE,DEND,DFN,DONE,DS,ETIME,HLOC,INVBD,INVDATE,INVDT,INVED
    35  N NFOUND,SC,TEMP,TGLIST,TIME
     35 N NFOUND,TEMP,TGLIST,TIME
    3636 S TGLIST="FPLIST_PXRMLOCL"
    3737 K ^TMP($J,TGLIST)
    38  S DEND=$S(EDT[".":EDT,1:EDT+.235959)
     38 S DEND=$S(EDT[".":EDT,1:EDT+.240001)
    3939 ;"AHL" in Visit file is inverse date_.time instead of a full inverse
    4040 ;date and time. For example if the date/time is 3030704.104449 then
    4141 ;"AHL" has 6969295.104449 instead of 6969295.89555
    42  S INVBD=9999999-$P(BDT,".",1),BTIME="."_$P(BDT,".",2)
    43  S INVED=9999999-$P(DEND,".",1),ETIME="."_$P(DEND,".",2)
    44  S DS=INVED-.000001
     42 S INVBD=9999999-$P(BDT,".",1),BTIME=+("."_$P(BDT,".",2))
     43 S INVED=9999999-$P(DEND,".",1),ETIME=+("."_$P(DEND,".",2))
     44 S DS=INVED-1
    4545 S HLOC=""
    4646 F  S HLOC=$O(^TMP($J,HLOCL,HLOC)) Q:HLOC=""  D
     
    5050 .. S INVDATE=$P(INVDT,".",1)
    5151 .. I INVDATE>INVBD S DONE=1 Q
    52  .. S TIME="."_$P(INVDT,".",2)
     52 .. S TIME=+("."_$P(INVDT,".",2))
    5353 .. I INVDATE=INVED,TIME>ETIME Q
    54  .. I INVDATE=INVBD,TIME<BTIME Q
     54 .. I INVDATE=INVBD,BTIME>TIME S DONE=1 Q
    5555 .. S DAS=0
    5656 .. F  S DAS=$O(^AUPNVSIT("AHL",HLOC,INVDT,DAS)) Q:DAS=""  D
     
    5858 ... I '$$VAPSTAT^PXRMVSIT(DAS) Q
    5959 ... S TEMP=^AUPNVSIT(DAS,0)
     60 ... S DFN=$P(TEMP,U,5)
    6061 ... S DATE=$P(TEMP,U,1)
    61  ... S DFN=$P(TEMP,U,5)
    62  ... S SC=$P(TEMP,U,7)
    63  ... S ^TMP($J,TGLIST,DFN,INVDT,DAS)=DATE_U_HLOC_U_SC
     62 ... S ^TMP($J,TGLIST,DFN,INVDT,DAS)=DATE_U_HLOC
    6463 ;Return the NOCC most recent for each patient.
    6564 S DFN=0
     
    7574 ;
    7675 ;=============================================
    77 FTEST(FILENUM,HLOCL,NOCC,BDT,EDT,PLIST) ;Find patient list data for
    78  ;a visit to a hospital location. Return the list in ^TMP($J,PLIST).
    79  N BTIME,DAS,DATE,DEND,DFN,DONE,DS,ETIME,HLOC,INVBD,INVDATE,INVDT,INVED
    80  N NFOUND,TEMP,TGLIST,TIME
    81  S TGLIST="FPLIST_PXRMLOCL"
    82  K ^TMP($J,TGLIST)
    83  S DS=$S(EDT[".":EDT+.0000001,1:EDT+.240001)
    84  S HLOC=""
    85  F  S HLOC=$O(^TMP($J,HLOCL,HLOC)) Q:HLOC=""  D
    86  . S DATE=DS
    87  . F  S DATE=+$O(^AUPNVSIT("AHDP",HLOC,DATE),-1) Q:(DATE=0)!(DATE<BDT)  D
    88  .. S DFN=""
    89  .. F  S DFN=$O(^AUPNVSIT("AHDP",HLOC,DATE,DFN)) Q:DFN=""  D
    90  ... S SC=""
    91  ... F  S SC=$O(^AUPNVSIT("AHDP",HLOC,DATE,DFN,SC)) Q:SC=""  D
    92  .... S DAS=$O(^AUPNVSIT("AHDP",HLOC,DATE,DFN,SC,""))
    93  .... I '$$VAPSTAT^PXRMVSIT(DAS) Q
    94  .... S ^TMP($J,TGLIST,DFN,DATE,DAS)=HLOC
    95  ;Return the NOCC most recent for each patient.
    96  S DFN=0
    97  F  S DFN=$O(^TMP($J,TGLIST,DFN)) Q:DFN=""  D
    98  . S DATE="",NFOUND=0
    99  . F  S DATE=$O(^TMP($J,TGLIST,DFN,DATE),-1) Q:(NFOUND=NOCC)!(DATE="")  D
    100  .. S DAS=""
    101  .. F  S DAS=$O(^TMP($J,TGLIST,DFN,DATE,DAS)) Q:(NFOUND=NOCC)!(DAS="")  D
    102  ... S NFOUND=NFOUND+1
    103  ... S ^TMP($J,PLIST,DFN,NFOUND)=DAS_U_DATE_U_^TMP($J,TGLIST,DFN,DATE,DAS)
    104  K ^TMP($J,TGLIST)
    105  Q
    106  ;
    107  ;=============================================
    10876GPLIST(FILENUM,SNODE,ITEM,PFINDPA,PLIST) ;Add to the patient list.
    10977 ; Return the list in ^TMP($J,PLIST).
     
    11583 ;Set the finding search parameters.
    11684 D SSPAR^PXRMUTIL(PFINDPA(0),.NOCC,.BDT,.EDT)
    117  ;Ignore negative occurrence count, date reversal not allowed in
    118  ;patient lists.
    11985 S NOCC=$S(NOCC<0:-NOCC,1:NOCC)
    12086 D SCPAR^PXRMCOND(.PFINDPA,.CASESEN,.COND,.UCIFS,.ICOND,.VSLIST)
    121  S NGET=$S(UCIFS:50,$D(STATUSA):50,1:NOCC)
     87 S NGET=$S(UCIFS:"*",$D(STATUSA):"*",1:NOCC)
    12288 ;Get a list of unique locations.
    12389 S LNAME=$P(^PXRMD(810.9,ITEM,0),U,1)
Note: See TracChangeset for help on using the changeset viewer.