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

WorldVistAEHR overlayed on FOIAVistA

Location:
FOIAVistA/tag/r
Files:
123 edited
1 copied

Legend:

Unmodified
Added
Removed
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRM7M1.m

    r628 r636  
    1 PXRM7M1 ;SLC/JVS HL7 PUT MESSAGE IN 772 FILE; 06/01/2007  15:26
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRM7M1 ;SLC/JVS HL7 PUT MESSAGE IN 772 FILE; 03/21/2002 ;4/11/02  15:26
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;This routine will use the HL7 Package commands to gather the message
    44 ;into the file 772
     
    1313 S HLA("HLS",1)=PXRM77
    1414 D GENERATE^HLMA(HL("EID"),"GM",1,.PXRM7R,.PXRM7ID,)
    15  D STORE^PXRM7API
    1615 S ID=ZMID
    1716 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRM7XT.m

    r628 r636  
    1 PXRM7XT ;SLC/JVS HL7 EXTRACT FROM FILE; 06/01/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRM7XT ;SLC/JVS HL7 EXTRACT FROM FILE; 03/21/2002 ;4/11/02  15:26
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;This is the beginning of the extraction from the extract file
    44 ;
     
    77 Q
    88SPLIT ;SPLIT MESSAGES
    9  ;
    109 N ORC2
    1110 I LINE>100 D
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMAGE.m

    r628 r636  
    1 PXRMAGE ; SLC/PKR - Utilities for age calculations. ;10/07/2005
    2  ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
     1PXRMAGE ; SLC/PKR - Utilities for age calculations. ;1/27/07  17:46
     2 ;;2.0;CLINICAL REMINDERS;**4,7**;Feb 04, 2005;Build 14
     3 ; Modified from FOIA VISTA,
     4 ; Copyright (C) 2007 WorldVistA
     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
     17 ; along with this program; if not, write to the Free Software
     18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
    319 ;===========================================
    420AGE(DOB,DOD,DATE) ;Given a date of birth, date of death, and a date
     
    622 ;return the age on the date of death. All dates should be in VA
    723 ;Fileman format.
    8  N CDATE
     24 N CDATE,X,X1,X2,X3
    925 S CDATE=$S(DOD="":DATE,DOD'="":DOD)
    10  Q (CDATE-DOB)\10000
     26 S X=(CDATE-DOB)\10000 Q:X>1 X ; Begin VOE changes to support pediatrics
     27 S X1=CDATE,X2=DOB
     28 D ^%DTC S X3=X\365.25,X=$S(X3>2:X3,1:X_"D")
     29 Q X ; End VOE changes to support pediatric ages
    1130 ;
    1231 ;===========================================
    13 AGECHECK(AGE,MINAGE,MAXAGE) ;Given an AGE, MINimumAGE, and MAXimumAGE
     32AGECHECK(PXRMAGE,MINAGE,MAXAGE) ;Given an AGE (with "Y", "M" or "D"), MINimumAGE, and MAXimumAGE
    1433 ;return true if age lies within the range.
    1534 ;Special values of NULL or 0 mean there are no limits.
    1635 ;
    17  S MAXAGE=+MAXAGE
    18  S MINAGE=+MINAGE
     36 ; IHS/CIA/MGH - 5/12/2004 PATCH 1001 Changed to function call to calculate age
     37 ; Two lines changed and one added ; for VOE too
     38 ;S MAXAGE=+MAXAGE
     39 ;S MINAGE=+MINAGE
     40 ;
     41 S MAXAGE=$$DECODE(MAXAGE) ; DECODE used in VOE Pediatric patients
     42 S MINAGE=$$DECODE(MINAGE)
     43 S AGEDAYS=$$DECODE(PXRMAGE)
     44 ;
    1945 ;See if too old.
    20  I (AGE>MAXAGE)&(MAXAGE>0) Q 0
     46 I (AGEDAYS>MAXAGE)&(MAXAGE>0) Q 0
    2147 ;
    2248 ;See if too young.
    2349 I MINAGE=0 Q 1
    24  I AGE<MINAGE Q 0
     50 I AGEDAYS<MINAGE Q 0
    2551 Q 1
    2652 ;
    27  ;===========================================
     53DECODE(AGEVALUE) ; Put age from VADPT into format for reminders ; for VOE too
     54 ; IHS/CIA/MGH - 5/12/2004 PATCH 1001 Added function to change age into days
     55 N NUM,CODE,MULT
     56 S NUM=+AGEVALUE,CODE=$P(AGEVALUE,NUM,2)
     57 S MULT=1.0
     58 I CODE="M" S MULT=30.42
     59 I CODE=""!(CODE="Y") S MULT=365.25
     60 Q +(MULT*NUM)
     61 ;======================================================================
    2862FMTAGE(MINAGE,MAXAGE) ;Format the minimum age and maximum age for display.
    2963 N STR
     
    79113OVERLAP(NAR,MINA,MAXA) ;Check age ranges for overlap.  Return an error message
    80114 ;if an overlap is found.
     115 ;IHS/CIA/MGH Changes made to decode the ages into numeric results
    81116 I NAR'>1 Q 0
    82117 N IC,IN,JC,MAXI,MAXJ,MINI,MINJ,OVRLAP,TEXT
    83118 S OVRLAP=0
    84119 F IC=1:1:NAR-1 D
    85  . S MAXI=MAXA(IC)
     120 . S MAXI=$$DECODE(MAXA(IC)) ; DECODE used in VOE Pediatric patients
    86121 . I MAXI="" S MAXI=1000
    87  . S MINI=MINA(IC)
     122 . S MINI=$$DECODE(MINA(IC))
    88123 . I MINI="" S MINI=0
    89124 . F JC=IC+1:1:NAR D
    90  .. S MAXJ=MAXA(JC)
     125 .. S MAXJ=$$DECODE(MAXA(JC))
    91126 .. I MAXJ="" S MAXJ=1000
    92  .. S MINJ=MINA(JC)
     127 .. S MINJ=$$DECODE(MINA(JC))
    93128 .. I MINJ="" S MINJ=0
    94129 .. S IN=0
     
    122157 Q OVERLAP
    123158 ;
     159 ;======================================================================
     160RESTORE(SOURCE,INDEX,FREQ,MINAGE,MAXAGE) ;Restore FREQ, MINAGE, and
     161 ;MAXAGE back to the original form.  From IHS for VOE
     162 N IND,TEMP
     163 I SOURCE="CFIND" D
     164 . S IND=$O(^PXD(811.9,PXRMITEM,10,"B",INDEX,""))
     165 . S TEMP=^PXD(811.9,PXRMITEM,10,IND,0)
     166 ;
     167 I SOURCE="HFIND" D
     168 . S IND=$O(^PXD(811.9,PXRMITEM,6,"B",INDEX,""))
     169 . S TEMP=^PXD(811.9,PXRMITEM,6,IND,0)
     170 ;
     171 I SOURCE="TFIND" D
     172 . S IND=$O(^PXD(811.9,PXRMITEM,4,"B",INDEX,""))
     173 . S TEMP=^PXD(811.9,PXRMITEM,4,IND,0)
     174 ;
     175 S MINAGE=$P(TEMP,U,2)
     176 S MAXAGE=$P(TEMP,U,3)
     177 S FREQ=$P(TEMP,U,4)
     178 Q
     179 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMCDUE.m

    r628 r636  
    1 PXRMCDUE ;SLC/PKR - Custom date due calculation routines. ;09/05/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMCDUE ;SLC/PKR - Custom date due calculation routines. ;06/30/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;========================================================
     
    3838 . S FI=$P(TEMP,U,1)
    3939 . S FREQ=$P(TEMP,U,2)
    40  . S DATE=$S(FIEVAL(FI):+FIEVAL(FI,"DATE"),1:0)
    41  . I DATE>0 S DATE=$$FULLDATE^PXRMDATE(DATE)
     40 . S DATE=+$G(FIEVAL(FI,"DATE"))
    4241 . S DLIST(IND)=$$NEWDATE^PXRMDATE(DATE,FREQ)
    43  S TEMP=$S(FUNCTION="MAX_DATE":$$MAXDATE(NARGS,.DLIST),FUNCTION="MIN_DATE":$$MINDATE(NARGS,.DLIST),1:0)
     42 S TEMP=$S(FUNCTION="MAX_DATE":$$MAXDATE(NARGS,.DLIST),FUNCTION="MIN_DATE":$$MINDATE(NARGS,.DLIST))
    4443 S DDUE=$P(TEMP,U,1)
    4544 I DDUE=0 Q -1
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMCF.m

    r628 r636  
    1 PXRMCF ; SLC/PKR - Handle computed findings. ;07/25/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMCF ; SLC/PKR - Handle computed findings. ;12/15/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;=======================================================
     
    6363 D SSPAR^PXRMUTIL(PFINDPA(0),.NOCC,.BDT,.EDT)
    6464 S SDIR=$S(NOCC<0:+1,1:-1)
     65 S NOCC=$S(NOCC<0:-NOCC,1:NOCC)
    6566 S TEST=PFINDPA(15)
    6667 D SCPAR^PXRMCOND(.PFINDPA,.CASESEN,.COND,.UCIFS,.ICOND,.VSLIST)
    67  S NGET=$S(UCIFS:50,$D(STATUSA):50,1:NOCC)
    68  ;Make sure NGET has the same sign as NOCC.
    69  I NGET'=NOCC S NGET=NGET*($$ABS^XLFMTH(NOCC)/NOCC)
     68 S NGET=$S(UCIFS:"*",$D(STATUSA):"*",1:NOCC)
    7069 S TEMP=^PXRMD(811.4,ITEM,0)
    7170 S TYPE=$P(TEMP,U,5)
     
    127126 S NOCCABS=$$ABS^XLFMTH(NOCC)
    128127 D SCPAR^PXRMCOND(.PFINDPA,.CASESEN,.COND,.UCIFS,.ICOND,.VSLIST)
    129  S NGET=$S(UCIFS:50,$D(STATUSA):50,1:NOCCABS)
     128 S NGET=$S(UCIFS:"*",$D(STATUSA):"*",1:NOCCABS)
    130129 K ^TMP($J,TGLIST)
    131130 S ROUTINE=$P(TEMP,U,3)_"^"_$P(TEMP,U,2)_"(NGET,BDT,EDT,TGLIST,PARAM)"
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMCOND.m

    r628 r636  
    1 PXRMCOND ; SLC/PKR - Routines for evaluating conditions. ;06/01/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMCOND ; SLC/PKR - Routines for evaluating conditions. ;11/01/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;============================================================
     
    7979 S CONDS=$G(FINDPA(3))
    8080 S COND=$P(CONDS,U,1)
    81  ;Even if there is no condition UCIFS could be used for status search.
    82  S UCIFS=$P(CONDS,U,3)
     81 S UCIFS=$S(COND="":0,1:$P(CONDS,U,3))
    8382 I COND="" Q
    8483 S CASESEN=$P(CONDS,U,2)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMCOPY.m

    r628 r636  
    1 PXRMCOPY ; SLC/PKR,PJH - Copy various reminder files. ;09/13/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMCOPY ; SLC/PKR,PJH - Copy various reminder files. ;05/11/2001
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;=====================================================
     
    1212 N DA,DIE,DIC,DIK,DIR,DIRUT,FDA,FIELDLEN,FILE
    1313 N IENN,IENO,IENS,MSG,NAME,ORGNAME,X,Y
    14  S DIC=ROOT,DIC(0)="AEMQ",DIC("A")=PROMPT
     14 S DIC=ROOT,DIC(0)="AEQ",DIC("A")=PROMPT
    1515 W !
    1616 D ^DIC
     
    6464 ;
    6565 ;=====================================================
    66 COPYLL ;Copy a location list.
    67  N PROMPT,ROOT,WHAT
    68  S WHAT="location list"
    69  S ROOT="^PXRMD(810.9,"
    70  S PROMPT="Select the reminder location list to copy: "
    71  D COPY(PROMPT,ROOT,WHAT)
    72  Q
    73  ;
    74  ;=====================================================
    7566COPYREM ;Copy a reminder definition.
    7667 N PROMPT,ROOT,WHAT
    7768 S WHAT="reminder"
    7869 S ROOT="^PXD(811.9,"
    79  S PROMPT="Select the reminder definition to copy: "
     70 S PROMPT="Select the reminder item to copy: "
    8071 D COPY(PROMPT,ROOT,WHAT)
    8172 Q
     
    8677 S WHAT="taxonomy"
    8778 S ROOT="^PXD(811.2,"
    88  S PROMPT="Select the reminder taxonomy to copy: "
     79 S PROMPT="Select the taxonomy item to copy: "
    8980 D COPY(PROMPT,ROOT,WHAT)
    9081 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDATA.m

    r628 r636  
    1 PXRMDATA ; SLC/PKR - Routines for getting data. ;04/02/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMDATA ; SLC/PKR - Routines for getting data. ;07/17/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;===============================================
     
    1313 I FILENUM=100 D GETDATA^PXRMORDR(DAS,.FIEVT) Q
    1414 I FILENUM=120.5 D GETDATA^PXRMVITL(DAS,.FIEVT) Q
    15  I FILENUM=601.84 D GETDATA^PXRMMH(DAS,.FIEVT) Q
     15 I FILENUM=601.2 D GETDATA^PXRMMH(DAS,.FIEVT) Q
    1616 I FILENUM=9000010 D GETDATA^PXRMVSIT(DAS,.FIEVT,1) Q
    1717 I FILENUM=9000010.07 D GETDATA^PXRMVPOV(DAS,.FIEVT) Q
     
    5757 I ENODE="PSRX(" Q 52
    5858 I ENODE="RAMIS(71," Q 70
    59  I ENODE="YTT(601.71," Q 601.84
     59 I ENODE="YTT(601," Q 601.2
    6060 Q 0
    6161 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDATE.m

    r628 r636  
    1 PXRMDATE ; SLC/PKR - Clinical Reminders date utilities. ;01/24/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMDATE ; SLC/PKR - Clinical Reminders date utilities. ;06/20/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;==================================================
     
    4848 ;forms as well as T-NY to a FileMan date. Also understands LAD for
    4949 ;Last Admission Date.
    50  N %DT,ND,X,Y
    51  ;Already a FileMan date?
    52  S ND=+DATE
    53  I (ND'<1000000),(ND'>9991231) Q DATE
     50 N %DT,X,Y
    5451 ;Check for a date FileMan understands.
    5552 S X=DATE,%DT="ST"
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDBL3.m

    r628 r636  
    1 PXRMDBL3 ; SLC/PJH - Reminder Dialog Generation. (overflow) ;11/08/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMDBL3 ; SLC/PJH - Reminder Dialog Generation. (overflow) ;04/30/2001
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ; Called from PXRMDBL1
    55 ;
    66 ;Set number range for site
    7 START ;
    8  D SETSTART^PXRMCOPY("^PXRMD(801.41,")
     7START D SETSTART^PXRMCOPY("^PXRMD(801.41,")
    98 ;Update dialog file for individual dialog items
    109 D UPDATE(.ARRAY,.WPTXT,"E")
     
    6463 N RNAME,TEST,YT S YT=""
    6564 ;Convert ien to name
    66  ;DBIA #5044
    67  S YT("CODE")=$P($G(^YTT(601.71,IEN,0)),U)
     65 S YT("CODE")=$P($G(^YTT(601,IEN,0)),U)
    6866 ;Quit if no code found
    6967 I YT("CODE")="" Q 0
    70  I '$$OK^PXRMDLL(IEN) Q 0
     68 ;Check if this is an allowable GUI test
     69 I (YT("CODE")'="GAF"),($P($G(^YTT(601.6,IEN,0)),U,4)'="Y") Q 0
     70 ;Get details of test
     71 D SHOWALL^YTAPI3(.TEST,.YT)
    7172 ;Check if valid
    72  ;I TEST(1)["[ERROR]" Q 0
     73 I TEST(1)["[ERROR]" Q 0
    7374 ;
    7475 S DNAME=FTYP_" "_YT("CODE")
     
    8283 ;Dialog item name, finding item and result
    8384 S ARRAY(CNT)=DSHORT_U_U_RESN_U
    84  ;Commented out Result Group Patch 6 until a decision can be made
    8585 ;Result group name
    86  ;S RNAME="PXRM "_YT("CODE")_" RESULT GROUP"
     86 S RNAME="PXRM "_YT("CODE")_" RESULT GROUP"
    8787 ;Result pointer
    88  ;S $P(ARRAY(CNT),U,7)=$O(^PXRMD(801.41,"B",RNAME,""))
     88 S $P(ARRAY(CNT),U,7)=$O(^PXRMD(801.41,"B",RNAME,""))
    8989 ;If aims exclude from p/n
    9090 I YT("CODE")="AIMS" S $P(ARRAY(CNT),U,6)=1
     
    130130 ..;MH fields (exclude from P/N and results pointer)
    131131 ..S:$P(INP(CNT),U,6) FDA(801.41,"?+1,",54)=$P(INP(CNT),U,6)
    132  ..;S:$P(INP(CNT),U,7) FDA(801.41,"?+1,",55)=$P(INP(CNT),U,7)
     132 ..S:$P(INP(CNT),U,7) FDA(801.41,"?+1,",55)=$P(INP(CNT),U,7)
    133133 .;Reminder dialog associated reminder/DISABLE
    134134 .I DTYPE="R" D
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDEDT.m

    r628 r636  
    1 PXRMDEDT ; SLC/PJH - Edit PXRM reminder dialog. ;10/18/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMDEDT ; SLC/PJH - Edit PXRM reminder dialog. ;07/28/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;Used by protocol PXRM SELECTION ADD/PXRM GENERAL ADD
     
    6363 ;Allows limited edit of national dialogs
    6464 I $P($G(^PXRMD(801.41,DA,100)),U)="N" D
    65  .I TYP="T",+$P($G(^PXMRD(801.41,DA,100)),U,4)=0 Q
    6665 .I $G(PXRMINST)=1,DUZ(0)="@" Q
    6766 .S DR="[PXRM EDIT NATIONAL DIALOG]",DINUSE=1
     
    276275 .N DTYP
    277276 .S DTYP=$P($G(^PXRMD(801.41,DA,0)),U,4)
    278  .;Allow limit edit of Result Elements that are not lock
    279  .I DTYP="T",+$P($G(^PXRMD(801.41,DA,100)),U,4)=0 Q
    280277 .;Allow edit of findings but not component multiple on groups
    281278 .I DTYP="G",$G(PXRMDIEN),DA'=PXRMDIEN Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDEV.m

    r628 r636  
    1 PXRMDEV ; SLC/PKR - This is a driver for testing Clinical Reminders.;01/24/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMDEV ; SLC/PKR - This is a driver for testing Clinical Reminders.;05/04/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;==================================================
     
    3232 I DFN=-1 W !,"No patient selected!" Q
    3333 S DIC=811.9,DIC("A")="Select Reminder: "
     34 S DIC("S")="I $P(^PXD(811.9,Y,100),U,4)'[""L"""
    3435 D ^DIC
    3536 I $D(DIROUT)!$D(DIRUT) Q
     
    6768 S DFN=+$P(Y,U,1)
    6869 S DIC=811.9,DIC("A")="Select Reminder: "
     70 S DIC("S")="I $P(^PXD(811.9,Y,100),U,4)'[""L"""
    6971 D ^DIC
    7072 I $D(DIROUT)!$D(DIRUT) Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDLG4.m

    r628 r636  
    1 PXRMDLG4 ; SLC/PJH - Reminder Dialog Edit/Inquiry ;06/05/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMDLG4 ; SLC/PJH - Reminder Dialog Edit/Inquiry ;10/31/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44WP(SUB,SUB1,WIDTH,SEQ,VALMCNT) ;Format WP text
     
    2222 W IORESET
    2323 S VALMBCK="R",NATIONAL=0
     24 ;Check if national reminder dialog
    2425 I $P($G(^PXRMD(801.41,PXRMDIEN,100)),U)="N" S NATIONAL=1
    2526 S LOCK=$P($G(^PXRMD(801.41,PXRMDIEN,100)),U,4)
     27 ;Dissallow editing of national dialogs
    2628 I NATIONAL,'($G(PXRMINST)=1)&(DUZ(0)="@"),$G(LOCK)'=1 D  Q
    2729 .W !,"Elements may not be added to national reminder dialogs" H 2
     
    6163 .;Get ien of prompt/component
    6264 .S DCIEN=$P($G(^PXRMD(801.41,DIEN,10,DSUB,0)),U,2) Q:'DCIEN
     65 .;Ignore prompts and forced values
    6366 .I "PF"[$P($G(^PXRMD(801.41,DCIEN,0)),U,4) Q
    6467 .;Save line in workfile
     
    7477DLINE(DIEN,LEV,DSEQ,NODE) ;Save individual component details
    7578 N CNT,DBOX,DCAP,DDIS,DMULT,DSUPP,DSHOW,DTYP,DTXT
    76  N IC,RESNM,RESULT,RIEN,RNAME,RCNT
     79 N IC,RESNM,RESULT,RIEN,RNAME
    7780 ;Dialog name
    7881 S DDATA=$G(^PXRMD(801.41,DIEN,0)),DNAM=$P(DDATA,U) Q:DNAM=""
     
    8689 S RNAME="",RIEN=$P($G(^PXRMD(801.41,DIEN,1)),U,3)
    8790 I RIEN S RNAME=$P($G(^PXRMD(801.9,RIEN,0)),U)
     91 ;Result Group
     92 S RESULT=$P(DDATA,U,15)
     93 I RESULT S RESNM=$P($G(^PXRMD(801.41,RESULT,0)),U)
    8894 ;
    8995 ;Group fields
     
    142148 ..S TEMP=$J("",TAB)_"Resolution: "_RNAME
    143149 ..S NLINE=NLINE+1,^TMP(NODE,$J,NLINE,0)=TEMP
    144  .;Result Group
    145  .I VIEW=4 D
    146  ..S RCNT=0 F  S RCNT=$O(^PXRMD(801.41,DIEN,51,RCNT)) Q:RCNT'>0  D
    147  ...S RESULT=$P($G(^PXRMD(801.41,DIEN,51,RCNT,0)),U)
    148  ...S RESNM=$P($G(^PXRMD(801.41,RESULT,0)),U) Q:RESNM=""
    149  ...S TEMP=$J("",TAB)_"Result Group: "_RESNM
    150  ...S NLINE=NLINE+1,^TMP(NODE,$J,NLINE,0)=TEMP
    151150 .;Additional findings
    152151 .D FADD(DIEN,TAB)
     
    166165FDESC(FIEN) ;Finding description
    167166 N FGLOB,FITEM,FNUM
     167 ;Determine finding type
    168168 S FGLOB=$P(FIEN,";",2) Q:FGLOB=""
    169169 S FITEM=$P(FIEN,";") Q:FITEM=""
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDLG5.m

    r628 r636  
    1 PXRMDLG5 ; SLC/PJH - Reminder Dialog Edit/Inquiry ;11/08/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMDLG5 ; SLC/PJH - Reminder Dialog Edit/Inquiry ;05/17/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    4 ALT(DIEN,LEV,DSEQ,NODE,VIEW,NLINE,CNT,ALTLEN) ;
    5  ;Display branching logic text in dialog summary view
    6  N DATA,DNAM,DTYP,IEN,TERM,TNAME,TSTAT,TEMP
    7  S DATA=$G(^PXRMD(801.41,DIEN,49))
    8  I '+$P(DATA,U)!($P($G(DATA),U,2)="") Q
    9  S TNAME=$P($G(^PXRMD(811.5,$P(DATA,U),0)),U)
    10  S TSTAT=$S($P(DATA,U,2)="1":"TRUE",1:"FALSE")
    11  I +$P(DATA,U,3)>0 D
    12  .S IEN=$P(DATA,U,3),DNAM=$P($G(^PXRMD(801.41,IEN,0)),U)
    13  .S DTYP=$S($P($G(^PXRMD(801.41,IEN,0)),U,4)="E":"Element",$P($G(^PXRMD(801.41,IEN,0)),U,4)="G":"Group")
    14  I $G(DNAM)="" S TEMP="Suppressed if Reminder Term "_TNAME_" evaluates as "_TSTAT
    15  I $G(DNAM)'="" S TEMP="Replaced by "_DNAM_" if Reminder Term "_TNAME_" evaluates as "_TSTAT
    16  D TEXT(.NLINES,CNT,ALTLEN,TEMP,NODE)
    17  Q
    184 ;
    195ASK(YESNO,PIEN) ;Confirm
     
    3622 S VALMBCK="R"
    3723 Q
     24 ;
     25MSEL(NUM) ;
     26 I NUM=4,'$$PATCH^XPDUTL("OR*3.0*243") D EN^DDIOL("THIS SELECTION IS NOT VALID, UNTIL CPRS 27 IS INSTALLED") Q 0
     27 Q 1
     28 ;
     29ALT(DIEN,LEV,DSEQ,NODE,VIEW,NLINE,CNT,ALTLEN) ;
     30 ;Display branching logic text in dialog summary view
     31 N DATA,DNAM,DTYP,IEN,TERM,TNAME,TSTAT,TEMP
     32 S DATA=$G(^PXRMD(801.41,DIEN,49))
     33 I '+$P(DATA,U)!($P($G(DATA),U,2)="") Q
     34 S TNAME=$P($G(^PXRMD(811.5,$P(DATA,U),0)),U)
     35 S TSTAT=$S($P(DATA,U,2)="1":"TRUE",1:"FALSE")
     36 I +$P(DATA,U,3)>0 D
     37 .S IEN=$P(DATA,U,3),DNAM=$P($G(^PXRMD(801.41,IEN,0)),U)
     38 .S DTYP=$S($P($G(^PXRMD(801.41,IEN,0)),U,4)="E":"Element",$P($G(^PXRMD(801.41,IEN,0)),U,4)="G":"Group")
     39 I $G(DNAM)="" S TEMP="Suppressed if Reminder Term "_TNAME_" evaluates as "_TSTAT
     40 I $G(DNAM)'="" S TEMP="Replaced by "_DNAM_" if Reminder Term "_TNAME_" evaluates as "_TSTAT
     41 D TEXT(.NLINES,CNT,ALTLEN,TEMP,NODE)
     42 Q
     43 ;
     44OTERM(DA) ;
     45 K OTERM
     46 S OTERM=$P($G(^PXRMD(801.41,DA,49)),U) Q
     47 ;
     48NTERM(DA,OTERM,NTERM) ;
     49 I +OTERM=0 S OTERM=$P($G(DA),U)
     50 I +NTERM=0 K OTERM Q 2
     51 I +OTERM=0,+NTERM>0 K OTERM Q 1
     52 I +OTERM'=+NTERM K OTERM Q 0
     53 K OTERM
     54 Q 1
     55 ;
     56TERMS(DA,X) ;
     57 N TERM
     58 S TERM=$P($G(^PXRMD(801.41,DA,49)),U)
     59 I +TERM=0 D  Q 0
     60 .W !,"Cannot set Reminder Term Status if the Reminder Term field is blank"
     61 .H 2
     62 I +TERM>0,$G(X)="" Q 2
     63 Q 1
    3864 ;
    3965BHELP(VALUE) ;
     
    5985 I VALUE=4 D
    6086 .;Patient Specific field
    61  .S HTEXT(1)="Enter either 1 for true or 0 for false. This value must be set to true"
     87 .S HTEXT(1)="Enter either 1 for true or 0 for false. This value must be set totrue"
    6288 .S HTEXT(2)="if item in this dialog will be using reminder term to either replace an item"
    6389 .S HTEXT(3)="or to suppress an item."
     
    6591 Q
    6692 ;
     93TEXT(NLINES,CNT,ATLEN,TEMP,NODE) ;
     94 N CNT1,NOUT,OUTPUT,WIDHT
     95 S WIDTH=IOM-(2+(CNT+ATLEN))
     96 S CNT1=1 D FORMATS^PXRMTEXT(1,WIDTH,TEMP,.NOUT,.OUTPUT)
     97 I NOUT>0 F CNT1=1:1:NOUT D
     98 .S NLINE=NLINE+1,^TMP(NODE,$J,NLINE,0)=$J("",2+(CNT+ATLEN))_OUTPUT(CNT1)
     99 Q
     100 ;
    67101INQ(DIEN) ;INQ Inquiry/Print option
     102 ;
    68103 ; Used by 801.41 print templates
    69104 ; [PXRM REMINDER DIALOG]
     
    84119 K ^TMP(NODE,$J)
    85120 Q
    86  ;
    87 MH(IEN) ;Allow IEN=109 (HX2) as a place holder for 601 entries that do not
    88  ;have a corresponding 601.71 entry.
    89  I IEN=109 Q 1
    90  I $G(PXRMINST)=1 Q 1
    91  N MAXNUM
    92  S MAXNUM=+$P($G(^PXRM(800,1,"MH")),U)
    93  I MAXNUM=0 S MAXNUM=25
    94  Q $$ONECR^YTQPXRM5(IEN,MAXNUM)
    95  ;
    96 MHLICR(IEN) ;Called by input template PXRM EDIT ELEMENT. Preserve Y so template
    97  ;branching works.
    98  N Y
    99  ;DBIA #5042
    100  I $$RL^YTQPXRM3(IEN)="Y" D
    101  .W !,"This MH test requires a license."
    102  .W !,"The question text will not appear in the progress note.",!
    103  .H 1
    104  Q
    105  ;
    106 MSEL(NUM) ;
    107  I NUM=4,'$$PATCH^XPDUTL("OR*3.0*243") D EN^DDIOL("THIS SELECTION IS NOT VALID, UNTIL CPRS 27 IS INSTALLED") Q 0
    108  Q 1
    109  ;
    110 MHREQHLP ;
    111  N TEXT
    112  S TEXT(1)="Select 0, ""Optional open and optional complete (partial complete possible)"","
    113  S TEXT(2)="if the user should be able to optionally select/open the MH test in the reminder dialog and optionally complete the MH test before the reminder dialog can be finished."
    114  S TEXT(3)=" "
    115  S TEXT(4)="Select 1, ""Required open and required complete before finish"","
    116  S TEXT(5)="if the user is required to select/open and complete the MH test in the reminder dialog before the reminder dialog can be finished."
    117  S TEXT(6)=" "
    118  S TEXT(7)="Select 2, ""Optional open and required complete or cancel before finish"","
    119  S TEXT(8)="if the user should be able to optionally select/open the MH test in the reminder dialog; however, if the user opens the MH test, then the user is required to complete or cancel the MH test before the reminder dialog can be finished."
    120  S TEXT(9)=" "
    121  S TEXT(10)="Note: Clicking the cancel button in the MH Test is considered the same as not opening the MH Test."
    122  S TEXT(11)="Also, Option 2, ""Optional open and required complete or cancel before finish"", only works with CPRS 27 and"
    123  S TEXT(12)="YS_MHA.dll. If Option 2 is selected and the user is using a pre-CPRS 27 version this option will be treated by CPRS as Option 1, ""Required open and required complete before finish""."
    124  D HELP^PXRMEUT(.TEXT)
    125  Q
    126  ;
    127 NTERM(DA,OTERM,NTERM) ;
    128  I +OTERM=0 S OTERM=$P($G(DA),U)
    129  I +NTERM=0 K OTERM Q 2
    130  I +OTERM=0,+NTERM>0 K OTERM Q 1
    131  I +OTERM'=+NTERM K OTERM Q 0
    132  K OTERM
    133  Q 1
    134  ;
    135 OTERM(DA) ;
    136  K OTERM
    137  S OTERM=$P($G(^PXRMD(801.41,DA,49)),U)
    138  Q
    139  ;
    140 RESCHK(IEN) ;Called by input template PXRM EDIT ELEMENT. Preserve Y so template
    141  ;branching works.
    142  N CNT,FDA,MSG,RG,RGIEN,VALID,Y
    143  S CNT=0
    144  F  S CNT=$O(^PXRMD(801.41,IEN,51,CNT)) Q:CNT'>0  D
    145  .S RGIEN=$P($G(^PXRMD(801.41,IEN,51,CNT,0)),U) I +RGIEN'>0 Q
    146  .S RG=$P($G(^PXRMD(801.41,RGIEN,0)),U,1)
    147  .I RG="" Q
    148  .S VALID=$$RGLSCR(IEN,RG,RGIEN)
    149  .I VALID Q
    150  .W !,"Deleting the result group ",RG," from the element/group."
    151  .S FDA(801.41121,CNT_","_IEN_",",.01)="@"
    152  .D FILE^DIE("E","FDA","MSG")
    153  .S RGKILL=1
    154  .I $D(MSG) D AWRITE^PXRMUTIL("MSG")
    155  Q
    156  ;
    157 RSELEDIT(DA) ;
    158  N NODE,RESULT
    159  ;RESULT=0 EDIT NOTHING
    160  ;RESULT=1 EDIT INFORMATIONAL TEXT
    161  ;RESULT=2 EDIT EVERYTHING
    162  S RESULT=2
    163  I $G(PXRMINST)=1,DUZ(0)="@" Q RESULT
    164  S NODE=$G(^PXRMD(801.41,DA,100))
    165  I $P(NODE,U)="N" S RESULT=0
    166  I RESULT=0,+$P(NODE,U,4)=0 S RESULT=1
    167  Q RESULT
    168  ;
    169 RGLSCR(DA,X,IEN) ;Input transform/screen for RESULT GROUP LIST
    170  I $G(PXRMINST)=1 Q 1
    171  I $G(PXRMEXCH)=1 Q 1
    172  N HELP,MHTEST,TEXT,VALID,Y
    173  S NMATCH=0
    174  S MHTEST=$O(^PXRMD(801.41,"B",X),-1)
    175  F  S MHTEST=$O(^PXRMD(801.41,"B",MHTEST)) Q:(NMATCH>1)!(MHTEST'[X)  S NMATCH=NMATCH+1
    176  ;If there is an exact match to the user's input turn help on.
    177  S HELP=$S($G(DIQUIET):0,NMATCH=1:1,1:0)
    178  S VALID=1
    179  ;Make sure the TYPE is a result group
    180  I '$D(^PXRMD(801.41,"TYPE","S",IEN)) D
    181  . I HELP S TEXT(1)="TYPE must be a result group."
    182  . S VALID=0
    183  ;Make sure the finding item for the element matches the
    184  ;MH Test assigned to the Result Group
    185  S MHTEST=+$P($G(^PXRMD(801.41,DA,1)),U,5) I MHTEST="" D
    186  . I HELP S TEXT(2)="The MH test is missing."
    187  . S VALID=0
    188  I +$P($G(^PXRMD(801.41,IEN,50)),U)'=MHTEST D
    189  . I HELP S TEXT(3)="The finding item does not match the MH Test assigned to the Result Group"
    190  . S VALID=0
    191  ;Make sure a scale has been defined.
    192  I +$P($G(^PXRMD(801.41,IEN,50)),U,2)'>0 D
    193  . I HELP S TEXT(4)="An MH Scale must be defined."
    194  . S VALID=0
    195  ;Make sure it is not disabled.
    196  I $P($G(^PXRMD(801.41,IEN,0)),U,3)'="" D
    197  . S VALID=0
    198  . I HELP D
    199  .. N EM,TYPE
    200  .. S TYPE=$P(^PXRMD(801.41,IEN,0),U,4)
    201  .. S TYPE=$$EXTERNAL^DILFD(801.41,4,"",TYPE,.EM)
    202  .. S TEXT(5)="The "_TYPE_" is disabled."
    203  I HELP,'VALID D EN^DDIOL(.TEXT)
    204  Q VALID
    205  ;
    206 TERMS(DA,X) ;
    207  N TERM
    208  S TERM=$P($G(^PXRMD(801.41,DA,49)),U)
    209  I +TERM=0 D  Q 0
    210  .W !,"Cannot set Reminder Term Status if the Reminder Term field is blank"
    211  .H 2
    212  I +TERM>0,$G(X)="" Q 2
    213  Q 1
    214  ;
    215 TEXT(NLINES,CNT,ATLEN,TEMP,NODE) ;
    216  N CNT1,NOUT,OUTPUT,WIDHT
    217  S WIDTH=IOM-(2+(CNT+ATLEN))
    218  S CNT1=1 D FORMATS^PXRMTEXT(1,WIDTH,TEMP,.NOUT,.OUTPUT)
    219  I NOUT>0 F CNT1=1:1:NOUT D
    220  .S NLINE=NLINE+1,^TMP(NODE,$J,NLINE,0)=$J("",2+(CNT+ATLEN))_OUTPUT(CNT1)
    221  Q
    222  ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDLGZ.m

    r628 r636  
    1 PXRMDLGZ ; SLC/PJH - Link reminder to dialog. ;01/11/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMDLGZ ; SLC/PJH - Link reminder to dialog. ;05/31/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;Called by option PXRM DIALOG/COMPONENT EDIT
     
    229229 .W $C(7),!,"A taxonomy cannot be entered as the finding item for a group"
    230230 ;Only applies to MH
    231  I $P(X,";",2)'="^YTT(601.71," Q 1
    232  I $$OK^PXRMDLL($P(X,";")) Q 1
     231 I $P(X,";",2)'="YTT(601," Q 1
     232 ;GAF
     233 I $P($G(^YTT(601,$P(X,";"),0)),U)="GAF" Q 1
     234 ;Check if a VALID GUI test
     235 I $P($G(^YTT(601.6,$P(X,";"),0)),U,4)="Y" Q 1
     236 ;else
    233237 W *7,!,"This test is not appropriate for the GUI",!
    234238 Q 0
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDLL.m

    r628 r636  
    11PXRMDLL ;SLC/PJH - REMINDER DIALOG LOADER ;09/26/2007
    2  ;;2.0;CLINICAL REMINDERS;**10,6**;Feb 04, 2005;Build 123
     2 ;;2.0;CLINICAL REMINDERS;**10**;Feb 04, 2005;Build 25
    33 ;
    44OK(DIEN) ;Check if mental health test is for GUI
    5  I 'DIEN Q 0
    6  Q $$MH^PXRMDLG5(DIEN)
     5 I 'DFIEN Q 0
     6 I $P($G(^YTT(601.6,DFIEN,0)),U,4)="Y" Q 1
     7 I $P($G(^YTT(601,DFIEN,0)),U)="GAF" Q 1
     8 Q 0
    79 ;
    810TXT ;Format text
     
    100102 .I $P($G(^PXRMD(801.41,DGIEN,2)),U,3) S DEXC=1
    101103 .S DTYP=$P(DATA,U,4),DSUPP=$P(DATA,U,11) Q:"EG"'[DTYP
    102  .S DMHEX=$P(DATA,U,14)
    103  .S DRESL=$$RESGROUP^PXRMDLLB(DGIEN)
    104  .;S DRESL=$P(DATA,U,15)
     104 .S DMHEX=$P(DATA,U,14),DRESL=$P(DATA,U,15)
    105105 .S DRES=$P($G(^PXRMD(801.41,DGIEN,1)),U,3)
    106106 .;Done Elsewhere (historical)
     
    146146 S DARRAY("GMRD(120.51,")="VIT"
    147147 S DARRAY("ORD(101.41,")="Q"
    148  S DARRAY("YTT(601.71,")="MH"
     148 S DARRAY("YTT(601,")="MH"
    149149 S DARRAY("ICD9(")="POV"
    150150 S DARRAY("ICPT(")="CPT"
     
    168168 ..D REPLACE^PXRMDLLB(DFN,TERMNODE,.DITEM,.DATA,.TERMSTAT)
    169169 .S DTYP=$P(DATA,U,4),DSUPP=$P(DATA,U,11)
    170  .S DMHEX=$P(DATA,U,14)
    171  .S DRESL=$$RESGROUP^PXRMDLLB(DITEM)
    172  .;S DRESL=$P(DATA,U,15)
     170 .S DMHEX=$P(DATA,U,14),DRESL=$P(DATA,U,15)
    173171 .K DTXT S SUB=0
    174172 .F  S SUB=$O(^PXRMD(801.41,DITEM,25,SUB)) Q:'SUB  D
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDLLA.m

    r628 r636  
    1 PXRMDLLA ;SLC/PJH - REMINDER DIALOG LOADER ;11/08/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMDLLA ;SLC/PJH - REMINDER DIALOG LOADER ;07/29/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44FREC(DFIEN,DFTYP) ;Build type 3 record
     
    2525 .;If mental health check if a GAF score and if MH test is required
    2626 .I DPCE="MH",DFIEN D
    27  ..;DBIA #5044
    28  ..I $P($G(^YTT(601.71,DFIEN,0)),U)="GAF" S $P(ORY(OCNT),U,12)=1
     27 ..I $P($G(^YTT(601,DFIEN,0)),U)="GAF" S $P(ORY(OCNT),U,12)=1
    2928 ..;Check to see if the MH test is required
    30  ..S $P(ORY(OCNT),U,13)=+$P($G(^PXRMD(801.41,DITEM,0)),U,18)
    31  ..I $P(ORY(OCNT),U,13)=2,$$PATCH^XPDUTL("OR*3.0*243")=0 S $P(ORY(OCNT),U,13)=1
     29 ..S $P(ORY(OCNT),U,13)=$S($P($G(^PXRMD(801.41,DITEM,0)),U,18)=1:1,1:0)
    3230 Q
    3331 ;
     
    5250 S DARRAY("GMRD(120.51,")="VIT"
    5351 S DARRAY("ORD(101.41,")="Q"
    54  S DARRAY("YTT(601.71,")="MH"
     52 S DARRAY("YTT(601,")="MH"
    5553 ;
    5654 S DARRAY("ICD9(")="POV"
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDLLB.m

    r628 r636  
    1 PXRMDLLB ;SLC/PJH - REMINDER DIALOG LOADER ;05/01/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMDLLB ;SLC/PJH - REMINDER DIALOG LOADER ;07/29/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44CODE(DFIEN,DFTYP,ARRAY) ;
     
    108108 Q
    109109 ;
    110 RESGROUP(DIEN) ;
    111  N CNT,RESULT,TEMP
    112  S RESULT=""
    113  I $$PATCH^XPDUTL("OR*3.0*243")=0 D  Q RESULT
    114  .S RESULT=$P($G(^PXRMD(801.41,DIEN,51,1,0)),U) I RESULT="" Q
    115  .I $P($G(^PXRMD(801.41,RESULT,0)),U,3)'="" S RESULT="" Q
    116  S CNT=0 F  S CNT=$O(^PXRMD(801.41,DIEN,51,CNT)) Q:CNT'>0  D
    117  .S TEMP=$P($G(^PXRMD(801.41,DIEN,51,CNT,0)),U) I TEMP="" Q
    118  .I $P($G(^PXRMD(801.41,TEMP,0)),U,3)'="" S TEMP="" Q
    119  .S RESULT=$S(RESULT="":TEMP,1:RESULT_"~"_TEMP)
    120  Q RESULT
    121  ;
    122110TERM(TERMIEN,DFN,IEN) ;
    123111 ;this section is use to for the term evaluation
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDLR.m

    r628 r636  
    1 PXRMDLR ;SLC/PJH - DIALOG RESULTS LOADER ;05/15/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMDLR ;SLC/PJH - DIALOG RESULTS LOADER ;06/09/2000
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;Build score related P/N text from score and result group
    55 ;
    66 ;If not found
    7 START(ORY,RESULT,ORES) ;
    87 I '$G(RESULT) S ORY(1)="-1^no results for this test" Q
    98 ;
    10  N ARRAY,ERROR,INSERT,OK,SCORE,SUB,YT,X
     9 N ARRAY,ERROR,INSERT,OK,SCORE,SUB,YT
    1110 ;
    12  I RESULT["~" S RESULT=$P(RESULT,"~")
    1311 S ERROR=0
    1412 ;
    1513 ;Get score using API
    16  K ^TMP($J,"YSCOR")
     14 S DFN=$G(ORES("DFN"))
    1715 I ORES("CODE")'="DOM80" D  Q:ERROR
    1816 .M YT=ORES
    19  .F X=1:1:$L(YT("R1")) I $E(YT("R1"),X)'="X" S YT(X)=X_U_$E(YT("R1"),X)
    20  .K YT("R1")
    21  .D CHECKCR^YTQPXRM4(.ARRAY,.YT)
    22  .S OK=0
    23  .;D PREVIEW^YTAPI4(.ARRAY,.YT)
    24  .I ^TMP($J,"YSCOR",1)'="[DATA]" S ORY(1)="-1^"_^TMP($J,"YSCOR",1)_^TMP($J,"YSCOD",2),ERROR=1 Q
    25  .;I ARRAY(1)'="[DATA]" S ORY(1)="-1^"_ARRAY(1)_ARRAY(2),ERROR=1 Q
    26  .I $P($G(^TMP($J,"YSCOR",2)),"=",2)'="" S SCORE=$P($G(^TMP($J,"YSCOR",2)),"=",2),OK=1
    27  .;S SUB=0,OK=0
    28  .;F  S SUB=$O(ARRAY(SUB)) Q:'SUB  D  Q:OK
    29  .;.I $P(ARRAY(SUB),U)="S1" S SCORE=$P(ARRAY(SUB),U,3),OK=1
     17 .D PREVIEW^YTAPI4(.ARRAY,.YT)
     18 .I ARRAY(1)'="[DATA]" S ORY(1)="-1^"_ARRAY(1)_ARRAY(2),ERROR=1 Q
     19 .S SUB=0,OK=0
     20 .F  S SUB=$O(ARRAY(SUB)) Q:'SUB  D  Q:OK
     21 ..I $P(ARRAY(SUB),U)="S1" S SCORE=$P(ARRAY(SUB),U,3),OK=1
    3022 .I 'OK S ORY(1)="-1^[ERROR] no score returned",ERROR=1 Q
    3123 ;
     
    3628 .S SCORE=0
    3729 ;
    38  S DFN=$G(ORES("DFN"))
    3930 S INSERT("SCORE")=SCORE
    4031 ;
     
    4940 .F CNT=2,3,4 S INSERT("SUM"_CNT)=SUM(CNT)
    5041 ;
    51 TEXT ;
    52  I RESULT["~" S RESULT=$P(RESULT,"~")
    5342 ;Load dialog results into ORY array
    5443 N DATA,DCON,DITEM,DSEQ,DSUB,DTYP,INS,SEP,TEXT
     
    8372 Q
    8473 ;
    85 MHDLL(ORES,RESULT,SCORE,DFN) ;
    86  S INSERT("SCORE")=SCORE
    87  D TEXT
    88  Q
    8974OUT(DATA) ;Display element details
    9075 N DITEM S DITEM=$P(DATA,U,2) Q:'DITEM
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDLR1.m

    r628 r636  
    1 PXRMDLR1 ; SLC/AGP - DIALOG ORPHAN REPORT. ; 11/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMDLR1 ; SLC/AGP - DIALOG ORPHAN REPORT. ; 02/04/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;=======================================================================
     
    4242 . W !,"  "_$G(NAME) S PCNT=PCNT+1 I (PCNT+1)'<IOSL D PAGE(.PCNT,.PAGE) I $G(DONE)=1 Q
    4343 I FOUND=0 W !,"No empty dialog found"
    44  I ($E(IOST,1,2)="C-")&(IO=IO(0)) D
     44 I ($E(IOST)="C")&(IO=IO(0)) D
    4545 . W !
    4646 . S DIR(0)="E" D ^DIR K DIR
     
    6666 . .I (PCNT+1)'<IOSL D PAGE(.PCNT,.PAGE) I $G(DONE)=1 Q
    6767 K ^TMP("PXRMDLR1",$J)
    68  I ($E(IOST,1,2)="C-")&(IO=IO(0)) D
     68 I ($E(IOST)="C")&(IO=IO(0)) D
    6969 . W !
    7070 . S DIR(0)="E" D ^DIR K DIR
     
    7979PAGE(PCNT,PAGE) ;
    8080 N DUOUT,DTOUT,DIROUT,DIR
    81  I ($E(IOST,1,2)="C-")&(IO=IO(0)) D
     81 I ($E(IOST)="C")&(IO=IO(0)) D
    8282 .S DIR(0)="E"
    8383 .W !
     
    8686 W:$D(IOF) @IOF
    8787 S PAGE=PAGE+1,PCNT=0
    88  I ($E(IOST,1,2)="C-")&(IO=IO(0)) W @IOF D HEADER(.PCNT,PAGE,TITLE)
     88 I $E(IOST)="C",IO=IO(0) W @IOF D HEADER(.PCNT,PAGE,TITLE)
    8989 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDNVA.m

    r628 r636  
    1 PXRMDNVA ; SLC/PKR - Handle non-VA med findings. ;03/14/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMDNVA ; SLC/PKR - Handle non-VA med findings. ;05/24/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;===============================================
     
    1818 ;====================================================
    1919MHVOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the MHV output.
    20  N DATE,JND,NOUT,TEMP,TEXTOUT
     20 N JND,NOUT,TEMP,TEXTOUT
    2121 S TEMP="Non-VA med: "_IFIEVAL("ORDERABLE ITEM")_" = "
    2222 S TEMP=TEMP_"("_$$EDATE^PXRMDATE(IFIEVAL("START DATE"))
    23  S DATE=IFIEVAL("DISCONTINUED DATE")
    24  S DATE=$S(DATE="":"NONE",1:$$EDATE^PXRMDATE(DATE))
     23 S TEMP=TEMP_" - "_$$EDATE^PXRMDATE(IFIEVAL("STOP DATE"))_")"
    2524 D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
    2625 F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDRGR.m

    r628 r636  
    1 PXRMDRGR ; SLC/PKR - Handle groups of drug findings. ;06/20/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMDRGR ; SLC/PKR - Handle groups of drug findings. ;06/12/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;Groups are drug classes or VA Generic.
    44 ;==================================================
     
    100100 .. S IND=0
    101101 .. F  S IND=+$O(FIEVT(IND)) Q:IND=0  D
    102  ...;Make sure this is not already on the list
    103  ... I $$ONLIST(.FIEVTL,IND,.FIEVT) Q
    104102 ... S NFOUND=NFOUND+1,FIEVTL(NFOUND,"DISPENSE DRUG")=DRUGIEN
    105103 ... M FIEVTL(NFOUND)=FIEVT(IND)
     
    185183 Q
    186184 ;
    187  ;==================================================
    188 ONLIST(FIEVTL,IND,FIEVT) ;Return true if FIEVT(IND) is already on
    189  ;FIEVTL.
    190  N JND,ONLIST
    191  S (JND,ONLIST)=0
    192  F  S JND=$O(FIEVTL(JND)) Q:(ONLIST)!(JND="")  D
    193  . I FIEVTL(JND,"FILE NUMBER")'=FIEVT(IND,"FILE NUMBER") Q
    194  . I FIEVTL(JND,"DAS")'=FIEVT(IND,"DAS") Q
    195  . S ONLIST=1
    196  Q ONLIST
    197  ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDRUG.m

    r628 r636  
    1 PXRMDRUG ; SLC/PKR - Handle drug findings. ;04/23/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMDRUG ; SLC/PKR - Handle drug findings. ;06/08/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;===============================================
     
    114114 ;===============================================
    115115EVALTERM(DFN,FINDPA,ENODE,TERMARR,TFIEVAL) ;Evaluate drug terms.
    116  N DATEORDR,DRUGIEN,DTERM,DTFIEVAL,IND,JND,NOINDEX,PFINDPA,POI
     116 N DATEORDR,DRUGIEN,DTERM,DTFIEVAL,IND,NOINDEX,PFINDPA,POI
    117117 N RXTYL,TEMP,TFINDING,TFINDPA
    118118 N DATEORDR,NOCC,SDIR
     
    159159 .. D DORDER^PXRMTERM(.DTFIEVAL,.DATEORDR)
    160160 .. D COPY^PXRMTERM(NOCC,SDIR,.DTFIEVAL,.DATEORDR,TFINDING,.TFIEVAL)
    161  ..;Save the dispense drug
    162  .. S JND=0
    163  .. F  S JND=+$O(TFIEVAL(TFINDING,JND)) Q:JND=0  S TFIEVAL(TFINDING,JND,"DISPENSE DRUG")=DRUGIEN
     161 .. I TFIEVAL(TFINDING) S TFIEVAL(TFINDING,"DISPENSE DRUG")=DRUGIEN
    164162 Q
    165163 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEDIT.m

    r628 r636  
    1 PXRMEDIT ; SLC/PKR - Clinical Reminder edit driver. ;06/04/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEDIT ; SLC/PKR - Clinical Reminder edit driver. ;05/18/2000
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44EDIT(ROOT,IENN) ;Call the appropriate edit routine.
    5  ;Reminder location list
    6  I ROOT="^PXRMD(810.9," D EDIT^PXRMLLED(ROOT,IENN) Q
    7  ;
    85 ;Taxonomy
    96 I ROOT="^PXD(811.2," D EDIT^PXRMTEDT(ROOT,IENN) Q
     
    129 I ROOT="^PXRMD(811.5," D EDIT^PXRMTMED(ROOT,IENN) Q
    1310 ;
    14  ;Reminder definition
     11 ;Reminder
    1512 I ROOT="^PXD(811.9," D
    1613 .;Build list of finding types for finding edit
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMENOD.m

    r628 r636  
    1 PXRMENOD ; SLC/PKR - Clinical Reminders "E" node routines. ;12/13/2006
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMENOD ; SLC/PKR - Clinical Reminders "E" node routines. ;04/17/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;========================================================
     
    3030 ;Do not execute as part of a verify fields.
    3131 I $G(DIUTIL)="VERIFY FIELDS" Q
    32  N DAS,GLOBAL,IEN,NAME
     32 N DAS,GLOBAL,IEN
    3333 S IEN=$P(X,";",1)
    3434 S GLOBAL=$P(X,";",2)
     
    4444 S DAS=IEN
    4545 I DAS="" Q
    46  S NAME=""
    47  I FILENUM=811.5 S ^PXRMD(811.5,DA(1),20,"E",GLOBAL,DAS,DA)=NAME
    48  I FILENUM=811.9 S ^PXD(811.9,DA(1),20,"E",GLOBAL,DAS,DA)=NAME
     46 I FILENUM=811.5 S ^PXRMD(811.5,DA(1),20,"E",GLOBAL,DAS,DA)=""
     47 I FILENUM=811.9 S ^PXD(811.9,DA(1),20,"E",GLOBAL,DAS,DA)=""
    4948 Q
    5049 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEPM.m

    r628 r636  
    1 PXRMEPM ; SLC/PKR/PJH - Extract Definition Management ;07/17/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMEPM ; SLC/PKR/PJH - Extract Definition Management ;06/21/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;Main entry point for PXRM EXTRACT DEFINITIONS
     
    1313 K ^TMP("PXRMEPM",$J)
    1414 N IEN,IND,PLIST
    15  D LIST^PXRMETM("PXRMEPM",.VALMCNT)
     15 D LIST^PXRMETM(.PLIST,.IEN)
     16 M ^TMP("PXRMEPM",$J)=PLIST
     17 S VALMCNT=PLIST("VALMCNT")
     18 F IND=1:1:VALMCNT D
     19 .S ^TMP("PXRMEPM",$J,"IDX",IND,IND)=IEN(IND)
    1620 Q
    1721 ;
     
    6165 .W $C(7),!,"Only one item number allowed." H 2
    6266 .S VALMBCK="R"
    63  I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("SEL",SEL))) D  Q
     67 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("IDX",SEL))) D  Q
    6468 .W $C(7),!,SEL_" is not a valid item number." H 2
    6569 .S VALMBCK="R"
    6670 ;
    6771 ;Get the list ien.
    68  S IEN=^TMP("PXRMEPM",$J,"SEL",SEL)
     72 S IEN=^TMP("PXRMEPM",$J,"IDX",SEL,SEL)
    6973 ;Display/Edit Extract Definition
    7074 D START^PXRMEPED(IEN)
     
    8286 ;
    8387EPADD ;Add Rule Option
     88 ;
    8489 ;Reset Screen Mode
    8590 W IORESET
     
    9095 ;Rebuild Workfile
    9196 D BLDLIST
     97 ;
    9298 S VALMBCK="R"
    9399 Q
     
    103109 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
    104110 .;Get the ien.
    105  .S LRIEN=^TMP("PXRMEPM",$J,"SEL",IND)
     111 .S LRIEN=^TMP("PXRMEPM",$J,"IDX",IND,IND)
    106112 .D START^PXRMEPED(LRIEN)
    107113 D BLDLIST
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMETCO.m

    r628 r636  
    1 PXRMETCO ; SLC/PJH - QUERI Extract Compliance Report ;03/27/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMETCO ; SLC/PJH - QUERI Extract Compliance Report ;01/19/2005
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;
     
    3333 S LIST=NAME_" REPORT "_DATES
    3434 ;Process (single) Denominator rule into patient list
    35  N INDP,INTP,SEQ,SUB,SUFFIX
     35 N SEQ,SUB,SUFFIX
    3636 S SEQ=""
    3737 F  S SEQ=$O(^PXRM(810.2,IEN,10,"B",SEQ)) Q:'SEQ  D
     
    4141 .S SUFFIX=$P(DATA,U,3)
    4242 .I SUFFIX="" S SUFFIX="DENOMINATOR "_SEQ
    43  .S INDP=+$P(DATA,U,4)
    44  .S INTP=+$P(DATA,U,5)
    4543 .;Create new patient list
    46  .S PXRMLIST=$$CRLST^PXRMRUL1(LIST_" "_SUFFIX) Q:'PXRMLIST
    47  .D START^PXRMRULE(PXRMRULE,PXRMLIST,PXRMNODE,PXRMSTRT,PXRMSTOP,IEN,INDP,INTP)
     44 .S PXRMLIST=$$CRLST^PXRMRULE(LIST_" "_SUFFIX) Q:'PXRMLIST
     45 .D START^PXRMRULE(PXRMRULE,PXRMLIST,PXRMNODE,PXRMSTRT,PXRMSTOP,IEN,"","")
    4846 .;Clear ^TMP lists created for rule
    4947 .D CLEAR^PXRMRULE(PXRMRULE,PXRMNODE)
     
    120118 W !,"Queue the Clinical Reminders MST synchronization."
    121119 S DIR("A",1)="Enter the date and time you want the job to start."
    122  S DIR("A",2)="It must be after "_$$FMTE^XLFDT(MINDT,"5Z")
    123  S DIR("A")="Start the task at: "
     120 S DIR("A")="It must be after "_$$FMTE^XLFDT(MINDT,"5Z")_" "
    124121 S DIR(0)="DAU"_U_MINDT_"::RSX"
    125122 D ^DIR
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMETH.m

    r628 r636  
    1 PXRMETH ; SLC/PJH - Reminder Extract History ;10/11/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMETH ; SLC/PJH - Reminder Extract History ;08/15/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;Main entry point for PXRM EXTRACT HISTORY
    5 START(EDIEN) ;
    6  ;EDIEN is the extract definition IEN.
     5START(IEN) ;
    76 N VALMBCK,VALMCNT,VALMSG,X,XMZ,XQORM,XQORNOD
    87 ;Details of last run
    98 N DATA,NPERIOD,NSDATE,NTAS,PXRMVIEW
    10  S DATA=$G(^PXRM(810.2,EDIEN,0))
     9 S DATA=$G(^PXRM(810.2,IEN,0))
    1110 S NPERIOD=$P(DATA,U,6),NSDATE=$P(DATA,U,7)
    1211 ;Default view is in date created order
     
    1817 Q
    1918 ;
    20 DELETE ;Delete an extract, called by protocol PXRM EXTRACT SUMMARY DELETE.
    21  N CLASS,IEN,IENLIST,IND
    22  S IENLIST=$$LMSEL
    23  F IND=1:1:$L(IENLIST,U) D
    24  .S IEN=$P(IENLIST,U,IND)
    25  .D DELETE^PXRMETXU(IEN)
    26  ;Rebuild workfile
    27  D BLDLIST^PXRMETH1(EDIEN)
    28  ;Refresh
    29  S VALMBCK="R"
    30  Q
    31  ;
    3219ENTRY ;Entry code
    33  D BLDLIST^PXRMETH1(EDIEN),XQORM
     20 D BLDLIST^PXRMETH1(IEN),XQORM
    3421 Q
    3522 ;
     
    4229 Q
    4330 ;
    44 EXTRACT(EDIEN) ;Run Extract/Transmission
     31HDR ; Header code
     32 N VIEW
     33 S VIEW=$S(PXRMVIEW="D":"Creation Date Order",1:"Extract Period Order")
     34 S VALMHDR(2)="          Extract Name: "_$P($G(^PXRM(810.2,IEN,0)),U)
     35 S VALMHDR(3)="   Next Extract Period: "_NPERIOD
     36 S VALMHDR(4)="      Scheduled to Run: "_NSDATE
     37 S VALMHDR(4)=$$LJ^XLFSTR(VALMHDR(4),45)_"    View: "_VIEW
     38 S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
     39 Q
     40 ;
     41HLP ;Help code
     42 N ORU,ORUPRMT,SUB,XQORM
     43 S SUB="PXRMETHH"
     44 D EN^VALM("PXRM EXTRACT HELP")
     45 Q
     46 ;
     47INIT ;Init
     48 S VALMCNT=0
     49 Q
     50 ;
     51PEXIT ;PXRM EXCH MENU protocol exit code
     52 S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
     53 D XQORM
     54 Q
     55 ;
     56XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXTRACT HISTORY SELECT ENTRY",0))_U_"1:"_VALMCNT
     57 S XQORM("A")="Select Item: "
     58 Q
     59 ;
     60XSEL ;PXRM EXTRACT HISTORY SELECT ENTRY validation
     61 N SEL,PXRMSIEN
     62 S SEL=$P(XQORNOD(0),"=",2)
     63 ;Remove trailing ,
     64 I $E(SEL,$L(SEL))="," S SEL=$E(SEL,1,$L(SEL)-1)
     65 ;Invalid selection
     66 I SEL["," D  Q
     67 .W $C(7),!,"Only one item number allowed." H 2
     68 .S VALMBCK="R"
     69 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("IDX",SEL))) D  Q
     70 .W $C(7),!,SEL_" is not a valid item number." H 2
     71 .S VALMBCK="R"
     72 ;
     73 ;Get the list ien.
     74 S PXRMSIEN=^TMP("PXRMETH",$J,"IDX",SEL,SEL)
     75 ;
     76 ;Full screen mode
     77 D FULL^VALM1
     78 ;
     79 ;Options
     80 N X,Y,DIR,OPTION K DIROUT,DIRUT,DTOUT,DUOUT
     81 S DIR(0)="SBM"_U_"ES:Extract Summary;"
     82 S DIR(0)=DIR(0)_"MT:Manual Transmission;"
     83 S DIR(0)=DIR(0)_"TH:Transmission History;"
     84 S DIR("A")="Select Action"
     85 S DIR("B")="ES"
     86 S DIR("?")="Select from the codes displayed. For detailed help type ??"
     87 S DIR("??")=U_"D HELP^PXRMETH1(1)"
     88 D ^DIR K DIR
     89 I $D(DIROUT) S DTOUT=1
     90 I $D(DTOUT)!($D(DUOUT)) S VALMBCK="R" Q
     91 S OPTION=Y
     92 ;
     93 ;Display Extract Summary
     94 I OPTION="ES" D
     95 .D START^PXRMETT(PXRMSIEN)
     96 ;
     97 ;Transmission option
     98 I OPTION="MT" D
     99 .N ANS,DUOUT,DTOUT,RTN,TEXT
     100 .I $P($G(^PXRMXT(810.3,PXRMSIEN,100)),U)'="N" D  Q
     101 ..W !,"Local extracts cannot be transmitted to AAC" H 2 Q
     102 .S TEXT="Transmit this extract to AAC",ANS="",RTN="PXRMETH"
     103 .S ANS=$$ASKYN^PXRMEUT("N",TEXT,RTN,3) Q:$D(DUOUT)!$D(DTOUT)
     104 .I ANS D TRANS^PXRMETX(PXRMSIEN)
     105 ;
     106 ;Transmission History
     107 I OPTION="TH" D
     108 .D START^PXRMETHL(PXRMSIEN)
     109 ;
     110 S VALMBCK="R"
     111 Q
     112 ;
     113EXTRACT(IEN) ;Run Extract/Transmission
     114 ;
    45115 ;Reset screen mode
    46116 W IORESET
     
    51121 N ANS,DATA,DUOUT,DTOUT,EDATE,EXSUMPUG,FREQ,MODE
    52122 N NAME,NAT,NEXT,PLISTPUG,RTN,REPL,STATUS,SNEXT,TEXT,XMIT
    53  S DATA=$G(^PXRM(810.2,EDIEN,0))
    54  S NAT=$P($G(^PXRM(810.2,EDIEN,100)),U)
     123 S DATA=$G(^PXRM(810.2,IEN,0))
     124 S NAT=$P($G(^PXRM(810.2,IEN,100)),U)
    55125 ;Determine Extract Name and Frequency
    56126 S NAME=$P(DATA,U),FREQ=$P(DATA,U,3),NEXT=$P(DATA,U,6),RTN="PXRMETX"
     
    93163 N ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
    94164 S ZTDESC="Reminder Extract "_NAME
    95  S ZTRTN="RUN^PXRMETX(EDIEN,NEXT,MODE,EXSUMPUG)"
    96  S ZTSAVE("EDIEN")=""
     165 S ZTRTN="RUN^PXRMETX(IEN,NEXT,MODE,EXSUMPUG)"
     166 S ZTSAVE("IEN")=""
    97167 S ZTSAVE("MODE")=""
    98168 S ZTSAVE("NEXT")=""
     
    117187 D ^%ZTLOAD
    118188 W !,"Task number ",ZTSK," queued." H 2
     189 ;
    119190 S VALMBCK="Q"
    120191 Q
    121192 ;
    122 HDR ; Header code
    123  N VIEW
    124  S VIEW=$S(PXRMVIEW="D":"Creation Date Order",1:"Extract Period Order")
    125  S VALMHDR(2)="          Extract Name: "_$P($G(^PXRM(810.2,EDIEN,0)),U)
    126  S VALMHDR(3)="   Next Extract Period: "_NPERIOD
    127  S VALMHDR(4)="      Scheduled to Run: "_$$FMTE^XLFDT(NSDATE,"5Z")
    128  S VALMHDR(4)=$$LJ^XLFSTR(VALMHDR(4),45)_"    View: "_VIEW
    129  S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
    130  Q
    131  ;
    132 HLP ;Help code
    133  N ORU,ORUPRMT,SUB,XQORM
    134  S SUB="PXRMETHH"
    135  D EN^VALM("PXRM EXTRACT HELP")
    136  Q
    137  ;
    138 INIT ;Init
    139  S VALMCNT=0
    140  Q
    141  ;
    142 LMSEL() ;Return selection list
    143  N IENLIST,IND,VALMY,XIEN
    144  D EN^VALM2(XQORNOD(0))
    145  ;If there is no list quit.
    146  I '$D(VALMY) Q ""
    147  S PXRMDONE=0,IENLIST=""
    148  S IND=""
    149  F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
    150  .;Get the ien.
    151  .S XIEN=^TMP("PXRMETH",$J,"SEL",IND)
    152  .S IENLIST=$S(IENLIST'="":IENLIST_U_XIEN,1:XIEN)
    153  Q IENLIST
    154  ;
    155 PEXIT ;PXRM EXCH MENU protocol exit code
    156  S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
    157  D XQORM
    158  Q
    159  ;
    160193SELECT(FREQ,SEL) ;Select extract period
     194 ;
    161195 N BDATE,EDATE,DA,DIE,DIK,DIR,DR,FDATE,VALID,X
    162196 ;Get the new name.
     
    184218 Q
    185219 ;
    186 TLIST ;Extract summary display
    187  N IEN,IENLIST,IND
    188  S IENLIST=$$LMSEL
    189  F IND=1:1:$L(IENLIST,U) D
    190  .S IEN=$P(IENLIST,U,IND)
    191  .D START^PXRMETT(IEN)
    192  .S VALMBCK="R"
     220TLIST ;Extract Totals
     221 N IND,PXRMSIEN,VALMY
     222 D EN^VALM2(XQORNOD(0))
     223 ;If there is no list quit.
     224 I '$D(VALMY) Q
     225 ;PXRMDONE is newed in PXRMLPM
     226 S PXRMDONE=0
     227 S IND=""
     228 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
     229 .;Get the ien.
     230 .S PXRMSIEN=^TMP("PXRMETH",$J,"IDX",IND,IND)
     231 .D START^PXRMETT(PXRMSIEN)
     232 ;
    193233 S VALMBCK="R"
    194234 Q
    195235 ;
    196236TRANS ;Run Transmission
    197  N IEN,IENLIST,IND
    198  S IENLIST=$$LMSEL
    199  F IND=1:1:$L(IENLIST,U) D
    200  .S IEN=$P(IENLIST,U,IND)
    201  .I $P($G(^PXRMXT(810.3,IEN,100)),U)'="N" D  Q
    202  ..W !,"Local extracts cannot be transmitted to AAC." H 2
     237 N IND,PXRMXIEN,VALMY
     238 D EN^VALM2(XQORNOD(0))
     239 ;If there is no list quit.
     240 I '$D(VALMY) Q
     241 S PXRMDONE=0
     242 S IND=""
     243 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
     244 .;Get the ien.
     245 .S PXRMXIEN=^TMP("PXRMETH",$J,"IDX",IND,IND)
     246 .I $P($G(^PXRMXT(810.3,PXRMXIEN,100)),U)'="N" D  Q
     247 ..W !,"Local extracts cannot be transmitted to AAC." H 1
    203248 .;Transmit extract summary
    204249 .N ANS,DUOUT,DTOUT,RTN,TEXT
    205250 .S TEXT="Transmit this extract to AAC",ANS="",RTN="PXRMETH"
    206251 .S ANS=$$ASKYN^PXRMEUT("N",TEXT,RTN,3) Q:$D(DUOUT)!$D(DTOUT)
    207  .I ANS D TRANS^PXRMETX(IEN)
     252 .I ANS D TRANS^PXRMETX(PXRMXIEN)
    208253 ;
    209254 ;Rebuild workfile
    210  D BLDLIST^PXRMETH1(EDIEN)
     255 D BLDLIST^PXRMETH1(IEN)
    211256 ;Refresh
    212257 S VALMBCK="R"
     
    214259 ;
    215260TRHIST ;Transmission History
    216  N IEN,IENLIST,IND
    217  S IENLIST=$$LMSEL
    218  F IND=1:1:$L(IENLIST,U) D
    219  .S IEN=$P(IENLIST,U,IND)
    220  .D START^PXRMETHL(IEN)
     261 N IND,PXRMSIEN,VALMY
     262 D EN^VALM2(XQORNOD(0))
     263 ;If there is no list quit.
     264 I '$D(VALMY) Q
     265 ;PXRMDONE is newed in PXRMLPM
     266 S PXRMDONE=0
     267 S IND=""
     268 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
     269 .;Get the ien.
     270 .S PXRMSIEN=^TMP("PXRMETH",$J,"IDX",IND,IND)
     271 .D START^PXRMETHL(PXRMSIEN)
     272 ;
    221273 S VALMBCK="R"
    222274 Q
     
    241293 ;
    242294VIEW ;Select view
     295 ;
    243296 W IORESET
    244  S VALMBCK="R"
     297 ;
     298 S VALMBCK="R"
     299 ;
    245300 N X,Y,CODE,DIR
    246301 K DIROUT,DIRUT,DTOUT,DUOUT
     
    259314 ;
    260315 ;Rebuild Workfile
    261  D BLDLIST^PXRMETH1(EDIEN),HDR
     316 D BLDLIST^PXRMETH1(IEN),HDR
    262317 Q
    263318 ;
     
    273328 W !!,"WARNING -This period is not complete until "_FDATE
    274329 Q
    275 XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXTRACT HISTORY SELECT ENTRY",0))_U_"1:"_VALMCNT
    276  S XQORM("A")="Select Item: "
    277  Q
    278  ;
    279 XSEL ;PXRM EXTRACT HISTORY SELECT ENTRY validation
    280  N SEL,PXRMSIEN
    281  S SEL=$P(XQORNOD(0),"=",2)
    282  ;Remove trailing ,
    283  I $E(SEL,$L(SEL))="," S SEL=$E(SEL,1,$L(SEL)-1)
    284  ;Invalid selection
    285  I SEL["," D  Q
    286  .W $C(7),!,"Only one item number allowed." H 2
    287  .S VALMBCK="R"
    288  I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("SEL",SEL))) D  Q
    289  .W $C(7),!,SEL_" is not a valid item number." H 2
    290  .S VALMBCK="R"
    291  ;
    292  ;Get the list ien.
    293  ;S PXRMSIEN=^TMP("PXRMETH",$J,"IDX",SEL,SEL)
    294  S PXRMSIEN=^TMP("PXRMETH",$J,"SEL",SEL)
    295  ;
    296  ;Full screen mode
    297  D FULL^VALM1
    298  ;
    299  ;Options
    300  N X,Y,DIR,OPTION K DIROUT,DIRUT,DTOUT,DUOUT
    301  S DIR(0)="SBM"_U_"DE:Delete Extract;"
    302  S DIR(0)=DIR(0)_"ES:Extract Summary;"
    303  S DIR(0)=DIR(0)_"MT:Manual Transmission;"
    304  S DIR(0)=DIR(0)_"TH:Transmission History;"
    305  S DIR("A")="Select Action"
    306  S DIR("B")="ES"
    307  S DIR("?")="Select from the codes displayed. For detailed help type ??"
    308  S DIR("??")=U_"D HELP^PXRMETH1(1)"
    309  D ^DIR K DIR
    310  I $D(DIROUT) S DTOUT=1
    311  I $D(DTOUT)!($D(DUOUT)) S VALMBCK="R" Q
    312  S OPTION=Y
    313  ;
    314  ;Delete an extract
    315  I OPTION="DE" D
    316  .D DELETE^PXRMETXU(PXRMSIEN)
    317  .;Rebuild workfile
    318  .D BLDLIST^PXRMETH1(PXRMSIEN)
    319  .;Refresh
    320  .S VALMBCK="R"
    321  ;
    322  ;Display Extract Summary
    323  I OPTION="ES" D START^PXRMETT(PXRMSIEN)
    324  ;
    325  ;Transmission option
    326  I OPTION="MT" D
    327  .N ANS,DUOUT,DTOUT,RTN,TEXT
    328  .I $P($G(^PXRMXT(810.3,PXRMSIEN,100)),U)'="N" D  Q
    329  ..W !,"Local extracts cannot be transmitted to AAC" H 2 Q
    330  .S TEXT="Transmit this extract to AAC",ANS="",RTN="PXRMETH"
    331  .S ANS=$$ASKYN^PXRMEUT("N",TEXT,RTN,3) Q:$D(DUOUT)!$D(DTOUT)
    332  .I ANS D TRANS^PXRMETX(PXRMSIEN)
    333  ;
    334  ;Transmission History
    335  I OPTION="TH" D START^PXRMETHL(PXRMSIEN)
    336  ;
    337  S VALMBCK="R"
    338  Q
    339  ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMETH1.m

    r628 r636  
    1 PXRMETH1 ; SLC/PJH - Reminder Extract History ;09/07/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMETH1 ; SLC/PJH - Reminder Extract History ;07/24/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    4 BLDLIST(EDIEN) ;Build workfile
    5  ;EDIEN is the extract definition IEN.
    6  N IND,FMTSTR,PLIST
     4BLDLIST(IEN) ;Build workfile
     5 N IND,PLIST
    76 K ^TMP("PXRMETH",$J)
    8  S FMTSTR=$$LMFMTSTR^PXRMTEXT(.VALMDDF,"RLL")
    97 ;Build list of extract summaries in period order
    10  I PXRMVIEW="P" D LIST1(EDIEN,"PXRMETH",FMTSTR)
     8 I PXRMVIEW="P" D LIST1(.PLIST,.IEN)
    119 ;Build list of extract summaries in date order
    12  I PXRMVIEW="D" D LIST2(EDIEN,"PXRMETH",FMTSTR)
    13  Q
    14  ;
    15 FMT(NUMBER,NAME,EDATE,XDATE,AUTO,FMTSTR,NL,OUTPUT) ;Format
    16  N TAUTO,TDATE,TEMP,TNAME,TSOURCE
    17  S TEMP=NUMBER_U_NAME_U
    18  S TDATE=$$FMTE^XLFDT(EDATE,"5Z")
    19  S TEMP=TEMP_$$LJ^XLFSTR(TDATE,20," ")
    20  S TDATE=XDATE I TDATE S TDATE=$$FMTE^XLFDT(TDATE,"5Z")
    21  S TEMP=TEMP_" "_$$LJ^XLFSTR(TDATE,22," ")
    22  S TAUTO=AUTO
    23  S TEMP=TEMP_TAUTO
    24  D COLFMT^PXRMTEXT(FMTSTR,TEMP," ",.NL,.OUTPUT)
     10 I PXRMVIEW="D" D LIST2(.PLIST,.IEN)
     11 ;Move into list array
     12 M ^TMP("PXRMETH",$J)=PLIST
     13 S VALMCNT=PLIST("VALMCNT")
     14 ;Allow selection by item
     15 F IND=1:1:VALMCNT D
     16 .S ^TMP("PXRMETH",$J,"IDX",IND,IND)=IEN(IND)
    2517 Q
    2618 ;
     
    2820 N HTEXT
    2921 I CALL=1 D
    30  .S HTEXT(1)="Select DE to delete an extract.\\"
    31  .S HTEXT(2)="Select ES to view the details of an extract or run a compliance"
    32  .S HTEXT(3)="report for the extract.\\Select MT to transmit extract details to the AAC.\\"
    33  .S HTEXT(4)="Select TH to view the transmission history for an extract."
     22 .S HTEXT(1)="Select ES to view the details of an extract or run a compliance"
     23 .S HTEXT(2)="report for the extract. Select MT to transmit extract details to the AAC."
     24 .S HTEXT(3)="Select TH to view the transmission history for an extract."
    3425 ;
    3526 I CALL=3 D
     
    4132 Q
    4233 ;
    43 LIST1(EDIEN,NODE,FMTSTR) ;Build a list of extract summaries for a parameter.
    44  N AUTO,EDATE,HL7ID,HL7SUB,IND,JND,NAME,NL,NUM,OUTPUT
    45  N PERIOD,STR,XDATE,YEAR
     34LIST1(LIST,IEN) ;Build a list of extract summaries for a parameter.
     35 N AUTO,EDATE,HL7ID,HL7SUB,IND,NAME,PERIOD,XDATE,YEAR
    4636 ;Build list of extract summaries in reverse date order.
    47  S YEAR="9999",(NUM,VALMCNT)=0
    48  F  S YEAR=$O(^PXRMXT(810.3,"D",EDIEN,YEAR),-1) Q:YEAR=""  D
     37 S YEAR="9999",VALMCNT=0
     38 F  S YEAR=$O(^PXRMXT(810.3,"D",IEN,YEAR),-1) Q:YEAR=""  D
    4939 .S PERIOD="99"
    50  .F  S PERIOD=$O(^PXRMXT(810.3,"D",EDIEN,YEAR,PERIOD),-1) Q:PERIOD=""  D
     40 .F  S PERIOD=$O(^PXRMXT(810.3,"D",IEN,YEAR,PERIOD),-1) Q:PERIOD=""  D
    5141 ..S IND=""
    52  ..F  S IND=$O(^PXRMXT(810.3,"D",EDIEN,YEAR,PERIOD,IND),-1) Q:IND=""  D
     42 ..F  S IND=$O(^PXRMXT(810.3,"D",IEN,YEAR,PERIOD,IND),-1) Q:IND=""  D
    5343 ...S NAME=$P($G(^PXRMXT(810.3,IND,0)),U)
    5444 ...S EDATE=$P($G(^PXRMXT(810.3,IND,0)),U,6)
     
    5949 ...I HL7SUB S XDATE=$P($G(^PXRMXT(810.3,IND,5,HL7SUB,0)),U,2)
    6050 ...I 'XDATE S XDATE="Not Transmitted"
    61  ...S NUM=NUM+1
    62  ...D FMT(NUM,NAME,EDATE,XDATE,AUTO,FMTSTR,.NL,.OUTPUT)
    63  ...F JND=1:1:NL D
    64  ....S VALMCNT=VALMCNT+1,^TMP(NODE,$J,VALMCNT,0)=OUTPUT(JND)
    65  ....S ^TMP(NODE,$J,"IDX",VALMCNT,NUM)=""
    66  ....S ^TMP(NODE,$J,"SEL",NUM)=IND
     51 ...S VALMCNT=VALMCNT+1
     52 ...S LIST(VALMCNT,0)=$$FRE(VALMCNT,NAME,EDATE,XDATE,AUTO)
     53 ...S IEN(VALMCNT)=IND
     54 S LIST("VALMCNT")=VALMCNT
    6755 Q
    6856 ;
    69 LIST2(EDIEN,NODE,FMTSTR) ;Build a list of extract summaries for a parameter.
    70  N AUTO,EDATE,HL7ID,HL7SUB,IND,JND,NAME,NL,NUM,OUTPUT
    71  N PERIOD,STR,XDATE,YEAR
     57LIST2(LIST,IEN) ;Build a list of extract summaries for a parameter.
     58 N AUTO,EDATE,HL7ID,HL7SUB,IND,NAME,PERIOD,XDATE,YEAR
    7259 ;Build list of extract summaries in reverse date order.
    73  S EDATE="",(NUM,VALMCNT)=0
    74  F  S EDATE=$O(^PXRMXT(810.3,"C",EDIEN,EDATE),-1) Q:'EDATE  D
     60 S EDATE="",VALMCNT=0
     61 F  S EDATE=$O(^PXRMXT(810.3,"C",IEN,EDATE),-1) Q:'EDATE  D
    7562 .S IND=""
    76  .F  S IND=$O(^PXRMXT(810.3,"C",EDIEN,EDATE,IND)) Q:'IND  D
    77  ..S NAME=$P($G(^PXRMXT(810.3,IND,0)),U,1)
     63 .F  S IND=$O(^PXRMXT(810.3,"C",IEN,EDATE,IND)) Q:'IND  D
     64 ..S NAME=$P($G(^PXRMXT(810.3,IND,0)),U)
    7865 ..S AUTO=$P($G(^PXRMXT(810.3,IND,4)),U,5)
    7966 ..S AUTO=$S(AUTO="A":"Y",1:"N")
     
    8269 ..I HL7SUB S XDATE=$P($G(^PXRMXT(810.3,IND,5,HL7SUB,0)),U,2)
    8370 ..I 'XDATE S XDATE="Not Transmitted"
    84  ..S NUM=NUM+1
    85  ..D FMT(NUM,NAME,EDATE,XDATE,AUTO,FMTSTR,.NL,.OUTPUT)
    86  ..F JND=1:1:NL D
    87  ...S VALMCNT=VALMCNT+1,^TMP(NODE,$J,VALMCNT,0)=OUTPUT(JND)
    88  ...S ^TMP(NODE,$J,"IDX",VALMCNT,NUM)=""
    89  ...S ^TMP(NODE,$J,"SEL",NUM)=IND
     71 ..S VALMCNT=VALMCNT+1
     72 ..S LIST(VALMCNT,0)=$$FRE(VALMCNT,NAME,EDATE,XDATE,AUTO)
     73 ..S IEN(VALMCNT)=IND
     74 S LIST("VALMCNT")=VALMCNT
    9075 Q
    9176 ;
     77FRE(NUMBER,NAME,EDATE,XDATE,AUTO) ;Format
     78 N TAUTO,TDATE,TEMP,TNAME,TSOURCE
     79 S TEMP=$$RJ^XLFSTR(NUMBER,5," ")
     80 S TNAME=$E(NAME,1,27)
     81 S TEMP=TEMP_" "_$$LJ^XLFSTR(TNAME,27," ")
     82 S TDATE=$$FMTE^XLFDT(EDATE,"5Z")
     83 S TEMP=TEMP_" "_$$LJ^XLFSTR(TDATE,20," ")
     84 S TDATE=XDATE I TDATE S TDATE=$$FMTE^XLFDT(TDATE,"5Z")
     85 S TEMP=TEMP_" "_$$LJ^XLFSTR(TDATE,22," ")
     86 S TAUTO=AUTO
     87 S TEMP=TEMP_TAUTO
     88 Q TEMP
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMETM.m

    r628 r636  
    1 PXRMETM ; SLC/PKR/PJH - Extract/Transmission Management ;09/06/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMETM ; SLC/PKR/PJH - Extract/Transmission Management ;05/15/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;Main entry point for PXRM EXTRACT MANAGEMENT
     
    1515 K ^TMP("PXRMETM",$J)
    1616 N IEN,IND,PLIST
    17  D LIST("PXRMETM",.VALMCNT)
     17 D LIST(.PLIST,.IEN)
     18 M ^TMP("PXRMETM",$J)=PLIST
     19 S VALMCNT=PLIST("VALMCNT")
     20 F IND=1:1:VALMCNT D
     21 .S ^TMP("PXRMETM",$J,"IDX",IND,IND)=IEN(IND)
    1822 Q
     23 ;
     24LIST(RLIST,IEN) ;Build a list of extract definition entries.
     25 N EPCLASS,IND,FNAME,NAME
     26 ;Build the list in alphabetical order.
     27 S VALMCNT=0
     28 S NAME=""
     29 F  S NAME=$O(^PXRM(810.2,"B",NAME)) Q:NAME=""  D
     30 .S IND=$O(^PXRM(810.2,"B",NAME,"")) Q:'IND
     31 .S FNAME=$P($G(^PXRM(810.2,IND,0)),U)
     32 .S EPCLASS=$P($G(^PXRM(810.2,IND,100)),U)
     33 .S VALMCNT=VALMCNT+1
     34 .S RLIST(VALMCNT,0)=$$FRE(VALMCNT,FNAME,EPCLASS)
     35 .S IEN(VALMCNT)=IND
     36 S RLIST("VALMCNT")=VALMCNT
     37 Q
     38 ;
     39FRE(NUMBER,NAME,CLASS) ;Format  entry number, name
     40 ;and date packed.
     41 N TCLASS,TEMP,TNAME,TSOURCE
     42 S TEMP=$$RJ^XLFSTR(NUMBER,5," ")
     43 S TNAME=$E(NAME,1,46)
     44 S TEMP=TEMP_"  "_$$LJ^XLFSTR(TNAME,60," ")
     45 S TCLASS=$S(CLASS="N":"NATIONAL",CLASS="V":"VISN",1:"LOCAL")
     46 S TEMP=TEMP_"  "_TCLASS
     47 Q TEMP
    1948 ;
    2049ENTRY ;Entry code
     
    3059 Q
    3160 ;
    32 FMT(NUMBER,NAME,CLASS) ;Format  entry number, name
    33  ;and date packed.
    34  N TCLASS,TEMP,TNAME,TSOURCE
    35  S TEMP=$$RJ^XLFSTR(NUMBER,5," ")
    36  S TNAME=$E(NAME,1,46)
    37  S TEMP=TEMP_"  "_$$LJ^XLFSTR(TNAME,60," ")
    38  S TCLASS=$S(CLASS="N":"NATIONAL",CLASS="V":"VISN",1:"LOCAL")
    39  S TEMP=TEMP_"  "_TCLASS
    40  Q TEMP
    41  ;
    42 GEN ;Ad hoc report option
    43  ;Reset Screen Mode
    44  W IORESET
    45  ;
    46  N IND,LISTIEN,VALMY
    47  D EN^VALM2(XQORNOD(0))
    48  ;If there is no list quit.
    49  I '$D(VALMY) Q
    50  S PXRMDONE=0
    51  S IND=""
    52  F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
    53  .;Get the ien.
    54  .S LISTIEN=^TMP("PXRMETM",$J,"SEL",IND)
    55  .D GENSEL(LISTIEN)
    56  ;
    57  S VALMBCK="R"
    58  Q
    59  ;
    60 GENSEL(IEN) ;Report for selected extract definition
    61  N ANS,BEGIN,END,RTN,TEXT
    62  D DATES^PXRMEUT(.BEGIN,.END,"Report")
    63  ;Options
    64  S RTN="PXRMETM",TEXT="Run compliance report for this period"
    65  S ANS=$$ASKYN^PXRMEUT("N",TEXT,RTN,1) Q:'ANS  Q:$D(DUOUT)!$D(DTOUT)
    66  ;Print Report
    67  D ADHOC^PXRMETCO(IEN,BEGIN,END)
    68  Q
    69  ;
    7061HDR ; Header code
    7162 S VALMHDR(1)="Available Extract Definitions:"
    7263 S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
    73  Q
    74  ;
    75 HELP(CALL) ;General help text routine
    76  N HTEXT
    77  I CALL=1 D
    78  .S HTEXT(1)="Select EDM to edit/display extract definitions.\\"
    79  .S HTEXT(2)="Select VSE to view previous extracts or"
    80  .S HTEXT(3)="initiate a manual extract or transmission."
    81  D HELP^PXRMEUT(.HTEXT)
    82  Q
    83  ;
    84 HLIST ;Extract History
    85  N IND,LISTIEN,VALMY
    86  D EN^VALM2(XQORNOD(0))
    87  ;If there is no list quit.
    88  I '$D(VALMY) Q
    89  S PXRMDONE=0
    90  S IND=""
    91  F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
    92  .;Get the ien.
    93  .S LISTIEN=^TMP("PXRMETM",$J,"SEL",IND)
    94  .D START^PXRMETH(LISTIEN)
    95  S VALMBCK="R"
    9664 Q
    9765 ;
     
    10674 Q
    10775 ;
    108 LIST(NODE,VALMCNT) ;Build a list of extract definition entries.
    109  N EPCLASS,IND,FNAME,NAME
    110  ;Build the list in alphabetical order.
    111  S VALMCNT=0
    112  S NAME=""
    113  F  S NAME=$O(^PXRM(810.2,"B",NAME)) Q:NAME=""  D
    114  .S IND=$O(^PXRM(810.2,"B",NAME,"")) Q:'IND
    115  .S FNAME=$P($G(^PXRM(810.2,IND,0)),U)
    116  .S EPCLASS=$P($G(^PXRM(810.2,IND,100)),U)
    117  .S VALMCNT=VALMCNT+1
    118  .S ^TMP(NODE,$J,VALMCNT,0)=$$FMT(VALMCNT,FNAME,EPCLASS)
    119  .S ^TMP(NODE,$J,"IDX",VALMCNT,VALMCNT)=""
    120  .S ^TMP(NODE,$J,"SEL",VALMCNT)=IND
    121  Q
    122  ;
    12376PEXIT ;Protocol exit code
    12477 S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
    12578 ;Reset after page up/down etc
    12679 D XQORM
    127  Q
    128  ;
    129 PLIST ;Extract Definition Inquiry
    130  N IND,EPIEN,VALMY
    131  D EN^VALM2(XQORNOD(0))
    132  ;If there is no list quit.
    133  I '$D(VALMY) Q
    134  S PXRMDONE=0
    135  S IND=""
    136  F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
    137  .;Get the ien.
    138  .S EPIEN=^TMP("PXRMETM",$J,"SEL",IND)
    139  .D START^PXRMEPED(EPIEN)
    140  S VALMBCK="R"
    14180 Q
    14281 ;
     
    14685 ;
    14786XSEL ;PXRM EXTRACT MANAGEMENT SELECT ENTRY validation
    148  N EDIEN,SEL
     87 N SEL,IEN
    14988 S SEL=$P(XQORNOD(0),"=",2)
    15089 ;Remove trailing ,
     
    15493 .W $C(7),!,"Only one item number allowed." H 2
    15594 .S VALMBCK="R"
    156  I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("SEL",SEL))) D  Q
     95 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("IDX",SEL))) D  Q
    15796 .W $C(7),!,SEL_" is not a valid item number." H 2
    15897 .S VALMBCK="R"
    15998 ;
    16099 ;Get the list ien.
    161  S EDIEN=^TMP("PXRMETM",$J,"SEL",SEL)
     100 S IEN=^TMP("PXRMETM",$J,"IDX",SEL,SEL)
    162101 ;
    163102 ;Full screen mode
     
    178117 ;
    179118 ;Display Extract Definitions
    180  I OPTION="EDM" D START^PXRMEPED(EDIEN)
     119 I OPTION="EDM" D
     120 .D START^PXRMEPED(IEN)
    181121 ;
    182122 ;Examine/Run Extract
    183  I OPTION="VSE" D START^PXRMETH(EDIEN)
     123 I OPTION="VSE" D
     124 .D START^PXRMETH(IEN)
    184125 ;
    185126 ;Examine/Run Extract
    186  I OPTION="ERE" D GENSEL(EDIEN)
     127 I OPTION="ERE" D
     128 .D GENSEL(IEN)
    187129 ;
    188130 S VALMBCK="R"
    189131 Q
    190132 ;
     133HELP(CALL) ;General help text routine
     134 N HTEXT
     135 I CALL=1 D
     136 .S HTEXT(1)="Select EDM to edit/display extract definitions."
     137 .S HTEXT(2)="extract. Select VSE to view previous extracts or "
     138 .S HTEXT(3)="initiate a manual extract or transmission."
     139 ;
     140 D HELP^PXRMEUT(.HTEXT)
     141 Q
     142 ;
     143GEN ;Ad hoc report option
     144 ;
     145 ;Reset Screen Mode
     146 W IORESET
     147 ;
     148 N IND,LISTIEN,VALMY
     149 D EN^VALM2(XQORNOD(0))
     150 ;If there is no list quit.
     151 I '$D(VALMY) Q
     152 S PXRMDONE=0
     153 S IND=""
     154 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
     155 .;Get the ien.
     156 .S LISTIEN=^TMP("PXRMETM",$J,"IDX",IND,IND)
     157 .D GENSEL(LISTIEN)
     158 ;
     159 S VALMBCK="R"
     160 Q
     161 ;
     162GENSEL(IEN) ;Report for selected extract definition
     163 N ANS,BEGIN,END,RTN,TEXT
     164 D DATES^PXRMEUT(.BEGIN,.END,"Report")
     165 ;Options
     166 S RTN="PXRMETM",TEXT="Run compliance report for this period"
     167 S ANS=$$ASKYN^PXRMEUT("N",TEXT,RTN,1) Q:'ANS  Q:$D(DUOUT)!$D(DTOUT)
     168 ;Print Report
     169 D ADHOC^PXRMETCO(IEN,BEGIN,END)
     170 Q
     171 ;
     172HLIST ;Extract History
     173 N IND,LISTIEN,VALMY
     174 D EN^VALM2(XQORNOD(0))
     175 ;If there is no list quit.
     176 I '$D(VALMY) Q
     177 S PXRMDONE=0
     178 S IND=""
     179 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
     180 .;Get the ien.
     181 .S LISTIEN=^TMP("PXRMETM",$J,"IDX",IND,IND)
     182 .D START^PXRMETH(LISTIEN)
     183 S VALMBCK="R"
     184 Q
     185 ;
     186PLIST ;Extract Definition Inquiry
     187 N IND,EPIEN,VALMY
     188 D EN^VALM2(XQORNOD(0))
     189 ;If there is no list quit.
     190 I '$D(VALMY) Q
     191 S PXRMDONE=0
     192 S IND=""
     193 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
     194 .;Get the ien.
     195 .S EPIEN=^TMP("PXRMETM",$J,"IDX",IND,IND)
     196 .D START^PXRMEPED(EPIEN)
     197 ;
     198 S VALMBCK="R"
     199 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMETT.m

    r628 r636  
    1 PXRMETT ; SLC/PJH - Extract Summary Display ;04/09/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
    3  ;
    4  ;Main entry point for PXRM EXTRACT SUMMARY
     1PXRMETT ; SLC/PKR/PJH - Reminder Patient List Patients ;08/08/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
     3 ;
     4 ;Main entry point for PXRM PATIENT LIST
    55START(IEN) N TOGGLE,TOGGLE1,VALMBCK,VALMBG,VALMCNT,VALMSG,X,XMZ,XQORM,XQORNOD
    66 S X="IORESET"
     
    1111 ;
    1212BLDLIST(IEN,FINDINGS,PATIENT) ;Build workfile.
    13  ;FINDINGS=1 means display finding totals
    1413 K ^TMP("PXRMETT",$J)
    1514 ;Build a list of extract summary totals.
    1615 N APPL,DATA,DUE,IND,LIST,NDUE,NAPPL,OLIST
    17  N PLCNT,PLIST,RIEN,RNAME,SARRAY,SEQ,SNAME,STATION,TOT
     16 N PLCNT,PLIST,RIEN,RNAME,SARRAY,SNAME,STATION,TOT
    1817 ;Build the list in alphabetical order.
    19  S VALMCNT=0,OLIST="",PLCNT=0
    20  S IND=0 F  S IND=$O(^PXRMXT(810.3,IEN,3,IND)) Q:IND'>0  D
     18 S IND=0,VALMCNT=0,OLIST="",PLCNT=0
     19 F  S IND=$O(^PXRMXT(810.3,IEN,3,IND)) Q:'IND  D
    2120 .S DATA=$G(^PXRMXT(810.3,IEN,3,IND,0)) Q:DATA=""
    2221 .S RIEN=$P(DATA,U,2) Q:'RIEN
    23  .S RNAME=$P(^PXD(811.9,RIEN,0),U,3)
    24  .I RNAME="" S RNAME=$P(^PXD(811.9,RIEN,0),U,1)
     22 .S RNAME=$P($G(^PXD(811.9,RIEN,0)),U)
    2523 .S STATION=$P(DATA,U,3),SARRAY=""
    2624 .D GETS^DIQ(4,STATION,99,"E","SARRAY")
     
    3129 .S PLIST=$P(DATA,U,4)
    3230 .I PLIST,PLIST'=OLIST D
    33  ..I PLCNT>0 D
    34  ...S VALMCNT=VALMCNT+1
    35  ...S ^TMP("PXRMETT",$J,VALMCNT,0)=""
    36  ...S ^TMP("PXRMETT",$J,"IDX",VALMCNT,PLCNT)=""
    3731 ..S PLNAME=$P($G(^PXRMXP(810.5,PLIST,0)),U),OLIST=PLIST Q:PLNAME=""
    3832 ..S VALMCNT=VALMCNT+1,PLCNT=PLCNT+1
     
    4034 ..S ^TMP("PXRMETT",$J,"SEL",PLCNT)=PLIST
    4135 ..S ^TMP("PXRMETT",$J,VALMCNT,0)=$$RJ^XLFSTR(PLCNT,4," ")_" "_PLNAME
     36 ..S VALMCNT=VALMCNT+1
     37 ..S ^TMP("PXRMETT",$J,VALMCNT,0)=""
     38 ..S ^TMP("PXRMETT",$J,"IDX",VALMCNT,PLCNT)=""
    4239 .S VALMCNT=VALMCNT+1
    4340 .S ^TMP("PXRMETT",$J,VALMCNT,0)=$$FRE(VALMCNT,RNAME,SNAME,TOT,APPL,NAPPL,DUE,NDUE)
     41 .S ^TMP("PXRMETT",$J,"IDX",VALMCNT,PLCNT)=""
     42 .S VALMCNT=VALMCNT+1
     43 .S ^TMP("PXRMETT",$J,VALMCNT,0)=""
    4444 .S ^TMP("PXRMETT",$J,"IDX",VALMCNT,PLCNT)=""
    4545 .;Finding totals
     
    4747 ;
    4848 S ^TMP("PXRMETT",$J,"VALMCNT")=VALMCNT
    49  Q
    50  ;
    51 ENTRY ;Entry code
    52  D BLDLIST(IEN,TOGGLE,TOGGLE1),XQORM
    53  Q
    54  ;
    55 EXIT ;Exit code
    56  K ^TMP("PXRMETT",$J)
    57  K ^TMP("PXRMETTH",$J)
    58  D CLEAN^VALM10
    59  D FULL^VALM1
    60  S VALMBCK="Q"
     49 ;M ^TMP("PXRMETT",$J)=LIST
    6150 Q
    6251 ;
     
    9180 Q
    9281 ;
     82PBLD(IEN,IND,SUB) ;
     83 N ARRAY,NAME,LEN,PCNT,DFN,CNT,USTR
     84 S VALMCNT=VALMCNT+1,CNT=0
     85 S PCNT=0 F  S PCNT=$O(^PXRMXT(810.3,IEN,3,IND,1,SUB,1,PCNT)) Q:PCNT'>0  D
     86 .S DFN=$P($G(^PXRMXT(810.3,IEN,3,IND,1,SUB,1,PCNT,0)),U) Q:DFN'>0
     87 .S NAME=$P($G(^DPT(DFN,0)),U)
     88 .S CNT=CNT+1,ARRAY(NAME)=""
     89 S ^TMP("PXRMETT",$J,VALMCNT,0)="     "_$$RJ^XLFSTR("Unique Applicable Patients ("_CNT_")",36," ")
     90 S USTR=$P($G(^TMP("PXRMETT",$J,VALMCNT,0)),"U"),LEN=$L(USTR)
     91 S ^TMP("PXRMETT",$J,"IDX",VALMCNT,PLCNT)=""
     92 S NAME="" F  S NAME=$O(ARRAY(NAME)) Q:NAME=""  D
     93 .S VALMCNT=VALMCNT+1
     94 .S ^TMP("PXRMETT",$J,VALMCNT,0)=USTR_$$LJ^XLFSTR(NAME,36," ")
     95 .S ^TMP("PXRMETT",$J,"IDX",VALMCNT,PLCNT)=""
     96 S VALMCNT=VALMCNT+1
     97 S ^TMP("PXRMETT",$J,VALMCNT,0)="  "
     98 S ^TMP("PXRMETT",$J,"IDX",VALMCNT,PLCNT)=""
     99 Q
     100 ;
    93101FLIST ;Toggle list with/without finding totals
    94102 S TOGGLE=(TOGGLE+1)#2
    95103 I TOGGLE=0 S TOGGLE1=0
     104 ;Rebuild Workfile
     105 D BLDLIST(IEN,TOGGLE,TOGGLE1)
     106 ;Refresh
     107 S VALMBCK="R",VALMBG=1
     108 Q
     109 ;
     110PLIST1 ;Toggle list with/without finding totals
     111 S TOGGLE1=(TOGGLE1+1)#2
    96112 ;Rebuild Workfile
    97113 D BLDLIST(IEN,TOGGLE,TOGGLE1)
     
    125141 Q TEMP
    126142 ;
     143ENTRY ;Entry code
     144 D BLDLIST(IEN,TOGGLE,TOGGLE1),XQORM
     145 Q
     146 ;
     147EXIT ;Exit code
     148 K ^TMP("PXRMETT",$J)
     149 K ^TMP("PXRMETTH",$J)
     150 D CLEAN^VALM10
     151 D FULL^VALM1
     152 S VALMBCK="Q"
     153 Q
     154 ;
    127155HDR ; Header code
    128156 S VALMHDR(1)="Extract Summary Name: "_$P($G(^PXRMXT(810.3,IEN,0)),U)
    129157 S VALMHDR(2)="      Extract Period: "_$$FMTE^XLFDT($P($G(^PXRMXT(810.3,IEN,0)),U,2),"5Z")_" - "_$$FMTE^XLFDT($P($G(^PXRMXT(810.3,IEN,0)),U,3),"5Z")
    130158 S VALMHDR(2)=VALMHDR(2)_"   Created: "_$$FMTE^XLFDT($P($G(^PXRMXT(810.3,IEN,0)),U,6),"5Z")
     159 ;S VALMHDR(3)=VALMHDR(3)_"        Transmitted: "_$$FMTE^XLFDT($P($G(^PXRMXT(810.3,IEN,0)),U,4),"5Z")
    131160 S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
    132161 Q
     
    142171 Q
    143172 ;
    144 PBLD(IEN,IND,SUB) ;
    145  N ARRAY,NAME,LEN,PCNT,DFN,CNT,USTR
    146  S VALMCNT=VALMCNT+1,CNT=0
    147  S PCNT=0 F  S PCNT=$O(^PXRMXT(810.3,IEN,3,IND,1,SUB,1,PCNT)) Q:PCNT'>0  D
    148  .S DFN=$P($G(^PXRMXT(810.3,IEN,3,IND,1,SUB,1,PCNT,0)),U) Q:DFN'>0
    149  .S NAME=$P($G(^DPT(DFN,0)),U)
    150  .S CNT=CNT+1,ARRAY(NAME)=""
    151  S ^TMP("PXRMETT",$J,VALMCNT,0)="     "_$$RJ^XLFSTR("Unique Applicable Patients ("_CNT_")",36," ")
    152  S USTR=$P($G(^TMP("PXRMETT",$J,VALMCNT,0)),"U"),LEN=$L(USTR)
    153  S ^TMP("PXRMETT",$J,"IDX",VALMCNT,PLCNT)=""
    154  S NAME="" F  S NAME=$O(ARRAY(NAME)) Q:NAME=""  D
    155  .S VALMCNT=VALMCNT+1
    156  .S ^TMP("PXRMETT",$J,VALMCNT,0)=USTR_$$LJ^XLFSTR(NAME,36," ")
    157  .S ^TMP("PXRMETT",$J,"IDX",VALMCNT,PLCNT)=""
    158  S VALMCNT=VALMCNT+1
    159  S ^TMP("PXRMETT",$J,VALMCNT,0)="  "
    160  S ^TMP("PXRMETT",$J,"IDX",VALMCNT,PLCNT)=""
     173XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXTRACT SUMMARY SELECT ENTRY",0))_U_"1:"_VALMCNT
     174 S XQORM("A")="Select Item: "
     175 Q
     176 ;
     177XSEL ;PXRM EXTRACT TOTALS SELECT ENTRY validation
     178 N SEL,PLIEN
     179 S SEL=$P(XQORNOD(0),"=",2)
     180 ;Remove trailing ,
     181 I $E(SEL,$L(SEL))="," S SEL=$E(SEL,1,$L(SEL)-1)
     182 ;Invalid selection
     183 I SEL["," D  Q
     184 .W $C(7),!,"Only one item number allowed." H 2
     185 .S VALMBCK="R"
     186 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("SEL",SEL))) D  Q
     187 .W $C(7),!,SEL_" is not a valid item number." H 2
     188 .S VALMBCK="R"
     189 ;
     190 ;Get the list ien.
     191 S PLIEN=^TMP("PXRMETT",$J,"SEL",SEL)
     192 ;
     193 D START^PXRMLPP(PLIEN)
     194 ;
     195 S VALMBCK="R"
    161196 Q
    162197 ;
     
    178213 .S PLIEN=^TMP("PXRMETT",$J,"SEL",IND)
    179214 .D START^PXRMLPP(PLIEN)
     215 ;
    180216 S VALMBCK="R"
    181217 Q
    182  ;
    183 PLIST1 ;Toggle list with/without finding totals
    184  S TOGGLE1=(TOGGLE1+1)#2
    185  ;Rebuild Workfile
    186  D BLDLIST(IEN,TOGGLE,TOGGLE1)
    187  ;Refresh
    188  S VALMBCK="R",VALMBG=1
    189  Q
    190  ;
    191 XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXTRACT SUMMARY SELECT ENTRY",0))_U_"1:"_VALMCNT
    192  S XQORM("A")="Select Item: "
    193  Q
    194  ;
    195 XSEL ;PXRM EXTRACT TOTALS SELECT ENTRY validation
    196  N SEL,PLIEN
    197  S SEL=$P(XQORNOD(0),"=",2)
    198  ;Remove trailing ,
    199  I $E(SEL,$L(SEL))="," S SEL=$E(SEL,1,$L(SEL)-1)
    200  ;Invalid selection
    201  I SEL["," D  Q
    202  .W $C(7),!,"Only one item number allowed." H 2
    203  .S VALMBCK="R"
    204  I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("SEL",SEL))) D  Q
    205  .W $C(7),!,SEL_" is not a valid item number." H 2
    206  .S VALMBCK="R"
    207  ;Get the list ien.
    208  S PLIEN=^TMP("PXRMETT",$J,"SEL",SEL)
    209  D START^PXRMLPP(PLIEN)
    210  S VALMBCK="R"
    211  Q
    212  ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMETX.m

    r628 r636  
    1 PXRMETX ; SLC/PJH - Run Extract for QUERI ;07/10/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMETX ; SLC/PJH - Run Extract for QUERI ;1/22/07  21:25
     2 ;;2.0;CLINICAL REMINDERS;**4,7**;Feb 04, 2005;Build 14
     3 ; Modified from FOIA VISTA,
     4 ; Copyright (C) 2007 WorldVistA
     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
     17 ; along with this program; if not, write to the Free Software
     18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
    319 ;
    420AUTO(ID,PURGE) ;Called from option scheduling (#19.2)
     
    1834 ;Purge Patient Lists
    1935 D PRGPL^PXRMETXU
     36 ;Call the DOQ-IT HL7 generating routine
     37 ;D EXTRACT^VEPER7EX(VDATA(810.2,IEN_",",3,"I"),VDATA(810.2,IEN_",",5,"I"))
    2038 Q
    2139 ;
     
    5371 Q
    5472 ;
     73ACAD ;Auto CAD entry point
     74 D AUTO("VOE DOQ-IT CAD EXTRACTION")
     75 Q
     76 ;
     77ADM ;Auto DM entry point
     78 D AUTO("VOE DOQ-IT DM EXTRACTION")
     79 Q
     80 ;
     81AHF ;Auto HF entry point
     82 D AUTO("VOE DOQ-IT HF EXTRACTION")
     83 Q
     84 ;
     85AHTN ;Auto HTN entry point
     86 D AUTO("VOE DOQ-IT HTN EXTRACTION")
     87 Q
     88 ;
     89APC ;Auto PC entry point
     90 D AUTO("VOE DOQ-IT PC EXTRACTION")
     91 Q
     92 ;
    5593RUN(IEN,NEXT,MODE,PURGE) ;Process extract parameter
    5694 ; IEN is ien of Extract Parameter
     
    62100 ;
    63101 N CLASS,FDA,FDAIEN,MSG
    64  N PXRMIDOD,PXRMLIST,PXRMNODE,PXRMRULE,PXRMSTRT,PXRMXIEN,PATCREAT,XNAME
    65  N ITER
     102 N PXRMLIST,PXRMNODE,PXRMRULE,PXRMSTRT,PXRMXIEN,PATCREAT,XNAME
    66103 ;Initialise
    67104 K ^TMP("PXRMETX",$J),^TMP("PXRMETX1",$J)
     
    83120 ;Determine output name for patient list and extract summary
    84121 S XNAME=NAME_" "_YEAR_" "_PERIOD
    85  S NAME=$$GETNAME(XNAME)
    86  S ITER=$P(NAME,"/",2)
    87122 ;Process (single) Denominator rule into patient list
    88123 N SEQ,SUB
     
    98133 .S INTP=+$P(DATA,U,5)
    99134 .;Create new patient list
    100  .I ITER'="" S LIST=LIST_"/"_ITER
    101  .S PATCREAT="Y",PXRMLIST=$$CRLST^PXRMRUL1(LIST,CLASS) Q:'PXRMLIST
     135 .S PATCREAT="Y",PXRMLIST=$$CRLST^PXRMRULE(LIST,CLASS) Q:'PXRMLIST
    102136 .;
    103  .D START^PXRMRULE(PXRMRULE,PXRMLIST,PXRMNODE,PXRMSTRT,PXRMSTOP,IEN,YEAR,PERIOD,INDP,INTP,ITER)
     137 .D START^PXRMRULE(PXRMRULE,PXRMLIST,PXRMNODE,PXRMSTRT,PXRMSTOP,IEN,YEAR,PERIOD,INDP,INTP)
    104138 .;Clear ^TMP lists created for rule
    105139 .D CLEAR^PXRMRULE(PXRMRULE,PXRMNODE)
    106140 .;Process reminders and finding rules
    107  .;If include deceased patients is true then set the flag so reminders
    108  .;will be evaluated for deceased patients.
    109  .S PXRMIDOD=$S(INDP:1,1:0)
    110141 .D REM^PXRMETXR(SUB,PXRMLIST,PXRMSTRT,PXRMSTOP,PARTYPE)
    111142 ;
    112143 ;Get the name
    113  ;S NAME=$$GETNAME(XNAME)
     144 S NAME=$$GETNAME(XNAME)
    114145 ;Create extract summary entry
    115146 S FDA(810.3,"+1,",.01)=NAME
     
    133164 ;Transmit results
    134165 I (MODE=0)!(MODE=2) D TRANS(FDAIEN(1))
     166 ;
     167 I $$GET^XPAR("SYS","DOQ-IT")="YES" D EXTRACT^VEPER7EX(VDATA(810.2,IEN_",",3,"I"),VDATA(810.2,IEN_",",5,"I"),PXRMLIST)
    135168 ;
    136169 ;Update extract parameters
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMETXR.m

    r628 r636  
    1 PXRMETXR ; SLC/PJH,PKR - Reminder section of extract ;02/22/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMETXR ; SLC/PJH,PKR - Reminder section of extract ;05/01/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ; Called from PXRMETX
     
    115115 ;lists.
    116116 N APPL,DATA,DEFARR,DEFSITE,DFN,DUE,FIEV,FRIEN,FUTIL,IND,INST
    117  N PXRMDATE,RCNT,REM,REMSEQ,RIEN,RNAM,STATUS,SUB1,TODAY
     117 N PXRMDATE,RCNT,REM,RIEN,RNAM,STATUS,SUB1,TODAY
    118118 N END,START
    119119 ;S START=$H
     
    123123 ;Scan reminders for this parameter set
    124124 S (RCNT,SUB1)=0
    125  S REMSEQ=""
    126  F  S REMSEQ=$O(^PXRM(810.2,IEN,10,SUB,10,"B",REMSEQ)) Q:REMSEQ=""  D
    127  .F  S SUB1=$O(^PXRM(810.2,IEN,10,SUB,10,"B",REMSEQ,SUB1)) Q:'SUB1  D
    128  ..S DATA=$G(^PXRM(810.2,IEN,10,SUB,10,SUB1,0)) Q:DATA=""
    129  ..;Reminder ien
    130  ..S RIEN=$P(DATA,U,2) Q:'RIEN
    131  ..;Evaluation date is period end except if the period is incomplete.
    132  ..S PXRMDATE=$S($$FMDIFF^XLFDT(PXRMSTOP,TODAY,2)>0:TODAY,1:PXRMSTOP)
    133  ..;Finding Rule
    134  ..S FRIEN=$P(DATA,U,3)
    135  ..;Reminder print name
    136  ..S RNAM=$P($G(^PXD(811.9,RIEN,0)),U,3)
    137  ..I RNAM="" S RNAM=$P(^PXD(811.9,RIEN,0),U,1)
    138  ..;Save details to REM array
    139  ..S RCNT=RCNT+1,REM(RCNT)=RIEN_U_RNAM_U_FRIEN
    140  ..;Build list of terms from extract finding rule #810.7
    141  ..I FRIEN D FRULE(FRIEN,RCNT,SEQ,.REM,.FUTIL) Q
    142  ..;If no extract finding rule defined collect all findings in reminder
    143  ..I 'FRIEN D REMF(RIEN,RCNT,SEQ,.REM)
     125 F  S SUB1=$O(^PXRM(810.2,IEN,10,SUB,10,SUB1)) Q:'SUB1  D
     126 .S DATA=$G(^PXRM(810.2,IEN,10,SUB,10,SUB1,0)) Q:DATA=""
     127 .;Reminder ien
     128 .S RIEN=$P(DATA,U,2) Q:'RIEN
     129 .;Evaluation date is period end except if the period is incomplete.
     130 .S PXRMDATE=$S($$FMDIFF^XLFDT(PXRMSTOP,TODAY,2)>0:TODAY,1:PXRMSTOP)
     131 .;Finding Rule
     132 .S FRIEN=$P(DATA,U,3)
     133 .;Reminder print name
     134 .S RNAM=$P($G(^PXD(811.9,RIEN,0)),U,3)
     135 .;Save details to REM array
     136 .S RCNT=RCNT+1,REM(RCNT)=RIEN_U_RNAM_U_FRIEN
     137 .;Build list of terms from extract finding rule #810.7
     138 .I FRIEN D FRULE(FRIEN,RCNT,SEQ,.REM,.FUTIL) Q
     139 .;If no extract finding rule defined collect all findings in reminder
     140 .I 'FRIEN D REMF(RIEN,RCNT,SEQ,.REM)
    144141 ;
    145142 ;Process patient list
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMETXU.m

    r628 r636  
    1 PXRMETXU ; SLC/PJH - Extract utilities ;09/06/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMETXU ; SLC/PJH - Extract utilities ;08/03/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44HELP(CALL) ;General help text routine
     
    1313 I CALL=4 D
    1414 .S HTEXT(1)="The selected period is the same as next scheduled extract."
    15  .S HTEXT(2)="Enter 'Y' if this extract will replace the scheduled"
     15 .S HTEXT(2)="Enter 'Y' to if this extract will replace the scheduled"
    1616 .S HTEXT(3)="extract. Enter 'N' if you still want the scheduled extract"
    17  .S HTEXT(4)="to run."
     17 .S HTEXT(3)="to run."
    1818 ;
    1919 D HELP^PXRMEUT(.HTEXT)
    20  Q
    21  ;
    22 DELETE(IEN) ;Delete an extract summary.
    23  I IEN="" Q
    24  N DA,DELOK,DIK,NAME
    25  S DELOK=1
    26  S NAME=$P(^PXRMXT(810.3,IEN,0),U,1)
    27  ;Must have PXRM MANAGER key in order to delete national extracts.
    28  I $P($G(^PXRMXT(810.3,IEN,100)),U,1)="N" D
    29  . S DELOK=$S($D(^XUSEC("PXRM MANAGER",DUZ)):1,1:0)
    30  . I 'DELOK D
    31  .. W !!,NAME," is national."
    32  .. W !,"You cannot delete a national extract summary."
    33  .. H 2
    34  I 'DELOK Q
    35  ;Double check the user really wants to delete.
    36  S TEXT="Are you sure you want to delete "_NAME
    37  S DELOK=$$ASKYN^PXRMEUT("N","Are you sure you want to delete "_NAME)
    38  I 'DELOK Q
    39  S DA=IEN
    40  S DIK="^PXRMXT(810.3,"
    41  D ^DIK
    42  W !,"Deleting ",NAME
    43  H 2
    4420 Q
    4521 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEUT.m

    r628 r636  
    1 PXRMEUT ; SLC/PJH - General extract utilities ;09/06/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMEUT ; SLC/PJH - General extract utilities ;06/27/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;=================================================
     
    162162 ;
    163163 ;=================================================
    164 HELP(HTEXT) ;General help text output routine.
    165  N IND,NIN,NOUT,TEXTIN,TEXOUT
    166  ;Make sure the text is in a form the formatting routine can handle.
    167  S IND="",NIN=0
    168  F  S IND=$O(HTEXT(IND)) Q:IND=""  S NIN=NIN+1,TEXTIN(NIN)=HTEXT(IND)
    169  D FORMAT^PXRMTEXT(1,72,NIN,.TEXTIN,.NOUT,.TEXTOUT)
    170  F IND=1:1:NOUT W !,TEXTOUT(IND)
     164HELP(HTEXT) ;General help text routine. Write out the text in the HTEXT
     165 ;array.
     166 N DIWF,DIWL,DIWR,IC,X
     167 S DIWF="C70",DIWL=0,DIWR=70
     168 K ^UTILITY($J,"W")
     169 S IC=""
     170 F  S IC=$O(HTEXT(IC)) Q:IC=""  D
     171 . S X=HTEXT(IC)
     172 . D ^DIWP
     173 W !
     174 S IC=0
     175 F  S IC=$O(^UTILITY($J,"W",0,IC)) Q:IC=""  D
     176 . W !,^UTILITY($J,"W",0,IC,0)
     177 K ^UTILITY($J,"W")
    171178 W !
    172179 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEUT1.m

    r628 r636  
    1 PXRMEUT1 ; SLC/PKR - General extract utilities ;05/08/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMEUT1 ; SLC/PKR - General extract utilities ;08/09/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;=================================================
    4 CLDATES ;Cleanup entries in ^TMP("PXRMDDOC",$J) before making date checks.
    5  ;For drug findings consolidate PS(55, PS(55NVA, and PSRX( back to
    6  ;PSDRUG(.
    7  N FI,FIND0,ITEM,GLOBAL,LIST
    8  S FIND0=""
    9  F  S FIND0=$O(^TMP("PXRMDDOC",$J,FIND0)) Q:FIND0=""  D
    10  . S FI=$P(FIND0,U,1)
    11  . S GLOBAL=$P(FI,";",2)
    12  . I GLOBAL'["PS" Q
    13  . S GLOBAL="PSDRUG("
    14  . S ITEM=$P(FI,";",1)
    15  . S FI=ITEM_";"_GLOBAL_U_$P(FIND0,U,2,11)
    16  . S LIST(FIND0)=FI
    17  ;
    18  S FIND0=""
    19  F  S FIND0=$O(LIST(FIND0)) Q:FIND0=""  D
    20  . S FI=LIST(FIND0)
    21  . S ^TMP("PXRMDDOC",$J,FI)=^TMP("PXRMDDOC",$J,FIND0)
    22  . K ^TMP("PXRMDDOC",$J,FIND0)
    23  Q
     4DCONV(DATE,LBBDT,LBEDT) ;Convert dates to actual values.
     5 I DATE=0 Q DATE
     6 N PXRMDATE
     7 S PXRMDATE=$S(DATE["BDT":LBBDT,1:LBEDT)
     8 S DATE=$$STRREP^PXRMUTIL(DATE,"BDT","T")
     9 Q $$CTFMD^PXRMDATE(DATE)
    2410 ;
    2511 ;=================================================
     
    3622 ;
    3723 ;=================================================
    38 DCONV(DATE,LBBDT,LBEDT) ;Convert dates to actual values.
    39  I DATE=0 Q DATE
    40  N PXRMDATE
    41  S PXRMDATE=$S(DATE["BDT":LBBDT,1:LBEDT)
    42  S DATE=$$STRREP^PXRMUTIL(DATE,"BDT","T")
    43  Q $$CTFMD^PXRMDATE(DATE)
    44  ;
    45  ;=================================================
    4624DOCDATES(RULESET,LBBDT,LBEDT,NL,OUTPUT) ;
    47  N EM,FRACT,FRDATA,FRDATES,FRIEN,FRLST,FRLIEN,FROLST,FROUT,FRPAT
    48  N FRPERM,FRSTRT,FRTIEN,FRTYP,FSEQ,OPER,PXRMFVPL
     25 N FINDPA,FRACT,FRDATA,FRDATES,FRIEN,FRLST,FRLIEN,FROLST,FROUT,FRPAT
     26 N FRPERM,FRSTRT,FRTIEN,FRTYP,FSEQ,PXRMDATE,PXRMFVPL
    4927 N RRIEN,RSDATA,RSDATES,RBDT,REDT,SEQ,SUB
    50  I $G(PXRMDDOC)=2 D CLDATES
    5128 ;Build the variable pointer list.
    5229 D BLDRLIST^PXRMVPTR(811.902,.01,.PXRMFVPL)
     
    5532 . S SUB=$O(^PXRM(810.4,RULESET,30,"B",SEQ,"")) Q:'SUB
    5633 . S RSDATA=$G(^PXRM(810.4,RULESET,30,SUB,0)) Q:RSDATA=""
    57  . S OPER=$P(RSDATA,U,3)
    58  . S OPER=$$EXTERNAL^DILFD(810.41,.03,"",OPER,.EM)
    5934 . S RSDATES=$G(^PXRM(810.4,RULESET,30,SUB,1))
    6035 .;Finding rule ien.
     
    6944 .;Determine RBDT and REDT
    7045 . D RDATES(RSDATES,FRDATES,LBBDT,LBEDT,.RBDT,.REDT)
     46 . S PXRMDATE=LBEDT
     47 . S $P(FINDPA(0),U,8)=RBDT,$P(FINDPA(0),U,11)=REDT
    7148 . S NL=NL+1,OUTPUT(NL)=""
    7249 . S NL=NL+1,OUTPUT(NL)="SEQUENCE "_SEQ_" "_$P(FRDATA,U,1)
    73  . S NL=NL+1,OUTPUT(NL)=" Operation: "_OPER
    7450 .;Term finding rules
    75  . I FRTYP=1 D TERM(FRTIEN,LBBDT,LBEDT,RBDT,REDT,.PXRMFVPL,.NL,.OUTPUT)
     51 . I FRTYP=1 D TERM(FRTIEN,.FINDPA,.PXRMFVPL,.NL,.OUTPUT)
    7652 .;Reminder Definition List Rule
    77  . I FRTYP=2 D REM(RRIEN,LBBDT,LBEDT,RBDT,REDT,.PXRMFVPL,.NL,.OUTPUT)
     53 . I FRTYP=2 D REM(RRIEN,.FINDPA,.PXRMFVPL,.NL,.OUTPUT)
    7854 Q
    7955 ;
    8056 ;=================================================
    81 FMULPRT(FARR,PXRMFVPL,NL,OUTPUT) ;Print the finding multiple
     57FMULPRT(DEFARR,FINDPA,PXRMFVPL,NL,OUTPUT) ;Print the finding multiple
    8258 ;information.
    83  ;Q
    84  N BDT,EDT,DERROR,FNAME,FTYPE,IND,NOCC,TBDT,TEDT,TEMP,VPTR
     59 N BDT,EDT,FNAME,FTYPE,IND,NOCC,PFINDPA,TFINDPA,VPTR
    8560 S IND=0
    86  F  S IND=+$O(FARR(20,IND)) Q:IND=0  D
    87  . S VPTR=$P(FARR(20,IND,0),U,1)
     61 F  S IND=+$O(DEFARR(20,IND)) Q:IND=0  D
     62 . S VPTR=$P(DEFARR(20,IND,0),U,1)
    8863 . S FNAME=$$ENTRYNAM^PXRMPTD2(VPTR)
    8964 . S FTYPE=$$FTYPE^PXRMPTD2(VPTR,1)
    9065 . S NL=NL+1,OUTPUT(NL)="  FINDING "_IND_"-"_FTYPE_"."_FNAME
     66 . K PFINDPA,TFINDPA
     67 . M TFINDPA=DEFARR(20,IND)
    9168 .;Set the finding parameters.
    92  . D SSPAR^PXRMUTIL(FARR(20,IND,0),.NOCC,.BDT,.EDT)
     69 . D SPFINDPA^PXRMTERM(.FINDPA,.TFINDPA,.PFINDPA)
     70 . D SSPAR^PXRMUTIL(PFINDPA(0),.NOCC,.BDT,.EDT)
    9371 . S NL=NL+1,OUTPUT(NL)="   Beginning Date/Time: "_$$FMTE^XLFDT(BDT,"5Z")
    9472 . S NL=NL+1,OUTPUT(NL)="   Ending Date/Time:    "_$$FMTE^XLFDT(EDT,"5Z")
    95  . I $G(PXRMDDOC)'=2 Q
    96  . S DERROR=0
    97  . S TEMP=$G(^TMP("PXRMDDOC",$J,$P(FARR(20,IND,0),U,1,11)))
    98  .;If TEMP is null then no evaluation was required and the check
    99  .;cannot be made
    100  . I TEMP="" Q
    101  . I $P(TEMP,U,1)'=BDT D
    102  .. S DERROR=1
    103  .. S NL=NL+1,OUTPUT(NL)="  There is a consistency problem with the beginning date!"
    104  .. S NL=NL+1,OUTPUT(NL)="  Date used to build the list was: "_$$FMTE^XLFDT($P(TEMP,U,1),"5Z")
    105  . I $P(TEMP,U,2)'=EDT D
    106  .. S DERROR=1
    107  .. S NL=NL+1,OUTPUT(NL)="  There is a consistency problem with the ending date!"
    108  .. S NL=NL+1,OUTPUT(NL)="  Date used to build the list was: "_$$FMTE^XLFDT($P(TEMP,U,2),"5Z")
    109  . I DERROR D
    110  .. S NL=NL+1,OUTPUT(NL)="  Please notify the developers."
    111  .. ;S NL=NL+1,OUTPUT(NL)="  Please enter a Remedy ticket."
    112  .. S NL=NL+1,OUTPUT(NL)=" "
    11373 Q
    11474 ;
     
    12282 I RBDT="" S RBDT=0
    12383 I REDT="" S REDT=LBEDT
    124  I REDT=0 S REDT=DT
     84 I REDT=0 S REDT=$$DT^XLFDT
    12585 ;Convert RBDT and REDT to FileMan dates.
    12686 S RBDT=$$DCONV(RBDT,LBBDT,LBEDT)
     
    13797 ;
    13898 ;=================================================
    139 REM(IEN,LBBDT,LBEDT,RBDT,REDT,PXRMFVPL,NL,OUTPUT) ;
     99REM(IEN,FINDPA,PXRMFVPL,NL,OUTPUT) ;
    140100 N DEFARR
    141101 D DEF^PXRMLDR(IEN,.DEFARR)
    142  D DATES^PXRMRUL1(LBBDT,LBEDT,RBDT,REDT,.DEFARR)
    143102 S NL=NL+1,OUTPUT(NL)=" REMINDER DEFINITION "_$P(DEFARR(0),U,1)
    144  D FMULPRT(.DEFARR,.PXRMFVPL,.NL,.OUTPUT)
     103 D FMULPRT(.DEFARR,.FINDPA,.PXRMFVPL,.NL,.OUTPUT)
    145104 Q
    146105 ;
    147106 ;=================================================
    148 TERM(IEN,LBBDT,LBEDT,RBDT,REDT,PXRMFVPL,NL,OUTPUT) ;
     107TERM(IEN,FINDPA,PXRMFVPL,NL,OUTPUT) ;
    149108 N TERMARR
    150109 D TERM^PXRMLDR(IEN,.TERMARR)
    151  D DATES^PXRMRUL1(LBBDT,LBEDT,RBDT,REDT,.TERMARR)
    152110 S NL=NL+1,OUTPUT(NL)=" TERM "_$P(TERMARR(0),U,1)
    153  D FMULPRT(.TERMARR,.PXRMFVPL,.NL,.OUTPUT)
     111 D FMULPRT(.TERMARR,.FINDPA,.PXRMFVPL,.NL,.OUTPUT)
    154112 Q
    155113 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEVFI.m

    r628 r636  
    1 PXRMEVFI ; SLC/PKR - Driver for finding evaluation. ;04/02/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEVFI ; SLC/PKR - Driver for finding evaluation. ;12/01/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;=====================================================
     
    2424 . I ENODE="PSNDF(50.6," D EVALFI^PXRMDGEN(DFN,.DEFARR,ENODE,.FIEVAL) Q
    2525 . I ENODE="RAMIS(71," D EVALFI^PXRMRAD(DFN,.DEFARR,ENODE,.FIEVAL) Q
    26  . I ENODE="YTT(601.71," D EVALFI^PXRMMH(DFN,.DEFARR,ENODE,.FIEVAL) Q
     26 . I ENODE="YTT(601," D EVALFI^PXRMMH(DFN,.DEFARR,ENODE,.FIEVAL) Q
    2727 ;Evaluate function findings.
    2828 D EVAL^PXRMFF(DFN,.DEFARR,.FIEVAL)
     
    3838 S FINDPA(11)=DEFARR(20,FINUM,11)
    3939 D GENTERM^PXRMPLST(FINDPA(0),FINUM,.TERMARR)
    40  D EVALPL^PXRMTERL(.FINDPA,.TERMARR,PLIST)
     40 D EVALPL^PXRMTERM(.FINDPA,.TERMARR,PLIST)
    4141 Q
    4242 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXCF.m

    r628 r636  
    1 PXRMEXCF ; SLC/PKR - Reminder exchange routines for computed findings. ;06/28/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXCF ; SLC/PKR - Reminder exchange routines for computed findings. ;12/22/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;==============================================
    44EXISTS(ROUTINE) ;Return true if routine ROUTINE exists.
     
    1010 ;==============================================
    1111GETRACT(ATTR,NEWNAME,NAMECHG,RTN,EXISTS) ;Get the action for a routine.
    12  N ACTION,CHOICES,CSUM,DIR,DIROUT,DIRUT,DTOUT,DUOUT,ECS,IND,MSG
     12 N ACTION,CHOICES,DIR,DIROUT,DIRUT,DTOUT,DUOUT,ECS,IND,MSG
    1313 N PCS,ROUTINE,SAME,TEXT,X,Y
    1414 S NEWNAME=""
     15 ;If the routine exists compare the existing routine checksum with the
     16 ;the checksum of the routine in the packed definition.
    1517 S ROUTINE=ATTR("NAME")
    1618 I EXISTS="" S EXISTS=$$EXISTS^PXRMEXCF(ROUTINE)
    1719 S CHOICES=$S(EXISTS:"COQS",1:"CIQS")
    1820 I EXISTS D
    19  .;If the routine exists compare the existing routine checksum with the
    20  .;the checksum of the routine in the packed definition.
    21  . S CSUM=$$RTNCS^PXRMEXCS(ROUTINE)
    22  . S SAME=$S(ATTR("CHECKSUM")=CSUM:1,1:0)
     21 . S SAME=$$SAME(.ATTR,.RTN)
    2322 . S TEXT(1)="Routine "_ROUTINE_" already exists "
    24  . I SAME D
    25  .. S TEXT(1)=TEXT(1)_"and the packed routine is identical, skipping."
    26  .. W !,TEXT(1),! H 2
    27  .. S ACTION="S"
    28  . I 'SAME D
    29  .. S TEXT(1)=TEXT(1)_"but the packed routine is different,"
    30  .. S TEXT(2)="what do you want to do?"
    31  .. W !,TEXT(1),!,TEXT(2)
    32  .. S DIR("B")="O"
    33  .. S ACTION=$$GETACT^PXRMEXIU(CHOICES,.DIR)
     23 . I SAME S TEXT(1)=TEXT(1)_"and the packed routine is identical,"
     24 . I 'SAME S TEXT(1)=TEXT(1)_"but the packed routine is different,"
     25 . S TEXT(2)="what do you want to do?"
     26 . D EN^DDIOL(.TEXT)
     27 . S DIR("B")="S"
     28 . S ACTION=$$GETACT^PXRMEXIU(CHOICES,.DIR)
    3429 E  D
    35  . W !!,"Routine "_ROUTINE_" is new, what do you want to do?"
     30 . W !!,"Routine "_ROUTINE_" is NEW, what do you want to do?"
    3631 . S DIR("B")="I"
    3732 . S ACTION=$$GETACT^PXRMEXIU(CHOICES,.DIR)
    3833 ;
    39  I (ACTION="Q")!(ACTION="S") Q ACTION
     34 I ACTION="Q" Q ACTION
    4035 ;
    4136 I ACTION="C" D
     
    6560 Q ACTION
    6661 ;
     62 ;==============================================
     63SAME(ATTR,RTN) ;Compare the existing routine and the new version
     64 ;in RTN to see if they are the same.
     65 N ECS,DIF,NEWCS,RT,SAME,X,XCNP
     66 ;Load the existing routine into RT.
     67 S XCNP=0
     68 S DIF="RT("
     69 S X=ATTR("NAME")
     70 X ^%ZOSF("LOAD")
     71 S ECS=$$ROUTINE^PXRMEXCS(.RT)
     72 K RT
     73 S NEWCS=$$ROUTINE^PXRMEXCS(.RTN)
     74 S SAME=$S(ECS=NEWCS:1,1:0)
     75 Q SAME
     76 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXCS.m

    r628 r636  
    1 PXRMEXCS ; SLC/PKR - Routines to compute checksums. ;07/27/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
    3  ;====================================================
    4 CHECKSUM(ATTR,START,END) ;Get the the checksum for a packed reminder
    5  ;component and load it into the attribute array.
    6  N CS,LINE
    7  ;If checksum is in packed component return it otherwise calculate it.
    8  I ATTR("FILE NUMBER")=0 D
    9  . S LINE=^PXD(811.8,PXRMRIEN,100,START-3,0)
    10  . S CS=$$GETTAGV^PXRMEXU3(LINE,"<CHECKSUM>")
    11  . I CS="" S CS=$$PRTNCS(PXRMRIEN,START,END)
    12  I ATTR("FILE NUMBER")>0 D
    13  . S LINE=^PXD(811.8,PXRMRIEN,100,START-2,0)
    14  . S CS=$$GETTAGV^PXRMEXU3(LINE,"<CHECKSUM>")
    15  . I CS="" S CS=$$PFDACS(PXRMRIEN,START,END)
    16  S ATTR("CHECKSUM")=CS
    17  Q
    18  ;
    19  ;====================================================
    20 DIQOUTCS(DIQOUT) ;Return checksum for a processed DIQOUT array.
    21  N CS,DATA,FIELD,FNUM,IENS,IND,SFN,STRING,TARGET,TEXT,WP
    22  S FNUM=$O(DIQOUT(""))
    23  D FIELD^DID(FNUM,"EDIT HISTORY","","SPECIFIER","TARGET")
    24  S SFN=+$G(TARGET("SPECIFIER"))
    25  S (CS,FNUM)=0
    26  F  S FNUM=$O(DIQOUT(FNUM)) Q:FNUM=""  D
    27  . I FNUM=SFN Q
    28  . S IENS=""
    29  . F  S IENS=$O(DIQOUT(FNUM,IENS)) Q:IENS=""  D
    30  .. S FIELD=0
    31  .. F  S FIELD=$O(DIQOUT(FNUM,IENS,FIELD)) Q:FIELD=""  D
    32  ... S DATA=DIQOUT(FNUM,IENS,FIELD)
    33  ... S TEXT=FNUM_$L(IENS,",")_FIELD_DATA
    34  ... S CS=$$CRC32^XLFCRC(TEXT,CS)
    35  ... I DATA["WP-start" F IND=1:1:$P(DATA,"~",2) D
    36  .... S TEXT=DIQOUT(FNUM,IENS,FIELD,IND)
    37  .... S CS=$$CRC32^XLFCRC(TEXT,CS)
    38  Q CS
    39  ;
     1PXRMEXCS ; SLC/PKR - Routines to compute checksums. ;12/21/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    403 ;====================================================
    414FILE(FILENUM,IEN) ;Return checksum for entry IEN in file FILENUM.
    42  N CS,DIQOUT,IENROOT,MSG
    43  D GETS^DIQ(FILENUM,IEN,"**","N","DIQOUT","MSG")
    44  ;Remove edit history from all reminder files.
    45  D RMEH^PXRMEXPU(FILENUM,.DIQOUT,1)
    46  ;Convert the iens to the FDA adding form.
    47  D CONTOFDA^PXRMEXPU(.DIQOUT,.IENROOT)
    48  S CS=$$DIQOUTCS(.DIQOUT)
     5 N CS,LC,REF,ROOT,TARGET
     6 D FILE^DID(FILENUM,"","GLOBAL NAME","TARGET")
     7 S ROOT=$$CREF^DILF(TARGET("GLOBAL NAME"))
     8 K ^TMP($J,"PXRMEXCS")
     9 M ^TMP($J,"PXRMEXCS")=@ROOT@(IEN)
     10 S REF="^TMP($J,""PXRMEXCS"")"
     11 S REF=$NA(@REF)
     12 S (CS,LC)=0
     13 F  S REF=$Q(@REF) Q:REF'["PXRMEXCS"  S LC=LC+1,CS=CS+$$LINECS(LC,@REF)
     14 K ^TMP($J,"PXRMEXCS")
    4915 Q CS
    5016 ;
     
    6531 N CS,IND,LINE
    6632 S (CS,IND)=0
    67  F  S IND=$O(@GBL@(IND)) Q:+IND=0  S LINE=@GBL@(IND),CS=$$CRC32^XLFCRC(LINE,CS)
     33 F  S IND=$O(@GBL@(IND)) Q:+IND=0  S LINE=@GBL@(IND),CS=CS+$$LINECS(IND,LINE)
     34 Q CS
     35 ;
     36 ;====================================================
     37LINECS(LINENUM,STRING) ;Return checksum of line number LINEUM whose contents
     38 ;is STRING.
     39 N CS,IND,LEN
     40 S CS=0
     41 S LEN=$L(STRING)
     42 F IND=1:1:LEN S CS=CS+($A(STRING,IND)*(LINENUM+IND))
    6843 Q CS
    6944 ;
     
    7348 S NLINES=+$P($G(^XMB(3.9,XMZ,2,0)),U,3)
    7449 S CS=0
    75  F IND=1:1:NLINES S LINE=$G(^XMB(3.9,XMZ,2,IND,0)),CS=$$CRC32^XLFCRC(LINE,CS)
    76  Q CS
    77  ;
    78  ;====================================================
    79 PFDACS(IEN,FDASTART,FDAEND) ;Return checksum for FDA array of packed
    80  ;reminder component.
    81  N CS,DATA,IENS,IND,JND,FIELD,FNUM,SFN,TARGET,TEMP,TEXT
    82  S TEMP=^PXD(811.8,IEN,100,FDASTART,0)
    83  S FNUM=$P(TEMP,";",1)
    84  D FIELD^DID(FNUM,"EDIT HISTORY","","SPECIFIER","TARGET")
    85  S SFN=+$G(TARGET("SPECIFIER"))
    86  S CS=0
    87  F IND=FDASTART:1:FDAEND D
    88  . S TEMP=^PXD(811.8,IEN,100,IND,0)
    89  . S DATA=$P(TEMP,"~",2,99)
    90  . S TEMP=$P(TEMP,"~",1)
    91  . S FNUM=$P(TEMP,";",1)
    92  . I FNUM=SFN Q
    93  . I FNUM="Exchange Stub" Q
    94  . S IENS=$P(TEMP,";",2)
    95  . S FIELD=$P(TEMP,";",3)
    96  . S TEXT=FNUM_$L(IENS,",")_FIELD_DATA
    97  . S CS=$$CRC32^XLFCRC(TEXT,CS)
    98  . I DATA["WP-start" F JND=1:1:$P(DATA,"~",2) D
    99  .. S IND=IND+1
    100  .. S TEXT=^PXD(811.8,IEN,100,IND,0)
    101  .. S CS=$$CRC32^XLFCRC(TEXT,CS)
     50 F IND=1:1:NLINES S LINE=$G(^XMB(3.9,XMZ,2,IND,0)),CS=CS+$$LINECS(IND,LINE)
    10251 Q CS
    10352 ;
     
    10554ROUTINE(RA) ;Return checksum for a routine loaded in array RA. RA has the
    10655 ;form created by ^%ZOSF("LOAD") i.e, RA(1,0) ... RA(N,0).
    107  N CS,IND,TEXT
     56 N CS,IND,LINE
    10857 S (CS,IND)=0
    109  ;Get rid of the build number on the second line.
    110  S RA(2,0)=$P(RA(2,0),";",1,6)
    111  F  S IND=$O(RA(IND)) Q:+IND=0  D
    112  . S TEXT=RA(IND,0)
    113  . S CS=$$CRC32^XLFCRC(RA(IND,0),CS)
     58 F  S IND=$O(RA(IND)) Q:+IND=0  S CS=CS+$$LINECS(IND,RA(IND,0))
    11459 Q CS
    11560 ;
    11661 ;====================================================
    117 RTNCS(ROUTINE) ;Return checksum for a routine ROUTINE.
     62RTN(ROUTINE) ;Return checksum for a routine ROUTINE.
    11863 N CS,DIF,RA,X,XCNP
    11964 S XCNP=0
     
    12873 Q CS
    12974 ;
    130  ;====================================================
    131 PRTNCS(IEN,START,END) ;Return checksum for a packed routine.
    132  N CS,IND,SL,TEXT
    133  S CS=0,SL=START+1
    134  F IND=START:1:END D
    135  . S TEXT=^PXD(811.8,IEN,100,IND,0)
    136  . ;Get rid of the build number on the second line.
    137  . I IND=SL S TEXT=$P(TEXT,";",1,6)
    138  . S CS=$$CRC32^XLFCRC(TEXT,CS)
    139  Q CS
    140  ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXDG.m

    r628 r636  
    1 PXRMEXDG ;SLC/PJH - Reminder Dialog Exchange index build ;05/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXDG ;SLC/PJH - Reminder Dialog Exchange index build ;02/25/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;=====================================================================
    5 DIALOG(RIEN,DLIST,FLIST,OLIST,TLIST,SPONLIST) ;
     5DIALOG(RIEN,DLIST,FLIST,OLIST,TLIST) ;
    66 ;
    77 ;Routine to get dialog details for a given reminder
     
    2727 S DCNT=0,FCNT=0,RCNT=0,TCNT=0
    2828 ;Get details
    29  D GETSPON^PXRMEXPR(801.41,DIEN,.SPONLIST)
    30  D DGET(DIEN,.SPONLIST)
     29 D DGET(DIEN)
    3130 ;
    3231 ;Now build the dialog list (components first)
     
    4140 N CNT,COUNT,DTYP
    4241 S COUNT=0
    43  F DTYP="RESULT ELEMENT" D
    44  .S CNT=0 F  S CNT=$O(TEMP(DTYP,CNT)) Q:CNT'>0  D
    45  ..S DIEN=$G(TEMP(DTYP,CNT)) Q:DIEN'>0
    46  ..S COUNT=COUNT+1,DLIST("DIALOG",COUNT,DIEN)=""
    47  ;
    48  F DTYP="RESULT" D
    49  .S CNT=0 F  S CNT=$O(TEMP(DTYP,CNT)) Q:CNT'>0  D
    50  ..S DIEN=$G(TEMP(DTYP,CNT)) Q:DIEN'>0
    51  ..S COUNT=COUNT+1,DLIST("DIALOG",COUNT,DIEN)=""
    52  ;
    53  ;F DTYP="RESULT","DIALOG" D
    54  F DTYP="DIALOG" D
     42 F DTYP="RESULT","DIALOG" D
    5543 .F CNT=1:1 S DIEN=$G(TEMP(DTYP,CNT)) Q:'DIEN  D
    5644 ..S COUNT=COUNT+1,DLIST("DIALOG",COUNT,DIEN)=""
     
    9179 ;Get the dialog components
    9280 ;-------------------------
    93 DGET(D0,SPONLIST) ;Save dialog ien
     81DGET(D0) ;Save dialog ien
    9482 N D1
    9583 I $G(D0)=83
    9684 I $G(^PXRMD(801.41,D0,49))'="",$P(^PXRMD(801.41,D0,49),U,3)>0 D
    97  .S D1=$P($G(^PXRMD(801.41,D0,49)),U,3) D DGET1(D0,.SPONLIST) D DGET1(D1,.SPONLIST)
    98  E  D DGET1(D0,.SPONLIST)
    99  Q
    100 DGET1(D0,SPONLIST) ;
     85 .S D1=$P($G(^PXRMD(801.41,D0,49)),U,3) D DGET1(D0) D DGET1(D1)
     86 E  D DGET1(D0)
     87 Q
     88DGET1(D0) ;
    10189 S DCNT=DCNT+1,DARRAY(DCNT)=D0
    10290 ;And details (except for reminder dialog)
    10391 I DCNT>1 D
    104  .D GETSPON^PXRMEXPR(801.41,D0,.SPONLIST)
    10592 .;Finding items
    10693 .D DFIND(D0)
     
    119106 .S DDATA=$G(^PXRMD(801.41,DCOMP,0)) Q:DDATA=""
    120107 .;Exclude national PXRM prompts
    121  .I +$G(PXRMINST)=0,$E(DDATA,1,4)="PXRM",$P($G(^PXRMD(801.41,DCOMP,100)),U)="N" Q
     108 .I $E(DDATA,1,4)="PXRM",$P($G(^PXRMD(801.41,DCOMP,100)),U)="N" Q
    122109 .;Sub-components
    123  .D DGET(DCOMP,.SPONLIST)
     110 .D DGET(DCOMP)
    124111 .;I $G(DCOMP1)'="" D DGET(DCOMP1) S DCOMP1=""
    125112 Q
     
    175162 ;---------------------------
    176163DRESULT(DIEN) ;
    177  N CNT,RIEN,RECNT,RGCNT
     164 N RIEN
    178165 ;Result Group/Element pointer
    179  S RECNT=$O(TEMP("RESULT ELEMENT",""),-1)
    180  S RGCNT=$O(TEMP("RESULT",""),-1)
    181  S CNT=0
    182  F  S CNT=$O(^PXRMD(801.41,DIEN,51,CNT)) Q:CNT'>0  D
    183  .S RIEN=$P($G(^PXRMD(801.41,DIEN,51,CNT,0)),U) Q:RIEN'>0
    184  .;S RIEN=$P($G(^PXRMD(801.41,DIEN,0)),U,15) Q:'RIEN  Q:$D(RESULT(RIEN))
    185  .;Result group compoments
    186  .N DSUB,REIEN
    187  .S DSUB=0
    188  .F  S DSUB=$O(^PXRMD(801.41,RIEN,10,DSUB)) Q:'DSUB  D
    189  ..;Get result element
    190  ..S REIEN=$P($G(^PXRMD(801.41,RIEN,10,DSUB,0)),U,2) Q:'REIEN
    191  ..Q:'$D(^PXRMD(801.41,REIEN,0))
    192  ..;If element exists get save it
    193  ..S RECNT=RECNT+1,TEMP("RESULT ELEMENT",RECNT)=REIEN
    194  ..;S RCNT=RCNT+1,OUTPUT("RESULT",RCNT)=REIEN
    195  .;
    196  .;Save result group
    197  .S RGCNT=RGCNT+1,TEMP("RESULT",RGCNT)=RIEN
    198  .;S RCNT=RCNT+1,RESULT(RIEN)="",TEMP("RESULT",RCNT)=RIEN
     166 S RIEN=$P($G(^PXRMD(801.41,DIEN,0)),U,15) Q:'RIEN  Q:$D(RESULT(RIEN))
     167 ;Result group compoments
     168 N DSUB,REIEN
     169 S DSUB=0
     170 F  S DSUB=$O(^PXRMD(801.41,RIEN,10,DSUB)) Q:'DSUB  D
     171 .;Get result element
     172 .S REIEN=$P($G(^PXRMD(801.41,RIEN,10,DSUB,0)),U,2) Q:'REIEN
     173 .Q:'$D(^PXRMD(801.41,REIEN,0))
     174 .;If element exists get save it
     175 .S RCNT=RCNT+1,OUTPUT("RESULT",RCNT)=REIEN
     176 ;
     177 ;Save result group
     178 S RCNT=RCNT+1,RESULT(RIEN)="",TEMP("RESULT",RCNT)=RIEN
    199179 Q
    200180 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXFI.m

    r628 r636  
    1 PXRMEXFI ; SLC/PKR/PJH - Exchange utilities for file entries.;07/05/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXFI ; SLC/PKR/PJH - Exchange utilities for file entries.;12/21/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;==============================================
    44DELALL(FILENUM,NAME) ;Delete all file entries named NAME.
     
    1717 S DIK=$$ROOT^DILFD(FILENUM)
    1818 D ^DIK
    19  Q
    20  ;
    21  ;==============================================
    22 FEIMSG(SAME,ATTR) ;Output the general file exits install message.
    23  N IND,NOUT,TEXT,TEXTO
    24  S TEXT(1)=ATTR("FILE NAME")_" entry named "_ATTR("NAME")_" already exists"
    25  I SAME D
    26  . S TEXT(2)="and the packed component is identical, skipping."
    27  . S TEXT(3)=" "
    28  . D FORMAT^PXRMTEXT(1,70,3,.TEXT,.NOUT,.TEXTO)
    29  . F IND=1:1:NOUT W !,TEXTO(IND)
    30  . H 2
    31  I 'SAME D
    32  . S TEXT(2)="but the packed component is different, what do you want to do?"
    33  . D FORMAT^PXRMTEXT(1,70,2,.TEXT,.NOUT,.TEXTO)
    34  . F IND=1:1:NOUT W !,TEXTO(IND)
    3519 Q
    3620 ;
     
    7357 ;Mental Health Instruments not allowed.
    7458 I FILENUM=601 Q 0
    75  I FILENUM=601.71 Q 0
    7659 ;
    7760 I FILENUM=790.404 Q 0
     
    8164 ;
    8265 ;==============================================
    83 GETFACT(PT01,ATTR,NEWPT01,NAMECHG,IEN) ;Get the action for a file.
    84  N ACTION,CHOICES,CSUM,DIR,FILENUM,MSG,RESULT
    85  N SAME,X,Y
     66GETFACT(PT01,ATTR,NEWPT01,NAMECHG,EXISTS) ;Get the action for a file.
     67 N ACTION,CHOICES,DIR,FILENUM,MSG,RESULT,X,Y
    8668 ;See if this entry is already defined.
    8769CHK ;
    8870 S NEWPT01=""
     71 S (ATTR("NAME"),ATTR("PT01"))=PT01
    8972 S FILENUM=ATTR("FILE NUMBER")
    90  I IEN="" S IEN=$$EXISTS^PXRMEXIU(FILENUM,PT01)
    91  I IEN D
    92  .;If the entry already exists compare the existing entry checksum
    93  .;with the packed entry checksum.
    94  . S CSUM=$$FILE^PXRMEXCS(ATTR("FILE NUMBER"),IEN)
    95  . S SAME=$S(ATTR("CHECKSUM")=CSUM:1,1:0)
    96  . D FEIMSG(SAME,.ATTR)
    97  . I SAME S ACTION="S"
    98  . I 'SAME D
    99  .. S CHOICES=$S(FILENUM=801.41:"CMOQS",FILENUM=811.5:"CMOQS",1:"COQS")
    100  .. S DIR("B")="O"
    101  .. S ACTION=$$GETACT^PXRMEXIU(CHOICES,.DIR)
     73 I EXISTS="" S EXISTS=$$EXISTS^PXRMEXIU(FILENUM,PT01)
     74 ;Check for identical file entry can be made here.
     75 I EXISTS D
     76 . W !!,ATTR("FILE NAME")," entry ",PT01," already EXISTS,"
     77 . W !,"what do you want to do?"
     78 . S CHOICES=$S(FILENUM=801.41:"CMOQS",FILENUM=811.5:"CMOQS",1:"COQS")
     79 . S DIR("B")="S"
     80 . S ACTION=$$GETACT^PXRMEXIU(CHOICES,.DIR)
    10281 E  D
    10382 . W !!,ATTR("FILE NAME")," entry ",PT01," is NEW,"
     
    142121 ;
    143122 ;==============================================
    144 SETATTR(ATTR,FILE,PT01) ;Set the file attributes for the file FILE.
     123SETATTR(ATTR,FILE) ;Set the file attributes for the file FILE.
    145124 N MSG
    146125 S ATTR("FILE NUMBER")=FILE
     
    149128 D FIELD^DID(FILE,.01,"","FIELD LENGTH","ATTR","MSG")
    150129 S ATTR("MIN FIELD LENGTH")=3
    151  S (ATTR("NAME"),ATTR("PT01"))=PT01
    152130 Q
    153131 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXID.m

    r628 r636  
    1 PXRMEXID ;SLC/PJH - Reminder Dialog Exchange Install Routine.;08/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXID ;SLC/PJH - Reminder Dialog Exchange Install Routine.;11/14/2003
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;==================================================
     
    77 ;------------------------------------------------
    88INSALL N ALL,DIROUT,DIRUT,DTOUT,DUOUT,IND,PXRMDONE
     9 K ^TMP("PXRMEXIA",$J)
    910 ;
    1011 ;Set the install date and time.
    11  S IND="",PXRMDONE=0
     12 S IND="",PXRMDONE=0,^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT
    1213 ;
    1314 ;Go to full screen mode.
     
    1819 S DNAME=$G(^TMP("PXRMEXTMP",$J,"PXRMDNAM"))
    1920 D EXIST^PXRMEXIX(.ALL,DNAME,"reminder dialog","")
    20  I ALL=0 D DISP^PXRMEXLD(PXRMMODE) Q
    2121 ;
    2222 ;Lock the entire file
    2323 Q:'$$LOCK
    24  F  S IND=$O(^TMP("PXRMEXLD",$J,"SEL",IND),-1) Q:(IND="")!(PXRMDONE)  D
     24 ;
     25 ;Install all components
     26 F  S IND=$O(^TMP("PXRMEXLD",$J,"SEL",IND),-1) Q:(+IND=0)!(PXRMDONE)  D
    2527 .D INSCOM(IND,1)
    2628 ;
     
    4143 F  S ISEQ=$O(^TMP("PXRMEXTMP",$J,"DMAP",NAME,ISEQ)) Q:'ISEQ  D
    4244 .S IDATA=$G(^TMP("PXRMEXTMP",$J,"DMAP",NAME,ISEQ)) Q:IDATA=""
    43  .S DNAME=$P(IDATA,U) Q:DNAME=""
    44  .;
    45  .I $D(^TMP("PXRMEXTMP",$J,"DREPL"))>0 D
    46  ..S REPL=$$CHKREPL^PXRMEXD1(NAME) I REPL>0 D INSREPL(NAME,REPL,.INAME)
    47  .S INAME(DNAME)=""
    48  .;Q:$$PXRM(DNAME)  S INAME(DNAME)=""
     45 .S DNAME=$P(IDATA,U) Q:DNAME=""  Q:$$PXRM(DNAME)  S INAME(DNAME)=""
    4946 .;Check for descendants
    5047 .I $D(^TMP("PXRMEXTMP",$J,"DMAP",DNAME)) D INSBLD(DNAME,.INAME)
    51  Q
    52  ;Build list of replacement names
    53  ;-------------------------------
    54 INSREPL(NAME,REPL,INAME) ;
    55  N DNAME,IDATA,ISEQ
    56  S ISEQ=0
    57  S IDATA=$G(^TMP("PXRMEXTMP",$J,"DREPL",REPL,NAME)) Q:IDATA=""
    58  S DNAME=$P(IDATA,U) Q:DNAME=""  S INAME(DNAME)=""
    59  ;S DNAME=$P(IDATA,U) Q:DNAME=""  Q:$$PXRM(DNAME)  S INAME(DNAME)=""
    60  ;Check for descendants
    61  I $D(^TMP("PXRMEXTMP",$J,"DMAP",DNAME)) D INSBLD(DNAME,.INAME)
    6248 Q
    6349 ;
     
    6551 ;---------------------
    6652INSCOM(IND,SILENT) ;
    67  N ACTION,ATTR,CSUM,DTYP,EXIEN,END,EXISTS,FILENUM,IND120,JND120
    68  N NEWPT01,PT01,START,REPL,SAME,TEMP
     53 N ACTION,ATTR,DTYP,EXIEN,END,EXISTS,FILENUM,IND120,JND120
     54 N NEWPT01,PT01,START,TEMP
    6955 S TEMP=^TMP("PXRMEXLD",$J,"SEL",IND),FILENUM=$P(TEMP,U,1)
    7056 S EXISTS=$P(TEMP,U,4),START=$P(TEMP,U,2),END=$P(TEMP,U,3) Q:START=""
     
    7965 ;
    8066 ;Check for descendents
    81  S REPL=$$CHKREPL^PXRMEXD1(PT01)
    82  I 'SILENT&($$INSDSC(PT01)!(REPL>0)) D  Q:PXRMDONE
     67 I 'SILENT,$$INSDSC(PT01) D  Q:PXRMDONE
    8368 .N ANS,INDS,TEXT
    8469 .S TEXT(1)=PT01_" ("_DTYP_") contains sub-components."
     
    8671 .;Give option to install all descendents
    8772 .D ASK^PXRMEXIX(.ANS,.TEXT,1) Q:PXRMDONE
    88  .I $G(ANS)="N" S PXRMDONE=1 Q
    8973 .I $G(ANS)="Y" D
    9074 ..S INDS=IND
    9175 ..N IDATA,INAME,IND
    92  ..I REPL>0 D INSREPL(PT01,REPL,.INAME)
    9376 ..;Build list of decendents to install
    9477 ..D INSBLD(PT01,.INAME)
     
    10689 ...I $D(INAME(PT01)) D INSCOM(IND,1)
    10790 ;
    108 SETENTRY ;
    109  D SETATTR^PXRMEXFI(.ATTR,FILENUM,PT01)
    110  S ACTION=""
     91 D SETATTR^PXRMEXFI(.ATTR,FILENUM)
    11192 ;Double check that it hasn't been installed
    11293 S EXIEN=$$EXISTS^PXRMEXIU(801.41,PT01)
    11394 I EXIEN,'EXISTS S EXISTS=1
    114  I EXISTS D
    115  . D CHECKSUM^PXRMEXCS(.ATTR,START,END)
    116  . S CSUM=$$FILE^PXRMEXCS(ATTR("FILE NUMBER"),EXIEN)
    117  . S SAME=$S(ATTR("CHECKSUM")=CSUM:1,1:0)
    118  . I SAME D FEIMSG^PXRMEXFI(SAME,.ATTR) S ACTION="S",(PXRMNMCH,NEWPT01)=""
    119  I ACTION="" D
    120  .;If all components installed the default is 'Install or Overwrite'
    121  . S:ALL ACTION=$S(EXISTS:"O",1:"I"),(PXRMNMCH,NEWPT01)=""
    122  . S:'ALL ACTION=$$GETFACT^PXRMEXFI(PT01,.ATTR,.NEWPT01,.PXRMNMCH,EXIEN)
     95 ;If all components installed the default is 'Install or Overwrite'
     96 S:ALL ACTION=$S(EXISTS:"O",1:"I"),(ATTR("NAME"),ATTR("PT01"))=PT01,PXRMNMCH="",NEWPT01=""
     97 S:'ALL ACTION=$$GETFACT^PXRMEXFI(PT01,.ATTR,.NEWPT01,.PXRMNMCH,EXISTS)
    12398 ;Save what was done for the installation summary.
    124  S ^TMP("PXRMEXIAD",$J,IND,ATTR("FILE NAME"),ATTR("PT01"),ACTION)=NEWPT01
     99 S ^TMP("PXRMEXIA",$J,IND,ATTR("FILE NAME"),ATTR("PT01"),ACTION)=NEWPT01
    125100 ;Clear heading
    126101 S VALMHDR(2)=""
     
    152127 F  S SUB=$O(^TMP("PXRMEXTMP",$J,"DMAP",NAME,SUB)) Q:'SUB  D  Q:DFOUND
    153128 .S DATA=$G(^TMP("PXRMEXTMP",$J,"DMAP",NAME,SUB)) Q:DATA=""
    154  .S DFOUND=1
    155  .;I '$$PXRM($P(DATA,U)) S DFOUND=1
     129 .I '$$PXRM($P(DATA,U)) S DFOUND=1
    156130 Q DFOUND
    157131 ;
    158 INSREPL1(NAME) ;
    159  N DATA,DFOUND,SUB
    160  S DFOUND=0,SUB=0
    161  F  S SUB=$O(^TMP("PXRMEXTMP",$J,"DREPL",NAME,SUB)) Q:'SUB  D  Q:DFOUND
    162  .S DATA=$G(^TMP("PXRMEXTMP",$J,"DREPL",NAME,SUB)) Q:DATA=""
    163  .S DFOUND=1
    164  Q DFOUND
    165132 ;Option to link dialog to a reminder
    166133 ;-----------------------------------
     
    223190 D EN^VALM2(XQORNOD(0))
    224191 ;
     192 K ^TMP("PXRMEXIA",$J)
    225193 ;Set the install date and time.
    226  S ALL="",PXRMDONE=0
     194 S ALL="",PXRMDONE=0,^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT
    227195 ;
    228196 ;Lock the entire file
     
    230198 ;
    231199 S IND=0
    232  F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D INSCOM(IND,0)
     200 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
     201 .D INSCOM(IND,0)
    233202 ;
    234203 ;Clear locks
     
    255224 ;Ignore non-PXRM
    256225 I $E(NAME,1,4)'="PXRM" Q 0
    257  N DIEN,RESULT
    258  I $G(PXRMINST)=1 D  Q RESULT
    259  .S RESULT=0
    260  .S DIEN=$O(^PXRMD(801.41,"B",NAME,"")) I 'DIEN Q
    261  .I $P($G(^PXRMD(801.41,DIEN,100)),U)'="N" Q
    262  .I ($P($G(^PXRMD(801.41,DIEN,0)),U,4)="P")!($P($G(^PXRMD(801.41,DIEN,0)),U,4)="F") S RESULT=1
    263226 ;
    264227 ;Check if this is a national code
     228 N DIEN
    265229 S DIEN=$O(^PXRMD(801.41,"B",NAME,""))
    266230 ;If not found abort
    267231 I 'DIEN Q 0
    268  ;if result group/element quit
    269  I $P($G(^PXRMD(801.41,DIEN,0)),U,4)="S"!($P($G(^PXRMD(801.41,DIEN,0)),U,4)="T") Q 0
    270232 ;Check class
    271233 I $P($G(^PXRMD(801.41,DIEN,100)),U)="N" Q 1
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXIU.m

    r628 r636  
    1 PXRMEXIU ; SLC/PKR/PJH - Utilities for installing repository entries. ;07/27/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMEXIU ; SLC/PKR/PJH - Utilities for installing repository entries. ;06/23/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;===============================================
    44DEF(FDA,NAMECHG) ;Check the reminder definition to make sure the related
     
    4747 ;
    4848 ;Linked reminder dialog field 51.
    49  S LRD=$G(FDA(811.9,IENS,51))
    50  S IEN=$S(LRD="":0,1:+$O(^PXRMD(801.41,"B",LRD,"")))
     49 S LRD=+$G(FDA(811.9,IENS,51))
     50 S IEN=$$EXISTS^PXRMEXIU(801.41,LRD)
    5151 I IEN=0 K FDA(811.9,IENS,51)
    5252 ;
     
    198198 ;
    199199 ;===============================================
     200SAME(ATTR,TA,NAME) ;Check existing entry and entry in packed reminder
     201 ;definition to see if they are identical.
     202 ;Present version only works for computed finding routines, other
     203 ;types of entries can be added later.
     204 N SAME
     205 I ATTR("FILE NAME")="COMPUTED FINDING ROUTINE" S SAME=$$SAME^PXRMEXCF(.ATTR,.TA,NAME)
     206 E  S SAME=1
     207 Q SAME
     208 ;
     209 ;===============================================
    200210TERM(FDA,NAMECHG) ;Check the reminder term to make sure all the
    201211 ;findings exist.
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXIX.m

    r628 r636  
    1 PXRMEXIX ;SLC/PJH - Reminder Dialog Exchange checks. ;10/10/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXIX ;SLC/PJH - Reminder Dialog Exchange checks. ;12/22/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;=====================================================================
     
    8484 ...S CNT=CNT+1,FIRST=0,TEXT(CNT)=DNAME_" ("_DTYP_")"
    8585 ..S CNT=CNT+1,TEXT(CNT)=""
    86  S TEXT="Install "_DTYP_" and all components with no further changes: "
     86 S TEXT="Install "_DTYP_" and all components with no further changes:"
    8787 ;Give option to install all descendents
    8888 D ASK(.ANS,.TEXT,2) I $G(ANS)="Y" S ALL=1
    89  I $G(ANS)="N" S ALL=0
    9089 Q
    9190 ;
     
    115114 ;
    116115 I CALL=1 D
    117  .S HTEXT(1)="Enter 'Yes' to install all sub-components or"
     116 .S HTEXT(1)="Enter 'Yes' to if you are installing all sub-components or"
    118117 .S HTEXT(2)="enter 'No' to install only the selected dialog."
    119118 I CALL=2 D
    120  .S HTEXT(1)="Enter 'Yes' to install without changes."
    121  .S HTEXT(2)="Enter 'No' to install with changes."
     119 .S HTEXT(1)="Enter 'Yes' to if you are installing without changes."
     120 .S HTEXT(2)="enter 'No' to install with changes."
    122121 I CALL=3 D
    123122 .S HTEXT(1)="Select IFE to INSTALL reminder or dialog from this exchange"
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXLB.m

    r628 r636  
    1 PXRMEXLB ;SLC/PJH - Reminder Dialog Exchange. ;05/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXLB ;SLC/PJH - Reminder Dialog Exchange. ;07/01/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;=====================================================================
     
    77 ;-------------------------------
    88DBUILD(IND,NITEMS,FILENUM) ;
    9  N DARRAY,DDATA,DDLG,DEND,DLOC,DMAP,DNAM,DNODE,DSEQ,DSTRT,DSUB,FILE,JND
    10  N REPCNT,RESGRP,TEMPRESL,CNT
     9 N DARRAY,DDATA,DDLG,DEND,DLOC,DMAP,DNAM,DNODE,DSEQ,DSTRT,DSUB,JND
    1110 ;
    1211 K ^TMP("PXRMEXTMP",$J),^TMP("PXRMEXFND",$J)
     
    2019 .D DPARSE
    2120 ;Scan dialog components in 120 and save dialog links
    22  S JND="B",REPCNT=0
     21 S JND="B"
    2322 F  S JND=$O(^PXD(811.8,IEN,120,IND,1,JND),-1) Q:'JND  D
    2423 .S DDATA=$G(^PXD(811.8,IEN,120,IND,1,JND,0)) Q:DDATA=""
     
    3130 .F  S DSUB=$O(^PXD(811.8,IEN,100,DSUB)) Q:DSUB>DEND  D
    3231 ..S DNODE=$G(^PXD(811.8,IEN,100,DSUB,0))
    33  ..I ($P(DNODE,";")'="801.412")&($P(DNODE,";")'="801.41121")&($P(DNODE,";",3)'["118~") Q
    34  ..S FILE=$P(DNODE,";")
     32 ..I $P(DNODE,";")'="801.412"&($P(DNODE,";",3)'["118~") Q
    3533 ..S DNODE=$P(DNODE,";",3)
    3634 ..;;Modified Exchange to handle dialogs with replacement dialogs
     
    3836 ...S DNAM=$P(DNODE,"~",2) Q:DNAM=""
    3937 ...S DLOC=$G(^TMP("PXRMEXTMP",$J,"DLOC",DNAM))
    40  ...S REPCNT=REPCNT+1,^TMP("PXRMEXTMP",$J,"DREPL",REPCNT,DDLG)=DNAM_U_DLOC
     38 ...S ^TMP("PXRMEXTMP",$J,"DREPL",DDLG)=DNAM_U_DLOC
    4139 ..I $E(DNODE,1,4)'=".01~" Q
    4240 ..S DSEQ=$P(DNODE,"~",2) Q:DSEQ=""
    43  ..I FILE="801.41121" D  Q
    44  ...S DNAM=$P(DNODE,"~",2) Q:DNAM=""
    45  ...S DLOC=$G(^TMP("PXRMEXTMP",$J,"DLOC",DNAM))
    46  ...S CNT=0
    47  ...I $D(^TMP("PXRMEXTMP",$J,"DMAP",DDLG))>0 S CNT=$O(^TMP("PXRMEXTMP",$J,"DMAP",DDLG,""),-1)
    48  ...S ^TMP("PXRMEXTMP",$J,"DMAP",DDLG,CNT+1)=DNAM_U_DLOC
    49  ..S DNODE=$G(^PXD(811.8,IEN,100,DSUB+1,0))
    50  ..I ($P(DNODE,";")'="801.412") Q
     41 ..S DNODE=$G(^PXD(811.8,IEN,100,DSUB+1,0)) I $P(DNODE,";")'="801.412" Q
    5142 ..S DNODE=$P(DNODE,";",3) I $E(DNODE,1,2)'="2~" Q
    5243 ..S DNAM=$P(DNODE,"~",2) Q:DNAM=""
     
    5546 ;
    5647 ;Build index of dialog findings by name
     48 ;
     49 ;
    5750 N FDATA,FILENAM,FILENUM,FNAME
    5851 S IND=0
     
    7164 ..;Save entry
    7265 ..S ^TMP("PXRMEXFND",$J,FNAME)=FILENUM_U_FILENAM_U_IND
    73  I $D(TEMPRESL)>0 D
    74  .S DDLG="" F  S DDLG=$O(TEMPRESL(DDLG)) Q:DDLG=""  D
    75  ..;S ^TMP("PXRMEXTMP",$J,"RESULT",DDLG,TEMPRESL(DDLG))=""
    76  ..S DSEQ=$O(^TMP("PXRMEXTMP",$J,"DMAP",DDLG,""),-1)
    77  ..S ^TMP("PXRMEXTMP",$J,"DMAP",DDLG,DSEQ+1)=TEMPRESL(DDLG)_U_RESGRP(TEMPRESL(DDLG))
    7866 Q
    7967 ;
     
    8371 ;
    8472 ;Find where all the field numbers are kept
    85  N DARRAY,DDATA,DFNUM,DRAW,DSTRING,RESNAM
    86  S DSUB=DSTRT-1,DSTRING=";.01;4;5;15;24;25;55;"
    87  ;S DSUB=DSTRT,DSTRING=";4;5;15;24;25;"
     73 N DARRAY,DDATA,DFNUM,DRAW,DSTRING
     74 S DSUB=DSTRT,DSTRING=";4;5;15;24;25;"
    8875 F  S DSUB=$O(^PXD(811.8,IEN,100,DSUB)) Q:'DSUB  D  Q:DSUB>DEND
    8976 .S DDATA=$G(^PXD(811.8,IEN,100,DSUB,0)) Q:DDATA=""
     
    9178 .S DFNUM=$P(DDATA,";",3),DFNUM=$P(DFNUM,"~") Q:DFNUM=""
    9279 .I DSTRING[(";"_DFNUM_";") S DARRAY(DFNUM)=DSUB
    93  .I $P(DDATA,";")="801.41121" S DARRAY(55)=DSUB
    9480 ;
    9581 ;Determine dialog component type
    9682 S DSUB=DARRAY(4) Q:'DSUB
    9783 S DTYP=$P($G(^PXD(811.8,IEN,100,DSUB,0)),"~",2)
    98  I DTYP'["result" S:DTYP[" " DTYP=$P(DTYP," ",2) S:DTYP="value" DTYP="forced"
     84 S:DTYP[" " DTYP=$P(DTYP," ",2) S:DTYP="value" DTYP="forced"
    9985 ;
    10086 ;Initialise text and finding fields
    10187 S DTXT="*NONE*",DFIND=""
    10288 ;Get text appropriate for the type of component
    103  I ((DTYP="element")!(DTYP="group"))&(DTYP'["result") D
     89 I (DTYP="element")!(DTYP="group") D
    10490 .;search for WP text
    10591 .S DSUB=$G(DARRAY(25)) D:DSUB
     
    115101 ..;Reformat text to 50 characters
    116102 ..D DWP(.DTXT)
    117  ..;Search for Result Group/Element
    118  ..S DSUB=$G(DARRAY(55)) I DSUB>0 D
    119  ...S RESNAME=$P($P($G(^PXD(811.8,IEN,100,DSUB,0)),";",3),"~",2)
    120  ...S TEMPRESL(DNAM)=RESNAME
     103 .;
    121104 .;Search for finding item
    122105 .S DSUB=$G(DARRAY(15)) D:DSUB
     
    136119 ...I $P(DFNAM,".")="ICD9" S DFNAM=$P(DFNAM," ")
    137120 ...S DCNT=DCNT+1,DFIAD(DCNT)=DFNAM
    138  ;
    139  I DTYP["result" D
    140  .S DSUB=$G(DARRAY(.01)) Q:'DSUB
    141  .S DTEXT=$P($G(^PXD(811.8,IEN,100,DSUB,0)),";",3) Q:DTEXT=""
    142  .S DTXT=$P(DTEXT,"~",2)
    143  .S RESGRP(DNAM)=DSTRT_U_DEND_U_IND_U_JND
    144121 ;
    145122 I DTYP="prompt" D
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXLC.m

    r628 r636  
    1 PXRMEXLC ; SLC/PKR/PJH - Routines to display repository entry components. ;08/03/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMEXLC ; SLC/PKR/PJH - Routines to display repository entry components. ;06/22/2004
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;======================================================
    44BLDLIST(FORCE) ;Build a list of all repository entries.
     
    77 I $D(^TMP("PXRMEXLR",$J,"VALMCNT")) S VALMCNT=^TMP("PXRMEXLR",$J,"VALMCNT")
    88 E  D
    9  . D REXL^PXRMLIST("PXRMEXLR")
    10  . S VALMCNT=^TMP("PXRMEXLR",$J,"VALMCNT")
     9 . N IEN,RELIST
     10 . D RE^PXRMLIST(.RELIST,.IEN)
     11 . M ^TMP("PXRMEXLR",$J)=RELIST
     12 . S VALMCNT=RELIST("VALMCNT")
     13 . F IND=1:1:VALMCNT S ^TMP("PXRMEXLR",$J,"IDX",IND,IND)=IEN(IND)
    1114 Q
    1215 ;
     
    7679 ;
    7780 ;======================================================
     81DDISP(IND,NITEMS,FILENUM) ;Setup dialog display list.
     82 N JND,NLINE,NSEL,TEMP
     83 S (NLINE,NSEL)=0
     84 F JND=1:1:NITEMS D
     85 . S TEMP=^PXD(811.8,IEN,120,IND,1,JND,0)
     86 . S PT01=$P(TEMP,U,1)
     87 . S EXISTS=$$EXISTS^PXRMEXIU(FILENUM,PT01,"W")
     88 . S NLINE=NLINE+1
     89 . S NSEL=NSEL+1
     90 . S ^TMP("PXRMEXLD",$J,NLINE,0)=$$FMTDATA(NSEL,PT01,CAT,EXISTS)
     91 . S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     92 .;Store the file number, start and stop line in the repository.
     93 . S ^TMP("PXRMEXLD",$J,"SEL",NSEL)=FILENUM_U_$P(TEMP,U,2,3)
     94 Q
     95 ;
     96 ;======================================================
    7897FMTDATA(NSEL,PT01,CAT,EXISTS) ;Format items for display.
    7998 N NSTI,TEMP
     
    88107 ;
    89108 ;======================================================
     109HISTLIST(LIST,VALMCNT) ;Build a list of install histories in
     110 ;^TMP("PXRMEXIH",$J).
     111 N DATE,DC,ENTRY,IHIND,IND,INDONE,NLINE,NSEL,RIEN,SOURCE,TEMP,USER
     112 K ^TMP("PXRMEXIH",$J)
     113 S (NLINE,NSEL)=0
     114 S IND=""
     115 F  S IND=$O(LIST(IND)) Q:IND=""  D
     116 . S RIEN=^TMP("PXRMEXLR",$J,"IDX",IND,IND)
     117 . I $D(^PXD(811.8,RIEN,130)) S INDONE=1
     118 . E  S INDONE=0
     119 . S TEMP=^PXD(811.8,RIEN,0)
     120 . S ENTRY=$P(TEMP,U,1)
     121 . S SOURCE=$P(TEMP,U,2)
     122 . S DATE=$P(TEMP,U,3)
     123 . S NLINE=NLINE+1
     124 . I INDONE S NSEL=NSEL+1
     125 . S ^TMP("PXRMEXIH",$J,NLINE,0)=$$FRE^PXRMLIST(" ",ENTRY,SOURCE,DATE)
     126 . I INDONE S ^TMP("PXRMEXIH",$J,"IDX",NLINE,NSEL)=""
     127 . S NLINE=NLINE+1
     128 . S ^TMP("PXRMEXIH",$J,NLINE,0)="     Installation Date       Installed By"
     129 . I INDONE S ^TMP("PXRMEXIH",$J,"IDX",NLINE,NSEL)=""
     130 . S NLINE=NLINE+1
     131 . S ^TMP("PXRMEXIH",$J,NLINE,0)="     -----------------       ------------"
     132 . I INDONE S ^TMP("PXRMEXIH",$J,"IDX",NLINE,NSEL)=""
     133 . I 'INDONE D  Q
     134 .. S NLINE=NLINE+1
     135 .. S ^TMP("PXRMEXIH",$J,NLINE,0)="      none"
     136 .. S NLINE=NLINE+1
     137 .. S ^TMP("PXRMEXIH",$J,NLINE,0)=" "
     138 . S DATE="",DC=0
     139 . F  S DATE=$O(^PXD(811.8,RIEN,130,"B",DATE)) Q:DATE=""  D
     140 .. S NLINE=NLINE+1
     141 .. S DC=DC+1
     142 .. I DC>1 S NSEL=NSEL+1
     143 .. S IHIND=$O(^PXD(811.8,RIEN,130,"B",DATE,""))
     144 .. S TEMP=^PXD(811.8,RIEN,130,IHIND,0)
     145 .. S ^TMP("PXRMEXIH",$J,NLINE,0)=$$RJ^XLFSTR(NSEL,4," ")_" "_$$FMTE^XLFDT($P(TEMP,U,1),"5Z")_"   "_$P(TEMP,U,2)
     146 .. S ^TMP("PXRMEXIH",$J,"IDX",NLINE,NSEL)=""
     147 .. S ^TMP("PXRMEXIH",$J,"SEL",NSEL)=RIEN_U_IHIND
     148 . S NLINE=NLINE+1
     149 . S ^TMP("PXRMEXIH",$J,NLINE,0)=" "
     150 . S ^TMP("PXRMEXIH",$J,"IDX",NLINE,NSEL)=""
     151 S VALMCNT=NLINE
     152 Q
     153 ;
     154 ;======================================================
    90155INSCHR(NUM,CHR) ;Return a string of NUM characters (CHR).
    91156 N IND,TEMP
     
    96161 ;
    97162 ;======================================================
    98 ORDER(STRING,ORDER) ;Rebuild string in ascending or descending order.
    99  N ARRAY,ITEM,CNT
    100  F CNT=1:1 S ITEM=$P(STRING,",",CNT) Q:'ITEM  S ARRAY(ITEM)=""
    101  K STRING
    102  F CNT=1:1 S ITEM=$O(ARRAY(ITEM),ORDER) Q:'ITEM  D
    103  .S $P(STRING,",",CNT)=ITEM
     163DREPL ;
     164 N STR,I
     165 K PXRMEXOR
     166 S NLINE=NLINE+1,^TMP("PXRMEXLD",$J,NLINE,0)=$J("",79)
     167 S STR="" F I=1:1:30 S STR=STR_"-"
     168 S NLINE=NLINE+1,^TMP("PXRMEXLD",$J,NLINE,0)=$J(STR_" REPLACEMENT ITEMS "_STR,79)
     169DREPL1 ;
     170 M ^TMP($J,"PXRMEXREP")=PXRMEXRP
     171 K PXRMEXRP
     172 ;S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)="
     173 N CNT,DLG,DDATA,DDLG,DEND,DNAM,DREP,DSTRT,IND,JND,LEV,TEMP
     174 ;S LEV="" F  S LEV=$O(^TMP($J,"PXRMEXREP",LEV)) Q:LEV=""  D
     175 S LEV=0
     176 S DLG="" F  S DLG=$O(^TMP($J,"PXRMEXREP",DLG)) Q:DLG=""  D
     177 .S DDATA=$G(^TMP("PXRMEXTMP",$J,"DREPL",DLG)) Q:DDATA=""
     178 .S DNAM=$P(DDATA,U),DSTRT=$P(DDATA,U,2),DEND=$P(DDATA,U,3) Q:DNAM=""
     179 .I $D(PXRMEXOR(DNAM))>0 Q
     180 .S PXRMEXOR(DNAM)=""
     181 .S IND=$P(DDATA,U,4),JND=$P(DDATA,U,5)
     182 .;Check if this component has been replaced
     183 .S LEV=LEV+1
     184 .S DREP=$G(PXRMNMCH(FILENUM,DNAM)) I DREP=DNAM S DREP=""
     185 .;Save line in workfile
     186 .S NLINE=NLINE+1,^TMP("PXRMEXLD",$J,NLINE,0)=$J("",79)
     187 .S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     188 .D DLINE^PXRMEXLD(DNAM,LEV,"")
     189 .I $D(^TMP("PXRMEXTMP",$J,"DMAP",DNAM)) D DCMP^PXRMEXLD(DNAM,LEV)
     190 K ^TMP($J,"PXRMEXREP")
     191 I $D(PXRMEXRP)>0 D DREPL1
    104192 Q
    105  ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXLD.m

    r628 r636  
    1 PXRMEXLD ;SLC/PJH - Reminder Dialog Exchange Main Routine. ;08/07/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
    3  ;
     1PXRMEXLD ;SLC/PJH - Reminder Dialog Exchange Main Routine. ;7/01/2004
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
     3 ;
     4 ;=====================================================================
    45START N PXRMBG,PXRMMODE,VALMBCK,VALMBG,VALMCNT,VALMSG,X,XMZ
    56 S X="IORESET"
    67 D EN^VALM("PXRM EX LIST DIALOG")
     8 ;
    79 ;Rebuild Display
    810 D CDISP^PXRMEXLC(PXRMRIEN)
    911 Q
    1012 ;
    11 ENTRY ; Entry point for List Manager
    12  D FIND Q
    13  ;
    14 DETAIL ;Detailed display
    15  S PXRMMODE=0 D DISP(PXRMMODE) Q
    16  ;
    17 FIND ;Display findings
    18  S PXRMMODE=2 D DISP(PXRMMODE) Q
    19  ;
    20 SUM ;Display dialog summary
    21  S PXRMMODE=3 D DISP(PXRMMODE) Q
    22  ;
    23 USE ;Display dialog usage
    24  S PXRMMODE=4 D DISP(PXRMMODE) Q
    25  ;
    26 TEXT ;Display dialog text
    27  S PXRMMODE=1 D DISP(PXRMMODE) Q
    28  ;
    29 EXIT ;
     13ENTRY D FIND Q
     14 ;
     15DETAIL S PXRMMODE=0 D DISP(PXRMMODE) Q
     16 ;
     17 ;Display Findings
     18 ;--------------------------
     19FIND S PXRMMODE=2 D DISP(PXRMMODE) Q
     20 ;
     21 ;Display Dialog Summary
     22 ;----------------------
     23SUM S PXRMMODE=3 D DISP(PXRMMODE) Q
     24 ;
     25 ;Display Dialog Usage
     26 ;--------------------
     27USE S PXRMMODE=4 D DISP(PXRMMODE) Q
     28 ;
     29 ;Display Dialog Text
     30 ;-------------------
     31TEXT S PXRMMODE=1 D DISP(PXRMMODE) Q
     32 ;
     33EXIT K ^TMP("PXRMEXLD",$J) Q
     34 ;
     35PEXIT ;PXRM EXCH DIALOG MENU protocol exit code
     36 S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
     37 ;Reset after page up/down etc
     38 D XQORM
     39 Q
     40 ;
     41HELP N ORU,ORUPRMT,XQORM,PXRMTAG S PXRMTAG="DLG"
     42 D EN^VALM("PXRM EX DIALOG HELP")
     43 Q
     44 ;
     45HDR S VALMHDR(1)="Packed reminder dialog: "
     46 S VALMHDR(1)=VALMHDR(1)_$G(^TMP("PXRMEXTMP",$J,"PXRMDNAM"))
     47 I $D(^TMP("PXRMEXTMP",$J,"PXRMDNAT")) D
     48 .S VALMHDR(1)=VALMHDR(1)_" [NATIONAL DIALOG]"
     49 S VALMHDR("TITLE")=VALMHDR(1)
     50 S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
     51 Q
     52 ;
     53 ;Build list manager workfile from ^TMP("PXRMEXTMP" (see ^PXRMEXLB)
     54DISP(VIEW) ;
     55 N OLEV,ODSEQ
    3056 K ^TMP("PXRMEXLD",$J)
    31  Q
    32  ;
    33 DISP(VIEW) ;Build the requested view and display it.
    34  D BLDDISP^PXRMEXD1(VIEW)
     57 K PXRMEXRP
     58 K ^TMP($J,"PXRMEXREP")
     59 N DDATA,DDLG,DEND,DREP,DSTRT,IND,JND,NLINE,NSEL
     60 S NLINE=0,NSEL=0,VALMBCK="R",VALMCNT=NLINE
     61 S DDLG=$G(^TMP("PXRMEXTMP",$J,"PXRMDNAM")) Q:DDLG=""
     62 ;
     63 ;Save reminder dialog
     64 S DDATA=^TMP("PXRMEXTMP",$J,"DLOC",DDLG)
     65 S DSTRT=$P(DDATA,U,1),DEND=$P(DDATA,U,2)
     66 S IND=$P(DDATA,U,3),JND=$P(DDATA,U,4),DREP=""
     67 D DLINE(DDLG,"","")
     68 S NLINE=NLINE+1,^TMP("PXRMEXLD",$J,NLINE,0)=$J("",79)
     69 S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     70 ;Process componentS
     71 D DCMP(DDLG,"")
     72 ;Process replacement elements
     73 ;I $D(^TMP("PXRMEXTMP",$J,"DREPL"))>0 D DREPL^PXRMEXLC
     74 I $D(PXRMEXRP)>0 D DREPL^PXRMEXLC
    3575 ;Change header
    3676 I VIEW=0 D CHGCAP^VALM("HEADER2","Dialog Details")
     
    3979 I VIEW=3 D CHGCAP^VALM("HEADER2","Dialog Summary")
    4080 I VIEW=4 D CHGCAP^VALM("HEADER2","Dialog Usage")
    41  S VALMCNT=^TMP("PXRMEXLD",$J,"VALMCNT"),VALMBG=1,VALMBCK="R"
     81 ;
     82 S VALMCNT=NLINE,^TMP("PXRMEXLD",$J,"VALMCNT")=VALMCNT,VALMBG=1
     83 ;
     84 K ^TMP($J,"PXRMEXREP"),PXRMEXRP
    4285 ;Reset protocol
    4386 D XQORM
    4487 Q
    4588 ;
    46 HELP ;
    47  N ORU,ORUPRMT,XQORM,PXRMTAG
    48  S PXRMTAG="DLG"
    49  D EN^VALM("PXRM EX DIALOG HELP")
    50  Q
    51  ;
    52 HDR ;
    53  S VALMHDR(1)="Packed reminder dialog: "
    54  S VALMHDR(1)=VALMHDR(1)_$G(^TMP("PXRMEXTMP",$J,"PXRMDNAM"))
    55  I $D(^TMP("PXRMEXTMP",$J,"PXRMDNAT")) S VALMHDR(1)=VALMHDR(1)_" [NATIONAL DIALOG]"
    56  S VALMHDR("TITLE")=VALMHDR(1)
    57  S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
    58  Q
    59  ;
    60 PEXIT ;PXRM EXCH DIALOG MENU protocol exit code
    61  S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
    62  ;Reset after page up/down etc
    63  D XQORM
    64  Q
    65  ;
    66 VALID(STRING) ;Validate sequence numbers
     89 ;Update workfile
     90DLINE(DNAM,LEV,DSEQ) ;
     91 ;Check if standard PXRM prompt
     92 N LEVSEQ,TLEV
     93 N DPXRM S DPXRM=$$PXRM^PXRMEXID(DNAM)
     94 ;
     95 ;Ignore PXRM prompts if doing a finding view (DF)
     96 I VIEW>1,DPXRM Q
     97 ;
     98 N DEXIST,DPTX,DTXT,DTYP,EXIST,ITEM,TEMP,SEP
     99 S ITEM=""
     100 I DPXRM=0 S NSEL=NSEL+1,ITEM=NSEL
     101 S NLINE=NLINE+1,SEP=$E(LEV,$L(LEV)),DEXIST=0
     102 S LEVSEQ=LEV_DSEQ
     103 S TEMP=$J(ITEM,3)_$J("",4)_LEV_DSEQ
     104 ;Determine type
     105 S DTYP=$G(^TMP("PXRMEXTMP",$J,"DTYP",DNAM))
     106 ;Dialog component display
     107 I (VIEW'=1) D
     108 .I $L(TEMP)<13 S TEMP=TEMP_$J("",12+$L(SEP)-$L(TEMP))_$E(DNAM,1,50)
     109 .E  S TEMP=TEMP_" "_$E(DNAM,1,50)
     110 I VIEW=1 D
     111 .I DTYP]"" S DTXT=$G(^TMP("PXRMEXTMP",$J,"DTXT",DNAM))
     112 .I DTYP="" S DTXT=DNAM
     113 .I DREP'="" S DTXT=DNAM
     114 .I $L(TEMP)<13 S TEMP=TEMP_$J("",12+$L(SEP)-$L(TEMP))_$E(DTXT,1,50)
     115 .E  S TEMP=TEMP_" "_$E(DTXT,1,50)
     116 ;Check for replacements
     117 I $D(^TMP("PXRMEXTMP",$J,"DREPL",DNAM))>0 D
     118 .S TEMP=TEMP_"*"
     119 .S TLEV=$S($E(LEVSEQ,$L(LEVSEQ))=".":$E(LEVSEQ,1,$L(LEVSEQ)-1),1:LEVSEQ)
     120 .S PXRMEXRP(DNAM)=""
     121 .;S ^TMP($J,"PXRMEXREP",TLEV,DNAM)=""
     122 ;Add Type
     123 S TEMP=TEMP_$J("",65-$L(TEMP))_DTYP
     124 ;Exists flag
     125 I DPXRM=0,$$EXISTS^PXRMEXIU(801.41,DNAM) D
     126 .S TEMP=TEMP_$J("",75-$L(TEMP))_"X",DEXIST=1
     127 S ^TMP("PXRMEXLD",$J,NLINE,0)=TEMP
     128 ;
     129 ;Set up selection index
     130 S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)="" Q:DPXRM=1
     131 ;Store the file number, start and stop line in the exchange file.
     132 S ^TMP("PXRMEXLD",$J,"SEL",NSEL)=FILENUM_U_DSTRT_U_DEND_U_DEXIST_U_IND_U_JND
     133 ;Insert additional text lines
     134 I VIEW=1,DREP="" D
     135 .N DSUB,DTXT,FILENUM
     136 .S DSUB=0,FILENUM=8927.1
     137 .F  S DSUB=$O(^TMP("PXRMEXTMP",$J,"DTXT",DNAM,DSUB)) Q:'DSUB  D
     138 ..S DTXT=$G(^TMP("PXRMEXTMP",$J,"DTXT",DNAM,DSUB)),NLINE=NLINE+1
     139 ..S ^TMP("PXRMEXLD",$J,NLINE,0)=$J("",12+$L(SEP))_$E(DTXT,1,50)
     140 ..S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     141 .;TIU template changes
     142 .I $D(PXRMNMCH(FILENUM)),$D(^TMP("PXRMEXTMP",$J,"DTIU",DNAM)) D
     143 ..N TEMP,TNAM,TNNAM
     144 ..S TNAM=""
     145 ..F  S TNAM=$O(^TMP("PXRMEXTMP",$J,"DTIU",DNAM,TNAM)) Q:TNAM=""  D
     146 ...S TNNAM=$G(PXRMNMCH(FILENUM,TNAM)) Q:TNNAM=""
     147 ...S NLINE=NLINE+1,^TMP("PXRMEXLD",$J,NLINE,0)=$J("",79)
     148 ...S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     149 ...S TEMP=$J("",12+$L(SEP))_"(TIU template "_TNAM_" copied to "_TNNAM_")"
     150 ...S NLINE=NLINE+1,^TMP("PXRMEXLD",$J,NLINE,0)=TEMP
     151 ...S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     152 ...S NLINE=NLINE+1,^TMP("PXRMEXLD",$J,NLINE,0)=$J("",79)
     153 ...S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     154 ;Insert finding items
     155 I VIEW=2,("element;group"[DTYP),DREP="" D
     156 .N DSUB,FDATA,FILENUM,FLIT,FLONG,FNAME,FOUND,FREP,FTAB,FTYP,TEMP
     157 .;Findings and additional findings
     158 .S DSUB=0,FOUND=0
     159 .F  S DSUB=$O(^TMP("PXRMEXTMP",$J,"DFND",DNAM,DSUB)) Q:'DSUB  D
     160 ..S FNAME=$G(^TMP("PXRMEXTMP",$J,"DFND",DNAM,DSUB)) Q:FNAME=""
     161 ..S FDATA=$G(^TMP("PXRMEXFND",$J,FNAME))
     162 ..S FILENUM=$P(FDATA,U),FTYP=$P(FDATA,U,2) Q:'FILENUM
     163 ..S FREP=$G(PXRMNMCH(FILENUM,FNAME)) I FREP=FNAME S FREP=""
     164 ..S NLINE=NLINE+1,EXIST=$$EXISTS^PXRMEXIU(FILENUM,FNAME),FOUND=1
     165 ..I DSUB=1 S FLIT="Finding: "
     166 ..I DSUB>1 S FLIT="Add. Finding: "
     167 ..S FLONG=0 I $L(FLIT_FNAME_" ("_FTYP_")")>60 S FLONG=1
     168 ..I 'FLONG S FNAME=FLIT_FNAME_" ("_FTYP_")"
     169 ..I FLONG S FNAME=FLIT_FNAME
     170 ..S TEMP=$J("",12+$L(SEP))_$E(FNAME,1,60)_$J("",60-$L(FNAME))
     171 ..I EXIST S TEMP=TEMP_$J("",75-$L(TEMP))_"X"
     172 ..S ^TMP("PXRMEXLD",$J,NLINE,0)=TEMP
     173 ..S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     174 ..I FLONG D
     175 ...S NLINE=NLINE+1
     176 ...S FTAB=$S(DSUB=1:21,1:26)
     177 ...S ^TMP("PXRMEXLD",$J,NLINE,0)=$J("",FTAB)_"("_FTYP_")"
     178 ...S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     179 ..I FREP'="" D
     180 ...S NLINE=NLINE+1
     181 ...S FTAB=$S(DSUB=1:21,1:26)
     182 ...S ^TMP("PXRMEXLD",$J,NLINE,0)=$J("",FTAB)_"(Replaced by "_FREP_")"
     183 ...S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     184 .;If no findings
     185 .I 'FOUND D
     186 ..S NLINE=NLINE+1
     187 ..S ^TMP("PXRMEXLD",$J,NLINE,0)=$J("",12+$L(SEP))_"Finding: *NONE*"
     188 ..S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     189 ;
     190 ;Usage screen
     191 I VIEW=4,DREP="" D
     192 .N DOTHER,DTXT,DTYPE,OTHER,TYPE
     193 .D OTHER(DNAM,.DOTHER) Q:'$D(DOTHER)
     194 .S OTHER=""
     195 .F  S OTHER=$O(DOTHER(OTHER)) Q:OTHER=""  D
     196 ..S TYPE=DOTHER(OTHER),NLINE=NLINE+1,DTYPE="REMINDER DIALOG"
     197 ..I TYPE="G" S DTYPE="DIALOG GROUP"
     198 ..I TYPE="E" S DTYPE="DIALOG ELEMENT"
     199 ..S DTXT="USED BY: "_OTHER_" ("_DTYPE_")"
     200 ..S ^TMP("PXRMEXLD",$J,NLINE,0)=$J("",12+$L(SEP))_DTXT
     201 ..S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     202 Q
     203 ;
     204 ;Save details of dialog components for display
     205DCMP(DLG,LEV) ;
     206 N DDATA,DDLG,DEND,DNAM,DSEQ,DSTRT,IND,JND,LAST,LEVSEQ,NUM
     207 S DSEQ=0,LAST=0
     208 F  S DSEQ=$O(^TMP("PXRMEXTMP",$J,"DMAP",DLG,DSEQ)) Q:'DSEQ  D
     209 .S DDATA=^TMP("PXRMEXTMP",$J,"DMAP",DLG,DSEQ)
     210 .S DNAM=$P(DDATA,U),DSTRT=$P(DDATA,U,2),DEND=$P(DDATA,U,3) Q:DNAM=""
     211 .S IND=$P(DDATA,U,4),JND=$P(DDATA,U,5)
     212 .;Check if this component has been replaced
     213 .S DREP=$G(PXRMNMCH(FILENUM,DNAM)) I DREP=DNAM S DREP=""
     214 .;Save line in workfile
     215 .S NUM=DSEQ
     216 .;S NUM=$S($G(REPL)["R":"."_DSEQ,1:DSEQ)
     217 .I +LEV>0,NUM>0,$E(LEV,$L(LEV))'="." S LEV=LEV_"."
     218 .D DLINE(DNAM,LEV,NUM) Q:DREP'=""
     219 .I $D(^TMP("PXRMEXTMP",$J,"DMAP",DNAM)) D DCMP(DNAM,LEV_DSEQ_".")
     220 .;Extra line feed
     221 .I LEV="" D
     222 ..S NLINE=NLINE+1,^TMP("PXRMEXLD",$J,NLINE,0)=$J("",79)
     223 ..S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     224 I $G(REPL)["R" D
     225 .S NLINE=NLINE+1,^TMP("PXRMEXLD",$J,NLINE,0)=$J("",79)
     226 .S ^TMP("PXRMEXLD",$J,"IDX",NLINE,NSEL)=""
     227 Q
     228 ;
     229 ;Rebuild string in ascending or descending order
     230ORDER(STRING,ORDER) ;
     231 N ARRAY,ITEM,CNT
     232 F CNT=1:1 S ITEM=$P(STRING,",",CNT) Q:'ITEM  S ARRAY(ITEM)=""
     233 K STRING
     234 F CNT=1:1 S ITEM=$O(ARRAY(ITEM),ORDER) Q:'ITEM  D
     235 .S $P(STRING,",",CNT)=ITEM
     236 Q
     237 ;
     238 ;Check if used by other dialogs
     239OTHER(NAME,LIST) ;
     240 N DDATA,DIEN,DNAME,DTYP,IEN
     241 S IEN=$O(^PXRMD(801.41,"B",NAME,0)) Q:'IEN
     242 ;Check if used by other dialogs
     243 I '$D(^PXRMD(801.41,"AD",IEN)) Q
     244 ;Build list of dialogs using this component
     245 S DIEN=0
     246 F  S DIEN=$O(^PXRMD(801.41,"AD",IEN,DIEN)) Q:'DIEN  D
     247 .S DDATA=$G(^PXRMD(801.41,DIEN,0)) Q:DDATA=""
     248 .S DNAME=$P(DDATA,U),DTYP=$P(DDATA,U,4) Q:DNAME=""
     249 .;Include only dialogs that are not part of this reminder dialog
     250 .I $D(^TMP("PXRMEXTMP",$J,"DMAP",DNAME)) Q
     251 .S LIST(DNAME)=DTYP
     252 Q
     253 ;
     254 ;Validate sequence numbers
     255VALID(STRING) ;
    67256 N CNT,FOUND,OK
    68257 S FOUND=0,OK=1
     
    86275 ;
    87276 ;Sort the SELECTION into reverse order
    88  D ORDER^PXRMEXLC(.SELECT,-1)
     277 D ORDER(.SELECT,-1)
    89278 ;
    90279 ;Lock the file
     
    99288 D UNLOCK^PXRMEXID
    100289 ;
     290 ;
    101291 ;Rebuild Workfile
    102292 D DISP^PXRMEXLD(PXRMMODE)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXLI.m

    r628 r636  
    1 PXRMEXLI ; SLC/PKR - List Manager routines for repository entry install. ;08/08/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXLI ; SLC/PKR - List Manager routines for repository entry install. ;01/10/2003
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;================================================
    55INSALL ;Install all components in a repository entry.
    66 N IND,INSTALL
     7 K ^TMP("PXRMEXIA",$J)
     8 ;Set the install date and time.
     9 S ^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT
    710 ;Initialize the name change storage.
    811 K PXRMNMCH
     
    4649 I FILENUM=0 D
    4750 . D RTNLD^PXRMEXIC(PXRMRIEN,START,END,.ATTR,.RTN)
    48  . D CHECKSUM^PXRMEXCS(.ATTR,START,END)
    4951 . S ACTION=$$GETRACT^PXRMEXCF(.ATTR,.NEWNAME,.PXRMNMCH,.RTN,EXISTS)
    5052 .;Save what was done for the installation summary.
     
    5658 . I FIELDNUM=.001 S TEMP=^PXD(811.8,PXRMRIEN,100,(START+1),0)
    5759 . S PT01=$P(TEMP,"~",2)
    58  . D SETATTR^PXRMEXFI(.ATTR,FILENUM,PT01)
    59  . D CHECKSUM^PXRMEXCS(.ATTR,START,END)
     60 . D SETATTR^PXRMEXFI(.ATTR,FILENUM)
    6061 . S ACTION=$$GETFACT^PXRMEXFI(PT01,.ATTR,.NEWPT01,.PXRMNMCH,EXISTS)
    6162 .;Save what was done for the installation summary.
     
    9091 I '$D(VALMY) Q
    9192 ;
     93 K ^TMP("PXRMEXIA",$J)
     94 ;Set the install date and time.
     95 S ^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT
     96 ;
    9297 ;Initialize the name change storage.
    9398 K PXRMNMCH
    9499 S (IND,INSTALL)=0
    95  F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D INSCOM(IND,.INSTALL)
     100 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
     101 .D INSCOM(IND,.INSTALL)
    96102 ;
    97103 ;If anything was installed rebuild the display.
     
    109115 I '$D(^PXD(811.8,PXRMRIEN,120)) D CLIST^PXRMEXU1(.PXRMRIEN)
    110116 I PXRMRIEN=-1 Q
    111  K ^TMP("PXRMEXIA",$J),^TMP("PXRMEXIAD",$J)
    112  ;Set the install date and time and type.
    113  S ^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT
    114  S ^TMP("PXRMEXIA",$J,"TYPE")="INTERACTIVE"
    115117 ;Format the component list for display.
    116118 D CDISP^PXRMEXLC(PXRMRIEN)
     
    120122 Q
    121123 ;
    122  ;================================================
    123124 ;Exit action added to PXRM EXCH INSTALL MENU
    124125PEXIT ;PXRM EXCH INSTALL MENU protocol exit code
     
    128129 Q
    129130 ;
    130  ;================================================
    131131XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXCH SELECT COMPONENT",0))_U_"1:"_VALMCNT
    132132 S XQORM("A")="Select Action: "
    133133 Q
    134134 ;
    135  ;================================================
    136135XSEL ;PXRM EXCH SELECT COMPONENT validation
    137136 N CNT,SELECT,SEL,PXRMDONE
     
    140139 ;
    141140 ;Sort selections into ascending sequence order
    142  D ORDER^PXRMEXLC(.SELECT,1)
     141 D ORDER^PXRMEXLD(.SELECT,1)
    143142 ;
    144  K ^TMP("PXRMEXIA",$J),^TMP("PXRMEXIAD",$J)
    145  ;Set the install date and time and type.
     143 K ^TMP("PXRMEXIA",$J)
     144 ;Set the install date and time.
    146145 S ^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT
    147  S ^TMP("PXRMEXIA",$J,"TYPE")="INTERACTIVE"
    148146 ;
    149147 ;Install selected component
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXLM.m

    r628 r636  
    1 PXRMEXLM ; SLC/PKR/PJH - Clinical Reminder Exchange List Manager routines. ;10/11/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMEXLM ; SLC/PKR/PJH - Clinical Reminder Exchange List Manager routines. ;12/22/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;=====================================================
     
    4141 ;
    4242 ;=====================================================
     43EN ;Main entry point for PXRM EXCHANGE
     44 N PXRMDONE,PXRMNMCH
     45 ;PXRMDONE is set to true if the user enters an action of Quit.
     46 S PXRMDONE=0
     47 ;PXRMNMCH is used to store name change information. If a finding
     48 ;is copied to a new name or is replaced by another finding the
     49 ;information is stored here. It is used when installing definitions
     50 ;or dialogs so they use the new or replaced finding.
     51 N VALMBCK,VALMSG,X,XMZ
     52 S X="IORESET"
     53 D ENDR^%ZISS
     54 D BLDLIST^PXRMEXLC(0)
     55 D EN^VALM("PXRM EX REMINDER EXCHANGE")
     56 W IORESET
     57 D KILL^%ZISS
     58 Q
     59 ;
     60 ;=====================================================
    4361ENTRY ;Entry code
    44  D BLDLIST^PXRMEXLC(0)
    4562 D XQORM
    4663 Q
     
    5269 K ^TMP("PXRMEXFND",$J)
    5370 K ^TMP("PXRMEXIA",$J)
    54  K ^TMP("PXRMEXIAD",$J)
    5571 K ^TMP("PXRMEXID",$J)
    5672 K ^TMP("PXRMEXIH",$J)
     
    166182 Q
    167183 ;
    168  ;=====================================================
    169 START ;Main entry point for PXRM EXCHANGE
    170  N PXRMDONE,PXRMNMCH
    171  ;PXRMDONE is set to true if the user enters an action of Quit.
    172  S PXRMDONE=0
    173  ;PXRMNMCH is used to store name change information. If a finding
    174  ;is copied to a new name or is replaced by another finding the
    175  ;information is stored here. It is used when installing definitions
    176  ;or dialogs so they use the new or replaced finding.
    177  N VALMBCK,VALMSG,X,XMZ
    178  S X="IORESET"
    179  D ENDR^%ZISS
    180  D EN^VALM("PXRM EX REMINDER EXCHANGE")
    181  W IORESET
    182  D KILL^%ZISS
    183  Q
    184  ;
    185  ;=====================================================
    186184XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXCH SELECT ENTRY",0))_U_"1:"_VALMCNT
    187185 S XQORM("A")="Select Action: "
    188186 Q
    189187 ;
    190  ;=====================================================
    191188XSEL ;PXRM EXCH SELECT COMPONENT validation
    192189 N SEL,PXRMRIEN
     
    198195 .W $C(7),!,"Only one item number allowed." H 2
    199196 .S VALMBCK="R"
    200  I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("SEL",SEL))) D  Q
     197 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("IDX",SEL))) D  Q
    201198 .W $C(7),!,SEL_" is not a valid item number." H 2
    202199 .S VALMBCK="R"
    203200 ;
    204201 ;Get the repository ien.
    205  S PXRMRIEN=^TMP("PXRMEXLR",$J,"SEL",SEL)
     202 S PXRMRIEN=^TMP("PXRMEXLR",$J,"IDX",SEL,SEL)
    206203 ;
    207204 ;Full screen mode
     
    233230 .;Rebuild the list for List Manager to display.
    234231 .K ^TMP("PXRMEXLR",$J)
    235  .D REXL^PXRMLIST("PXRMEXLR")
    236  .S VALMCNT=^TMP("PXRMEXLR",$J,"VALMCNT")
     232 .D RE^PXRMLIST(.RELIST,.IEN)
     233 .M ^TMP("PXRMEXLR",$J)=RELIST
     234 .S VALMCNT=RELIST("VALMCNT")
     235 .F IND=1:1:VALMCNT D
     236 ..S ^TMP("PXRMEXLR",$J,"IDX",IND,IND)=IEN(IND)
     237 .;
    237238 .S VALMHDR(1)="Deleted 1 exchange file entry",VALMHDR(2)=" ",VALMBCK="R"
    238239 ;
    239  I OPTION="IH" D START^PXRMEXIH
    240  ;
    241  S VALMBCK="R"
    242  Q
     240 I OPTION="IH" D
     241 .N HISLIST,VALMCNT
     242 .S HISLIST(SEL)=""
     243 .D HISTLIST^PXRMEXLC(.HISLIST,.VALMCNT)
     244 .D EN^VALM("PXRM EX INSTALLATION HISTORY")
     245 .K ^TMP("PXRMEXIH",$J)
     246 ;
     247 S VALMBCK="R"
     248 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXLR.m

    r628 r636  
    1 PXRMEXLR ; SLC/PKR/PJH - List Manager routines for existing repository entries. ;07/30/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXLR ; SLC/PKR/PJH - List Manager routines for existing repository entries. ;01/10/2003
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;==================================================
    44CHF ;Create a host file containing repository entries.
     
    5050 ;Rebuild the list for List Manager to display.
    5151 K ^TMP("PXRMEXLR",$J)
    52  D REXL^PXRMLIST("PXRMEXLR")
     52 D RE^PXRMLIST(.RELIST,.IEN)
     53 M ^TMP("PXRMEXLR",$J)=RELIST
     54 S VALMCNT=RELIST("VALMCNT")
     55 F IND=1:1:VALMCNT S ^TMP("PXRMEXLR",$J,"IDX",IND,IND)=IEN(IND)
    5356 ;
    5457 S VALMHDR(1)="Deleted "_DELLIST("COUNT")_" Exchange File"
     
    6164 ;
    6265 ;==================================================
     66DELHIST ;Get a list of repository installation entries and delete them.
     67 ;Save the original list, it contains the selected repository entries.
     68 N VALMYO
     69 M VALMYO=VALMY
     70 N IHIND,IND,RIEN,TEMP,VALMY
     71 N VALMBG,VALMLST
     72 ;
     73 S VALMBG=1,VALMLST=+$O(^TMP("PXRMEXIH",$J,"IDX",""),-1)
     74 ;Get the list to delete.
     75 D EN^VALM2(XQORNOD(0))
     76 ;If there is no list quit.
     77 I '$D(VALMY) Q
     78 S IND=""
     79 F  S IND=$O(VALMY(IND)) Q:IND=""  D
     80 . S TEMP=^TMP("PXRMEXIH",$J,"SEL",IND)
     81 . S RIEN=$P(TEMP,U,1)
     82 . S IHIND=$P(TEMP,U,2)
     83 . D DELHIST^PXRMEXU1(RIEN,IHIND)
     84 ;Rebuild the display list.
     85 D HISTLIST^PXRMEXLC(.VALMYO,.VALMCNT)
     86 S VALMBCK="R"
     87 Q
     88 ;
     89 ;==================================================
    6390EXIT ; Exit code
    6491 D CLEAN^VALM10
     
    6996 ;
    7097 ;==================================================
     98IH ;Get a list of repository entries and show their installation history.
     99 N VALMCNT,VALMY
     100 D EN^VALM2(XQORNOD(0))
     101 ;If there is no list quit.
     102 I '$D(VALMY) Q
     103 ;Build a history list.
     104 D HISTLIST^PXRMEXLC(.VALMY,.VALMCNT)
     105 D EN^VALM("PXRM EX INSTALLATION HISTORY")
     106 K ^TMP("PXRMEXIH",$J)
     107 S VALMBCK="R"
     108 Q
     109 ;
     110 ;==================================================
     111INDETAIL ;Output the details of an installation.
     112 N VALMBG,VALMCNT,VALMHDR,VALMLST,VALMY
     113 S VALMBG=1,VALMLST=+$O(^TMP("PXRMEXIH",$J,"IDX",""),-1)
     114 ;Get the list to display.
     115 D EN^VALM2(XQORNOD(0))
     116 ;If there is no list quit.
     117 I '$D(VALMY) Q
     118 D INDISP(.VALMY)
     119 Q
     120 ;
     121 ;==================================================
     122INDISP(ARRAY) ;Display details list
     123 N ACTION,CMPNT,DI,DP,ENTRY,IHIND,IND,INDEX,JND,KND
     124 N NAME,NEWNAME,NLINE,RIEN,TEMP
     125 K ^TMP("PXRMEXID",$J)
     126 ;If there are no items then quit.
     127 I '$D(ARRAY) Q
     128 S (IND,NLINE)=0
     129 F  S IND=$O(ARRAY(IND)) Q:IND=""  D
     130 . S TEMP=^TMP("PXRMEXIH",$J,"SEL",IND)
     131 . S RIEN=$P(TEMP,U,1)
     132 . S IHIND=$P(TEMP,U,2)
     133 . S TEMP=^PXD(811.8,RIEN,0)
     134 . S ENTRY=$E($P(TEMP,U,1),1,38)
     135 . S ENTRY=$$LJ^XLFSTR(ENTRY,38," ")
     136 . S DP=$$FMTE^XLFDT($P(TEMP,U,3),"5Z")
     137 . S DI=$$FMTE^XLFDT(^PXD(811.8,RIEN,130,IHIND,0),"5Z")
     138 . I NLINE>1 D
     139 .. S NLINE=NLINE+1
     140 .. S ^TMP("PXRMEXID",$J,NLINE,0)="------------------------------------------------------------------------------"
     141 . S NLINE=NLINE+1
     142 . S ^TMP("PXRMEXID",$J,NLINE,0)=ENTRY_" "_DP_"  "_DI
     143 .;Write the header line here.
     144 . S NLINE=NLINE+1
     145 . S ^TMP("PXRMEXID",$J,NLINE,0)="     Component                         Action  New Name"
     146 . S CMPNT=""
     147 . S JND=0
     148 . F  S JND=$O(^PXD(811.8,RIEN,130,IHIND,1,JND)) Q:JND=""  D
     149 .. S TEMP=^PXD(811.8,RIEN,130,IHIND,1,JND,0)
     150 .. I $P(TEMP,U,2)'=CMPNT D
     151 ... S NLINE=NLINE+1
     152 ... S ^TMP("PXRMEXID",$J,NLINE,0)=" "
     153 ... S CMPNT=$P(TEMP,U,2)
     154 ... S NLINE=NLINE+1
     155 ... S ^TMP("PXRMEXID",$J,NLINE,0)=CMPNT
     156 .. S INDEX=$$RJ^XLFSTR($P(TEMP,U,1),4," ")
     157 .. S NAME=$E($P(TEMP,U,3),1,36)
     158 .. S NAME=$$LJ^XLFSTR(NAME,36," ")
     159 .. S ACTION=$P(TEMP,U,4)
     160 .. S NEWNAME=$E($P(TEMP,U,5),1,36)
     161 .. S NEWNAME=$$LJ^XLFSTR(NEWNAME,36," ")
     162 .. S NLINE=NLINE+1
     163 .. S ^TMP("PXRMEXID",$J,NLINE,0)=INDEX_" "_NAME_" "_ACTION_"    "_NEWNAME
     164 ..;If there are Additional Details add them to the display.
     165 .. S KND=0
     166 .. F  S KND=$O(^PXD(811.8,RIEN,130,IHIND,1,JND,1,KND)) Q:KND=""  D
     167 ... S NLINE=NLINE+1
     168 ... S ^TMP("PXRMEXID",$J,NLINE,0)=^PXD(811.8,RIEN,130,IHIND,1,JND,1,KND,0)
     169 . S NLINE=NLINE+1
     170 . S ^TMP("PXRMEXID",$J,NLINE,0)=" "
     171 S VALMHDR(1)=^PXD(811.8,RIEN,0)_"  "_^TMP("PXRMEXID",$J,1,0)
     172 S VALMCNT=NLINE
     173 D EN^VALM("PXRM EX INSTALLATION DETAIL")
     174 K ^TMP("PXRMEXID",$J)
     175 S VALMBCK="R"
     176 Q
     177 ;
     178 ;==================================================
    71179INSTALL ;Get a list of repository entries and install them.
    72180 N IND,PXRMRIEN,VALMY
     
    79187 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
    80188 .;Get the repository ien.
    81  . S PXRMRIEN=^TMP("PXRMEXLR",$J,"SEL",IND)
     189 . S PXRMRIEN=^TMP("PXRMEXLR",$J,"IDX",IND,IND)
    82190 .;The list template calls INSTALL^PXRMEXLI
    83191 . D EN^VALM("PXRM EX LIST COMPONENTS")
     
    98206 ;
    99207 ;==================================================
     208IS ;Get a list of packed reminders and print the installation summary.
     209 N VALMY
     210 D EN^VALM2(XQORNOD(0))
     211 ;If there is no list quit.
     212 I '$D(VALMY) Q
     213 Q
     214 ;
     215 ;==================================================
    100216MIENLIST(LIST) ;Get a list of List Manager repository entries and turn it
    101217 ;into iens.
     
    108224 F  S IND=$O(VALMY(IND)) Q:+IND=0  D
    109225 . S COUNT=COUNT+1
    110  . ;S IEN=^TMP("PXRMEXLR",$J,"IDX",IND,IND)
    111  . S IEN=^TMP("PXRMEXLR",$J,"SEL",IND)
     226 . S IEN=^TMP("PXRMEXLR",$J,"IDX",IND,IND)
    112227 . S LIST(IEN)=""
    113228 S LIST("COUNT")=COUNT
     
    117232PEXIT ;PXRM EXCH INSTALLATION MENU protocol exit code
    118233 S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
    119  Q
    120  ;
     234 ;Reset after page up/down etc
     235 D XQORM
     236 Q
     237 ;
     238 ;==================================================
     239XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXCH SELECT HISTORY",0))_U_"1:"_VALMCNT
     240 S XQORM("A")="Select Action: "
     241 Q
     242 ;
     243 ;==================================================
     244XSEL ;PXRM EXCH SELECT HISTORY validation
     245 N ARRAY,CNT,SELECT,SEL
     246 S SELECT=$P(XQORNOD(0),"=",2)
     247 I '$$VALID^PXRMEXLD(SELECT) S VALMBCK="R" Q
     248 ;Build array of selected items
     249 F CNT=1:1 S SEL=$P(SELECT,",",CNT) Q:'SEL  D
     250 .S ARRAY(SEL)=""
     251 ;
     252 ;Display Selected Histories
     253 D INDISP(.ARRAY)
     254 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXPR.m

    r628 r636  
    1 PXRMEXPR ; SLC/PKR/PJH - Routines to create packed reminder definitions. ;12/12/2006
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXPR ; SLC/PKR/PJH - Routines to create packed reminder definitions. ;02/25/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;===============================================================
    44ADDFILE(FLIST,ROOT,FILENAME) ;Add a file to the list of finding files.
     
    2929 D GETSPON(811.9,RIEN,.SPONLIST)
    3030 ;If there is a dialog add it.
    31  ;S DIEN=+$P($G(^PXD(811.9,RIEN,51)),U,1)
    32  ;I DIEN>0 D GETSPON(801.41,DIEN,.SPONLIST)
     31 S DIEN=+$P($G(^PXD(811.9,RIEN,51)),U,1)
     32 I DIEN>0 D GETSPON(801.41,DIEN,.SPONLIST)
    3333 ;Go through the finding list to find additional sponsors.
    3434 S IND=""
     
    122122 ;Save the source information
    123123 I +RTP'>0 Q
    124  K ^TMP(TMPIND,$J),^TMP("PXRMEXCS",$J)
     124 K ^TMP(TMPIND,$J)
    125125 D PUTSRC(RTP,TMPIND)
    126126 ;
     
    152152 ;If a dialog exists for this reminder add it and its findings to the
    153153 ;list. Also collect any embedded TIU objects or templates
    154  D DIALOG^PXRMEXDG(RIEN,.DLGLIST,.FINDLIST,.OBJLIST,.TEMLIST,.SPONLIST)
     154 D DIALOG^PXRMEXDG(RIEN,.DLGLIST,.FINDLIST,.OBJLIST,.TEMLIST)
    155155 ;
    156156 ;If there were education topics make sure subtopics are included.
     
    226226 S LOC=$$SITE^VASITE
    227227 S ^TMP(TMPIND,$J,"SRC","REMINDER")=$P(RTP,U,2)
     228 ;S ^TMP(TMPIND,$J,"SRC","USER")=$P(^VA(200,DUZ,0),U,1)
    228229 S ^TMP(TMPIND,$J,"SRC","USER")=$$GET1^DIQ(200,DUZ,.01)
    229230 S ^TMP(TMPIND,$J,"SRC","SITE")=$P(LOC,U,2)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXPU.m

    r628 r636  
    1 PXRMEXPU ; SLC/PKR - Utilities for packing and unpacking repository entries. ;09/10/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXPU ; SLC/PKR - Utilities for packing and unpacking repository entries. ;12/22/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;==================================================
    44BTTABLE(DIQOUT,IENROOT,TTABLE) ;Build the DIQOUT to FDA iens translation table.
     
    1313 . S TTABLE(FILENUM,IENS)="+"_IENS
    1414 E  D  Q
    15  . W !,"BTTABLE^PXRMEXPU - DIQOUT problem, do not have correct top level"
     15 . W !,"BTTABLE^PXRMEXPU - DIQOUT problem do not have correct top level"
    1616 ;
    1717 F  S FILENUM=$O(DIQOUT(FILENUM)) Q:FILENUM=""  D
     
    4343 ... I '$D(TYPE(FILENUM,FIELD)) S TYPE(FILENUM,FIELD)=$$GET1^DID(FILENUM,FIELD,"","TYPE")
    4444 ... S PTRTO=$S(TYPE(FILENUM,FIELD)="POINTER":$$GET1^DID(FILENUM,FIELD,"","POINTER"),1:"")
    45  ... ;Remove pointers to file 200.
    46  ... I PTRTO="VA(200," S DIQOUT(FILENUM,IENS,FIELD)="" Q
    4745 ...;If the field's type is COMPUTED then don't transport it.
    4846 ... I TYPE(FILENUM,FIELD)="COMPUTED" K DIQOUT(FILENUM,IENS,FIELD) Q
     
    9189 ;==================================================
    9290GDIQF(LIST,NUM,TMPIND,SERROR) ;Save file entries into ^TMP(TMPIND,$J).
    93  N CSUM,DIQOUT,IENROOT,IND,FIELD,FILENAME,IENS,MSG,PT01,TEMP
     91 N DIQOUT,IENROOT,IND,FIELD,FILENAME,IENS,MSG,PT01,TEMP
    9492 S ^TMP(TMPIND,$J,"NUMF")=NUM
    9593 F IND=1:1:NUM D
     
    103101 . I $$FOKTI^PXRMEXFI(FILENUM) S FIELD="**"
    104102 . E  S FIELD=.01
    105  . D GETS^DIQ(FILENUM,IEN,FIELD,"N","DIQOUT","MSG")
     103 . D GETS^DIQ(FILENUM,IEN,FIELD,"","DIQOUT","MSG")
    106104 . I $D(MSG) D  Q
    107105 .. S SERROR=1,IND=NUM
     
    117115 .;Convert the iens to the FDA adding form.
    118116 . D CONTOFDA(.DIQOUT,.IENROOT)
    119  . S CSUM=$$DIQOUTCS^PXRMEXCS(.DIQOUT)
    120  . S ^TMP("PXRMEXCS",$J,IND,FILENAME)=CSUM
    121117 .;Load the converted DIQOUT into TMP.
    122118 . M ^TMP(TMPIND,$J,IND,FILENAME)=DIQOUT
     
    135131 ;==================================================
    136132GRTN(LIST,NUM,TMPIND,SERROR) ;Save routines into ^TMP(TMPIND,$J).
    137  N DIF,IEN,IND,RA,TEMP,X,XCNP
     133 N DIF,IEN,IND,TEMP,X,XCNP
    138134 S ^TMP(TMPIND,$J,"NUMR")=NUM
    139135 S X=""
     
    143139 . X ^%ZOSF("TEST")
    144140 . I $T D
    145  .. K RA
    146  .. S DIF="RA("
     141 .. S DIF="^TMP(TMPIND,$J,""ROUTINE"","""_X_""","
    147142 .. S XCNP=0
    148143 .. X ^%ZOSF("LOAD")
    149  .. S ^TMP("PXRMEXCS",$J,"ROUTINE",X)=$$ROUTINE^PXRMEXCS(.RA)
    150  .. M ^TMP(TMPIND,$J,"ROUTINE",X)=RA
    151144 . E  D
    152145 .. S SERROR=1
     
    156149 ;
    157150 ;==================================================
    158 RMEH(FILENUM,DIQOUT,NOSTUB) ;Clear the edit history from all reminder files.
     151RMEH(FILENUM,DIQOUT) ;Clear the edit history from all reminder files.
    159152 ;Leave a stub so it can be filled in when the file is installed.
    160153 I (FILENUM<800)!(FILENUM>811.9) Q
    161  N IENS,SFN,TARGET
     154 N IEN,SFN,TARGET
    162155 ;Edit History is stored in node 110 for all files, get the
    163156 ;subfile number.
     
    169162 F  S IENS=$O(DIQOUT(SFN,IENS)) Q:IENS=""  K DIQOUT(SFN,IENS)
    170163 ;Create a stub for the install.
    171  I $G(NOSTUB) Q
    172164 S IENS="1,"_$O(DIQOUT(FILENUM,""))
    173165 S DIQOUT(SFN,IENS,.01)=$$FMTE^XLFDT($$NOW^XLFDT,"5Z")
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXSI.m

    r628 r636  
    1 PXRMEXSI ; SLC/PKR/PJH - Silent repository entry install. ;09/28/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXSI ; SLC/PKR/PJH - Silent repository entry install. ;12/22/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
     3 ;
     4 ;===================================================
     5BUILD ;Build list manager workfile from ^TMP("PXRMEXTMP" (see ^PXRMEXLB)
     6 N DDATA,DDLG,IND,JND,NLINE,NSEL
     7 S NLINE=0,NSEL=0
     8 S DDLG=$G(^TMP("PXRMEXTMP",$J,"PXRMDNAM")) Q:DDLG=""
     9 ;
     10 ;Save reminder dialog
     11 S DDATA=^TMP("PXRMEXTMP",$J,"DLOC",DDLG)
     12 S IND=$P(DDATA,U,3),JND=$P(DDATA,U,4)
     13 D DSAVE(DDLG,IND,JND)
     14 ;
     15 ;Process sub-components
     16 I $D(^TMP("PXRMEXTMP",$J,"DREPL",DDLG))>0 D DREPL(DDLG)
     17 D DCMP(DDLG)
     18 Q
     19 ;
     20 ;===================================================
     21DCMP(DLG) ;Search for dialog components
     22 N DDLG,DEND,DNAM,DSEQ,DSTRT,IND,JND
     23 S DSEQ=0
     24 F  S DSEQ=$O(^TMP("PXRMEXTMP",$J,"DMAP",DLG,DSEQ)) Q:'DSEQ  D
     25 . S DDATA=^TMP("PXRMEXTMP",$J,"DMAP",DLG,DSEQ)
     26 . S DNAM=$P(DDATA,U),DSTRT=$P(DDATA,U,2),DEND=$P(DDATA,U,3) Q:DNAM=""
     27 . S IND=$P(DDATA,U,4),JND=$P(DDATA,U,5)
     28 .;Save line in workfile
     29 . D DSAVE(DNAM,IND,JND)
     30 .;
     31 . I $D(^TMP("PXRMEXTMP",$J,"DREPL",DNAM))>0 D DREPL(DNAM)
     32 .;Process any sub-components
     33 . I $D(^TMP("PXRMEXTMP",$J,"DMAP",DNAM)) D DCMP(DNAM)
     34 Q
     35 ;
     36 ;===================================================
     37DREPL(DLG,LEV) ;
     38 N DDATA,DDLG,DEND,DNAM,DSEQ,DSTRT,IND,JND
     39 S DDATA=^TMP("PXRMEXTMP",$J,"DREPL",DLG)
     40 S DNAM=$P(DDATA,U),DSTRT=$P(DDATA,U,2),DEND=$P(DDATA,U,3) Q:DNAM=""
     41 S IND=$P(DDATA,U,4),JND=$P(DDATA,U,5)
     42 ;Save line in workfile
     43 D DSAVE(DNAM,IND,JND)
     44 I $D(^TMP("PXRMEXTMP",$J,"DMAP",DNAM)) D DCMP(DNAM)
     45 Q
     46 ;===================================================
     47DSAVE(DNAM,IND,JND) ;Update workfile
     48 ;Ignore national prompts
     49 I $$PXRM^PXRMEXID(DNAM) Q
     50 N DEXIST
     51 S NSEL=NSEL+1
     52 ;Check if dialog exists
     53 S DEXIST=$$EXISTS^PXRMEXIU(801.41,DNAM)
     54 ;Store the file number, start and stop line in the exchange file.
     55 S ^TMP("PXRMEXLD",$J,"SEL",NSEL)=FILENUM_U_IND_U_JND_U_DEXIST
     56 Q
    357 ;
    458 ;===================================================
    559INITMPG ;Initialize ^TMP arrays.
    6  K ^TMP("PXRMEXFND",$J)
    760 K ^TMP("PXRMEXIA",$J)
    8  K ^TMP("PXRMEXIAD",$J)
    961 K ^TMP("PXRMEXLC",$J)
    1062 K ^TMP("PXRMEXLD",$J)
     
    1365 ;
    1466 ;===================================================
    15 INSCOM(PXRMRIEN,ACTION,IND,TEMP,REMNAME,HISTSUB) ;Install component IND
    16  ;of PXRMRIEN.
    17  N ATTR,END,EXISTS,FILENUM,IND120,JND120,NAME
    18  N PT01,RTN,SAME,START,TEXT
     67INSCOM(PXRMRIEN,IND,TEMP,REMNAME) ;Install component IND of PXRMRIEN.
     68 N ACTION,ATTR,END,EXISTS,FILENUM,IND120,JND120,NAME
     69 N PT01,RTN,START
    1970 S FILENUM=$P(TEMP,U,1),EXISTS=$P(TEMP,U,4)
    2071 S IND120=$P(TEMP,U,2),JND120=$P(TEMP,U,3)
    21  I (IND120="")!(JND120="") Q
    2272 S TEMP=^PXD(811.8,PXRMRIEN,120,IND120,1,JND120,0)
    23  ;If the component does not exist then the action has to be "I".
    24  ;If the component exists and the action is "I" change it to "O".
    25  ;If the component exists and the action is "M" leave it "M".
    26  ;If the component exists and the action is "O" leave it "O".
    27  S ACTION=$S('EXISTS:"I",ACTION="I":"O",1:ACTION)
    28  S SAME=0
     73 I (FILENUM=801.41)!(FILENUM=811.5) S ACTION=$S(EXISTS:"M",1:"I")
     74 E  S ACTION=$S(EXISTS:"O",1:"I")
    2975 S START=$P(TEMP,U,2)
    3076 S END=$P(TEMP,U,3)
     77 S TEMP=^PXD(811.8,PXRMRIEN,100,START,0)
    3178 I FILENUM=0 D
    3279 . D RTNLD^PXRMEXIC(PXRMRIEN,START,END,.ATTR,.RTN)
    33  . I EXISTS D
    34  .. D CHECKSUM^PXRMEXCS(.ATTR,START,END)
    35  .. S CSUM=$$RTNCS^PXRMEXCS(ATTR("NAME"))
    36  .. I ATTR("CHECKSUM")=CSUM S SAME=1,ACTION="S"
     80 .;Save what was done for the installation summary.
    3781 . S ^TMP("PXRMEXIA",$J,IND,"ROUTINE",ATTR("NAME"),ACTION)=""
    3882 E  D
    39  . S TEMP=^PXD(811.8,PXRMRIEN,100,START,0)
    4083 . S PT01=$P(TEMP,"~",2)
    41  .;Save reminder name for dialog install.
    42  . I FILENUM=811.9 S REMNAME=PT01
    43  . D SETATTR^PXRMEXFI(.ATTR,FILENUM,PT01)
    44  . I EXISTS D
    45  .. D CHECKSUM^PXRMEXCS(.ATTR,START,END)
    46  .. S CSUM=$$FILE^PXRMEXCS(ATTR("FILE NUMBER"),EXISTS)
    47  .. I ATTR("CHECKSUM")=CSUM S SAME=1,ACTION="S"
     84 . S (ATTR("NAME"),ATTR("PT01"))=PT01
     85 . D SETATTR^PXRMEXFI(.ATTR,FILENUM)
    4886 .;Save what was done for the installation summary.
    49  . S ^TMP(HISTSUB,$J,IND,ATTR("FILE NAME"),PT01,ACTION)=""
    50  ;If the packed component and the installed component are the same
    51  ;there is nothing to do.
    52  I SAME Q
     87 . S ^TMP("PXRMEXIA",$J,IND,ATTR("FILE NAME"),PT01,ACTION)=""
    5388 ;Install this component.
    5489 I FILENUM=0 D RTNSAVE^PXRMEXIC(.RTN,ATTR("NAME"))
    5590 E  D FILE^PXRMEXIC(PXRMRIEN,EXISTS,IND120,JND120,ACTION,.ATTR,.PXRMNMCH)
     91 ;Save reminder name
     92 I FILENUM=811.9 S REMNAME=PT01
     93 ;If this component was not installed add to the no install message.
    5694 Q
    5795 ;
    5896 ;===================================================
    59 INSDLG(PXRMRIEN,ACTION) ;Install dialog components directly
    60  ;from the "SEL" array.
    61  N IND,FILENUM,ITEMP,NAME,REMNAME,TEMP
    62  ;Build the selection array in ^TMP("PXRMEXLD",$J,"SEL"). For dialogs
    63  ;the selection array is:
    64  ;file no.^FDA start^FDA end^EXISTS^IND120^JND120^NAME
    65  D BLDDISP^PXRMEXD1(0)
    66  ;Work through the selection array installing the dialog parts
    67  ;in reverse order.
    68  S IND=""
    69  F  S IND=$O(^TMP("PXRMEXLD",$J,"SEL",IND),-1) Q:(IND="")!(PXRMDONE)  D
    70  . S TEMP=^TMP("PXRMEXLD",$J,"SEL",IND)
    71  . S FILENUM=$P(TEMP,U,1),NAME=$P(TEMP,U,7)
    72  .;Dialog elements may be used more than once in a dialog so make sure
    73  .;the element has not already been installed.
    74  . S ITEMP=$P(TEMP,U,1)_U_$P(TEMP,U,5,6)_U_$$EXISTS^PXRMEXIU(FILENUM,NAME)
    75  . D INSCOM(PXRMRIEN,ACTION,IND,ITEMP,.REMNAME,"PXRMEXIAD")
     97INSDLG(PXRMRIEN) ;Install dialog components (in reverse order)
     98 ;
     99 K ^TMP("PXRMEXSI",$J)
     100 N IND,TEMP,JND120,KIDSDONE
     101 ;Build list of components
     102 D BUILD
     103 S IND="",KIDSDONE=0
     104 F  S IND=$O(^TMP("PXRMEXLD",$J,"SEL",IND),-1) Q:'IND!(KIDSDONE=1)  D
     105 . S TEMP=^TMP("PXRMEXLD",$J,"SEL",IND),JND120=$P(TEMP,U,3)
     106 .;Skip install if dialog occurs more than once
     107 . I $D(^TMP("PXRMEXSI",$J,JND120)) Q
     108 . S ^TMP("PXRMEXSI",$J,JND120)=""
     109 .;Silent Dialog Install
     110 . D INSCOM(PXRMRIEN,IND,TEMP,.REMNAME)
     111 K ^TMP("PXRMEXSI",$J)
    76112 Q
    77113 ;
    78114 ;===================================================
    79 INSTALL(PXRMRIEN,ACTION,NOR) ;Install all components in a repository entry.
     115INSTALL(PXRMRIEN,NOR) ;Install all components in a repository entry.
    80116 ;If NOR is true do not install routines.
    81  N DNAME,FILENUM,IND,PXRMDONE,PXRMNMCH,REMNAME,TEMP
    82  S PXRMDONE=0
     117 N DNAME,FILENUM,IND,PXRMNMCH,REMNAME,TEMP
    83118 S NOR=$G(NOR)
    84119 ;Initialize ^TMP globals.
     
    91126 ;Build the selectable list.
    92127 D CDISP^PXRMEXLC(PXRMRIEN)
    93  ;Set the install date and time and type.
     128 ;Set the install date and time.
    94129 S ^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT
    95  S ^TMP("PXRMEXIA",$J,"TYPE")="SILENT"
    96130 ;Initialize the name change storage.
    97131 K PXRMNMCH
    98132 S IND=0
    99  F  S IND=$O(^TMP("PXRMEXLC",$J,"SEL",IND)) Q:(IND="")!(PXRMDONE)  D
     133 F  S IND=$O(^TMP("PXRMEXLC",$J,"SEL",IND)) Q:+IND=0  D
    100134 . S TEMP=^TMP("PXRMEXLC",$J,"SEL",IND)
    101135 . S FILENUM=$P(TEMP,U,1)
     
    103137 . I FILENUM=0,NOR Q
    104138 . ;Install dialog components
    105  . I FILENUM=801.41 N PXRMDONE S PXRMDONE=0 D INSDLG(PXRMRIEN,ACTION) Q
     139 . I FILENUM=801.41 N PXRMDONE S PXRMDONE=0 D INSDLG(PXRMRIEN) Q
    106140 . ;Install component
    107  . E  D INSCOM(PXRMRIEN,ACTION,IND,TEMP,.REMNAME,"PXRMEXIA")
     141 . E  D INSCOM(PXRMRIEN,IND,TEMP,.REMNAME)
    108142 ;
    109143 ;Get the dialog name
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXU1.m

    r628 r636  
    1 PXRMEXU1 ; SLC/PKR/PJH - Reminder exchange repository utilities, #1.;08/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXU1 ; SLC/PKR/PJH - Reminder exchange repository utilities, #1. ;09/20/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;=====================================================
    44CLIST(IEN) ;Build the list of components for the repository
     
    9898 ;
    9999 ;=====================================================
    100 DELHIST(RIEN,IHIEN) ;Delete install history IHIEN in repository entry RIEN.
    101  N DA,DIK
    102  S DA=IHIEN,DA(1)=RIEN
    103  S DIK="^PXD(811.8,"_DA(1)_",130,"
    104  D ^DIK
     100DELHIST(RIEN,IHIND) ;Delete install history IHIND in repository entry RIEN.
     101 N DATE
     102 S DATE=$P(^PXD(811.8,RIEN,130,IHIND,0),U)
     103 K ^PXD(811.8,RIEN,130,IHIND)
     104 K ^PXD(811.8,RIEN,130,"B",DATE)
    105105 Q
    106106 ;
     
    146146RIEN(LIEN) ;Given the list ien return the repository ien.
    147147 N RIEN
    148  S RIEN=$G(^TMP("PXRMEXLR",$J,"SEL",LIEN))
     148 S RIEN=$G(^TMP("PXRMEXLR",$J,"IDX",LIEN,LIEN))
    149149 Q RIEN
    150150 ;
    151151 ;=====================================================
    152152SAVHIST ;Save the installation history in the repository.
    153  N ACTION,DATE,CMPNT,FTYPE,IND,INDEX,ITEM,JND,NEWNAME
    154  N SUB,TEMP,TOTAL,TYPE,USER
     153 N ACTION,DATE,CMPNT,FTYPE,IND,INDEX,ITEM,JND,NEWNAME,TEMP,USER
    155154 ;Find the first open spot in the Installation History node.
    156155 S (IND,JND)=0
    157  F  S IND=+$O(^PXD(811.8,PXRMRIEN,130,IND)) S JND=JND+1 Q:(IND=0)!(IND>JND)
     156 F  S IND=+$O(^PXD(811.8,PXRMRIEN,130,IND)) S JND=JND+1 Q:(IND=0)!(JND>IND)
     157 ;Set the 0 node.
     158 S ^PXD(811.8,PXRMRIEN,130,0)=U_"811.803DA"_U_JND_U_JND
    158159 S IND=JND
    159  S JND=0
    160  F SUB="PXRMEXIA","PXRMEXIAD" D
    161  . S INDEX=0
    162  . F  S INDEX=$O(^TMP(SUB,$J,INDEX)) Q:+INDEX=0  D
    163  .. S JND=JND+1
    164  .. S CMPNT=$O(^TMP(SUB,$J,INDEX,""))
    165  .. S ITEM=$O(^TMP(SUB,$J,INDEX,CMPNT,""))
    166  .. S ACTION=$O(^TMP(SUB,$J,INDEX,CMPNT,ITEM,""))
    167  .. S NEWNAME=$G(^TMP(SUB,$J,INDEX,CMPNT,ITEM,ACTION))
    168  .. S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,0)=INDEX_U_CMPNT_U_ITEM_U_ACTION_U_NEWNAME
    169  ..;Set the 0 node.
    170  .. S ^PXD(811.8,PXRMRIEN,130,IND,1,0)=U_"811.8031A"_U_JND_U_JND
    171  ..;Check for finding item changes and save them.
    172  .. S FTYPE=""
    173  .. I CMPNT["DEFINITION" S FTYPE="DEFF"
    174  .. I CMPNT["DIALOG" S FTYPE="DIAF"
    175  .. I CMPNT["TERM" S FTYPE="TRMF"
    176  .. I (FTYPE'=""),($D(^TMP(SUB,$J,FTYPE))) D
    177  ... N FI,FINDING,KND,OFINDING
    178  ... S KND=2
    179  ... S FI=""
    180  ... F  S FI=$O(^TMP(SUB,$J,FTYPE,FI)) Q:FI=""  D
    181  .... S OFINDING=$O(^TMP(SUB,$J,FTYPE,FI,""))
    182  .... S FINDING=^TMP(SUB,$J,FTYPE,FI,OFINDING)
    183  .... I OFINDING=FINDING Q
     160 S DATE=^TMP("PXRMEXIA",$J,"DT")
     161 S USER=$$GET1^DIQ(200,DUZ,.01,"")
     162 S ^PXD(811.8,PXRMRIEN,130,IND,0)=DATE_U_USER
     163 S ^PXD(811.8,PXRMRIEN,130,"B",DATE,IND)=""
     164 S (INDEX,JND)=0
     165 F  S INDEX=$O(^TMP("PXRMEXIA",$J,INDEX)) Q:+INDEX=0  D
     166 . S JND=JND+1
     167 . S CMPNT=$O(^TMP("PXRMEXIA",$J,INDEX,""))
     168 . S ITEM=$O(^TMP("PXRMEXIA",$J,INDEX,CMPNT,""))
     169 . S ACTION=$O(^TMP("PXRMEXIA",$J,INDEX,CMPNT,ITEM,""))
     170 . S NEWNAME=$G(^TMP("PXRMEXIA",$J,INDEX,CMPNT,ITEM,ACTION))
     171 . S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,0)=INDEX_U_CMPNT_U_ITEM_U_ACTION_U_NEWNAME
     172 .;Set the 0 node.
     173 . S ^PXD(811.8,PXRMRIEN,130,IND,1,0)=U_"811.8031A"_U_JND_U_JND
     174 .;Check for finding item changes and save them.
     175 . S FTYPE=""
     176 . I CMPNT["DEFINITION" S FTYPE="DEFF"
     177 . I CMPNT["DIALOG" S FTYPE="DIAF"
     178 . I CMPNT["TERM" S FTYPE="TRMF"
     179 . I (FTYPE'=""),($D(^TMP("PXRMEXIA",$J,FTYPE))) D
     180 .. N FI,FINDING,KND,OFINDING
     181 .. S KND=2
     182 .. S FI=""
     183 .. F  S FI=$O(^TMP("PXRMEXIA",$J,FTYPE,FI)) Q:FI=""  D
     184 ... S OFINDING=$O(^TMP("PXRMEXIA",$J,FTYPE,FI,""))
     185 ... S FINDING=^TMP("PXRMEXIA",$J,FTYPE,FI,OFINDING)
     186 ... I OFINDING=FINDING Q
     187 ... S KND=KND+1
     188 ... S TEMP=$E(OFINDING,1,33)
     189 ... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,KND,0)="    "_TEMP_$$INSCHR^PXRMEXLC((35-$L(TEMP))," ")_FINDING
     190 .. S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,0)=U_"811.80315A"_U_KND_U_KND
     191 .. I KND>2 D
     192 ... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,1,0)="   Finding Changes"
     193 ... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,2,0)="     Original"_$$INSCHR^PXRMEXLC(27," ")_"New"
     194 .;
     195 .;Check for TIU template replacements and save them.
     196 . I CMPNT["DIALOG" S FTYPE="DIATIU"
     197 . E  S FTYPE=""
     198 . I (FTYPE'=""),($D(^TMP("PXRMEXIA",$J,FTYPE))) D
     199 .. N KND,OTIUT,TIUT,TYPE
     200 .. S TYPE=""
     201 .. S KND=2
     202 .. F  S TYPE=$O(^TMP("PXRMEXIA",$J,FTYPE,TYPE)) Q:TYPE=""  D
     203 ... S OTIUT=""
     204 ... F  S OTIUT=$O(^TMP("PXRMEXIA",$J,FTYPE,TYPE,OTIUT)) Q:OTIUT=""  D
     205 .... S TIUT=$G(^TMP("PXRMEXIA",$J,FTYPE,TYPE,OTIUT))
     206 .... I OTIUT=TIUT Q
     207 .... I '$D(^TMP("PXRMEXIA",$J,FTYPE,TYPE,OTIUT,ITEM)) Q
    184208 .... S KND=KND+1
    185  .... S TEMP=$E(OFINDING,1,33)
    186  .... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,KND,0)="    "_TEMP_$$INSCHR^PXRMEXLC((35-$L(TEMP))," ")_FINDING
     209 .... S TEMP=$E(OTIUT,1,33)
     210 .... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,KND,0)="    "_TEMP_$$INSCHR^PXRMEXLC((35-$L(TEMP))," ")_TIUT
    187211 ... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,0)=U_"811.80315A"_U_KND_U_KND
    188212 ... I KND>2 D
    189  .... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,1,0)="   Finding Changes"
     213 .... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,1,0)="   "_TYPE
    190214 .... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,2,0)="     Original"_$$INSCHR^PXRMEXLC(27," ")_"New"
    191  ..;
    192  ..;Check for TIU template replacements and save them.
    193  .. I CMPNT["DIALOG" S FTYPE="DIATIU"
    194  .. E  S FTYPE=""
    195  .. I (FTYPE'=""),($D(^TMP(SUB,$J,FTYPE))) D
    196  ... N KND,OTIUT,TIUT,TYPE
    197  ... S TYPE=""
    198  ... S KND=2
    199  ... F  S TYPE=$O(^TMP(SUB,$J,FTYPE,TYPE)) Q:TYPE=""  D
    200  .... S OTIUT=""
    201  .... F  S OTIUT=$O(^TMP(SUB,$J,FTYPE,TYPE,OTIUT)) Q:OTIUT=""  D
    202  ..... S TIUT=$G(^TMP(SUB,$J,FTYPE,TYPE,OTIUT))
    203  ..... I OTIUT=TIUT Q
    204  ..... I '$D(^TMP(SUB,$J,FTYPE,TYPE,OTIUT,ITEM)) Q
    205  ..... S KND=KND+1
    206  ..... S TEMP=$E(OTIUT,1,33)
    207  ..... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,KND,0)="    "_TEMP_$$INSCHR^PXRMEXLC((35-$L(TEMP))," ")_TIUT
    208  .... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,0)=U_"811.80315A"_U_KND_U_KND
    209  .... I KND>2 D
    210  ..... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,1,0)="   "_TYPE
    211  ..... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,2,0)="     Original"_$$INSCHR^PXRMEXLC(27," ")_"New"
    212  ;If JND is still 0 then there was nothing to save.
    213  I JND>0 D
    214  .;Save the header information.
    215  . S DATE=^TMP("PXRMEXIA",$J,"DT")
    216  . S TYPE=^TMP("PXRMEXIA",$J,"TYPE")
    217  . S USER=$$GET1^DIQ(200,DUZ,.01,"")
    218  . S ^PXD(811.8,PXRMRIEN,130,IND,0)=DATE_U_USER_U_TYPE
    219  . S ^PXD(811.8,PXRMRIEN,130,"B",DATE,IND)=""
    220  .;Set the 0 node.
    221  . S (KND,TOTAL)=0
    222  . F  S KND=+$O(^PXD(811.8,PXRMRIEN,130,KND)) Q:KND=0  S TOTAL=TOTAL+1
    223  . S ^PXD(811.8,PXRMRIEN,130,0)=U_"811.803DA"_U_IND_U_TOTAL
    224215 K ^TMP("PXRMEXIA",$J)
    225  K ^TMP("PXRMEXIAD",$J)
    226  Q
    227  ;
     216 Q
     217 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXU2.m

    r628 r636  
    1 PXRMEXU2 ; SLC/PKR/PJH - Reminder exchange repository utilities, #2. ;11/21/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXU2 ; SLC/PKR/PJH - Reminder exchange repository utilities, #2. ;09/20/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;=====================================================
    44FDA(IND,LC,TMPIND,FILENAME) ;Build the XML FDA output.
     
    5959 S ^TMP("PXRMEXRS",$J,1,0)="<?xml version=""1.0"" standalone=""yes""?>"
    6060 S ^TMP("PXRMEXRS",$J,2,0)="<REMINDER_EXCHANGE_FILE_ENTRY>"
    61  S VERSN=$P(^PXRM(800,1,"VERSION"),U,1)
     61 S VERSN=^PXRM(800,1,"VERSION")
    6262 S ^TMP("PXRMEXRS",$J,3,0)="<PACKAGE_VERSION>"_VERSN_"</PACKAGE_VERSION>"
    6363 ;The pointer to the index will be on line 4 so leave room.
     
    101101 . S ^TMP($J,"CIND",NCMPNT,"M_ROUTINE_START")=LC
    102102 . S LC=LC+1,^TMP("PXRMEXRS",$J,LC,0)="<ROUTINE_NAME>"_RNAME_"</ROUTINE_NAME>"
    103  . S LC=LC+1,^TMP("PXRMEXRS",$J,LC,0)="<CHECKSUM>"_^TMP("PXRMEXCS",$J,"ROUTINE",RNAME)_"</CHECKSUM>"
    104103 . S LC=LC+1,^TMP("PXRMEXRS",$J,LC,0)="<CODE>"
    105104 . S LC=LC+1,^TMP("PXRMEXRS",$J,LC,0)="<![CDATA["
     
    138137 ... S ^TMP("PXRMEXRS",$J,LC,0)="<POINT_01>"_$$TOXML^PXRMEXU3(PT01)_"</POINT_01>"
    139138 ... S LC=LC+1,^TMP("PXRMEXRS",$J,LC,0)="<INTERNAL_ENTRY_NUMBER>"_+SIENS_"</INTERNAL_ENTRY_NUMBER>"
    140  ... S LC=LC+1,^TMP("PXRMEXRS",$J,LC,0)="<CHECKSUM>"_^TMP("PXRMEXCS",$J,IND,FILENAME)_"</CHECKSUM>"
    141139 ... S ^TMP($J,"CIND",NCMPNT,"FDA_START")=LC+3
    142140 ... D FDA(IND,.LC,TMPIND,FILENAME)
     
    180178 . S DESL("SOURCE")=^TMP(TMPIND,$J,"SRC","USER")_" at "_^TMP(TMPIND,$J,"SRC","SITE")
    181179 . S DESL("DATEP")=^TMP(TMPIND,$J,"SRC","DATE")
    182  . S DESL("VRSN")=VERSN
     180 . S DESL("VRSN")=$G(^PXRM(800,1,"VERSION"))
    183181 . S DESC="^TMP(TMPIND,$J,""DESC"")"
    184182 . S KEYWORD="^TMP(TMPIND,$J,""KEYWORD"")"
    185183 . D DESC^PXRMEXU1(IENROOT(1),.DESL,$NA(@DESC),$NA(@KEYWORD))
    186  K ^TMP($J,"CIND"),^TMP("PXRMEXRS",$J)
    187  K ^TMP(TMPIND,$J),^TMP("PXRMEXCS",$J)
     184 K ^TMP($J,"CIND")
     185 K ^TMP("PXRMEXRS",$J)
     186 K ^TMP(TMPIND,$J)
    188187 Q
    189188 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXU4.m

    r628 r636  
    1 PXRMEXU4 ; SLC/PJH,PKR - Reminder Exchange #4, dialog changes. ;05/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMEXU4 ; SLC/PJH,PKR - Reminder Exchange #4, dialog changes. ;01/19/2005
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;===============================================
    44DLG(FDA,NAMECHG) ;Check the dialog for renamed entries, called by
     
    1515 D BLDALIST^PXRMVPTR(801.4118,.01,.ALIST)
    1616 ;Plus field 15 files
    17  ;S ALIST("MH")=601,ALIST("TX")=811.2
    18  S ALIST("MH")=601.71,ALIST("TX")=811.2
     17 S ALIST("MH")=601,ALIST("TX")=811.2
    1918 S ALIST("WH")=790.404
    2019 ;Plus field 17 file
     
    186185 .. I Y="" S ACTION="Q" Q
    187186 .. I Y'="" S FDA(801.412,IENS,2)=$P(Y,U,2)
    188  ;Process Result Groups
    189  F  S IENS=$O(FDA(801.41121,IENS)) Q:IENS=""  D  I ACTION="Q" K FDA S (PXRMDONE,KIDSDONE)=1 Q
    190  . S PT01=$G(FDA(801.41121,IENS,.01)) Q:PT01=""
    191  . S FILENUM=801.41,NEWNAM=$G(NAMECHG(FILENUM,PT01))
    192  .I NEWNAM'="" D
    193  .. S FDA(801.41121,IENS,2)=NEWNAM,PT01=NEWNAM
    194  .S IEN=$$EXISTS^PXRMEXIU(FILENUM,PT01)
    195  .I IEN=0 D
    196  ..;Get replacement
    197  .. N DIC,DIR,DUOUT,MSG,X,Y
    198  .. S MSG(1)=" "
    199  .. S MSG(2)="RESULT GROUP entry "_PT01_" does not exist."
    200  .. D MES^XPDUTL(.MSG)
    201  .. S ACTION=$$GETACT^PXRMEXIU("DPQ",.DIR)
    202  .. I ACTION="S" S ACTION="Q"
    203  .. I ACTION="Q" Q
    204  .. I ACTION="D" K FDA(801.41121,IENS) Q
    205  .. S DIC=FILENUM
    206  .. S DIC(0)="AEMNQ"
    207  .. S DIC("S")="I ""S""[$P(^PXRMD(801.41,Y,0),U,4)"
    208  .. S Y=-1
    209  .. F  Q:+Y'=-1  D
    210  ...;If this is being called during a KIDS install we need echoing on.
    211  ... I $D(XPDNM) X ^%ZOSF("EON")
    212  ... D ^DIC
    213  ... I $D(XPDNM) X ^%ZOSF("EOFF")
    214  ... I $D(DUOUT) S Y="" Q
    215  ... I Y=-1 D BMES^XPDUTL("You must input a replacement!")
    216  .. I Y="" S ACTION="Q" Q
    217  .. I Y'="" S FDA(801.41121,IENS,.01)=$P(Y,U,2)
    218187 Q
    219188 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMFF.m

    r628 r636  
    1 PXRMFF ;SLC/PKR - Clinical Reminders function finding evaluation. ;3/29/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMFF ;SLC/PKR - Clinical Reminders function finding evaluation. ;07/17/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;===========================================
    44EVAL(DFN,DEFARR,FIEVAL) ;Evaluate function findings.
     
    7070 . S LNAME(IND)="PXRMFF"_IND
    7171 . K ^TMP($J,LNAME(IND))
    72  . D EVALPL^PXRMTERL(.FINDPA,.TERMARR,LNAME(IND))
     72 . D EVALPL^PXRMTERM(.FINDPA,.TERMARR,LNAME(IND))
    7373 .;Get rid of the false part of the list.
    7474 . K ^TMP($J,LNAME(IND),0)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMFF0.m

    r628 r636  
    1 PXRMFF0 ;SLC/PKR - Clinical Reminders function finding routines. ;09/11/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMFF0 ;SLC/PKR - Clinical Reminders function finding routines. ;06/23/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;============================================
     
    8282 ;
    8383 ;============================================
    84 NUMERIC(LIST,FIEVAL,VALUE) ;Given a finding, return the first numeric
    85  ;portion of one of the "CSUB" values. Based on original work
    86  ;by R. Silverman.
    87  S VALUE=$G(FIEVAL(LIST(1),LIST(2),LIST(3)))
    88  S VALUE=$$FIRSTNUM(VALUE)
    89  Q
    90  ;
    91 FIRSTNUM(STRING) ;return the first numeric portion of a string.
    92  N CHAR,DONE,IND,NUMBER,NUMERIC
    93  S NUMERIC="+-.1234567890"
    94  S STRING=$TR(STRING," ")
    95  S DONE=0,IND=0,NUMBER=""
    96  F  Q:DONE  D
    97  . S IND=IND+1,CHAR=$E(STRING,IND)
    98  . I CHAR="" S DONE=1 Q
    99  . I NUMERIC[CHAR S NUMBER=NUMBER_CHAR
    100  . I NUMBER'="",NUMERIC'[CHAR S DONE=1
    101  Q +NUMBER
    102  ;
    103  ;============================================
    10484VALUE(LIST,FIEVAL,VALUE) ;Given a finding return one of its "CSUB"
    10585 ;values.
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMFFAT.m

    r628 r636  
    1 PXRMFFAT ;SLC/PKR - Function Finding argument type routines. ;09/11/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMFFAT ;SLC/PKR - Function Finding argument type routines. ;08/03/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;============================================
     
    4848 ;
    4949 ;============================================
    50 NUMERIC(AN) ;
    51  Q $S(AN=1:"F",AN=2:"N",AN=3:"S",1:"U")
    52  ;
    53  ;============================================
    5450VALUE(AN) ;
    5551 Q $S(AN=1:"F",AN=2:"N",AN=3:"S",1:"U")
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMFFDB.m

    r628 r636  
    1 PXRMFFDB ;SLC/PKR - Function finding data structure builder. ;10/31/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMFFDB ;SLC/PKR - Function finding data structure builder. ;06/22/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;===========================================
     
    6868 N PFSTACK,REPL,RS,TEMP,TS,XS
    6969 S IENB=DA_","_DA(1)_","
    70  S OPER="!&-+<>='"
     70 S OPER="!&<>='"
    7171 S XS=$$PSPACE(X)
    7272 D POSTFIX^PXRMSTAC(XS,OPER,.PFSTACK)
     
    140140PSPACE(OPR) ;OPR is an operand in a function finding, if some portion
    141141 ;of OPR is a string translate a space into "~" so it is preserved.
    142  ;Note this will work for the entire function string.
    143  N DONE,END,START,TNS,TS
    144  S DONE=0,END=1
    145  F  Q:DONE  D
    146  . S START=$F(OPR,"""",END)
    147  . I START=0 S DONE=1 Q
    148  . S END=$F(OPR,"""",START)
    149  . S TS=$E(OPR,START,END-2)
    150  . S TNS=$TR(TS," ","~")
    151  . S OPR=$$STRREP^PXRMUTIL(OPR,TS,TNS)
     142 N END,START,TNS,TS
     143 S START=$F(OPR,"""")
     144 I START=0 Q OPR
     145 S END=$F(OPR,"""",START)-2
     146 S TS=$E(OPR,START,END)
     147 S TNS=$TR(TS," ","~")
     148 S OPR=$$STRREP^PXRMUTIL(OPR,TS,TNS)
    152149 Q OPR
    153150 ;
     
    198195 N DAI,DATE,FUNIEN,IND,LIST,MFUN,OPER,PFSTACK,TEMP,TEXT,VALID
    199196 S DAI=DA(1)
    200  S OPER="!&-+<>='"
     197 S OPER="!&<>='"
    201198 ;Define the allowed M functions.
    202199 S MFUN("$P")=""
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMGECN.m

    r628 r636  
    1 PXRMGECN ;SLC/JVS GEC-Score Reports-cont'd ;06/01/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMGECN ;SLC/JVS GEC-Score Reports-cont'd ;6/19/03  20:58
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 Q
    44SUM ;By Summary by Patient
    55 N CAT,HF,DATE,DFN,Y,HFN,CNTREF,X,REFNUM,SUM,GSUM,CATDANA
    6  N DATER,SDATE,SCNT
     6 N DATER,SDATE
    77 D E^PXRMGECV("HS1",1,BDT,EDT,"F",DFNONLY)
    88 I FORMAT="D" S FOR=0
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMHF.m

    r628 r636  
    1 PXRMHF ; SLC/PKR - Handle Health Factor findings. ;06/01/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMHF ; SLC/PKR - Handle Health Factor findings. ;12/23/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;=====================================================
     
    142142 N EM,FIEN,IND,JND,LVL,NOUT,PNAME,TEMP,TEXTOUT,VDATE
    143143 S FIEN=$P(IFIEVAL("FINDING"),";",1)
    144  ;DBIA #3083
    145144 S PNAME=$P(^AUTTHF(FIEN,0),U,1)
    146145 S NLINES=NLINES+1
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMINDC.m

    r628 r636  
    1 PXRMINDC ; SLC/PKR - Index counting routines. ;03/06/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMINDC ; SLC/PKR - Index counting routines. ;04/20/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;========================================================
    55CNT5(FILENUM,COUNT) ;Get date counts for indexes where the date
    66 ;is at subscript 5. Works for file numbers:
    7  ;63, 70, 120.5, 601.2, 601.84,
     7 ;63, 70, 120.5, 601.2,
    88 ;9000010.11, 9000010.12, 9000010.13, 9000010.16, 9000010.23
    99 N DAS,DATE,DFN,IND,ITEM,YEAR
     
    177177 S ROUTINE(120.5)="CNT5^PXRMINDC"
    178178 S ROUTINE(601.2)="CNT5^PXRMINDC"
    179  S ROUTINE(601.84)="CNT5^PXRMINDC"
    180179 S ROUTINE(9000011)="CNTPL^PXRMINDC"
    181180 S ROUTINE(9000010.07)="CNT6^PXRMINDC"
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMINDD.m

    r628 r636  
    1 PXRMINDD ; SLC/PKR - Index string date checking routines. ;03/06/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMINDD ; SLC/PKR - Index string date checking routines. ;05/02/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;========================================================
    55CNT5(FILENUM,NSD) ;Check for string dates for indexes where the date
    66 ;is at subscript 5. Works for file numbers:
    7  ;63, 70, 120.5, 601.2, 601.84
     7 ;63, 70, 120.5, 601.2,
    88 ;9000010.11, 9000010.12, 9000010.13, 9000010.16, 9000010.23
    99 N DAS,DATE,DFN,IND,ITEM
     
    177177 S ROUTINE(120.5)="CNT5^PXRMINDD"
    178178 S ROUTINE(601.2)="CNT5^PXRMINDD"
    179  S ROUTINE(601.84)="CNT5^PXRMINDD"
    180179 S ROUTINE(9000011)="CNTPL^PXRMINDD"
    181180 S ROUTINE(9000010.07)="CNT6^PXRMINDD"
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMINDL.m

    r628 r636  
    1 PXRMINDL ; SLC/PKR - List building routines. ;07/26/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMINDL ; SLC/PKR - List building routines. ;07/17/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;================================================
    44EVALPL(FINDPA,ENODE,TERMARR,PLIST) ;General patient list term evaluator.
     
    2525 N DAS,DATE,DFN,DS,NFOUND
    2626 K ^TMP($J,PLIST)
    27  I FILENUM=601.84 D SEVALPL^PXRMMH(ITEM,NOCC,BDT,EDT,PLIST) Q
     27 I FILENUM=601.2 D SEVALPL^PXRMMH(ITEM,NOCC,BDT,EDT,PLIST) Q
    2828 S DS=$S(EDT[".":EDT+.0000001,1:EDT+.240001)
    2929 S DFN=0
     
    8484 D SSPAR^PXRMUTIL(PFINDPA(0),.NOCC,.BDT,.EDT)
    8585 S INVFD=$P(PFINDPA(0),U,16)
     86 S NOCC=$S(NOCC<0:-NOCC,1:NOCC)
    8687 D GETSTATI^PXRMSTAT(FILENUM,.PFINDPA,.STATUSA)
    8788 D SCPAR^PXRMCOND(.PFINDPA,.CASESEN,.COND,.UCIFS,.ICOND,.VSLIST)
    88  ;Ignore any negative occurrence counts, date reversal not allowed
    89  ;in patient lists.
    90  S NOCC=$S(NOCC<0:-NOCC,1:NOCC)
    91  S NGET=$S(UCIFS:50,$D(STATUSA):50,1:NOCC)
     89 S NGET=$S(UCIFS:"*",$D(STATUSA):"*",1:NOCC)
    9290 I SSFIND D FPLISTSS(FILENUM,SNODE,ITEM,NGET,BDT,EDT,USESTRT,TGLIST)
    9391 I 'SSFIND D FPLIST(FILENUM,SNODE,ITEM,NGET,BDT,EDT,TGLIST)
     
    104102 .. I PFINDPA(0)["LAB(60" S DAS=ITEM_"~"_DAS
    105103 ..;If this is a Mental Health finding attach the scale to DAS.
    106  .. I PFINDPA(0)["YTT(601.71" S DAS=DAS_"S"_$P(PFINDPA(0),U,12)
     104 .. I PFINDPA(0)["YTT(601" S DAS=DAS_"S"_$P(PFINDPA(0),U,12)
    107105 .. D GETDATA^PXRMDATA(FILENUM,DAS,.FIEVD)
    108106 .. S VALUE=$G(FIEVD("VALUE"))
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMINDX.m

    r628 r636  
    1 PXRMINDX ; SLC/PKR - Routines for utilizing the index. ;10/11/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMINDX ; SLC/PKR - Routines for utilizing the index. ;07/17/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;Code for patient findings.
    44 ;================================================================
     
    5858 S SDIR=$S(NOCC<0:+1,1:-1)
    5959 S NOCC=$S(NOCC<0:-NOCC,1:NOCC)
    60  S NGET=$S(UCIFS:50,1:NOCC)
     60 S NGET=$S(UCIFS:"*",1:NOCC)
    6161 ;Determine if this is a finding with a start and stop date.
    6262 S SSFIND=$S(FILENUM=52:1,FILENUM["55":1,FILENUM=100:1,1:0)
     
    7575 . I PFINDPA(0)["LAB(60" S DAS=ITEM_"~"_DAS
    7676 .;If this is a Mental Health finding attach the scale to DAS.
    77  . I PFINDPA(0)["YTT(601.71" S DAS=DAS_"S"_$P(PFINDPA(0),U,12)
     77 . I PFINDPA(0)["YTT(601" S DAS=DAS_"S"_$P(PFINDPA(0),U,12)
    7878 . D GETDATA^PXRMDATA(FILENUM,DAS,.FIEVD)
    7979 . I INVFD D GETDATA^PXRMVSIT(FIEVD("VISIT"),.FIEVD,0)
     
    101101 ;data for regular files. FLIST is returned in date order, i.e.,
    102102 ;FLIST(1) is the most recent SDIR=-1, oldest SDIR=+1.
    103  I FILENUM=601.84 D SEVALFI^PXRMMH(DFN,ITEM,NGET,SDIR,BDT,EDT,.NFOUND,.FLIST) Q
     103 I FILENUM=601.2 D SEVALFI^PXRMMH(DFN,ITEM,NGET,SDIR,BDT,EDT,.NFOUND,.FLIST) Q
    104104 N DAS,DATE,DONE,EDTT
    105105 S EDTT=$S(EDT[".":EDT+.0000001,1:EDT+.240001)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMISE.m

    r628 r636  
    1 PXRMISE ; SLC/PKR - Index size estimating routines. ;03/13/2006
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMISE ; SLC/PKR - Index size estimating routines. ;01/12/2005
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;========================================================
     
    3737 W !,"Queue the Clinical Reminders index size estimation."
    3838 S DIR("A",1)="Enter the date and time you want the job to start."
    39  S DIR("A",2)="It must be after "_$$FMTE^XLFDT(MINDT,"5Z")
    40  S DIR("A")="Start the task at: "
     39 S DIR("A")="It must be after "_$$FMTE^XLFDT(MINDT,"5Z")_" "
    4140 S DIR(0)="DAU"_U_MINDT_"::RSX"
    4241 D ^DIR
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLCD.m

    r628 r636  
    1 PXRMLCD ; SLC/PKR - Reminder Patient List Patients ;11/02/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMLCD ; SLC/PKR - Reminder Patient List Patients ;06/30/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;Display list creation documentation.
     
    1212 S IND="",PXRMDONE=0
    1313 F  S IND=$O(VALMY(IND)) Q:(IND="")!(PXRMDONE)  D
    14  . S LISTIEN=^TMP("PXRMLPU",$J,"SEL",IND)
     14 . S LISTIEN=^TMP("PXRMLPU",$J,"IDX",IND,IND)
    1515 . D EN^PXRMLCD(LISTIEN)
    1616 S VALMBCK="R"
     
    4040 ;===========================================================
    4141HDR ; Header code
    42  S VALMHDR(1)="Documentation for creation of patient list:"
    43  S VALMHDR(2)=" "_$P(^PXRMXP(810.5,LISTIEN,0),U,1)
     42 S VALMHDR(1)="Documentation for creation of patient list "_$P(^PXRMXP(810.5,LISTIEN,0),U,1)
    4443 S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
    4544 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLCR.m

    r628 r636  
    1 PXRMLCR ; SLC/PJH - Create Patient List from individual finding rule; 10/18/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMLCR ; SLC/PJH - Create Patient List from individual finding rule; 08/03/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ; Called from PXRM PATIENT LIST CREATE protocol
     
    3737TPAT S PXRMTPAT=$$ASKYN^PXRMEUT("N","Include test patients on the list")
    3838 Q:$D(DTOUT)  G:$D(DUOUT) DPAT
    39  I $G(PXRMDEBG) D RUN^PXRMLCR(PXRMRULE,PXRMLIST,PXRMNODE,BEG,END,PXRMDPAT,PXRMTPAT) Q
    4039 ;Build patient list in background
    4140 N ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
     
    8584 ;
    8685 I CALL=4 D
    87  .S HTEXT(1)="Enter Y to turn on debug output."
    88  .S HTEXT(2)="The debug output will send a series of MailMan messages to the requestor of the report"
    89  .S HTEXT(3)="-**WARNING**- the reminder report will take longer to run if you turn on this option!"
     86 .S HTEXT(1)="Enter Y to turn on Debug output."
     87 .S HTEXT(2)="The debug output will send a series of mailman message to the requestor of the report"
     88 .S HTEXT(3)="**WARNING** the reminder report will take longer to run if you turn on this option!"
    9089 D HELP^PXRMEUT(.HTEXT)
    9190 Q
     
    9695 S DIC("A")=TEXT
    9796 S DIC("S")="I $P($G(^(100)),U)'=""N"""
    98  ;If this is a new entry save the creator, make the TYPE public and
    99  ;CLASS local.
    100  S DIC("DR")=".07///`"_DUZ_";.08///PUB;100///L"
     97 S DIC("DR")="100///L"
    10198 W !
    10299 D ^DIC
     
    158155RUN(PXRMRULE,PXRMLIST,PXRMNODE,BEG,END,PXRMDPAT,PXRMTPAT) ;
    159156 ;Process rule set and update final patient list
    160  D START^PXRMRULE(PXRMRULE,PXRMLIST,PXRMNODE,BEG,END,"","","",PXRMDPAT,PXRMTPAT,"")
     157 D START^PXRMRULE(PXRMRULE,PXRMLIST,PXRMNODE,BEG,END,"","","",PXRMDPAT,PXRMTPAT)
    161158 ;Clear ^TMP lists created for rule
    162159 D CLEAR^PXRMRULE(PXRMRULE,PXRMNODE)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLIST.m

    r628 r636  
    1 PXRMLIST ; SLC/PKR/PJH - Clinical Reminders list functions. ;07/17/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMLIST ; SLC/PKR/PJH - Clinical Reminders list functions. ;10/04/2000
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;Used in the reminder exchange utility for building lists of
    44 ;reminders, Exchange File entries, etc.
     
    1111 ;
    1212 ;=======================================================
    13 FMT(NUMBER,NAME,SOURCE,DATE,FMTSTR,NL,OUTPUT) ;Format  entry number, name,
    14  ;source, and date packed for LM display.
    15  N TEMP,TSOURCE
    16  S TEMP=NUMBER_U_NAME
     13FRE(NUMBER,NAME,SOURCE,DATE) ;Format  entry number, name, source,
     14 ;and date packed.
     15 N TEMP,TNAME,TSOURCE
     16 S TEMP=$$RJ^XLFSTR(NUMBER,4," ")
     17 S TNAME=$E(NAME,1,27)
     18 S TEMP=TEMP_"  "_$$LJ^XLFSTR(TNAME,29," ")
    1719 S TSOURCE=$E($P(SOURCE,",",1),1,12)_"@"_$E($P(SOURCE," at ",2),1,12)
    18  S TEMP=TEMP_U_TSOURCE
     20 S TEMP=TEMP_$$LJ^XLFSTR(TSOURCE,23," ")
    1921 S DATE=$$FMTE^XLFDT(DATE,"5Z")
    20  S TEMP=TEMP_U_DATE
    21  D COLFMT^PXRMTEXT(FMTSTR,TEMP," ",.NL,.OUTPUT)
    22  Q
     22 S TEMP=TEMP_"  "_$$LJ^XLFSTR(DATE,30," ")
     23 Q TEMP
    2324 ;
    2425 ;=======================================================
     
    7475 ;
    7576 ;=======================================================
    76 REXL(RLIST) ;Build a list of exchange repository entries.
    77  N DATE,EXIEN,FMTSTR,IND,NAME,NL,NUM,OUTPUT,SOURCE,STR
     77RE(RLIST,IEN) ;Build a list of repository entries.
     78 N DATE,IND,NAME,SOURCE
    7879 ;Build the list in alphabetical order.
    79  S FMTSTR=$$LMFMTSTR^PXRMTEXT(.VALMDDF,"RLLL")
    80  S (NUM,VALMCNT)=0
     80 S VALMCNT=0
    8181 S NAME=""
    8282 F  S NAME=$O(^PXD(811.8,"B",NAME)) Q:NAME=""  D
    8383 . S DATE=""
    8484 . F  S DATE=$O(^PXD(811.8,"B",NAME,DATE)) Q:DATE=""  D
    85  .. S EXIEN=$O(^PXD(811.8,"B",NAME,DATE,""))
    86  .. S SOURCE=$P(^PXD(811.8,EXIEN,0),U,2)
    87  .. S NUM=NUM+1
    88  .. S ^TMP(RLIST,$J,"SEL",NUM)=EXIEN
    89  .. D FMT(NUM,NAME,SOURCE,DATE,FMTSTR,.NL,.OUTPUT)
    90  .. F IND=1:1:NL D
    91  ... S VALMCNT=VALMCNT+1,^TMP(RLIST,$J,VALMCNT,0)=OUTPUT(IND)
    92  ... S ^TMP(RLIST,$J,"IDX",VALMCNT,NUM)=""
    93  S ^TMP(RLIST,$J,"VALMCNT")=VALMCNT
     85 .. S IND=$O(^PXD(811.8,"B",NAME,DATE,""))
     86 .. S SOURCE=$P(^PXD(811.8,IND,0),U,2)
     87 .. S VALMCNT=VALMCNT+1
     88 .. S RLIST(VALMCNT,0)=$$FRE(VALMCNT,NAME,SOURCE,DATE)
     89 .. S IEN(VALMCNT)=IND
     90 S RLIST("VALMCNT")=VALMCNT
    9491 Q
    9592 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLLED.m

    r628 r636  
    1 PXRMLLED ; SLC/PJH - Edit a location list. ;06/25/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMLLED ; SLC/PJH - Edit a location list. ;12/23/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;================================================================
     
    6464 S DR(2,810.9001)=".01;1"
    6565 D ^DIE
    66  I $D(Y) G RD
     66 I $D(Y) G DES
    6767 ;
    6868 ;Hospital Locations
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLOCF.m

    r628 r636  
    1 PXRMLOCF ; SLC/PKR - Handle location findings. ;10/11/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMLOCF ; 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 findings.
    44 ;=================================================
    55ALL(FILENUM,DFN,PFINDPA,FIEVAL) ;Get all Visits with a location
    66 ;for a patient.
    7  N BDT,BTIME,CASESEN,COND,CONVAL,DAS,DATE,DEND,DONE,DS,EDT,FIEVD
    8  N ICOND,INVBD,INVDATE,INVDT,INVED,NFOUND,NOCC
    9  N SAVE,SDIR,TEMP,TIME,UCIFS
     7 N BDT,CASESEN,COND,CONVAL,DAS,DATE,DONE,EDT,ENTYPE,FIEVD,HLOC
     8 N ICOND,IND,NFOUND,NOCC
     9 N SAVE,SDIR,TEMP,UCIFS,VDATE
    1010 ;Set the finding search parameters.
    1111 D SSPAR^PXRMUTIL(PFINDPA(0),.NOCC,.BDT,.EDT)
    12  S SDIR=$S(NOCC<0:-1,1:1)
     12 S SDIR=$S(NOCC<0:+1,1:-1)
    1313 S NOCC=$S(NOCC<0:-NOCC,1:NOCC)
    1414 D SCPAR^PXRMCOND(.PFINDPA,.CASESEN,.COND,.UCIFS,.ICOND,.VSLIST)
    1515 S (DONE,NFOUND)=0
    16  S DEND=$S(EDT[".":EDT,1:EDT+.235959)
    17  S INVBD=9999999-$P(BDT,".",1),BTIME="."_$P(BDT,".",2)
    18  S INVED=9999999-$P(DEND,".",1),ETIME="."_$P(DEND,".",2)
    19  I SDIR=1 S DS=INVED-.000001
    20  I SDIR=-1 S DS=INVBD+.000001
    21  S INVDT=DS,(DONE,NFOUND)=0
     16 I SDIR=1 S VDATE=BDT-.0000001
     17 I SDIR=-1 S VDATE=$S(EDT[".":EDT+.0000001,1:EDT+.240001)
    2218 ;DBIA 2028
    23  F  S INVDT=$O(^AUPNVSIT("AA",DFN,INVDT),SDIR) Q:(DONE)!(INVDT="")  D
    24  . S INVDATE=$P(INVDT,".",1)
    25  . I (SDIR=1),INVDATE>INVBD S DONE=1 Q
    26  . I (SDIR=-1),INVDATE<INVED S DONE=1 Q
    27  . S TIME="."_$P(INVDT,".",2)
    28  . I INVDATE=INVED,TIME>ETIME Q
    29  . I INVDATE=INVBD,TIME<BTIME Q
    30  . S DAS=0
    31  . F  S DAS=$O(^AUPNVSIT("AA",DFN,INVDT,DAS)) Q:(DAS="")!(DONE)  D
    32  .. D GETDATA^PXRMDATA(FILENUM,DAS,.FIEVD)
    33  .. S CONVAL=$S(COND="":1,1:$$COND^PXRMCOND(CASESEN,ICOND,VSLIST,.FIEVD))
    34  .. S SAVE=$S('UCIFS:1,(UCIFS&CONVAL):1,1:0)
    35  .. I SAVE D
    36  ... S TEMP=^AUPNVSIT(DAS,0)
    37  ... S NFOUND=NFOUND+1
    38  ... S FIEVAL(NFOUND)=CONVAL
    39  ... I COND'="" S FIEVAL(NFOUND,"CONDITION")=CONVAL
    40  ... S FIEVAL(NFOUND,"DAS")=DAS
    41  ... S FIEVAL(NFOUND,"DATE")=$P(TEMP,U,1)
    42  ... M FIEVAL(NFOUND)=FIEVD
    43  ... I $G(PXRMDEBG) M FIEVAL(NFOUND,"CSUB")=FIEVD
    44  ... I NFOUND=NOCC S DONE=1
     19 F  S VDATE=+$O(^AUPNVSIT("AET",DFN,VDATE),SDIR) Q:(VDATE=0)!(DONE)  D
     20 . I SDIR=1,VDATE>EDT S DONE=1 Q
     21 . I SDIR=-1,VDATE<BDT S DONE=1 Q
     22 . S HLOC=""
     23 . F  S HLOC=$O(^AUPNVSIT("AET",DFN,VDATE,HLOC)) Q:(HLOC="")!(DONE)  D
     24 .. S ENTYPE=""
     25 .. F  S ENTYPE=$O(^AUPNVSIT("AET",DFN,VDATE,HLOC,ENTYPE)) Q:(ENTYPE="")!(DONE)  D
     26 ... S DAS=0
     27 ... F  S DAS=$O(^AUPNVSIT("AET",DFN,VDATE,HLOC,ENTYPE,DAS)) Q:(DAS="")!(DONE)  D
     28 .... D GETDATA^PXRMDATA(FILENUM,DAS,.FIEVD)
     29 .... S CONVAL=$S(COND'="":$$COND^PXRMCOND(CASESEN,ICOND,VSLIST,.FIEVD),1:1)
     30 .... S SAVE=$S('UCIFS:1,(UCIFS&CONVAL):1,1:0)
     31 .... I SAVE D
     32 ..... S NFOUND=NFOUND+1
     33 ..... S FIEVAL(NFOUND)=CONVAL
     34 ..... I COND'="" S FIEVAL(NFOUND,"CONDITION")=CONVAL
     35 ..... S FIEVAL(NFOUND,"DAS")=DAS
     36 ..... S FIEVAL(NFOUND,"DATE")=VDATE
     37 ..... M FIEVAL(NFOUND)=FIEVD
     38 ..... I $G(PXRMDEBG) M FIEVAL(NFOUND,"CSUB")=FIEVD
     39 ..... I NFOUND=NOCC S DONE=1
    4540 ;Save the finding result.
    46  D SFRES^PXRMUTIL(-SDIR,NFOUND,.FIEVAL)
     41 D SFRES^PXRMUTIL(SDIR,NFOUND,.FIEVAL)
    4742 S FIEVAL("FILE NUMBER")=FILENUM
    4843 Q
     
    9287 ;Set the finding search parameters.
    9388 D SSPAR^PXRMUTIL(PFINDPA(0),.NOCC,.BDT,.EDT)
    94  S SDIR=$S(NOCC<0:-1,1:1)
     89 S SDIR=$S(NOCC<0:+1,1:-1)
     90 S NOCC=$S(NOCC<0:-NOCC,1:NOCC)
    9591 D SCPAR^PXRMCOND(.PFINDPA,.CASESEN,.COND,.UCIFS,.ICOND,.VSLIST)
    96  S NOCC=$S(NOCC<0:-NOCC,1:NOCC)
    97  S NGET=$S(UCIFS:50,$D(STATUSA):50,1:NOCC)
     92 S NGET=$S(UCIFS:"*",$D(STATUSA):"*",1:NOCC)
    9893 ;Get a list of unique locations.
    9994 D LOCLIST(ITEM,"HLOCL")
    100  D FPDAT(DFN,"HLOCL",NGET,SDIR,BDT,EDT,.NFOUND,.FLIST)
     95 D FPDAT(DFN,"HLOCL",NGET,BDT,EDT,.NFOUND,.FLIST)
    10196 I NFOUND=0 S FIEVAL=0 Q
    10297 S NP=0
     
    121116 ;
    122117 ;=================================================
    123 FPDAT(DFN,HLOCL,NOCC,SDIR,BDT,EDT,NFOUND,FLIST) ;Find patient data for
     118FPDAT(DFN,HLOCL,NOCC,BDT,EDT,NFOUND,FLIST) ;Find patient data for
    124119 ;visits at a specified hospital location. Return up to NOCC most
    125120 ;recent entries in FLIST where FLIST(1) is the most recent.
    126  ;"AA" in Visit file is inverse date_.time instead of a full inverse
    127  ;date and time. For example if the date/time is 3030704.104449 then
    128  ;"AA" has 6969295.104449 instead of 6969295.89555
    129  N BTIME,DAS,DATE,DEND,DLIST,DONE,DS,ETIME,HLOC
    130  N INVBD,INVDATE,INVDT,INVED,NF,TEMP,TIME
    131  S DEND=$S(EDT[".":EDT,1:EDT+.235959)
    132  S INVBD=9999999-$P(BDT,".",1),BTIME="."_$P(BDT,".",2)
    133  S INVED=9999999-$P(DEND,".",1),ETIME="."_$P(DEND,".",2)
    134  I SDIR=1 S DS=INVED-.000001
    135  I SDIR=-1 S DS=INVBD+.000001
    136  ;DBIA #2028
    137  S INVDT=DS,(DONE,NFOUND)=0
    138  F  S INVDT=$O(^AUPNVSIT("AA",DFN,INVDT),SDIR) Q:(INVDT="")!(DONE)  D
     121 N DAS,DATE,DLIST,ENTYPE,HLOC,NF
     122 S NFOUND=0
     123 S DATE=$S(EDT[".":EDT+.0000001,1:EDT+.240001)
     124 ;DBIA 2028
     125 F  S DATE=+$O(^AUPNVSIT("AET",DFN,DATE),-1) Q:(DATE=0)!(DATE<BDT)!(NFOUND=NOCC)  D
     126 . S HLOC=""
     127 . F  S HLOC=$O(^TMP($J,HLOCL,HLOC)) Q:(HLOC="")!(NFOUND=NOCC)  D
     128 .. I '$D(^AUPNVSIT("AET",DFN,DATE,HLOC)) Q
     129 .. S NF=0
     130 .. S ENTYPE=""
     131 .. F  S ENTYPE=$O(^AUPNVSIT("AET",DFN,DATE,HLOC,ENTYPE)) Q:(ENTYPE="")!(NFOUND=NOCC)  D
     132 ... S DAS=0
     133 ... F  S DAS=$O(^AUPNVSIT("AET",DFN,DATE,HLOC,ENTYPE,DAS)) Q:(DAS="")!(NFOUND=NOCC)  D
     134 ....;Check the associated appointment for a valid status.
     135 .... I '$$VAPSTAT^PXRMVSIT(DAS) Q
     136 .... S NF=NF+1,NFOUND=NFOUND+1
     137 .... S DLIST(DATE,NF)=DAS
     138 S NFOUND=0
     139 S DATE=""
     140 F  S DATE=$O(DLIST(DATE),-1) Q:DATE=""  D
    139141 . S NF=0
    140  . S INVDATE=$P(INVDT,".",1)
    141  . I (SDIR=1),INVDATE>INVBD S DONE=1 Q
    142  . I (SDIR=-1),INVDATE<INVED S DONE=1 Q
    143  . S TIME="."_$P(INVDT,".",2)
    144  . I INVDATE=INVED,TIME>ETIME Q
    145  . I INVDATE=INVBD,TIME<BTIME Q
    146  . S DAS=0
    147  . F  S DAS=$O(^AUPNVSIT("AA",DFN,INVDT,DAS)) Q:(DAS="")!(DONE)  D
    148  .. S TEMP=^AUPNVSIT(DAS,0)
    149  .. S HLOC=$P(TEMP,U,22)
    150  .. I HLOC="" Q
    151  .. I '$D(^TMP($J,HLOCL,HLOC)) Q
    152  ..;Check the associated appointment for a valid status.
    153  .. I '$$VAPSTAT^PXRMVSIT(DAS) Q
    154  .. S DATE=$P(TEMP,U,1)
    155  .. S NF=NF+1,NFOUND=NFOUND+1
    156  .. I NFOUND=NOCC S DONE=1
    157  .. S DLIST(INVDT,NF)=DAS_U_DATE
    158  S INVDT="",NFOUND=0
    159  F  S INVDT=$O(DLIST(INVDT)) Q:INVDT=""  D
    160  . S NF=0
    161  . F  S NF=$O(DLIST(INVDT,NF)) Q:NF=""  D
     142 . F  S NF=$O(DLIST(DATE,NF)) Q:NF=""  D
    162143 .. S NFOUND=NFOUND+1
    163  .. S FLIST(NFOUND)=DLIST(INVDT,NF)
     144 .. S FLIST(NFOUND)=DLIST(DATE,NF)_U_DATE
    164145 K ^TMP($J,"HLOCL")
    165146 Q
  • 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)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLPAU.m

    r628 r636  
    1 PXRMLPAU ; SLC/AGP - Reminder Patient List ;09/06/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMLPAU ; SLC/AGP - Reminder Patient List ;07/29/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;Main entry point for PXRM PATIENT LIST
     
    8383 Q
    8484 ;
    85 ADD ;add a user
     85ADD ;add a users
    8686 N CREAT,CNT,DIC,DIE,FDA,MSG,USER,Y
    8787 S CREAT=$P($G(^PXRMXP(810.5,IEN,0)),U,7)
     
    105105 I $D(DIROUT) S DTOUT=1
    106106 I $D(DTOUT)!($D(DUOUT)) Q
    107  I $G(Y)="" W !,"A level of control must be entered." H 2 Q
     107 I $G(Y)="" W !,"A status must be enter" H 2 Q
    108108 S YESNO=$E(Y(0))
    109109 S FDA(810.54,"+2,"_IEN_",",.01)=USER
     
    146146HELP(CALL) ;General help text routine
    147147 N HTEXT
     148 ;
    148149 I CALL=1 D
    149  .S HTEXT(1)="Select CO to copy the patient list.\\"
    150  .S HTEXT(2)="Select COE to copy the patient list to an OE/RR Team.\\"
    151  .S HTEXT(3)="Select DE to delete the patient list.\\"
    152  .S HTEXT(4)="Select DSP to display the patient list.\\"
     150 .S HTEXT(1)="Select CO to copy patient list."
     151 .S HTEXT(2)="Select COE to copy patient list to OE/RR Team."
     152 .S HTEXT(3)="Select CR to delete patient list."
     153 .S HTEXT(4)="Select DSP to display patient list."
     154 ;
    153155 D HELP^PXRMEUT(.HTEXT)
    154156 Q
     
    161163 N CREAT,IND,LISTIEN,NODE
    162164 I DUZ'=$P($G(^PXRMXP(810.5,IEN,0)),U,7) D  G PDELEX
    163  .W !,"Only the creator of this list can delete it." H 2
     165 .W !,"Only the creator of this list can delete an user." H 2
    164166 D EN^VALM2(XQORNOD(0))
    165167 ;If there is no list quit.
     
    170172 .S LISTIEN=^TMP("PXRMLPAU",$J,"IDX",IND,IND)
    171173 .S DA(1)=IEN,DA=LISTIEN,DIK="^PXRMXP(810.5,"_DA(1)_",40," D ^DIK
    172  .W !,"Patient list deleted"
     174 .W !,"PATIENT DELETED"
    173175 ;
    174176PDELEX ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLPHS.m

    r628 r636  
    1 PXRMLPHS ; SLC/PJH,PKR - Run Health Summaries from Patient List ;03/26/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMLPHS ; SLC/PJH,PKR - Run Health Summaries from Patient List ;08/08/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;External Ref DBIA #398
     
    6060 ;
    6161QUE(HSIEN,PLNODE) ;Determine whether the report should be queued.
    62  N PXRMQUE,%ZIS,ZTDESC,ZTRTN,ZTSK,ZTSAVE
     62 N PXRMQUE,RETZTSK,%ZIS,ZTDESC,ZTRTN,ZTSK,ZTSAVE
    6363 S %ZIS="M"
    6464 S ZTDESC="Patient List Health Summaries - print"
     
    6666 S ZTSAVE("HSIEN")=""
    6767 S ZTSAVE("PLNODE")=""
    68  S PXRMQUE=$$DEVICE^PXRMXQUE(ZTRTN,ZTDESC,.ZTSAVE,.%ZIS,1)
     68 S RETZTSK=1
     69 S PXRMQUE=$$DEVICE^PXRMXQUE(ZTRTN,ZTDESC,.ZTSAVE,.%ZIS,.RETZTSK)
    6970 S VALMBCK="R"
    7071 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLPP.m

    r628 r636  
    1 PXRMLPP ; SLC/PKR/PJH - Reminder Patient List Patients ;04/04/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMLPP ; SLC/PKR/PJH - Reminder Patient List Patients ;01/06/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;Main entry point for PXRM PATIENT LIST
    55START(IEN) ;
    6  N CDATE,CLASS,CREATOR,INDP,INTP,LDATA,LNAME,PXRMVIEW,SNAME,SOURCE,TYPE
     6 N CDATE,CLASS,CREATOR,LDATA,LNAME,PXRMVIEW,SNAME,SOURCE,TYPE
    77 N VALMBCK,VALMBG,VALMCNT,VALMSG,X,XMZ,XQORM,XQORNOD
    88 ;Get Patient List record and associated data.
     
    3333 S CLASS=$P($G(^PXRMXP(810.5,IEN,100)),U)
    3434 S CLASS=$S(CLASS="N":"National",CLASS="V":"VISN",1:"Local")
    35  S INDP=$P(LDATA,U,11)
    36  S INTP=$P(LDATA,U,12)
    3735 ;Default view by name.
    3836 S PXRMVIEW="N"
     
    9088 Q
    9189 ;
    92 FRE(NUMBER,PNAME,DFN,DECEASED,TESTP,INST) ;Format  entry number, name, primary
    93  ;station and deceased, test information.
    94  N TEMP,TEXT,TNAME,TSOURCE
    95  S TEXT=$$RJ^XLFSTR(NUMBER,5," ")
    96  S TEXT=$$SETFLD^VALM1(PNAME,TEXT,"HEADER1")
    97  S TEXT=TEXT_"  "_$$LJ^XLFSTR(DFN,15," ")
    98  S TEMP=""
    99  I DECEASED S TEMP=" (D)"
    100  I TESTP S TEMP=" (T)"
    101  I DECEASED,TESTP S TEMP=" (DP)"
    102  S TEXT=TEXT_TEMP
    103  I INST'="" S TEXT=$$SETFLD^VALM1(INST,TEXT,"HEADER3")
    104  Q TEXT
     90FRE(NUMBER,NAME,INST,DFN) ;Format  entry number, name and primary station
     91 N TEMP,TNAME,TSOURCE
     92 S TEMP=$$RJ^XLFSTR(NUMBER,5," ")
     93 S TNAME=$E(NAME,1,30)
     94 S TEMP=TEMP_"  "_$$LJ^XLFSTR(TNAME,32," ")
     95 S TEMP=TEMP_"  "_$$LJ^XLFSTR(DFN,15," ")
     96 I INST'="" S TEMP=TEMP_"  "_INST
     97 Q TEMP
    10598 ;
    10699HDR ; Header code
    107  N TEXT
    108  S VALMHDR(1)="List Name: "_LNAME
     100 S VALMHDR(1)="List Name: "_LNAME_" ("_VALMCNT_" patients)"
    109101 S VALMHDR(2)=" Created: "_$$FMTE^XLFDT(CDATE,"5Z")
    110102 S VALMHDR(2)=$$LJ^XLFSTR(VALMHDR(2),40)_"Creator: "_CREATOR
     
    112104 S VALMHDR(3)=$$LJ^XLFSTR(VALMHDR(3),40)_"Type: "_TYPE
    113105 S VALMHDR(4)=" Source: "_SNAME
    114  S VALMHDR(5)=" Number of patients: "_VALMCNT
    115106 S VALMSG="+ Next Screen   - Prev Screen   ?? More Actions"
    116  S TEXT=""
    117  I INDP S TEXT=" (D=deceased)"
    118  I INTP S TEXT=" (T=test)"
    119  I INDP,INTP S TEXT=" (D=deceased, T=test)"
    120  S TEXT="DFN"_TEXT
    121  D CHGCAP^VALM("HEADER2",TEXT)
    122107 Q
    123108 ;
     
    148133 .;DBIA #10035
    149134 .S PNAME=$P(^DPT(DFN,0),U,1)
    150  .I PNAME="" S PNAME=DFN_" does not exist"
    151135 .S ^XTMP(PLNODE,PNAME)=DFN
    152136 D HSI^PXRMLPHS(PLNODE)
     
    159143 ;
    160144LIST(VALMCNT,IEN,INCINST) ;Build a list of patients.
    161  N DATA,DECEASED,DFN,IND,INST,NEXT,PNAME,SUB,TESTP
     145 N DATA,DFN,IND,INST,NEXT,PNAME,SUB
    162146 ;Build the ordered list.
    163147 S IND=0,SUB="NAME"
     
    165149 .S DATA=$G(^PXRMXP(810.5,IEN,30,IND,0)) Q:DATA=""
    166150 .S DFN=$P(DATA,U) Q:'DFN
    167  .S DECEASED=$P(DATA,U,4)
    168  .S TESTP=$P(DATA,U,5)
    169151 .;#DBIA 10035
    170152 .S PNAME=$P($G(^DPT(DFN,0)),U,1)
    171  .I PNAME="" S PNAME=DFN_" does not exist"
    172153 .S INSTNUM=$P(DATA,U,2) S:INSTNUM="" INSTNUM="NONE"
    173154 .S INST=$P(DATA,U,3)
     
    176157 .I INST="" S INST="NONE"
    177158 .I PXRMVIEW="I" S SUB=INST
    178  .S ^TMP("PXRMLPPA",$J,SUB,PNAME,DFN)=DECEASED_U_TESTP_U_INST
     159 .S ^TMP("PXRMLPPA",$J,SUB,PNAME,DFN)=INST
    179160 ;Transfer to list manager array
    180161 S SUB="",VALMCNT=0
     
    184165 ..S DFN=""
    185166 ..F  S DFN=$O(^TMP("PXRMLPPA",$J,SUB,PNAME,DFN)) Q:DFN=""  D
    186  ...S DATA=^TMP("PXRMLPPA",$J,SUB,PNAME,DFN)
    187  ...S DECEASED=$P(DATA,U,1)
    188  ...S TESTP=$P(DATA,U,2)
    189  ...I INCINST S INST=$P(DATA,U,3)
     167 ...I INCINST S INST=^TMP("PXRMLPPA",$J,SUB,PNAME,DFN)
    190168 ...S VALMCNT=VALMCNT+1
    191  ...S ^TMP("PXRMLPP",$J,VALMCNT,0)=$$FRE(VALMCNT,PNAME,DFN,DECEASED,TESTP,INST)
     169 ...S ^TMP("PXRMLPP",$J,VALMCNT,0)=$$FRE(VALMCNT,PNAME,INST,DFN)
    192170 ...S ^TMP("PXRMLPPI",$J,VALMCNT)=DFN
    193171 K ^TMP("PXRMLPPA",$J)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLPU.m

    r628 r636  
    1 PXRMLPU ; SLC/PKR/PJH - Reminder Patient List ;10/11/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMLPU ; SLC/PKR/PJH - Reminder Patient List ;08/07/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;Main entry point for PXRM PATIENT LIST
     
    3131 ;
    3232BLDLIST ;
    33  N PLIST
     33 N IEN,PLIST
    3434 K ^TMP("PXRMLPU",$J)
    3535 K ^TMP("PXRMLPUH",$J)
    3636 S PLIST="PXRMLPU"
    37  D LIST(MODE,PLIST)
     37 D LIST(MODE,PLIST,.IEN)
    3838 S VALMCNT=+$G(^TMP("PXRMLPU",$J,"VALMCNT"))
     39 F IND=1:1:VALMCNT D
     40 .S ^TMP("PXRMLPU",$J,"IDX",IND,IND)=IEN(IND)
    3941 Q
    4042 ;
     
    5456 Q
    5557 ;
     58FORMAT(NUMBER,NAME,NODE) ;Format  entry number, name, source,
     59 ;and date packed.
     60 N ACCESS,DATE,COUNT,TEMP,TYPE
     61 S DATE=$P(NODE,U,2),COUNT=$P(NODE,U,3)
     62 S TYPE=$P(NODE,U,4),ACCESS=$P(NODE,U,5)
     63 S TEMP=$$RJ^XLFSTR(NUMBER,5," ")
     64 S NAME=$E(NAME,1,45)
     65 S TEMP=TEMP_"  "_$$LJ^XLFSTR(NAME,45," ")
     66 S DATE=$$FMTE^XLFDT(DATE,2)
     67 S TEMP=TEMP_"  "_$$LJ^XLFSTR(DATE,17," ")
     68 S TEMP=TEMP_"  "_$$RJ^XLFSTR(COUNT,6," ")
     69 S TEMP=TEMP_"  "_$$RJ^XLFSTR(TYPE,4," ")
     70 S TEMP=TEMP_"  "_$$RJ^XLFSTR(ACCESS,3," ")
     71 Q TEMP
     72 ;
    5673HDR ; Header code
    5774 N NAME
     
    6279 N HTEXT
    6380 I CALL=1 D
    64  .S HTEXT(1)="Select CO to copy the patient list.\\"
    65  .S HTEXT(2)="Select COE to copy the patient list to an OE/RR Team.\\"
    66  .S HTEXT(3)="Select DE to delete the patient list.\\"
    67  .S HTEXT(4)="Select DCD to display creation documentation.\\"
    68  .S HTEXT(5)="Select DSP to display the patient list.\\"
     81 .S HTEXT(1)="Select CO to copy patient list."
     82 .S HTEXT(2)="Select COE to copy patient list to OE/RR Team."
     83 .S HTEXT(3)="Select CR to delete patient list."
     84 .S HTEXT(4)="Select DCD to display creation documentation."
     85 .S HTEXT(5)="Select DSP to display patient list."
    6986 D HELP^PXRMEUT(.HTEXT)
    7087 Q
     
    8097 Q
    8198 ;
    82 LIST(MODE,PLIST) ;Build a list of patient list entries.
    83  N ACCESS,COUNT,DATA,DATE,IND,FMTSTR,FNAME,OUTPUT,NAME,NL,NUM
    84  N STR,SUB,TYPE
    85  S FMTSTR=$$LMFMTSTR^PXRMTEXT(.VALMDDF,"RLLRRC")
     99LIST(MODE,PLIST,IEN) ;Build a list of patient list entries.
     100 N ACCESS,COUNT,DATE,IND,FNAME,NAME,NODE,SUB,TYPE
    86101 ;MODE=0 build list in alphabetical order
    87102 ;MODE=1 build list by type of list.
    88103 K ^TMP($J,PLIST),^TMP(PLIST,$J)
    89  S VALMCNT=0,NAME="",NUM=0,TYPE=""
     104 S VALMCNT=0,NAME="",TYPE=""
    90105 F  S NAME=$O(^PXRMXP(810.5,"B",NAME)) Q:NAME=""  D
    91106 .S IND="" F  S IND=$O(^PXRMXP(810.5,"B",NAME,IND)) Q:'IND  D
    92  ..S DATA=$G(^PXRMXP(810.5,IND,0))
    93  ..S ACCESS=$$ACCESS(IND,DATA)
     107 ..S NODE=$G(^PXRMXP(810.5,IND,0))
     108 ..S ACCESS=$$ACCESS(IND,NODE)
    94109 ..I ACCESS="N" Q
    95  ..S FNAME=$P($G(DATA),U),DATE=$P($G(DATA),U,4)
     110 ..S FNAME=$P($G(NODE),U),DATE=$P($G(NODE),U,4)
    96111 ..S COUNT=+$P($G(^PXRMXP(810.5,IND,30,0)),U,4)
    97  ..S TYPE=$P(DATA,U,8)
     112 ..S TYPE=$P(NODE,U,8)
    98113 ..S SUB=$S(MODE=0:"NAME",1:TYPE)
    99114 ..S ^TMP($J,PLIST,SUB,FNAME)=IND_U_DATE_U_COUNT_U_TYPE_U_ACCESS
     
    104119 S SUB=""
    105120 F  S SUB=$O(^TMP($J,PLIST,SUB),-1) Q:SUB=""  D
    106  . S FNAME=""
    107  . F  S FNAME=$O(^TMP($J,PLIST,SUB,FNAME)) Q:FNAME=""  D
    108  .. S DATA=^TMP($J,PLIST,SUB,FNAME),NUM=NUM+1
    109  .. S ^TMP("PXRMLPU",$J,"SEL",NUM)=$P(DATA,U,1)
    110  .. S DATE=$P(DATA,U,2),DATE=$$FMTE^XLFDT(DATE,2)
    111  .. S $P(DATA,U,2)=DATE
    112  .. S STR=NUM_U_FNAME_U_$P(DATA,U,2,5)
    113  .. D COLFMT^PXRMTEXT(FMTSTR,STR," ",.NL,.OUTPUT)
    114  .. F IND=1:1:NL D
    115  ... S VALMCNT=VALMCNT+1,^TMP(PLIST,$J,VALMCNT,0)=OUTPUT(IND)
    116  ... S ^TMP("PXRMLPU",$J,"IDX",VALMCNT,NUM)=""
     121 .S FNAME=""
     122 .F  S FNAME=$O(^TMP($J,PLIST,SUB,FNAME)) Q:FNAME=""  D
     123 ..S NODE=^TMP($J,PLIST,SUB,FNAME),VALMCNT=VALMCNT+1
     124 ..S ^TMP(PLIST,$J,VALMCNT,0)=$$FORMAT(VALMCNT,FNAME,NODE)
     125 ..S IEN(VALMCNT)=$P(NODE,U,1)
    117126 S ^TMP(PLIST,$J,"VALMCNT")=VALMCNT
    118127 K ^TMP($J,PLIST)
     
    136145 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
    137146 .;Get the patient list ien.
    138  .S LISTIEN=^TMP(SUB,$J,"SEL",IND)
    139  .D COPY^PXRMRUL1(LISTIEN)
     147 .S LISTIEN=^TMP(SUB,$J,"IDX",IND,IND)
     148 .D COPY^PXRMRULE(LISTIEN)
    140149 Q
    141150 ;
     
    150159 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
    151160 .;Get the patient list ien.
    152  .S LISTIEN=^TMP("PXRMLPU",$J,"SEL",IND)
     161 .S LISTIEN=^TMP("PXRMLPU",$J,"IDX",IND,IND)
    153162 .S NODE=$G(^PXRMXP(810.5,LISTIEN,0))
    154163 .S DELOK=$$LDELOK^PXRMEUT(LISTIEN)
    155  .I DELOK D DELETE^PXRMRUL1(LISTIEN) Q
     164 .I DELOK D DELETE^PXRMRULE(LISTIEN) Q
    156165 .E  D  Q
    157166 ..W !,"In order to delete a list you must be the creator or a Reminder Manager!"
     
    177186 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
    178187 .;Get the patient list ien.
    179  .S LISTIEN=^TMP("PXRMLPU",$J,"SEL",IND)
     188 .S LISTIEN=^TMP("PXRMLPU",$J,"IDX",IND,IND)
    180189 .S NODE=$G(^PXRMXP(810.5,LISTIEN,0))
    181190 .S ACCESS=$$ACCESS^PXRMLPU(LISTIEN,NODE)
     
    196205 S IND=""
    197206 F  S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE)  D
    198  .S LISTIEN=^TMP("PXRMLPU",$J,"SEL",IND)
     207 .S LISTIEN=^TMP("PXRMLPU",$J,"IDX",IND,IND)
    199208 .D START^PXRMLPP(LISTIEN)
    200209 D BLDLIST
     
    227236 .W $C(7),!,"Only one item number allowed." H 2
    228237 .S VALMBCK="R"
    229  I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("SEL",SEL))) D  Q
     238 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("IDX",SEL))) D  Q
    230239 .W $C(7),!,SEL_" is not a valid item number." H 2
    231240 .S VALMBCK="R"
    232241 ;
    233242 ;Get the patient list ien
    234  S LISTIEN=^TMP("PXRMLPU",$J,"SEL",SEL)
     243 S LISTIEN=^TMP("PXRMLPU",$J,"IDX",SEL,SEL)
    235244 ;Get extract definition ien (if present)
    236245 S EPIEN=$P($G(^PXRMXP(810.5,LISTIEN,0)),U,5)
     
    255264 S DIR("B")="DSP"
    256265 S DIR("?")="Select from the codes displayed. For detailed help type ??"
    257  S DIR("??")=U_"D HELP^PXRMLPU(1)"
     266 S DIR("??")=U_"D HELP^PXRMLPM(1)"
    258267 D ^DIR K DIR
    259268 I $D(DIROUT) S DTOUT=1
     
    264273 ;
    265274 ;Copy patient list
    266  I OPTION="CO" D COPY^PXRMRUL1(LISTIEN)
     275 I OPTION="CO" D COPY^PXRMRULE(LISTIEN)
    267276 Q:$D(DUOUT)!$D(DTOUT)
    268277 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLRM.m

    r628 r636  
    1 PXRMLRM ; SLC/PJH/PKR - List Rule Management ; 09/06/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMLRM ; SLC/PJH/PKR - List Rule Management ; 05/15/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;Main entry point for PXRM LIST RULE MANAGEMENT
     
    5656 N HTEXT
    5757 I CALL=1 D
    58  .S HTEXT(1)="Select DE to display or edit a rule.\\"
    59  .S HTEXT(2)="Select ED to edit a rule.\\"
     58 .S HTEXT(1)="Select DE to display or edit a rule."
     59 .S HTEXT(2)="Select ED to edit a rule"
    6060 ;
    6161 I CALL=2 D
    62  .S HTEXT(1)="Select F to edit term based finding rules.\\"
    63  .S HTEXT(2)="Select P to edit patient list based finding rules.\\"
    64  .S HTEXT(3)="Select R to edit reminder rules.\\"
    65  .S HTEXT(4)="Select S to edit rule sets. A rule set may contain"
    66  .S HTEXT(5)="any of the following:\\"
    67  .S HTEXT(6)=" finding list rules, patient list rules, reminder rules\\"
    68  .S HTEXT(7)="These component list rules must be created before the rule set"
    69  .S HTEXT(8)="can be constructed."
     62 .S HTEXT(1)=" Select F to edit term based finding rules."
     63 .S HTEXT(2)=" Select P to edit patient list based finding rules."
     64 .S HTEXT(3)=" Select R to edit reminder rules."
     65 .S HTEXT(4)=" Select S to edit rule sets. A rule set may contain either "
     66 .S HTEXT(5)="finding list rules or patient list rules or both. These "
     67 .S HTEXT(6)="component list rules must be created before the rule set "
     68 .S HTEXT(7)="can be constructed."
    7069 ;
    7170 D HELP^PXRMEUT(.HTEXT)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMMH.m

    r628 r636  
    1 PXRMMH ; SLC/PKR - Handle mental health findings. ;11/23/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMMH ; SLC/PKR - Handle mental health findings. ;04/05/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;=======================================================
     
    1212 D EVALPL^PXRMINDL(.FINDPA,ENODE,.TERMARR,PLIST)
    1313 Q
    14  ;
    1514 ;=======================================================
    1615EVALTERM(DFN,FINDPA,ENODE,TERMARR,TFIEVAL) ;Evaluate mental
     
    2019 ;
    2120 ;=======================================================
    22 GETDATA(DASP,FIEVT) ;Return the data for a MH Administrations entry.
     21GETDATA(DAS,FIEVT) ;Return the data for a Psych Instrument Patient entry.
    2322 ;Some tests require the YSP key in order to get a score.
    24  N DAS,DATA,IND,SCALE
    25  S DAS=$P(DASP,"S",1)
    26  S SCALE=+$P(DASP,"S",2)
    27  ;DBIA #5043
    28  D ENDAS71^YTQPXRM6(.DATA,DAS)
    29  I $G(DATA(1))="[ERROR]" Q
    30  I SCALE=0 S SCALE=+$O(DATA("SI",""))
    31  S FIEVT("MH TEST")=$P(DATA(2),U,3)
    32  S IND=0
    33  F  S IND=$O(DATA("SI",IND)) Q:IND=""  S FIEVT("S",IND)=$P(DATA("SI",IND),U,3,4)
    34  S IND=0
    35  F  S IND=$O(DATA("R",IND)) Q:IND=""  S FIEVT("R",IND)=$P(DATA("R",IND),U,6)
    36  I $D(DATA("SI",SCALE)) S FIEVT("VALUE")=FIEVT("S",SCALE),FIEVT("SCALE NAME")=$P(DATA("SI",SCALE),U,2)
     23 N DASP,IND,SCALE,YSDATA
     24 ;DBIA #4442
     25 S DASP=$P(DAS,"S",1)
     26 S SCALE=$P(DAS,"S",2)
     27 D ENDAS^YTAPI10(.YSDATA,DASP)
     28 I $G(YSDATA(0))="[ERROR]" Q
     29 S FIEVT("MH TEST")=$P(YSDATA(2),U,3)
     30 I FIEVT("MH TEST")["GAF" S FIEVT("RATING")=$P(YSDATA(3),U,2) Q
     31 ;If no scale is specified use the first set of results.
     32 S IND=$S(SCALE="":6,1:SCALE+5)
     33 S FIEVT("YSDATA")=$G(YSDATA(IND))
     34 S FIEVT("SCALE NAME")=$P(FIEVT("YSDATA"),U,2)
     35 S (FIEVT("RAW SCORE"),FIEVT("VALUE"))=$P(FIEVT("YSDATA"),U,3)
     36 S FIEVT("TRANSFORMED SCORE")=$P(FIEVT("YSDATA"),U,4)
    3737 Q
    3838 ;
    3939 ;=======================================================
    4040MHVOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the MHV output.
    41  N DATE,IND,JND,MHTEST,NOUT,SCALE,SNAME,SCORE,TEXTOUT
    42  S MHTEST="Mental Health Test: "_IFIEVAL("MH TEST")_" = "
     41 N DATE,IND,JND,MHTEST,NAME,NOUT,RATING,RSCORE,SCORE,TEXTOUT,TSCORE
     42 S MHTEST=IFIEVAL("MH TEST")
     43 ;Remove the dashes surrounding the name.
     44 S MHTEST=$TR(MHTEST,"-","")
     45 S NAME="Mental Health Test: "_MHTEST_" = "
    4346 S IND=0
    4447 F  S IND=+$O(IFIEVAL(IND)) Q:IND=0  D
    45  . S DATE="("_$$EDATE^PXRMDATE(IFIEVAL(IND,"DATE"))_")"
    46  . S TEMP=MHTEST_DATE
    47  . S SNAME=$G(IFIEVAL(IND,"SCALE NAME"))
    48  . I SNAME'="" S TEMP=TEMP_" scale: "_SNAME_" -"
    49  . S SCORE=$G(IFIEVAL(IND,"VALUE"))
    50  . I SCORE'="" S TEMP=TEMP_"  raw score: "_$P(SCORE,U,1)_", transformed score: "_$P(SCORE,U,2)
     48 . S DATE=IFIEVAL(IND,"DATE")
     49 . S RSCORE=$G(IFIEVAL(IND,"RAW SCORE"))
     50 . S TSCORE=$G(IFIEVAL(IND,"TRANSFORMED SCORE"))
     51 . S RATING=$G(IFIEVAL(IND,"RATING"))
     52 . S SCORE=$S(RATING'="":RATING,TSCORE'="":TSCORE,RSCORE'="":RSCORE,1:"")
     53 . S TEMP=NAME_SCORE_" ("_$$EDATE^PXRMDATE(IFIEVAL(IND,"DATE"))_")"
    5154 . D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
    5255 . F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
     
    5760OUTPUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the clinical
    5861 ;maintenance output.
    59  N IND,JND,MHTEST,NOUT,SCALE,SNAME,SCORE,TEXTOUT
     62 N DATE,IND,JND,MHTEST,NOUT,RATING,RSCORE,TEXTOUT,TSCORE
    6063 S MHTEST=IFIEVAL("MH TEST")
     64 ;Remove the dashes surrounding the name.
     65 S MHTEST=$TR(MHTEST,"-","")
    6166 S NLINES=NLINES+1
    6267 S TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_"Mental Health Test: "_MHTEST
    6368 S IND=0
    6469 F  S IND=+$O(IFIEVAL(IND)) Q:IND=0  D
     70 . S DATE=IFIEVAL(IND,"DATE")
    6571 . S TEMP=$$EDATE^PXRMDATE(IFIEVAL(IND,"DATE"))
    66  . S SNAME=$G(IFIEVAL(IND,"SCALE NAME"))
    67  . I SNAME'="" S TEMP=TEMP_" scale: "_SNAME_" -"
    68  . S SCORE=$G(IFIEVAL(IND,"VALUE"))
    69  . I SCORE'="" S TEMP=TEMP_"  raw score: "_$P(SCORE,U,1)_", transformed score: "_$P(SCORE,U,2)
     72 . S RSCORE=$G(IFIEVAL(IND,"RAW SCORE"))
     73 . I RSCORE'="" S TEMP=TEMP_" raw score - "_RSCORE
     74 . S TSCORE=$G(IFIEVAL(IND,"TRANSFORMED SCORE"))
     75 . I TSCORE'="" S TEMP=TEMP_"; transformed score - "_TSCORE
     76 . S RATING=$G(IFIEVAL(IND,"RATING"))
     77 . I RATING'="" S TEMP=TEMP_" Rating: "_RATING
    7078 . D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT)
    7179 . F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND)
     
    7583 ;=======================================================
    7684SCHELP(MHIEN) ;Xecutable help for MH SCALE
    77  N DATA,IND,JND,NUM,SCALE,SNUM
     85 N IND,JND,NUM,SCALE,TEMP,TEMP1
    7886 I MHIEN=0 D  Q
    7987 . S SCALE(1)="This is not a valid Mental Health finding, selecting an MH scale does"
    8088 . S SCALE(2)="not make sense"
    8189 . D EN^DDIOL(.SCALE)
    82  ;DBIA #5053
    83  D SCALES^YTQPXRM5(.DATA,MHIEN)
    84  I DATA(1)="ERROR" D  Q
    85  . S SCALE(1)="There are no scales for this test."
    86  . D EN^DDIOL(.SCALE)
    87  S SCALE(1)="Valid scales are:"
    88  S SCALE(2)="SCALE NUMBER  SCALE NAME"
    89  S SCALE(3)="------------------------"
    90  S IND=0,JND=3
    91  F  S IND=$O(DATA("S",IND)) Q:IND=""  D
     90 S SCALE(1)="SCALE NUMBER  SCALE NAME"
     91 S SCALE(2)="------------------------"
     92 S IND=0
     93 S JND=2
     94 F  S IND=$O(^YTT(601,MHIEN,"S",IND)) Q:+IND=0  D
     95 . S TEMP=^YTT(601,MHIEN,"S",IND,0)
    9296 . S JND=JND+1
    93  . S NUM=6-$L(IND)
    94  . S SCALE(JND)=$$INSCHR^PXRMEXLC(NUM," ")_(IND)_"        "_$P(DATA("S",IND),U,1)
     97 . S TEMP1=$P(TEMP,U,1)
     98 . S NUM=6-$L(TEMP1)
     99 . S SCALE(JND)=$$INSCHR^PXRMEXLC(NUM," ")_TEMP1_"        "_$P(TEMP,U,2)
    95100 D EN^DDIOL(.SCALE)
    96101 Q
    97102 ;
    98103 ;=======================================================
    99 SCHELPD(DA) ;Xecutable help for MH SCALE in Result Group file 801.41
    100  N MHIEN
    101  S MHIEN=+$P($G(^PXRMD(801.41,DA,50)),U)
    102  D SCHELP^PXRMMH(MHIEN)
    103  Q
    104  ;=======================================================
    105104SCHELPF ;Xecutable help for MH SCALE in 811.9 findings.
    106105 N FIND0,MHIEN
    107106 S FIND0=^PXD(811.9,DA(1),20,DA,0)
    108  I FIND0["YTT(601.71" S MHIEN=$P(FIND0,";",1)
     107 I FIND0["YTT(601" S MHIEN=$P(FIND0,";",1)
    109108 E  S MHIEN=0
    110109 D SCHELP(MHIEN)
     
    115114 N MHIEN,TFIND0
    116115 S TFIND0=^PXRMD(811.5,DA(1),20,DA,0)
    117  I TFIND0["YTT(601.71" S MHIEN=$P(TFIND0,";",1)
     116 I TFIND0["YTT(601" S MHIEN=$P(TFIND0,";",1)
    118117 E  S MHIEN=0
    119118 D SCHELP(MHIEN)
     
    121120 ;
    122121 ;=======================================================
    123 SCNAME(TEST,SCNUM) ;Given the test ien and scale number return the
    124  ;scale name.
    125  N DATA,SCNAME
    126  D SCALES^YTQPXRM5(.DATA,TEST)
    127  Q $G(DATA("S",SCNUM))
    128  ;
    129  ;=======================================================
    130122SEVALFI(DFN,ITEM,NGET,SDIR,BDT,EDT,NFOUND,FLIST) ;
    131  N FIEV,FINDING,IND,YS,DATA
     123 N FIEV,FINDING,IND,YS,YSDATA
    132124 S YS("CODE")=ITEM,YS("DFN")=DFN
    133125 S YS("BEGIN")=BDT,YS("END")=EDT
    134  ;PTTEST^YTQPXRM2 does not understand "*" for a limit so use 99.
     126 ;YTAPI10A does not understand "*" for a limit so use 99.
    135127 I NGET="*" S NGET=99
    136128 S YS("LIMIT")=$S(SDIR=-1:NGET,1:-NGET)
    137  ;DBIA #5035
    138  D PTTEST^YTQPXRM2(.DATA,.YS)
    139  S NFOUND=$P(DATA(1),U,2)
     129 ;DBIA #4458
     130 D PTTEST^YTAPI10A(.YSDATA,.YS)
     131 S NFOUND=$P(YSDATA(1),U,2)
    140132 I NFOUND=0 Q
    141  F IND=1:1:NFOUND S FLIST(IND)=DATA(IND+1)
     133 F IND=1:1:NFOUND S FLIST(IND)=YSDATA(IND+1)
    142134 Q
    143135 ;
     
    147139 N YS
    148140 ;YTAPI10A does not understand "*" for a limit so use 99.
    149  ;OCCUR^YTQPXRM1 does not understand "*" for a limit so use 99.
    150141 I NOCC="*" S NOCC=99
    151142 S YS("CODE")=ITEM,YS("BEGIN")=BDT,YS("END")=EDT,YS("LIMIT")=NOCC
    152  ;DBIA #5034
    153  D OCCUR^YTQPXRM1(PLIST,.YS)
     143 ;DBIA #4458
     144 D OCCUR^YTAPI10A(PLIST,.YS)
    154145 Q
    155146 ;
     
    157148VSCALE(X,FIND0) ;Make sure that the mental health scale is valid.
    158149 ;Either the scale number or the scale name can be used.
    159  N DATA,IND,MHIEN,MHTEST,SCALE,VALID
     150 N MHIEN,MHTEST,SCALE,VALID
    160151 S MHTEST=$P(FIND0,U,1)
    161152 S MHIEN=$P(MHTEST,";",1)
    162  D SCALES^YTQPXRM5(.DATA,MHIEN)
    163  I +X>0 S VALID=$S($D(DATA("S",X)):1,1:0)
     153 I +X>0 D  Q VALID
     154 . S VALID=$S($D(^YTT(601,MHIEN,"S",X)):1,1:0)
    164155 E  D
    165  . S IND=1,VALID=0
    166  . F  S IND=$O(DATA("S",IND)) Q:(VALID)!(IND="")  D
    167  .. I X=$P(DATA("S",IND),U,1) S VALID=1 Q
    168  I 'VALID D EN^DDIOL(X_" is not a valid scale for this test!")
    169  I $O(DATA(""),-1)>20 H 1
     156 . S SCALE=$O(^YTT(601,MHIEN,"S","C",X,""))
     157 . S VALID=$S(SCALE="":0,1:1)
    170158 Q VALID
    171  ;
    172  ;=======================================================
    173 VSCALED(X,DA) ;Make sure that the mental health scale is valid for a result
    174  ;group.
    175  I X="" Q 1
    176  ;Do not execute as part of a verify fields.
    177  I $G(DIUTIL)="VERIFY FIELDS" Q 1
    178  ;Do not execute as part of exchange.
    179  I $G(PXRMEXCH) Q 1
    180  N MHTEST
    181  S MHTEST=$P($G(^PXRMD(801.41,DA,50)),U)
    182  Q $$VSCALE(X,MHTEST)
    183159 ;
    184160 ;=======================================================
     
    205181 Q $$VSCALE(X,TFIND0)
    206182 ;
    207  ;=======================================================
    208 WARN ;Warn the user that they must select a scale if they intend to use
    209  ;a condition.
    210  W !,"Remember that the score is returned as raw score^transformed score,"
    211  W !,"so if your Condition uses the raw score use +V or $P(V,U,1) and if"
    212  W !,"it uses the transformed score use $P(V,U,2)."
    213  Q
    214  ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMMST.m

    r628 r636  
    1 PXRMMST ; SLC/PKR - Routines for dealing with MST. ;03/29/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMMST ; SLC/PKR - Routines for dealing with MST. ;07/17/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;Use of DGMSTAPI supported by DBIA #2716.
    44 ;====================================================
     
    231231 . I TERMIEN="" Q
    232232 . D TERM^PXRMLDR(TERMIEN,.TERMARR)
    233  . D EVALPL^PXRMTERL(.FINDPA,.TERMARR,INDEX)
     233 . D EVALPL^PXRMTERM(.FINDPA,.TERMARR,INDEX)
    234234 . S DFN=0
    235235 . F  S DFN=+$O(^TMP($J,INDEX,1,DFN)) Q:DFN=0  D
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMOUTC.m

    r628 r636  
    1 PXRMOUTC ; SLC/PKR - Clinical Maintenance output. ;07/06/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMOUTC ; SLC/PKR - Clinical Maintenance output. ;10/07/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;================================================
    44CM(DEFARR,PXRMPDEM,PCLOGIC,RESLOGIC,RESDATE,FIEVAL) ;Prepare the
    55 ;clinical maintenance output.
    6  N IND,JND,FIDATA,FINDING,FLIST,FTYPE
     6 N IND,FIDATA,FINDING,FLIST,FTYPE
    77 N HDR,NHDR,IFIEVAL,LIST,NFLINES,NTXT,NUM
    88 N TEMP,TEXT
     
    3737 .. I '$D(FIDATA(FINDING)) Q
    3838 .. K IFIEVAL
    39  .. ;I FIEVAL(FINDING) M IFIEVAL=FIEVAL(FINDING)
    40  .. ;E  S IFIEVAL=0
    41  .. I FIEVAL(FINDING) D
    42  ... M IFIEVAL=FIEVAL(FINDING)
    43  ...;Remove any false occurrences so they are not displayed.
    44  ... S JND=0
    45  ... F  S JND=+$O(IFIEVAL(JND)) Q:JND=0  K:'IFIEVAL(JND) IFIEVAL(JND)
     39 .. I FIEVAL(FINDING) M IFIEVAL=FIEVAL(FINDING)
    4640 .. E  S IFIEVAL=0
    4741 ..;If the finding is false all we need to do is process the not found
     
    8882 I FTYPE="PXRMD(811.4," D OUTPUT^PXRMCF(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
    8983 I FTYPE="RAMIS(71," D OUTPUT^PXRMRAD(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
    90  I FTYPE="YTT(601.71," D OUTPUT^PXRMMH(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
     84 I FTYPE="YTT(601," D OUTPUT^PXRMMH(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
    9185 Q
    9286 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMOUTM.m

    r628 r636  
    1 PXRMOUTM ; SLC/PKR - MyHealtheVet output. ;07/06/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMOUTM ; SLC/PKR - MyHealtheVet output. ;10/12/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;================================================
     
    2828 I FTYPE="PXRMD(811.4," D MHVOUT^PXRMCF(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
    2929 I FTYPE="RAMIS(71," D MHVOUT^PXRMRAD(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
    30  I FTYPE="YTT(601.71," D MHVOUT^PXRMMH(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
     30 I FTYPE="YTT(601," D MHVOUT^PXRMMH(INDENT,.IFIEVAL,.NLINES,.TEXT) Q
    3131 Q
    3232 ;
     
    4949MHVD(DEFARR,PXRMPDEM,PCLOGIC,RESLOGIC,RESDATE,FIEVAL,WEB) ;Prepare the
    5050 ;MyHealtheVet detailed output.
    51  N IND,JND,FIDATA,FINDING,FLIST,FTYPE
     51 N IND,FIDATA,FINDING,FLIST,FTYPE
    5252 N HDR,NHDR,IFIEVAL,LIST,NFLINES,NTXT,NUM
    5353 N TEXT
     
    7575 .. I '$D(FIDATA(FINDING)) Q
    7676 .. K IFIEVAL
    77  .. ;I FIEVAL(FINDING) M IFIEVAL=FIEVAL(FINDING)
    78  .. ;E  S IFIEVAL=0
    79  .. I FIEVAL(FINDING) D
    80  ... M IFIEVAL=FIEVAL(FINDING)
    81  ...;Remove any false occurrences so they are not displayed.
    82  ... S JND=0
    83  ... F  S JND=+$O(IFIEVAL(JND)) Q:JND=0  K:'IFIEVAL(JND) IFIEVAL(JND)
     77 .. I FIEVAL(FINDING) M IFIEVAL=FIEVAL(FINDING)
    8478 .. E  S IFIEVAL=0
    8579 ..;Output the found/not found text for the finding.
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMP9E.m

    r628 r636  
    1818 D BM(" Code Set Update message fix (Remedy Ticket 175985)"),M(" ")
    1919 N DA,DIC,DIQ,DR,PXRMB,PXRMBLD,PXRMBLDS,PXRMERR,PXRMHF,PXRMI,PXRML,PXRMPAT,PXRMPN,PXRMREQ,PXRMS,PXRMT,PXRMU,PXRMV,PXRMVER,X
    20  K XPDABORT,XPDQUIT S U="^",PXRMREQ="LEX*2.0*25;LEX*2.0*27;LEX*2.0*32;LEX*2.0*46;ICD*18.0*11;ICPT*6.0*16;PXRM*2.0*4"
     20 K XPDABORT,XPDQUIT S U="^",PXRMREQ="LEX*2.0*25;LEX*2.0*27;ICD*18.0*11;ICPT*6.0*16;PXRM*2.0*4"
    2121 S PXRMBLD="LEX*2.0*49",PXRMBLDS="LEX*2.0*49;ICD*18.0*28;ICPT*6.0*34;PXRM*2.0*9",PXRMHF="LEX_2_49.KID"
    2222 K PXRMERR D:+($$UR)'>0 ET("User not defined (DUZ)") I $D(PXRMERR) D ABRT Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPARS.m

    r628 r636  
    1 PXRMPARS ; SLC/PJH - Edit PXRM(800 reminder parameters. ;04/02/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMPARS ; SLC/PJH - Edit PXRM(800 reminder parameters. ;06/14/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;called by protocol PXRM EDIT SITE DISCLAIMER
     
    1111 D ^DIE
    1212 D FORMAT^PXRMDISC
    13  Q
    14  ;
    15 MH(DA) ;Edit MH default Question Value
    16  Q:'$$LOCK(DA)
    17  N DIC,DIE,DR,Y
    18  ;Edit
    19  S DIE="^PXRM(800,",DR=17
    20  D ^DIE
    2113 Q
    2214 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPDR.m

    r628 r636  
    1 PXRMPDR ;SLC/AGP,PKR - Patient List Demographic report main routine ;11/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMPDR ;SLC/AGP,PKR - Patient List Demographic report main routine ;07/17/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44EN(PLIEN) ; -- main entry point for PXRM PATIENT LIST DEMOGRAPHIC
    5  N ARRAY,DC,DDATA,DELIM,DTOUT,DUOUT
     5 N ADDDATA,APPDATA,ARRAY,BACK,CNT,DC,DEMDATA,DELIM,DIC,DIR,DTOUT,DUOUT
     6 N ELIGDATA,IEN,INPDATA
     7 N FINDDATA,NAME,NODE,PFACDATA,PTIEN
     8 N QUIT,REMDATA
     9 N X,Y,YESNO
    610 W @IOF
    711 K ^TMP("PXRMPLD",$J),^TMP("PXRMPLN",$J)
    8  S DELIM=0
     12 S BACK=0,DELIM=0,QUIT=0
    913OPTION ;
    1014 W !,"Select the items to include on the report."
    11 ADDSEL D ADDSEL^PXRMPDRS(.DDATA,"ADD")
     15ADDSEL D ADDSEL^PXRMPDRS(.ADDDATA)
    1216 I $D(DTOUT)!$D(DUOUT) Q
    13 APPSEL D APPSEL^PXRMPDRS(.DDATA,"APP")
     17APPSEL D APPSEL^PXRMPDRS(.APPDATA)
    1418 I $D(DTOUT)!$D(DUOUT) G ADDSEL
    15 DEMSEL D DEMSEL^PXRMPDRS(.DDATA,"DEM")
     19DEMSEL D DEMSEL^PXRMPDRS(.DEMDATA)
    1620 I $D(DTOUT)!$D(DUOUT) G APPSEL
    17 PFACSEL S DDATA("PFAC",0)=$$ASKYN^PXRMEUT("N","Include the patient's preferred facility")
     21PFACSEL S PFACDATA(0)=$$ASKYN^PXRMEUT("N","Include the patient's preferred facility")
    1822 I $D(DTOUT)!$D(DUOUT) G DEMSEL
    19  S DDATA("PFAC","LEN")=$S(DDATA("PFAC",0)=1:1,1:0)
    20 ELIGSEL D ELIGSEL^PXRMPDRS(.DDATA,"ELIG")
     23 S PFACDATA("LEN")=$S(PFACDATA(0)=1:1,1:0)
     24ELIGSEL D ELIGSEL^PXRMPDRS(.ELIGDATA)
    2125 I $D(DTOUT)!$D(DUOUT) G PFACSEL
    22 DATASEL D DATASEL^PXRMPDRS(PLIEN,.DDATA,"FIND")
     26DATASEL D DATASEL^PXRMPDRS(PLIEN,.FINDDATA)
    2327 I $D(DTOUT)!$D(DUOUT) G ELIGSEL
    24 INPSEL D INPSEL^PXRMPDRS(.DDATA,"INP")
     28INPSEL D INPSEL^PXRMPDRS(.INPDATA)
    2529 I $D(DTOUT)!$D(DUOUT) G DATASEL
    26 REMDATA D REMSEL^PXRMPDRS(PLIEN,.DDATA,"REM")
     30REMDATA D REMSEL^PXRMPDRS(PLIEN,.REMDATA)
    2731 I $D(DTOUT)!$D(DUOUT) G INPSEL
    2832 S DELIM=$$ASKYN^PXRMEUT("Y","Delimited Report:")
    2933 I $D(DTOUT)!$D(DUOUT) G REMDATA
    30  S DC=$S(DELIM:$$DELIMSEL^PXRMXSD,1:U)
     34 I DELIM S DC=$$DELIMSEL^PXRMXSD
    3135 I $D(DTOUT)!$D(DUOUT) G OPTION
    3236DEVICE ;
    33  N DESC,DIR,PXRMQUE,RTN,SAVE,%ZIS
     37 N DIR,PXRMQUE,%ZIS,ZTDESC,ZTRTN,ZTSAVE
    3438 S %ZIS="M"
    35  S DESC="Patient List Demographic Report"
    36  S RTN="GETPDATA^PXRMPDR(DELIM,DC,PLIEN,.DDATA)"
    37  S SAVE("DELIM")="",SAVE("DC")="",SAVE("PLIEN")=""
    38  S SAVE("DDATA(")=""
    39  S PXRMQUE=$$DEVICE^PXRMXQUE(RTN,DESC,.SAVE,.%ZIS,1)
    40  I PXRMQUE'="" G EXIT
     39 S ZTDESC="Patient List Demographic"
     40 S ZTRTN="GETDATA^PXRMPDR(DELIM,PLIEN,.DEMDATA,.PFACDATA,.ADDDATA,.INPDATA,.APPDATA,.FINDDATA,.REMDATA)"
     41 S ZTSAVE("*")=""
     42 S PXRMQUE=0
     43 S PXRMQUE=$$DEVICE^PXRMXQUE(ZTRTN,ZTDESC,.ZTSAVE,.%ZIS,.ZTSK)
     44 I PXRMQUE=1 G EXIT
    4145 I $D(DTOUT)!$D(DUOUT) G EXIT
     46 ;
    4247 S DIR(0)="E" D ^DIR
    4348EXIT D KVA^VADPT
     
    4550 Q
    4651 ;
    47 GETPDATA(DELIM,DC,PLIEN,DDATA) ;
     52GETDATA(DELIM,PLIEN,DEMDATA,PFACDATA,ADDDATA,INPDATA,APPDATA,FINDDATA,REMDATA) ;
    4853 N DATA,DATE,DCREAT,DFN,DTYPE,ERRMSG
    4954 N GETADD,GETAPP,GETDEM,GETELIG,GETFIND,GETINP,GETREM
     
    5459 S LISTNAME=$P(^PXRMXP(810.5,PLIEN,0),U,1)
    5560 S DCREAT=$P(^PXRMXP(810.5,PLIEN,0),U,4)
    56  S GETDEM=$S(DDATA("DEM","LEN")>0:1,1:0)
    57  S GETADD=$S(DDATA("ADD","LEN")>0:1,1:0)
    58  S GETINP=$S(DDATA("INP","LEN")>0:1,1:0)
    59  S GETELIG=$S(DDATA("ELIG","LEN")>0:1,1:0)
    60  S GETAPP=$S(DDATA("APP","LEN")>0:1,1:0)
    61  S GETFIND=$S(DDATA("FIND","LEN")>0:1,1:0)
    62  S GETREM=$S(DDATA("REM","LEN")>0:1,1:0)
     61 S GETDEM=$S(DEMDATA("LEN")>0:1,1:0)
     62 S GETADD=$S(ADDDATA("LEN")>0:1,1:0)
     63 S GETINP=$S(INPDATA("LEN")>0:1,1:0)
     64 S GETELIG=$S(ELIGDATA("LEN")>0:1,1:0)
     65 S GETAPP=$S(APPDATA("LEN")>0:1,1:0)
     66 S GETFIND=$S(FINDDATA("LEN")>0:1,1:0)
     67 S GETREM=$S(REMDATA("LEN")>0:1,1:0)
    6368 S IEN=0
    6469 F  S IEN=+$O(^PXRMXP(810.5,PLIEN,30,IEN)) Q:IEN=0  D
     
    7277 .. N VADM
    7378 .. D DEM^VADPT
    74  .. F IND=1:1:DDATA("DEM","LEN") D
    75  ... S JND=$P(DDATA("DEM"),",",IND)
    76  ... S KND=0
    77  ... F  S KND=$O(DDATA("DEM",JND,KND)) Q:KND=""  D
    78  .... S PIECE=$P(DDATA("DEM",JND,KND),U,2)
     79 .. F IND=1:1:DEMDATA("LEN") D
     80 ... S JND=$P(DEMDATA,",",IND)
     81 ... S KND=0
     82 ... F  S KND=$O(DEMDATA(JND,KND)) Q:KND=""  D
     83 .... S PIECE=$P(DEMDATA(JND,KND),U,2)
    7984 .... S TDATA=$P(VADM(KND),U,PIECE)
    8085 .... S LND=""
     
    8287 ..... I TDATA'="" S TDATA=TDATA_"~"
    8388 ..... S TDATA=TDATA_$P(VADM(KND,LND),U,PIECE)
    84  .... I KND=2,'DDATA("DEM","FULLSSN") S TDATA=$E(TDATA,8,11)
    85  .... S $P(PDATA,U,KND)=TDATA
    86  .. I PDATA'="" S ^TMP("PXRMPLD",$J,DFN,"DEM")=PDATA,PDATA=""
    87  . I DDATA("PFAC",0)=1 D
     89 .... I KND=2,'DEMDATA("FULLSSN") S TDATA=$E(TDATA,8,11)
     90 .... S $P(PDATA,U,KND)=TDATA
     91 .. I PDATA'="" S ^TMP("PXRMPLD",$J,DFN,"DEMDATA")=PDATA,PDATA=""
     92 . I PFACDATA(0)=1 D
    8893 ..;DBIA #1850
    8994 .. S TDATA=$$GET1^DIQ(2,DFN,27.02,"E","","ERRMSG")
    9095 .. I TDATA="" S TDATA="NONE"
    91  .. S ^TMP("PXRMPLD",$J,DFN,"PFAC")=TDATA
     96 .. S ^TMP("PXRMPLD",$J,DFN,"PFACDATA")=TDATA
    9297 . I GETADD D
    9398 .. N VAPA
    9499 .. D ADD^VADPT
    95  .. F IND=1:1:DDATA("ADD","LEN") D
    96  ... S JND=$P(DDATA("ADD"),",",IND)
    97  ... S KND=0
    98  ... F  S KND=$O(DDATA("ADD",JND,KND)) Q:KND=""  D
    99  .... S PIECE=$P(DDATA("ADD",JND,KND),U,2)
     100 .. F IND=1:1:ADDDATA("LEN") D
     101 ... S JND=$P(ADDDATA,",",IND)
     102 ... S KND=0
     103 ... F  S KND=$O(ADDDATA(JND,KND)) Q:KND=""  D
     104 .... S PIECE=$P(ADDDATA(JND,KND),U,2)
    100105 .... S TDATA=$P(VAPA(KND),U,PIECE)
    101106 .... S $P(PDATA,U,KND)=TDATA
    102  .. I PDATA'="" S ^TMP("PXRMPLD",$J,DFN,"ADD")=PDATA,PDATA=""
     107 .. I PDATA'="" S ^TMP("PXRMPLD",$J,DFN,"ADDDATA")=PDATA,PDATA=""
    103108 . I GETINP D
    104109 .. N VAIP
    105110 .. D INP^VADPT
    106  .. F IND=1:1:DDATA("INP","LEN") D
    107  ... S JND=$P(DDATA("INP"),",",IND)
    108  ... S KND=0
    109  ... F  S KND=$O(DDATA("INP",JND,KND)) Q:KND=""  D
    110  .... S PIECE=$P(DDATA("INP",JND,KND),U,2)
     111 .. F IND=1:1:INPDATA("LEN") D
     112 ... S JND=$P(INPDATA,",",IND)
     113 ... S KND=0
     114 ... F  S KND=$O(INPDATA(JND,KND)) Q:KND=""  D
     115 .... S PIECE=$P(INPDATA(JND,KND),U,2)
    111116 .... S TDATA=$P(VAIN(KND),U,PIECE)
    112117 .... S $P(PDATA,U,KND)=TDATA
    113  .. I PDATA'="" S ^TMP("PXRMPLD",$J,DFN,"INP")=PDATA,PDATA=""
     118 .. I PDATA'="" S ^TMP("PXRMPLD",$J,DFN,"INPDATA")=PDATA,PDATA=""
    114119 . I GETELIG D
    115120 .. N VAEL
    116121 .. D ELIG^VADPT
    117  .. F IND=1:1:DDATA("ELIG","LEN") D
    118  ... S JND=$P(DDATA("ELIG"),",",IND)
    119  ... S KND=0
    120  ... F  S KND=$O(DDATA("ELIG",JND,KND)) Q:KND=""  D
    121  .... S PIECE=$P(DDATA("ELIG",JND,KND),U,2)
     122 .. F IND=1:1:ELIGDATA("LEN") D
     123 ... S JND=$P(ELIGDATA,",",IND)
     124 ... S KND=0
     125 ... F  S KND=$O(ELIGDATA(JND,KND)) Q:KND=""  D
     126 .... S PIECE=$P(ELIGDATA(JND,KND),U,2)
    122127 .... S TDATA=$P(VAEL(KND),U,PIECE)
    123128 .... I KND=4 S TDATA=$S(TDATA=1:"YES",1:"NO")
    124129 .... S $P(PDATA,U,KND)=TDATA
    125  .. I PDATA'="" S ^TMP("PXRMPLD",$J,DFN,"ELIG")=PDATA,PDATA=""
     130 .. I PDATA'="" S ^TMP("PXRMPLD",$J,DFN,"ELIGDATA")=PDATA,PDATA=""
    126131 . D KVA^VADPT
    127132 . I GETREM D
    128133 .. S IND=0
    129  .. F  S IND=$O(DDATA("REM","IEN",IND)) Q:IND=""  D
     134 .. F  S IND=$O(REMDATA("IEN",IND)) Q:IND=""  D
    130135 ... S PDATA=$G(^PXRMXP(810.5,PLIEN,30,IEN,"REM",IND,0))
    131136 ... I PDATA="" Q
    132137 ... S RIEN=$P(PDATA,U,1)
    133  ... S ^TMP("PXRMPLD",$J,DFN,"REM",RIEN)=PDATA,PDATA=""
     138 ... S ^TMP("PXRMPLD",$J,DFN,"REMDATA",RIEN)=PDATA,PDATA=""
    134139 . I GETFIND D
    135140 .. N DL
    136  .. F IND=1:1:DDATA("FIND","LEN") D
    137  ... S JND=$P(DDATA("FIND"),",",IND)
    138  ... S DTYPE=DDATA("FIND",JND,JND)
     141 .. F IND=1:1:FINDDATA("LEN") D
     142 ... S JND=$P(FINDDATA,",",IND)
     143 ... S DTYPE=FINDDATA(JND,JND)
    139144 ... S KND=$O(^PXRMXP(810.5,PLIEN,30,IEN,"DATA","B",DTYPE,""))
    140145 ... S DL=$S(KND="":0,1:$L(^PXRMXP(810.5,PLIEN,30,IEN,"DATA",KND,0),U))
    141146 ... S DATA=$S(KND="":"",1:$P(^PXRMXP(810.5,PLIEN,30,IEN,"DATA",KND,0),U,2,DL))
    142  ... S ^TMP("PXRMPLD",$J,DFN,"FIND",JND)=DATA
     147 ... S ^TMP("PXRMPLD",$J,DFN,"FINDDATA",JND)=DATA
    143148 ;Get appointment data for all patients on the list.
    144149 I GETAPP D
     
    146151 . S ARRAY(1)=DT,ARRAY(3)="I;R"
    147152 . S ARRAY(4)="^TMP($J,""PXRMPL""",ARRAY("FLDS")=""
    148  . F IND=1:1:DDATA("APP","LEN") D
    149  .. S JND=$P(DDATA("APP"),",",IND)
     153 . F IND=1:1:APPDATA("LEN") D
     154 .. S JND=$P(APPDATA,",",IND)
    150155 .. S KND=0
    151  .. F  S KND=$O(DDATA("APP",JND,KND)) Q:KND=""  S ARRAY("FLDS")=ARRAY("FLDS")_KND_";"
     156 .. F  S KND=$O(APPDATA(JND,KND)) Q:KND=""  S ARRAY("FLDS")=ARRAY("FLDS")_KND_";"
    152157 . K ^TMP($J,"PXRMPL"),^TMP($J,"SDAMA301")
    153158 . S IND=0
     
    158163 . I COUNT=-1 D  Q
    159164 .. D APPERR^PXRMPDRS
    160  .. S DDATA("APP","ERROR")=""
     165 .. S APPDATA("ERROR")=""
    161166 .. K ^TMP($J,"PXRMPL"),^TMP($J,"SDAMA301")
    162167 . F IND=1:1:COUNT D
     
    172177 ..... S TDATA=$P(TDATA,U,2),TDATA=$P(TDATA,";",2)
    173178 ..... S PDATA=PDATA_U_TDATA
    174  ..... S ^TMP("PXRMPLD",$J,DFN,"APP",KND)=PDATA
     179 ..... S ^TMP("PXRMPLD",$J,DFN,"APPDATA",KND)=PDATA
    175180 . K ^TMP($J,"PXRMPL"),^TMP($J,"SDAMA301")
    176  I DELIM=1 D DELIMPR^PXRMPDRP(DC,PLIEN,.DDATA)
    177  I DELIM=0 D REGPR^PXRMPDRP(PLIEN,.DDATA)
     181 I DELIM=1 D DELIMPR^PXRMPDRP(DC,PLIEN,.ADDDATA,.APPDATA,.DEMDATA,.FINDDATA,.INPDATA,.PFACDATA,.REMDATA)
     182 I DELIM=0 D REGPR^PXRMPDRP(PLIEN,.ADDDATA,.APPDATA,.DEMDATA,.FINDDATA,.INPDATA,.PFACDATA,.REMDATA)
    178183 Q
    179184 ;
     
    184189 ;
    185190PAGE ;
    186  I ($E(IOST,1,2)="C-")&(IO=IO(0)) D
     191 I ($E(IOST)="C")&(IO=IO(0)) D
    187192 .S DIR(0)="E"
    188193 .W !
     
    191196 W:$D(IOF) @IOF
    192197 S PAGE=PAGE+1
    193  I ($E(IOST,1,2)="C-")&(IO=IO(0)) W @IOF
    194  Q
    195  ;
     198 I $E(IOST)="C",IO=IO(0) W @IOF
     199 Q
     200 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPDRP.m

    r628 r636  
    1 PXRMPDRP ;SLC/AGP,PKR - Patient List Demographic report print routine ;11/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMPDRP ;SLC/AGP,PKR - Patient List Demographic report print routine ;06/20/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44ADDTXT(TEXT) ;Accumulate text in ^TMP.
     
    77 Q
    88 ;
    9 APPHDR(DC,DDATA,SUB) ;Build the appointment header.
    10  I DDATA(SUB,"LEN")'>0 Q
     9APPHDR(DC,APPDATA) ;Build the appointment header.
     10 I APPDATA("LEN")'>0 Q
    1111 N HDR,IND,JND,KND,LND,TEMP
    1212 S IND=0,HDR=""
    13  F IND=1:1:DDATA(SUB,"MAX") D
    14  . F JND=1:1:DDATA(SUB,"LEN") D
    15  .. S KND=$P(DDATA(SUB),",",JND)
     13 F IND=1:1:APPDATA("MAX") D
     14 . F JND=1:1:APPDATA("LEN") D
     15 .. S KND=$P(APPDATA,",",JND)
    1616 .. S LND=""
    17  .. F  S LND=$O(DDATA(SUB,KND,LND)) Q:LND=""  D
    18  ... S TEMP=$P(DDATA(SUB,KND,LND),U,1)
     17 .. F  S LND=$O(APPDATA(KND,LND)) Q:LND=""  D
     18 ... S TEMP=$P(APPDATA(KND,LND),U,1)
    1919 ... S HDR=HDR_TEMP_IND_DC
    20  S DDATA(SUB,"HDR")=HDR
    21  Q
    22  ;
    23 APPPRINT(DFN,DDATA,SUB) ;Print appointment data.
     20 S APPDATA("HDR")=HDR
     21 Q
     22 ;
     23APPPRINT(DFN,APPDATA) ;Print appointment data.
    2424 N CLINIC,COUNT,DATE,HDR,IND,JND,KND,LINE,PCLINIC,PDATE,TEMP
    2525 S (PCLINIC,PDATE)=0
    26  F IND=1:1:DDATA(SUB,"LEN") D
    27  . S JND=$P(DDATA(SUB),",",IND)
     26 F IND=1:1:APPDATA("LEN") D
     27 . S JND=$P(APPDATA,",",IND)
    2828 . I JND=1 S PDATE=1
    2929 . I JND=2 S PCLINIC=1
    3030 S HDR=""
    31  I PDATE S HDR=" "_$P(DDATA(SUB,1,1),U,1)
    32  I PCLINIC S HDR=HDR_"   "_$P(DDATA(SUB,2,2),U,1)
     31 I PDATE S HDR=" "_$P(APPDATA(1,1),U,1)
     32 I PCLINIC S HDR=HDR_"   "_$P(APPDATA(2,2),U,1)
    3333 D ADDTXT(" ")
    3434 D ADDTXT("Appointment Data")
    3535 D ADDTXT(HDR)
    3636 S COUNT=0
    37  F  S COUNT=$O(^TMP("PXRMPLD",$J,DFN,"APP",COUNT)) Q:COUNT=""  D
    38  . S TEMP=$G(^TMP("PXRMPLD",$J,DFN,"APP",COUNT))
     37 F  S COUNT=$O(^TMP("PXRMPLD",$J,DFN,"APPDATA",COUNT)) Q:COUNT=""  D
     38 . S TEMP=$G(^TMP("PXRMPLD",$J,DFN,"APPDATA",COUNT))
    3939 . S LINE=""
    4040 . I PDATE S LINE=LINE_$P(TEMP,U,1)
     
    4343 Q
    4444 ;
    45 DELIMHDR(DC,DDATA,SUB) ;Build the delimited header for a data type.
    46  I DDATA(SUB,"LEN")'>0 Q
     45DELIMHDR(DC,DATA) ;Build the delimited header for a data type.
     46 I DATA("LEN")'>0 Q
    4747 N HDR,IND,JND,KND,LND,MAX,TEMP
    4848 S IND=0,HDR=""
    49  F IND=1:1:DDATA(SUB,"LEN") D
    50  . S JND=$P(DDATA(SUB),",",IND)
     49 F IND=1:1:DATA("LEN") D
     50 . S JND=$P(DATA,",",IND)
    5151 . S KND=""
    52  . F  S KND=$O(DDATA(SUB,JND,KND)) Q:KND=""  D
    53  .. S TEMP=$P(DDATA(SUB,JND,KND),U,1)
    54  .. S MAX=$P(DDATA(SUB,JND,KND),U,3)
     52 . F  S KND=$O(DATA(JND,KND)) Q:KND=""  D
     53 .. S TEMP=$P(DATA(JND,KND),U,1)
     54 .. S MAX=$P(DATA(JND,KND),U,3)
    5555 .. I MAX="" S HDR=HDR_TEMP_DC
    5656 .. I +MAX>0 F LND=1:1:MAX S HDR=HDR_TEMP_LND_DC
    57  S DDATA(SUB,"HDR")=HDR
    58  Q
    59  ;
    60 DELIMPR(DC,PLIEN,DDATA) ;
     57 S DATA("HDR")=HDR
     58 Q
     59 ;
     60DELIMPR(DC,PLIEN,ADDDATA,APPDATA,DEMDATA,FINDDATA,INPDATA,PFACDATA,REMDATA) ;
    6161 ;Print the delimited report.
    6262 N DATALIST,DFN,IND,NDT,PNAME
    6363 S NDT=0
    64  I DDATA("ADD","LEN")>0 S NDT=NDT+1,DATALIST(NDT)="ADD"
    65  I DDATA("APP","LEN")>0 S NDT=NDT+1,DATALIST(NDT)="APP"
    66  I DDATA("DEM","LEN")>0 S NDT=NDT+1,DATALIST(NDT)="DEM"
    67  I DDATA("ELIG","LEN")>0 S NDT=NDT+1,DATALIST(NDT)="ELIG"
    68  I DDATA("FIND","LEN")>0 S NDT=NDT+1,DATALIST(NDT)="FIND"
    69  I DDATA("INP","LEN")>0 S NDT=NDT+1,DATALIST(NDT)="INP"
    70  I DDATA("PFAC","LEN")>0 S NDT=NDT+1,DATALIST(NDT)="PFAC"
    71  I DDATA("REM","LEN")>0 S NDT=NDT+1,DATALIST(NDT)="REM"
    72  S DATALIST(0)=NDT
     64 I ADDDATA("LEN")>0 S NDT=NDT+1,DATALIST(NDT)="ADDDATA"
     65 I APPDATA("LEN")>0 S NDT=NDT+1,DATALIST(NDT)="APPDATA"
     66 I DEMDATA("LEN")>0 S NDT=NDT+1,DATALIST(NDT)="DEMDATA"
     67 I ELIGDATA("LEN")>0 S NDT=NDT+1,DATALIST(NDT)="ELIGDATA"
     68 I FINDDATA("LEN")>0 S NDT=NDT+1,DATALIST(NDT)="FINDDATA"
     69 I INPDATA("LEN")>0 S NDT=NDT+1,DATALIST(NDT)="INPDATA"
     70 I PFACDATA("LEN")>0 S NDT=NDT+1,DATALIST(NDT)="PFACDATA"
     71 I REMDATA("LEN")>0 S NDT=NDT+1,DATALIST(NDT)="REMDATA"
    7372 D TITLE(PLIEN,1)
    74  ;Create the delimited header.
     73 ;Output the delimited header.
    7574 F IND=1:1:NDT D
    76  . I DATALIST(IND)="ADD" D DELIMHDR(DC,.DDATA,"ADD") Q
    77  . I DATALIST(IND)="APP" D APPHDR(DC,.DDATA,"APP") Q
    78  . I DATALIST(IND)="DEM" D DELIMHDR(DC,.DDATA,"DEM") Q
    79  . I DATALIST(IND)="ELIG" D DELIMHDR(DC,.DDATA,"ELIG") Q
    80  . I DATALIST(IND)="FIND" D DELIMHDR(DC,.DDATA,"FIND") Q
    81  . I DATALIST(IND)="INP" D DELIMHDR(DC,.DDATA,"INP") Q
    82  . I DATALIST(IND)="PFAC" D PFACHDR(.DDATA,"PFAC")
    83  . I DATALIST(IND)="REM" D REMHDR(DC,.DDATA,"REM") Q
    84  D DELTITLE(DC,.DATALIST,.DDATA)
     75 . I DATALIST(IND)="ADDDATA" D DELIMHDR(DC,.ADDDATA) Q
     76 . I DATALIST(IND)="APPDATA" D APPHDR(DC,.APPDATA) Q
     77 . I DATALIST(IND)="DEMDATA" D DELIMHDR(DC,.DEMDATA) Q
     78 . I DATALIST(IND)="ELIGDATA" D DELIMHDR(DC,.ELIGDATA) Q
     79 . I DATALIST(IND)="FINDDATA" D DELIMHDR(DC,.FINDDATA) Q
     80 . I DATALIST(IND)="INPDATA" D DELIMHDR(DC,.INPDATA) Q
     81 . I DATALIST(IND)="PFACDATA" D PFACHDR(.PFACDATA)
     82 . I DATALIST(IND)="REMDATA" D REMHDR(DC,.REMDATA) Q
     83 D DELTITLE(DC,.ADDDATA,.APPDATA,.DEMDATA,.FINDDATA,.INPDATA,.PFACDATA,.REMDATA)
    8584 S PNAME=":"
    8685 F  S PNAME=$O(^TMP("PXRMPLN",$J,PNAME)) Q:PNAME=""  D
     
    8988 .. W !,PNAME_DC
    9089 .. F IND=1:1:NDT D
    91  ... I DATALIST(IND)="ADD" D PDELDATA(DFN,DC,DATALIST(IND),.DDATA,"ADD") Q
    92  ... I DATALIST(IND)="APP" D PAPPDATA(DFN,DC,.DDATA,"APP") Q
    93  ... I DATALIST(IND)="DEM" D PDELDATA(DFN,DC,DATALIST(IND),.DDATA,"DEM") Q
    94  ... I DATALIST(IND)="ELIG" D PDELDATA(DFN,DC,DATALIST(IND),.DDATA,"ELIG") Q
    95  ... I DATALIST(IND)="FIND" D PFINDATA(DFN,DC,.DDATA,"FIND") Q
    96  ... I DATALIST(IND)="INP" D PDELDATA(DFN,DC,DATALIST(IND),.DDATA,"INP") Q
    97  ... I DATALIST(IND)="PFAC" D PFACDATA(DFN,.DDATA,"PFAC") Q
    98  ... I DATALIST(IND)="REM" D PREMDATA(DFN,DC,.DDATA,"REM") Q
     90 ... I DATALIST(IND)="ADDDATA" D PDELDATA(DFN,DC,DATALIST(IND),.ADDDATA) Q
     91 ... I DATALIST(IND)="APPDATA" D PAPPDATA(DFN,DC,.APPDATA) Q
     92 ... I DATALIST(IND)="DEMDATA" D PDELDATA(DFN,DC,DATALIST(IND),.DEMDATA) Q
     93 ... I DATALIST(IND)="ELIGDATA" D PDELDATA(DFN,DC,DATALIST(IND),.ELIGDATA) Q
     94 ... I DATALIST(IND)="FINDDATA" D PFINDATA(DFN,DC,.FINDDATA) Q
     95 ... I DATALIST(IND)="INPDATA" D PDELDATA(DFN,DC,DATALIST(IND),.INPDATA) Q
     96 ... I DATALIST(IND)="PFACDATA" D PFACDATA(DFN,.PFACDATA) Q
     97 ... I DATALIST(IND)="REMDATA" D PREMDATA(DFN,DC,.REMDATA) Q
    9998 .. W "\\"
    10099 Q
    101100 ;
    102 DELTITLE(DC,DATALIST,DDATA) ;Combine all the headers to create the delimited title.
     101DELTITLE(DC,ADDDATA,APPDATA,DEMDATA,FINDDATA,INPDATA,PFACDATA,REMDATA) ;Combine
     102 ;all the headers to create the delimited title.
    103103 W !,"PATIENT"_DC
    104  N IND
    105  F IND=1:1:DATALIST(0) W DDATA(DATALIST(IND),"HDR")
     104 W $G(ADDDATA("HDR"))
     105 W $G(APPDATA("HDR"))
     106 W $G(DEMDATA("HDR"))
     107 W $G(ELIGDATA("HDR"))
     108 W $G(FINDDATA("HDR"))
     109 W $G(INPDATA("HDR"))
     110 W $G(PFACDATA("HDR"))
     111 W $G(REMDATA("HDR"))
    106112 W "\\"
    107113 Q
    108114 ;
    109 FINDPR(DFN,DDATA,SUB) ;Print finding information.
     115FINDPR(DFN,FINDDATA) ;Print finding information.
    110116 N IND,JND,LINE,TEMP
    111117 D ADDTXT(" ")
    112118 S LINE="Finding Data"
    113119 D ADDTXT(LINE)
    114  F IND=1:1:DDATA(SUB,"LEN") D
    115  . S JND=$P(DDATA(SUB),",",IND)
    116  . S TEMP=$G(^TMP("PXRMPLD",$J,DFN,"FIND",JND))
     120 F IND=1:1:FINDDATA("LEN") D
     121 . S JND=$P(FINDDATA,",",IND)
     122 . S TEMP=$G(^TMP("PXRMPLD",$J,DFN,"FINDDATA",JND))
    117123 . I TEMP="" Q
    118  . S LINE=" "_$P(DDATA(SUB,JND,JND),U,1)_": "_TEMP
     124 . S LINE=" "_$P(FINDDATA(JND,JND),U,1)_": "_TEMP
    119125 . D ADDTXT(LINE)
    120126 Q
     
    134140 ;
    135141PAGE ;
    136  I ($E(IOST,1,2)="C-")&(IO=IO(0)) D
     142 I ($E(IOST)="C")&(IO=IO(0)) D
    137143 . N DIR
    138144 . S DIR(0)="E"
     
    141147 I $D(DUOUT)!$D(DTOUT) Q
    142148 W:$D(IOF) @IOF
    143  I ($E(IOST,1,2)="C-")&(IO=IO(0)) W @IOF
    144  Q
    145  ;
    146 PAPPDATA(DFN,DC,DDATA,SUB) ;Print the delimited appointment data.
     149 I $E(IOST)="C",IO=IO(0) W @IOF
     150 Q
     151 ;
     152PAPPDATA(DFN,DC,APPDATA) ;Print the delimited appointment data.
    147153 N IND,JND,KND,LINE,LND,PIECE,TEMP
    148  I DDATA(SUB,"LEN")'>0 Q
     154 I APPDATA("LEN")'>0 Q
    149155 S LINE=""
    150  F IND=1:1:DDATA(SUB,"MAX") D
    151  . S TEMP=$G(^TMP("PXRMPLD",$J,DFN,"APP",IND))
    152  . F JND=1:1:DDATA(SUB,"LEN") D
    153  .. S KND=$P(DDATA(SUB),",",JND)
     156 F IND=1:1:APPDATA("MAX") D
     157 . S TEMP=$G(^TMP("PXRMPLD",$J,DFN,"APPDATA",IND))
     158 . F JND=1:1:APPDATA("LEN") D
     159 .. S KND=$P(APPDATA,",",JND)
    154160 .. S LND=""
    155  .. F  S LND=$O(DDATA(SUB,KND,LND)) Q:LND=""  D
    156  ... S PIECE=$P(DDATA(SUB,KND,KND),U,2)
     161 .. F  S LND=$O(APPDATA(KND,LND)) Q:LND=""  D
     162 ... S PIECE=$P(APPDATA(KND,KND),U,2)
    157163 ... S LINE=LINE_$P(TEMP,U,PIECE)_DC
    158164 W LINE
    159165 Q
    160166 ;
    161 PDELDATA(DFN,DC,DTYPE,DDATA,SUB) ;Print the delimited data.
     167PDELDATA(DFN,DC,DTYPE,DATA) ;Print the delimited data.
    162168 N IND,JND,KND,LINE,LND,TEMP,TTEMP
     169 I DATA("LEN")'>0 Q
    163170 S TEMP=$G(^TMP("PXRMPLD",$J,DFN,DTYPE))
    164171 S LINE=""
    165  F IND=1:1:DDATA(DTYPE,"LEN") D
    166  . S JND=$P(DDATA(DTYPE),",",IND)
     172 F IND=1:1:DATA("LEN") D
     173 . S JND=$P(DATA,",",IND)
    167174 . S KND=""
    168  . F  S KND=$O(DDATA(DTYPE,JND,KND)) Q:KND=""  D
    169  .. S MAX=$P(DDATA(DTYPE,JND,KND),U,3)
     175 . F  S KND=$O(DATA(JND,KND)) Q:KND=""  D
     176 .. S MAX=$P(DATA(JND,KND),U,3)
    170177 .. I MAX="" S LINE=LINE_$P(TEMP,U,KND)_DC Q
    171178 .. I +MAX>1 S TTEMP=$P(TEMP,U,KND) F LND=1:1:MAX S LINE=LINE_$P(TTEMP,"~",LND)_DC
     
    173180 Q
    174181 ;
    175 PFACHDR(DDATA,SUB) ;Build the preferred facility header.
    176  I DDATA(SUB,0)=1 S DDATA(SUB,"HDR")="PATIENT'S PREFERRED FACILITY"
    177  Q
    178  ;
    179 PFACDATA(DFN,DDATA,SUB) ;Print the patient's preferred facility data, delimited.
    180  I DDATA(SUB,0)=0 Q
    181  W ^TMP("PXRMPLD",$J,DFN,"PFAC")
    182  Q
    183  ;
    184 PFACPR(DFN,DDATA,SUB) ;Print the patient's preferred facility.
    185  I DDATA(SUB,0)=0 Q
     182PFACHDR(PFACDATA) ;Build the preferred facility header.
     183 I PFACDATA(0)=1 S PFACDATA("HDR")="PATIENT'S PREFERRED FACILITY"
     184 Q
     185 ;
     186PFACDATA(DFN,PFACDATA) ;Print the patient's preferred facility data, delimited.
     187 I PFACDATA(0)=0 Q
     188 W ^TMP("PXRMPLD",$J,DFN,"PFACDATA")
     189 Q
     190 ;
     191PFACPR(DFN,PFACDATA) ;Print the patient's preferred facility.
     192 I PFACDATA(0)=0 Q
    186193 D ADDTXT("Patient's Preferred Facility")
    187  D ADDTXT(" "_$G(^TMP("PXRMPLD",$J,DFN,"PFAC")))
    188  Q
    189  ;
    190 PFINDATA(DFN,DC,DDATA,SUB) ;Print the finding data.
     194 D ADDTXT(" "_$G(^TMP("PXRMPLD",$J,DFN,"PFACDATA")))
     195 Q
     196 ;
     197PFINDATA(DFN,DC,FINDDATA) ;Print the finding data.
    191198 N IND,JND,LINE,TEMP
    192  I DDATA(SUB,"LEN")'>0 Q
     199 I FINDDATA("LEN")'>0 Q
    193200 S LINE=""
    194  F IND=1:1:DDATA(SUB,"LEN") D
    195  . S JND=$P(DDATA(SUB),",",IND)
    196  . S TEMP=$G(^TMP("PXRMPLD",$J,DFN,"FIND",JND))
     201 F IND=1:1:FINDDATA("LEN") D
     202 . S JND=$P(FINDDATA,",",IND)
     203 . S TEMP=$G(^TMP("PXRMPLD",$J,DFN,"FINDDATA",JND))
    197204 . S LINE=LINE_TEMP_DC
    198205 W LINE
    199206 Q
    200207 ;
    201 PREMDATA(DFN,DC,DDATA,SUB) ;Print the reminder data.
     208PREMDATA(DFN,DC,REMDATA) ;Print the reminder data.
    202209 N IND,JND,LINE,TEMP
    203  I DDATA(SUB,"LEN")'>0 Q
     210 I REMDATA("LEN")'>0 Q
    204211 S LINE=""
    205  F IND=1:1:DDATA(SUB,"LEN") D
    206  . S JND=$P(DDATA(SUB),",",IND)
    207  . S LINE=LINE_DDATA(SUB,"RNAME",JND)_DC
    208  . S TEMP=$G(^TMP("PXRMPLD",$J,DFN,"REM",DDATA(SUB,"IEN",JND)))
     212 F IND=1:1:REMDATA("LEN") D
     213 . S JND=$P(REMDATA,",",IND)
     214 . S LINE=LINE_REMDATA("RNAME",JND)_DC
     215 . S TEMP=$G(^TMP("PXRMPLD",$J,DFN,"REMDATA",REMDATA("IEN",JND)))
    209216 . S LINE=LINE_$P(TEMP,U,2)_DC_$P(TEMP,U,3)_"^"_$P(TEMP,U,4)_DC
    210217 W LINE
    211218 Q
    212219 ;
    213 REGPR(PLIEN,DDATA,SUB) ;
     220REGPR(PLIEN,ADDDATA,APPDATA,DEMDATA,FINDDATA,INPDATA,PFACDATA,REMDATA) ;
    214221 ;Print the regular report..
    215222 N DATATYPE,DFN,PNAME,LINCNT
     
    225232 .. S DATATYPE=""
    226233 .. F  S DATATYPE=$O(^TMP("PXRMPLD",$J,DFN,DATATYPE)) Q:DATATYPE=""  D
    227  ... I DATATYPE="ADD" D VADPTPR(DFN,"Address Data",DATATYPE,.DDATA,"ADD") Q
    228  ... I DATATYPE="APP" D APPPRINT(DFN,.DDATA,"APP") Q
    229  ... I DATATYPE="DEM" D VADPTPR(DFN,"Demographic Data",DATATYPE,.DDATA,"DEM") Q
    230  ... I DATATYPE="ELIG" D VADPTPR(DFN,"Eligibility Data",DATATYPE,.DDATA,"ELIG") Q
    231  ... I DATATYPE="FIND" D FINDPR(DFN,.DDATA,"FIND") Q
    232  ... I DATATYPE="INP" D VADPTPR(DFN,"Inpatient Data",DATATYPE,.DDATA,"INP") Q
    233  ... I DATATYPE="PFAC" D PFACPR(DFN,.DDATA,"PFAC") Q
    234  ... I DATATYPE="REM" D REMPR(DFN,.DDATA,"REM") Q
     234 ... I DATATYPE="ADDDATA" D VADPTPR(DFN,"Address Data",DATATYPE,.ADDDATA) Q
     235 ... I DATATYPE="APPDATA" D APPPRINT(DFN,.APPDATA) Q
     236 ... I DATATYPE="DEMDATA" D VADPTPR(DFN,"Demographic Data",DATATYPE,.DEMDATA) Q
     237 ... I DATATYPE="ELIGDATA" D VADPTPR(DFN,"Eligibility Data",DATATYPE,.ELIGDATA) Q
     238 ... I DATATYPE="FINDDATA" D FINDPR(DFN,.FINDDATA) Q
     239 ... I DATATYPE="INPDATA" D VADPTPR(DFN,"Inpatient Data",DATATYPE,.INPDATA) Q
     240 ... I DATATYPE="PFACDATA" D PFACPR(DFN,.PFACDATA) Q
     241 ... I DATATYPE="REMDATA" D REMPR(DFN,.REMDATA) Q
    235242 D OUTPUT
    236243 K ^TMP("PXRMPDEM",$J)
    237244 Q
    238245 ;
    239 REMHDR(DC,DDATA,SUB) ;Build the reminder data delimited header.
     246REMHDR(DC,REMDATA) ;Build the reminder data delimited header.
    240247 N HDR,IND,JND
    241248 S HDR=""
    242  F IND=1:1:DDATA(SUB,"LEN") D
    243  . S JND=$P(DDATA(SUB),",",IND)
     249 F IND=1:1:REMDATA("LEN") D
     250 . S JND=$P(REMDATA,",",IND)
    244251 . S HDR=HDR_"REMINDER"_JND_DC_"STATUS"_JND_DC_"DUE DATE"_JND_DC_"LAST DONE"_JND_DC
    245  S DDATA(SUB,"HDR")=HDR
    246  Q
    247  ;
    248 REMPR(DFN,DDATA,SUB) ;Print reminder status information.
     252 S REMDATA("HDR")=HDR
     253 Q
     254 ;
     255REMPR(DFN,REMDATA) ;Print reminder status information.
    249256 N DUE,IND,JND,LAST,LINE,NSP,STATUS,TEMP
    250257 D ADDTXT(" ")
    251258 S LINE="Reminder:"_$$INSCHR^PXRMEXLC(27," ")_"--STATUS--  --DUE DATE--  --LAST DONE--"
    252259 D ADDTXT(LINE)
    253  F IND=1:1:DDATA(SUB,"LEN") D
    254  . S JND=$P(DDATA(SUB),",",IND)
    255  . S RIEN=DDATA(SUB,"IEN",JND)
    256  . S TEMP=$G(^TMP("PXRMPLD",$J,DFN,"REM",RIEN))
     260 F IND=1:1:REMDATA("LEN") D
     261 . S JND=$P(REMDATA,",",IND)
     262 . S RIEN=REMDATA("IEN",JND)
     263 . S TEMP=$G(^TMP("PXRMPLD",$J,DFN,"REMDATA",RIEN))
    257264 . I TEMP="" Q
    258265 . S STATUS=$P(TEMP,U,2)
    259266 . S DUE=$P(TEMP,U,3),DUE=$$EDATE^PXRMDATE(DUE)
    260267 . S LAST=$P(TEMP,U,4),LAST=$$EDATE^PXRMDATE(LAST)
    261  . S NSP=38-$L(DDATA(SUB,"RNAME",JND))
    262  . S LINE=DDATA(SUB,"RNAME",JND)_$$INSCHR^PXRMEXLC(NSP," ")_STATUS
     268 . S NSP=38-$L(REMDATA("RNAME",JND))
     269 . S LINE=REMDATA("RNAME",JND)_$$INSCHR^PXRMEXLC(NSP," ")_STATUS
    263270 . S NSP=54-$L(LINE)-($L(DUE)/2)
    264271 . S LINE=LINE_$$INSCHR^PXRMEXLC(NSP," ")_DUE
     
    282289 Q
    283290 ;
    284 VADPTPR(DFN,DNAME,DTYPE,DDATA,SUB) ;Print data returned by a VADPT call.
     291VADPTPR(DFN,DNAME,DTYPE,DATA) ;Print data returned by a VADPT call.
    285292 N IND,JND,KND,LINE,LND,MAX,TEMP,TTEMP
    286293 D ADDTXT(" ")
    287294 D ADDTXT(DNAME)
    288295 S TEMP=$G(^TMP("PXRMPLD",$J,DFN,DTYPE))
    289  F IND=1:1:DDATA(SUB,"LEN") D
    290  . S JND=$P(DDATA(SUB),",",IND)
     296 F IND=1:1:DATA("LEN") D
     297 . S JND=$P(DATA,",",IND)
    291298 . S KND=""
    292  . F  S KND=$O(DDATA(SUB,JND,KND)) Q:KND=""  D
     299 . F  S KND=$O(DATA(JND,KND)) Q:KND=""  D
    293300 .. S TTEMP=$P(TEMP,U,KND)
    294  .. S MAX=+$P(DDATA(SUB,JND,KND),U,3)
     301 .. S MAX=+$P(DATA(JND,KND),U,3)
    295302 .. I MAX=0 S MAX=1
    296303 .. F LND=1:1:MAX D
    297  ... S LINE=" "_$P(DDATA(SUB,JND,KND),U,1)_": "_$P(TTEMP,"~",LND)
     304 ... S LINE=" "_$P(DATA(JND,KND),U,1)_": "_$P(TTEMP,"~",LND)
    298305 ... D ADDTXT(LINE)
    299306 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPDRS.m

    r628 r636  
    1 PXRMPDRS ;SLC/PKR - Patient List Demographic Report data selection. ;03/22/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMPDRS ;SLC/PKR - Patient List Demographic Report data selection. ;07/18/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    4 ADDSEL(DATA,SUB) ;Let the user select the address information they want.
     4ADDSEL(ADDDATA) ;Let the user select the address information they want.
    55 N ADDLIST,LIST
    6  S ADDLIST("A",1)=" 1 - CURRENT ADDRESS",DATA(SUB,1,1)="STREET ADDRESS #1"_U_1
    7  S DATA(SUB,1,2)="STREET ADDRESS #2"_U_1,DATA(SUB,1,3)="STREET ADDRESS #3"_U_1
    8  S DATA(SUB,1,4)="CITY"_U_1,DATA(SUB,1,5)="STATE"_U_2,DATA(SUB,1,6)="ZIP"_U_1
    9  S DATA(SUB,1,7)="COUNTY"_U_2
    10  S ADDLIST("A",2)=" 2 - PHONE NUMBER",DATA(SUB,2,8)="PHONE NUMBER"_U_1
     6 S ADDLIST("A",1)=" 1 - CURRENT ADDRESS",ADDDATA(1,1)="STREET ADDRESS #1"_U_1
     7 S ADDDATA(1,2)="STREET ADDRESS #2"_U_1,ADDDATA(1,3)="STREET ADDRESS #3"_U_1
     8 S ADDDATA(1,4)="CITY"_U_1,ADDDATA(1,5)="STATE"_U_2,ADDDATA(1,6)="ZIP"_U_1
     9 S ADDDATA(1,7)="COUNTY"_U_2
     10 S ADDLIST("A",2)=" 2 - PHONE NUMBER",ADDDATA(2,8)="PHONE NUMBER"_U_1
    1111 S ADDLIST("A")="Enter your selection(s)"
    1212 S ADDLIST("?")="^D HELP^PXRMPDRS"
     
    1414 S LIST=$$SEL^PXRMPDRS(.ADDLIST,2)
    1515 I $D(DTOUT)!$D(DUOUT) Q
    16  S DATA(SUB)=LIST
    17  S DATA(SUB,"LEN")=$L(LIST,",")-1
     16 S ADDDATA=LIST
     17 S ADDDATA("LEN")=$L(LIST,",")-1
    1818 Q
    1919 ;
     
    4444 Q
    4545 ;
    46 APPSEL(DATA,SUB) ;Let the user select the appointment information they want.
     46APPSEL(APPDATA) ;Let the user select the appointment information they want.
    4747 ;The first subscript of APPDATA is the selection number and the
    4848 ;the second subscript is the subscript where the data is returned
     
    5050 ;second piece is the piece of VAPA this is displayed.
    5151 N APPLIST,LIST,MAX
    52  S APPLIST("A",1)=" 1 - APPOINTMENT DATE",DATA(SUB,1,1)="APPOINTMENT DATE"_U_1
    53  S APPLIST("A",2)=" 2 - CLINIC",DATA(SUB,2,2)="CLINIC"_U_2
     52 S APPLIST("A",1)=" 1 - APPOINTMENT DATE",APPDATA(1,1)="APPOINTMENT DATE"_U_1
     53 S APPLIST("A",2)=" 2 - CLINIC",APPDATA(2,2)="CLINIC"_U_2
    5454 S APPLIST("A")="Enter your selection(s)"
    5555 S APPLIST("?")="^D HELP^PXRMPDRS"
     
    5757 S LIST=$$SEL^PXRMPDRS(.APPLIST,2)
    5858 I $D(DTOUT)!$D(DUOUT) Q
    59  S DATA(SUB)=LIST
    60  S DATA(SUB,"LEN")=$L(LIST,",")-1
    61  I DATA(SUB,"LEN")=0 Q
    62  S DATA(SUB,"MAX")=$$ASKNUM^PXRMEUT("Maximum number of appointments to display",1,25)
     59 S APPDATA=LIST
     60 S APPDATA("LEN")=$L(LIST,",")-1
     61 I APPDATA("LEN")=0 Q
     62 S APPDATA("MAX")=$$ASKNUM^PXRMEUT("Maximum number of appointments to display",1,25)
    6363 Q
    6464 ;
    65 DATASEL(LISTIEN,DATA,SUB) ; Build a list of data that is availble for
     65DATASEL(LISTIEN,FINDDATA) ; Build a list of data that is availble for
    6666 ;this patient list and let the user select what they want.
    6767 N IND,DATALIST,DTYPE
     
    6969 F  S DTYPE=$O(^PXRMXP(810.5,LISTIEN,35,"B",DTYPE)) Q:DTYPE=""  D
    7070 . S IND=IND+1,DATALIST("A",IND)=" "_IND_" - "_DTYPE
    71  . S DATA(SUB,IND,IND)=DTYPE
     71 . S FINDDATA(IND,IND)=DTYPE
    7272 ;If there is no data quit.
    73  I IND=0 S DATA(SUB,"LEN")=0 Q
     73 I IND=0 S FINDDATA("LEN")=0 Q
    7474 S DATALIST("A")="Enter your selections(s)"
    7575 S DATALIST("?")="^D HELP^PXRMPDRS"
     
    7777 S LIST=$$SEL^PXRMPDRS(.DATALIST,IND)
    7878 I $D(DTOUT)!$D(DUOUT) Q
    79  S DATA(SUB)=LIST
    80  S DATA(SUB,"LEN")=$L(LIST,",")-1
     79 S FINDDATA=LIST
     80 S FINDDATA("LEN")=$L(LIST,",")-1
    8181 Q
    8282 ;
    83 DEMSEL(DATA,SUB) ;Let the user select the demographic information they want.
    84  ;The first subscript of DATA is the selection number and the
     83DEMSEL(DEMDATA) ;Let the user select the demographic information they want.
     84 ;The first subscript of DEMDATA is the selection number and the
    8585 ;the second subscript is the subscript where the data is returned
    8686 ;in VADM. The first piece of DEMDATA is the name of the data and the
    8787 ;second piece is the piece of VADM this is displayed.
    8888 N DEMLIST,DTOUT,DUOUT,IND,ITEM,JND,KND,LIST,TEMP
    89  S DEMLIST("A",1)=" 1 - SSN",DATA(SUB,1,2)="SSN"_U_2
    90  S DEMLIST("A",2)=" 2 - DATE OF BIRTH",DATA(SUB,2,3)="DOB"_U_2
    91  S DEMLIST("A",3)=" 3 - AGE",DATA(SUB,3,4)="AGE"_U_1
    92  S DEMLIST("A",4)=" 4 - SEX",DATA(SUB,4,5)="SEX"_U_2
    93  S DEMLIST("A",5)=" 5 - DATE OF DEATH",DATA(SUB,5,6)="DOD"_U_2
    94  S DEMLIST("A",6)=" 6 - REMARKS",DATA(SUB,6,7)="REMARKS"_U_1
    95  S DEMLIST("A",7)=" 7 - HISTORIC RACE",DATA(SUB,7,8)="HISTORIC RACE"_U_2
    96  S DEMLIST("A",8)=" 8 - RELIGION",DATA(SUB,8,9)="RELIGION"_U_2
    97  S DEMLIST("A",9)=" 9 - MARITAL STATUS",DATA(SUB,9,10)="MARTIAL STATUS"_U_2
    98  S DEMLIST("A",10)="10 - ETHNICITY",DATA(SUB,10,11)="ETHNICITY"_U_2
    99  S DEMLIST("A",11)="11 - RACE",DATA(SUB,11,12)="RACE"_U_2
     89 S DEMLIST("A",1)=" 1 - SSN",DEMDATA(1,2)="SSN"_U_2
     90 S DEMLIST("A",2)=" 2 - DATE OF BIRTH",DEMDATA(2,3)="DOB"_U_2
     91 S DEMLIST("A",3)=" 3 - AGE",DEMDATA(3,4)="AGE"_U_1
     92 S DEMLIST("A",4)=" 4 - SEX",DEMDATA(4,5)="SEX"_U_2
     93 S DEMLIST("A",5)=" 5 - DATE OF DEATH",DEMDATA(5,6)="DOD"_U_2
     94 S DEMLIST("A",6)=" 6 - REMARKS",DEMDATA(6,7)="REMARKS"_U_1
     95 S DEMLIST("A",7)=" 7 - HISTORIC RACE",DEMDATA(7,8)="HISTORIC RACE"_U_2
     96 S DEMLIST("A",8)=" 8 - RELIGION",DEMDATA(8,9)="RELIGION"_U_2
     97 S DEMLIST("A",9)=" 9 - MARITAL STATUS",DEMDATA(9,10)="MARTIAL STATUS"_U_2
     98 S DEMLIST("A",10)="10 - ETHNICITY",DEMDATA(10,11)="ETHNICITY"_U_2
     99 S DEMLIST("A",11)="11 - RACE",DEMDATA(11,12)="RACE"_U_2
    100100 S DEMLIST("A")="Enter your selection(s)"
    101101 S DEMLIST("?")="^D HELP^PXRMPDRS"
     
    103103 S LIST=$$SEL^PXRMPDRS(.DEMLIST,11)
    104104 I $D(DTOUT)!$D(DUOUT) Q
    105  S DATA(SUB)=LIST
    106  S DATA(SUB,"LEN")=$L(LIST,",")-1
    107  F IND=1:1:DATA(SUB,"LEN") D
     105 S DEMDATA=LIST
     106 S DEMDATA("LEN")=$L(LIST,",")-1
     107 F IND=1:1:DEMDATA("LEN") D
    108108 . S JND=$P(LIST,",",IND)
    109  . S KND=$O(DATA(SUB,JND,""))
    110  . S TEMP=$P(DATA(SUB,JND,KND),U,1)
     109 . S KND=$O(DEMDATA(JND,""))
     110 . S TEMP=$P(DEMDATA(JND,KND),U,1)
    111111 . I TEMP="SSN" D
    112112 .. N FULLSSN
    113113 .. D SSN^PXRMXSD(.FULLSSN)
    114  .. S DATA(SUB,"FULLSSN")=$S($G(FULLSSN)="Y":1,1:0)
    115  . I $D(DTOUT)!$D(DUOUT) S IND=DATA(SUB,"LEN")+1 Q
    116  . I TEMP="ETHNICITY" S $P(DATA(SUB,10,11),U,3)=$$ASKNUM^PXRMEUT("Maximum number of ethnicity entries to display",1,10)
    117  . I TEMP="RACE" S $P(DATA(SUB,11,12),U,3)=$$ASKNUM^PXRMEUT("Maximum number of race entries to display",1,10)
     114 .. S DEMDATA("FULLSSN")=$S($G(FULLSSN)="Y":1,1:0)
     115 . I $D(DTOUT)!$D(DUOUT) S IND=DEMDATA("LEN")+1 Q
     116 . I TEMP="ETHNICITY" S $P(DEMDATA(10,11),U,3)=$$ASKNUM^PXRMEUT("Maximum number of ethnicity entries to display",1,10)
     117 . I TEMP="RACE" S $P(DEMDATA(11,12),U,3)=$$ASKNUM^PXRMEUT("Maximum number of race entries to display",1,10)
    118118 I $D(DTOUT)!$D(DUOUT) K DTOUT,DUOUT G DSEL
    119119 Q
    120120 ;
    121 ELIGSEL(DATA,SUB) ;Let the user select the eligibility data they want.
     121ELIGSEL(ELIGDATA) ;Let the user select the eligibility data they want.
    122122 ;The first subscript of ELIGDATA is the selection number and the
    123123 ;the second subscript is the subscript where the data is returned
     
    125125 ;second piece is the piece of VAEL this is displayed.
    126126 N ELIGLIST,ITEM,LIST
    127  S ELIGLIST("A",1)=" 1 - PRIMARY ELGIBILITY CODE",DATA(SUB,1,1)="PRIMARY ELGIBILITY CODE"_U_2
    128  S ELIGLIST("A",2)=" 2 - PERIOD OF SERVICE",DATA(SUB,2,2)="PERIOD OF SERVICE"_U_2
    129  S ELIGLIST("A",3)=" 3 - % SERVICE CONNECTED",DATA(SUB,3,3)="% SERVICE CONNECTED"_U_2
    130  S ELIGLIST("A",4)=" 4 - VETERAN",DATA(SUB,4,4)="VETERAN"_U_1
    131  S ELIGLIST("A",5)=" 5 - TYPE",DATA(SUB,5,6)="TYPE"_U_2
    132  S ELIGLIST("A",6)=" 6 - ELIGIBILITY STATUS",DATA(SUB,6,8)="ELIGIBILITY STATUS"_U_2
    133  S ELIGLIST("A",7)=" 7 - CURRENT MEANS TEST",DATA(SUB,7,9)="CURRENT MEANS TEST"_U_2
     127 S ELIGLIST("A",1)=" 1 - PRIMARY ELGIBILITY CODE",ELIGDATA(1,1)="PRIMARY ELGIBILITY CODE"_U_2
     128 S ELIGLIST("A",2)=" 2 - PERIOD OF SERVICE",ELIGDATA(2,2)="PERIOD OF SERVICE"_U_2
     129 S ELIGLIST("A",3)=" 3 - % SERVICE CONNECTED",ELIGDATA(3,3)="% SERVICE CONNECTED"_U_2
     130 S ELIGLIST("A",4)=" 4 - VETERAN",ELIGDATA(4,4)="VETERAN"_U_1
     131 S ELIGLIST("A",5)=" 5 - TYPE",ELIGDATA(5,6)="TYPE"_U_2
     132 S ELIGLIST("A",6)=" 6 - ELIGIBILITY STATUS",ELIGDATA(6,8)="ELIGIBILITY STATUS"_U_2
     133 S ELIGLIST("A",7)=" 7 - CURRENT MEANS TEST",ELIGDATA(7,9)="CURRENT MEANS TEST"_U_2
    134134 S ELIGLIST("A")="Enter your selection(s)"
    135135 S ELIGLIST("?")="^D HELP^PXRMPDRS"
     
    137137 S LIST=$$SEL^PXRMPDRS(.ELIGLIST,7)
    138138 I $D(DTOUT)!$D(DUOUT) Q
    139  S DATA(SUB)=LIST
    140  S DATA(SUB,"LEN")=$L(LIST,",")-1
     139 S ELIGDATA=LIST
     140 S ELIGDATA("LEN")=$L(LIST,",")-1
    141141 Q
    142142 ;
     
    147147 Q
    148148 ;
    149 INPSEL(DATA,SUB) ;Let the user select the inpatient information they want.
     149INPSEL(INPDATA) ;Let the user select the inpatient information they want.
    150150 ;The first subscript of INPDATA is the selection number and the
    151151 ;the second subscript is the subscript where the data is returned
     
    153153 ;second piece is the piece of VAIN this is displayed.
    154154 N INPLIST,ITEM,LIST
    155  S INPLIST("A",1)=" 1 - WARD LOCATION",DATA(SUB,1,4)="WARD"_U_2
    156  S INPLIST("A",2)=" 2 - ROOM-BED",DATA(SUB,2,5)="ROOM-BED"_U_1
    157  S INPLIST("A",3)=" 3 - ADMISSION DATE/TIME",DATA(SUB,3,7)="ADMISSION DATE/TIME"_U_2
    158  S INPLIST("A",4)=" 4 - ATTENDING PHYSICIAN",DATA(SUB,4,11)="ATTENDING"_U_2
     155 S INPLIST("A",1)=" 1 - WARD LOCATION",INPDATA(1,4)="WARD"_U_2
     156 S INPLIST("A",2)=" 2 - ROOM-BED",INPDATA(2,5)="ROOM-BED"_U_1
     157 S INPLIST("A",3)=" 3 - ADMISSION DATE/TIME",INPDATA(3,7)="ADMISSION DATE/TIME"_U_2
     158 S INPLIST("A",4)=" 4 - ATTENDING PHYSICIAN",INPDATA(4,11)="ATTENDING"_U_2
    159159 S INPLIST("A")="Enter your selection(s)"
    160160 S INPLIST("?")="^D HELP^PXRMPDRS"
     
    162162 S LIST=$$SEL^PXRMPDRS(.INPLIST,5)
    163163 I $D(DTOUT)!$D(DUOUT) Q
    164  S DATA(SUB)=LIST
    165  S DATA(SUB,"LEN")=$L(LIST,",")-1
     164 S INPDATA=LIST
     165 S INPDATA("LEN")=$L(LIST,",")-1
    166166 Q
    167167 ;
    168 REMSEL(PLIEN,DATA,SUB) ;If the list was generated from a reminder report
     168REMSEL(PLIEN,REMDATA) ;If the list was generated from a reminder report
    169169 ;let the user select the reminder data they want.
    170  I '$P(^PXRMXP(810.5,PLIEN,0),U,9) S DATA(SUB,"LEN")=0 Q
     170 I '$P(^PXRMXP(810.5,PLIEN,0),U,9) S REMDATA("LEN")=0 Q
    171171 N IEN,IND,REMLIST,RNAME
    172172 S (IEN,IND)=0
     
    175175 . I RNAME="" S RNAME=$P(^PXD(811.9,IEN,0),U,1)
    176176 . S IND=IND+1
    177  . S DATA(SUB,"RNAME",IND)=RNAME
    178  . S DATA(SUB,"IEN",IND)=IEN
     177 . S REMDATA("RNAME",IND)=RNAME
     178 . S REMDATA("IEN",IND)=IEN
    179179 . S REMLIST("A",IND)=" "_IND_" - "_RNAME
    180180 S REMLIST("A")="Enter your selection(s)"
     
    183183 S LIST=$$SEL^PXRMPDRS(.REMLIST,IND)
    184184 I $D(DTOUT)!$D(DUOUT) Q
    185  S DATA(SUB)=LIST
    186  S DATA(SUB,"LEN")=$L(LIST,",")-1
     185 S REMDATA=LIST
     186 S REMDATA("LEN")=$L(LIST,",")-1
    187187 Q
    188188 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPLST.m

    r628 r636  
    1 PXRMPLST ; SLC/PKR - Build a patient list from a reminder definition. ;01/24/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMPLST ; SLC/PKR - Build a patient list from a reminder definition. ;06/09/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;Input  :  RIEN     - Reminder IEN
     
    77 ;          PXRMDATE - Evaluation date
    88 ;===================================================
    9 BLDPLST(DEFARR,PLIST,DFNONLY) ;
    10  N DFN,DOBE,DOBS,ELE,ERROR,ERRSTR,IND,FNUM
     9BLDPLST(RIEN,PLIST,DFNONLY,PXRMDATE) ;
     10 N DEFARR,DFN,DOBE,DOBS,ELE,ERROR,ERRSTR,IND,FNUM
    1111 N LIST1,LIST2,LNAME,LSP,LSTACK
    1212 N NDR,NOT,OPER,PCLOG,PFSTACK,SEX,TYPE
    1313 ;
     14 D DEF^PXRMLDR(RIEN,.DEFARR)
    1415 ;Get the cohort logic string. This has passed a validation before
    1516 ;it can be selected for building patient lists so we don't need to
     
    229230 N DFN,DS,IND,SEXOK
    230231 F IND=1:1:NDR D
    231  . S DS=DOBS(IND)-.000001
     232 . S DS=DOBS(IND)-.1
    232233 . F  S DS=$O(^DPT("ADOB",DS)) Q:(DS>DOBE(IND))!(DS="")  D
    233234 .. S DFN=""
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPTD2.m

    r628 r636  
    1 PXRMPTD2 ; SLC/PKR/PJH - Reminder Inquiry print template routines.;03/06/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMPTD2 ; SLC/PKR/PJH - Reminder Inquiry print template routines.;10/07/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;================================================
    44DATE(FIND0,PIECE,FLDNUM,TITLE,RJC,PAD,FILENUM,FLG) ;Standard DATE
     
    66 S DATE=$P($G(FIND0),U,PIECE)
    77 I DATE'="" D
    8  .S DATE=$$FMTE^XLFDT(DATE,"5Z"),X=$$RJ^XLFSTR(TITLE,RJC,PAD),X=X_" "_DATE
     8 .S DATE=$$FMTE^XLFDT(DATE,"D"),X=$$RJ^XLFSTR(TITLE,RJC,PAD),X=X_" "_DATE
    99 .D ^DIWP
    1010 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPTDF.m

    r628 r636  
    1 PXRMPTDF ; SLC/PKR/PJH - Reminder Inquiry print template routines. ;06/07/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMPTDF ; SLC/PKR/PJH - Reminder Inquiry print template routines. ;01/30/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;================================================
     
    8181 .D SFDISP(FIND0,1,14,"Condition:",RJC,PAD,FILENUM)
    8282 .D SFDISP(FIND0,2,15,"Condition Case Sensitive:",RJC,PAD,FILENUM)
    83  .D SFDISP(FIND0,3,18,"Use Status/Cond in Search:",RJC,PAD,FILENUM)
     83 .D SFDISP(FIND0,3,18,"Use Cond in Finding Search:",RJC,PAD,FILENUM)
    8484 .I $G(^PXD(811.9,D0,20,FINDING,15))'="" D
    8585 ..S X=$$RJ^XLFSTR("Computed Finding Parameter:",RJC,PAD)
     
    173173 .D SFDISP(TERM3,1,14,"Condition:",RJT,PAD,TERMNUM,1)
    174174 .D SFDISP(TERM3,2,15,"Condition Case Sensitive:",RJT,PAD,TERMNUM)
    175  .D SFDISP(TERM3,3,18,"Use Status/Cond in Search:",RJT,PAD,TERMNUM)
     175 .D SFDISP(TERM3,3,18,"Use Cond in Finding Search:",RJT,PAD,TERMNUM)
    176176 .I $G(^PXRMD(811.5,IEN1,20,TERMS,15))'="" D
    177177 ..S X=$$RJ^XLFSTR("Computed Finding Parameter:",RJT,PAD)
     
    215215 .S X=$$RJ^XLFSTR(TITLE,RJC,PAD)
    216216 .S X=X_" "_$$EXTERNAL^DILFD(FILENUM,FLDNUM,"",FIELD,"")
    217  .I FLDNUM=13 S X=X_" - "_$$SPECIAL(FIND0,FIELD)
    218  .D ^DIWP
    219  Q
    220  ;
    221  ;================================================
    222 SPECIAL(FIND0,FIELD) ;Special output for certain fields.
    223  N FINDING,GLOBAL,IEN
    224  S FINDING=$P(FIND0,U,1)
    225  S IEN=$P(FINDING,";",1)
    226  S GLOBAL=$P(FINDING,";",2)
    227  I GLOBAL="YTT(601.71," Q $$SCNAME^PXRMMH(IEN,FIELD)
    228  Q ""
     217 .D ^DIWP
     218 Q
    229219 ;
    230220 ;================================================
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPTTR.m

    r628 r636  
    1 PXRMPTTR ;SLC/PKR - Routines for term print templates ;06/01/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMPTTR ;SLC/PKR - Routines for term print templates ;01/30/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;====================================================
     
    8888 . D SFDISP(FIND0,1,14,"Condition:",RJC,PAD)
    8989 . D SFDISP(FIND0,2,15,"Condition Case Sensitive:",RJC,PAD)
    90  . D SFDISP(FIND0,3,18,"Use Status/Cond in Search:",RJC,PAD)
     90 . D SFDISP(FIND0,3,18,"Use Cond in Finding Search:",RJC,PAD)
    9191 . I $G(^PXRMD(811.5,D0,20,FINDING,15))'="" D
    9292 .. S CFP=$$RJ^XLFSTR("Computed Finding Parameter:",RJC,PAD)
     
    103103 . S TEXT=$$RJ^XLFSTR(TITLE,RJC,PAD)
    104104 . S TEXT=TEXT_"  "_$$EXTERNAL^DILFD(811.52,FLDNUM,"",FIELD,"")
    105  . I FLDNUM=13 S TEXT=TEXT_" - "_$$SPECIAL^PXRMPTDF(FIND0,FIELD)
    106105 . W !,TEXT
    107106 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMREDF.m

    r628 r636  
    1 PXRMREDF ; SLC/PJH - Edit PXRM reminder findings. ;01/09/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMREDF ; SLC/PJH - Edit PXRM reminder findings. ;02/09/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ; Called by PXRMREDT which newes and initialized DEF, DEF1, DEF2.
     
    3737 D ^DIC I Y=-1 S DTOUT=1 Q
    3838 S DIE=DIC K DIC
    39  S DIE("NO^")="OUTOK"
    4039 S DA=+Y,GLOB=$P($P(Y,U,2),";",2) Q:GLOB=""
    4140 S TYPE=$G(DEF1(GLOB))
     
    4342 ;Save term IEN
    4443 S STATUS=0
     44 I TYPE="RT" S TIEN=$P($P(Y,U,2),";",1)
    4545 I TYPE="CF" S CFIEN=$P($P(Y,U,2),";",1) D
    4646 .I $D(^PXRMD(811.4,CFIEN,1))>0 D
     
    4949 ...W !,$G(^PXRMD(811.4,CFIEN,1,WPIEN,0))
    5050 .E  W !!,"No description defined for this computed finding"
    51  I TYPE="MH" D WARN^PXRMMH
    52  I TYPE="RT" S TIEN=$P($P(Y,U,2),";",1)
    5351 ;Finding record fields
    5452 W !!,"Editing Finding Number: "_$G(DA)
     
    9997 ;Check if deleted
    10098 I '$D(DA) Q
    101  I STATUS=1,$D(Y)=0 D STATUS^PXRMSTA1(.DA,"D")
     99 I STATUS=1 D STATUS^PXRMSTA1(.DA,"D")
    102100 ;
    103101 S ETYPE=$P(^PXD(811.9,IEN,20,SDA(1),0),U,1)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMREDT.m

    r628 r636  
    1 PXRMREDT ; SLC/PKR,PJH - Edit PXRM reminder definition. ;10/04/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMREDT ; SLC/PKR,PJH - Edit PXRM reminder definition. ;02/09/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;=======================================================
     
    1717 D SETSTART^PXRMCOPY(DIC)
    1818 W !
    19  S DIC("W")="W $$LUDISP^PXRMREDT(Y)"
    2019 D ^DIC
    2120 I ($D(DTOUT))!($D(DUOUT)) Q
     
    288287 ;
    289288 ;-------------------------------------
    290 LUDISP(IEN) ;Use for DIC("W") to augment look-up display.
    291  N CLASS,EM,INACTIVE,TEXT
    292  S INACTIVE=$P(^PXD(811.9,IEN,0),U,6)
    293  S CLASS=$P(^PXD(811.9,IEN,100),U,1)
    294  I INACTIVE'="" S INACTIVE="("_$$EXTERNAL^DILFD(811.9,1.6,"",INACTIVE,.EM)_")"
    295  S CLASS=$$EXTERNAL^DILFD(811.9,100,"",CLASS,.EM)
    296  S TEXT="  "_CLASS_" "_INACTIVE
    297  Q TEXT
    298  ;
    299  ;-------------------------------------
    300289TFIND(DA,LIST) ;Allow edit of term findings for national reminders.
    301  N DIR,IENLIST,IND,JND,NAME,NAMELIST,SUB,X,Y
     290 N DIR,IENLIST,IND,NAME,NAMELIST,SUB,X,Y
    302291 S IND=0,NAME=""
    303292 F  S NAME=$O(LIST("RT",NAME)) Q:NAME=""  D
     
    313302 I $D(DIROUT)!$D(DIRUT) S LIST="" Q
    314303 I $D(DUOUT)!$D(DTOUT) S LIST="" Q
     304 S LIST=Y
    315305 F IND=1:1:$L(Y,",")-1 D
    316  . S JND=$P(Y,",",IND)
    317  . S NAME=$P(NAMELIST(JND),JND,2)
     306 . S NAME=$P(NAMELIST(IND),IND,2)
    318307 . W !!,"Reminder Term:",NAME
    319  . D TMAP^PXRMREDF(DA,IENLIST(JND))
    320  Q
    321  ;
     308 . D TMAP^PXRMREDF(DA,IENLIST(IND))
     309 Q
     310 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMRPCC.m

    r628 r636  
    1 PXRMRPCC ;SLC/PJH - PXRM REMINDER DIALOG ;11/26/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMRPCC ;SLC/PJH - PXRM REMINDER DIALOG ;04/12/2002
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44ACTIVE(ORY,ORREM) ;Check if active dialog exist for reminders
     
    3939 ;
    4040 ;Load dialog lines into local array
    41  S ORY(0)=0_U_+$P($G(^PXRMD(801.41,DIEN,0)),U,17)
    4241 D LOAD^PXRMDLL(DIEN,$G(DFN))
    4342 Q
     
    7776 ; Input mental health instrument NAME
    7877 ;
    79  K ^TMP($J,"YSQU")
    80  N ARRAY,CNT,CNT1,FNODE,FSUB,IC,NODE,OCNT,SUB,YS
    81  ;DBIA #5056
    82  S YS("CODE")=OTEST D SHOWALL^YTQPXRM5(.ARRAY,.YS)
    83  S OCNT=0,CNT=0
     78 N YS,ARRAY S YS("CODE")=OTEST D SHOWALL^YTAPI3(.ARRAY,.YS) ; DBIA #2895
     79 ;
     80 N FNODE,FSUB,IC,NODE,OCNT,SUB
    8481 S SUB="ARRAY",OCNT=0
    8582 F  S SUB=$Q(@SUB) Q:SUB=""  D
     
    9693 ; Input MH result IEN and mental health instrument response
    9794 ;
    98  D START^PXRMDLR(.ORY,RESULT,.ORES)
     95 D ^PXRMDLR
    9996 ;
    10097 Q
     
    103100 ;
    104101 ; Input mental health instrument response
    105  N ANS,ARRAY,X
    106  S ANS=$G(YS("R1")) K YS("R1")
    107  S YS("ADATE")=YS("ADATE")_"."_$P($$NOW^XLFDT,".",2)
    108  F X=1:1:$L(ANS) I $E(ANS,X)'="X" S YS(X)=X_U_$E(ANS,X)
    109  ;DBIA #4463
    110  D SAVECR^YTQPXRM4(.ARRAY,.YS)
     102 N ARRAY
     103 D SAVEIT^YTAPI1(.ARRAY,.YS) ; DBIA #2893
     104 I ARRAY(1)'="[DATA]" S ORY(1)="-1^"_ARRAY(1)_ARRAY(2)
     105 I ARRAY(1)="[DATA]" S ORY(1)=ARRAY(1)_ARRAY(2)
    111106 Q
    112107 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMRUL1.m

    r628 r636  
    1 PXRMRUL1 ; SLC/AGP,PKR - Patient list routines. ; 03/29/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMRUL1 ; SLC/AGP,PKR - Patient list routines. ; 08/11/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    4  ;
    5 ASK(PLIEN,OPT) ;Verify patient list name
    6  N X,Y,TEXT
    7  K DIROUT,DIRUT,DTOUT,DUOUT
    8  S DIR(0)="YA0"
    9  S DIR("A")=OPT_" patient list "_$P($G(^PXRMXP(810.5,PLIEN,0)),U)_"?: "
    10  S DIR("B")="N"
    11  S DIR("?")="Enter Y or N. For detailed help type ??"
    12  W !
    13  D ^DIR K DIR
    14  I $D(DIROUT) S DTOUT=1
    15  I $D(DTOUT)!($D(DUOUT)) Q
    16  I $E(Y(0))="N" S DUOUT=1 Q
    17  Q
    18  ;
    19 COPY(IENO) ;Copy patient list
    20  ;Check if OK to copy
    21  D ASK(IENO,"Copy") Q:$D(DUOUT)!$D(DTOUT)
    22  N FDA,IENN,IND,MSG,NNAME,ODATA,OEPIEN,ONAME,ORULE,PATCREAT,TEXT,X,Y
    23  ;Select list to copy to
    24  S TEXT="Select PATIENT LIST name to copy to: "
    25  D PLIST^PXRMLCR(.IENN,TEXT,IENO) Q:$D(DUOUT)!$D(DTOUT)  Q:'IENN
    26  S NNAME=$P($G(^PXRMXP(810.5,IENN,0)),U)
    27  ;
    28  ;Get original Patient List record
    29  S ODATA=$G(^PXRMXP(810.5,IENO,0))
    30  S ONAME=$P(ODATA,U),OEPIEN=$P(ODATA,U,5),ORULE=$P(ODATA,U,6)
    31  ;
    32  M ^PXRMXP(810.5,IENN)=^PXRMXP(810.5,IENO)
    33  D ASK^PXRMXD(.PATCREAT,"Secure list?: ",2)
    34  ;Update header info
    35  S TYPE=$S($G(PATCREAT)="Y":"PVT",1:"PUB")
    36  S IND=IENN_","
    37  S FDA(810.5,IND,.01)=NNAME
    38  S FDA(810.5,IND,.04)=$$NOW^XLFDT
    39  S FDA(810.5,IND,.05)=OEPIEN
    40  S FDA(810.5,IND,.06)=ORULE
    41  S FDA(810.5,IND,.07)=$G(DUZ)
    42  S FDA(810.5,IND,.08)=TYPE
    43  D UPDATE^DIE("","FDA","","MSG")
    44  ;Error
    45  I $D(MSG) D ERR
    46  ;
    47  W !!,"Completed copy of '"_ONAME_"'"
    48  W !,"into '"_NNAME_"'",! H 2
    49  K ^TMP($J,"PXRMRULE")
    50  Q
    51  ;
    52 CRLST(NAME,CLASS) ;Create new patient list
    53  N IEN
    54  ;Check if name exists
    55  S IEN=$O(^PXRMXP(810.5,"B",NAME,"")) I IEN Q IEN
    56  ;Otherwise create national entry
    57  N FDA,FDAIEN,MSG
    58  S FDA(810.5,"+1,",.01)=NAME
    59  S FDA(810.5,"+1,",100)=CLASS
    60  S FDA(810.5,"+1,",.07)=$G(DUZ)
    61  ;Make stub public
    62  S FDA(810.5,"+1,",.08)="PUB"
    63  D UPDATE^DIE("","FDA","FDAIEN","MSG")
    64  ;Error
    65  I $D(MSG) Q 0
    66  ;Otherwise list ien
    67  Q FDAIEN(1)
    68  ;
    69 COUNT(NODE) ;Count the number of entries.
    70  N DFN,NUM
    71  S (DFN,NUM)=0
    72  F  S DFN=$O(^TMP($J,NODE,DFN)) Q:DFN=""  S NUM=NUM+1
    73  Q NUM
    74  ;
    75 DELETE(LIST) ;Delete Patient list
    76  I '$$VEDIT^PXRMUTIL("^PXRMXP(810.5,",LIST) D  Q
    77  .W !!,?5,"VA- and national class patient lists may not be deleted" H 2
    78  .S DUOUT=1
    79  ;Check if this is the right list
    80  D ASK(LIST,"Delete") Q:$D(DUOUT)!$D(DTOUT)
    81  ;
    82  N DA,DIK,DUOUT
    83  ;Lock patient list
    84  D LOCK Q:$D(DUOUT)
    85  ;Kill List
    86  S DA=LIST,DIK="^PXRMXP(810.5,"
    87  D ^DIK
    88  ;Unlock patient list
    89  D UNLOCK
    90  Q
    91  ;
    924DATECHK(DATE) ;
    935 I DATE=0 Q 1
    946 S DATE=$$STRREP^PXRMUTIL(DATE,"BDT","T")
    957 Q $$VDT^PXRMINTR(DATE)
    96  ;
    97 DATES(LBBDT,LBEDT,RBDT,REDT,FARR) ;Set the dates in the finding array to
    98  ;FileMan dates.
    99  N FI,PXRMDATE,TBDT,TEDT
    100  S FI=0
    101  F  S FI=+$O(FARR(20,FI)) Q:FI=0  D
    102  . S TBDT=$P(FARR(20,FI,0),U,8),TEDT=$P(FARR(20,FI,0),U,11)
    103  . I TBDT="",TEDT="" D
    104  .. S $P(FARR(20,FI,0),U,8)=RBDT,$P(FARR(20,FI,0),U,11)=REDT
    105  . E  D
    106  .. S PXRMDATE=$S(TBDT["BDT":LBBDT,1:LBEDT)
    107  .. S TBDT=$S(TBDT="":0,TBDT=0:0,TBDT="BDT":LBBDT,1:$$CTFMD^PXRMDATE(TBDT))
    108  .. S PXRMDATE=$S(TEDT["BDT":LBBDT,1:LBEDT)
    109  .. S TEDT=$S(TEDT="":"T",TEDT=0:"T",TEDT="BDT":LBBDT,1:TEDT)
    110  .. S TEDT=$$CTFMD^PXRMDATE(TEDT)
    111  .. S $P(FARR(20,FI,0),U,8)=TBDT,$P(FARR(20,FI,0),U,11)=TEDT
    112  Q
    113  ;
    114 ERR ;Error Handler
    115  N ERROR,IC,REF
    116  S ERROR(1)="Unable to build patient list : "
    117  S ERROR(2)=NAME
    118  S ERROR(3)="Error in UPDATE^DIE, needs further investigation"
    119  ; Move MSG into Error
    120  S REF="MSG"
    121  F IC=4:1 S REF=$Q(@REF) Q:REF=""  S ERROR(IC)=REF_"="_@REF
    122  ;Screen message
    123  D EN^DDIOL(.ERROR)
    124  Q
    1258 ;
    1269INSERT(FROUT,DFN,TNAME,TFIEV,RSTOP) ;Save patient data.
     
    15336 Q INST
    15437 ;
    155 LOCK L +^PXRMXP(810.5,LIST):0
    156  E  W !!?5,"Another user is using this patient list" S DUOUT=1
    157  Q
    158  ;
    15938LOGOP(LIST1,LIST2,LOGOP) ;Given LIST1 and LIST2 apply the logical
    16039 ;operator LOGOP to generate a new list and return it in LIST1
     
    17857 Q
    17958 ;
    180 REM(FRACT,RIEN,LBBDT,LBEDT,RSTART,RSTOP,PNODE) ;Process reminder finding rule
    181  N DEFFARR,PXRMDATE
    182  D DEF^PXRMLDR(RIEN,.DEFARR)
    183  D DATES(LBBDT,LBEDT,RSTART,RSTOP,.DEFARR)
    184  S PXRMDATE=RSTOP
    185  D BLDPLST^PXRMPLST(.DEFARR,PNODE,1)
     59REM(FRACT,RIEN,RSTART,RSTOP,PNODE) ;Process reminder finding rule
     60 D BLDPLST^PXRMPLST(RIEN,PNODE,1,RSTOP)
    18661 ;Remove, Select or Add Findings operations
    18762 I FRACT="A" D LOGOP(FROUT,PNODE,"!") Q
     
    19065 Q
    19166 ;
    192 TERM(FRACT,FRTIEN,LBBDT,LBEDT,RSTART,RSTOP,PNODE,INST) ;Process TERM finding
    193  ;rules
    194  N FINDPA,FINDING,FNAME,PLIST,PXRMDATE,PXRMDEBG
    195  N TERMARR,TFIEV,TNAME
     67TERM(FRACT,FRTIEN,RSTART,RSTOP,PNODE,INST) ;Process TERM finding rule
     68 N FINDPA,FINDING,FNAME,PLIST,PXRMDATE,PXRMDEBG,TERMARR,TFIEV,TNAME
    19669 ;Get term definition array
    19770 D TERM^PXRMLDR(FRTIEN,.TERMARR)
    19871 S TNAME=$P(TERMARR(0),U,1)
    19972 S INST=$S(FRACT'="F":0,TNAME="VA-PCMM INSTITUTION":1,TNAME="VA-IHD STATION CODE":1,1:0)
    200  ;Set begin and end dates in the term.
    201  D DATES(LBBDT,LBEDT,RSTART,RSTOP,.TERMARR)
     73 ;Set start and end dates
    20274 S $P(FINDPA(0),U,8)=RSTART,$P(FINDPA(0),U,11)=RSTOP,PXRMDATE=RSTOP
    20375 ;
     
    20577 I FRACT="A" D  Q
    20678 .;Process term for date range
    207  .D EVALPL^PXRMTERL(.FINDPA,.TERMARR,PNODE)
     79 .D EVALPL^PXRMTERM(.FINDPA,.TERMARR,PNODE)
    20880 .;Merge lists if operation is add
    20981 .M ^TMP($J,FROUT)=^TMP($J,PNODE,1)
     
    22698 Q
    22799 ;
    228 UNLOCK L -^PXRMXP(810.5,LIST) Q
    229  ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMRULE.m

    r628 r636  
    1 PXRMRULE ; SLC/PJH - Build Patient list from Rule Set ;03/27/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMRULE ; SLC/PJH - Build Patient list from Rule Set ;08/11/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ; Called from PXRM PATIENT LIST CREATE protocol
     5 ;
     6ASK(PLIEN,OPT) ;Verify patient list name
     7 N X,Y,TEXT
     8 K DIROUT,DIRUT,DTOUT,DUOUT
     9 S DIR(0)="YA0"
     10 S DIR("A")=OPT_" patient list "_$P($G(^PXRMXP(810.5,PLIEN,0)),U)_"?: "
     11 S DIR("B")="N"
     12 S DIR("?")="Enter Y or N. For detailed help type ??"
     13 W !
     14 D ^DIR K DIR
     15 I $D(DIROUT) S DTOUT=1
     16 I $D(DTOUT)!($D(DUOUT)) Q
     17 I $E(Y(0))="N" S DUOUT=1 Q
     18 Q
    519 ;
    620CLEAR(RULE,NODE) ;Clear workfile entries
     
    1327 Q
    1428 ;
     29COPY(IENO) ;Copy patient list
     30 ;Check if OK to copy
     31 D ASK(IENO,"Copy") Q:$D(DUOUT)!$D(DTOUT)
     32 N FDA,IENN,IND,MSG,NNAME,ODATA,OEPIEN,ONAME,ORULE,PATCREAT,TEXT,X,Y
     33 ;Select list to copy to
     34 S TEXT="Select PATIENT LIST name to copy to: "
     35 D PLIST^PXRMLCR(.IENN,TEXT,IENO) Q:$D(DUOUT)!$D(DTOUT)  Q:'IENN
     36 S NNAME=$P($G(^PXRMXP(810.5,IENN,0)),U)
     37 ;
     38 ;Get original Patient List record
     39 S ODATA=$G(^PXRMXP(810.5,IENO,0))
     40 S ONAME=$P(ODATA,U),OEPIEN=$P(ODATA,U,5),ORULE=$P(ODATA,U,6)
     41 ;
     42 M ^PXRMXP(810.5,IENN)=^PXRMXP(810.5,IENO)
     43 D ASK^PXRMXD(.PATCREAT,"Secure list?: ",2)
     44 ;Update header info
     45 S TYPE=$S($G(PATCREAT)="Y":"PVT",1:"PUB")
     46 S IND=IENN_","
     47 S FDA(810.5,IND,.01)=NNAME
     48 S FDA(810.5,IND,.04)=$$NOW^XLFDT
     49 S FDA(810.5,IND,.05)=OEPIEN
     50 S FDA(810.5,IND,.06)=ORULE
     51 S FDA(810.5,IND,.07)=$G(DUZ)
     52 S FDA(810.5,IND,.08)=TYPE
     53 D UPDATE^DIE("","FDA","","MSG")
     54 ;Error
     55 I $D(MSG) D ERR
     56 ;
     57 W !!,"Completed copy of '"_ONAME_"'"
     58 W !,"into '"_NNAME_"'",! H 2
     59 K ^TMP($J,"PXRMRULE")
     60 Q
     61 ;
     62CRLST(NAME,CLASS) ;Create new patient list
     63 N IEN
     64 ;Check if name exists
     65 S IEN=$O(^PXRMXP(810.5,"B",NAME,"")) I IEN Q IEN
     66 ;Otherwise create national entry
     67 N FDA,FDAIEN,MSG
     68 S FDA(810.5,"+1,",.01)=NAME
     69 S FDA(810.5,"+1,",100)=CLASS
     70 D UPDATE^DIE("","FDA","FDAIEN","MSG")
     71 ;Error
     72 I $D(MSG) Q 0
     73 ;Otherwise list ien
     74 Q FDAIEN(1)
     75 ;
     76DELETE(LIST) ;Delete Patient list
     77 I '$$VEDIT^PXRMUTIL("^PXRMXP(810.5,",LIST) D  Q
     78 .W !!,?5,"VA- and national class patient lists may not be deleted" H 2
     79 .S DUOUT=1
     80 ;Check if this is the right list
     81 D ASK(LIST,"Delete") Q:$D(DUOUT)!$D(DTOUT)
     82 ;
     83 N DA,DIK,DUOUT
     84 ;Lock patient list
     85 D LOCK Q:$D(DUOUT)
     86 ;Kill List
     87 S DA=LIST,DIK="^PXRMXP(810.5,"
     88 D ^DIK
     89 ;Unlock patient list
     90 D UNLOCK
     91 Q
     92 ;
     93ERR ;Error Handler
     94 N ERROR,IC,REF
     95 S ERROR(1)="Unable to build patient list : "
     96 S ERROR(2)=NAME
     97 S ERROR(3)="Error in UPDATE^DIE, needs further investigation"
     98 ; Move MSG into Error
     99 S REF="MSG"
     100 F IC=4:1 S REF=$Q(@REF) Q:REF=""  S ERROR(IC)=REF_"="_@REF
     101 ;Screen message
     102 D EN^DDIOL(.ERROR)
     103 Q
     104 ;
    15105INTR ;Input transform for #810.4 fields
    16106 Q
     
    25115 Q
    26116 ;
    27 PATS(FRACT,FROUT,PNODE,LIST) ;Process Patient List finding rule
     117LOCK L +^PXRMXP(810.5,LIST):0
     118 E  W !!?5,"Another user is using this patient list" S DUOUT=1
     119 Q
     120 ;
     121PATS(LIST) ;Process Patient List finding rule
    28122 ;
    29123 N LIEN,LUVALUE
     
    38132 I FRACT="A" D LOAD(FROUT,LIEN) Q
    39133 ;
    40  ;Remove or Select operations
    41  ;Load List
    42  D LOAD(PNODE,LIEN)
    43  ;Check each patient
    44  S DFN=0
    45  F  S DFN=$O(^TMP($J,FROUT,DFN)) Q:'DFN  D
    46  .;Delete any ^TMP patient in PLIST if action is remove
    47  .I FRACT="R",$D(^TMP($J,PNODE,DFN)) K ^TMP($J,FROUT,DFN) Q
    48  .;Delete any ^TMP patient not in PLIST if action is select
    49  .I FRACT="S",'$D(^TMP($J,PNODE,DFN)) K ^TMP($J,FROUT,DFN)
    50  Q
    51  ;
    52 START(RULESET,LIST,NODE,LBBDT,LBEDT,PAR,YEAR,PERIOD,INDP,INTP,EXTITR) ;
     134 ;Remove, Select or Add Findings operations
     135 I FRACT'="A" D  Q
     136 .;Load List
     137 .D LOAD(PNODE,LIEN)
     138 .;Check each patient
     139 .S DFN=0
     140 .F  S DFN=$O(^TMP($J,FROUT,DFN)) Q:'DFN  D
     141 ..;Delete any ^TMP patient in PLIST if action is remove
     142 ..I FRACT="R",$D(^TMP($J,PNODE,DFN)) K ^TMP($J,FROUT,DFN) Q
     143 ..;Delete any ^TMP patient not in PLIST if action is select
     144 ..I FRACT="S",'$D(^TMP($J,PNODE,DFN)) K ^TMP($J,FROUT,DFN)
     145 Q
     146 ;
     147START(RULESET,LIST,NODE,LBBDT,LBEDT,PAR,YEAR,PERIOD,INDP,INTP) ;
    53148 ;Process rule set
    54149 ;Clear ^TMP
     
    56151 ;
    57152 N CLASS,FRACT,FRDATA,FRDATES,FRIEN,FRLST,FRLIEN,FROLST,FROUT,FRPAT
    58  N FRPERM,FRSTRT,FRTIEN,FRTYP,FSEQ,INC,INST,PXRMDATE,PXRMDDOC
     153 N FRPERM,FRSTRT,FRTIEN,FRTYP,FSEQ,INC,INST,PXRMDATE
    59154 N RBDT,REDT,RRIEN,RSDATA,RSDATES,SEQ,SUB
    60155 ;Get class from extract parameter
     
    62157 ;Otherwise default to local
    63158 I $G(CLASS)="" S CLASS="L"
    64  ;PXRMDDOC=1 save list rule evaluation dates in ^TMP("PXRMDDOC",$J)
    65  S PXRMDDOC=1
    66  K ^TMP("PXRMDDOC",$J)
    67159 ;Get each finding rule in sequence
    68  S SEQ="",INC=0,INST=0
     160 S SEQ="",INC=0
    69161 F  S SEQ=$O(^PXRM(810.4,RULESET,30,"B",SEQ)) Q:'SEQ  D
    70162 .;Save first sequence as default
     
    84176 .;Get Extract Patient List name for patient list rule
    85177 .I FRTYP=5 S FRLST=$P($G(^PXRM(810.4,FRIEN,1)),U) D  Q:FRLST=""
    86  ..I +EXTITR>0 S FRLST=FRLST_"/"_EXTITR
    87178 ..S FROLST=$P(FRDATA,U,8)
    88179 ..I +FROLST>0 S FRLST=$P($G(^PXRMXP(810.5,FROLST,0)),U)
     
    106197 .K ^TMP($J,PNODE)
    107198 .;Term finding rules
    108  .I FRTYP=1 D TERM^PXRMRUL1(FRACT,FRTIEN,LBBDT,LBEDT,RBDT,REDT,PNODE,.INST)
     199 .I FRTYP=1 D TERM^PXRMRUL1(FRACT,FRTIEN,RBDT,REDT,PNODE,.INST)
    109200 .;Reminder Definition List Rule
    110  .I FRTYP=2 D REM^PXRMRUL1(FRACT,RRIEN,LBBDT,LBEDT,RBDT,REDT,PNODE)
     201 .I FRTYP=2 D REM^PXRMRUL1(FRACT,RRIEN,RBDT,REDT,PNODE)
    111202 .;Patient list finding rules
    112  .I FRTYP=5 D PATS(FRACT,FROUT,PNODE,FRLST)
     203 .I FRTYP=5 D PATS(FRLST)
    113204 .;Clear results file
    114205 .K ^TMP($J,PNODE)
     
    118209 ..N FRPIEN
    119210 ..;Get patient list IEN or create new patient list
    120  ..S FRPIEN=$$CRLST^PXRMRUL1(FRPERM,CLASS) Q:'FRPIEN
     211 ..S FRPIEN=$$CRLST(FRPERM,CLASS) Q:'FRPIEN
    121212 ..;Update patient list
    122  ..D UPDLST(FROUT,FRPIEN,PAR,RULESET,INST,INDP,INTP)
     213 ..D UPDLST(FROUT,FRPIEN,PAR,RULESET,INST)
    123214 ;
    124215 ;Save final results to patient list
    125216 I LIST'="",FROUT'="" D
    126217 . D RMPAT^PXRMEUT(FROUT,INDP,INTP)
    127  . D UPDLST(FROUT,LIST,PAR,RULESET,INST,INDP,INTP)
    128  .;PXRMDDOC=2 compare saved dates with those generated in
    129  .;DOCUMENT^PXRMEUT.
    130  . S PXRMDDOC=2
     218 . D UPDLST(FROUT,LIST,PAR,RULESET,INST)
    131219 . D DOCUMENT^PXRMEUT(LIST,RULESET,INDP,INTP,LBBDT,LBEDT)
    132  K ^TMP("PXRMDDOC",$J)
    133  Q
    134  ;
    135 UPDLST(NODE,LIST,EPIEN,RULE,INST,INDP,INTP) ;Update patient list
    136  N CNT,DA,DATA,DCNT,DECEASED,DFN,DNAME,DNAMEL,DOD,DUE,DUOUT,FDA
    137  N INSTNAM,INSTNUM,LAST,MSG,NAME,ONODE
    138  N RCNT,RIEN,RNAMEL,RNCNT,SUB,TEMP,TEST,TYPE,VALUE
     220 Q
     221 ;
     222UPDLST(NODE,LIST,EPIEN,RULE,INST) ;Update patient list
     223 N CNT,DA,DATA,DCNT,DFN,DNAME,DNAMEL,DUE,DUOUT,FDA,INST,INSTNAM,INSTNUM
     224 N LAST,MSG,NAME,ONODE,RCNT,RIEN,RNAMEL,RNCNT,SUB,TEMP,TYPE,VALUE
    139225 ;Lock patient list
    140  D LOCK^PXRMRUL1 Q:$D(DUOUT)
    141  S TEMP=^PXRMXP(810.5,LIST,0)
    142  S NAME=$P(TEMP,U,1)
    143  S $P(^PXRMXP(810.5,LIST,0),U,11)=INDP
    144  S $P(^PXRMXP(810.5,LIST,0),U,12)=INTP
     226 D LOCK Q:$D(DUOUT)
    145227 ;
    146228 ;Clear existing list.
    147229 K ^PXRMXP(810.5,LIST,30),^PXRMXP(810.5,LIST,35),^PXRMXP(810.5,LIST,45),^PXRMXP(810.5,LIST,200)
     230 S NAME=$P($G(^PXRMXP(810.5,LIST,0)),U)
    148231 ;
    149232 ;Merge ^TMP into Patient List
    150  S (DECEASED,TESTP)=""
    151  S (CNT,DFN)=0
     233 S (CNT,DFN,INST)=0
    152234 F  S DFN=$O(^TMP($J,NODE,DFN)) Q:'DFN  D
    153235 .S ONODE=$G(^TMP($J,NODE,DFN,"INST"))
    154236 .S INSTNUM=$P(ONODE,U,1),INSTNAM=$P(ONODE,U,2)
    155  .S TEMP=DFN_U_INSTNUM_U_INSTNAM
    156  .I INDP D
    157  ..;DBIA #10035
    158  ..S DOD=+$P($G(^DPT(DFN,.35)),U,1)
    159  ..S DECEASED=$S(DOD=0:0,1:1)
    160  .;DBIA #3744
    161  .I INTP S TESTP=$$TESTPAT^VADPT(DFN)
    162  .S CNT=CNT+1,^PXRMXP(810.5,LIST,30,CNT,0)=DFN_U_INSTNUM_U_INSTNAM_U_DECEASED_U_TESTP
     237 .S CNT=CNT+1,^PXRMXP(810.5,LIST,30,CNT,0)=DFN_U_INSTNUM_U_INSTNAM
    163238 .S ^PXRMXP(810.5,LIST,30,"B",DFN,CNT)=""
    164239 .;
     
    215290 D UPDATE^DIE("","FDA","","MSG")
    216291 ;Error
    217  I $D(MSG) D ERR^PXRMRUL1
     292 I $D(MSG) D ERR
    218293 ;Unlock patient list
    219  D UNLOCK^PXRMRUL1
    220  Q
    221  ;
     294 D UNLOCK
     295 Q
     296 ;
     297UNLOCK L -^PXRMXP(810.5,LIST) Q
     298 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMSTA1.m

    r628 r636  
    1 PXRMSTA1 ; SLC/AGP - Routines for building status list. ;09/06/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMSTA1 ; SLC/AGP - Routines for building status list. ;06/20/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;This routine and PXRMSTA2 will allow users to select the
     
    3535 ;
    3636ADDDEL(ANS,GBL,FILE,TYPE,NODE,WILD,DA,UPDATE,DELALL) ;
    37  I $G(ANS)="" S ANS=$$PROMPT("S^A:ADD STATUS;D:DELETE A STATUS;S:SAVE AND QUIT;Q:QUIT WITHOUT SAVING CHANGES")
     37 I $G(ANS)="" S ANS=$$PROMPT("S^A:ADD STATUS;D:DELETE A STATUS;S:SAVE AND QUIT;Q:QUIT WITHOUT SAVING CHANGES","S")
    3838 I "ADDASQ"'[ANS Q
    3939 I ANS="A",WILD=1 D
     
    6262 I TYPE[";" S TYPE=$P($G(TYPE),";",2)
    6363 I TYPE="PXD(811.2," D  G ADDEX
    64  .I $G(TAXTYPE)="R"!($G(TAXTYPE)="B") D DATA^PXRMSTA2(FILE,.DA,"RAMIS(71,","",.STATUS)
     64 .I $G(TAXTYPE)="R" D DATA^PXRMSTA2(FILE,.DA,"RAMIS(71,","",.STATUS)
    6565 .;I $G(TAXTYPE)="P" D DATA^PXRMSTA2(FILE,.DA,"PROB","",.STATUS)
    66  .;I $G(TAXTYPE)="B" D DATA^PXRMSTA2(FILE,.DA,"TAX","",.STATUS)
     66 .I $G(TAXTYPE)="B" D DATA^PXRMSTA2(FILE,.DA,"TAX","",.STATUS)
    6767 ; handle drug finding items
    6868 I TYPE["PSDRUG("!(TYPE["PS(50.605")!(TYPE["PSNDF") D  G ADDEX
     
    9191 I TYPE[";" S TYPE=$P($G(TYPE),";",2)
    9292 I TYPE="PXD(811.2," D
    93  .I $G(TAXTYPE)="R"!($G(TAXTYPE)="B") S FILE=70
    94  .;I $G(TAXTYPE)="P" S FILE=9000011
     93 .I $G(TAXTYPE)="R" S FILE=70
     94 .I $G(TAXTYPE)="P" S FILE=9000011
    9595 I FILE="",TYPE="ORD(101.43," S FILE=100
    9696 I FILE="",TYPE="RAMIS(71," S FILE=70
     
    173173 Q
    174174 ;
    175 PROMPT(STR) ;
     175PROMPT(STR,DEFAULT) ;
    176176 N DIR,HTEXT
    177  S HTEXT(1)="Select 'A' to add a status to the current status list.\\Select 'D' to"
    178  S HTEXT(2)="delete a status from the list.\\Select 'S' to save your changes and quit. "
    179  S HTEXT(3)="\\Select 'Q' to quit without saving your changes."
     177 S HTEXT(1)="Select 'A' to add a status to the current status list. Select 'D' to "
     178 S HTEXT(2)="delete a status from the list. Select 'S' to save your changes and quit. "
     179 S HTEXT(3)="Select 'Q' to quit without saving your changes."
    180180 S DIR(0)=STR
    181181 S DIR("B")="S"
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMSTA2.m

    r628 r636  
    1 PXRMSTA2 ; SLC/AGP - Routines for building status list. ;03/27/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMSTA2 ; SLC/AGP - Routines for building status list. ;9/26/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44DATA(FILE,DA,TYPE,RXTYPE,STATUS) ;
     
    1111 I TYPE="DRUG" D
    1212 .I $D(RXTYPE("I"))>0 D
    13  . . D STATUS^PSS55MIS(55.06,28,"SARRAY")
    14  . . ;D FIELD^DID(55.06,28,"","POINTER","SARRAY")
     13 . . D FIELD^DID(55.06,28,"","POINTER","SARRAY")
    1514 . . D ARRAYFOR(.SARRAY,.ARRAY,"I") K CODE
    16  . . D STATUS^PSS55MIS(55.01,100,"SARRAY")
    17  . . ;D FIELD^DID(55.01,100,"","POINTER","SARRAY")
     15 . . D FIELD^DID(55.01,100,"","POINTER","SARRAY")
    1816 . . D ARRAYFOR(.SARRAY,.ARRAY1,"I") K CODE
    1917 . . D COMPARE(.ARRAY,.ARRAY1,"I",.OUTPUT)
    2018 . I $D(RXTYPE("O"))>0 D
    2119 . . K ARRAY,ARRAY1,CODE
    22  . . D STATUS^PSODI(52,100,"SARRAY")
    23  . . ;D FIELD^DID(52,100,"","POINTER","SARRAY")
     20 . . D FIELD^DID(52,100,"","POINTER","SARRAY")
    2421 . . D ARRAYFOR(.SARRAY,.ARRAY,"O") K CODE
    2522 . . I $D(OUTPUT)>0 K ARRAY1 M ARRAY1=OUTPUT K OUTPUT D COMPARE(.ARRAY,.ARRAY1,"",.OUTPUT)
     
    2724 . I $D(RXTYPE("N"))>0 D
    2825 . . K ARRAY,ARRAY1,CODE
    29  . . D STATUS^PSS55MIS(55.05,5,"SARRAY")
    30  . . ;D FIELD^DID(55.05,5,"","POINTER","SARRAY")
     26 . . D FIELD^DID(55.05,5,"","POINTER","SARRAY")
    3127 . . S SARRAY("POINTER")=SARRAY("POINTER")_"0:ACTIVE;"
    3228 . . D ARRAYFOR(.SARRAY,.ARRAY,"N") K CODE
     
    7672 ;
    7773ARRAYFOR(ARRAY,OUTPUT,DEF) ;
    78  ;this sub routine is use to format the array data into a standard
     74 ;this sub routine is use to format that array data into a standard
    7975 ;format
    8076 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMSXRM.m

    r628 r636  
    1 PXRMSXRM ; SLC/PKR - Main driver for building indexes. ;11/23/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMSXRM ; SLC/PKR - Main driver for building indexes. ;12/20/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;==========================================
     
    8181 S ROUTINE(120.5)="VITALS^GMVPXRM"  ;DBIA #3647
    8282 S ROUTINE(601.2)="INDEX^YTPXRM" ;DBIA #4523
    83  S ROUTINE(601.84)="INDEX^YTQPXRM" ;DBIA #5055
    8483 S ROUTINE(9000011)="INDEX^GMPLPXRM" ;DBIA #4516
    8584 S ROUTINE(9000010.07)="VPOV^PXPXRMI2" ;DBIA #4520
     
    115114 ;==========================================
    116115SEL(LIST,GBL) ;Select global list
    117  N ALIST,DIR,DIROUT,DIRUT,DTOUT,DUOUT,INUM,X,Y
    118  S INUM=1,ALIST(INUM)="  "_INUM_" - LABORATORY TEST (CH, Anatomic Path, Micro)",GBL(INUM)=63
    119  S INUM=INUM+1,ALIST(INUM)="  "_INUM_" - MENTAL HEALTH",GBL(INUM)=601.2
    120  S INUM=INUM+1,ALIST(INUM)="  "_INUM_" - MENTAL HEALTH (MHA3)",GBL(INUM)=601.84
    121  S INUM=INUM+1,ALIST(INUM)="  "_INUM_" - ORDER",GBL(INUM)=100
    122  S INUM=INUM+1,ALIST(INUM)="  "_INUM_" - PTF",GBL(INUM)=45
    123  S INUM=INUM+1,ALIST(INUM)="  "_INUM_" - PHARMACY PATIENT",GBL(INUM)=55
    124  S INUM=INUM+1,ALIST(INUM)="  "_INUM_" - PRESCRIPTION",GBL(INUM)=52
    125  S INUM=INUM+1,ALIST(INUM)="  "_INUM_" - PROBLEM LIST",GBL(INUM)=9000011
    126  S INUM=INUM+1,ALIST(INUM)="  "_INUM_" - RADIOLOGY",GBL(INUM)=70
    127  S INUM=INUM+1,ALIST(INUM)=" "_INUM_" - V CPT",GBL(INUM)=9000010.18
    128  S INUM=INUM+1,ALIST(INUM)=" "_INUM_" - V EXAM",GBL(INUM)=9000010.13
    129  S INUM=INUM+1,ALIST(INUM)=" "_INUM_" - V HEALTH FACTORS",GBL(INUM)=9000010.23
    130  S INUM=INUM+1,ALIST(INUM)=" "_INUM_" - V IMMUNIZATION",GBL(INUM)=9000010.11
    131  S INUM=INUM+1,ALIST(INUM)=" "_INUM_" - V PATIENT ED",GBL(INUM)=9000010.16
    132  S INUM=INUM+1,ALIST(INUM)=" "_INUM_" - V POV",GBL(INUM)=9000010.07
    133  S INUM=INUM+1,ALIST(INUM)=" "_INUM_" - V SKIN TEST",GBL(INUM)=9000010.12
    134  S INUM=INUM+1,ALIST(INUM)=" "_INUM_" - VITAL MEASUREMENT",GBL(INUM)=120.5
     116 N ALIST,DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
     117 S ALIST(1)="  1 - LABORATORY TEST (CH, Anatomic Path, Micro)",GBL(1)=63
     118 S ALIST(2)="  2 - MENTAL HEALTH",GBL(2)=601.2
     119 S ALIST(3)="  3 - ORDER",GBL(3)=100
     120 S ALIST(4)="  4 - PTF",GBL(4)=45
     121 S ALIST(5)="  5 - PHARMACY PATIENT",GBL(5)=55
     122 S ALIST(6)="  6 - PRESCRIPTION",GBL(6)=52
     123 S ALIST(7)="  7 - PROBLEM LIST",GBL(7)=9000011
     124 S ALIST(8)="  8 - RADIOLOGY",GBL(8)=70
     125 S ALIST(9)="  9 - V CPT",GBL(9)=9000010.18
     126 S ALIST(10)=" 10 - V EXAM",GBL(10)=9000010.13
     127 S ALIST(11)=" 11 - V HEALTH FACTORS",GBL(11)=9000010.23
     128 S ALIST(12)=" 12 - V IMMUNIZATION",GBL(12)=9000010.11
     129 S ALIST(13)=" 13 - V PATIENT ED",GBL(13)=9000010.16
     130 S ALIST(14)=" 14 - V POV",GBL(14)=9000010.07
     131 S ALIST(15)=" 15 - V SKIN TEST",GBL(15)=9000010.12
     132 S ALIST(16)=" 16 - VITAL MEASUREMENT",GBL(16)=120.5
    135133 M DIR("A")=ALIST
    136134 S DIR("A")="Enter your list"
    137  S DIR(0)="LO^1:"_INUM
     135 S DIR(0)="LO^1:16"
    138136 D ^DIR
    139137 I $D(DIROUT)!$D(DIRUT) S LIST="" Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMTAX.m

    r628 r636  
    1 PXRMTAX ; SLC/PKR - Handle taxonomy finding. ;10/11/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMTAX ; SLC/PKR - Handle taxonomy finding. ;07/17/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;==================================================
     
    6565 S SDIR=$S(NOCC<0:+1,1:-1)
    6666 S NOCC=$S(NOCC<0:-NOCC,1:NOCC)
    67  S NGET=$S(UCIFS:50,1:NOCC)
     67 S NGET=$S(UCIFS:"*",1:NOCC)
    6868 ;
    6969 I (NICD0>0),INS D FPDAT^PXRMDGPT(DFN,.TAXARR,NGET,SDIR,BDT,EDT,"ICD0",.TLIST)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMTERM.m

    r628 r636  
    1 PXRMTERM ; SLC/PKR - Handle reminder terms. ;04/23/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMTERM ; SLC/PKR - Handle reminder terms. ;06/29/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;=============================================
     
    1919 ... I 'FIEVAL(FINDING) Q
    2020 ... S JND="@"
    21  ... F  S JND=$O(TFIEVAL(TFI,JND)) Q:JND=""  M FIEVAL(FINDING,JND)=TFIEVAL(TFI,JND)
     21 ... F  S JND=$O(TFIEVAL(TFI,JND)) Q:JND=""  D
     22 .... M FIEVAL(FINDING,JND)=TFIEVAL(TFI,JND)
    2223 .. I 'FIEVAL(FINDING) Q
    2324 .. S IND=0
     
    7980 ;
    8081 ;=============================================
     82EVALPL(FINDPA,TERMARR,PLIST) ;Build a list of patients based on a
     83 ;term. The list is returned in:
     84 ;^TMP($J,PLIST,T/F,DFN,ITEM,NFOUND,FILENUM)=DAS_U_DATE_U_VALUE
     85 ;for findings with a start and stop date the list is
     86 ;^TMP($J,PLIST,T/F,DFN,ITEM,NFOUND,FILENUM)=DAS_U_START_U_STOP_U_VALUE
     87 N ENODE
     88 K ^TMP($J,PLIST)
     89 S ENODE=""
     90 F  S ENODE=$O(TERMARR("E",ENODE)) Q:ENODE=""  D
     91 . I ENODE="AUTTEDT(" D EVALPL^PXRMEDU(.FINDPA,ENODE,.TERMARR,PLIST) Q
     92 . I ENODE="AUTTEXAM(" D EVALPL^PXRMEXAM(.FINDPA,ENODE,.TERMARR,PLIST) Q
     93 . I ENODE="AUTTHF(" D EVALPL^PXRMHF(.FINDPA,ENODE,.TERMARR,PLIST) Q
     94 . I ENODE="AUTTIMM(" D EVALPL^PXRMIMM(.FINDPA,ENODE,.TERMARR,PLIST) Q
     95 . I ENODE="AUTTSK(" D EVALPL^PXRMSKIN(.FINDPA,ENODE,.TERMARR,PLIST) Q
     96 . I ENODE="GMRD(120.51," D EVALPL^PXRMVITL(.FINDPA,ENODE,.TERMARR,PLIST) Q
     97 . I ENODE="LAB(60," D EVALPL^PXRMLAB(.FINDPA,ENODE,.TERMARR,PLIST) Q
     98 . I ENODE="ORD(101.43," D EVALPL^PXRMORDR(.FINDPA,ENODE,.TERMARR,PLIST) Q
     99 . I ENODE="PXRMD(810.9," D EVALPL^PXRMLOCL(.FINDPA,ENODE,.TERMARR,PLIST) Q
     100 . I ENODE="PXD(811.2," D EVALPL^PXRMTAX(.FINDPA,ENODE,.TERMARR,PLIST) Q
     101 . I ENODE="PXRMD(811.4," D EVALPL^PXRMCF(.FINDPA,ENODE,.TERMARR,PLIST) Q
     102 . I ENODE="PS(50.605," D EVALPL^PXRMDRCL(.FINDPA,ENODE,.TERMARR,PLIST) Q
     103 . I ENODE="PSDRUG(" D EVALPL^PXRMDRUG(.FINDPA,ENODE,.TERMARR,PLIST) Q
     104 . I ENODE="PSNDF(50.6," D EVALPL^PXRMDGEN(.FINDPA,ENODE,.TERMARR,PLIST) Q
     105 . I ENODE="RAMIS(71," D EVALPL^PXRMRAD(.FINDPA,ENODE,.TERMARR,PLIST) Q
     106 . I ENODE="YTT(601," D EVALPL^PXRMMH(.FINDPA,ENODE,.TERMARR,PLIST) Q
     107 Q
     108 ;
     109 ;=============================================
    81110EVALTERM(DFN,FINDPA,TERMARR,TFIEVAL) ;Evaluate all the findings in
    82111 ;a term. Use the "E" cross-reference just like the finding evaluation.
     
    102131 . I ENODE="PSNDF(50.6," D EVALTERM^PXRMDGEN(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL) Q
    103132 . I ENODE="RAMIS(71," D EVALTERM^PXRMRAD(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL) Q
    104  . I ENODE="YTT(601.71," D EVALTERM^PXRMMH(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL) Q
     133 . I ENODE="YTT(601," D EVALTERM^PXRMMH(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL) Q
    105134 Q
    106135 ;
     
    140169 ;=============================================
    141170OPT(INDENT,IFIEVAL,NLINES,TEXT,TYPE) ;General output.
    142  N DG,DGL,DGN,IEN,IND,JND,KND,INDENTT,FILENUM,TEMP,TIFIEVAL
     171 N DG,DGL,DGN,DRUG,IEN,IND,JND,KND,INDENTT,FILENUM,TEMP,TIFIEVAL
     172 ;If there is a drug make it available for display.
     173 S DRUG=$S($D(IFIEVAL("DISPENSE DRUG")):IFIEVAL("DISPENSE DRUG"),1:"")
     174 ;DBIA #10043
     175 I DRUG'="" S DRUG=$P(^PSDRUG(DRUG,0),U,1)
    143176 ;Build the display grouping.
    144177 S FILENUM=IFIEVAL(1,"FILE NUMBER")
     
    164197 .. I KND=1 M TIFIEVAL=IFIEVAL(JND)
    165198 .. M TIFIEVAL(KND)=IFIEVAL(JND)
     199 .. I DRUG'="" S TIFIEVAL("DISPENSE DRUG")=DRUG
    166200 . I TYPE="CM" D FOUT^PXRMOUTC(INDENTT,.TIFIEVAL,.NLINES,.TEXT)
    167201 . I TYPE="MHV" D FOUT^PXRMOUTM(INDENTT,.TIFIEVAL,.NLINES,.TEXT)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMTEXT.m

    r628 r636  
    1 PXRMTEXT ; SLC/PKR - Text formatting utility routines. ;07/19/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMTEXT ; SLC/PKR - Text formatting utility routines. ;11/03/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    4  ;============================================
     4 ;================================================================
    55NEWLINE ;Put TEXT on a new line to the output, make sure it does not end
    66 ;with a " ".
     
    1414 Q
    1515 ;
    16  ;============================================
     16 ;================================================================
    1717BLANK ;Add a blank line (line containing just " ") to the output.
    1818 S NOUT=NOUT+1,TEXTOUT(NOUT)=" "
     
    2020 Q
    2121 ;
    22  ;============================================
     22 ;================================================================
    2323CHECKLEN(WORD) ;Check to see if adding the next word makes the line too long.
    2424 ;If it does add it to the output and start a new line.
     
    3434 Q
    3535 ;
    36  ;============================================
    37 COLFMT(FMTSTR,TEXTSTR,PC,NL,OUTPUT) ;Columnar text formatter.
    38  ;FMTSTR - format string; ^ separated string for each column in the
    39  ;output. 35R2 defines a right justified column 35 characters wide
    40  ;with 2 blank spaces following. Columns can be centered (C) left
    41  ;justified (L) or right justified (R).
    42  ;TEXTSTR - string to be formated
    43  ;PC - the pad character
    44  ;NL - number of lines of output
    45  ;OUTPUT - array containing output lines.
    46  N COLOUT,ENTRY,FMT,JND,JUS,IND,LEN,NCOL,NLO,NROW,SP,TEMP,TEXT,WIDTH,WPSP
    47  S NCOL=$L(FMTSTR,U),NROW=1
    48  F IND=1:1:NCOL D
    49  . S FMT=$P(FMTSTR,U,IND)
    50  . S JUS(IND)=$S(FMT["C":"C",FMT["L":"L",FMT["R":"R",1:"C")
    51  . S WIDTH(IND)=$P(FMT,JUS(IND),1)
    52  . S SP(IND)=$P(FMT,JUS(IND),2)
    53  . S WPSP(IND)=WIDTH(IND)+SP(IND)
    54  F IND=1:1:NCOL D
    55  . S ENTRY=$S(JUS(IND)="C":"CJ",JUS(IND)="L":"LJ",JUS(IND)="R":"RJ")
    56  . S TEMP=$P(TEXTSTR,U,IND)
    57  . S LEN=$L(TEMP)
    58  . I LEN'>WIDTH(IND) D
    59  .. S TEMP=$$@ENTRY^XLFSTR(TEMP,WIDTH(IND),PC)
    60  .. S COLOUT(1,IND)=TEMP_$$LJ^XLFSTR("",SP(IND)," ")
    61  . I LEN>WIDTH(IND) D
    62  .. D FORMATS(1,WIDTH(IND),TEMP,.NLO,.TEXTOUT)
    63  .. F JND=1:1:NLO D
    64  ... S TEMP=$$@ENTRY^XLFSTR(TEXTOUT(JND),WIDTH(IND),PC)
    65  ... S COLOUT(JND,IND)=TEMP_$$LJ^XLFSTR("",SP(IND)," ")
    66  .. I NLO>NROW S NROW=NLO
    67  F IND=1:1:NROW D
    68  . S TEXT=""
    69  . F JND=1:1:NCOL D
    70  .. I $D(COLOUT(IND,JND)) S TEXT=TEXT_COLOUT(IND,JND)
    71  .. E  S TEXT=TEXT_$$LJ^XLFSTR("",(WPSP(JND))," ")
    72  . S OUTPUT(IND)=TEXT
    73  S NL=NROW
    74  Q
    75  ;
    76  ;============================================
    77 COLFMTA(FMTSTR,INPUT,PC,NL,OUTPUT) ;Columnar text formatter.
    78  ;Array version of COLFMT. Input array is ^TMP($J,INPUT,M) and
    79  ;output is ^TMP(OUTPUT,$J,N,0).
    80  N COLOUT,ENTRY,FMT,JND,JUS,IND,LEN,NCOL,NLO,NROW,NUM
    81  N SP,TEMP,TEXT,WIDTH,WPSP
    82  S NCOL=$L(FMTSTR,U)
    83  F IND=1:1:NCOL D
    84  . S FMT=$P(FMTSTR,U,IND)
    85  . S JUS(IND)=$S(FMT["C":"C",FMT["L":"L",FMT["R":"R",1:"C")
    86  . S WIDTH(IND)=$P(FMT,JUS(IND),1)
    87  . S SP(IND)=$P(FMT,JUS(IND),2)
    88  . S WPSP(IND)=WIDTH(IND)+SP(IND)
    89  S NL=0,NUM=""
    90  F  S NUM=$O(^TMP($J,INPUT,NUM)) Q:NUM=""  D
    91  . K COLOUT
    92  . S NROW=1
    93  . F IND=1:1:NCOL D
    94  .. S ENTRY=$S(JUS(IND)="C":"CJ",JUS(IND)="L":"LJ",JUS(IND)="R":"RJ")
    95  .. S TEMP=$P(^TMP($J,INPUT,NUM),U,IND)
    96  .. S LEN=$L(TEMP)
    97  .. I LEN'>WIDTH(IND) D
    98  ... S TEMP=$$@ENTRY^XLFSTR(TEMP,WIDTH(IND),PC)
    99  ... S COLOUT(1,IND)=TEMP_$$LJ^XLFSTR("",SP(IND)," ")
    100  .. I LEN>WIDTH(IND) D
    101  ... D FORMATS(1,WIDTH(IND),TEMP,.NLO,.TEXTOUT)
    102  ... F JND=1:1:NLO D
    103  .... S TEMP=$$@ENTRY^XLFSTR(TEXTOUT(JND),WIDTH(IND),PC)
    104  .... S COLOUT(JND,IND)=TEMP_$$LJ^XLFSTR("",SP(IND)," ")
    105  ... I NLO>NROW S NROW=NLO
    106  . F IND=1:1:NROW D
    107  .. S TEXT=""
    108  .. F JND=1:1:NCOL D
    109  ... I $D(COLOUT(IND,JND)) S TEXT=TEXT_COLOUT(IND,JND)
    110  ... E  S TEXT=TEXT_$$LJ^XLFSTR("",(WPSP(JND))," ")
    111  .. S NL=NL+1,^TMP(OUTPUT,$J,NL,0)=TEXT
    112  Q
    113  ;
    114  ;============================================
     36 ;================================================================
    11537FORMAT(LM,RM,NIN,TEXTIN,NOUT,TEXTOUT) ;Format the text in TEXTIN so it has
    11638 ;a left margin of LM and a right margin of RM. The formatted text
     
    16385 Q
    16486 ;
    165  ;============================================
     87 ;================================================================
    16688FORMATS(LM,RM,TEXTLINE,NOUT,TEXTOUT) ;Take a single line of input text
    16789 ;and format it.
     
    17193 Q
    17294 ;
    173  ;============================================
    174 LMFMTSTR(VALMDDF,JSTR) ;The List Manager variable VALMDDF contains the
    175  ;list template caption column formatting information. It contains
    176  ;the starting column and the width if the form
    177  ;VALMDDF(COLUMN NAME)=COLUMN NAME^COLUMN^WIDTH^CAPTION^VIDEO^SCROLL
    178  ;LOCK. JUSSTR, which is optional,is the justification for each column;
    179  ;(L=left, C=center, R=right) the default is center. Use this information
    180  ;to build the format string for the column formatter COLFMT.
    181  N CN,COL,FMTSTR,IND,JC,JUSSTR,PLCOL,SCOL,SP,TEMP,WIDTH
    182  ;Sort by columns
    183  S IND=""
    184  F  S IND=$O(VALMDDF(IND)) Q:IND=""  D
    185  . S TEMP=VALMDDF(IND)
    186  . S COL($P(TEMP,U,2))=$P(TEMP,U,3)
    187  S JUSSTR=$G(JSTR)
    188  S (CN,PLCOL,SCOL,SP)=0
    189  S FMTSTR=""
    190  S SCOL=0
    191  F  S SCOL=$O(COL(SCOL)) Q:SCOL=""  D
    192  . S CN=CN+1
    193  . S WIDTH=COL(SCOL)
    194  . I CN=1 S PLCOL=WIDTH
    195  . E  S SP=SCOL-PLCOL-1,FMTSTR=FMTSTR_SP_U,PLCOL=SCOL+WIDTH-1
    196  . S JC=$E(JUSSTR,CN)
    197  . I JC="" S JC="C"
    198  . S TEMP=WIDTH_JC
    199  . S FMTSTR=FMTSTR_TEMP
    200  Q FMTSTR
    201  ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMTMED.m

    r628 r636  
    1 PXRMTMED ; SLC/PKR/PJH - Edit a reminder term. ;04/18/2007
    2  ;;2.0;CLINICAL REMINDERS;**1,4,6**;Feb 04, 2005;Build 123
     1PXRMTMED ; SLC/PKR/PJH - Edit a reminder term. ;01/30/2006
     2 ;;2.0;CLINICAL REMINDERS;**1,4**;Feb 04, 2005;Build 21
    33 ;
    44 ;=======================================================
     
    6262 N CFIEN,GLOB,IEN,LIST,NODE,TERMSTAT,VF,WPIEN
    6363 N DEF,DEF1,DEF2,STATUS
    64  S DIE("NO^")="OUTOK"
    6564 S STATUS=0
    6665 D DEF^PXRMRUTL("811.52",.DEF,.DEF1,.DEF2)
     
    7776 S DA=+Y,GLOB=$P($P(Y,U,2),";",2) Q:GLOB=""
    7877 I GLOB="PXRMD(811.4," S CFIEN=$P($P(Y,U,2),";",1) D
    79  . I $D(^PXRMD(811.4,CFIEN,1))>0 D
    80  .. W !!,"Computed Finding Description:" S WPIEN=0
    81  .. F  S WPIEN=$O(^PXRMD(811.4,CFIEN,1,WPIEN)) Q:+WPIEN'>0  D
    82  ... W !,$G(^PXRMD(811.4,CFIEN,1,WPIEN,0))
    83  . E  W !!,"No description defined for this computed finding"
    84  . W !
    85  I GLOB="YTT(601.71," D WARN^PXRMMH
     78 .I $D(^PXRMD(811.4,CFIEN,1))>0 D
     79 ..W !!,"Computed Finding Description:" S WPIEN=0
     80 ..F  S WPIEN=$O(^PXRMD(811.4,CFIEN,1,WPIEN)) Q:+WPIEN'>0  D
     81 ...W !,$G(^PXRMD(811.4,CFIEN,1,WPIEN,0))
     82 .E  W !!,"No description defined for this computed finding"
     83 .W !
    8684 W !,"Editing Finding Number: "_$G(DA)
    8785 ;Finding record fields
     
    9997 I VF S DR=DR_";28"
    10098 ;Mental Health - scale
    101  I GLOB="YTT(601.71," S DR=DR_";13"
     99 I GLOB="YTT(601," S DR=DR_";13"
    102100 ;Radiology procedure
    103101 I GLOB="RAMIS(71," S STATUS=1
     
    111109 ;Edit finding record
    112110 D ^DIE
    113  I STATUS=1,$D(DA)>0,$D(Y)=0 D STATUS^PXRMSTA1(.DA,"T")
     111 I STATUS=1,$D(DA)>0 D STATUS^PXRMSTA1(.DA,"T")
    114112 S $P(^PXRMD(811.5,IEN,20,0),U,3)=0
    115113 Q
  • 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.
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMVITL.m

    r628 r636  
    1 PXRMVITL ; SLC/PKR - Handle vitals findings. ;09/20/2007
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMVITL ; SLC/PKR - Handle vitals findings. ;10/21/2004
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;===========================================================
     
    2020 ;
    2121 ;===========================================================
    22 GETDATA(DAS,FIEVT) ;Return data for a GMRV Vital Measurement entry.
    23  N EM,IND,GMRVDATA,STOP,TEMP,TYPE
     22GETDATA(DAS,FIEVT) ;Return the value, which is Rate, for a specified
     23 ;GMRV Vital Measurement entry.
     24 N IND,GMRVDATA,TEMP
    2425 ;DBIA #3647
    2526 D EN^GMVPXRM(.GMRVDATA,DAS,"I")
    2627 I $P(GMRVDATA(1),U,1)=-1 D  Q
    27  . S ^TMP("PXRMXMZ",$J,1,0)="Found GMRV entry "_DAS_" in the index, but it does not exist in ^GMR(120.5"
     28 . S ^TMP("PXRMXMZ",$J,1,0)="Found GMRV entry "_DAS_" in the index, but it does not exist in ^GMRV(120.5"
    2829 . D SEND^PXRMMSG("Bad entry in Vitals index.")
    29  S FIEVT("TYPE")=$$EXTERNAL^DILFD(120.5,.03,"",GMRVDATA(3),.EM)
    30  ;DBIA #10040
    31  S TEMP=$S(+GMRVDATA(5)'=0:^SC(GMRVDATA(5),0),1:"")
    32  S FIEVT("HOSPITAL LOCATION")=$P(TEMP,U,1)
    33  S FIEVT("LOCATION TYPE")=$P(TEMP,U,3)
    34  S STOP=$P(TEMP,U,7)
    35  S FIEVT("ENTERED BY")=$P(^VA(200,GMRVDATA(6),0),U,1)
     30 S FIEVT("TYPE")=$P(GMRVDATA(3),U,1)
    3631 S (FIEVT("RATE"),FIEVT("VALUE"))=$P(GMRVDATA(7),U,1)
    3732 S IND=0
     
    4136 .;DBIA #4504
    4237 . I TEMP'="" S FIEVT("QUALIFIER",IND)=$P($G(^GMRD(120.52,+TEMP,0)),U,1)
    43  ;DBIA #557
    44  I STOP'="" S FIEVT("STOP CODE")=$P(^DIC(40.7,STOP,0),U,1,2)
    45  E  S FIEVT("STOP CODE")=""
    4638 Q
    4739 ;
     
    6658 ;maintenance output.
    6759 N DATE,EM,IND,JND,NOUT,RATE,TEMP,TEXTOUT,TYPE
     60 S TYPE=$$EXTERNAL^DILFD(120.5,.03,"",IFIEVAL("TYPE"),.EM)
    6861 S NLINES=NLINES+1
    69  S TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_"Vital Measurement: "_IFIEVAL("TYPE")
     62 S TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_"Vital Measurement: "_TYPE
    7063 S IND=0
    7164 F  S IND=+$O(IFIEVAL(IND)) Q:IND=0  D
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMVPTR.m

    r628 r636  
    11PXRMVPTR ; SLC/PKR - Routines for dealing with variable pointers. ; 02/06/2001
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ;==================================================
     
    2020 ;indexed by the file number.
    2121 N FN,IND,ROOT,TEMP
    22  ;DBIA #2991
    2322 S IND=0
    2423 F  S IND=$O(^DD(FILE,FIELD,"V",IND)) Q:+IND=0  D
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMVSIT.m

    r628 r636  
    1 PXRMVSIT ; SLC/PKR - Visit related info for reminders. ;02/22/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMVSIT ; SLC/PKR - Visit related info for reminders. ;07/06/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;======================================================
    5 GETDATA(DA,DATA,SVALUE) ;Return data for a specific Visit file entry.
     5GETDATA(DA,FIEVT,SVALUE) ;Return data for a specific Visit file entry.
    66 ;DBIA #2028 for Visit file.
    7  N DONE,IEN,HTEMP,LOE,TEMP
     7 N HTEMP,TEMP
    88 S TEMP=^AUPNVSIT(DA,0)
    9  S DATA("VISIT")=DA
    10  S DATA("DATE VISIT CREATED")=$P(TEMP,U,2)
    11  S DATA("DFN")=$P(TEMP,U,5)
    12  S (DATA("LOC. OF ENCOUNTER"),LOE)=$P(TEMP,U,6)
    13  ;DBIA #10090
    14  S DATA("STATION NUMBER")=$$GET1^DIQ(4,LOE,99)
    15  S DATA("OFFICAL VA NAME")=$$GET1^DIQ(4,LOE,100)
    16  S DATA("SERVICE CATEGORY")=$P(TEMP,U,7)
    17  I $G(SVALUE) S DATA("VALUE")=$P(TEMP,U,7)
    18  S DATA("HOSPITAL LOCATION")=$P(TEMP,U,22)
     9 S FIEVT("VISIT")=DA
     10 S FIEVT("DATE VISIT CREATED")=$P(TEMP,U,2)
     11 S FIEVT("DFN")=$P(TEMP,U,5)
     12 S FIEVT("LOC. OF ENCOUNTER")=$P(TEMP,U,6)
     13 S FIEVT("SERVICE CATEGORY")=$P(TEMP,U,7)
     14 I $G(SVALUE) S FIEVT("VALUE")=$P(TEMP,U,7)
     15 S FIEVT("HOSPITAL LOCATION")=$P(TEMP,U,22)
    1916 ;DBIA #10040, #2804
    20  I $G(DATA("HOSPITAL LOCATION"))="" S HTEMP=""
    21  E  S HTEMP=^SC(DATA("HOSPITAL LOCATION"),0)
    22  S DATA("HLOC")=$P(HTEMP,U,1)
    23  S DATA("DSS ID")=$P(TEMP,U,8)
    24  I DATA("DSS ID")="" S DATA("DSS ID")=$P(HTEMP,U,7)
     17 I $G(FIEVT("HOSPITAL LOCATION"))="" S HTEMP=""
     18 E  S HTEMP=^SC(FIEVT("HOSPITAL LOCATION"),0)
     19 S FIEVT("HLOC")=$P(HTEMP,U,1)
     20 S FIEVT("DSS ID")=$P(TEMP,U,8)
     21 I FIEVT("DSS ID")="" S FIEVT("DSS ID")=$P(HTEMP,U,7)
    2522 ;DBIA #557
    26  I DATA("DSS ID")'="" S DATA("STOP CODE")=$P(^DIC(40.7,DATA("DSS ID"),0),U,2)
    27  S DATA("OUTSIDE LOCATION")=$G(^AUPNVSIT(DA,21))
    28  S DATA("COMMENTS")=$G(^AUPNVSIT(DA,811))
     23 I FIEVT("DSS ID")'="" S FIEVT("STOP CODE")=$P(^DIC(40.7,FIEVT("DSS ID"),0),U,2)
     24 S FIEVT("OUTSIDE LOCATION")=$G(^AUPNVSIT(DA,21))
     25 S FIEVT("COMMENTS")=$G(^AUPNVSIT(DA,811))
    2926 ;DBIA #4850
    30  S DATA("STATUS")=$$STATUS^SDPCE(DA)
    31  ;Get the primary provider.
    32  ;DBIA #3455 for V PROVIDER
    33  S DATA("PRIMARY PROVIDER")="",IEN="",DONE=0
    34  F  S IEN=$O(^AUPNVPRV("AD",DA,IEN)) Q:(DONE)!(IEN="")  D
    35  . S TEMP=^AUPNVPRV(IEN,0)
    36  . I $P(TEMP,U,4)="P" S DATA("PRIMARY PROVIDER")=$P(TEMP,U,1),DONE=1
     27 S FIEVT("STATUS")=$$STATUS^SDPCE(DA)
    3728 Q
    3829 ;
     
    8980 ;NO-SHOW
    9081 ;NO-SHOW & AUTO RE-BOOK
    91  ;NULL
    9282 N STATUS,VALID
    9383 ;DBIA #4850
    9484 S STATUS=$P($$STATUS^SDPCE(VIEN),U,2)
    95  S VALID=$S(STATUS["CANCELLED":0,STATUS["DELETED":0,STATUS["NO ACTION":0,STATUS["NO-SHOW":0,STATUS="":0,1:1)
     85 S VALID=$S(STATUS["CANCELLED":0,STATUS["DELETED":0,STATUS["NO ACTION":0,STATUS["NO-SHOW":0,1:1)
    9686 Q VALID
    9787 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXD.m

    r628 r636  
    1 PXRMXD ; SLC/PJH - Reminder Due reports DRIVER ;11/27/2006
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMXD ; SLC/PJH - Reminder Due reports DRIVER ;06/20/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44START ; Arrays and strings
     
    1717 N DBDOWN,DBDUZ,DBERR,PXRMLIST,PXRMLIS1,Y
    1818 N PLISTPUG
    19  N PXRMTPAT,PXRMDPAT,PXRMPML
     19 N PXRMTPAT,PXRMDPAT
    2020 ;
    2121 S PXRMRT="PXRMX",PXRMTYP="X",PXRMFCMB="N",PXRMLCMB="N",PXRMTCMB="N"
     
    153153 .D LIT,TOTALS^PXRMXSD(.PXRMTOT,LIT1,LIT2,LIT3)
    154154 ;
    155 MLOC     ;Print Locations empty location at the end of the report
    156  W !
    157  S DIR(0)="Y",DIR("B")="YES",DIR("A")="Print locations with no patients"
    158  D ^DIR
    159  I Y="^^" G EXIT
    160  I Y=U G:PXRMREP="D" SSN G TOT
    161  S PXRMPML=Y
    162  ;
    163155 ;Reminder Category/Individual Reminder Selection
    164156RCAT ;
    165157 D RCAT^PXRMXSU(.PXRMRCAT,.PXRMREM) I $D(DTOUT) G EXIT
    166  ;I $D(DUOUT) G:PXRMREP="D" SSN G TOT
    167  I $D(DUOUT) G MLOC
     158 I $D(DUOUT) G:PXRMREP="D" SSN G TOT
    168159 ;
    169160 ;Create combined reminder list
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXDT1.m

    r628 r636  
    1 PXRMXDT1 ; SLC/PJH - Build Patient list SUBROUTINES;08/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMXDT1 ; SLC/PJH - Build Patient list SUBROUTINES;07/10/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ; Called by label from PXRMXSEO,PXRMXSE
     
    167167 Q
    168168 ;
    169 ERRMSG(TYPE) ;
     169DBDOWN(TYPE) ;
    170170 N CNT,CNT1,CNT2,STR,NLINES,OUTPUT,TIME
    171171 K ^TMP("PXRMXMZ",$J)
     
    173173 I TYPE="C" D  Q
    174174 .M ^TMP("PXRMXMZ",$J)=^TMP($J,"PXRM CNBD")
    175  .D SEND^PXRMMSG("REMINDER REPORTS CNBD PATIENT LIST ("_$$FMTE^XLFDT($$NOW^XLFDT)_")",1)
     175 .D SEND^PXRMMSG("COULD NOT BE DETERMINED PATIENTS("_$$FMTE^XLFDT($$NOW^XLFDT)_")",1)
    176176 I 'PXRMQUE D
    177177 .S STR(1)="The Reminders Due Report "_$G(TITLE)_" requested by "_$$GET1^DIQ(200,DUZ,.01)_" on "_$$FMTE^XLFDT($G(PXRMXST))_" for the following reason(s):"
     
    180180 .F CNT=1:1:NLINES W !,OUTPUT(CNT)
    181181 I PXRMQUE D
    182  .S ^TMP("PXRMXMZ",$J,1,0)="The Reminders Due Report "_$G(TITLE)_" requested by "_$$GET1^DIQ(200,DUZ,.01)_" on "_$$FMTE^XLFDT($G(PXRMXST))_"was cancelled for the following reason(s):"
     182 .S ^TMP("PXRMXMZ",$J,1,0)="The Reminders Due Report "_$G(TITLE)_" requested by "_$$GET1^DIQ(200,DUZ,.01)_" on "_$$FMTE^XLFDT($G(PXRMXST))_" for the following reason(s):"
    183183 .F  S CNT=$O(DBERR(CNT)) Q:CNT'>0  S ^TMP("PXRMXMZ",$J,CNT1,0)=DBERR(CNT),CNT1=CNT1+1
    184  .D SEND^PXRMMSG("Cancelled Reminders Due Report ("_$$FMTE^XLFDT($$NOW^XLFDT)_")",1)
     184 .D SEND^PXRMMSG("Cancelled Reminders Due Report("_$$FMTE^XLFDT($$NOW^XLFDT)_")",1)
    185185 .S ZTSTOP=1
    186186 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXGPR.m

    r628 r636  
    1 PXRMXGPR ; SLC/PJH - Reminder Due print calls ;11/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMXGPR ; SLC/PJH - Reminder Due print calls ;01/09/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;Called from PXRMXPR
     
    174174 ;
    175175 ;form feed to new page
    176 PAGE I ($E(IOST,1,2)="C-")&(IO=IO(0))&(PAGE>0) D
     176PAGE I ($E(IOST)="C")&(IO=IO(0))&(PAGE>0) D
    177177 .S DIR(0)="E"
    178178 .W !
     
    181181 W:$D(IOF)&(PAGE>0) @IOF
    182182 S PAGE=PAGE+1,FIRST=0
    183  I $E(IOST,1,2)="C-",IO=IO(0) W @IOF
     183 I $E(IOST)="C",IO=IO(0) W @IOF
    184184 E  W !
    185185 N TEMP,TEXTLEN
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXGUT.m

    r628 r636  
    1 PXRMXGUT ; SLC/PJH - General utilities for reminder reports; 11/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMXGUT ; SLC/PJH - General utilities for reminder reports; 05/31/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;=======================================
    55EOR ;End of report display.
    6  I $E(IOST,1,2)="C-",IO=IO(0) D
     6 I $E(IOST)="C",IO=IO(0) D
    77 . S DIR(0)="EA"
    88 . S DIR("A")="End of the report. Press ENTER/RETURN to continue..."
     
    2929 ;
    3030 ;=======================================
    31 TIMING ;Print report timing data.
    32  N IND
    33  W !!,"Report timing data:"
    34  S IND=""
    35  F  S IND=$O(^XTMP(PXRMXTMP,"TIMING",IND)) Q:IND=""  W !," ",^XTMP(PXRMXTMP,"TIMING",IND)
    36  Q
     31VLIST(SLIST,LIST,MESSAGE) ;Make sure all the elements of LIST are in
     32 ;SLIST.  If they are, then LIST is valid.  The elements of LIST can be
     33 ;separated by commas and spaces.
     34 N IC,LE,LEN,VALID
     35 S LIST=$TR(LIST,",","")
     36 S LIST=$TR(LIST," ","")
     37 ;Make the test case insensitive.
     38 S SLIST=$$UP^XLFSTR(SLIST)
     39 S LIST=$$UP^XLFSTR(LIST)
     40 S VALID=1
     41 S LEN=$L(LIST)
     42 I LEN=0 D
     43 . W !,"The list is empty!"
     44 . S VALID=0
     45 F IC=1:1:LEN D
     46 . S LE=$E(LIST,IC,IC)
     47 . I SLIST'[LE D
     48 .. W !,LE,MESSAGE
     49 .. S VALID=0
     50 Q VALID
    3751 ;
    3852 ;=======================================
     
    7589 Q STR
    7690 ;
    77  ;=======================================
    78 VLIST(SLIST,LIST,MESSAGE) ;Make sure all the elements of LIST are in
    79  ;SLIST.  If they are, then LIST is valid.  The elements of LIST can be
    80  ;separated by commas and spaces.
    81  N IC,LE,LEN,VALID
    82  S LIST=$TR(LIST,",","")
    83  S LIST=$TR(LIST," ","")
    84  ;Make the test case insensitive.
    85  S SLIST=$$UP^XLFSTR(SLIST)
    86  S LIST=$$UP^XLFSTR(LIST)
    87  S VALID=1
    88  S LEN=$L(LIST)
    89  I LEN=0 D
    90  . W !,"The list is empty!"
    91  . S VALID=0
    92  F IC=1:1:LEN D
    93  . S LE=$E(LIST,IC,IC)
    94  . I SLIST'[LE D
    95  .. W !,LE,MESSAGE
    96  .. S VALID=0
    97  Q VALID
    98  ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXPR.m

    r628 r636  
    1 PXRMXPR ; SLC/PJH - Print Reminder Due report. ;11/27/2006
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMXPR ; SLC/PJH - Print Reminder Due report. ;01/14/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ; Called/Jobbed after PXRMXSE1
     
    135135 I ('DONE),$O(^XTMP(PXRMXTMP,PX,""))="" D NULL^PXRMXGPR G EXIT
    136136 ; Report selected patient sample with no patients
    137  I $D(MISSED),PXRMPML=1 D MISSED^PXRMXPR1(0,.MISSED)
     137 I $D(MISSED) D MISSED^PXRMXPR1(0,.MISSED)
    138138 ;
    139139 ;Print Patient List
     
    143143 I $D(^XTMP(PXRMXTMP,"ERROR"))>0!($D(^XTMP(PXRMXTMP,"CNBD"))>0) D ERROR^PXRMXBSY
    144144EXIT ;
    145  D TIMING^PXRMXGUT
    146145 D EXIT^PXRMXGUT
    147146 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXPR1.m

    r628 r636  
    11PXRMXPR1 ; SLC/AGP - Print Reminder Due report carryover code. ;01/05/2006
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ;Patient list display
     
    7070 N DATA,IC,LTYPE,MARK
    7171 S IC=""
    72  I PXRMSEL="P" D  Q
     72 I PXRMSEL="P" D
    7373 . F  S IC=$O(PXRMPRV(IC)) Q:IC=""  D
    7474 .. S DATA=PXRMPRV(IC)
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXQUE.m

    r628 r636  
    1 PXRMXQUE ; SLC/PJH - Reminder reports general queuing routine.;03/23/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMXQUE ; SLC/PJH - Reminder reports general queuing routine.;02/24/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    4  ;Determine whether the report should be queued.
     4        ;Determine whether the report should be queued.
    55JOB ;
    66 N %ZIS S %ZIS="Q"
     
    4242 Q $G(ZTSK)
    4343 ;
    44 DEVICE(RTN,DESC,SAVE,%ZIS,RETZTSK) ;
    45  ;Pass RETZTSK as number such as 1 if you want to get ZTSK.
    46  N ZTSK
     44DEVICE(ZTRTN,ZTDESC,ZTSAVE,%ZIS,ZTSK) ;
    4745 W !
    48  D EN^XUTMDEVQ(RTN,DESC,.SAVE,.%ZIS,RETZTSK)
    49  I $D(ZTSK) W !!,DESC," has been queued, task number "_ZTSK H 2
    50  Q $G(ZTSK)
     46 D EN^XUTMDEVQ(ZTRTN,ZTDESC,.ZTSAVE,.%ZIS,.ZTSK)
     47 I $D(ZTSK)>1 W !!,ZTDESC," has been queued, task number "_$G(ZTSK) H 2
     48 I $G(ZTSK)="" S ZTSK=0
     49 Q ZTSK
    5150 ;
    5251 ;=======================================================================
     
    138137 S ZTSAVE("PXRMDPAT")=""
    139138 I +$G(PXRMIDOD)>0 S ZTSAVE("PXRMIDOD")=""
    140  S ZTSAVE("PXRMPML")=""
    141139 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXSC.m

    r628 r636  
    1 PXRMXSC ; SLC/PJH - Reminder reports service category selection ;12/18/2006
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMXSC ; SLC/PJH - Reminder reports service category selection ;11/03/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44SCAT ;Get the list of service categories.
     
    1010 D HELP^DIE(9000010,"",.07,"S","SCA")
    1111 S NSC=SCA("DIHELP")
    12  S DIR("?")=U_"D SCATHELP^PXRMXSC"
     12 S DIR("?")=" "
     13 S DIR("?",1)="The possible service categories for the report are:"
     14 S JC=0
     15 F IC=2:1:NSC D
     16 . S X=$P(SCA("DIHELP",IC)," ",1)
     17 . I PCESVC="" S PCESVC=X
     18 . E  S PCESVC=PCESVC_","_X
     19 . S JC=JC+1
     20 . S DIR("?",JC)=SCA("DIHELP",IC)
     21 S NSC=JC
    1322 S DIR("??")=U_"D SCATHELP^PXRMXSC"
    1423SCATP ;
     
    2837 ;
    2938 ;======================================================
    30 SCATHELP ;? help for service categories.
    31  N ARRAY,IC,JC,NSC,PCESVC
    32  S PCESVC=""
    33  D HELP^DIE(9000010,"",.07,"S","SCA")
    34  S NSC=SCA("DIHELP")
    35  S JC=0
    36  F IC=2:1:NSC D
    37  . S X=$P(SCA("DIHELP",IC)," ",1)
    38  . I PCESVC="" S PCESVC=X
    39  . E  S PCESVC=PCESVC_","_X
    40  . S JC=JC+1
    41  . S ARRAY(JC)=SCA("DIHELP",IC)
    42  S NSC=JC
     39SCATHELP ;?? help for service categories.
    4340 W !!,"Enter the letter(s), separated by commas, corresponding to the desired service"
    4441 W !,"category or categories. For example A,H,T,E would allow only encounters with"
    4542 W !,"service categories of ambulatory, hospitalization, telecommunications, and"
    4643 W !,"event (historical) to be included."
    47  W !!,"The possible service categories for the report are:",!
    48  F IC=1:1:NSC W !,ARRAY(IC)
    4944 Q
    5045 ;
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXSE1.m

    r628 r636  
    1 PXRMXSE1 ; SLC/PJH - Build Patient lists for Reminder Due report; 08/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMXSE1 ; SLC/PJH - Build Patient lists for Reminder Due report; 01/25/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ; Called/jobbed from PXRMXD
     
    6464 ..N DA,DIK S DA=PXRMLIS1,DIK="^PXRMXP(810.5," D ^DIK
    6565 .;Otherwise create patient list
    66  .D UPDLST^PXRMRULE("PXRMXPAT",PXRMLIS1,"","","",PXRMDPAT,PXRMTPAT)
     66 .D UPDLST^PXRMRULE("PXRMXPAT",PXRMLIS1,"","")
    6767 .S $P(^PXRMXP(810.5,PXRMLIS1,0),U,9)=1
    6868 K ^TMP($J,"PXRMXPAT")
     
    152152 ;
    153153XTMP(START) ;
    154  N CNT,CCNT,DDAT,INP,ITEM,LIT,LSSN,MCNBD,MCNBDR,NAME
    155  N SUB,STATUS,TEMP,TEMP1,TEXT
     154 N CNT,CCNT,DDAT,INP,ITEM,LIT,LSSN,MCNBD,MCNBDR,NAME,SUB,STATUS,TEMP,TEMP1
    156155 K ^TMP($J,"PXRM CNBD")
    157156 S CCNT=0,MCNBD=$G(^PXRM(800,1,"MIERR")),MCNBDR=0
     
    189188 ....I PXRMREP="D" D SDET^PXRMXDT1(DFN,STATUS,NAM,FACILITY,INP)
    190189 ....I PXRMREP="S" D SUM^PXRMXDT1(DFN,STATUS,FACILITY,NAM)
    191  I $D(^TMP($J,"PXRM CNBD"))>0 D ERRMSG^PXRMXDT1("C")
     190 I $D(^TMP($J,"PXRM CNBD"))>0 D DBDOWN^PXRMXDT1("C")
    192191 K ^TMP($J,"PXRM CNBD")
    193192 S END=$H
    194  S TEXT="Elapsed time for reminder evaluation: "_$$DETIME^PXRMXSL1(START,END)
    195  S ^XTMP(PXRMXTMP,"TIMING","REMINDER EVALUATION")=TEXT
    196  I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) W !,TEXT
     193 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DETIME^PXRMXSL1(START,END,"Evaluating Reminders")
    197194 ;I PXRMDBUG="Y" D DEBUG("DEBUG PATIENT DATA EVALUATION","DEBUG","^TMP($J,""PXRMDEBUG"")")
    198195 K ^TMP($J,"PXRM PATIENT EVAL")
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXSL1.m

    r628 r636  
    1 PXRMXSL1 ; SLC/PJH - Process Visits/Appts Reminder Due report;02/07/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMXSL1 ; SLC/PJH - Process Visits/Appts Reminder Due report;12/09/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ; Called from PXRMXSE
     
    2525 I '$D(PXRMFACN(HFAC)) Q ""
    2626 Q HFAC
    27  ;
    28 INACTCL(HLIEN,PXRMBDT) ;
    29  ;Check to see if clinic is inactivated before the start of
    30  ;the reporting period
    31  N INACT,REACT
    32  S INACT=+$P($G(^SC(HLIEN,"I")),U) I INACT=0 Q 0
    33  S REACT=+$P($G(^SC(HLIEN,"I")),U,2)
    34  I REACT'<INACT Q 0
    35  I INACT<PXRMBDT Q 1
    36  Q 0
    3727 ;
    3828INPADM ;
     
    6151 ;
    6252BHLOC ;
    63  N CLINIEN,END,FACILITY,NAM,HLIEN,I,START,TEXT
    64  N INACT,REACT
     53 N CLINIEN,END,FACILITY,NAM,HLIEN,I,START
    6554 I '(PXRMQUE!$D(IO("S"))) D INIT^PXRMXBSY(.BUSY)
    6655 ;All inpatient, outpatient all location credit stop and encounter
     
    6958 .S HLIEN=0 F  S HLIEN=$O(^SC(HLIEN)) Q:HLIEN'>0  D
    7059 ..S FACILITY=$$HFAC(HLIEN) I FACILITY'>0 Q
    71  ..I $$INACTCL(HLIEN,PXRMBDT)=1 Q
    7260 ..S NAM=$P(^SC(HLIEN,0),U)
    7361 ..I ('(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")))&(DBDOWN=0) D SPIN^PXRMXBSY("Building Hospital Locations List",.BUSY)
     
    8270 .S HLIEN=0 F  S HLIEN=$O(PXRMLOCN(HLIEN)) Q:HLIEN'>0  D
    8371 ..S FACILITY=$$HFAC(HLIEN) I FACILITY'>0 Q
    84  ..I $$INACTCL(HLIEN,PXRMBDT)=1 Q
    8572 ..S NAM=$P(^SC(HLIEN,0),U)
    8673 ..I ('(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")))&(DBDOWN=0) D SPIN^PXRMXBSY("Building Hospital Locations List",.BUSY)
     
    9178 ..S HLIEN=0 F  S HLIEN=$O(^SC("AST",CLINIEN,HLIEN)) Q:HLIEN'>0  D
    9279 ...S FACILITY=$$HFAC(HLIEN) I FACILITY'>0 Q
    93  ...I $$INACTCL(HLIEN,PXRMBDT)=1 Q
    9480 ...S NAM=$P(^DIC(40.7,CLINIEN,0),U)_" "_$P(PXRMCS($G(PXRMCSN(CLINIEN))),U,3)
    9581 ...I ('(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")))&(DBDOWN=0) D SPIN^PXRMXBSY("Building Hospital Locations List",.BUSY)
     
    10086 ..S HLIEN=0 F  S HLIEN=$O(^SC("ASCRPW",CGRPIEN,HLIEN)) Q:HLIEN'>0  D
    10187 ...S FACILITY=$$HFAC(HLIEN) I FACILITY'>0 Q
    102  ...I $$INACTCL(HLIEN,PXRMBDT)=1 Q
    10388 ...I ('(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")))&(DBDOWN=0) D SPIN^PXRMXBSY("Building Hospital Locations List",.BUSY)
    10489 ...S ^XTMP(PXRMXTMP,"HLOC",HLIEN)=FACILITY_U_$P(^SC(HLIEN,0),U)_U_CGRPIEN
    10590 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DONE^PXRMXBSY("Done")
    10691 S END=$H
    107  S TEXT="Elapsed time for building hospital locations: "_$$DETIME^PXRMXSL1(START,END)
    108  S ^XTMP(PXRMXTMP,"TIMING","BUILDING HOSPITAL LOCATIONS")=TEXT
    109  I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) W !,TEXT
    110  Q
    111  ;
    112 DETIME(START,END) ;
     92 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DETIME(START,END,"Building Hospital Locations")
     93 Q
     94 ;
     95DETIME(START,END,SECTION) ;
    11396 N ETIME,TEXT
    11497 S ETIME=$$HDIFF^XLFDT(END,START,2)
    11598 I ETIME>90 D
    11699 . S ETIME=$$HDIFF^XLFDT(END,START,3)
    117  . S TEXT=ETIME
    118  E  S TEXT=ETIME_" secs"
    119  Q TEXT
     100 . S TEXT="Elapsed time for "_SECTION_": "_ETIME
     101 E  S TEXT="Elapsed time for "_SECTION_": "_ETIME_" secs"
     102 D MES^XPDUTL(TEXT)
     103 Q
    120104 ;
    121105OERR ;
     
    145129 I '(PXRMQUE!$D(IO("S"))) D INIT^PXRMXBSY(.BUSY)
    146130 N CNT,SCDT,LIST,SCERR,SCLIST,II,PCM,NAM,PNAM,PXRM,OK
    147  N FACILITY,NAM
    148131 S SCDT("BEGIN")=PXRMSDT,SCDT("END")=PXRMSDT
    149132 ;Include patient if in team on any day in range
     
    163146 ..I PXRMPRIM="P",($$PCASSIGN^PXRMXAP(DFN)'=1) Q
    164147 ..;For detailed provider report get assoc clinic
    165  ..I PXRMREP="D" S DCLN=$P(^TMP($J,"PCM",CNT),U,7) I +$G(DCLN)>0 D
    166  ...S FACILITY=$$HFAC(DCLN)
    167  ...S NAM=$P(^SC(DCLN,0),U)
    168  ...S ^XTMP(PXRMXTMP,"HLOC",DCLN)=FACILITY_U_NAM
     148 ..I PXRMREP="D" S DCLN=$P(^TMP($J,"PCM",CNT),U,7) I $G(DCLN)'="" S ^XTMP(PXRMXTMP,"HLOC",DCLN)=""
    169149 ..I $G(DCLN)'="" S PXRMDCLN(DCLN)=""
    170150 ..D UPD1(DFN,NAM,"FACILITY",+$G(DCLN))
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXSL2.m

    r628 r636  
    1 PXRMXSL2 ; SLC/AGP - Process Visits/Appts Reminder Due report; 08/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMXSL2 ; SLC/AGP - Process Visits/Appts Reminder Due report; 06/07/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44APPTS ;
     
    66 N APPTDT,BDT,EDT,NODE,DFN,FACILITY,HLIEN,NAM
    77 S NAM="All Locations"
    8  S BDT=PXRMBDT
    9  ;I PXRMBDT["." S BDT=PXRMBDT
    10  ;E  S BDT=PXRMBDT-.0001
     8 I PXRMBDT["." S BDT=PXRMBDT
     9 E  S BDT=PXRMBDT-.0001
    1110 I PXRMEDT["." S EDT=PXRMEDT
    1211 E  S EDT=PXRMEDT+.2359
     
    4140 ;
    4241SDAM301(BD,ED,PXRMSEL,PXRMFD,PXRMREP) ;
    43  N ARRAY,BUSY,FACILITY,NAM,OPIEN,STATUS,TEXT
     42 N ARRAY,BUSY,FACILITY,NAM,OPIEN,STATUS
    4443 K ^TMP($J,"PXRM FUTURE APPT")
    4544 K ^TMP($J,"PXRM FACILITY FUTURE APPT")
     
    6463 S COUNT=$$SDAPI^SDAMA301(.ARRAY)
    6564 S END=$H
    66  S TEXT="Elapsed time for call to the Scheduling Package: "_$$DETIME^PXRMXSL1(START,END)
    67  S ^XTMP(PXRMXTMP,"TIMING","SCHEDULING")=TEXT
    68  I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) W !,TEXT
     65 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DETIME^PXRMXSL1(START,END,"Total amount of time to call the Scheduling Package")
    6966 I COUNT<0 D  Q
    7067 .N CNT
     
    7269 .F  S CNT=$O(^TMP($J,"SDAMA301",CNT)) Q:CNT'>0  D
    7370 ..S DBERR(CNT)=$G(^TMP($J,"SDAMA301",CNT))
    74  .D ERRMSG^PXRMXDT1("E")
     71 .D DBDOWN^PXRMXDT1("E")
    7572 ;
    7673LOOP ;
    7774 I PXRMFD'="P"!(PXRMSEL'="L") Q
    78  N APPTDT,CIEN,DFN,FUTDT,NODE,TEXT,VIEN
     75 N APPTDT,CIEN,DFN,FUTDT,NODE,VIEN
    7976 ;LOOP THROUGH PATIENT
    8077 S START=$H
     
    10299 S END=$H
    103100 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DONE^PXRMXBSY("Done")
    104  S TEXT="Elapsed time for sorting SDAMA301 output: "_$$DETIME^PXRMXSL1(START,END)
    105  S ^XTMP(PXRMXTMP,"TIMING","SCHEDULE SORT")=TEXT
    106  I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) W !,TEXT
     101 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DETIME^PXRMXSL1(START,END,"Sorting SDAMA301 Output")
    107102 Q
    108103 ;
    109104 ;Scan visit file to build list of patients
    110105VISITS ;
    111  N BUSY,DAS,DATE,DFN,DS,END,ETIME,HLOC,NF
    112  N SC,START,TEMP,TEXT,TGLIST,TIME
    113  S START=$H
    114  K ^TMP($J,"PXRM PATIENT LIST")
    115  I '(PXRMQUE!$D(IO("S"))) D INIT^PXRMXBSY(.BUSY)
    116  W !,"Building patient list "
    117  K ^TMP($J,"HLOCL"),^TMP($J,"PLIST")
    118  M ^TMP($J,"HLOCL")=^XTMP(PXRMXTMP,"HLOC")
    119  D FPLIST^PXRMLOCL(9000010,"HLOCL",-1,PXRMBDT,PXRMEDT,"PLIST")
    120  K ^TMP($J,"HLOCL")
    121  S DFN=""
    122  F  S DFN=$O(^TMP($J,"PLIST",DFN)) Q:DFN=""  D
    123  . S NF=0
    124  . F  S NF=$O(^TMP($J,"PLIST",DFN,NF)) Q:NF=""  D
    125  .. S TEMP=^TMP($J,"PLIST",DFN,NF)
    126  .. S SC=$P(TEMP,U,4)
    127  .. I '$D(PXRMSCAT(SC)) Q
    128  .. ;Remove test Patients
    129  .. I 'PXRMTPAT,$$TESTPAT^VADPT(DFN)=1 Q
    130  .. ;Remove deceased patients
    131  .. I 'PXRMDPAT,$P($G(^DPT(DFN,.35)),U,1)>0 Q
    132  .. S DAS=$P(TEMP,U,1),DATE=$P(TEMP,U,2),HLOC=$P(TEMP,U,3)
    133  .. S ^TMP($J,"PXRM PATIENT LIST",DFN,HLOC,DATE,DAS)=""
    134  K ^TMP($J,"PLIST")
    135  S END=$H
    136  I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DONE^PXRMXBSY("Done")
    137  S TEXT="Elapsed time for building patient list: "_$$DETIME^PXRMXSL1(START,END)
    138  S ^XTMP(PXRMXTMP,"TIMING","PATIENT LIST")=TEXT
    139  I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) W !,TEXT
    140  I PXRMREP="D" D SDAM301(PXRMBDT,PXRMEDT,PXRMSEL,PXRMFD,PXRMREP)
    141  I DBDOWN=1 Q
    142  S START=$H
    143  S BUSY=0
    144  I '(PXRMQUE!$D(IO("S"))) D INIT^PXRMXBSY(.BUSY)
    145  N HLIEN,NAM,FACILITY,LSEL,NODE
    146  S DFN=0 F  S DFN=$O(^TMP($J,"PXRM PATIENT LIST",DFN)) Q:DFN'>0  D
    147  .S HLIEN=0
    148  .F  S HLIEN=$O(^TMP($J,"PXRM PATIENT LIST",DFN,HLIEN)) Q:HLIEN'>0  D
    149  ..I ('(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")))&(DBDOWN=0) D SPIN^PXRMXBSY("Removing Invalid Encounter(s)",.BUSY)
    150  ..S NODE=$G(^XTMP(PXRMXTMP,"HLOC",HLIEN))
    151  ..S FACILITY=$P(NODE,U),NAM=$P(NODE,U,2)
    152  ..D TMP^PXRMXSL1(DFN,NAM,FACILITY,HLIEN)
    153  ..S TEMP=$P(PXRMLCSC,U,1)
    154  ..S LSEL=$S(TEMP="CS":$P(NODE,U,3),TEMP="GS":$P(NODE,U,3),1:HLIEN)
    155  ..D MARK^PXRMXSL1(LSEL)
    156  ..S ^TMP($J,"PXRM PATIENT EVAL",DFN)=""
    157  S END=$H
    158  S TEXT="Elapsed time for removing invalid encounter(s): "_$$DETIME^PXRMXSL1(START,END)
    159  S ^XTMP(PXRMXTMP,"TIMING","REMOVING INVALID ENCOUNTER(S)")=TEXT
    160  I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) W !,TEXT
    161  I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DONE^PXRMXBSY("Done")
    162  Q
    163  ;
    164 VISITSO ; Old entry point
    165106 N BTIME,DAS,DATE,DEND,DFN,DONE,DS,ETIME,HLOC,INVBD,INVDATE,INVDT,INVED
    166  N NFOUND,SC,TEMP,TEXT,TGLIST,TIME
     107 N NFOUND,SC,TEMP,TGLIST,TIME
    167108 N DOD,START,END
    168109 S START=$H
     
    175116 S INVBD=9999999-$P(PXRMBDT,".",1),BTIME=+("."_$P(PXRMBDT,".",2))
    176117 S INVED=9999999-$P(DEND,".",1),ETIME=+("."_$P(DEND,".",2))
    177  S DS=INVED-.000001
     118 S DS=INVED-1
    178119 S HLOC=""
    179120 F  S HLOC=$O(^XTMP(PXRMXTMP,"HLOC",HLOC)) Q:HLOC=""  D
     
    203144 S END=$H
    204145 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DONE^PXRMXBSY("Done")
    205  S TEXT="Elapsed time for building patient list: "_$$DETIME^PXRMXSL1(START,END)
    206  S ^XTMP(PXRMXTMP,"TIMING","PATIENT LIST")=TEXT
    207  I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) W !,TEXT
    208  I PXRMREP="D" D SDAM301(PXRMBDT,PXRMEDT,PXRMSEL,PXRMFD,PXRMREP)
    209  ;D SDAM301(PXRMBDT-.0001,PXRMEDT,PXRMSEL,PXRMFD,PXRMREP)
     146 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DETIME^PXRMXSL1(START,END,"Building Patient List")
     147 D SDAM301(PXRMBDT-.0001,PXRMEDT,PXRMSEL,PXRMFD,PXRMREP)
    210148 ;
    211149 I DBDOWN=1 Q
    212150 S START=$H
    213151 S BUSY=0
     152 I DBDOWN=1 Q
    214153 N NODE
    215154 I '(PXRMQUE!$D(IO("S"))) D INIT^PXRMXBSY(.BUSY)
     
    227166 ..S ^TMP($J,"PXRM PATIENT EVAL",DFN)=""
    228167 S END=$H
    229  S TEXT="Elapsed time for removing invalid encounter(s): "_$$DETIME^PXRMXSL1(START,END)
    230  S ^XTMP(PXRMXTMP,"TIMING","REMOVING INVALID ENCOUNTER(S)")=TEXT
    231  I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) W !,TEXT
    232168 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DONE^PXRMXBSY("Done")
     169 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DETIME^PXRMXSL1(START,END,"Removing Invalid Encounter(s)")
    233170 Q
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXTB.m

    r628 r636  
    1 PXRMXTB ; SLC/PJH - Reminder Reports Template Load ;11/27/2006
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     1PXRMXTB ; SLC/PJH - Reminder Reports Template Load ;08/01/2001
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ; Called from PXRMXD
     
    5858 S XREF("PXRMLCSC")=1.5
    5959 S XREF("PXRMFD")=1.6
    60  S XREF("PXRMPML")=1.7
    6160 S XREF("PXRMREM")=2
    6261 S XREF("PXRMFAC")=3
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXTD.m

    r628 r636  
    1 PXRMXTD ; SLC/PJH - Reminder Reports Template Display ;11/16/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMXTD ; SLC/PJH - Reminder Reports Template Display ;11/03/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ; Called from PXRMXT/PXRMXTF
     
    2424 .I $E(PXRMLCSC,2)'="A" W ! D ARRS
    2525 I DONE Q
    26  W !?PSTART,"Print Locations without Patients:",?32,$S($G(PXRMPML)=0:"NO",1:"YES")
    2726 S IC="" F  S IC=$O(PXRMRCAT(IC)) Q:IC=""  D  Q:DONE
    2827 .W !,?PSTART W:IC=1 "Category:"
     
    9594 ;form feed to new page
    9695 ;---------------------
    97 PAGE I ($E(IOST,1,2)="C-")&(IO=IO(0))&(PAGE>0) D
     96PAGE I ($E(IOST)="C")&(IO=IO(0))&(PAGE>0) D
    9897 .S DIR(0)="E"
    9998 .W !
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXTE.m

    r628 r636  
    1 PXRMXTE ; SLC/PJH - Reminder Reports Template Edit ;11/27/2006
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMXTE ; SLC/PJH - Reminder Reports Template Edit ;08/03/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ; Called from PXRMYD,PXRMXD
     
    5858 ;Report type (detail or summary)
    5959 S DR=DR_";1.4"
    60  ;Print Locations without patients
    61  S DR=DR_";1.7"
    6260 ;Reminder Categories
    6361 I $D(^PXRMPT(810.1,DA,12,0))>0 D
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXTF.m

    r628 r636  
    11PXRMXTF ; SLC/PJH - Reminder Reports Template Filing ;05/02/2002
    2  ;;2.0;CLINICAL REMINDERS;**6**;Feb 04, 2005;Build 123
     2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
    33 ;
    44 ; Called from PXRMXTA
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXTU.m

    r628 r636  
    1 PXRMXTU ; SLC/PJH - Reminder Reports Template Update ;11/27/2006
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMXTU ; SLC/PJH - Reminder Reports Template Update ;11/03/2005
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    44 ; Called from PXRMYD,PXRMXD (also at UPD from PXRMXPR/PXRMYPR)
     
    5959 ;
    6060 ;Save single fields into FDA
    61  F IC="NAME","PXRMLCSC","PXRMPRIM","PXRMREP","PXRMSEL","PXRMTYP","PXRMPML" D
     61 F IC="NAME","PXRMLCSC","PXRMPRIM","PXRMREP","PXRMSEL","PXRMTYP" D
    6262 .S FDA(810.1,MODE,XREF(IC))=$G(@IC)
    6363 F IC="PXRMFD","PXRMSCAT","RUN","TITLE" D
Note: See TracChangeset for help on using the changeset viewer.