Changeset 636 for FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM
- Timestamp:
- Dec 4, 2009, 8:26:01 PM (15 years ago)
- 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; 0 6/01/200715:262 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRM7M1 ;SLC/JVS HL7 PUT MESSAGE IN 772 FILE; 03/21/2002 ;4/11/02 15:26 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ;This routine will use the HL7 Package commands to gather the message 4 4 ;into the file 772 … … 13 13 S HLA("HLS",1)=PXRM77 14 14 D GENERATE^HLMA(HL("EID"),"GM",1,.PXRM7R,.PXRM7ID,) 15 D STORE^PXRM7API16 15 S ID=ZMID 17 16 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRM7XT.m
r628 r636 1 PXRM7XT ;SLC/JVS HL7 EXTRACT FROM FILE; 0 6/01/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRM7XT ;SLC/JVS HL7 EXTRACT FROM FILE; 03/21/2002 ;4/11/02 15:26 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ;This is the beginning of the extraction from the extract file 4 4 ; … … 7 7 Q 8 8 SPLIT ;SPLIT MESSAGES 9 ;10 9 N ORC2 11 10 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 1 PXRMAGE ; 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 3 19 ;=========================================== 4 20 AGE(DOB,DOD,DATE) ;Given a date of birth, date of death, and a date … … 6 22 ;return the age on the date of death. All dates should be in VA 7 23 ;Fileman format. 8 N CDATE 24 N CDATE,X,X1,X2,X3 9 25 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 11 30 ; 12 31 ;=========================================== 13 AGECHECK( AGE,MINAGE,MAXAGE) ;Given an AGE, MINimumAGE, and MAXimumAGE32 AGECHECK(PXRMAGE,MINAGE,MAXAGE) ;Given an AGE (with "Y", "M" or "D"), MINimumAGE, and MAXimumAGE 14 33 ;return true if age lies within the range. 15 34 ;Special values of NULL or 0 mean there are no limits. 16 35 ; 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 ; 19 45 ;See if too old. 20 I (AGE >MAXAGE)&(MAXAGE>0) Q 046 I (AGEDAYS>MAXAGE)&(MAXAGE>0) Q 0 21 47 ; 22 48 ;See if too young. 23 49 I MINAGE=0 Q 1 24 I AGE <MINAGE Q 050 I AGEDAYS<MINAGE Q 0 25 51 Q 1 26 52 ; 27 ;=========================================== 53 DECODE(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 ;====================================================================== 28 62 FMTAGE(MINAGE,MAXAGE) ;Format the minimum age and maximum age for display. 29 63 N STR … … 79 113 OVERLAP(NAR,MINA,MAXA) ;Check age ranges for overlap. Return an error message 80 114 ;if an overlap is found. 115 ;IHS/CIA/MGH Changes made to decode the ages into numeric results 81 116 I NAR'>1 Q 0 82 117 N IC,IN,JC,MAXI,MAXJ,MINI,MINJ,OVRLAP,TEXT 83 118 S OVRLAP=0 84 119 F IC=1:1:NAR-1 D 85 . S MAXI= MAXA(IC)120 . S MAXI=$$DECODE(MAXA(IC)) ; DECODE used in VOE Pediatric patients 86 121 . I MAXI="" S MAXI=1000 87 . S MINI= MINA(IC)122 . S MINI=$$DECODE(MINA(IC)) 88 123 . I MINI="" S MINI=0 89 124 . F JC=IC+1:1:NAR D 90 .. S MAXJ= MAXA(JC)125 .. S MAXJ=$$DECODE(MAXA(JC)) 91 126 .. I MAXJ="" S MAXJ=1000 92 .. S MINJ= MINA(JC)127 .. S MINJ=$$DECODE(MINA(JC)) 93 128 .. I MINJ="" S MINJ=0 94 129 .. S IN=0 … … 122 157 Q OVERLAP 123 158 ; 159 ;====================================================================== 160 RESTORE(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. ;0 9/05/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMCDUE ;SLC/PKR - Custom date due calculation routines. ;06/30/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;======================================================== … … 38 38 . S FI=$P(TEMP,U,1) 39 39 . 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")) 42 41 . 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)) 44 43 S DDUE=$P(TEMP,U,1) 45 44 I DDUE=0 Q -1 -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMCF.m
r628 r636 1 PXRMCF ; SLC/PKR - Handle computed findings. ; 07/25/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMCF ; SLC/PKR - Handle computed findings. ;12/15/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;======================================================= … … 63 63 D SSPAR^PXRMUTIL(PFINDPA(0),.NOCC,.BDT,.EDT) 64 64 S SDIR=$S(NOCC<0:+1,1:-1) 65 S NOCC=$S(NOCC<0:-NOCC,1:NOCC) 65 66 S TEST=PFINDPA(15) 66 67 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) 70 69 S TEMP=^PXRMD(811.4,ITEM,0) 71 70 S TYPE=$P(TEMP,U,5) … … 127 126 S NOCCABS=$$ABS^XLFMTH(NOCC) 128 127 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) 130 129 K ^TMP($J,TGLIST) 131 130 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/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMCOND ; SLC/PKR - Routines for evaluating conditions. ;11/01/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;============================================================ … … 79 79 S CONDS=$G(FINDPA(3)) 80 80 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)) 83 82 I COND="" Q 84 83 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. ;0 9/13/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMCOPY ; SLC/PKR,PJH - Copy various reminder files. ;05/11/2001 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;===================================================== … … 12 12 N DA,DIE,DIC,DIK,DIR,DIRUT,FDA,FIELDLEN,FILE 13 13 N IENN,IENO,IENS,MSG,NAME,ORGNAME,X,Y 14 S DIC=ROOT,DIC(0)="AE MQ",DIC("A")=PROMPT14 S DIC=ROOT,DIC(0)="AEQ",DIC("A")=PROMPT 15 15 W ! 16 16 D ^DIC … … 64 64 ; 65 65 ;===================================================== 66 COPYLL ;Copy a location list.67 N PROMPT,ROOT,WHAT68 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 Q73 ;74 ;=====================================================75 66 COPYREM ;Copy a reminder definition. 76 67 N PROMPT,ROOT,WHAT 77 68 S WHAT="reminder" 78 69 S ROOT="^PXD(811.9," 79 S PROMPT="Select the reminder definitionto copy: "70 S PROMPT="Select the reminder item to copy: " 80 71 D COPY(PROMPT,ROOT,WHAT) 81 72 Q … … 86 77 S WHAT="taxonomy" 87 78 S ROOT="^PXD(811.2," 88 S PROMPT="Select the reminder taxonomyto copy: "79 S PROMPT="Select the taxonomy item to copy: " 89 80 D COPY(PROMPT,ROOT,WHAT) 90 81 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDATA.m
r628 r636 1 PXRMDATA ; SLC/PKR - Routines for getting data. ;0 4/02/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMDATA ; SLC/PKR - Routines for getting data. ;07/17/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;=============================================== … … 13 13 I FILENUM=100 D GETDATA^PXRMORDR(DAS,.FIEVT) Q 14 14 I FILENUM=120.5 D GETDATA^PXRMVITL(DAS,.FIEVT) Q 15 I FILENUM=601. 84D GETDATA^PXRMMH(DAS,.FIEVT) Q15 I FILENUM=601.2 D GETDATA^PXRMMH(DAS,.FIEVT) Q 16 16 I FILENUM=9000010 D GETDATA^PXRMVSIT(DAS,.FIEVT,1) Q 17 17 I FILENUM=9000010.07 D GETDATA^PXRMVPOV(DAS,.FIEVT) Q … … 57 57 I ENODE="PSRX(" Q 52 58 58 I ENODE="RAMIS(71," Q 70 59 I ENODE="YTT(601 .71," Q 601.8459 I ENODE="YTT(601," Q 601.2 60 60 Q 0 61 61 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDATE.m
r628 r636 1 PXRMDATE ; SLC/PKR - Clinical Reminders date utilities. ;0 1/24/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMDATE ; SLC/PKR - Clinical Reminders date utilities. ;06/20/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;================================================== … … 48 48 ;forms as well as T-NY to a FileMan date. Also understands LAD for 49 49 ;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 54 51 ;Check for a date FileMan understands. 55 52 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/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMDBL3 ; SLC/PJH - Reminder Dialog Generation. (overflow) ;04/30/2001 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ; Called from PXRMDBL1 5 5 ; 6 6 ;Set number range for site 7 START ; 8 D SETSTART^PXRMCOPY("^PXRMD(801.41,") 7 START D SETSTART^PXRMCOPY("^PXRMD(801.41,") 9 8 ;Update dialog file for individual dialog items 10 9 D UPDATE(.ARRAY,.WPTXT,"E") … … 64 63 N RNAME,TEST,YT S YT="" 65 64 ;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) 68 66 ;Quit if no code found 69 67 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) 71 72 ;Check if valid 72 ;I TEST(1)["[ERROR]" Q 073 I TEST(1)["[ERROR]" Q 0 73 74 ; 74 75 S DNAME=FTYP_" "_YT("CODE") … … 82 83 ;Dialog item name, finding item and result 83 84 S ARRAY(CNT)=DSHORT_U_U_RESN_U 84 ;Commented out Result Group Patch 6 until a decision can be made85 85 ;Result group name 86 ;S RNAME="PXRM "_YT("CODE")_" RESULT GROUP"86 S RNAME="PXRM "_YT("CODE")_" RESULT GROUP" 87 87 ;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,"")) 89 89 ;If aims exclude from p/n 90 90 I YT("CODE")="AIMS" S $P(ARRAY(CNT),U,6)=1 … … 130 130 ..;MH fields (exclude from P/N and results pointer) 131 131 ..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) 133 133 .;Reminder dialog associated reminder/DISABLE 134 134 .I DTYPE="R" D -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDEDT.m
r628 r636 1 PXRMDEDT ; SLC/PJH - Edit PXRM reminder dialog. ; 10/18/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMDEDT ; SLC/PJH - Edit PXRM reminder dialog. ;07/28/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;Used by protocol PXRM SELECTION ADD/PXRM GENERAL ADD … … 63 63 ;Allows limited edit of national dialogs 64 64 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 Q66 65 .I $G(PXRMINST)=1,DUZ(0)="@" Q 67 66 .S DR="[PXRM EDIT NATIONAL DIALOG]",DINUSE=1 … … 276 275 .N DTYP 277 276 .S DTYP=$P($G(^PXRMD(801.41,DA,0)),U,4) 278 .;Allow limit edit of Result Elements that are not lock279 .I DTYP="T",+$P($G(^PXRMD(801.41,DA,100)),U,4)=0 Q280 277 .;Allow edit of findings but not component multiple on groups 281 278 .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.;0 1/24/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMDEV ; SLC/PKR - This is a driver for testing Clinical Reminders.;05/04/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;================================================== … … 32 32 I DFN=-1 W !,"No patient selected!" Q 33 33 S DIC=811.9,DIC("A")="Select Reminder: " 34 S DIC("S")="I $P(^PXD(811.9,Y,100),U,4)'[""L""" 34 35 D ^DIC 35 36 I $D(DIROUT)!$D(DIRUT) Q … … 67 68 S DFN=+$P(Y,U,1) 68 69 S DIC=811.9,DIC("A")="Select Reminder: " 70 S DIC("S")="I $P(^PXD(811.9,Y,100),U,4)'[""L""" 69 71 D ^DIC 70 72 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/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMDLG4 ; SLC/PJH - Reminder Dialog Edit/Inquiry ;10/31/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 WP(SUB,SUB1,WIDTH,SEQ,VALMCNT) ;Format WP text … … 22 22 W IORESET 23 23 S VALMBCK="R",NATIONAL=0 24 ;Check if national reminder dialog 24 25 I $P($G(^PXRMD(801.41,PXRMDIEN,100)),U)="N" S NATIONAL=1 25 26 S LOCK=$P($G(^PXRMD(801.41,PXRMDIEN,100)),U,4) 27 ;Dissallow editing of national dialogs 26 28 I NATIONAL,'($G(PXRMINST)=1)&(DUZ(0)="@"),$G(LOCK)'=1 D Q 27 29 .W !,"Elements may not be added to national reminder dialogs" H 2 … … 61 63 .;Get ien of prompt/component 62 64 .S DCIEN=$P($G(^PXRMD(801.41,DIEN,10,DSUB,0)),U,2) Q:'DCIEN 65 .;Ignore prompts and forced values 63 66 .I "PF"[$P($G(^PXRMD(801.41,DCIEN,0)),U,4) Q 64 67 .;Save line in workfile … … 74 77 DLINE(DIEN,LEV,DSEQ,NODE) ;Save individual component details 75 78 N CNT,DBOX,DCAP,DDIS,DMULT,DSUPP,DSHOW,DTYP,DTXT 76 N IC,RESNM,RESULT,RIEN,RNAME ,RCNT79 N IC,RESNM,RESULT,RIEN,RNAME 77 80 ;Dialog name 78 81 S DDATA=$G(^PXRMD(801.41,DIEN,0)),DNAM=$P(DDATA,U) Q:DNAM="" … … 86 89 S RNAME="",RIEN=$P($G(^PXRMD(801.41,DIEN,1)),U,3) 87 90 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) 88 94 ; 89 95 ;Group fields … … 142 148 ..S TEMP=$J("",TAB)_"Resolution: "_RNAME 143 149 ..S NLINE=NLINE+1,^TMP(NODE,$J,NLINE,0)=TEMP 144 .;Result Group145 .I VIEW=4 D146 ..S RCNT=0 F S RCNT=$O(^PXRMD(801.41,DIEN,51,RCNT)) Q:RCNT'>0 D147 ...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: "_RESNM150 ...S NLINE=NLINE+1,^TMP(NODE,$J,NLINE,0)=TEMP151 150 .;Additional findings 152 151 .D FADD(DIEN,TAB) … … 166 165 FDESC(FIEN) ;Finding description 167 166 N FGLOB,FITEM,FNUM 167 ;Determine finding type 168 168 S FGLOB=$P(FIEN,";",2) Q:FGLOB="" 169 169 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/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMDLG5 ; SLC/PJH - Reminder Dialog Edit/Inquiry ;05/17/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 ALT(DIEN,LEV,DSEQ,NODE,VIEW,NLINE,CNT,ALTLEN) ;5 ;Display branching logic text in dialog summary view6 N DATA,DNAM,DTYP,IEN,TERM,TNAME,TSTAT,TEMP7 S DATA=$G(^PXRMD(801.41,DIEN,49))8 I '+$P(DATA,U)!($P($G(DATA),U,2)="") Q9 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 D12 .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 "_TSTAT15 I $G(DNAM)'="" S TEMP="Replaced by "_DNAM_" if Reminder Term "_TNAME_" evaluates as "_TSTAT16 D TEXT(.NLINES,CNT,ALTLEN,TEMP,NODE)17 Q18 4 ; 19 5 ASK(YESNO,PIEN) ;Confirm … … 36 22 S VALMBCK="R" 37 23 Q 24 ; 25 MSEL(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 ; 29 ALT(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 ; 44 OTERM(DA) ; 45 K OTERM 46 S OTERM=$P($G(^PXRMD(801.41,DA,49)),U) Q 47 ; 48 NTERM(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 ; 56 TERMS(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 38 64 ; 39 65 BHELP(VALUE) ; … … 59 85 I VALUE=4 D 60 86 .;Patient Specific field 61 .S HTEXT(1)="Enter either 1 for true or 0 for false. This value must be set to 87 .S HTEXT(1)="Enter either 1 for true or 0 for false. This value must be set totrue" 62 88 .S HTEXT(2)="if item in this dialog will be using reminder term to either replace an item" 63 89 .S HTEXT(3)="or to suppress an item." … … 65 91 Q 66 92 ; 93 TEXT(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 ; 67 101 INQ(DIEN) ;INQ Inquiry/Print option 102 ; 68 103 ; Used by 801.41 print templates 69 104 ; [PXRM REMINDER DIALOG] … … 84 119 K ^TMP(NODE,$J) 85 120 Q 86 ;87 MH(IEN) ;Allow IEN=109 (HX2) as a place holder for 601 entries that do not88 ;have a corresponding 601.71 entry.89 I IEN=109 Q 190 I $G(PXRMINST)=1 Q 191 N MAXNUM92 S MAXNUM=+$P($G(^PXRM(800,1,"MH")),U)93 I MAXNUM=0 S MAXNUM=2594 Q $$ONECR^YTQPXRM5(IEN,MAXNUM)95 ;96 MHLICR(IEN) ;Called by input template PXRM EDIT ELEMENT. Preserve Y so template97 ;branching works.98 N Y99 ;DBIA #5042100 I $$RL^YTQPXRM3(IEN)="Y" D101 .W !,"This MH test requires a license."102 .W !,"The question text will not appear in the progress note.",!103 .H 1104 Q105 ;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 0108 Q 1109 ;110 MHREQHLP ;111 N TEXT112 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 Q126 ;127 NTERM(DA,OTERM,NTERM) ;128 I +OTERM=0 S OTERM=$P($G(DA),U)129 I +NTERM=0 K OTERM Q 2130 I +OTERM=0,+NTERM>0 K OTERM Q 1131 I +OTERM'=+NTERM K OTERM Q 0132 K OTERM133 Q 1134 ;135 OTERM(DA) ;136 K OTERM137 S OTERM=$P($G(^PXRMD(801.41,DA,49)),U)138 Q139 ;140 RESCHK(IEN) ;Called by input template PXRM EDIT ELEMENT. Preserve Y so template141 ;branching works.142 N CNT,FDA,MSG,RG,RGIEN,VALID,Y143 S CNT=0144 F S CNT=$O(^PXRMD(801.41,IEN,51,CNT)) Q:CNT'>0 D145 .S RGIEN=$P($G(^PXRMD(801.41,IEN,51,CNT,0)),U) I +RGIEN'>0 Q146 .S RG=$P($G(^PXRMD(801.41,RGIEN,0)),U,1)147 .I RG="" Q148 .S VALID=$$RGLSCR(IEN,RG,RGIEN)149 .I VALID Q150 .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=1154 .I $D(MSG) D AWRITE^PXRMUTIL("MSG")155 Q156 ;157 RSELEDIT(DA) ;158 N NODE,RESULT159 ;RESULT=0 EDIT NOTHING160 ;RESULT=1 EDIT INFORMATIONAL TEXT161 ;RESULT=2 EDIT EVERYTHING162 S RESULT=2163 I $G(PXRMINST)=1,DUZ(0)="@" Q RESULT164 S NODE=$G(^PXRMD(801.41,DA,100))165 I $P(NODE,U)="N" S RESULT=0166 I RESULT=0,+$P(NODE,U,4)=0 S RESULT=1167 Q RESULT168 ;169 RGLSCR(DA,X,IEN) ;Input transform/screen for RESULT GROUP LIST170 I $G(PXRMINST)=1 Q 1171 I $G(PXRMEXCH)=1 Q 1172 N HELP,MHTEST,TEXT,VALID,Y173 S NMATCH=0174 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+1176 ;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=1179 ;Make sure the TYPE is a result group180 I '$D(^PXRMD(801.41,"TYPE","S",IEN)) D181 . I HELP S TEXT(1)="TYPE must be a result group."182 . S VALID=0183 ;Make sure the finding item for the element matches the184 ;MH Test assigned to the Result Group185 S MHTEST=+$P($G(^PXRMD(801.41,DA,1)),U,5) I MHTEST="" D186 . I HELP S TEXT(2)="The MH test is missing."187 . S VALID=0188 I +$P($G(^PXRMD(801.41,IEN,50)),U)'=MHTEST D189 . I HELP S TEXT(3)="The finding item does not match the MH Test assigned to the Result Group"190 . S VALID=0191 ;Make sure a scale has been defined.192 I +$P($G(^PXRMD(801.41,IEN,50)),U,2)'>0 D193 . I HELP S TEXT(4)="An MH Scale must be defined."194 . S VALID=0195 ;Make sure it is not disabled.196 I $P($G(^PXRMD(801.41,IEN,0)),U,3)'="" D197 . S VALID=0198 . I HELP D199 .. N EM,TYPE200 .. 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 VALID205 ;206 TERMS(DA,X) ;207 N TERM208 S TERM=$P($G(^PXRMD(801.41,DA,49)),U)209 I +TERM=0 D Q 0210 .W !,"Cannot set Reminder Term Status if the Reminder Term field is blank"211 .H 2212 I +TERM>0,$G(X)="" Q 2213 Q 1214 ;215 TEXT(NLINES,CNT,ATLEN,TEMP,NODE) ;216 N CNT1,NOUT,OUTPUT,WIDHT217 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 D220 .S NLINE=NLINE+1,^TMP(NODE,$J,NLINE,0)=$J("",2+(CNT+ATLEN))_OUTPUT(CNT1)221 Q222 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDLGZ.m
r628 r636 1 PXRMDLGZ ; SLC/PJH - Link reminder to dialog. ;0 1/11/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMDLGZ ; SLC/PJH - Link reminder to dialog. ;05/31/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;Called by option PXRM DIALOG/COMPONENT EDIT … … 229 229 .W $C(7),!,"A taxonomy cannot be entered as the finding item for a group" 230 230 ;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 233 237 W *7,!,"This test is not appropriate for the GUI",! 234 238 Q 0 -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDLL.m
r628 r636 1 1 PXRMDLL ;SLC/PJH - REMINDER DIALOG LOADER ;09/26/2007 2 ;;2.0;CLINICAL REMINDERS;**10 ,6**;Feb 04, 2005;Build 1232 ;;2.0;CLINICAL REMINDERS;**10**;Feb 04, 2005;Build 25 3 3 ; 4 4 OK(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 7 9 ; 8 10 TXT ;Format text … … 100 102 .I $P($G(^PXRMD(801.41,DGIEN,2)),U,3) S DEXC=1 101 103 .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) 105 105 .S DRES=$P($G(^PXRMD(801.41,DGIEN,1)),U,3) 106 106 .;Done Elsewhere (historical) … … 146 146 S DARRAY("GMRD(120.51,")="VIT" 147 147 S DARRAY("ORD(101.41,")="Q" 148 S DARRAY("YTT(601 .71,")="MH"148 S DARRAY("YTT(601,")="MH" 149 149 S DARRAY("ICD9(")="POV" 150 150 S DARRAY("ICPT(")="CPT" … … 168 168 ..D REPLACE^PXRMDLLB(DFN,TERMNODE,.DITEM,.DATA,.TERMSTAT) 169 169 .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) 173 171 .K DTXT S SUB=0 174 172 .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/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMDLLA ;SLC/PJH - REMINDER DIALOG LOADER ;07/29/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 FREC(DFIEN,DFTYP) ;Build type 3 record … … 25 25 .;If mental health check if a GAF score and if MH test is required 26 26 .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 29 28 ..;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) 32 30 Q 33 31 ; … … 52 50 S DARRAY("GMRD(120.51,")="VIT" 53 51 S DARRAY("ORD(101.41,")="Q" 54 S DARRAY("YTT(601 .71,")="MH"52 S DARRAY("YTT(601,")="MH" 55 53 ; 56 54 S DARRAY("ICD9(")="POV" -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDLLB.m
r628 r636 1 PXRMDLLB ;SLC/PJH - REMINDER DIALOG LOADER ;0 5/01/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMDLLB ;SLC/PJH - REMINDER DIALOG LOADER ;07/29/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 CODE(DFIEN,DFTYP,ARRAY) ; … … 108 108 Q 109 109 ; 110 RESGROUP(DIEN) ;111 N CNT,RESULT,TEMP112 S RESULT=""113 I $$PATCH^XPDUTL("OR*3.0*243")=0 D Q RESULT114 .S RESULT=$P($G(^PXRMD(801.41,DIEN,51,1,0)),U) I RESULT="" Q115 .I $P($G(^PXRMD(801.41,RESULT,0)),U,3)'="" S RESULT="" Q116 S CNT=0 F S CNT=$O(^PXRMD(801.41,DIEN,51,CNT)) Q:CNT'>0 D117 .S TEMP=$P($G(^PXRMD(801.41,DIEN,51,CNT,0)),U) I TEMP="" Q118 .I $P($G(^PXRMD(801.41,TEMP,0)),U,3)'="" S TEMP="" Q119 .S RESULT=$S(RESULT="":TEMP,1:RESULT_"~"_TEMP)120 Q RESULT121 ;122 110 TERM(TERMIEN,DFN,IEN) ; 123 111 ;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 ;0 5/15/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMDLR ;SLC/PJH - DIALOG RESULTS LOADER ;06/09/2000 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;Build score related P/N text from score and result group 5 5 ; 6 6 ;If not found 7 START(ORY,RESULT,ORES) ;8 7 I '$G(RESULT) S ORY(1)="-1^no results for this test" Q 9 8 ; 10 N ARRAY,ERROR,INSERT,OK,SCORE,SUB,YT ,X9 N ARRAY,ERROR,INSERT,OK,SCORE,SUB,YT 11 10 ; 12 I RESULT["~" S RESULT=$P(RESULT,"~")13 11 S ERROR=0 14 12 ; 15 13 ;Get score using API 16 K ^TMP($J,"YSCOR")14 S DFN=$G(ORES("DFN")) 17 15 I ORES("CODE")'="DOM80" D Q:ERROR 18 16 .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 30 22 .I 'OK S ORY(1)="-1^[ERROR] no score returned",ERROR=1 Q 31 23 ; … … 36 28 .S SCORE=0 37 29 ; 38 S DFN=$G(ORES("DFN"))39 30 S INSERT("SCORE")=SCORE 40 31 ; … … 49 40 .F CNT=2,3,4 S INSERT("SUM"_CNT)=SUM(CNT) 50 41 ; 51 TEXT ;52 I RESULT["~" S RESULT=$P(RESULT,"~")53 42 ;Load dialog results into ORY array 54 43 N DATA,DCON,DITEM,DSEQ,DSUB,DTYP,INS,SEP,TEXT … … 83 72 Q 84 73 ; 85 MHDLL(ORES,RESULT,SCORE,DFN) ;86 S INSERT("SCORE")=SCORE87 D TEXT88 Q89 74 OUT(DATA) ;Display element details 90 75 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/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMDLR1 ; SLC/AGP - DIALOG ORPHAN REPORT. ; 02/04/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;======================================================================= … … 42 42 . W !," "_$G(NAME) S PCNT=PCNT+1 I (PCNT+1)'<IOSL D PAGE(.PCNT,.PAGE) I $G(DONE)=1 Q 43 43 I FOUND=0 W !,"No empty dialog found" 44 I ($E(IOST ,1,2)="C-")&(IO=IO(0)) D44 I ($E(IOST)="C")&(IO=IO(0)) D 45 45 . W ! 46 46 . S DIR(0)="E" D ^DIR K DIR … … 66 66 . .I (PCNT+1)'<IOSL D PAGE(.PCNT,.PAGE) I $G(DONE)=1 Q 67 67 K ^TMP("PXRMDLR1",$J) 68 I ($E(IOST ,1,2)="C-")&(IO=IO(0)) D68 I ($E(IOST)="C")&(IO=IO(0)) D 69 69 . W ! 70 70 . S DIR(0)="E" D ^DIR K DIR … … 79 79 PAGE(PCNT,PAGE) ; 80 80 N DUOUT,DTOUT,DIROUT,DIR 81 I ($E(IOST ,1,2)="C-")&(IO=IO(0)) D81 I ($E(IOST)="C")&(IO=IO(0)) D 82 82 .S DIR(0)="E" 83 83 .W ! … … 86 86 W:$D(IOF) @IOF 87 87 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) 89 89 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDNVA.m
r628 r636 1 PXRMDNVA ; SLC/PKR - Handle non-VA med findings. ;0 3/14/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMDNVA ; SLC/PKR - Handle non-VA med findings. ;05/24/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;=============================================== … … 18 18 ;==================================================== 19 19 MHVOUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the MHV output. 20 N DATE,JND,NOUT,TEMP,TEXTOUT20 N JND,NOUT,TEMP,TEXTOUT 21 21 S TEMP="Non-VA med: "_IFIEVAL("ORDERABLE ITEM")_" = " 22 22 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"))_")" 25 24 D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT) 26 25 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/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMDRGR ; SLC/PKR - Handle groups of drug findings. ;06/12/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ;Groups are drug classes or VA Generic. 4 4 ;================================================== … … 100 100 .. S IND=0 101 101 .. F S IND=+$O(FIEVT(IND)) Q:IND=0 D 102 ...;Make sure this is not already on the list103 ... I $$ONLIST(.FIEVTL,IND,.FIEVT) Q104 102 ... S NFOUND=NFOUND+1,FIEVTL(NFOUND,"DISPENSE DRUG")=DRUGIEN 105 103 ... M FIEVTL(NFOUND)=FIEVT(IND) … … 185 183 Q 186 184 ; 187 ;==================================================188 ONLIST(FIEVTL,IND,FIEVT) ;Return true if FIEVT(IND) is already on189 ;FIEVTL.190 N JND,ONLIST191 S (JND,ONLIST)=0192 F S JND=$O(FIEVTL(JND)) Q:(ONLIST)!(JND="") D193 . I FIEVTL(JND,"FILE NUMBER")'=FIEVT(IND,"FILE NUMBER") Q194 . I FIEVTL(JND,"DAS")'=FIEVT(IND,"DAS") Q195 . S ONLIST=1196 Q ONLIST197 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDRUG.m
r628 r636 1 PXRMDRUG ; SLC/PKR - Handle drug findings. ;0 4/23/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMDRUG ; SLC/PKR - Handle drug findings. ;06/08/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;=============================================== … … 114 114 ;=============================================== 115 115 EVALTERM(DFN,FINDPA,ENODE,TERMARR,TFIEVAL) ;Evaluate drug terms. 116 N DATEORDR,DRUGIEN,DTERM,DTFIEVAL,IND, JND,NOINDEX,PFINDPA,POI116 N DATEORDR,DRUGIEN,DTERM,DTFIEVAL,IND,NOINDEX,PFINDPA,POI 117 117 N RXTYL,TEMP,TFINDING,TFINDPA 118 118 N DATEORDR,NOCC,SDIR … … 159 159 .. D DORDER^PXRMTERM(.DTFIEVAL,.DATEORDR) 160 160 .. 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 164 162 Q 165 163 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEDIT.m
r628 r636 1 PXRMEDIT ; SLC/PKR - Clinical Reminder edit driver. ;0 6/04/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEDIT ; SLC/PKR - Clinical Reminder edit driver. ;05/18/2000 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 EDIT(ROOT,IENN) ;Call the appropriate edit routine. 5 ;Reminder location list6 I ROOT="^PXRMD(810.9," D EDIT^PXRMLLED(ROOT,IENN) Q7 ;8 5 ;Taxonomy 9 6 I ROOT="^PXD(811.2," D EDIT^PXRMTEDT(ROOT,IENN) Q … … 12 9 I ROOT="^PXRMD(811.5," D EDIT^PXRMTMED(ROOT,IENN) Q 13 10 ; 14 ;Reminder definition11 ;Reminder 15 12 I ROOT="^PXD(811.9," D 16 13 .;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/20062 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMENOD ; SLC/PKR - Clinical Reminders "E" node routines. ;04/17/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;======================================================== … … 30 30 ;Do not execute as part of a verify fields. 31 31 I $G(DIUTIL)="VERIFY FIELDS" Q 32 N DAS,GLOBAL,IEN ,NAME32 N DAS,GLOBAL,IEN 33 33 S IEN=$P(X,";",1) 34 34 S GLOBAL=$P(X,";",2) … … 44 44 S DAS=IEN 45 45 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)="" 49 48 Q 50 49 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEPM.m
r628 r636 1 PXRMEPM ; SLC/PKR/PJH - Extract Definition Management ;0 7/17/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMEPM ; SLC/PKR/PJH - Extract Definition Management ;06/21/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;Main entry point for PXRM EXTRACT DEFINITIONS … … 13 13 K ^TMP("PXRMEPM",$J) 14 14 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) 16 20 Q 17 21 ; … … 61 65 .W $C(7),!,"Only one item number allowed." H 2 62 66 .S VALMBCK="R" 63 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@(" SEL",SEL))) D Q67 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("IDX",SEL))) D Q 64 68 .W $C(7),!,SEL_" is not a valid item number." H 2 65 69 .S VALMBCK="R" 66 70 ; 67 71 ;Get the list ien. 68 S IEN=^TMP("PXRMEPM",$J," SEL",SEL)72 S IEN=^TMP("PXRMEPM",$J,"IDX",SEL,SEL) 69 73 ;Display/Edit Extract Definition 70 74 D START^PXRMEPED(IEN) … … 82 86 ; 83 87 EPADD ;Add Rule Option 88 ; 84 89 ;Reset Screen Mode 85 90 W IORESET … … 90 95 ;Rebuild Workfile 91 96 D BLDLIST 97 ; 92 98 S VALMBCK="R" 93 99 Q … … 103 109 F S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE) D 104 110 .;Get the ien. 105 .S LRIEN=^TMP("PXRMEPM",$J," SEL",IND)111 .S LRIEN=^TMP("PXRMEPM",$J,"IDX",IND,IND) 106 112 .D START^PXRMEPED(LRIEN) 107 113 D BLDLIST -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMETCO.m
r628 r636 1 PXRMETCO ; SLC/PJH - QUERI Extract Compliance Report ;0 3/27/20072 ;;2.0;CLINICAL REMINDERS; **4,6**;Feb 04, 2005;Build 1231 PXRMETCO ; SLC/PJH - QUERI Extract Compliance Report ;01/19/2005 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ; … … 33 33 S LIST=NAME_" REPORT "_DATES 34 34 ;Process (single) Denominator rule into patient list 35 N INDP,INTP,SEQ,SUB,SUFFIX35 N SEQ,SUB,SUFFIX 36 36 S SEQ="" 37 37 F S SEQ=$O(^PXRM(810.2,IEN,10,"B",SEQ)) Q:'SEQ D … … 41 41 .S SUFFIX=$P(DATA,U,3) 42 42 .I SUFFIX="" S SUFFIX="DENOMINATOR "_SEQ 43 .S INDP=+$P(DATA,U,4)44 .S INTP=+$P(DATA,U,5)45 43 .;Create new patient list 46 .S PXRMLIST=$$CRLST^PXRMRUL 1(LIST_" "_SUFFIX) Q:'PXRMLIST47 .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,"","") 48 46 .;Clear ^TMP lists created for rule 49 47 .D CLEAR^PXRMRULE(PXRMRULE,PXRMNODE) … … 120 118 W !,"Queue the Clinical Reminders MST synchronization." 121 119 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")_" " 124 121 S DIR(0)="DAU"_U_MINDT_"::RSX" 125 122 D ^DIR -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMETH.m
r628 r636 1 PXRMETH ; SLC/PJH - Reminder Extract History ; 10/11/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMETH ; SLC/PJH - Reminder Extract History ;08/15/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;Main entry point for PXRM EXTRACT HISTORY 5 START(EDIEN) ; 6 ;EDIEN is the extract definition IEN. 5 START(IEN) ; 7 6 N VALMBCK,VALMCNT,VALMSG,X,XMZ,XQORM,XQORNOD 8 7 ;Details of last run 9 8 N DATA,NPERIOD,NSDATE,NTAS,PXRMVIEW 10 S DATA=$G(^PXRM(810.2, EDIEN,0))9 S DATA=$G(^PXRM(810.2,IEN,0)) 11 10 S NPERIOD=$P(DATA,U,6),NSDATE=$P(DATA,U,7) 12 11 ;Default view is in date created order … … 18 17 Q 19 18 ; 20 DELETE ;Delete an extract, called by protocol PXRM EXTRACT SUMMARY DELETE.21 N CLASS,IEN,IENLIST,IND22 S IENLIST=$$LMSEL23 F IND=1:1:$L(IENLIST,U) D24 .S IEN=$P(IENLIST,U,IND)25 .D DELETE^PXRMETXU(IEN)26 ;Rebuild workfile27 D BLDLIST^PXRMETH1(EDIEN)28 ;Refresh29 S VALMBCK="R"30 Q31 ;32 19 ENTRY ;Entry code 33 D BLDLIST^PXRMETH1( EDIEN),XQORM20 D BLDLIST^PXRMETH1(IEN),XQORM 34 21 Q 35 22 ; … … 42 29 Q 43 30 ; 44 EXTRACT(EDIEN) ;Run Extract/Transmission 31 HDR ; 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 ; 41 HLP ;Help code 42 N ORU,ORUPRMT,SUB,XQORM 43 S SUB="PXRMETHH" 44 D EN^VALM("PXRM EXTRACT HELP") 45 Q 46 ; 47 INIT ;Init 48 S VALMCNT=0 49 Q 50 ; 51 PEXIT ;PXRM EXCH MENU protocol exit code 52 S VALMSG="+ Next Screen - Prev Screen ?? More Actions" 53 D XQORM 54 Q 55 ; 56 XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXTRACT HISTORY SELECT ENTRY",0))_U_"1:"_VALMCNT 57 S XQORM("A")="Select Item: " 58 Q 59 ; 60 XSEL ;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 ; 113 EXTRACT(IEN) ;Run Extract/Transmission 114 ; 45 115 ;Reset screen mode 46 116 W IORESET … … 51 121 N ANS,DATA,DUOUT,DTOUT,EDATE,EXSUMPUG,FREQ,MODE 52 122 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) 55 125 ;Determine Extract Name and Frequency 56 126 S NAME=$P(DATA,U),FREQ=$P(DATA,U,3),NEXT=$P(DATA,U,6),RTN="PXRMETX" … … 93 163 N ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE 94 164 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")="" 97 167 S ZTSAVE("MODE")="" 98 168 S ZTSAVE("NEXT")="" … … 117 187 D ^%ZTLOAD 118 188 W !,"Task number ",ZTSK," queued." H 2 189 ; 119 190 S VALMBCK="Q" 120 191 Q 121 192 ; 122 HDR ; Header code123 N VIEW124 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: "_NPERIOD127 S VALMHDR(4)=" Scheduled to Run: "_$$FMTE^XLFDT(NSDATE,"5Z")128 S VALMHDR(4)=$$LJ^XLFSTR(VALMHDR(4),45)_" View: "_VIEW129 S VALMSG="+ Next Screen - Prev Screen ?? More Actions"130 Q131 ;132 HLP ;Help code133 N ORU,ORUPRMT,SUB,XQORM134 S SUB="PXRMETHH"135 D EN^VALM("PXRM EXTRACT HELP")136 Q137 ;138 INIT ;Init139 S VALMCNT=0140 Q141 ;142 LMSEL() ;Return selection list143 N IENLIST,IND,VALMY,XIEN144 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) D150 .;Get the ien.151 .S XIEN=^TMP("PXRMETH",$J,"SEL",IND)152 .S IENLIST=$S(IENLIST'="":IENLIST_U_XIEN,1:XIEN)153 Q IENLIST154 ;155 PEXIT ;PXRM EXCH MENU protocol exit code156 S VALMSG="+ Next Screen - Prev Screen ?? More Actions"157 D XQORM158 Q159 ;160 193 SELECT(FREQ,SEL) ;Select extract period 194 ; 161 195 N BDATE,EDATE,DA,DIE,DIK,DIR,DR,FDATE,VALID,X 162 196 ;Get the new name. … … 184 218 Q 185 219 ; 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" 220 TLIST ;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 ; 193 233 S VALMBCK="R" 194 234 Q 195 235 ; 196 236 TRANS ;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 203 248 .;Transmit extract summary 204 249 .N ANS,DUOUT,DTOUT,RTN,TEXT 205 250 .S TEXT="Transmit this extract to AAC",ANS="",RTN="PXRMETH" 206 251 .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) 208 253 ; 209 254 ;Rebuild workfile 210 D BLDLIST^PXRMETH1( EDIEN)255 D BLDLIST^PXRMETH1(IEN) 211 256 ;Refresh 212 257 S VALMBCK="R" … … 214 259 ; 215 260 TRHIST ;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 ; 221 273 S VALMBCK="R" 222 274 Q … … 241 293 ; 242 294 VIEW ;Select view 295 ; 243 296 W IORESET 244 S VALMBCK="R" 297 ; 298 S VALMBCK="R" 299 ; 245 300 N X,Y,CODE,DIR 246 301 K DIROUT,DIRUT,DTOUT,DUOUT … … 259 314 ; 260 315 ;Rebuild Workfile 261 D BLDLIST^PXRMETH1( EDIEN),HDR316 D BLDLIST^PXRMETH1(IEN),HDR 262 317 Q 263 318 ; … … 273 328 W !!,"WARNING -This period is not complete until "_FDATE 274 329 Q 275 XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXTRACT HISTORY SELECT ENTRY",0))_U_"1:"_VALMCNT276 S XQORM("A")="Select Item: "277 Q278 ;279 XSEL ;PXRM EXTRACT HISTORY SELECT ENTRY validation280 N SEL,PXRMSIEN281 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 selection285 I SEL["," D Q286 .W $C(7),!,"Only one item number allowed." H 2287 .S VALMBCK="R"288 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("SEL",SEL))) D Q289 .W $C(7),!,SEL_" is not a valid item number." H 2290 .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 mode297 D FULL^VALM1298 ;299 ;Options300 N X,Y,DIR,OPTION K DIROUT,DIRUT,DTOUT,DUOUT301 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 DIR310 I $D(DIROUT) S DTOUT=1311 I $D(DTOUT)!($D(DUOUT)) S VALMBCK="R" Q312 S OPTION=Y313 ;314 ;Delete an extract315 I OPTION="DE" D316 .D DELETE^PXRMETXU(PXRMSIEN)317 .;Rebuild workfile318 .D BLDLIST^PXRMETH1(PXRMSIEN)319 .;Refresh320 .S VALMBCK="R"321 ;322 ;Display Extract Summary323 I OPTION="ES" D START^PXRMETT(PXRMSIEN)324 ;325 ;Transmission option326 I OPTION="MT" D327 .N ANS,DUOUT,DTOUT,RTN,TEXT328 .I $P($G(^PXRMXT(810.3,PXRMSIEN,100)),U)'="N" D Q329 ..W !,"Local extracts cannot be transmitted to AAC" H 2 Q330 .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 History335 I OPTION="TH" D START^PXRMETHL(PXRMSIEN)336 ;337 S VALMBCK="R"338 Q339 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMETH1.m
r628 r636 1 PXRMETH1 ; SLC/PJH - Reminder Extract History ;0 9/07/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMETH1 ; SLC/PJH - Reminder Extract History ;07/24/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 BLDLIST(EDIEN) ;Build workfile 5 ;EDIEN is the extract definition IEN. 6 N IND,FMTSTR,PLIST 4 BLDLIST(IEN) ;Build workfile 5 N IND,PLIST 7 6 K ^TMP("PXRMETH",$J) 8 S FMTSTR=$$LMFMTSTR^PXRMTEXT(.VALMDDF,"RLL")9 7 ;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) 11 9 ;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) 25 17 Q 26 18 ; … … 28 20 N HTEXT 29 21 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." 34 25 ; 35 26 I CALL=3 D … … 41 32 Q 42 33 ; 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 34 LIST1(LIST,IEN) ;Build a list of extract summaries for a parameter. 35 N AUTO,EDATE,HL7ID,HL7SUB,IND,NAME,PERIOD,XDATE,YEAR 46 36 ;Build list of extract summaries in reverse date order. 47 S YEAR="9999", (NUM,VALMCNT)=048 F S YEAR=$O(^PXRMXT(810.3,"D", EDIEN,YEAR),-1) Q:YEAR="" D37 S YEAR="9999",VALMCNT=0 38 F S YEAR=$O(^PXRMXT(810.3,"D",IEN,YEAR),-1) Q:YEAR="" D 49 39 .S PERIOD="99" 50 .F S PERIOD=$O(^PXRMXT(810.3,"D", EDIEN,YEAR,PERIOD),-1) Q:PERIOD="" D40 .F S PERIOD=$O(^PXRMXT(810.3,"D",IEN,YEAR,PERIOD),-1) Q:PERIOD="" D 51 41 ..S IND="" 52 ..F S IND=$O(^PXRMXT(810.3,"D", EDIEN,YEAR,PERIOD,IND),-1) Q:IND="" D42 ..F S IND=$O(^PXRMXT(810.3,"D",IEN,YEAR,PERIOD,IND),-1) Q:IND="" D 53 43 ...S NAME=$P($G(^PXRMXT(810.3,IND,0)),U) 54 44 ...S EDATE=$P($G(^PXRMXT(810.3,IND,0)),U,6) … … 59 49 ...I HL7SUB S XDATE=$P($G(^PXRMXT(810.3,IND,5,HL7SUB,0)),U,2) 60 50 ...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 67 55 Q 68 56 ; 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 57 LIST2(LIST,IEN) ;Build a list of extract summaries for a parameter. 58 N AUTO,EDATE,HL7ID,HL7SUB,IND,NAME,PERIOD,XDATE,YEAR 72 59 ;Build list of extract summaries in reverse date order. 73 S EDATE="", (NUM,VALMCNT)=074 F S EDATE=$O(^PXRMXT(810.3,"C", EDIEN,EDATE),-1) Q:'EDATE D60 S EDATE="",VALMCNT=0 61 F S EDATE=$O(^PXRMXT(810.3,"C",IEN,EDATE),-1) Q:'EDATE D 75 62 .S IND="" 76 .F S IND=$O(^PXRMXT(810.3,"C", EDIEN,EDATE,IND)) Q:'IND D77 ..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) 78 65 ..S AUTO=$P($G(^PXRMXT(810.3,IND,4)),U,5) 79 66 ..S AUTO=$S(AUTO="A":"Y",1:"N") … … 82 69 ..I HL7SUB S XDATE=$P($G(^PXRMXT(810.3,IND,5,HL7SUB,0)),U,2) 83 70 ..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 90 75 Q 91 76 ; 77 FRE(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 ;0 9/06/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMETM ; SLC/PKR/PJH - Extract/Transmission Management ;05/15/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;Main entry point for PXRM EXTRACT MANAGEMENT … … 15 15 K ^TMP("PXRMETM",$J) 16 16 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) 18 22 Q 23 ; 24 LIST(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 ; 39 FRE(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 19 48 ; 20 49 ENTRY ;Entry code … … 30 59 Q 31 60 ; 32 FMT(NUMBER,NAME,CLASS) ;Format entry number, name33 ;and date packed.34 N TCLASS,TEMP,TNAME,TSOURCE35 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_" "_TCLASS40 Q TEMP41 ;42 GEN ;Ad hoc report option43 ;Reset Screen Mode44 W IORESET45 ;46 N IND,LISTIEN,VALMY47 D EN^VALM2(XQORNOD(0))48 ;If there is no list quit.49 I '$D(VALMY) Q50 S PXRMDONE=051 S IND=""52 F S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE) D53 .;Get the ien.54 .S LISTIEN=^TMP("PXRMETM",$J,"SEL",IND)55 .D GENSEL(LISTIEN)56 ;57 S VALMBCK="R"58 Q59 ;60 GENSEL(IEN) ;Report for selected extract definition61 N ANS,BEGIN,END,RTN,TEXT62 D DATES^PXRMEUT(.BEGIN,.END,"Report")63 ;Options64 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 Report67 D ADHOC^PXRMETCO(IEN,BEGIN,END)68 Q69 ;70 61 HDR ; Header code 71 62 S VALMHDR(1)="Available Extract Definitions:" 72 63 S VALMSG="+ Next Screen - Prev Screen ?? More Actions" 73 Q74 ;75 HELP(CALL) ;General help text routine76 N HTEXT77 I CALL=1 D78 .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 Q83 ;84 HLIST ;Extract History85 N IND,LISTIEN,VALMY86 D EN^VALM2(XQORNOD(0))87 ;If there is no list quit.88 I '$D(VALMY) Q89 S PXRMDONE=090 S IND=""91 F S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE) D92 .;Get the ien.93 .S LISTIEN=^TMP("PXRMETM",$J,"SEL",IND)94 .D START^PXRMETH(LISTIEN)95 S VALMBCK="R"96 64 Q 97 65 ; … … 106 74 Q 107 75 ; 108 LIST(NODE,VALMCNT) ;Build a list of extract definition entries.109 N EPCLASS,IND,FNAME,NAME110 ;Build the list in alphabetical order.111 S VALMCNT=0112 S NAME=""113 F S NAME=$O(^PXRM(810.2,"B",NAME)) Q:NAME="" D114 .S IND=$O(^PXRM(810.2,"B",NAME,"")) Q:'IND115 .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+1118 .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)=IND121 Q122 ;123 76 PEXIT ;Protocol exit code 124 77 S VALMSG="+ Next Screen - Prev Screen ?? More Actions" 125 78 ;Reset after page up/down etc 126 79 D XQORM 127 Q128 ;129 PLIST ;Extract Definition Inquiry130 N IND,EPIEN,VALMY131 D EN^VALM2(XQORNOD(0))132 ;If there is no list quit.133 I '$D(VALMY) Q134 S PXRMDONE=0135 S IND=""136 F S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE) D137 .;Get the ien.138 .S EPIEN=^TMP("PXRMETM",$J,"SEL",IND)139 .D START^PXRMEPED(EPIEN)140 S VALMBCK="R"141 80 Q 142 81 ; … … 146 85 ; 147 86 XSEL ;PXRM EXTRACT MANAGEMENT SELECT ENTRY validation 148 N EDIEN,SEL87 N SEL,IEN 149 88 S SEL=$P(XQORNOD(0),"=",2) 150 89 ;Remove trailing , … … 154 93 .W $C(7),!,"Only one item number allowed." H 2 155 94 .S VALMBCK="R" 156 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@(" SEL",SEL))) D Q95 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("IDX",SEL))) D Q 157 96 .W $C(7),!,SEL_" is not a valid item number." H 2 158 97 .S VALMBCK="R" 159 98 ; 160 99 ;Get the list ien. 161 S EDIEN=^TMP("PXRMETM",$J,"SEL",SEL)100 S IEN=^TMP("PXRMETM",$J,"IDX",SEL,SEL) 162 101 ; 163 102 ;Full screen mode … … 178 117 ; 179 118 ;Display Extract Definitions 180 I OPTION="EDM" D START^PXRMEPED(EDIEN) 119 I OPTION="EDM" D 120 .D START^PXRMEPED(IEN) 181 121 ; 182 122 ;Examine/Run Extract 183 I OPTION="VSE" D START^PXRMETH(EDIEN) 123 I OPTION="VSE" D 124 .D START^PXRMETH(IEN) 184 125 ; 185 126 ;Examine/Run Extract 186 I OPTION="ERE" D GENSEL(EDIEN) 127 I OPTION="ERE" D 128 .D GENSEL(IEN) 187 129 ; 188 130 S VALMBCK="R" 189 131 Q 190 132 ; 133 HELP(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 ; 143 GEN ;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 ; 162 GENSEL(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 ; 172 HLIST ;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 ; 186 PLIST ;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/P JH - Extract Summary Display ;04/09/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1233 ; 4 ;Main entry point for PXRM EXTRACT SUMMARY1 PXRMETT ; 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 5 5 START(IEN) N TOGGLE,TOGGLE1,VALMBCK,VALMBG,VALMCNT,VALMSG,X,XMZ,XQORM,XQORNOD 6 6 S X="IORESET" … … 11 11 ; 12 12 BLDLIST(IEN,FINDINGS,PATIENT) ;Build workfile. 13 ;FINDINGS=1 means display finding totals14 13 K ^TMP("PXRMETT",$J) 15 14 ;Build a list of extract summary totals. 16 15 N APPL,DATA,DUE,IND,LIST,NDUE,NAPPL,OLIST 17 N PLCNT,PLIST,RIEN,RNAME,SARRAY,S EQ,SNAME,STATION,TOT16 N PLCNT,PLIST,RIEN,RNAME,SARRAY,SNAME,STATION,TOT 18 17 ;Build the list in alphabetical order. 19 S VALMCNT=0,OLIST="",PLCNT=020 S IND=0 F S IND=$O(^PXRMXT(810.3,IEN,3,IND)) Q:IND'>0D18 S IND=0,VALMCNT=0,OLIST="",PLCNT=0 19 F S IND=$O(^PXRMXT(810.3,IEN,3,IND)) Q:'IND D 21 20 .S DATA=$G(^PXRMXT(810.3,IEN,3,IND,0)) Q:DATA="" 22 21 .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) 25 23 .S STATION=$P(DATA,U,3),SARRAY="" 26 24 .D GETS^DIQ(4,STATION,99,"E","SARRAY") … … 31 29 .S PLIST=$P(DATA,U,4) 32 30 .I PLIST,PLIST'=OLIST D 33 ..I PLCNT>0 D34 ...S VALMCNT=VALMCNT+135 ...S ^TMP("PXRMETT",$J,VALMCNT,0)=""36 ...S ^TMP("PXRMETT",$J,"IDX",VALMCNT,PLCNT)=""37 31 ..S PLNAME=$P($G(^PXRMXP(810.5,PLIST,0)),U),OLIST=PLIST Q:PLNAME="" 38 32 ..S VALMCNT=VALMCNT+1,PLCNT=PLCNT+1 … … 40 34 ..S ^TMP("PXRMETT",$J,"SEL",PLCNT)=PLIST 41 35 ..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)="" 42 39 .S VALMCNT=VALMCNT+1 43 40 .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)="" 44 44 .S ^TMP("PXRMETT",$J,"IDX",VALMCNT,PLCNT)="" 45 45 .;Finding totals … … 47 47 ; 48 48 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 61 50 Q 62 51 ; … … 91 80 Q 92 81 ; 82 PBLD(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 ; 93 101 FLIST ;Toggle list with/without finding totals 94 102 S TOGGLE=(TOGGLE+1)#2 95 103 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 ; 110 PLIST1 ;Toggle list with/without finding totals 111 S TOGGLE1=(TOGGLE1+1)#2 96 112 ;Rebuild Workfile 97 113 D BLDLIST(IEN,TOGGLE,TOGGLE1) … … 125 141 Q TEMP 126 142 ; 143 ENTRY ;Entry code 144 D BLDLIST(IEN,TOGGLE,TOGGLE1),XQORM 145 Q 146 ; 147 EXIT ;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 ; 127 155 HDR ; Header code 128 156 S VALMHDR(1)="Extract Summary Name: "_$P($G(^PXRMXT(810.3,IEN,0)),U) 129 157 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") 130 158 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") 131 160 S VALMSG="+ Next Screen - Prev Screen ?? More Actions" 132 161 Q … … 142 171 Q 143 172 ; 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)="" 173 XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXTRACT SUMMARY SELECT ENTRY",0))_U_"1:"_VALMCNT 174 S XQORM("A")="Select Item: " 175 Q 176 ; 177 XSEL ;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" 161 196 Q 162 197 ; … … 178 213 .S PLIEN=^TMP("PXRMETT",$J,"SEL",IND) 179 214 .D START^PXRMLPP(PLIEN) 215 ; 180 216 S VALMBCK="R" 181 217 Q 182 ;183 PLIST1 ;Toggle list with/without finding totals184 S TOGGLE1=(TOGGLE1+1)#2185 ;Rebuild Workfile186 D BLDLIST(IEN,TOGGLE,TOGGLE1)187 ;Refresh188 S VALMBCK="R",VALMBG=1189 Q190 ;191 XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXTRACT SUMMARY SELECT ENTRY",0))_U_"1:"_VALMCNT192 S XQORM("A")="Select Item: "193 Q194 ;195 XSEL ;PXRM EXTRACT TOTALS SELECT ENTRY validation196 N SEL,PLIEN197 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 selection201 I SEL["," D Q202 .W $C(7),!,"Only one item number allowed." H 2203 .S VALMBCK="R"204 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("SEL",SEL))) D Q205 .W $C(7),!,SEL_" is not a valid item number." H 2206 .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 Q212 ; -
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 1 PXRMETX ; 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 3 19 ; 4 20 AUTO(ID,PURGE) ;Called from option scheduling (#19.2) … … 18 34 ;Purge Patient Lists 19 35 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")) 20 38 Q 21 39 ; … … 53 71 Q 54 72 ; 73 ACAD ;Auto CAD entry point 74 D AUTO("VOE DOQ-IT CAD EXTRACTION") 75 Q 76 ; 77 ADM ;Auto DM entry point 78 D AUTO("VOE DOQ-IT DM EXTRACTION") 79 Q 80 ; 81 AHF ;Auto HF entry point 82 D AUTO("VOE DOQ-IT HF EXTRACTION") 83 Q 84 ; 85 AHTN ;Auto HTN entry point 86 D AUTO("VOE DOQ-IT HTN EXTRACTION") 87 Q 88 ; 89 APC ;Auto PC entry point 90 D AUTO("VOE DOQ-IT PC EXTRACTION") 91 Q 92 ; 55 93 RUN(IEN,NEXT,MODE,PURGE) ;Process extract parameter 56 94 ; IEN is ien of Extract Parameter … … 62 100 ; 63 101 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 66 103 ;Initialise 67 104 K ^TMP("PXRMETX",$J),^TMP("PXRMETX1",$J) … … 83 120 ;Determine output name for patient list and extract summary 84 121 S XNAME=NAME_" "_YEAR_" "_PERIOD 85 S NAME=$$GETNAME(XNAME)86 S ITER=$P(NAME,"/",2)87 122 ;Process (single) Denominator rule into patient list 88 123 N SEQ,SUB … … 98 133 .S INTP=+$P(DATA,U,5) 99 134 .;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 102 136 .; 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) 104 138 .;Clear ^TMP lists created for rule 105 139 .D CLEAR^PXRMRULE(PXRMRULE,PXRMNODE) 106 140 .;Process reminders and finding rules 107 .;If include deceased patients is true then set the flag so reminders108 .;will be evaluated for deceased patients.109 .S PXRMIDOD=$S(INDP:1,1:0)110 141 .D REM^PXRMETXR(SUB,PXRMLIST,PXRMSTRT,PXRMSTOP,PARTYPE) 111 142 ; 112 143 ;Get the name 113 ;S NAME=$$GETNAME(XNAME)144 S NAME=$$GETNAME(XNAME) 114 145 ;Create extract summary entry 115 146 S FDA(810.3,"+1,",.01)=NAME … … 133 164 ;Transmit results 134 165 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) 135 168 ; 136 169 ;Update extract parameters -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMETXR.m
r628 r636 1 PXRMETXR ; SLC/PJH,PKR - Reminder section of extract ;0 2/22/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMETXR ; SLC/PJH,PKR - Reminder section of extract ;05/01/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ; Called from PXRMETX … … 115 115 ;lists. 116 116 N APPL,DATA,DEFARR,DEFSITE,DFN,DUE,FIEV,FRIEN,FUTIL,IND,INST 117 N PXRMDATE,RCNT,REM,R EMSEQ,RIEN,RNAM,STATUS,SUB1,TODAY117 N PXRMDATE,RCNT,REM,RIEN,RNAM,STATUS,SUB1,TODAY 118 118 N END,START 119 119 ;S START=$H … … 123 123 ;Scan reminders for this parameter set 124 124 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) 144 141 ; 145 142 ;Process patient list -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMETXU.m
r628 r636 1 PXRMETXU ; SLC/PJH - Extract utilities ;0 9/06/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMETXU ; SLC/PJH - Extract utilities ;08/03/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 HELP(CALL) ;General help text routine … … 13 13 I CALL=4 D 14 14 .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" 16 16 .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." 18 18 ; 19 19 D HELP^PXRMEUT(.HTEXT) 20 Q21 ;22 DELETE(IEN) ;Delete an extract summary.23 I IEN="" Q24 N DA,DELOK,DIK,NAME25 S DELOK=126 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" D29 . S DELOK=$S($D(^XUSEC("PXRM MANAGER",DUZ)):1,1:0)30 . I 'DELOK D31 .. W !!,NAME," is national."32 .. W !,"You cannot delete a national extract summary."33 .. H 234 I 'DELOK Q35 ;Double check the user really wants to delete.36 S TEXT="Are you sure you want to delete "_NAME37 S DELOK=$$ASKYN^PXRMEUT("N","Are you sure you want to delete "_NAME)38 I 'DELOK Q39 S DA=IEN40 S DIK="^PXRMXT(810.3,"41 D ^DIK42 W !,"Deleting ",NAME43 H 244 20 Q 45 21 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEUT.m
r628 r636 1 PXRMEUT ; SLC/PJH - General extract utilities ;0 9/06/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMEUT ; SLC/PJH - General extract utilities ;06/27/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;================================================= … … 162 162 ; 163 163 ;================================================= 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) 164 HELP(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") 171 178 W ! 172 179 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEUT1.m
r628 r636 1 PXRMEUT1 ; SLC/PKR - General extract utilities ;0 5/08/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMEUT1 ; SLC/PKR - General extract utilities ;08/09/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ;================================================= 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 4 DCONV(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) 24 10 ; 25 11 ;================================================= … … 36 22 ; 37 23 ;================================================= 38 DCONV(DATE,LBBDT,LBEDT) ;Convert dates to actual values.39 I DATE=0 Q DATE40 N PXRMDATE41 S PXRMDATE=$S(DATE["BDT":LBBDT,1:LBEDT)42 S DATE=$$STRREP^PXRMUTIL(DATE,"BDT","T")43 Q $$CTFMD^PXRMDATE(DATE)44 ;45 ;=================================================46 24 DOCDATES(RULESET,LBBDT,LBEDT,NL,OUTPUT) ; 47 N EM,FRACT,FRDATA,FRDATES,FRIEN,FRLST,FRLIEN,FROLST,FROUT,FRPAT48 N FRPERM,FRSTRT,FRTIEN,FRTYP,FSEQ, OPER,PXRMFVPL25 N FINDPA,FRACT,FRDATA,FRDATES,FRIEN,FRLST,FRLIEN,FROLST,FROUT,FRPAT 26 N FRPERM,FRSTRT,FRTIEN,FRTYP,FSEQ,PXRMDATE,PXRMFVPL 49 27 N RRIEN,RSDATA,RSDATES,RBDT,REDT,SEQ,SUB 50 I $G(PXRMDDOC)=2 D CLDATES51 28 ;Build the variable pointer list. 52 29 D BLDRLIST^PXRMVPTR(811.902,.01,.PXRMFVPL) … … 55 32 . S SUB=$O(^PXRM(810.4,RULESET,30,"B",SEQ,"")) Q:'SUB 56 33 . 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)59 34 . S RSDATES=$G(^PXRM(810.4,RULESET,30,SUB,1)) 60 35 .;Finding rule ien. … … 69 44 .;Determine RBDT and REDT 70 45 . 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 71 48 . S NL=NL+1,OUTPUT(NL)="" 72 49 . S NL=NL+1,OUTPUT(NL)="SEQUENCE "_SEQ_" "_$P(FRDATA,U,1) 73 . S NL=NL+1,OUTPUT(NL)=" Operation: "_OPER74 50 .;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) 76 52 .;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) 78 54 Q 79 55 ; 80 56 ;================================================= 81 FMULPRT( FARR,PXRMFVPL,NL,OUTPUT) ;Print the finding multiple57 FMULPRT(DEFARR,FINDPA,PXRMFVPL,NL,OUTPUT) ;Print the finding multiple 82 58 ;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 85 60 S IND=0 86 F S IND=+$O( FARR(20,IND)) Q:IND=0 D87 . 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) 88 63 . S FNAME=$$ENTRYNAM^PXRMPTD2(VPTR) 89 64 . S FTYPE=$$FTYPE^PXRMPTD2(VPTR,1) 90 65 . S NL=NL+1,OUTPUT(NL)=" FINDING "_IND_"-"_FTYPE_"."_FNAME 66 . K PFINDPA,TFINDPA 67 . M TFINDPA=DEFARR(20,IND) 91 68 .;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) 93 71 . S NL=NL+1,OUTPUT(NL)=" Beginning Date/Time: "_$$FMTE^XLFDT(BDT,"5Z") 94 72 . S NL=NL+1,OUTPUT(NL)=" Ending Date/Time: "_$$FMTE^XLFDT(EDT,"5Z") 95 . I $G(PXRMDDOC)'=2 Q96 . S DERROR=097 . 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 check99 .;cannot be made100 . I TEMP="" Q101 . I $P(TEMP,U,1)'=BDT D102 .. S DERROR=1103 .. 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 D106 .. S DERROR=1107 .. 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 D110 .. 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)=" "113 73 Q 114 74 ; … … 122 82 I RBDT="" S RBDT=0 123 83 I REDT="" S REDT=LBEDT 124 I REDT=0 S REDT= DT84 I REDT=0 S REDT=$$DT^XLFDT 125 85 ;Convert RBDT and REDT to FileMan dates. 126 86 S RBDT=$$DCONV(RBDT,LBBDT,LBEDT) … … 137 97 ; 138 98 ;================================================= 139 REM(IEN, LBBDT,LBEDT,RBDT,REDT,PXRMFVPL,NL,OUTPUT) ;99 REM(IEN,FINDPA,PXRMFVPL,NL,OUTPUT) ; 140 100 N DEFARR 141 101 D DEF^PXRMLDR(IEN,.DEFARR) 142 D DATES^PXRMRUL1(LBBDT,LBEDT,RBDT,REDT,.DEFARR)143 102 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) 145 104 Q 146 105 ; 147 106 ;================================================= 148 TERM(IEN, LBBDT,LBEDT,RBDT,REDT,PXRMFVPL,NL,OUTPUT) ;107 TERM(IEN,FINDPA,PXRMFVPL,NL,OUTPUT) ; 149 108 N TERMARR 150 109 D TERM^PXRMLDR(IEN,.TERMARR) 151 D DATES^PXRMRUL1(LBBDT,LBEDT,RBDT,REDT,.TERMARR)152 110 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) 154 112 Q 155 113 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEVFI.m
r628 r636 1 PXRMEVFI ; SLC/PKR - Driver for finding evaluation. ; 04/02/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEVFI ; SLC/PKR - Driver for finding evaluation. ;12/01/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;===================================================== … … 24 24 . I ENODE="PSNDF(50.6," D EVALFI^PXRMDGEN(DFN,.DEFARR,ENODE,.FIEVAL) Q 25 25 . 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) Q26 . I ENODE="YTT(601," D EVALFI^PXRMMH(DFN,.DEFARR,ENODE,.FIEVAL) Q 27 27 ;Evaluate function findings. 28 28 D EVAL^PXRMFF(DFN,.DEFARR,.FIEVAL) … … 38 38 S FINDPA(11)=DEFARR(20,FINUM,11) 39 39 D GENTERM^PXRMPLST(FINDPA(0),FINUM,.TERMARR) 40 D EVALPL^PXRMTER L(.FINDPA,.TERMARR,PLIST)40 D EVALPL^PXRMTERM(.FINDPA,.TERMARR,PLIST) 41 41 Q 42 42 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXCF.m
r628 r636 1 PXRMEXCF ; SLC/PKR - Reminder exchange routines for computed findings. ; 06/28/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEXCF ; SLC/PKR - Reminder exchange routines for computed findings. ;12/22/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ;============================================== 4 4 EXISTS(ROUTINE) ;Return true if routine ROUTINE exists. … … 10 10 ;============================================== 11 11 GETRACT(ATTR,NEWNAME,NAMECHG,RTN,EXISTS) ;Get the action for a routine. 12 N ACTION,CHOICES, CSUM,DIR,DIROUT,DIRUT,DTOUT,DUOUT,ECS,IND,MSG12 N ACTION,CHOICES,DIR,DIROUT,DIRUT,DTOUT,DUOUT,ECS,IND,MSG 13 13 N PCS,ROUTINE,SAME,TEXT,X,Y 14 14 S NEWNAME="" 15 ;If the routine exists compare the existing routine checksum with the 16 ;the checksum of the routine in the packed definition. 15 17 S ROUTINE=ATTR("NAME") 16 18 I EXISTS="" S EXISTS=$$EXISTS^PXRMEXCF(ROUTINE) 17 19 S CHOICES=$S(EXISTS:"COQS",1:"CIQS") 18 20 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) 23 22 . 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) 34 29 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?" 36 31 . S DIR("B")="I" 37 32 . S ACTION=$$GETACT^PXRMEXIU(CHOICES,.DIR) 38 33 ; 39 I (ACTION="Q")!(ACTION="S")Q ACTION34 I ACTION="Q" Q ACTION 40 35 ; 41 36 I ACTION="C" D … … 65 60 Q ACTION 66 61 ; 62 ;============================================== 63 SAME(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 ; 1 PXRMEXCS ; SLC/PKR - Routines to compute checksums. ;12/21/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 40 3 ;==================================================== 41 4 FILE(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") 49 15 Q CS 50 16 ; … … 65 31 N CS,IND,LINE 66 32 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 ;==================================================== 37 LINECS(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)) 68 43 Q CS 69 44 ; … … 73 48 S NLINES=+$P($G(^XMB(3.9,XMZ,2,0)),U,3) 74 49 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) 102 51 Q CS 103 52 ; … … 105 54 ROUTINE(RA) ;Return checksum for a routine loaded in array RA. RA has the 106 55 ;form created by ^%ZOSF("LOAD") i.e, RA(1,0) ... RA(N,0). 107 N CS,IND, TEXT56 N CS,IND,LINE 108 57 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)) 114 59 Q CS 115 60 ; 116 61 ;==================================================== 117 RTN CS(ROUTINE) ;Return checksum for a routine ROUTINE.62 RTN(ROUTINE) ;Return checksum for a routine ROUTINE. 118 63 N CS,DIF,RA,X,XCNP 119 64 S XCNP=0 … … 128 73 Q CS 129 74 ; 130 ;====================================================131 PRTNCS(IEN,START,END) ;Return checksum for a packed routine.132 N CS,IND,SL,TEXT133 S CS=0,SL=START+1134 F IND=START:1:END D135 . 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 CS140 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXDG.m
r628 r636 1 PXRMEXDG ;SLC/PJH - Reminder Dialog Exchange index build ;0 5/16/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEXDG ;SLC/PJH - Reminder Dialog Exchange index build ;02/25/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;===================================================================== 5 DIALOG(RIEN,DLIST,FLIST,OLIST,TLIST ,SPONLIST) ;5 DIALOG(RIEN,DLIST,FLIST,OLIST,TLIST) ; 6 6 ; 7 7 ;Routine to get dialog details for a given reminder … … 27 27 S DCNT=0,FCNT=0,RCNT=0,TCNT=0 28 28 ;Get details 29 D GETSPON^PXRMEXPR(801.41,DIEN,.SPONLIST) 30 D DGET(DIEN,.SPONLIST) 29 D DGET(DIEN) 31 30 ; 32 31 ;Now build the dialog list (components first) … … 41 40 N CNT,COUNT,DTYP 42 41 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 55 43 .F CNT=1:1 S DIEN=$G(TEMP(DTYP,CNT)) Q:'DIEN D 56 44 ..S COUNT=COUNT+1,DLIST("DIALOG",COUNT,DIEN)="" … … 91 79 ;Get the dialog components 92 80 ;------------------------- 93 DGET(D0 ,SPONLIST) ;Save dialog ien81 DGET(D0) ;Save dialog ien 94 82 N D1 95 83 I $G(D0)=83 96 84 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 88 DGET1(D0) ; 101 89 S DCNT=DCNT+1,DARRAY(DCNT)=D0 102 90 ;And details (except for reminder dialog) 103 91 I DCNT>1 D 104 .D GETSPON^PXRMEXPR(801.41,D0,.SPONLIST)105 92 .;Finding items 106 93 .D DFIND(D0) … … 119 106 .S DDATA=$G(^PXRMD(801.41,DCOMP,0)) Q:DDATA="" 120 107 .;Exclude national PXRM prompts 121 .I +$G(PXRMINST)=0,$E(DDATA,1,4)="PXRM",$P($G(^PXRMD(801.41,DCOMP,100)),U)="N" Q108 .I $E(DDATA,1,4)="PXRM",$P($G(^PXRMD(801.41,DCOMP,100)),U)="N" Q 122 109 .;Sub-components 123 .D DGET(DCOMP ,.SPONLIST)110 .D DGET(DCOMP) 124 111 .;I $G(DCOMP1)'="" D DGET(DCOMP1) S DCOMP1="" 125 112 Q … … 175 162 ;--------------------------- 176 163 DRESULT(DIEN) ; 177 N CNT,RIEN,RECNT,RGCNT164 N RIEN 178 165 ;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 199 179 Q 200 180 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXFI.m
r628 r636 1 PXRMEXFI ; SLC/PKR/PJH - Exchange utilities for file entries.; 07/05/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEXFI ; SLC/PKR/PJH - Exchange utilities for file entries.;12/21/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ;============================================== 4 4 DELALL(FILENUM,NAME) ;Delete all file entries named NAME. … … 17 17 S DIK=$$ROOT^DILFD(FILENUM) 18 18 D ^DIK 19 Q20 ;21 ;==============================================22 FEIMSG(SAME,ATTR) ;Output the general file exits install message.23 N IND,NOUT,TEXT,TEXTO24 S TEXT(1)=ATTR("FILE NAME")_" entry named "_ATTR("NAME")_" already exists"25 I SAME D26 . 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 231 I 'SAME D32 . 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)35 19 Q 36 20 ; … … 73 57 ;Mental Health Instruments not allowed. 74 58 I FILENUM=601 Q 0 75 I FILENUM=601.71 Q 076 59 ; 77 60 I FILENUM=790.404 Q 0 … … 81 64 ; 82 65 ;============================================== 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 66 GETFACT(PT01,ATTR,NEWPT01,NAMECHG,EXISTS) ;Get the action for a file. 67 N ACTION,CHOICES,DIR,FILENUM,MSG,RESULT,X,Y 86 68 ;See if this entry is already defined. 87 69 CHK ; 88 70 S NEWPT01="" 71 S (ATTR("NAME"),ATTR("PT01"))=PT01 89 72 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) 102 81 E D 103 82 . W !!,ATTR("FILE NAME")," entry ",PT01," is NEW," … … 142 121 ; 143 122 ;============================================== 144 SETATTR(ATTR,FILE ,PT01) ;Set the file attributes for the file FILE.123 SETATTR(ATTR,FILE) ;Set the file attributes for the file FILE. 145 124 N MSG 146 125 S ATTR("FILE NUMBER")=FILE … … 149 128 D FIELD^DID(FILE,.01,"","FIELD LENGTH","ATTR","MSG") 150 129 S ATTR("MIN FIELD LENGTH")=3 151 S (ATTR("NAME"),ATTR("PT01"))=PT01152 130 Q 153 131 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXID.m
r628 r636 1 PXRMEXID ;SLC/PJH - Reminder Dialog Exchange Install Routine.; 08/16/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEXID ;SLC/PJH - Reminder Dialog Exchange Install Routine.;11/14/2003 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;================================================== … … 7 7 ;------------------------------------------------ 8 8 INSALL N ALL,DIROUT,DIRUT,DTOUT,DUOUT,IND,PXRMDONE 9 K ^TMP("PXRMEXIA",$J) 9 10 ; 10 11 ;Set the install date and time. 11 S IND="",PXRMDONE=0 12 S IND="",PXRMDONE=0,^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT 12 13 ; 13 14 ;Go to full screen mode. … … 18 19 S DNAME=$G(^TMP("PXRMEXTMP",$J,"PXRMDNAM")) 19 20 D EXIST^PXRMEXIX(.ALL,DNAME,"reminder dialog","") 20 I ALL=0 D DISP^PXRMEXLD(PXRMMODE) Q21 21 ; 22 22 ;Lock the entire file 23 23 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 25 27 .D INSCOM(IND,1) 26 28 ; … … 41 43 F S ISEQ=$O(^TMP("PXRMEXTMP",$J,"DMAP",NAME,ISEQ)) Q:'ISEQ D 42 44 .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)="" 49 46 .;Check for descendants 50 47 .I $D(^TMP("PXRMEXTMP",$J,"DMAP",DNAME)) D INSBLD(DNAME,.INAME) 51 Q52 ;Build list of replacement names53 ;-------------------------------54 INSREPL(NAME,REPL,INAME) ;55 N DNAME,IDATA,ISEQ56 S ISEQ=057 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 descendants61 I $D(^TMP("PXRMEXTMP",$J,"DMAP",DNAME)) D INSBLD(DNAME,.INAME)62 48 Q 63 49 ; … … 65 51 ;--------------------- 66 52 INSCOM(IND,SILENT) ; 67 N ACTION,ATTR, CSUM,DTYP,EXIEN,END,EXISTS,FILENUM,IND120,JND12068 N NEWPT01,PT01,START, REPL,SAME,TEMP53 N ACTION,ATTR,DTYP,EXIEN,END,EXISTS,FILENUM,IND120,JND120 54 N NEWPT01,PT01,START,TEMP 69 55 S TEMP=^TMP("PXRMEXLD",$J,"SEL",IND),FILENUM=$P(TEMP,U,1) 70 56 S EXISTS=$P(TEMP,U,4),START=$P(TEMP,U,2),END=$P(TEMP,U,3) Q:START="" … … 79 65 ; 80 66 ;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 83 68 .N ANS,INDS,TEXT 84 69 .S TEXT(1)=PT01_" ("_DTYP_") contains sub-components." … … 86 71 .;Give option to install all descendents 87 72 .D ASK^PXRMEXIX(.ANS,.TEXT,1) Q:PXRMDONE 88 .I $G(ANS)="N" S PXRMDONE=1 Q89 73 .I $G(ANS)="Y" D 90 74 ..S INDS=IND 91 75 ..N IDATA,INAME,IND 92 ..I REPL>0 D INSREPL(PT01,REPL,.INAME)93 76 ..;Build list of decendents to install 94 77 ..D INSBLD(PT01,.INAME) … … 106 89 ...I $D(INAME(PT01)) D INSCOM(IND,1) 107 90 ; 108 SETENTRY ; 109 D SETATTR^PXRMEXFI(.ATTR,FILENUM,PT01) 110 S ACTION="" 91 D SETATTR^PXRMEXFI(.ATTR,FILENUM) 111 92 ;Double check that it hasn't been installed 112 93 S EXIEN=$$EXISTS^PXRMEXIU(801.41,PT01) 113 94 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) 123 98 ;Save what was done for the installation summary. 124 S ^TMP("PXRMEXIA D",$J,IND,ATTR("FILE NAME"),ATTR("PT01"),ACTION)=NEWPT0199 S ^TMP("PXRMEXIA",$J,IND,ATTR("FILE NAME"),ATTR("PT01"),ACTION)=NEWPT01 125 100 ;Clear heading 126 101 S VALMHDR(2)="" … … 152 127 F S SUB=$O(^TMP("PXRMEXTMP",$J,"DMAP",NAME,SUB)) Q:'SUB D Q:DFOUND 153 128 .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 156 130 Q DFOUND 157 131 ; 158 INSREPL1(NAME) ;159 N DATA,DFOUND,SUB160 S DFOUND=0,SUB=0161 F S SUB=$O(^TMP("PXRMEXTMP",$J,"DREPL",NAME,SUB)) Q:'SUB D Q:DFOUND162 .S DATA=$G(^TMP("PXRMEXTMP",$J,"DREPL",NAME,SUB)) Q:DATA=""163 .S DFOUND=1164 Q DFOUND165 132 ;Option to link dialog to a reminder 166 133 ;----------------------------------- … … 223 190 D EN^VALM2(XQORNOD(0)) 224 191 ; 192 K ^TMP("PXRMEXIA",$J) 225 193 ;Set the install date and time. 226 S ALL="",PXRMDONE=0 194 S ALL="",PXRMDONE=0,^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT 227 195 ; 228 196 ;Lock the entire file … … 230 198 ; 231 199 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) 233 202 ; 234 203 ;Clear locks … … 255 224 ;Ignore non-PXRM 256 225 I $E(NAME,1,4)'="PXRM" Q 0 257 N DIEN,RESULT258 I $G(PXRMINST)=1 D Q RESULT259 .S RESULT=0260 .S DIEN=$O(^PXRMD(801.41,"B",NAME,"")) I 'DIEN Q261 .I $P($G(^PXRMD(801.41,DIEN,100)),U)'="N" Q262 .I ($P($G(^PXRMD(801.41,DIEN,0)),U,4)="P")!($P($G(^PXRMD(801.41,DIEN,0)),U,4)="F") S RESULT=1263 226 ; 264 227 ;Check if this is a national code 228 N DIEN 265 229 S DIEN=$O(^PXRMD(801.41,"B",NAME,"")) 266 230 ;If not found abort 267 231 I 'DIEN Q 0 268 ;if result group/element quit269 I $P($G(^PXRMD(801.41,DIEN,0)),U,4)="S"!($P($G(^PXRMD(801.41,DIEN,0)),U,4)="T") Q 0270 232 ;Check class 271 233 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. ;0 7/27/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMEXIU ; SLC/PKR/PJH - Utilities for installing repository entries. ;06/23/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ;=============================================== 4 4 DEF(FDA,NAMECHG) ;Check the reminder definition to make sure the related … … 47 47 ; 48 48 ;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) 51 51 I IEN=0 K FDA(811.9,IENS,51) 52 52 ; … … 198 198 ; 199 199 ;=============================================== 200 SAME(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 ;=============================================== 200 210 TERM(FDA,NAMECHG) ;Check the reminder term to make sure all the 201 211 ;findings exist. -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXIX.m
r628 r636 1 PXRMEXIX ;SLC/PJH - Reminder Dialog Exchange checks. ;1 0/10/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEXIX ;SLC/PJH - Reminder Dialog Exchange checks. ;12/22/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;===================================================================== … … 84 84 ...S CNT=CNT+1,FIRST=0,TEXT(CNT)=DNAME_" ("_DTYP_")" 85 85 ..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:" 87 87 ;Give option to install all descendents 88 88 D ASK(.ANS,.TEXT,2) I $G(ANS)="Y" S ALL=1 89 I $G(ANS)="N" S ALL=090 89 Q 91 90 ; … … 115 114 ; 116 115 I CALL=1 D 117 .S HTEXT(1)="Enter 'Yes' to i nstallall sub-components or"116 .S HTEXT(1)="Enter 'Yes' to if you are installing all sub-components or" 118 117 .S HTEXT(2)="enter 'No' to install only the selected dialog." 119 118 I CALL=2 D 120 .S HTEXT(1)="Enter 'Yes' to i nstallwithout 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." 122 121 I CALL=3 D 123 122 .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. ;0 5/16/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEXLB ;SLC/PJH - Reminder Dialog Exchange. ;07/01/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;===================================================================== … … 7 7 ;------------------------------- 8 8 DBUILD(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 11 10 ; 12 11 K ^TMP("PXRMEXTMP",$J),^TMP("PXRMEXFND",$J) … … 20 19 .D DPARSE 21 20 ;Scan dialog components in 120 and save dialog links 22 S JND="B" ,REPCNT=021 S JND="B" 23 22 F S JND=$O(^PXD(811.8,IEN,120,IND,1,JND),-1) Q:'JND D 24 23 .S DDATA=$G(^PXD(811.8,IEN,120,IND,1,JND,0)) Q:DDATA="" … … 31 30 .F S DSUB=$O(^PXD(811.8,IEN,100,DSUB)) Q:DSUB>DEND D 32 31 ..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 35 33 ..S DNODE=$P(DNODE,";",3) 36 34 ..;;Modified Exchange to handle dialogs with replacement dialogs … … 38 36 ...S DNAM=$P(DNODE,"~",2) Q:DNAM="" 39 37 ...S DLOC=$G(^TMP("PXRMEXTMP",$J,"DLOC",DNAM)) 40 ...S REPCNT=REPCNT+1,^TMP("PXRMEXTMP",$J,"DREPL",REPCNT,DDLG)=DNAM_U_DLOC38 ...S ^TMP("PXRMEXTMP",$J,"DREPL",DDLG)=DNAM_U_DLOC 41 39 ..I $E(DNODE,1,4)'=".01~" Q 42 40 ..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 51 42 ..S DNODE=$P(DNODE,";",3) I $E(DNODE,1,2)'="2~" Q 52 43 ..S DNAM=$P(DNODE,"~",2) Q:DNAM="" … … 55 46 ; 56 47 ;Build index of dialog findings by name 48 ; 49 ; 57 50 N FDATA,FILENAM,FILENUM,FNAME 58 51 S IND=0 … … 71 64 ..;Save entry 72 65 ..S ^TMP("PXRMEXFND",$J,FNAME)=FILENUM_U_FILENAM_U_IND 73 I $D(TEMPRESL)>0 D74 .S DDLG="" F S DDLG=$O(TEMPRESL(DDLG)) Q:DDLG="" D75 ..;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))78 66 Q 79 67 ; … … 83 71 ; 84 72 ;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;" 88 75 F S DSUB=$O(^PXD(811.8,IEN,100,DSUB)) Q:'DSUB D Q:DSUB>DEND 89 76 .S DDATA=$G(^PXD(811.8,IEN,100,DSUB,0)) Q:DDATA="" … … 91 78 .S DFNUM=$P(DDATA,";",3),DFNUM=$P(DFNUM,"~") Q:DFNUM="" 92 79 .I DSTRING[(";"_DFNUM_";") S DARRAY(DFNUM)=DSUB 93 .I $P(DDATA,";")="801.41121" S DARRAY(55)=DSUB94 80 ; 95 81 ;Determine dialog component type 96 82 S DSUB=DARRAY(4) Q:'DSUB 97 83 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" 99 85 ; 100 86 ;Initialise text and finding fields 101 87 S DTXT="*NONE*",DFIND="" 102 88 ;Get text appropriate for the type of component 103 I ( (DTYP="element")!(DTYP="group"))&(DTYP'["result") D89 I (DTYP="element")!(DTYP="group") D 104 90 .;search for WP text 105 91 .S DSUB=$G(DARRAY(25)) D:DSUB … … 115 101 ..;Reformat text to 50 characters 116 102 ..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 .; 121 104 .;Search for finding item 122 105 .S DSUB=$G(DARRAY(15)) D:DSUB … … 136 119 ...I $P(DFNAM,".")="ICD9" S DFNAM=$P(DFNAM," ") 137 120 ...S DCNT=DCNT+1,DFIAD(DCNT)=DFNAM 138 ;139 I DTYP["result" D140 .S DSUB=$G(DARRAY(.01)) Q:'DSUB141 .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_JND144 121 ; 145 122 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. ;0 8/03/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMEXLC ; SLC/PKR/PJH - Routines to display repository entry components. ;06/22/2004 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ;====================================================== 4 4 BLDLIST(FORCE) ;Build a list of all repository entries. … … 7 7 I $D(^TMP("PXRMEXLR",$J,"VALMCNT")) S VALMCNT=^TMP("PXRMEXLR",$J,"VALMCNT") 8 8 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) 11 14 Q 12 15 ; … … 76 79 ; 77 80 ;====================================================== 81 DDISP(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 ;====================================================== 78 97 FMTDATA(NSEL,PT01,CAT,EXISTS) ;Format items for display. 79 98 N NSTI,TEMP … … 88 107 ; 89 108 ;====================================================== 109 HISTLIST(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 ;====================================================== 90 155 INSCHR(NUM,CHR) ;Return a string of NUM characters (CHR). 91 156 N IND,TEMP … … 96 161 ; 97 162 ;====================================================== 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 163 DREPL ; 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) 169 DREPL1 ; 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 104 192 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 ; 1 PXRMEXLD ;SLC/PJH - Reminder Dialog Exchange Main Routine. ;7/01/2004 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 ; 4 ;===================================================================== 4 5 START N PXRMBG,PXRMMODE,VALMBCK,VALMBG,VALMCNT,VALMSG,X,XMZ 5 6 S X="IORESET" 6 7 D EN^VALM("PXRM EX LIST DIALOG") 8 ; 7 9 ;Rebuild Display 8 10 D CDISP^PXRMEXLC(PXRMRIEN) 9 11 Q 10 12 ; 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 ; 13 ENTRY D FIND Q 14 ; 15 DETAIL S PXRMMODE=0 D DISP(PXRMMODE) Q 16 ; 17 ;Display Findings 18 ;-------------------------- 19 FIND S PXRMMODE=2 D DISP(PXRMMODE) Q 20 ; 21 ;Display Dialog Summary 22 ;---------------------- 23 SUM S PXRMMODE=3 D DISP(PXRMMODE) Q 24 ; 25 ;Display Dialog Usage 26 ;-------------------- 27 USE S PXRMMODE=4 D DISP(PXRMMODE) Q 28 ; 29 ;Display Dialog Text 30 ;------------------- 31 TEXT S PXRMMODE=1 D DISP(PXRMMODE) Q 32 ; 33 EXIT K ^TMP("PXRMEXLD",$J) Q 34 ; 35 PEXIT ;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 ; 41 HELP N ORU,ORUPRMT,XQORM,PXRMTAG S PXRMTAG="DLG" 42 D EN^VALM("PXRM EX DIALOG HELP") 43 Q 44 ; 45 HDR 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) 54 DISP(VIEW) ; 55 N OLEV,ODSEQ 30 56 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 35 75 ;Change header 36 76 I VIEW=0 D CHGCAP^VALM("HEADER2","Dialog Details") … … 39 79 I VIEW=3 D CHGCAP^VALM("HEADER2","Dialog Summary") 40 80 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 42 85 ;Reset protocol 43 86 D XQORM 44 87 Q 45 88 ; 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 90 DLINE(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 205 DCMP(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 230 ORDER(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 239 OTHER(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 255 VALID(STRING) ; 67 256 N CNT,FOUND,OK 68 257 S FOUND=0,OK=1 … … 86 275 ; 87 276 ;Sort the SELECTION into reverse order 88 D ORDER ^PXRMEXLC(.SELECT,-1)277 D ORDER(.SELECT,-1) 89 278 ; 90 279 ;Lock the file … … 99 288 D UNLOCK^PXRMEXID 100 289 ; 290 ; 101 291 ;Rebuild Workfile 102 292 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. ;0 8/08/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEXLI ; SLC/PKR - List Manager routines for repository entry install. ;01/10/2003 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;================================================ 5 5 INSALL ;Install all components in a repository entry. 6 6 N IND,INSTALL 7 K ^TMP("PXRMEXIA",$J) 8 ;Set the install date and time. 9 S ^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT 7 10 ;Initialize the name change storage. 8 11 K PXRMNMCH … … 46 49 I FILENUM=0 D 47 50 . D RTNLD^PXRMEXIC(PXRMRIEN,START,END,.ATTR,.RTN) 48 . D CHECKSUM^PXRMEXCS(.ATTR,START,END)49 51 . S ACTION=$$GETRACT^PXRMEXCF(.ATTR,.NEWNAME,.PXRMNMCH,.RTN,EXISTS) 50 52 .;Save what was done for the installation summary. … … 56 58 . I FIELDNUM=.001 S TEMP=^PXD(811.8,PXRMRIEN,100,(START+1),0) 57 59 . 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) 60 61 . S ACTION=$$GETFACT^PXRMEXFI(PT01,.ATTR,.NEWPT01,.PXRMNMCH,EXISTS) 61 62 .;Save what was done for the installation summary. … … 90 91 I '$D(VALMY) Q 91 92 ; 93 K ^TMP("PXRMEXIA",$J) 94 ;Set the install date and time. 95 S ^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT 96 ; 92 97 ;Initialize the name change storage. 93 98 K PXRMNMCH 94 99 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) 96 102 ; 97 103 ;If anything was installed rebuild the display. … … 109 115 I '$D(^PXD(811.8,PXRMRIEN,120)) D CLIST^PXRMEXU1(.PXRMRIEN) 110 116 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^XLFDT114 S ^TMP("PXRMEXIA",$J,"TYPE")="INTERACTIVE"115 117 ;Format the component list for display. 116 118 D CDISP^PXRMEXLC(PXRMRIEN) … … 120 122 Q 121 123 ; 122 ;================================================123 124 ;Exit action added to PXRM EXCH INSTALL MENU 124 125 PEXIT ;PXRM EXCH INSTALL MENU protocol exit code … … 128 129 Q 129 130 ; 130 ;================================================131 131 XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXCH SELECT COMPONENT",0))_U_"1:"_VALMCNT 132 132 S XQORM("A")="Select Action: " 133 133 Q 134 134 ; 135 ;================================================136 135 XSEL ;PXRM EXCH SELECT COMPONENT validation 137 136 N CNT,SELECT,SEL,PXRMDONE … … 140 139 ; 141 140 ;Sort selections into ascending sequence order 142 D ORDER^PXRMEXL C(.SELECT,1)141 D ORDER^PXRMEXLD(.SELECT,1) 143 142 ; 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. 146 145 S ^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT 147 S ^TMP("PXRMEXIA",$J,"TYPE")="INTERACTIVE"148 146 ; 149 147 ;Install selected component -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXLM.m
r628 r636 1 PXRMEXLM ; SLC/PKR/PJH - Clinical Reminder Exchange List Manager routines. ;1 0/11/20072 ;;2.0;CLINICAL REMINDERS; **4,6**;Feb 04, 2005;Build 1231 PXRMEXLM ; SLC/PKR/PJH - Clinical Reminder Exchange List Manager routines. ;12/22/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;===================================================== … … 41 41 ; 42 42 ;===================================================== 43 EN ;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 ;===================================================== 43 61 ENTRY ;Entry code 44 D BLDLIST^PXRMEXLC(0)45 62 D XQORM 46 63 Q … … 52 69 K ^TMP("PXRMEXFND",$J) 53 70 K ^TMP("PXRMEXIA",$J) 54 K ^TMP("PXRMEXIAD",$J)55 71 K ^TMP("PXRMEXID",$J) 56 72 K ^TMP("PXRMEXIH",$J) … … 166 182 Q 167 183 ; 168 ;=====================================================169 START ;Main entry point for PXRM EXCHANGE170 N PXRMDONE,PXRMNMCH171 ;PXRMDONE is set to true if the user enters an action of Quit.172 S PXRMDONE=0173 ;PXRMNMCH is used to store name change information. If a finding174 ;is copied to a new name or is replaced by another finding the175 ;information is stored here. It is used when installing definitions176 ;or dialogs so they use the new or replaced finding.177 N VALMBCK,VALMSG,X,XMZ178 S X="IORESET"179 D ENDR^%ZISS180 D EN^VALM("PXRM EX REMINDER EXCHANGE")181 W IORESET182 D KILL^%ZISS183 Q184 ;185 ;=====================================================186 184 XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXCH SELECT ENTRY",0))_U_"1:"_VALMCNT 187 185 S XQORM("A")="Select Action: " 188 186 Q 189 187 ; 190 ;=====================================================191 188 XSEL ;PXRM EXCH SELECT COMPONENT validation 192 189 N SEL,PXRMRIEN … … 198 195 .W $C(7),!,"Only one item number allowed." H 2 199 196 .S VALMBCK="R" 200 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@(" SEL",SEL))) D Q197 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("IDX",SEL))) D Q 201 198 .W $C(7),!,SEL_" is not a valid item number." H 2 202 199 .S VALMBCK="R" 203 200 ; 204 201 ;Get the repository ien. 205 S PXRMRIEN=^TMP("PXRMEXLR",$J," SEL",SEL)202 S PXRMRIEN=^TMP("PXRMEXLR",$J,"IDX",SEL,SEL) 206 203 ; 207 204 ;Full screen mode … … 233 230 .;Rebuild the list for List Manager to display. 234 231 .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 .; 237 238 .S VALMHDR(1)="Deleted 1 exchange file entry",VALMHDR(2)=" ",VALMBCK="R" 238 239 ; 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. ;0 7/30/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEXLR ; SLC/PKR/PJH - List Manager routines for existing repository entries. ;01/10/2003 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ;================================================== 4 4 CHF ;Create a host file containing repository entries. … … 50 50 ;Rebuild the list for List Manager to display. 51 51 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) 53 56 ; 54 57 S VALMHDR(1)="Deleted "_DELLIST("COUNT")_" Exchange File" … … 61 64 ; 62 65 ;================================================== 66 DELHIST ;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 ;================================================== 63 90 EXIT ; Exit code 64 91 D CLEAN^VALM10 … … 69 96 ; 70 97 ;================================================== 98 IH ;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 ;================================================== 111 INDETAIL ;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 ;================================================== 122 INDISP(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 ;================================================== 71 179 INSTALL ;Get a list of repository entries and install them. 72 180 N IND,PXRMRIEN,VALMY … … 79 187 F S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE) D 80 188 .;Get the repository ien. 81 . S PXRMRIEN=^TMP("PXRMEXLR",$J," SEL",IND)189 . S PXRMRIEN=^TMP("PXRMEXLR",$J,"IDX",IND,IND) 82 190 .;The list template calls INSTALL^PXRMEXLI 83 191 . D EN^VALM("PXRM EX LIST COMPONENTS") … … 98 206 ; 99 207 ;================================================== 208 IS ;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 ;================================================== 100 216 MIENLIST(LIST) ;Get a list of List Manager repository entries and turn it 101 217 ;into iens. … … 108 224 F S IND=$O(VALMY(IND)) Q:+IND=0 D 109 225 . 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) 112 227 . S LIST(IEN)="" 113 228 S LIST("COUNT")=COUNT … … 117 232 PEXIT ;PXRM EXCH INSTALLATION MENU protocol exit code 118 233 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 ;================================================== 239 XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXCH SELECT HISTORY",0))_U_"1:"_VALMCNT 240 S XQORM("A")="Select Action: " 241 Q 242 ; 243 ;================================================== 244 XSEL ;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/20062 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEXPR ; SLC/PKR/PJH - Routines to create packed reminder definitions. ;02/25/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ;=============================================================== 4 4 ADDFILE(FLIST,ROOT,FILENAME) ;Add a file to the list of finding files. … … 29 29 D GETSPON(811.9,RIEN,.SPONLIST) 30 30 ;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) 33 33 ;Go through the finding list to find additional sponsors. 34 34 S IND="" … … 122 122 ;Save the source information 123 123 I +RTP'>0 Q 124 K ^TMP(TMPIND,$J) ,^TMP("PXRMEXCS",$J)124 K ^TMP(TMPIND,$J) 125 125 D PUTSRC(RTP,TMPIND) 126 126 ; … … 152 152 ;If a dialog exists for this reminder add it and its findings to the 153 153 ;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) 155 155 ; 156 156 ;If there were education topics make sure subtopics are included. … … 226 226 S LOC=$$SITE^VASITE 227 227 S ^TMP(TMPIND,$J,"SRC","REMINDER")=$P(RTP,U,2) 228 ;S ^TMP(TMPIND,$J,"SRC","USER")=$P(^VA(200,DUZ,0),U,1) 228 229 S ^TMP(TMPIND,$J,"SRC","USER")=$$GET1^DIQ(200,DUZ,.01) 229 230 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/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEXPU ; SLC/PKR - Utilities for packing and unpacking repository entries. ;12/22/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ;================================================== 4 4 BTTABLE(DIQOUT,IENROOT,TTABLE) ;Build the DIQOUT to FDA iens translation table. … … 13 13 . S TTABLE(FILENUM,IENS)="+"_IENS 14 14 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" 16 16 ; 17 17 F S FILENUM=$O(DIQOUT(FILENUM)) Q:FILENUM="" D … … 43 43 ... I '$D(TYPE(FILENUM,FIELD)) S TYPE(FILENUM,FIELD)=$$GET1^DID(FILENUM,FIELD,"","TYPE") 44 44 ... 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)="" Q47 45 ...;If the field's type is COMPUTED then don't transport it. 48 46 ... I TYPE(FILENUM,FIELD)="COMPUTED" K DIQOUT(FILENUM,IENS,FIELD) Q … … 91 89 ;================================================== 92 90 GDIQF(LIST,NUM,TMPIND,SERROR) ;Save file entries into ^TMP(TMPIND,$J). 93 N CSUM,DIQOUT,IENROOT,IND,FIELD,FILENAME,IENS,MSG,PT01,TEMP91 N DIQOUT,IENROOT,IND,FIELD,FILENAME,IENS,MSG,PT01,TEMP 94 92 S ^TMP(TMPIND,$J,"NUMF")=NUM 95 93 F IND=1:1:NUM D … … 103 101 . I $$FOKTI^PXRMEXFI(FILENUM) S FIELD="**" 104 102 . E S FIELD=.01 105 . D GETS^DIQ(FILENUM,IEN,FIELD," N","DIQOUT","MSG")103 . D GETS^DIQ(FILENUM,IEN,FIELD,"","DIQOUT","MSG") 106 104 . I $D(MSG) D Q 107 105 .. S SERROR=1,IND=NUM … … 117 115 .;Convert the iens to the FDA adding form. 118 116 . D CONTOFDA(.DIQOUT,.IENROOT) 119 . S CSUM=$$DIQOUTCS^PXRMEXCS(.DIQOUT)120 . S ^TMP("PXRMEXCS",$J,IND,FILENAME)=CSUM121 117 .;Load the converted DIQOUT into TMP. 122 118 . M ^TMP(TMPIND,$J,IND,FILENAME)=DIQOUT … … 135 131 ;================================================== 136 132 GRTN(LIST,NUM,TMPIND,SERROR) ;Save routines into ^TMP(TMPIND,$J). 137 N DIF,IEN,IND, RA,TEMP,X,XCNP133 N DIF,IEN,IND,TEMP,X,XCNP 138 134 S ^TMP(TMPIND,$J,"NUMR")=NUM 139 135 S X="" … … 143 139 . X ^%ZOSF("TEST") 144 140 . I $T D 145 .. K RA 146 .. S DIF="RA(" 141 .. S DIF="^TMP(TMPIND,$J,""ROUTINE"","""_X_"""," 147 142 .. S XCNP=0 148 143 .. X ^%ZOSF("LOAD") 149 .. S ^TMP("PXRMEXCS",$J,"ROUTINE",X)=$$ROUTINE^PXRMEXCS(.RA)150 .. M ^TMP(TMPIND,$J,"ROUTINE",X)=RA151 144 . E D 152 145 .. S SERROR=1 … … 156 149 ; 157 150 ;================================================== 158 RMEH(FILENUM,DIQOUT ,NOSTUB) ;Clear the edit history from all reminder files.151 RMEH(FILENUM,DIQOUT) ;Clear the edit history from all reminder files. 159 152 ;Leave a stub so it can be filled in when the file is installed. 160 153 I (FILENUM<800)!(FILENUM>811.9) Q 161 N IEN S,SFN,TARGET154 N IEN,SFN,TARGET 162 155 ;Edit History is stored in node 110 for all files, get the 163 156 ;subfile number. … … 169 162 F S IENS=$O(DIQOUT(SFN,IENS)) Q:IENS="" K DIQOUT(SFN,IENS) 170 163 ;Create a stub for the install. 171 I $G(NOSTUB) Q172 164 S IENS="1,"_$O(DIQOUT(FILENUM,"")) 173 165 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 1 PXRMEXSI ; SLC/PKR/PJH - Silent repository entry install. ;12/22/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 ; 4 ;=================================================== 5 BUILD ;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 ;=================================================== 21 DCMP(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 ;=================================================== 37 DREPL(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 ;=================================================== 47 DSAVE(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 3 57 ; 4 58 ;=================================================== 5 59 INITMPG ;Initialize ^TMP arrays. 6 K ^TMP("PXRMEXFND",$J)7 60 K ^TMP("PXRMEXIA",$J) 8 K ^TMP("PXRMEXIAD",$J)9 61 K ^TMP("PXRMEXLC",$J) 10 62 K ^TMP("PXRMEXLD",$J) … … 13 65 ; 14 66 ;=================================================== 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 67 INSCOM(PXRMRIEN,IND,TEMP,REMNAME) ;Install component IND of PXRMRIEN. 68 N ACTION,ATTR,END,EXISTS,FILENUM,IND120,JND120,NAME 69 N PT01,RTN,START 19 70 S FILENUM=$P(TEMP,U,1),EXISTS=$P(TEMP,U,4) 20 71 S IND120=$P(TEMP,U,2),JND120=$P(TEMP,U,3) 21 I (IND120="")!(JND120="") Q22 72 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") 29 75 S START=$P(TEMP,U,2) 30 76 S END=$P(TEMP,U,3) 77 S TEMP=^PXD(811.8,PXRMRIEN,100,START,0) 31 78 I FILENUM=0 D 32 79 . 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. 37 81 . S ^TMP("PXRMEXIA",$J,IND,"ROUTINE",ATTR("NAME"),ACTION)="" 38 82 E D 39 . S TEMP=^PXD(811.8,PXRMRIEN,100,START,0)40 83 . 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) 48 86 .;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)="" 53 88 ;Install this component. 54 89 I FILENUM=0 D RTNSAVE^PXRMEXIC(.RTN,ATTR("NAME")) 55 90 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. 56 94 Q 57 95 ; 58 96 ;=================================================== 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") 97 INSDLG(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) 76 112 Q 77 113 ; 78 114 ;=================================================== 79 INSTALL(PXRMRIEN, ACTION,NOR) ;Install all components in a repository entry.115 INSTALL(PXRMRIEN,NOR) ;Install all components in a repository entry. 80 116 ;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 83 118 S NOR=$G(NOR) 84 119 ;Initialize ^TMP globals. … … 91 126 ;Build the selectable list. 92 127 D CDISP^PXRMEXLC(PXRMRIEN) 93 ;Set the install date and time and type.128 ;Set the install date and time. 94 129 S ^TMP("PXRMEXIA",$J,"DT")=$$NOW^XLFDT 95 S ^TMP("PXRMEXIA",$J,"TYPE")="SILENT"96 130 ;Initialize the name change storage. 97 131 K PXRMNMCH 98 132 S IND=0 99 F S IND=$O(^TMP("PXRMEXLC",$J,"SEL",IND)) Q: (IND="")!(PXRMDONE)D133 F S IND=$O(^TMP("PXRMEXLC",$J,"SEL",IND)) Q:+IND=0 D 100 134 . S TEMP=^TMP("PXRMEXLC",$J,"SEL",IND) 101 135 . S FILENUM=$P(TEMP,U,1) … … 103 137 . I FILENUM=0,NOR Q 104 138 . ;Install dialog components 105 . I FILENUM=801.41 N PXRMDONE S PXRMDONE=0 D INSDLG(PXRMRIEN ,ACTION) Q139 . I FILENUM=801.41 N PXRMDONE S PXRMDONE=0 D INSDLG(PXRMRIEN) Q 106 140 . ;Install component 107 . E D INSCOM(PXRMRIEN, ACTION,IND,TEMP,.REMNAME,"PXRMEXIA")141 . E D INSCOM(PXRMRIEN,IND,TEMP,.REMNAME) 108 142 ; 109 143 ;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/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEXU1 ; SLC/PKR/PJH - Reminder exchange repository utilities, #1. ;09/20/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ;===================================================== 4 4 CLIST(IEN) ;Build the list of components for the repository … … 98 98 ; 99 99 ;===================================================== 100 DELHIST(RIEN,IHI EN) ;Delete install history IHIENin repository entry RIEN.101 N DA ,DIK102 S DA =IHIEN,DA(1)=RIEN103 S DIK="^PXD(811.8,"_DA(1)_",130,"104 D ^DIK100 DELHIST(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) 105 105 Q 106 106 ; … … 146 146 RIEN(LIEN) ;Given the list ien return the repository ien. 147 147 N RIEN 148 S RIEN=$G(^TMP("PXRMEXLR",$J," SEL",LIEN))148 S RIEN=$G(^TMP("PXRMEXLR",$J,"IDX",LIEN,LIEN)) 149 149 Q RIEN 150 150 ; 151 151 ;===================================================== 152 152 SAVHIST ;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 155 154 ;Find the first open spot in the Installation History node. 156 155 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 158 159 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 184 208 .... S KND=KND+1 185 .... S TEMP=$E(O FINDING,1,33)186 .... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,KND,0)=" "_TEMP_$$INSCHR^PXRMEXLC((35-$L(TEMP))," ")_ FINDING209 .... 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 187 211 ... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,0)=U_"811.80315A"_U_KND_U_KND 188 212 ... 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 190 214 .... 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))) D196 ... N KND,OTIUT,TIUT,TYPE197 ... S TYPE=""198 ... S KND=2199 ... F S TYPE=$O(^TMP(SUB,$J,FTYPE,TYPE)) Q:TYPE="" D200 .... S OTIUT=""201 .... F S OTIUT=$O(^TMP(SUB,$J,FTYPE,TYPE,OTIUT)) Q:OTIUT="" D202 ..... S TIUT=$G(^TMP(SUB,$J,FTYPE,TYPE,OTIUT))203 ..... I OTIUT=TIUT Q204 ..... I '$D(^TMP(SUB,$J,FTYPE,TYPE,OTIUT,ITEM)) Q205 ..... S KND=KND+1206 ..... 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))," ")_TIUT208 .... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,0)=U_"811.80315A"_U_KND_U_KND209 .... I KND>2 D210 ..... S ^PXD(811.8,PXRMRIEN,130,IND,1,JND,1,1,0)=" "_TYPE211 ..... 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 D214 .;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_TYPE219 . S ^PXD(811.8,PXRMRIEN,130,"B",DATE,IND)=""220 .;Set the 0 node.221 . S (KND,TOTAL)=0222 . F S KND=+$O(^PXD(811.8,PXRMRIEN,130,KND)) Q:KND=0 S TOTAL=TOTAL+1223 . S ^PXD(811.8,PXRMRIEN,130,0)=U_"811.803DA"_U_IND_U_TOTAL224 215 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/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEXU2 ; SLC/PKR/PJH - Reminder exchange repository utilities, #2. ;09/20/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ;===================================================== 4 4 FDA(IND,LC,TMPIND,FILENAME) ;Build the XML FDA output. … … 59 59 S ^TMP("PXRMEXRS",$J,1,0)="<?xml version=""1.0"" standalone=""yes""?>" 60 60 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") 62 62 S ^TMP("PXRMEXRS",$J,3,0)="<PACKAGE_VERSION>"_VERSN_"</PACKAGE_VERSION>" 63 63 ;The pointer to the index will be on line 4 so leave room. … … 101 101 . S ^TMP($J,"CIND",NCMPNT,"M_ROUTINE_START")=LC 102 102 . 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>"104 103 . S LC=LC+1,^TMP("PXRMEXRS",$J,LC,0)="<CODE>" 105 104 . S LC=LC+1,^TMP("PXRMEXRS",$J,LC,0)="<![CDATA[" … … 138 137 ... S ^TMP("PXRMEXRS",$J,LC,0)="<POINT_01>"_$$TOXML^PXRMEXU3(PT01)_"</POINT_01>" 139 138 ... 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>"141 139 ... S ^TMP($J,"CIND",NCMPNT,"FDA_START")=LC+3 142 140 ... D FDA(IND,.LC,TMPIND,FILENAME) … … 180 178 . S DESL("SOURCE")=^TMP(TMPIND,$J,"SRC","USER")_" at "_^TMP(TMPIND,$J,"SRC","SITE") 181 179 . S DESL("DATEP")=^TMP(TMPIND,$J,"SRC","DATE") 182 . S DESL("VRSN")= VERSN180 . S DESL("VRSN")=$G(^PXRM(800,1,"VERSION")) 183 181 . S DESC="^TMP(TMPIND,$J,""DESC"")" 184 182 . S KEYWORD="^TMP(TMPIND,$J,""KEYWORD"")" 185 183 . 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) 188 187 Q 189 188 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMEXU4.m
r628 r636 1 PXRMEXU4 ; SLC/PJH,PKR - Reminder Exchange #4, dialog changes. ;0 5/16/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMEXU4 ; SLC/PJH,PKR - Reminder Exchange #4, dialog changes. ;01/19/2005 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ;=============================================== 4 4 DLG(FDA,NAMECHG) ;Check the dialog for renamed entries, called by … … 15 15 D BLDALIST^PXRMVPTR(801.4118,.01,.ALIST) 16 16 ;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 19 18 S ALIST("WH")=790.404 20 19 ;Plus field 17 file … … 186 185 .. I Y="" S ACTION="Q" Q 187 186 .. I Y'="" S FDA(801.412,IENS,2)=$P(Y,U,2) 188 ;Process Result Groups189 F S IENS=$O(FDA(801.41121,IENS)) Q:IENS="" D I ACTION="Q" K FDA S (PXRMDONE,KIDSDONE)=1 Q190 . S PT01=$G(FDA(801.41121,IENS,.01)) Q:PT01=""191 . S FILENUM=801.41,NEWNAM=$G(NAMECHG(FILENUM,PT01))192 .I NEWNAM'="" D193 .. S FDA(801.41121,IENS,2)=NEWNAM,PT01=NEWNAM194 .S IEN=$$EXISTS^PXRMEXIU(FILENUM,PT01)195 .I IEN=0 D196 ..;Get replacement197 .. N DIC,DIR,DUOUT,MSG,X,Y198 .. 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" Q204 .. I ACTION="D" K FDA(801.41121,IENS) Q205 .. S DIC=FILENUM206 .. S DIC(0)="AEMNQ"207 .. S DIC("S")="I ""S""[$P(^PXRMD(801.41,Y,0),U,4)"208 .. S Y=-1209 .. F Q:+Y'=-1 D210 ...;If this is being called during a KIDS install we need echoing on.211 ... I $D(XPDNM) X ^%ZOSF("EON")212 ... D ^DIC213 ... I $D(XPDNM) X ^%ZOSF("EOFF")214 ... I $D(DUOUT) S Y="" Q215 ... I Y=-1 D BMES^XPDUTL("You must input a replacement!")216 .. I Y="" S ACTION="Q" Q217 .. I Y'="" S FDA(801.41121,IENS,.01)=$P(Y,U,2)218 187 Q 219 188 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMFF.m
r628 r636 1 PXRMFF ;SLC/PKR - Clinical Reminders function finding evaluation. ; 3/29/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMFF ;SLC/PKR - Clinical Reminders function finding evaluation. ;07/17/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ;=========================================== 4 4 EVAL(DFN,DEFARR,FIEVAL) ;Evaluate function findings. … … 70 70 . S LNAME(IND)="PXRMFF"_IND 71 71 . K ^TMP($J,LNAME(IND)) 72 . D EVALPL^PXRMTER L(.FINDPA,.TERMARR,LNAME(IND))72 . D EVALPL^PXRMTERM(.FINDPA,.TERMARR,LNAME(IND)) 73 73 .;Get rid of the false part of the list. 74 74 . 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. ;0 9/11/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMFF0 ;SLC/PKR - Clinical Reminders function finding routines. ;06/23/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;============================================ … … 82 82 ; 83 83 ;============================================ 84 NUMERIC(LIST,FIEVAL,VALUE) ;Given a finding, return the first numeric85 ;portion of one of the "CSUB" values. Based on original work86 ;by R. Silverman.87 S VALUE=$G(FIEVAL(LIST(1),LIST(2),LIST(3)))88 S VALUE=$$FIRSTNUM(VALUE)89 Q90 ;91 FIRSTNUM(STRING) ;return the first numeric portion of a string.92 N CHAR,DONE,IND,NUMBER,NUMERIC93 S NUMERIC="+-.1234567890"94 S STRING=$TR(STRING," ")95 S DONE=0,IND=0,NUMBER=""96 F Q:DONE D97 . S IND=IND+1,CHAR=$E(STRING,IND)98 . I CHAR="" S DONE=1 Q99 . I NUMERIC[CHAR S NUMBER=NUMBER_CHAR100 . I NUMBER'="",NUMERIC'[CHAR S DONE=1101 Q +NUMBER102 ;103 ;============================================104 84 VALUE(LIST,FIEVAL,VALUE) ;Given a finding return one of its "CSUB" 105 85 ;values. -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMFFAT.m
r628 r636 1 PXRMFFAT ;SLC/PKR - Function Finding argument type routines. ;0 9/11/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMFFAT ;SLC/PKR - Function Finding argument type routines. ;08/03/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;============================================ … … 48 48 ; 49 49 ;============================================ 50 NUMERIC(AN) ;51 Q $S(AN=1:"F",AN=2:"N",AN=3:"S",1:"U")52 ;53 ;============================================54 50 VALUE(AN) ; 55 51 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/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMFFDB ;SLC/PKR - Function finding data structure builder. ;06/22/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;=========================================== … … 68 68 N PFSTACK,REPL,RS,TEMP,TS,XS 69 69 S IENB=DA_","_DA(1)_"," 70 S OPER="!& -+<>='"70 S OPER="!&<>='" 71 71 S XS=$$PSPACE(X) 72 72 D POSTFIX^PXRMSTAC(XS,OPER,.PFSTACK) … … 140 140 PSPACE(OPR) ;OPR is an operand in a function finding, if some portion 141 141 ;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) 152 149 Q OPR 153 150 ; … … 198 195 N DAI,DATE,FUNIEN,IND,LIST,MFUN,OPER,PFSTACK,TEMP,TEXT,VALID 199 196 S DAI=DA(1) 200 S OPER="!& -+<>='"197 S OPER="!&<>='" 201 198 ;Define the allowed M functions. 202 199 S MFUN("$P")="" -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMGECN.m
r628 r636 1 PXRMGECN ;SLC/JVS GEC-Score Reports-cont'd ; 06/01/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMGECN ;SLC/JVS GEC-Score Reports-cont'd ;6/19/03 20:58 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 Q 4 4 SUM ;By Summary by Patient 5 5 N CAT,HF,DATE,DFN,Y,HFN,CNTREF,X,REFNUM,SUM,GSUM,CATDANA 6 N DATER,SDATE ,SCNT6 N DATER,SDATE 7 7 D E^PXRMGECV("HS1",1,BDT,EDT,"F",DFNONLY) 8 8 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/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMHF ; SLC/PKR - Handle Health Factor findings. ;12/23/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;===================================================== … … 142 142 N EM,FIEN,IND,JND,LVL,NOUT,PNAME,TEMP,TEXTOUT,VDATE 143 143 S FIEN=$P(IFIEVAL("FINDING"),";",1) 144 ;DBIA #3083145 144 S PNAME=$P(^AUTTHF(FIEN,0),U,1) 146 145 S NLINES=NLINES+1 -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMINDC.m
r628 r636 1 PXRMINDC ; SLC/PKR - Index counting routines. ;0 3/06/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMINDC ; SLC/PKR - Index counting routines. ;04/20/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;======================================================== 5 5 CNT5(FILENUM,COUNT) ;Get date counts for indexes where the date 6 6 ;is at subscript 5. Works for file numbers: 7 ;63, 70, 120.5, 601.2, 601.84,7 ;63, 70, 120.5, 601.2, 8 8 ;9000010.11, 9000010.12, 9000010.13, 9000010.16, 9000010.23 9 9 N DAS,DATE,DFN,IND,ITEM,YEAR … … 177 177 S ROUTINE(120.5)="CNT5^PXRMINDC" 178 178 S ROUTINE(601.2)="CNT5^PXRMINDC" 179 S ROUTINE(601.84)="CNT5^PXRMINDC"180 179 S ROUTINE(9000011)="CNTPL^PXRMINDC" 181 180 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. ;0 3/06/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMINDD ; SLC/PKR - Index string date checking routines. ;05/02/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;======================================================== 5 5 CNT5(FILENUM,NSD) ;Check for string dates for indexes where the date 6 6 ;is at subscript 5. Works for file numbers: 7 ;63, 70, 120.5, 601.2, 601.847 ;63, 70, 120.5, 601.2, 8 8 ;9000010.11, 9000010.12, 9000010.13, 9000010.16, 9000010.23 9 9 N DAS,DATE,DFN,IND,ITEM … … 177 177 S ROUTINE(120.5)="CNT5^PXRMINDD" 178 178 S ROUTINE(601.2)="CNT5^PXRMINDD" 179 S ROUTINE(601.84)="CNT5^PXRMINDD"180 179 S ROUTINE(9000011)="CNTPL^PXRMINDD" 181 180 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/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMINDL ; SLC/PKR - List building routines. ;07/17/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ;================================================ 4 4 EVALPL(FINDPA,ENODE,TERMARR,PLIST) ;General patient list term evaluator. … … 25 25 N DAS,DATE,DFN,DS,NFOUND 26 26 K ^TMP($J,PLIST) 27 I FILENUM=601. 84D SEVALPL^PXRMMH(ITEM,NOCC,BDT,EDT,PLIST) Q27 I FILENUM=601.2 D SEVALPL^PXRMMH(ITEM,NOCC,BDT,EDT,PLIST) Q 28 28 S DS=$S(EDT[".":EDT+.0000001,1:EDT+.240001) 29 29 S DFN=0 … … 84 84 D SSPAR^PXRMUTIL(PFINDPA(0),.NOCC,.BDT,.EDT) 85 85 S INVFD=$P(PFINDPA(0),U,16) 86 S NOCC=$S(NOCC<0:-NOCC,1:NOCC) 86 87 D GETSTATI^PXRMSTAT(FILENUM,.PFINDPA,.STATUSA) 87 88 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) 92 90 I SSFIND D FPLISTSS(FILENUM,SNODE,ITEM,NGET,BDT,EDT,USESTRT,TGLIST) 93 91 I 'SSFIND D FPLIST(FILENUM,SNODE,ITEM,NGET,BDT,EDT,TGLIST) … … 104 102 .. I PFINDPA(0)["LAB(60" S DAS=ITEM_"~"_DAS 105 103 ..;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) 107 105 .. D GETDATA^PXRMDATA(FILENUM,DAS,.FIEVD) 108 106 .. 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/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMINDX ; SLC/PKR - Routines for utilizing the index. ;07/17/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ;Code for patient findings. 4 4 ;================================================================ … … 58 58 S SDIR=$S(NOCC<0:+1,1:-1) 59 59 S NOCC=$S(NOCC<0:-NOCC,1:NOCC) 60 S NGET=$S(UCIFS: 50,1:NOCC)60 S NGET=$S(UCIFS:"*",1:NOCC) 61 61 ;Determine if this is a finding with a start and stop date. 62 62 S SSFIND=$S(FILENUM=52:1,FILENUM["55":1,FILENUM=100:1,1:0) … … 75 75 . I PFINDPA(0)["LAB(60" S DAS=ITEM_"~"_DAS 76 76 .;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) 78 78 . D GETDATA^PXRMDATA(FILENUM,DAS,.FIEVD) 79 79 . I INVFD D GETDATA^PXRMVSIT(FIEVD("VISIT"),.FIEVD,0) … … 101 101 ;data for regular files. FLIST is returned in date order, i.e., 102 102 ;FLIST(1) is the most recent SDIR=-1, oldest SDIR=+1. 103 I FILENUM=601. 84D SEVALFI^PXRMMH(DFN,ITEM,NGET,SDIR,BDT,EDT,.NFOUND,.FLIST) Q103 I FILENUM=601.2 D SEVALFI^PXRMMH(DFN,ITEM,NGET,SDIR,BDT,EDT,.NFOUND,.FLIST) Q 104 104 N DAS,DATE,DONE,EDTT 105 105 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. ;0 3/13/20062 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMISE ; SLC/PKR - Index size estimating routines. ;01/12/2005 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;======================================================== … … 37 37 W !,"Queue the Clinical Reminders index size estimation." 38 38 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")_" " 41 40 S DIR(0)="DAU"_U_MINDT_"::RSX" 42 41 D ^DIR -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLCD.m
r628 r636 1 PXRMLCD ; SLC/PKR - Reminder Patient List Patients ; 11/02/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMLCD ; SLC/PKR - Reminder Patient List Patients ;06/30/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;Display list creation documentation. … … 12 12 S IND="",PXRMDONE=0 13 13 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) 15 15 . D EN^PXRMLCD(LISTIEN) 16 16 S VALMBCK="R" … … 40 40 ;=========================================================== 41 41 HDR ; 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) 44 43 S VALMSG="+ Next Screen - Prev Screen ?? More Actions" 45 44 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLCR.m
r628 r636 1 PXRMLCR ; SLC/PJH - Create Patient List from individual finding rule; 10/18/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMLCR ; SLC/PJH - Create Patient List from individual finding rule; 08/03/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ; Called from PXRM PATIENT LIST CREATE protocol … … 37 37 TPAT S PXRMTPAT=$$ASKYN^PXRMEUT("N","Include test patients on the list") 38 38 Q:$D(DTOUT) G:$D(DUOUT) DPAT 39 I $G(PXRMDEBG) D RUN^PXRMLCR(PXRMRULE,PXRMLIST,PXRMNODE,BEG,END,PXRMDPAT,PXRMTPAT) Q40 39 ;Build patient list in background 41 40 N ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE … … 85 84 ; 86 85 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 messagesto 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!" 90 89 D HELP^PXRMEUT(.HTEXT) 91 90 Q … … 96 95 S DIC("A")=TEXT 97 96 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" 101 98 W ! 102 99 D ^DIC … … 158 155 RUN(PXRMRULE,PXRMLIST,PXRMNODE,BEG,END,PXRMDPAT,PXRMTPAT) ; 159 156 ;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) 161 158 ;Clear ^TMP lists created for rule 162 159 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/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMLIST ; SLC/PKR/PJH - Clinical Reminders list functions. ;10/04/2000 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ;Used in the reminder exchange utility for building lists of 4 4 ;reminders, Exchange File entries, etc. … … 11 11 ; 12 12 ;======================================================= 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 13 FRE(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," ") 17 19 S TSOURCE=$E($P(SOURCE,",",1),1,12)_"@"_$E($P(SOURCE," at ",2),1,12) 18 S TEMP=TEMP_ U_TSOURCE20 S TEMP=TEMP_$$LJ^XLFSTR(TSOURCE,23," ") 19 21 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 23 24 ; 24 25 ;======================================================= … … 74 75 ; 75 76 ;======================================================= 76 RE XL(RLIST) ;Build a list of exchangerepository entries.77 N DATE, EXIEN,FMTSTR,IND,NAME,NL,NUM,OUTPUT,SOURCE,STR77 RE(RLIST,IEN) ;Build a list of repository entries. 78 N DATE,IND,NAME,SOURCE 78 79 ;Build the list in alphabetical order. 79 S FMTSTR=$$LMFMTSTR^PXRMTEXT(.VALMDDF,"RLLL") 80 S (NUM,VALMCNT)=0 80 S VALMCNT=0 81 81 S NAME="" 82 82 F S NAME=$O(^PXD(811.8,"B",NAME)) Q:NAME="" D 83 83 . S DATE="" 84 84 . 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 94 91 Q 95 92 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLLED.m
r628 r636 1 PXRMLLED ; SLC/PJH - Edit a location list. ; 06/25/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMLLED ; SLC/PJH - Edit a location list. ;12/23/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;================================================================ … … 64 64 S DR(2,810.9001)=".01;1" 65 65 D ^DIE 66 I $D(Y) G RD66 I $D(Y) G DES 67 67 ; 68 68 ;Hospital Locations -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLOCF.m
r628 r636 1 PXRMLOCF ; SLC/PKR - Handle location findings. ; 10/11/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMLOCF ; SLC/PKR - Handle location findings. ;07/17/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ;This routine is for location list patient findings. 4 4 ;================================================= 5 5 ALL(FILENUM,DFN,PFINDPA,FIEVAL) ;Get all Visits with a location 6 6 ;for a patient. 7 N BDT, BTIME,CASESEN,COND,CONVAL,DAS,DATE,DEND,DONE,DS,EDT,FIEVD8 N ICOND,IN VBD,INVDATE,INVDT,INVED,NFOUND,NOCC9 N SAVE,SDIR,TEMP, TIME,UCIFS7 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 10 10 ;Set the finding search parameters. 11 11 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) 13 13 S NOCC=$S(NOCC<0:-NOCC,1:NOCC) 14 14 D SCPAR^PXRMCOND(.PFINDPA,.CASESEN,.COND,.UCIFS,.ICOND,.VSLIST) 15 15 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) 22 18 ;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 45 40 ;Save the finding result. 46 D SFRES^PXRMUTIL( -SDIR,NFOUND,.FIEVAL)41 D SFRES^PXRMUTIL(SDIR,NFOUND,.FIEVAL) 47 42 S FIEVAL("FILE NUMBER")=FILENUM 48 43 Q … … 92 87 ;Set the finding search parameters. 93 88 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) 95 91 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) 98 93 ;Get a list of unique locations. 99 94 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) 101 96 I NFOUND=0 S FIEVAL=0 Q 102 97 S NP=0 … … 121 116 ; 122 117 ;================================================= 123 FPDAT(DFN,HLOCL,NOCC, SDIR,BDT,EDT,NFOUND,FLIST) ;Find patient data for118 FPDAT(DFN,HLOCL,NOCC,BDT,EDT,NFOUND,FLIST) ;Find patient data for 124 119 ;visits at a specified hospital location. Return up to NOCC most 125 120 ;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 139 141 . 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 162 143 .. S NFOUND=NFOUND+1 163 .. S FLIST(NFOUND)=DLIST( INVDT,NF)144 .. S FLIST(NFOUND)=DLIST(DATE,NF)_U_DATE 164 145 K ^TMP($J,"HLOCL") 165 146 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLOCL.m
r628 r636 1 PXRMLOCL ; SLC/PKR - Handle location findings. ;07/ 26/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMLOCL ; SLC/PKR - Handle location findings. ;07/17/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ;This routine is for location list patient lists. 4 4 ;============================================= … … 33 33 ;a visit to a hospital location. Return the list in ^TMP($J,PLIST). 34 34 N BTIME,DAS,DATE,DEND,DFN,DONE,DS,ETIME,HLOC,INVBD,INVDATE,INVDT,INVED 35 N NFOUND, SC,TEMP,TGLIST,TIME35 N NFOUND,TEMP,TGLIST,TIME 36 36 S TGLIST="FPLIST_PXRMLOCL" 37 37 K ^TMP($J,TGLIST) 38 S DEND=$S(EDT[".":EDT,1:EDT+.2 35959)38 S DEND=$S(EDT[".":EDT,1:EDT+.240001) 39 39 ;"AHL" in Visit file is inverse date_.time instead of a full inverse 40 40 ;date and time. For example if the date/time is 3030704.104449 then 41 41 ;"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- .00000142 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 45 45 S HLOC="" 46 46 F S HLOC=$O(^TMP($J,HLOCL,HLOC)) Q:HLOC="" D … … 50 50 .. S INVDATE=$P(INVDT,".",1) 51 51 .. I INVDATE>INVBD S DONE=1 Q 52 .. S TIME= "."_$P(INVDT,".",2)52 .. S TIME=+("."_$P(INVDT,".",2)) 53 53 .. I INVDATE=INVED,TIME>ETIME Q 54 .. I INVDATE=INVBD, TIME<BTIMEQ54 .. I INVDATE=INVBD,BTIME>TIME S DONE=1 Q 55 55 .. S DAS=0 56 56 .. F S DAS=$O(^AUPNVSIT("AHL",HLOC,INVDT,DAS)) Q:DAS="" D … … 58 58 ... I '$$VAPSTAT^PXRMVSIT(DAS) Q 59 59 ... S TEMP=^AUPNVSIT(DAS,0) 60 ... S DFN=$P(TEMP,U,5) 60 61 ... 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 64 63 ;Return the NOCC most recent for each patient. 65 64 S DFN=0 … … 75 74 ; 76 75 ;============================================= 77 FTEST(FILENUM,HLOCL,NOCC,BDT,EDT,PLIST) ;Find patient list data for78 ;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,INVED80 N NFOUND,TEMP,TGLIST,TIME81 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="" D86 . S DATE=DS87 . F S DATE=+$O(^AUPNVSIT("AHDP",HLOC,DATE),-1) Q:(DATE=0)!(DATE<BDT) D88 .. S DFN=""89 .. F S DFN=$O(^AUPNVSIT("AHDP",HLOC,DATE,DFN)) Q:DFN="" D90 ... S SC=""91 ... F S SC=$O(^AUPNVSIT("AHDP",HLOC,DATE,DFN,SC)) Q:SC="" D92 .... S DAS=$O(^AUPNVSIT("AHDP",HLOC,DATE,DFN,SC,""))93 .... I '$$VAPSTAT^PXRMVSIT(DAS) Q94 .... S ^TMP($J,TGLIST,DFN,DATE,DAS)=HLOC95 ;Return the NOCC most recent for each patient.96 S DFN=097 F S DFN=$O(^TMP($J,TGLIST,DFN)) Q:DFN="" D98 . S DATE="",NFOUND=099 . F S DATE=$O(^TMP($J,TGLIST,DFN,DATE),-1) Q:(NFOUND=NOCC)!(DATE="") D100 .. S DAS=""101 .. F S DAS=$O(^TMP($J,TGLIST,DFN,DATE,DAS)) Q:(NFOUND=NOCC)!(DAS="") D102 ... S NFOUND=NFOUND+1103 ... S ^TMP($J,PLIST,DFN,NFOUND)=DAS_U_DATE_U_^TMP($J,TGLIST,DFN,DATE,DAS)104 K ^TMP($J,TGLIST)105 Q106 ;107 ;=============================================108 76 GPLIST(FILENUM,SNODE,ITEM,PFINDPA,PLIST) ;Add to the patient list. 109 77 ; Return the list in ^TMP($J,PLIST). … … 115 83 ;Set the finding search parameters. 116 84 D SSPAR^PXRMUTIL(PFINDPA(0),.NOCC,.BDT,.EDT) 117 ;Ignore negative occurrence count, date reversal not allowed in118 ;patient lists.119 85 S NOCC=$S(NOCC<0:-NOCC,1:NOCC) 120 86 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) 122 88 ;Get a list of unique locations. 123 89 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 ;0 9/06/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMLPAU ; SLC/AGP - Reminder Patient List ;07/29/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;Main entry point for PXRM PATIENT LIST … … 83 83 Q 84 84 ; 85 ADD ;add a user 85 ADD ;add a users 86 86 N CREAT,CNT,DIC,DIE,FDA,MSG,USER,Y 87 87 S CREAT=$P($G(^PXRMXP(810.5,IEN,0)),U,7) … … 105 105 I $D(DIROUT) S DTOUT=1 106 106 I $D(DTOUT)!($D(DUOUT)) Q 107 I $G(Y)="" W !,"A level of control must be entered." H 2 Q107 I $G(Y)="" W !,"A status must be enter" H 2 Q 108 108 S YESNO=$E(Y(0)) 109 109 S FDA(810.54,"+2,"_IEN_",",.01)=USER … … 146 146 HELP(CALL) ;General help text routine 147 147 N HTEXT 148 ; 148 149 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 ; 153 155 D HELP^PXRMEUT(.HTEXT) 154 156 Q … … 161 163 N CREAT,IND,LISTIEN,NODE 162 164 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 2165 .W !,"Only the creator of this list can delete an user." H 2 164 166 D EN^VALM2(XQORNOD(0)) 165 167 ;If there is no list quit. … … 170 172 .S LISTIEN=^TMP("PXRMLPAU",$J,"IDX",IND,IND) 171 173 .S DA(1)=IEN,DA=LISTIEN,DIK="^PXRMXP(810.5,"_DA(1)_",40," D ^DIK 172 .W !,"P atient list deleted"174 .W !,"PATIENT DELETED" 173 175 ; 174 176 PDELEX ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLPHS.m
r628 r636 1 PXRMLPHS ; SLC/PJH,PKR - Run Health Summaries from Patient List ;0 3/26/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMLPHS ; SLC/PJH,PKR - Run Health Summaries from Patient List ;08/08/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;External Ref DBIA #398 … … 60 60 ; 61 61 QUE(HSIEN,PLNODE) ;Determine whether the report should be queued. 62 N PXRMQUE, %ZIS,ZTDESC,ZTRTN,ZTSK,ZTSAVE62 N PXRMQUE,RETZTSK,%ZIS,ZTDESC,ZTRTN,ZTSK,ZTSAVE 63 63 S %ZIS="M" 64 64 S ZTDESC="Patient List Health Summaries - print" … … 66 66 S ZTSAVE("HSIEN")="" 67 67 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) 69 70 S VALMBCK="R" 70 71 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLPP.m
r628 r636 1 PXRMLPP ; SLC/PKR/PJH - Reminder Patient List Patients ;0 4/04/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMLPP ; SLC/PKR/PJH - Reminder Patient List Patients ;01/06/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;Main entry point for PXRM PATIENT LIST 5 5 START(IEN) ; 6 N CDATE,CLASS,CREATOR, INDP,INTP,LDATA,LNAME,PXRMVIEW,SNAME,SOURCE,TYPE6 N CDATE,CLASS,CREATOR,LDATA,LNAME,PXRMVIEW,SNAME,SOURCE,TYPE 7 7 N VALMBCK,VALMBG,VALMCNT,VALMSG,X,XMZ,XQORM,XQORNOD 8 8 ;Get Patient List record and associated data. … … 33 33 S CLASS=$P($G(^PXRMXP(810.5,IEN,100)),U) 34 34 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)37 35 ;Default view by name. 38 36 S PXRMVIEW="N" … … 90 88 Q 91 89 ; 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 90 FRE(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 105 98 ; 106 99 HDR ; Header code 107 N TEXT 108 S VALMHDR(1)="List Name: "_LNAME 100 S VALMHDR(1)="List Name: "_LNAME_" ("_VALMCNT_" patients)" 109 101 S VALMHDR(2)=" Created: "_$$FMTE^XLFDT(CDATE,"5Z") 110 102 S VALMHDR(2)=$$LJ^XLFSTR(VALMHDR(2),40)_"Creator: "_CREATOR … … 112 104 S VALMHDR(3)=$$LJ^XLFSTR(VALMHDR(3),40)_"Type: "_TYPE 113 105 S VALMHDR(4)=" Source: "_SNAME 114 S VALMHDR(5)=" Number of patients: "_VALMCNT115 106 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"_TEXT121 D CHGCAP^VALM("HEADER2",TEXT)122 107 Q 123 108 ; … … 148 133 .;DBIA #10035 149 134 .S PNAME=$P(^DPT(DFN,0),U,1) 150 .I PNAME="" S PNAME=DFN_" does not exist"151 135 .S ^XTMP(PLNODE,PNAME)=DFN 152 136 D HSI^PXRMLPHS(PLNODE) … … 159 143 ; 160 144 LIST(VALMCNT,IEN,INCINST) ;Build a list of patients. 161 N DATA,D ECEASED,DFN,IND,INST,NEXT,PNAME,SUB,TESTP145 N DATA,DFN,IND,INST,NEXT,PNAME,SUB 162 146 ;Build the ordered list. 163 147 S IND=0,SUB="NAME" … … 165 149 .S DATA=$G(^PXRMXP(810.5,IEN,30,IND,0)) Q:DATA="" 166 150 .S DFN=$P(DATA,U) Q:'DFN 167 .S DECEASED=$P(DATA,U,4)168 .S TESTP=$P(DATA,U,5)169 151 .;#DBIA 10035 170 152 .S PNAME=$P($G(^DPT(DFN,0)),U,1) 171 .I PNAME="" S PNAME=DFN_" does not exist"172 153 .S INSTNUM=$P(DATA,U,2) S:INSTNUM="" INSTNUM="NONE" 173 154 .S INST=$P(DATA,U,3) … … 176 157 .I INST="" S INST="NONE" 177 158 .I PXRMVIEW="I" S SUB=INST 178 .S ^TMP("PXRMLPPA",$J,SUB,PNAME,DFN)= DECEASED_U_TESTP_U_INST159 .S ^TMP("PXRMLPPA",$J,SUB,PNAME,DFN)=INST 179 160 ;Transfer to list manager array 180 161 S SUB="",VALMCNT=0 … … 184 165 ..S DFN="" 185 166 ..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) 190 168 ...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) 192 170 ...S ^TMP("PXRMLPPI",$J,VALMCNT)=DFN 193 171 K ^TMP("PXRMLPPA",$J) -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLPU.m
r628 r636 1 PXRMLPU ; SLC/PKR/PJH - Reminder Patient List ; 10/11/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMLPU ; SLC/PKR/PJH - Reminder Patient List ;08/07/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;Main entry point for PXRM PATIENT LIST … … 31 31 ; 32 32 BLDLIST ; 33 N PLIST33 N IEN,PLIST 34 34 K ^TMP("PXRMLPU",$J) 35 35 K ^TMP("PXRMLPUH",$J) 36 36 S PLIST="PXRMLPU" 37 D LIST(MODE,PLIST )37 D LIST(MODE,PLIST,.IEN) 38 38 S VALMCNT=+$G(^TMP("PXRMLPU",$J,"VALMCNT")) 39 F IND=1:1:VALMCNT D 40 .S ^TMP("PXRMLPU",$J,"IDX",IND,IND)=IEN(IND) 39 41 Q 40 42 ; … … 54 56 Q 55 57 ; 58 FORMAT(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 ; 56 73 HDR ; Header code 57 74 N NAME … … 62 79 N HTEXT 63 80 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." 69 86 D HELP^PXRMEUT(.HTEXT) 70 87 Q … … 80 97 Q 81 98 ; 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") 99 LIST(MODE,PLIST,IEN) ;Build a list of patient list entries. 100 N ACCESS,COUNT,DATE,IND,FNAME,NAME,NODE,SUB,TYPE 86 101 ;MODE=0 build list in alphabetical order 87 102 ;MODE=1 build list by type of list. 88 103 K ^TMP($J,PLIST),^TMP(PLIST,$J) 89 S VALMCNT=0,NAME="", NUM=0,TYPE=""104 S VALMCNT=0,NAME="",TYPE="" 90 105 F S NAME=$O(^PXRMXP(810.5,"B",NAME)) Q:NAME="" D 91 106 .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) 94 109 ..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) 96 111 ..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) 98 113 ..S SUB=$S(MODE=0:"NAME",1:TYPE) 99 114 ..S ^TMP($J,PLIST,SUB,FNAME)=IND_U_DATE_U_COUNT_U_TYPE_U_ACCESS … … 104 119 S SUB="" 105 120 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) 117 126 S ^TMP(PLIST,$J,"VALMCNT")=VALMCNT 118 127 K ^TMP($J,PLIST) … … 136 145 F S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE) D 137 146 .;Get the patient list ien. 138 .S LISTIEN=^TMP(SUB,$J," SEL",IND)139 .D COPY^PXRMRUL 1(LISTIEN)147 .S LISTIEN=^TMP(SUB,$J,"IDX",IND,IND) 148 .D COPY^PXRMRULE(LISTIEN) 140 149 Q 141 150 ; … … 150 159 F S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE) D 151 160 .;Get the patient list ien. 152 .S LISTIEN=^TMP("PXRMLPU",$J," SEL",IND)161 .S LISTIEN=^TMP("PXRMLPU",$J,"IDX",IND,IND) 153 162 .S NODE=$G(^PXRMXP(810.5,LISTIEN,0)) 154 163 .S DELOK=$$LDELOK^PXRMEUT(LISTIEN) 155 .I DELOK D DELETE^PXRMRUL 1(LISTIEN) Q164 .I DELOK D DELETE^PXRMRULE(LISTIEN) Q 156 165 .E D Q 157 166 ..W !,"In order to delete a list you must be the creator or a Reminder Manager!" … … 177 186 F S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE) D 178 187 .;Get the patient list ien. 179 .S LISTIEN=^TMP("PXRMLPU",$J," SEL",IND)188 .S LISTIEN=^TMP("PXRMLPU",$J,"IDX",IND,IND) 180 189 .S NODE=$G(^PXRMXP(810.5,LISTIEN,0)) 181 190 .S ACCESS=$$ACCESS^PXRMLPU(LISTIEN,NODE) … … 196 205 S IND="" 197 206 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) 199 208 .D START^PXRMLPP(LISTIEN) 200 209 D BLDLIST … … 227 236 .W $C(7),!,"Only one item number allowed." H 2 228 237 .S VALMBCK="R" 229 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@(" SEL",SEL))) D Q238 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("IDX",SEL))) D Q 230 239 .W $C(7),!,SEL_" is not a valid item number." H 2 231 240 .S VALMBCK="R" 232 241 ; 233 242 ;Get the patient list ien 234 S LISTIEN=^TMP("PXRMLPU",$J," SEL",SEL)243 S LISTIEN=^TMP("PXRMLPU",$J,"IDX",SEL,SEL) 235 244 ;Get extract definition ien (if present) 236 245 S EPIEN=$P($G(^PXRMXP(810.5,LISTIEN,0)),U,5) … … 255 264 S DIR("B")="DSP" 256 265 S DIR("?")="Select from the codes displayed. For detailed help type ??" 257 S DIR("??")=U_"D HELP^PXRMLP U(1)"266 S DIR("??")=U_"D HELP^PXRMLPM(1)" 258 267 D ^DIR K DIR 259 268 I $D(DIROUT) S DTOUT=1 … … 264 273 ; 265 274 ;Copy patient list 266 I OPTION="CO" D COPY^PXRMRUL 1(LISTIEN)275 I OPTION="CO" D COPY^PXRMRULE(LISTIEN) 267 276 Q:$D(DUOUT)!$D(DTOUT) 268 277 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMLRM.m
r628 r636 1 PXRMLRM ; SLC/PJH/PKR - List Rule Management ; 0 9/06/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMLRM ; SLC/PJH/PKR - List Rule Management ; 05/15/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;Main entry point for PXRM LIST RULE MANAGEMENT … … 56 56 N HTEXT 57 57 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" 60 60 ; 61 61 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." 70 69 ; 71 70 D HELP^PXRMEUT(.HTEXT) -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMMH.m
r628 r636 1 PXRMMH ; SLC/PKR - Handle mental health findings. ; 11/23/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMMH ; SLC/PKR - Handle mental health findings. ;04/05/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;======================================================= … … 12 12 D EVALPL^PXRMINDL(.FINDPA,ENODE,.TERMARR,PLIST) 13 13 Q 14 ;15 14 ;======================================================= 16 15 EVALTERM(DFN,FINDPA,ENODE,TERMARR,TFIEVAL) ;Evaluate mental … … 20 19 ; 21 20 ;======================================================= 22 GETDATA(DAS P,FIEVT) ;Return the data for a MH Administrationsentry.21 GETDATA(DAS,FIEVT) ;Return the data for a Psych Instrument Patient entry. 23 22 ;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) 37 37 Q 38 38 ; 39 39 ;======================================================= 40 40 MHVOUT(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_" = " 43 46 S IND=0 44 47 F S IND=+$O(IFIEVAL(IND)) Q:IND=0 D 45 . S DATE= "("_$$EDATE^PXRMDATE(IFIEVAL(IND,"DATE"))_")"46 . S TEMP=MHTEST_DATE47 . 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"))_")" 51 54 . D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT) 52 55 . F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND) … … 57 60 OUTPUT(INDENT,IFIEVAL,NLINES,TEXT) ;Produce the clinical 58 61 ;maintenance output. 59 N IND,JND,MHTEST,NOUT,SCALE,SNAME,SCORE,TEXTOUT62 N DATE,IND,JND,MHTEST,NOUT,RATING,RSCORE,TEXTOUT,TSCORE 60 63 S MHTEST=IFIEVAL("MH TEST") 64 ;Remove the dashes surrounding the name. 65 S MHTEST=$TR(MHTEST,"-","") 61 66 S NLINES=NLINES+1 62 67 S TEXT(NLINES)=$$INSCHR^PXRMEXLC(INDENT," ")_"Mental Health Test: "_MHTEST 63 68 S IND=0 64 69 F S IND=+$O(IFIEVAL(IND)) Q:IND=0 D 70 . S DATE=IFIEVAL(IND,"DATE") 65 71 . 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 70 78 . D FORMATS^PXRMTEXT(INDENT+2,PXRMRM,TEMP,.NOUT,.TEXTOUT) 71 79 . F JND=1:1:NOUT S NLINES=NLINES+1,TEXT(NLINES)=TEXTOUT(JND) … … 75 83 ;======================================================= 76 84 SCHELP(MHIEN) ;Xecutable help for MH SCALE 77 N DATA,IND,JND,NUM,SCALE,SNUM85 N IND,JND,NUM,SCALE,TEMP,TEMP1 78 86 I MHIEN=0 D Q 79 87 . S SCALE(1)="This is not a valid Mental Health finding, selecting an MH scale does" 80 88 . S SCALE(2)="not make sense" 81 89 . 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) 92 96 . 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) 95 100 D EN^DDIOL(.SCALE) 96 101 Q 97 102 ; 98 103 ;======================================================= 99 SCHELPD(DA) ;Xecutable help for MH SCALE in Result Group file 801.41100 N MHIEN101 S MHIEN=+$P($G(^PXRMD(801.41,DA,50)),U)102 D SCHELP^PXRMMH(MHIEN)103 Q104 ;=======================================================105 104 SCHELPF ;Xecutable help for MH SCALE in 811.9 findings. 106 105 N FIND0,MHIEN 107 106 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) 109 108 E S MHIEN=0 110 109 D SCHELP(MHIEN) … … 115 114 N MHIEN,TFIND0 116 115 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) 118 117 E S MHIEN=0 119 118 D SCHELP(MHIEN) … … 121 120 ; 122 121 ;======================================================= 123 SCNAME(TEST,SCNUM) ;Given the test ien and scale number return the124 ;scale name.125 N DATA,SCNAME126 D SCALES^YTQPXRM5(.DATA,TEST)127 Q $G(DATA("S",SCNUM))128 ;129 ;=======================================================130 122 SEVALFI(DFN,ITEM,NGET,SDIR,BDT,EDT,NFOUND,FLIST) ; 131 N FIEV,FINDING,IND,YS, DATA123 N FIEV,FINDING,IND,YS,YSDATA 132 124 S YS("CODE")=ITEM,YS("DFN")=DFN 133 125 S YS("BEGIN")=BDT,YS("END")=EDT 134 ; PTTEST^YTQPXRM2does not understand "*" for a limit so use 99.126 ;YTAPI10A does not understand "*" for a limit so use 99. 135 127 I NGET="*" S NGET=99 136 128 S YS("LIMIT")=$S(SDIR=-1:NGET,1:-NGET) 137 ;DBIA # 5035138 D PTTEST^YT QPXRM2(.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) 140 132 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) 142 134 Q 143 135 ; … … 147 139 N YS 148 140 ;YTAPI10A does not understand "*" for a limit so use 99. 149 ;OCCUR^YTQPXRM1 does not understand "*" for a limit so use 99.150 141 I NOCC="*" S NOCC=99 151 142 S YS("CODE")=ITEM,YS("BEGIN")=BDT,YS("END")=EDT,YS("LIMIT")=NOCC 152 ;DBIA # 5034153 D OCCUR^YT QPXRM1(PLIST,.YS)143 ;DBIA #4458 144 D OCCUR^YTAPI10A(PLIST,.YS) 154 145 Q 155 146 ; … … 157 148 VSCALE(X,FIND0) ;Make sure that the mental health scale is valid. 158 149 ;Either the scale number or the scale name can be used. 159 N DATA,IND,MHIEN,MHTEST,SCALE,VALID150 N MHIEN,MHTEST,SCALE,VALID 160 151 S MHTEST=$P(FIND0,U,1) 161 152 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) 164 155 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) 170 158 Q VALID 171 ;172 ;=======================================================173 VSCALED(X,DA) ;Make sure that the mental health scale is valid for a result174 ;group.175 I X="" Q 1176 ;Do not execute as part of a verify fields.177 I $G(DIUTIL)="VERIFY FIELDS" Q 1178 ;Do not execute as part of exchange.179 I $G(PXRMEXCH) Q 1180 N MHTEST181 S MHTEST=$P($G(^PXRMD(801.41,DA,50)),U)182 Q $$VSCALE(X,MHTEST)183 159 ; 184 160 ;======================================================= … … 205 181 Q $$VSCALE(X,TFIND0) 206 182 ; 207 ;=======================================================208 WARN ;Warn the user that they must select a scale if they intend to use209 ;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 Q214 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMMST.m
r628 r636 1 PXRMMST ; SLC/PKR - Routines for dealing with MST. ;0 3/29/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMMST ; SLC/PKR - Routines for dealing with MST. ;07/17/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ;Use of DGMSTAPI supported by DBIA #2716. 4 4 ;==================================================== … … 231 231 . I TERMIEN="" Q 232 232 . D TERM^PXRMLDR(TERMIEN,.TERMARR) 233 . D EVALPL^PXRMTER L(.FINDPA,.TERMARR,INDEX)233 . D EVALPL^PXRMTERM(.FINDPA,.TERMARR,INDEX) 234 234 . S DFN=0 235 235 . 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/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMOUTC ; SLC/PKR - Clinical Maintenance output. ;10/07/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ;================================================ 4 4 CM(DEFARR,PXRMPDEM,PCLOGIC,RESLOGIC,RESDATE,FIEVAL) ;Prepare the 5 5 ;clinical maintenance output. 6 N IND, JND,FIDATA,FINDING,FLIST,FTYPE6 N IND,FIDATA,FINDING,FLIST,FTYPE 7 7 N HDR,NHDR,IFIEVAL,LIST,NFLINES,NTXT,NUM 8 8 N TEMP,TEXT … … 37 37 .. I '$D(FIDATA(FINDING)) Q 38 38 .. 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) 46 40 .. E S IFIEVAL=0 47 41 ..;If the finding is false all we need to do is process the not found … … 88 82 I FTYPE="PXRMD(811.4," D OUTPUT^PXRMCF(INDENT,.IFIEVAL,.NLINES,.TEXT) Q 89 83 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) Q84 I FTYPE="YTT(601," D OUTPUT^PXRMMH(INDENT,.IFIEVAL,.NLINES,.TEXT) Q 91 85 Q 92 86 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMOUTM.m
r628 r636 1 PXRMOUTM ; SLC/PKR - MyHealtheVet output. ; 07/06/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMOUTM ; SLC/PKR - MyHealtheVet output. ;10/12/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;================================================ … … 28 28 I FTYPE="PXRMD(811.4," D MHVOUT^PXRMCF(INDENT,.IFIEVAL,.NLINES,.TEXT) Q 29 29 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) Q30 I FTYPE="YTT(601," D MHVOUT^PXRMMH(INDENT,.IFIEVAL,.NLINES,.TEXT) Q 31 31 Q 32 32 ; … … 49 49 MHVD(DEFARR,PXRMPDEM,PCLOGIC,RESLOGIC,RESDATE,FIEVAL,WEB) ;Prepare the 50 50 ;MyHealtheVet detailed output. 51 N IND, JND,FIDATA,FINDING,FLIST,FTYPE51 N IND,FIDATA,FINDING,FLIST,FTYPE 52 52 N HDR,NHDR,IFIEVAL,LIST,NFLINES,NTXT,NUM 53 53 N TEXT … … 75 75 .. I '$D(FIDATA(FINDING)) Q 76 76 .. 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) 84 78 .. E S IFIEVAL=0 85 79 ..;Output the found/not found text for the finding. -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMP9E.m
r628 r636 18 18 D BM(" Code Set Update message fix (Remedy Ticket 175985)"),M(" ") 19 19 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" 21 21 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" 22 22 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. ;0 4/02/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMPARS ; SLC/PJH - Edit PXRM(800 reminder parameters. ;06/14/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;called by protocol PXRM EDIT SITE DISCLAIMER … … 11 11 D ^DIE 12 12 D FORMAT^PXRMDISC 13 Q14 ;15 MH(DA) ;Edit MH default Question Value16 Q:'$$LOCK(DA)17 N DIC,DIE,DR,Y18 ;Edit19 S DIE="^PXRM(800,",DR=1720 D ^DIE21 13 Q 22 14 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPDR.m
r628 r636 1 PXRMPDR ;SLC/AGP,PKR - Patient List Demographic report main routine ; 11/16/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMPDR ;SLC/AGP,PKR - Patient List Demographic report main routine ;07/17/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 EN(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 6 10 W @IOF 7 11 K ^TMP("PXRMPLD",$J),^TMP("PXRMPLN",$J) 8 S DELIM=012 S BACK=0,DELIM=0,QUIT=0 9 13 OPTION ; 10 14 W !,"Select the items to include on the report." 11 ADDSEL D ADDSEL^PXRMPDRS(. DDATA,"ADD")15 ADDSEL D ADDSEL^PXRMPDRS(.ADDDATA) 12 16 I $D(DTOUT)!$D(DUOUT) Q 13 APPSEL D APPSEL^PXRMPDRS(. DDATA,"APP")17 APPSEL D APPSEL^PXRMPDRS(.APPDATA) 14 18 I $D(DTOUT)!$D(DUOUT) G ADDSEL 15 DEMSEL D DEMSEL^PXRMPDRS(.D DATA,"DEM")19 DEMSEL D DEMSEL^PXRMPDRS(.DEMDATA) 16 20 I $D(DTOUT)!$D(DUOUT) G APPSEL 17 PFACSEL S DDATA("PFAC",0)=$$ASKYN^PXRMEUT("N","Include the patient's preferred facility")21 PFACSEL S PFACDATA(0)=$$ASKYN^PXRMEUT("N","Include the patient's preferred facility") 18 22 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) 24 ELIGSEL D ELIGSEL^PXRMPDRS(.ELIGDATA) 21 25 I $D(DTOUT)!$D(DUOUT) G PFACSEL 22 DATASEL D DATASEL^PXRMPDRS(PLIEN,. DDATA,"FIND")26 DATASEL D DATASEL^PXRMPDRS(PLIEN,.FINDDATA) 23 27 I $D(DTOUT)!$D(DUOUT) G ELIGSEL 24 INPSEL D INPSEL^PXRMPDRS(. DDATA,"INP")28 INPSEL D INPSEL^PXRMPDRS(.INPDATA) 25 29 I $D(DTOUT)!$D(DUOUT) G DATASEL 26 REMDATA D REMSEL^PXRMPDRS(PLIEN,. DDATA,"REM")30 REMDATA D REMSEL^PXRMPDRS(PLIEN,.REMDATA) 27 31 I $D(DTOUT)!$D(DUOUT) G INPSEL 28 32 S DELIM=$$ASKYN^PXRMEUT("Y","Delimited Report:") 29 33 I $D(DTOUT)!$D(DUOUT) G REMDATA 30 S DC=$S(DELIM:$$DELIMSEL^PXRMXSD,1:U)34 I DELIM S DC=$$DELIMSEL^PXRMXSD 31 35 I $D(DTOUT)!$D(DUOUT) G OPTION 32 36 DEVICE ; 33 N D ESC,DIR,PXRMQUE,RTN,SAVE,%ZIS37 N DIR,PXRMQUE,%ZIS,ZTDESC,ZTRTN,ZTSAVE 34 38 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 EXIT39 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 41 45 I $D(DTOUT)!$D(DUOUT) G EXIT 46 ; 42 47 S DIR(0)="E" D ^DIR 43 48 EXIT D KVA^VADPT … … 45 50 Q 46 51 ; 47 GET PDATA(DELIM,DC,PLIEN,DDATA) ;52 GETDATA(DELIM,PLIEN,DEMDATA,PFACDATA,ADDDATA,INPDATA,APPDATA,FINDDATA,REMDATA) ; 48 53 N DATA,DATE,DCREAT,DFN,DTYPE,ERRMSG 49 54 N GETADD,GETAPP,GETDEM,GETELIG,GETFIND,GETINP,GETREM … … 54 59 S LISTNAME=$P(^PXRMXP(810.5,PLIEN,0),U,1) 55 60 S DCREAT=$P(^PXRMXP(810.5,PLIEN,0),U,4) 56 S GETDEM=$S(D DATA("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) 63 68 S IEN=0 64 69 F S IEN=+$O(^PXRMXP(810.5,PLIEN,30,IEN)) Q:IEN=0 D … … 72 77 .. N VADM 73 78 .. D DEM^VADPT 74 .. F IND=1:1:D DATA("DEM","LEN") D75 ... S JND=$P(D DATA("DEM"),",",IND)76 ... S KND=0 77 ... F S KND=$O(D DATA("DEM",JND,KND)) Q:KND="" D78 .... S PIECE=$P(D DATA("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) 79 84 .... S TDATA=$P(VADM(KND),U,PIECE) 80 85 .... S LND="" … … 82 87 ..... I TDATA'="" S TDATA=TDATA_"~" 83 88 ..... S TDATA=TDATA_$P(VADM(KND,LND),U,PIECE) 84 .... I KND=2,'D DATA("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 D89 .... 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 88 93 ..;DBIA #1850 89 94 .. S TDATA=$$GET1^DIQ(2,DFN,27.02,"E","","ERRMSG") 90 95 .. I TDATA="" S TDATA="NONE" 91 .. S ^TMP("PXRMPLD",$J,DFN,"PFAC ")=TDATA96 .. S ^TMP("PXRMPLD",$J,DFN,"PFACDATA")=TDATA 92 97 . I GETADD D 93 98 .. N VAPA 94 99 .. D ADD^VADPT 95 .. F IND=1:1: DDATA("ADD","LEN") D96 ... S JND=$P( DDATA("ADD"),",",IND)97 ... S KND=0 98 ... F S KND=$O( DDATA("ADD",JND,KND)) Q:KND="" D99 .... 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) 100 105 .... S TDATA=$P(VAPA(KND),U,PIECE) 101 106 .... 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="" 103 108 . I GETINP D 104 109 .. N VAIP 105 110 .. D INP^VADPT 106 .. F IND=1:1: DDATA("INP","LEN") D107 ... S JND=$P( DDATA("INP"),",",IND)108 ... S KND=0 109 ... F S KND=$O( DDATA("INP",JND,KND)) Q:KND="" D110 .... 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) 111 116 .... S TDATA=$P(VAIN(KND),U,PIECE) 112 117 .... 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="" 114 119 . I GETELIG D 115 120 .. N VAEL 116 121 .. D ELIG^VADPT 117 .. F IND=1:1: DDATA("ELIG","LEN") D118 ... S JND=$P( DDATA("ELIG"),",",IND)119 ... S KND=0 120 ... F S KND=$O( DDATA("ELIG",JND,KND)) Q:KND="" D121 .... 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) 122 127 .... S TDATA=$P(VAEL(KND),U,PIECE) 123 128 .... I KND=4 S TDATA=$S(TDATA=1:"YES",1:"NO") 124 129 .... 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="" 126 131 . D KVA^VADPT 127 132 . I GETREM D 128 133 .. S IND=0 129 .. F S IND=$O( DDATA("REM","IEN",IND)) Q:IND="" D134 .. F S IND=$O(REMDATA("IEN",IND)) Q:IND="" D 130 135 ... S PDATA=$G(^PXRMXP(810.5,PLIEN,30,IEN,"REM",IND,0)) 131 136 ... I PDATA="" Q 132 137 ... 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="" 134 139 . I GETFIND D 135 140 .. N DL 136 .. F IND=1:1: DDATA("FIND","LEN") D137 ... 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) 139 144 ... S KND=$O(^PXRMXP(810.5,PLIEN,30,IEN,"DATA","B",DTYPE,"")) 140 145 ... S DL=$S(KND="":0,1:$L(^PXRMXP(810.5,PLIEN,30,IEN,"DATA",KND,0),U)) 141 146 ... 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)=DATA147 ... S ^TMP("PXRMPLD",$J,DFN,"FINDDATA",JND)=DATA 143 148 ;Get appointment data for all patients on the list. 144 149 I GETAPP D … … 146 151 . S ARRAY(1)=DT,ARRAY(3)="I;R" 147 152 . S ARRAY(4)="^TMP($J,""PXRMPL""",ARRAY("FLDS")="" 148 . F IND=1:1: DDATA("APP","LEN") D149 .. S JND=$P( DDATA("APP"),",",IND)153 . F IND=1:1:APPDATA("LEN") D 154 .. S JND=$P(APPDATA,",",IND) 150 155 .. 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_";" 152 157 . K ^TMP($J,"PXRMPL"),^TMP($J,"SDAMA301") 153 158 . S IND=0 … … 158 163 . I COUNT=-1 D Q 159 164 .. D APPERR^PXRMPDRS 160 .. S DDATA("APP","ERROR")=""165 .. S APPDATA("ERROR")="" 161 166 .. K ^TMP($J,"PXRMPL"),^TMP($J,"SDAMA301") 162 167 . F IND=1:1:COUNT D … … 172 177 ..... S TDATA=$P(TDATA,U,2),TDATA=$P(TDATA,";",2) 173 178 ..... S PDATA=PDATA_U_TDATA 174 ..... S ^TMP("PXRMPLD",$J,DFN,"APP ",KND)=PDATA179 ..... S ^TMP("PXRMPLD",$J,DFN,"APPDATA",KND)=PDATA 175 180 . 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) 178 183 Q 179 184 ; … … 184 189 ; 185 190 PAGE ; 186 I ($E(IOST ,1,2)="C-")&(IO=IO(0)) D191 I ($E(IOST)="C")&(IO=IO(0)) D 187 192 .S DIR(0)="E" 188 193 .W ! … … 191 196 W:$D(IOF) @IOF 192 197 S PAGE=PAGE+1 193 I ($E(IOST,1,2)="C-")&(IO=IO(0)) W @IOF194 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/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMPDRP ;SLC/AGP,PKR - Patient List Demographic report print routine ;06/20/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ADDTXT(TEXT) ;Accumulate text in ^TMP. … … 7 7 Q 8 8 ; 9 APPHDR(DC, DDATA,SUB) ;Build the appointment header.10 I DDATA(SUB,"LEN")'>0 Q9 APPHDR(DC,APPDATA) ;Build the appointment header. 10 I APPDATA("LEN")'>0 Q 11 11 N HDR,IND,JND,KND,LND,TEMP 12 12 S IND=0,HDR="" 13 F IND=1:1: DDATA(SUB,"MAX") D14 . F JND=1:1: DDATA(SUB,"LEN") D15 .. 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) 16 16 .. S LND="" 17 .. F S LND=$O( DDATA(SUB,KND,LND)) Q:LND="" D18 ... 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) 19 19 ... S HDR=HDR_TEMP_IND_DC 20 S DDATA(SUB,"HDR")=HDR21 Q 22 ; 23 APPPRINT(DFN, DDATA,SUB) ;Print appointment data.20 S APPDATA("HDR")=HDR 21 Q 22 ; 23 APPPRINT(DFN,APPDATA) ;Print appointment data. 24 24 N CLINIC,COUNT,DATE,HDR,IND,JND,KND,LINE,PCLINIC,PDATE,TEMP 25 25 S (PCLINIC,PDATE)=0 26 F IND=1:1: DDATA(SUB,"LEN") D27 . S JND=$P( DDATA(SUB),",",IND)26 F IND=1:1:APPDATA("LEN") D 27 . S JND=$P(APPDATA,",",IND) 28 28 . I JND=1 S PDATE=1 29 29 . I JND=2 S PCLINIC=1 30 30 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) 33 33 D ADDTXT(" ") 34 34 D ADDTXT("Appointment Data") 35 35 D ADDTXT(HDR) 36 36 S COUNT=0 37 F S COUNT=$O(^TMP("PXRMPLD",$J,DFN,"APP ",COUNT)) Q:COUNT="" D38 . 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)) 39 39 . S LINE="" 40 40 . I PDATE S LINE=LINE_$P(TEMP,U,1) … … 43 43 Q 44 44 ; 45 DELIMHDR(DC,D DATA,SUB) ;Build the delimited header for a data type.46 I D DATA(SUB,"LEN")'>0 Q45 DELIMHDR(DC,DATA) ;Build the delimited header for a data type. 46 I DATA("LEN")'>0 Q 47 47 N HDR,IND,JND,KND,LND,MAX,TEMP 48 48 S IND=0,HDR="" 49 F IND=1:1:D DATA(SUB,"LEN") D50 . S JND=$P(D DATA(SUB),",",IND)49 F IND=1:1:DATA("LEN") D 50 . S JND=$P(DATA,",",IND) 51 51 . S KND="" 52 . F S KND=$O(D DATA(SUB,JND,KND)) Q:KND="" D53 .. S TEMP=$P(D DATA(SUB,JND,KND),U,1)54 .. S MAX=$P(D DATA(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) 55 55 .. I MAX="" S HDR=HDR_TEMP_DC 56 56 .. I +MAX>0 F LND=1:1:MAX S HDR=HDR_TEMP_LND_DC 57 S D DATA(SUB,"HDR")=HDR58 Q 59 ; 60 DELIMPR(DC,PLIEN, DDATA) ;57 S DATA("HDR")=HDR 58 Q 59 ; 60 DELIMPR(DC,PLIEN,ADDDATA,APPDATA,DEMDATA,FINDDATA,INPDATA,PFACDATA,REMDATA) ; 61 61 ;Print the delimited report. 62 62 N DATALIST,DFN,IND,NDT,PNAME 63 63 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" 73 72 D TITLE(PLIEN,1) 74 ; Createthe delimited header.73 ;Output the delimited header. 75 74 F IND=1:1:NDT D 76 . I DATALIST(IND)="ADD " D DELIMHDR(DC,.DDATA,"ADD") Q77 . I DATALIST(IND)="APP " D APPHDR(DC,.DDATA,"APP") Q78 . I DATALIST(IND)="DEM " D DELIMHDR(DC,.DDATA,"DEM") Q79 . I DATALIST(IND)="ELIG " D DELIMHDR(DC,.DDATA,"ELIG") Q80 . I DATALIST(IND)="FIND " D DELIMHDR(DC,.DDATA,"FIND") Q81 . I DATALIST(IND)="INP " D DELIMHDR(DC,.DDATA,"INP") Q82 . I DATALIST(IND)="PFAC " D PFACHDR(.DDATA,"PFAC")83 . I DATALIST(IND)="REM " D REMHDR(DC,.DDATA,"REM") Q84 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) 85 84 S PNAME=":" 86 85 F S PNAME=$O(^TMP("PXRMPLN",$J,PNAME)) Q:PNAME="" D … … 89 88 .. W !,PNAME_DC 90 89 .. F IND=1:1:NDT D 91 ... I DATALIST(IND)="ADD " D PDELDATA(DFN,DC,DATALIST(IND),.DDATA,"ADD") Q92 ... I DATALIST(IND)="APP " D PAPPDATA(DFN,DC,.DDATA,"APP") Q93 ... I DATALIST(IND)="DEM " D PDELDATA(DFN,DC,DATALIST(IND),.DDATA,"DEM") Q94 ... I DATALIST(IND)="ELIG " D PDELDATA(DFN,DC,DATALIST(IND),.DDATA,"ELIG") Q95 ... I DATALIST(IND)="FIND " D PFINDATA(DFN,DC,.DDATA,"FIND") Q96 ... I DATALIST(IND)="INP " D PDELDATA(DFN,DC,DATALIST(IND),.DDATA,"INP") Q97 ... I DATALIST(IND)="PFAC " D PFACDATA(DFN,.DDATA,"PFAC") Q98 ... I DATALIST(IND)="REM " D PREMDATA(DFN,DC,.DDATA,"REM") Q90 ... 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 99 98 .. W "\\" 100 99 Q 101 100 ; 102 DELTITLE(DC,DATALIST,DDATA) ;Combine all the headers to create the delimited title. 101 DELTITLE(DC,ADDDATA,APPDATA,DEMDATA,FINDDATA,INPDATA,PFACDATA,REMDATA) ;Combine 102 ;all the headers to create the delimited title. 103 103 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")) 106 112 W "\\" 107 113 Q 108 114 ; 109 FINDPR(DFN, DDATA,SUB) ;Print finding information.115 FINDPR(DFN,FINDDATA) ;Print finding information. 110 116 N IND,JND,LINE,TEMP 111 117 D ADDTXT(" ") 112 118 S LINE="Finding Data" 113 119 D ADDTXT(LINE) 114 F IND=1:1: DDATA(SUB,"LEN") D115 . 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)) 117 123 . I TEMP="" Q 118 . S LINE=" "_$P( DDATA(SUB,JND,JND),U,1)_": "_TEMP124 . S LINE=" "_$P(FINDDATA(JND,JND),U,1)_": "_TEMP 119 125 . D ADDTXT(LINE) 120 126 Q … … 134 140 ; 135 141 PAGE ; 136 I ($E(IOST ,1,2)="C-")&(IO=IO(0)) D142 I ($E(IOST)="C")&(IO=IO(0)) D 137 143 . N DIR 138 144 . S DIR(0)="E" … … 141 147 I $D(DUOUT)!$D(DTOUT) Q 142 148 W:$D(IOF) @IOF 143 I ($E(IOST,1,2)="C-")&(IO=IO(0)) W @IOF144 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 ; 152 PAPPDATA(DFN,DC,APPDATA) ;Print the delimited appointment data. 147 153 N IND,JND,KND,LINE,LND,PIECE,TEMP 148 I DDATA(SUB,"LEN")'>0 Q154 I APPDATA("LEN")'>0 Q 149 155 S LINE="" 150 F IND=1:1: DDATA(SUB,"MAX") D151 . S TEMP=$G(^TMP("PXRMPLD",$J,DFN,"APP ",IND))152 . F JND=1:1: DDATA(SUB,"LEN") D153 .. 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) 154 160 .. S LND="" 155 .. F S LND=$O( DDATA(SUB,KND,LND)) Q:LND="" D156 ... 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) 157 163 ... S LINE=LINE_$P(TEMP,U,PIECE)_DC 158 164 W LINE 159 165 Q 160 166 ; 161 PDELDATA(DFN,DC,DTYPE,D DATA,SUB) ;Print the delimited data.167 PDELDATA(DFN,DC,DTYPE,DATA) ;Print the delimited data. 162 168 N IND,JND,KND,LINE,LND,TEMP,TTEMP 169 I DATA("LEN")'>0 Q 163 170 S TEMP=$G(^TMP("PXRMPLD",$J,DFN,DTYPE)) 164 171 S LINE="" 165 F IND=1:1:D DATA(DTYPE,"LEN") D166 . S JND=$P(D DATA(DTYPE),",",IND)172 F IND=1:1:DATA("LEN") D 173 . S JND=$P(DATA,",",IND) 167 174 . S KND="" 168 . F S KND=$O(D DATA(DTYPE,JND,KND)) Q:KND="" D169 .. S MAX=$P(D DATA(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) 170 177 .. I MAX="" S LINE=LINE_$P(TEMP,U,KND)_DC Q 171 178 .. I +MAX>1 S TTEMP=$P(TEMP,U,KND) F LND=1:1:MAX S LINE=LINE_$P(TTEMP,"~",LND)_DC … … 173 180 Q 174 181 ; 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 Q181 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 Q182 PFACHDR(PFACDATA) ;Build the preferred facility header. 183 I PFACDATA(0)=1 S PFACDATA("HDR")="PATIENT'S PREFERRED FACILITY" 184 Q 185 ; 186 PFACDATA(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 ; 191 PFACPR(DFN,PFACDATA) ;Print the patient's preferred facility. 192 I PFACDATA(0)=0 Q 186 193 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 ; 197 PFINDATA(DFN,DC,FINDDATA) ;Print the finding data. 191 198 N IND,JND,LINE,TEMP 192 I DDATA(SUB,"LEN")'>0 Q199 I FINDDATA("LEN")'>0 Q 193 200 S LINE="" 194 F IND=1:1: DDATA(SUB,"LEN") D195 . 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)) 197 204 . S LINE=LINE_TEMP_DC 198 205 W LINE 199 206 Q 200 207 ; 201 PREMDATA(DFN,DC, DDATA,SUB) ;Print the reminder data.208 PREMDATA(DFN,DC,REMDATA) ;Print the reminder data. 202 209 N IND,JND,LINE,TEMP 203 I DDATA(SUB,"LEN")'>0 Q210 I REMDATA("LEN")'>0 Q 204 211 S LINE="" 205 F IND=1:1: DDATA(SUB,"LEN") D206 . S JND=$P( DDATA(SUB),",",IND)207 . S LINE=LINE_ DDATA(SUB,"RNAME",JND)_DC208 . 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))) 209 216 . S LINE=LINE_$P(TEMP,U,2)_DC_$P(TEMP,U,3)_"^"_$P(TEMP,U,4)_DC 210 217 W LINE 211 218 Q 212 219 ; 213 REGPR(PLIEN, DDATA,SUB) ;220 REGPR(PLIEN,ADDDATA,APPDATA,DEMDATA,FINDDATA,INPDATA,PFACDATA,REMDATA) ; 214 221 ;Print the regular report.. 215 222 N DATATYPE,DFN,PNAME,LINCNT … … 225 232 .. S DATATYPE="" 226 233 .. F S DATATYPE=$O(^TMP("PXRMPLD",$J,DFN,DATATYPE)) Q:DATATYPE="" D 227 ... I DATATYPE="ADD " D VADPTPR(DFN,"Address Data",DATATYPE,.DDATA,"ADD") Q228 ... I DATATYPE="APP " D APPPRINT(DFN,.DDATA,"APP") Q229 ... I DATATYPE="DEM " D VADPTPR(DFN,"Demographic Data",DATATYPE,.DDATA,"DEM") Q230 ... I DATATYPE="ELIG " D VADPTPR(DFN,"Eligibility Data",DATATYPE,.DDATA,"ELIG") Q231 ... I DATATYPE="FIND " D FINDPR(DFN,.DDATA,"FIND") Q232 ... I DATATYPE="INP " D VADPTPR(DFN,"Inpatient Data",DATATYPE,.DDATA,"INP") Q233 ... I DATATYPE="PFAC " D PFACPR(DFN,.DDATA,"PFAC") Q234 ... I DATATYPE="REM " D REMPR(DFN,.DDATA,"REM") Q234 ... 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 235 242 D OUTPUT 236 243 K ^TMP("PXRMPDEM",$J) 237 244 Q 238 245 ; 239 REMHDR(DC, DDATA,SUB) ;Build the reminder data delimited header.246 REMHDR(DC,REMDATA) ;Build the reminder data delimited header. 240 247 N HDR,IND,JND 241 248 S HDR="" 242 F IND=1:1: DDATA(SUB,"LEN") D243 . S JND=$P( DDATA(SUB),",",IND)249 F IND=1:1:REMDATA("LEN") D 250 . S JND=$P(REMDATA,",",IND) 244 251 . S HDR=HDR_"REMINDER"_JND_DC_"STATUS"_JND_DC_"DUE DATE"_JND_DC_"LAST DONE"_JND_DC 245 S DDATA(SUB,"HDR")=HDR246 Q 247 ; 248 REMPR(DFN, DDATA,SUB) ;Print reminder status information.252 S REMDATA("HDR")=HDR 253 Q 254 ; 255 REMPR(DFN,REMDATA) ;Print reminder status information. 249 256 N DUE,IND,JND,LAST,LINE,NSP,STATUS,TEMP 250 257 D ADDTXT(" ") 251 258 S LINE="Reminder:"_$$INSCHR^PXRMEXLC(27," ")_"--STATUS-- --DUE DATE-- --LAST DONE--" 252 259 D ADDTXT(LINE) 253 F IND=1:1: DDATA(SUB,"LEN") D254 . 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)) 257 264 . I TEMP="" Q 258 265 . S STATUS=$P(TEMP,U,2) 259 266 . S DUE=$P(TEMP,U,3),DUE=$$EDATE^PXRMDATE(DUE) 260 267 . 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," ")_STATUS268 . S NSP=38-$L(REMDATA("RNAME",JND)) 269 . S LINE=REMDATA("RNAME",JND)_$$INSCHR^PXRMEXLC(NSP," ")_STATUS 263 270 . S NSP=54-$L(LINE)-($L(DUE)/2) 264 271 . S LINE=LINE_$$INSCHR^PXRMEXLC(NSP," ")_DUE … … 282 289 Q 283 290 ; 284 VADPTPR(DFN,DNAME,DTYPE,D DATA,SUB) ;Print data returned by a VADPT call.291 VADPTPR(DFN,DNAME,DTYPE,DATA) ;Print data returned by a VADPT call. 285 292 N IND,JND,KND,LINE,LND,MAX,TEMP,TTEMP 286 293 D ADDTXT(" ") 287 294 D ADDTXT(DNAME) 288 295 S TEMP=$G(^TMP("PXRMPLD",$J,DFN,DTYPE)) 289 F IND=1:1:D DATA(SUB,"LEN") D290 . S JND=$P(D DATA(SUB),",",IND)296 F IND=1:1:DATA("LEN") D 297 . S JND=$P(DATA,",",IND) 291 298 . S KND="" 292 . F S KND=$O(D DATA(SUB,JND,KND)) Q:KND="" D299 . F S KND=$O(DATA(JND,KND)) Q:KND="" D 293 300 .. S TTEMP=$P(TEMP,U,KND) 294 .. S MAX=+$P(D DATA(SUB,JND,KND),U,3)301 .. S MAX=+$P(DATA(JND,KND),U,3) 295 302 .. I MAX=0 S MAX=1 296 303 .. F LND=1:1:MAX D 297 ... S LINE=" "_$P(D DATA(SUB,JND,KND),U,1)_": "_$P(TTEMP,"~",LND)304 ... S LINE=" "_$P(DATA(JND,KND),U,1)_": "_$P(TTEMP,"~",LND) 298 305 ... D ADDTXT(LINE) 299 306 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPDRS.m
r628 r636 1 PXRMPDRS ;SLC/PKR - Patient List Demographic Report data selection. ;0 3/22/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMPDRS ;SLC/PKR - Patient List Demographic Report data selection. ;07/18/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 ADDSEL( DATA,SUB) ;Let the user select the address information they want.4 ADDSEL(ADDDATA) ;Let the user select the address information they want. 5 5 N ADDLIST,LIST 6 S ADDLIST("A",1)=" 1 - CURRENT ADDRESS", DATA(SUB,1,1)="STREET ADDRESS #1"_U_17 S DATA(SUB,1,2)="STREET ADDRESS #2"_U_1,DATA(SUB,1,3)="STREET ADDRESS #3"_U_18 S DATA(SUB,1,4)="CITY"_U_1,DATA(SUB,1,5)="STATE"_U_2,DATA(SUB,1,6)="ZIP"_U_19 S DATA(SUB,1,7)="COUNTY"_U_210 S ADDLIST("A",2)=" 2 - PHONE NUMBER", DATA(SUB,2,8)="PHONE NUMBER"_U_16 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 11 11 S ADDLIST("A")="Enter your selection(s)" 12 12 S ADDLIST("?")="^D HELP^PXRMPDRS" … … 14 14 S LIST=$$SEL^PXRMPDRS(.ADDLIST,2) 15 15 I $D(DTOUT)!$D(DUOUT) Q 16 S DATA(SUB)=LIST17 S DATA(SUB,"LEN")=$L(LIST,",")-116 S ADDDATA=LIST 17 S ADDDATA("LEN")=$L(LIST,",")-1 18 18 Q 19 19 ; … … 44 44 Q 45 45 ; 46 APPSEL( DATA,SUB) ;Let the user select the appointment information they want.46 APPSEL(APPDATA) ;Let the user select the appointment information they want. 47 47 ;The first subscript of APPDATA is the selection number and the 48 48 ;the second subscript is the subscript where the data is returned … … 50 50 ;second piece is the piece of VAPA this is displayed. 51 51 N APPLIST,LIST,MAX 52 S APPLIST("A",1)=" 1 - APPOINTMENT DATE", DATA(SUB,1,1)="APPOINTMENT DATE"_U_153 S APPLIST("A",2)=" 2 - CLINIC", DATA(SUB,2,2)="CLINIC"_U_252 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 54 54 S APPLIST("A")="Enter your selection(s)" 55 55 S APPLIST("?")="^D HELP^PXRMPDRS" … … 57 57 S LIST=$$SEL^PXRMPDRS(.APPLIST,2) 58 58 I $D(DTOUT)!$D(DUOUT) Q 59 S DATA(SUB)=LIST60 S DATA(SUB,"LEN")=$L(LIST,",")-161 I DATA(SUB,"LEN")=0 Q62 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) 63 63 Q 64 64 ; 65 DATASEL(LISTIEN, DATA,SUB) ; Build a list of data that is availble for65 DATASEL(LISTIEN,FINDDATA) ; Build a list of data that is availble for 66 66 ;this patient list and let the user select what they want. 67 67 N IND,DATALIST,DTYPE … … 69 69 F S DTYPE=$O(^PXRMXP(810.5,LISTIEN,35,"B",DTYPE)) Q:DTYPE="" D 70 70 . S IND=IND+1,DATALIST("A",IND)=" "_IND_" - "_DTYPE 71 . S DATA(SUB,IND,IND)=DTYPE71 . S FINDDATA(IND,IND)=DTYPE 72 72 ;If there is no data quit. 73 I IND=0 S DATA(SUB,"LEN")=0 Q73 I IND=0 S FINDDATA("LEN")=0 Q 74 74 S DATALIST("A")="Enter your selections(s)" 75 75 S DATALIST("?")="^D HELP^PXRMPDRS" … … 77 77 S LIST=$$SEL^PXRMPDRS(.DATALIST,IND) 78 78 I $D(DTOUT)!$D(DUOUT) Q 79 S DATA(SUB)=LIST80 S DATA(SUB,"LEN")=$L(LIST,",")-179 S FINDDATA=LIST 80 S FINDDATA("LEN")=$L(LIST,",")-1 81 81 Q 82 82 ; 83 DEMSEL(D ATA,SUB) ;Let the user select the demographic information they want.84 ;The first subscript of D ATA is the selection number and the83 DEMSEL(DEMDATA) ;Let the user select the demographic information they want. 84 ;The first subscript of DEMDATA is the selection number and the 85 85 ;the second subscript is the subscript where the data is returned 86 86 ;in VADM. The first piece of DEMDATA is the name of the data and the 87 87 ;second piece is the piece of VADM this is displayed. 88 88 N DEMLIST,DTOUT,DUOUT,IND,ITEM,JND,KND,LIST,TEMP 89 S DEMLIST("A",1)=" 1 - SSN",D ATA(SUB,1,2)="SSN"_U_290 S DEMLIST("A",2)=" 2 - DATE OF BIRTH",D ATA(SUB,2,3)="DOB"_U_291 S DEMLIST("A",3)=" 3 - AGE",D ATA(SUB,3,4)="AGE"_U_192 S DEMLIST("A",4)=" 4 - SEX",D ATA(SUB,4,5)="SEX"_U_293 S DEMLIST("A",5)=" 5 - DATE OF DEATH",D ATA(SUB,5,6)="DOD"_U_294 S DEMLIST("A",6)=" 6 - REMARKS",D ATA(SUB,6,7)="REMARKS"_U_195 S DEMLIST("A",7)=" 7 - HISTORIC RACE",D ATA(SUB,7,8)="HISTORIC RACE"_U_296 S DEMLIST("A",8)=" 8 - RELIGION",D ATA(SUB,8,9)="RELIGION"_U_297 S DEMLIST("A",9)=" 9 - MARITAL STATUS",D ATA(SUB,9,10)="MARTIAL STATUS"_U_298 S DEMLIST("A",10)="10 - ETHNICITY",D ATA(SUB,10,11)="ETHNICITY"_U_299 S DEMLIST("A",11)="11 - RACE",D ATA(SUB,11,12)="RACE"_U_289 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 100 100 S DEMLIST("A")="Enter your selection(s)" 101 101 S DEMLIST("?")="^D HELP^PXRMPDRS" … … 103 103 S LIST=$$SEL^PXRMPDRS(.DEMLIST,11) 104 104 I $D(DTOUT)!$D(DUOUT) Q 105 S D ATA(SUB)=LIST106 S D ATA(SUB,"LEN")=$L(LIST,",")-1107 F IND=1:1:D ATA(SUB,"LEN") D105 S DEMDATA=LIST 106 S DEMDATA("LEN")=$L(LIST,",")-1 107 F IND=1:1:DEMDATA("LEN") D 108 108 . S JND=$P(LIST,",",IND) 109 . S KND=$O(D ATA(SUB,JND,""))110 . S TEMP=$P(D ATA(SUB,JND,KND),U,1)109 . S KND=$O(DEMDATA(JND,"")) 110 . S TEMP=$P(DEMDATA(JND,KND),U,1) 111 111 . I TEMP="SSN" D 112 112 .. N FULLSSN 113 113 .. D SSN^PXRMXSD(.FULLSSN) 114 .. S D ATA(SUB,"FULLSSN")=$S($G(FULLSSN)="Y":1,1:0)115 . I $D(DTOUT)!$D(DUOUT) S IND=D ATA(SUB,"LEN")+1 Q116 . I TEMP="ETHNICITY" S $P(D ATA(SUB,10,11),U,3)=$$ASKNUM^PXRMEUT("Maximum number of ethnicity entries to display",1,10)117 . I TEMP="RACE" S $P(D ATA(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) 118 118 I $D(DTOUT)!$D(DUOUT) K DTOUT,DUOUT G DSEL 119 119 Q 120 120 ; 121 ELIGSEL( DATA,SUB) ;Let the user select the eligibility data they want.121 ELIGSEL(ELIGDATA) ;Let the user select the eligibility data they want. 122 122 ;The first subscript of ELIGDATA is the selection number and the 123 123 ;the second subscript is the subscript where the data is returned … … 125 125 ;second piece is the piece of VAEL this is displayed. 126 126 N ELIGLIST,ITEM,LIST 127 S ELIGLIST("A",1)=" 1 - PRIMARY ELGIBILITY CODE", DATA(SUB,1,1)="PRIMARY ELGIBILITY CODE"_U_2128 S ELIGLIST("A",2)=" 2 - PERIOD OF SERVICE", DATA(SUB,2,2)="PERIOD OF SERVICE"_U_2129 S ELIGLIST("A",3)=" 3 - % SERVICE CONNECTED", DATA(SUB,3,3)="% SERVICE CONNECTED"_U_2130 S ELIGLIST("A",4)=" 4 - VETERAN", DATA(SUB,4,4)="VETERAN"_U_1131 S ELIGLIST("A",5)=" 5 - TYPE", DATA(SUB,5,6)="TYPE"_U_2132 S ELIGLIST("A",6)=" 6 - ELIGIBILITY STATUS", DATA(SUB,6,8)="ELIGIBILITY STATUS"_U_2133 S ELIGLIST("A",7)=" 7 - CURRENT MEANS TEST", DATA(SUB,7,9)="CURRENT MEANS TEST"_U_2127 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 134 134 S ELIGLIST("A")="Enter your selection(s)" 135 135 S ELIGLIST("?")="^D HELP^PXRMPDRS" … … 137 137 S LIST=$$SEL^PXRMPDRS(.ELIGLIST,7) 138 138 I $D(DTOUT)!$D(DUOUT) Q 139 S DATA(SUB)=LIST140 S DATA(SUB,"LEN")=$L(LIST,",")-1139 S ELIGDATA=LIST 140 S ELIGDATA("LEN")=$L(LIST,",")-1 141 141 Q 142 142 ; … … 147 147 Q 148 148 ; 149 INPSEL( DATA,SUB) ;Let the user select the inpatient information they want.149 INPSEL(INPDATA) ;Let the user select the inpatient information they want. 150 150 ;The first subscript of INPDATA is the selection number and the 151 151 ;the second subscript is the subscript where the data is returned … … 153 153 ;second piece is the piece of VAIN this is displayed. 154 154 N INPLIST,ITEM,LIST 155 S INPLIST("A",1)=" 1 - WARD LOCATION", DATA(SUB,1,4)="WARD"_U_2156 S INPLIST("A",2)=" 2 - ROOM-BED", DATA(SUB,2,5)="ROOM-BED"_U_1157 S INPLIST("A",3)=" 3 - ADMISSION DATE/TIME", DATA(SUB,3,7)="ADMISSION DATE/TIME"_U_2158 S INPLIST("A",4)=" 4 - ATTENDING PHYSICIAN", DATA(SUB,4,11)="ATTENDING"_U_2155 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 159 159 S INPLIST("A")="Enter your selection(s)" 160 160 S INPLIST("?")="^D HELP^PXRMPDRS" … … 162 162 S LIST=$$SEL^PXRMPDRS(.INPLIST,5) 163 163 I $D(DTOUT)!$D(DUOUT) Q 164 S DATA(SUB)=LIST165 S DATA(SUB,"LEN")=$L(LIST,",")-1164 S INPDATA=LIST 165 S INPDATA("LEN")=$L(LIST,",")-1 166 166 Q 167 167 ; 168 REMSEL(PLIEN, DATA,SUB) ;If the list was generated from a reminder report168 REMSEL(PLIEN,REMDATA) ;If the list was generated from a reminder report 169 169 ;let the user select the reminder data they want. 170 I '$P(^PXRMXP(810.5,PLIEN,0),U,9) S DATA(SUB,"LEN")=0 Q170 I '$P(^PXRMXP(810.5,PLIEN,0),U,9) S REMDATA("LEN")=0 Q 171 171 N IEN,IND,REMLIST,RNAME 172 172 S (IEN,IND)=0 … … 175 175 . I RNAME="" S RNAME=$P(^PXD(811.9,IEN,0),U,1) 176 176 . S IND=IND+1 177 . S DATA(SUB,"RNAME",IND)=RNAME178 . S DATA(SUB,"IEN",IND)=IEN177 . S REMDATA("RNAME",IND)=RNAME 178 . S REMDATA("IEN",IND)=IEN 179 179 . S REMLIST("A",IND)=" "_IND_" - "_RNAME 180 180 S REMLIST("A")="Enter your selection(s)" … … 183 183 S LIST=$$SEL^PXRMPDRS(.REMLIST,IND) 184 184 I $D(DTOUT)!$D(DUOUT) Q 185 S DATA(SUB)=LIST186 S DATA(SUB,"LEN")=$L(LIST,",")-1185 S REMDATA=LIST 186 S REMDATA("LEN")=$L(LIST,",")-1 187 187 Q 188 188 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPLST.m
r628 r636 1 PXRMPLST ; SLC/PKR - Build a patient list from a reminder definition. ;0 1/24/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMPLST ; SLC/PKR - Build a patient list from a reminder definition. ;06/09/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;Input : RIEN - Reminder IEN … … 7 7 ; PXRMDATE - Evaluation date 8 8 ;=================================================== 9 BLDPLST( DEFARR,PLIST,DFNONLY) ;10 N D FN,DOBE,DOBS,ELE,ERROR,ERRSTR,IND,FNUM9 BLDPLST(RIEN,PLIST,DFNONLY,PXRMDATE) ; 10 N DEFARR,DFN,DOBE,DOBS,ELE,ERROR,ERRSTR,IND,FNUM 11 11 N LIST1,LIST2,LNAME,LSP,LSTACK 12 12 N NDR,NOT,OPER,PCLOG,PFSTACK,SEX,TYPE 13 13 ; 14 D DEF^PXRMLDR(RIEN,.DEFARR) 14 15 ;Get the cohort logic string. This has passed a validation before 15 16 ;it can be selected for building patient lists so we don't need to … … 229 230 N DFN,DS,IND,SEXOK 230 231 F IND=1:1:NDR D 231 . S DS=DOBS(IND)-. 000001232 . S DS=DOBS(IND)-.1 232 233 . F S DS=$O(^DPT("ADOB",DS)) Q:(DS>DOBE(IND))!(DS="") D 233 234 .. S DFN="" -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPTD2.m
r628 r636 1 PXRMPTD2 ; SLC/PKR/PJH - Reminder Inquiry print template routines.; 03/06/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMPTD2 ; SLC/PKR/PJH - Reminder Inquiry print template routines.;10/07/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ;================================================ 4 4 DATE(FIND0,PIECE,FLDNUM,TITLE,RJC,PAD,FILENUM,FLG) ;Standard DATE … … 6 6 S DATE=$P($G(FIND0),U,PIECE) 7 7 I DATE'="" D 8 .S DATE=$$FMTE^XLFDT(DATE," 5Z"),X=$$RJ^XLFSTR(TITLE,RJC,PAD),X=X_" "_DATE8 .S DATE=$$FMTE^XLFDT(DATE,"D"),X=$$RJ^XLFSTR(TITLE,RJC,PAD),X=X_" "_DATE 9 9 .D ^DIWP 10 10 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPTDF.m
r628 r636 1 PXRMPTDF ; SLC/PKR/PJH - Reminder Inquiry print template routines. ;0 6/07/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMPTDF ; SLC/PKR/PJH - Reminder Inquiry print template routines. ;01/30/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;================================================ … … 81 81 .D SFDISP(FIND0,1,14,"Condition:",RJC,PAD,FILENUM) 82 82 .D SFDISP(FIND0,2,15,"Condition Case Sensitive:",RJC,PAD,FILENUM) 83 .D SFDISP(FIND0,3,18,"Use Status/Cond inSearch:",RJC,PAD,FILENUM)83 .D SFDISP(FIND0,3,18,"Use Cond in Finding Search:",RJC,PAD,FILENUM) 84 84 .I $G(^PXD(811.9,D0,20,FINDING,15))'="" D 85 85 ..S X=$$RJ^XLFSTR("Computed Finding Parameter:",RJC,PAD) … … 173 173 .D SFDISP(TERM3,1,14,"Condition:",RJT,PAD,TERMNUM,1) 174 174 .D SFDISP(TERM3,2,15,"Condition Case Sensitive:",RJT,PAD,TERMNUM) 175 .D SFDISP(TERM3,3,18,"Use Status/Cond inSearch:",RJT,PAD,TERMNUM)175 .D SFDISP(TERM3,3,18,"Use Cond in Finding Search:",RJT,PAD,TERMNUM) 176 176 .I $G(^PXRMD(811.5,IEN1,20,TERMS,15))'="" D 177 177 ..S X=$$RJ^XLFSTR("Computed Finding Parameter:",RJT,PAD) … … 215 215 .S X=$$RJ^XLFSTR(TITLE,RJC,PAD) 216 216 .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 229 219 ; 230 220 ;================================================ -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMPTTR.m
r628 r636 1 PXRMPTTR ;SLC/PKR - Routines for term print templates ;0 6/01/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMPTTR ;SLC/PKR - Routines for term print templates ;01/30/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;==================================================== … … 88 88 . D SFDISP(FIND0,1,14,"Condition:",RJC,PAD) 89 89 . D SFDISP(FIND0,2,15,"Condition Case Sensitive:",RJC,PAD) 90 . D SFDISP(FIND0,3,18,"Use Status/Cond inSearch:",RJC,PAD)90 . D SFDISP(FIND0,3,18,"Use Cond in Finding Search:",RJC,PAD) 91 91 . I $G(^PXRMD(811.5,D0,20,FINDING,15))'="" D 92 92 .. S CFP=$$RJ^XLFSTR("Computed Finding Parameter:",RJC,PAD) … … 103 103 . S TEXT=$$RJ^XLFSTR(TITLE,RJC,PAD) 104 104 . S TEXT=TEXT_" "_$$EXTERNAL^DILFD(811.52,FLDNUM,"",FIELD,"") 105 . I FLDNUM=13 S TEXT=TEXT_" - "_$$SPECIAL^PXRMPTDF(FIND0,FIELD)106 105 . W !,TEXT 107 106 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMREDF.m
r628 r636 1 PXRMREDF ; SLC/PJH - Edit PXRM reminder findings. ;0 1/09/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMREDF ; SLC/PJH - Edit PXRM reminder findings. ;02/09/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ; Called by PXRMREDT which newes and initialized DEF, DEF1, DEF2. … … 37 37 D ^DIC I Y=-1 S DTOUT=1 Q 38 38 S DIE=DIC K DIC 39 S DIE("NO^")="OUTOK"40 39 S DA=+Y,GLOB=$P($P(Y,U,2),";",2) Q:GLOB="" 41 40 S TYPE=$G(DEF1(GLOB)) … … 43 42 ;Save term IEN 44 43 S STATUS=0 44 I TYPE="RT" S TIEN=$P($P(Y,U,2),";",1) 45 45 I TYPE="CF" S CFIEN=$P($P(Y,U,2),";",1) D 46 46 .I $D(^PXRMD(811.4,CFIEN,1))>0 D … … 49 49 ...W !,$G(^PXRMD(811.4,CFIEN,1,WPIEN,0)) 50 50 .E W !!,"No description defined for this computed finding" 51 I TYPE="MH" D WARN^PXRMMH52 I TYPE="RT" S TIEN=$P($P(Y,U,2),";",1)53 51 ;Finding record fields 54 52 W !!,"Editing Finding Number: "_$G(DA) … … 99 97 ;Check if deleted 100 98 I '$D(DA) Q 101 I STATUS=1 ,$D(Y)=0D STATUS^PXRMSTA1(.DA,"D")99 I STATUS=1 D STATUS^PXRMSTA1(.DA,"D") 102 100 ; 103 101 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/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMREDT ; SLC/PKR,PJH - Edit PXRM reminder definition. ;02/09/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;======================================================= … … 17 17 D SETSTART^PXRMCOPY(DIC) 18 18 W ! 19 S DIC("W")="W $$LUDISP^PXRMREDT(Y)"20 19 D ^DIC 21 20 I ($D(DTOUT))!($D(DUOUT)) Q … … 288 287 ; 289 288 ;------------------------------------- 290 LUDISP(IEN) ;Use for DIC("W") to augment look-up display.291 N CLASS,EM,INACTIVE,TEXT292 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_" "_INACTIVE297 Q TEXT298 ;299 ;-------------------------------------300 289 TFIND(DA,LIST) ;Allow edit of term findings for national reminders. 301 N DIR,IENLIST,IND, JND,NAME,NAMELIST,SUB,X,Y290 N DIR,IENLIST,IND,NAME,NAMELIST,SUB,X,Y 302 291 S IND=0,NAME="" 303 292 F S NAME=$O(LIST("RT",NAME)) Q:NAME="" D … … 313 302 I $D(DIROUT)!$D(DIRUT) S LIST="" Q 314 303 I $D(DUOUT)!$D(DTOUT) S LIST="" Q 304 S LIST=Y 315 305 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) 318 307 . 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/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMRPCC ;SLC/PJH - PXRM REMINDER DIALOG ;04/12/2002 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ACTIVE(ORY,ORREM) ;Check if active dialog exist for reminders … … 39 39 ; 40 40 ;Load dialog lines into local array 41 S ORY(0)=0_U_+$P($G(^PXRMD(801.41,DIEN,0)),U,17)42 41 D LOAD^PXRMDLL(DIEN,$G(DFN)) 43 42 Q … … 77 76 ; Input mental health instrument NAME 78 77 ; 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 84 81 S SUB="ARRAY",OCNT=0 85 82 F S SUB=$Q(@SUB) Q:SUB="" D … … 96 93 ; Input MH result IEN and mental health instrument response 97 94 ; 98 D START^PXRMDLR(.ORY,RESULT,.ORES)95 D ^PXRMDLR 99 96 ; 100 97 Q … … 103 100 ; 104 101 ; 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) 111 106 Q 112 107 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMRUL1.m
r628 r636 1 PXRMRUL1 ; SLC/AGP,PKR - Patient list routines. ; 0 3/29/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMRUL1 ; SLC/AGP,PKR - Patient list routines. ; 08/11/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 ;5 ASK(PLIEN,OPT) ;Verify patient list name6 N X,Y,TEXT7 K DIROUT,DIRUT,DTOUT,DUOUT8 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 DIR14 I $D(DIROUT) S DTOUT=115 I $D(DTOUT)!($D(DUOUT)) Q16 I $E(Y(0))="N" S DUOUT=1 Q17 Q18 ;19 COPY(IENO) ;Copy patient list20 ;Check if OK to copy21 D ASK(IENO,"Copy") Q:$D(DUOUT)!$D(DTOUT)22 N FDA,IENN,IND,MSG,NNAME,ODATA,OEPIEN,ONAME,ORULE,PATCREAT,TEXT,X,Y23 ;Select list to copy to24 S TEXT="Select PATIENT LIST name to copy to: "25 D PLIST^PXRMLCR(.IENN,TEXT,IENO) Q:$D(DUOUT)!$D(DTOUT) Q:'IENN26 S NNAME=$P($G(^PXRMXP(810.5,IENN,0)),U)27 ;28 ;Get original Patient List record29 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 info35 S TYPE=$S($G(PATCREAT)="Y":"PVT",1:"PUB")36 S IND=IENN_","37 S FDA(810.5,IND,.01)=NNAME38 S FDA(810.5,IND,.04)=$$NOW^XLFDT39 S FDA(810.5,IND,.05)=OEPIEN40 S FDA(810.5,IND,.06)=ORULE41 S FDA(810.5,IND,.07)=$G(DUZ)42 S FDA(810.5,IND,.08)=TYPE43 D UPDATE^DIE("","FDA","","MSG")44 ;Error45 I $D(MSG) D ERR46 ;47 W !!,"Completed copy of '"_ONAME_"'"48 W !,"into '"_NNAME_"'",! H 249 K ^TMP($J,"PXRMRULE")50 Q51 ;52 CRLST(NAME,CLASS) ;Create new patient list53 N IEN54 ;Check if name exists55 S IEN=$O(^PXRMXP(810.5,"B",NAME,"")) I IEN Q IEN56 ;Otherwise create national entry57 N FDA,FDAIEN,MSG58 S FDA(810.5,"+1,",.01)=NAME59 S FDA(810.5,"+1,",100)=CLASS60 S FDA(810.5,"+1,",.07)=$G(DUZ)61 ;Make stub public62 S FDA(810.5,"+1,",.08)="PUB"63 D UPDATE^DIE("","FDA","FDAIEN","MSG")64 ;Error65 I $D(MSG) Q 066 ;Otherwise list ien67 Q FDAIEN(1)68 ;69 COUNT(NODE) ;Count the number of entries.70 N DFN,NUM71 S (DFN,NUM)=072 F S DFN=$O(^TMP($J,NODE,DFN)) Q:DFN="" S NUM=NUM+173 Q NUM74 ;75 DELETE(LIST) ;Delete Patient list76 I '$$VEDIT^PXRMUTIL("^PXRMXP(810.5,",LIST) D Q77 .W !!,?5,"VA- and national class patient lists may not be deleted" H 278 .S DUOUT=179 ;Check if this is the right list80 D ASK(LIST,"Delete") Q:$D(DUOUT)!$D(DTOUT)81 ;82 N DA,DIK,DUOUT83 ;Lock patient list84 D LOCK Q:$D(DUOUT)85 ;Kill List86 S DA=LIST,DIK="^PXRMXP(810.5,"87 D ^DIK88 ;Unlock patient list89 D UNLOCK90 Q91 ;92 4 DATECHK(DATE) ; 93 5 I DATE=0 Q 1 94 6 S DATE=$$STRREP^PXRMUTIL(DATE,"BDT","T") 95 7 Q $$VDT^PXRMINTR(DATE) 96 ;97 DATES(LBBDT,LBEDT,RBDT,REDT,FARR) ;Set the dates in the finding array to98 ;FileMan dates.99 N FI,PXRMDATE,TBDT,TEDT100 S FI=0101 F S FI=+$O(FARR(20,FI)) Q:FI=0 D102 . S TBDT=$P(FARR(20,FI,0),U,8),TEDT=$P(FARR(20,FI,0),U,11)103 . I TBDT="",TEDT="" D104 .. S $P(FARR(20,FI,0),U,8)=RBDT,$P(FARR(20,FI,0),U,11)=REDT105 . E D106 .. 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)=TEDT112 Q113 ;114 ERR ;Error Handler115 N ERROR,IC,REF116 S ERROR(1)="Unable to build patient list : "117 S ERROR(2)=NAME118 S ERROR(3)="Error in UPDATE^DIE, needs further investigation"119 ; Move MSG into Error120 S REF="MSG"121 F IC=4:1 S REF=$Q(@REF) Q:REF="" S ERROR(IC)=REF_"="_@REF122 ;Screen message123 D EN^DDIOL(.ERROR)124 Q125 8 ; 126 9 INSERT(FROUT,DFN,TNAME,TFIEV,RSTOP) ;Save patient data. … … 153 36 Q INST 154 37 ; 155 LOCK L +^PXRMXP(810.5,LIST):0156 E W !!?5,"Another user is using this patient list" S DUOUT=1157 Q158 ;159 38 LOGOP(LIST1,LIST2,LOGOP) ;Given LIST1 and LIST2 apply the logical 160 39 ;operator LOGOP to generate a new list and return it in LIST1 … … 178 57 Q 179 58 ; 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) 59 REM(FRACT,RIEN,RSTART,RSTOP,PNODE) ;Process reminder finding rule 60 D BLDPLST^PXRMPLST(RIEN,PNODE,1,RSTOP) 186 61 ;Remove, Select or Add Findings operations 187 62 I FRACT="A" D LOGOP(FROUT,PNODE,"!") Q … … 190 65 Q 191 66 ; 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 67 TERM(FRACT,FRTIEN,RSTART,RSTOP,PNODE,INST) ;Process TERM finding rule 68 N FINDPA,FINDING,FNAME,PLIST,PXRMDATE,PXRMDEBG,TERMARR,TFIEV,TNAME 196 69 ;Get term definition array 197 70 D TERM^PXRMLDR(FRTIEN,.TERMARR) 198 71 S TNAME=$P(TERMARR(0),U,1) 199 72 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 202 74 S $P(FINDPA(0),U,8)=RSTART,$P(FINDPA(0),U,11)=RSTOP,PXRMDATE=RSTOP 203 75 ; … … 205 77 I FRACT="A" D Q 206 78 .;Process term for date range 207 .D EVALPL^PXRMTER L(.FINDPA,.TERMARR,PNODE)79 .D EVALPL^PXRMTERM(.FINDPA,.TERMARR,PNODE) 208 80 .;Merge lists if operation is add 209 81 .M ^TMP($J,FROUT)=^TMP($J,PNODE,1) … … 226 98 Q 227 99 ; 228 UNLOCK L -^PXRMXP(810.5,LIST) Q229 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMRULE.m
r628 r636 1 PXRMRULE ; SLC/PJH - Build Patient list from Rule Set ;0 3/27/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMRULE ; SLC/PJH - Build Patient list from Rule Set ;08/11/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ; Called from PXRM PATIENT LIST CREATE protocol 5 ; 6 ASK(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 5 19 ; 6 20 CLEAR(RULE,NODE) ;Clear workfile entries … … 13 27 Q 14 28 ; 29 COPY(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 ; 62 CRLST(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 ; 76 DELETE(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 ; 93 ERR ;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 ; 15 105 INTR ;Input transform for #810.4 fields 16 106 Q … … 25 115 Q 26 116 ; 27 PATS(FRACT,FROUT,PNODE,LIST) ;Process Patient List finding rule 117 LOCK L +^PXRMXP(810.5,LIST):0 118 E W !!?5,"Another user is using this patient list" S DUOUT=1 119 Q 120 ; 121 PATS(LIST) ;Process Patient List finding rule 28 122 ; 29 123 N LIEN,LUVALUE … … 38 132 I FRACT="A" D LOAD(FROUT,LIEN) Q 39 133 ; 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 ; 147 START(RULESET,LIST,NODE,LBBDT,LBEDT,PAR,YEAR,PERIOD,INDP,INTP) ; 53 148 ;Process rule set 54 149 ;Clear ^TMP … … 56 151 ; 57 152 N CLASS,FRACT,FRDATA,FRDATES,FRIEN,FRLST,FRLIEN,FROLST,FROUT,FRPAT 58 N FRPERM,FRSTRT,FRTIEN,FRTYP,FSEQ,INC,INST,PXRMDATE ,PXRMDDOC153 N FRPERM,FRSTRT,FRTIEN,FRTYP,FSEQ,INC,INST,PXRMDATE 59 154 N RBDT,REDT,RRIEN,RSDATA,RSDATES,SEQ,SUB 60 155 ;Get class from extract parameter … … 62 157 ;Otherwise default to local 63 158 I $G(CLASS)="" S CLASS="L" 64 ;PXRMDDOC=1 save list rule evaluation dates in ^TMP("PXRMDDOC",$J)65 S PXRMDDOC=166 K ^TMP("PXRMDDOC",$J)67 159 ;Get each finding rule in sequence 68 S SEQ="",INC=0 ,INST=0160 S SEQ="",INC=0 69 161 F S SEQ=$O(^PXRM(810.4,RULESET,30,"B",SEQ)) Q:'SEQ D 70 162 .;Save first sequence as default … … 84 176 .;Get Extract Patient List name for patient list rule 85 177 .I FRTYP=5 S FRLST=$P($G(^PXRM(810.4,FRIEN,1)),U) D Q:FRLST="" 86 ..I +EXTITR>0 S FRLST=FRLST_"/"_EXTITR87 178 ..S FROLST=$P(FRDATA,U,8) 88 179 ..I +FROLST>0 S FRLST=$P($G(^PXRMXP(810.5,FROLST,0)),U) … … 106 197 .K ^TMP($J,PNODE) 107 198 .;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) 109 200 .;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) 111 202 .;Patient list finding rules 112 .I FRTYP=5 D PATS(FR ACT,FROUT,PNODE,FRLST)203 .I FRTYP=5 D PATS(FRLST) 113 204 .;Clear results file 114 205 .K ^TMP($J,PNODE) … … 118 209 ..N FRPIEN 119 210 ..;Get patient list IEN or create new patient list 120 ..S FRPIEN=$$CRLST ^PXRMRUL1(FRPERM,CLASS) Q:'FRPIEN211 ..S FRPIEN=$$CRLST(FRPERM,CLASS) Q:'FRPIEN 121 212 ..;Update patient list 122 ..D UPDLST(FROUT,FRPIEN,PAR,RULESET,INST ,INDP,INTP)213 ..D UPDLST(FROUT,FRPIEN,PAR,RULESET,INST) 123 214 ; 124 215 ;Save final results to patient list 125 216 I LIST'="",FROUT'="" D 126 217 . 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) 131 219 . 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 ; 222 UPDLST(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 139 225 ;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) 145 227 ; 146 228 ;Clear existing list. 147 229 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) 148 231 ; 149 232 ;Merge ^TMP into Patient List 150 S (DECEASED,TESTP)="" 151 S (CNT,DFN)=0 233 S (CNT,DFN,INST)=0 152 234 F S DFN=$O(^TMP($J,NODE,DFN)) Q:'DFN D 153 235 .S ONODE=$G(^TMP($J,NODE,DFN,"INST")) 154 236 .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 163 238 .S ^PXRMXP(810.5,LIST,30,"B",DFN,CNT)="" 164 239 .; … … 215 290 D UPDATE^DIE("","FDA","","MSG") 216 291 ;Error 217 I $D(MSG) D ERR ^PXRMRUL1292 I $D(MSG) D ERR 218 293 ;Unlock patient list 219 D UNLOCK^PXRMRUL1 220 Q 221 ; 294 D UNLOCK 295 Q 296 ; 297 UNLOCK 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. ;0 9/06/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMSTA1 ; SLC/AGP - Routines for building status list. ;06/20/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;This routine and PXRMSTA2 will allow users to select the … … 35 35 ; 36 36 ADDDEL(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") 38 38 I "ADDASQ"'[ANS Q 39 39 I ANS="A",WILD=1 D … … 62 62 I TYPE[";" S TYPE=$P($G(TYPE),";",2) 63 63 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) 65 65 .;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) 67 67 ; handle drug finding items 68 68 I TYPE["PSDRUG("!(TYPE["PS(50.605")!(TYPE["PSNDF") D G ADDEX … … 91 91 I TYPE[";" S TYPE=$P($G(TYPE),";",2) 92 92 I TYPE="PXD(811.2," D 93 .I $G(TAXTYPE)="R" !($G(TAXTYPE)="B")S FILE=7094 . ;I $G(TAXTYPE)="P" S FILE=900001193 .I $G(TAXTYPE)="R" S FILE=70 94 .I $G(TAXTYPE)="P" S FILE=9000011 95 95 I FILE="",TYPE="ORD(101.43," S FILE=100 96 96 I FILE="",TYPE="RAMIS(71," S FILE=70 … … 173 173 Q 174 174 ; 175 PROMPT(STR ) ;175 PROMPT(STR,DEFAULT) ; 176 176 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." 180 180 S DIR(0)=STR 181 181 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/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMSTA2 ; SLC/AGP - Routines for building status list. ;9/26/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 DATA(FILE,DA,TYPE,RXTYPE,STATUS) ; … … 11 11 I TYPE="DRUG" D 12 12 .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") 15 14 . . 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") 18 16 . . D ARRAYFOR(.SARRAY,.ARRAY1,"I") K CODE 19 17 . . D COMPARE(.ARRAY,.ARRAY1,"I",.OUTPUT) 20 18 . I $D(RXTYPE("O"))>0 D 21 19 . . 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") 24 21 . . D ARRAYFOR(.SARRAY,.ARRAY,"O") K CODE 25 22 . . I $D(OUTPUT)>0 K ARRAY1 M ARRAY1=OUTPUT K OUTPUT D COMPARE(.ARRAY,.ARRAY1,"",.OUTPUT) … … 27 24 . I $D(RXTYPE("N"))>0 D 28 25 . . 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") 31 27 . . S SARRAY("POINTER")=SARRAY("POINTER")_"0:ACTIVE;" 32 28 . . D ARRAYFOR(.SARRAY,.ARRAY,"N") K CODE … … 76 72 ; 77 73 ARRAYFOR(ARRAY,OUTPUT,DEF) ; 78 ;this sub routine is use to format th earray data into a standard74 ;this sub routine is use to format that array data into a standard 79 75 ;format 80 76 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMSXRM.m
r628 r636 1 PXRMSXRM ; SLC/PKR - Main driver for building indexes. ;1 1/23/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMSXRM ; SLC/PKR - Main driver for building indexes. ;12/20/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;========================================== … … 81 81 S ROUTINE(120.5)="VITALS^GMVPXRM" ;DBIA #3647 82 82 S ROUTINE(601.2)="INDEX^YTPXRM" ;DBIA #4523 83 S ROUTINE(601.84)="INDEX^YTQPXRM" ;DBIA #505584 83 S ROUTINE(9000011)="INDEX^GMPLPXRM" ;DBIA #4516 85 84 S ROUTINE(9000010.07)="VPOV^PXPXRMI2" ;DBIA #4520 … … 115 114 ;========================================== 116 115 SEL(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 135 133 M DIR("A")=ALIST 136 134 S DIR("A")="Enter your list" 137 S DIR(0)="LO^1: "_INUM135 S DIR(0)="LO^1:16" 138 136 D ^DIR 139 137 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/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMTAX ; SLC/PKR - Handle taxonomy finding. ;07/17/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;================================================== … … 65 65 S SDIR=$S(NOCC<0:+1,1:-1) 66 66 S NOCC=$S(NOCC<0:-NOCC,1:NOCC) 67 S NGET=$S(UCIFS: 50,1:NOCC)67 S NGET=$S(UCIFS:"*",1:NOCC) 68 68 ; 69 69 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. ;0 4/23/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMTERM ; SLC/PKR - Handle reminder terms. ;06/29/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;============================================= … … 19 19 ... I 'FIEVAL(FINDING) Q 20 20 ... 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) 22 23 .. I 'FIEVAL(FINDING) Q 23 24 .. S IND=0 … … 79 80 ; 80 81 ;============================================= 82 EVALPL(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 ;============================================= 81 110 EVALTERM(DFN,FINDPA,TERMARR,TFIEVAL) ;Evaluate all the findings in 82 111 ;a term. Use the "E" cross-reference just like the finding evaluation. … … 102 131 . I ENODE="PSNDF(50.6," D EVALTERM^PXRMDGEN(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL) Q 103 132 . 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) Q133 . I ENODE="YTT(601," D EVALTERM^PXRMMH(DFN,.FINDPA,ENODE,.TERMARR,.TFIEVAL) Q 105 134 Q 106 135 ; … … 140 169 ;============================================= 141 170 OPT(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) 143 176 ;Build the display grouping. 144 177 S FILENUM=IFIEVAL(1,"FILE NUMBER") … … 164 197 .. I KND=1 M TIFIEVAL=IFIEVAL(JND) 165 198 .. M TIFIEVAL(KND)=IFIEVAL(JND) 199 .. I DRUG'="" S TIFIEVAL("DISPENSE DRUG")=DRUG 166 200 . I TYPE="CM" D FOUT^PXRMOUTC(INDENTT,.TIFIEVAL,.NLINES,.TEXT) 167 201 . 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/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMTEXT ; SLC/PKR - Text formatting utility routines. ;11/03/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 ;============================================ 4 ;================================================================ 5 5 NEWLINE ;Put TEXT on a new line to the output, make sure it does not end 6 6 ;with a " ". … … 14 14 Q 15 15 ; 16 ;============================================ 16 ;================================================================ 17 17 BLANK ;Add a blank line (line containing just " ") to the output. 18 18 S NOUT=NOUT+1,TEXTOUT(NOUT)=" " … … 20 20 Q 21 21 ; 22 ;============================================ 22 ;================================================================ 23 23 CHECKLEN(WORD) ;Check to see if adding the next word makes the line too long. 24 24 ;If it does add it to the output and start a new line. … … 34 34 Q 35 35 ; 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 ;================================================================ 115 37 FORMAT(LM,RM,NIN,TEXTIN,NOUT,TEXTOUT) ;Format the text in TEXTIN so it has 116 38 ;a left margin of LM and a right margin of RM. The formatted text … … 163 85 Q 164 86 ; 165 ;============================================ 87 ;================================================================ 166 88 FORMATS(LM,RM,TEXTLINE,NOUT,TEXTOUT) ;Take a single line of input text 167 89 ;and format it. … … 171 93 Q 172 94 ; 173 ;============================================174 LMFMTSTR(VALMDDF,JSTR) ;The List Manager variable VALMDDF contains the175 ;list template caption column formatting information. It contains176 ;the starting column and the width if the form177 ;VALMDDF(COLUMN NAME)=COLUMN NAME^COLUMN^WIDTH^CAPTION^VIDEO^SCROLL178 ;LOCK. JUSSTR, which is optional,is the justification for each column;179 ;(L=left, C=center, R=right) the default is center. Use this information180 ;to build the format string for the column formatter COLFMT.181 N CN,COL,FMTSTR,IND,JC,JUSSTR,PLCOL,SCOL,SP,TEMP,WIDTH182 ;Sort by columns183 S IND=""184 F S IND=$O(VALMDDF(IND)) Q:IND="" D185 . 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)=0189 S FMTSTR=""190 S SCOL=0191 F S SCOL=$O(COL(SCOL)) Q:SCOL="" D192 . S CN=CN+1193 . S WIDTH=COL(SCOL)194 . I CN=1 S PLCOL=WIDTH195 . E S SP=SCOL-PLCOL-1,FMTSTR=FMTSTR_SP_U,PLCOL=SCOL+WIDTH-1196 . S JC=$E(JUSSTR,CN)197 . I JC="" S JC="C"198 . S TEMP=WIDTH_JC199 . S FMTSTR=FMTSTR_TEMP200 Q FMTSTR201 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMTMED.m
r628 r636 1 PXRMTMED ; SLC/PKR/PJH - Edit a reminder term. ;0 4/18/20072 ;;2.0;CLINICAL REMINDERS;**1,4 ,6**;Feb 04, 2005;Build 1231 PXRMTMED ; SLC/PKR/PJH - Edit a reminder term. ;01/30/2006 2 ;;2.0;CLINICAL REMINDERS;**1,4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;======================================================= … … 62 62 N CFIEN,GLOB,IEN,LIST,NODE,TERMSTAT,VF,WPIEN 63 63 N DEF,DEF1,DEF2,STATUS 64 S DIE("NO^")="OUTOK"65 64 S STATUS=0 66 65 D DEF^PXRMRUTL("811.52",.DEF,.DEF1,.DEF2) … … 77 76 S DA=+Y,GLOB=$P($P(Y,U,2),";",2) Q:GLOB="" 78 77 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 ! 86 84 W !,"Editing Finding Number: "_$G(DA) 87 85 ;Finding record fields … … 99 97 I VF S DR=DR_";28" 100 98 ;Mental Health - scale 101 I GLOB="YTT(601 .71," S DR=DR_";13"99 I GLOB="YTT(601," S DR=DR_";13" 102 100 ;Radiology procedure 103 101 I GLOB="RAMIS(71," S STATUS=1 … … 111 109 ;Edit finding record 112 110 D ^DIE 113 I STATUS=1,$D(DA)>0 ,$D(Y)=0D STATUS^PXRMSTA1(.DA,"T")111 I STATUS=1,$D(DA)>0 D STATUS^PXRMSTA1(.DA,"T") 114 112 S $P(^PXRMD(811.5,IEN,20,0),U,3)=0 115 113 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMUTIL.m
r628 r636 1 PXRMUTIL ; SLC/PKR/PJH - Utility routines for use by PXRM. ; 10/02/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1233 ; 4 ;================================= 1 PXRMUTIL ; SLC/PKR/PJH - Utility routines for use by PXRM. ;05/25/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 ; 4 ;=========================================================== 5 5 ATTVALUE(STRING,ATTR,SEP,AVSEP) ;STRING contains a list of attribute value 6 6 ;pairs. Each pair is separated by SEP and the attribute value pair … … 14 14 Q VALUE 15 15 ; 16 ;================================= 17 ACOPY(REF,OUTPUT) ;Copy all the descendants of the array reference into a linear 18 ;array. REF is the starting array reference, for example A or 19 ;^TMP("PXRM",$J). OUTPUT is the linear array for the output. It 20 ;should be in the form of a closed root, i.e., A() or ^TMP($J,). 21 ;Note OUTPUT cannot be used as the name of the output array. 22 N DONE,IND,LEN,NL,OROOT,OUT,PROOT,ROOT,START,TEMP 23 I REF="" Q 24 S NL=0 25 S OROOT=$P(OUTPUT,")",1) 26 S PROOT=$P(REF,")",1) 27 ;Build the root so we can tell when we are done. 28 S TEMP=$NA(@REF) 29 S ROOT=$P(TEMP,")",1) 30 S REF=$Q(@REF) 31 I REF'[ROOT Q 32 S DONE=0 33 F Q:(REF="")!(DONE) D 34 . S START=$F(REF,ROOT) 35 . S LEN=$L(REF) 36 . S IND=$E(REF,START,LEN) 37 . S NL=NL+1 38 . S OUT=OROOT_NL_")" 39 . S @OUT=PROOT_IND_"="_@REF 40 . S REF=$Q(@REF) 41 . I REF'[ROOT S DONE=1 42 Q 43 ; 44 ;================================= 16 ;=========================================================== 45 17 AWRITE(REF) ;Write all the descendants of the array reference. 46 18 ;REF is the starting array reference, for example A or ^TMP("PXRM",$J). … … 63 35 Q 64 36 ; 65 ;================================= 37 ;=========================================================== 66 38 DIP(VAR,IEN,PXRMROOT,FLDS) ;Do general inquiry for IEN return formatted 67 39 ;output in VAR. VAR can be either a local variable or a global. … … 113 85 Q 114 86 ; 115 ;================================= 87 ;=========================================================== 116 88 FNFR(ROOT) ;Given the root of a file return the file number. 117 89 Q +$P(@(ROOT_"0)"),U,2) 118 90 ; 119 ;================================= 91 ;=========================================================== 120 92 NTOAN(NUMBER) ;Given an integer N return an alphabetic string that can be 121 93 ;used for sorting. This will be modulus 26. For example N=0 returns … … 140 112 Q ANUM 141 113 ; 142 ;================================= 143 RMEHIST(FILENUM,IEN) ;Remove the edit history for a reminder file. 144 I (FILENUM<800)!(FILENUM>811.9)!(FILENUM=811.8) Q 145 N DA,DIK,GLOBAL,ROOT 146 S GLOBAL=$$GET1^DID(FILENUM,"","","GLOBAL NAME") 147 ;Edit History is stored in node 110 for all files. 148 S DA(1)=IEN 149 S DIK=GLOBAL_IEN_",110," 150 S ROOT=GLOBAL_IEN_",110,DA)" 151 S DA=0 152 F S DA=+$O(@ROOT) Q:DA=0 D ^DIK 153 Q 154 ; 155 ;================================= 114 ;=========================================================== 156 115 SEHIST(FILENUM,ROOT,IEN) ;Set the edit date and edit by and prompt the 157 116 ;user for the edit comment. … … 186 145 Q 187 146 ; 188 ;================================= 147 ;=========================================================== 189 148 SFRES(SDIR,NRES,FIEVAL) ;Save the finding result. 190 149 I NRES=0 S FIEVAL=0 Q … … 202 161 Q 203 162 ; 204 ;================================= 163 ;=========================================================== 205 164 SSPAR(FIND0,NOCC,BDT,EDT) ;Set the finding search parameters. 206 165 S BDT=$P(FIND0,U,8),EDT=$P(FIND0,U,11),NOCC=$P(FIND0,U,14) 207 I +NOCC=0S NOCC=1166 I NOCC="" S NOCC=1 208 167 ;Convert the dates to FileMan dates. 209 168 S BDT=$S(BDT="":0,BDT=0:0,1:$$CTFMD^PXRMDATE(BDT)) … … 212 171 ;If EDT does not contain a time set it to the end of the day. 213 172 I EDT'["." S EDT=EDT_".235959" 214 I $G(PXRMDDOC)'=1 Q 215 S ^TMP("PXRMDDOC",$J,$P(FIND0,U,1,11))=BDT_U_EDT 216 Q 217 ; 218 ;================================= 173 Q 174 ; 175 ;=========================================================== 219 176 STRREP(STRING,TS,RS) ;Replace every occurrence of the target string (TS) 220 177 ;in STRING with the replacement string (RS). … … 234 191 Q STR 235 192 ; 236 ;================================= 193 ;=========================================================== 237 194 VEDIT(ROOT,IEN) ;This is used as a DIC("S") screen to select which entries 238 195 ;a user can edit. -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMVITL.m
r628 r636 1 PXRMVITL ; SLC/PKR - Handle vitals findings. ; 09/20/20072 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMVITL ; SLC/PKR - Handle vitals findings. ;10/21/2004 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;=========================================================== … … 20 20 ; 21 21 ;=========================================================== 22 GETDATA(DAS,FIEVT) ;Return data for a GMRV Vital Measurement entry. 23 N EM,IND,GMRVDATA,STOP,TEMP,TYPE 22 GETDATA(DAS,FIEVT) ;Return the value, which is Rate, for a specified 23 ;GMRV Vital Measurement entry. 24 N IND,GMRVDATA,TEMP 24 25 ;DBIA #3647 25 26 D EN^GMVPXRM(.GMRVDATA,DAS,"I") 26 27 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" 28 29 . 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) 36 31 S (FIEVT("RATE"),FIEVT("VALUE"))=$P(GMRVDATA(7),U,1) 37 32 S IND=0 … … 41 36 .;DBIA #4504 42 37 . I TEMP'="" S FIEVT("QUALIFIER",IND)=$P($G(^GMRD(120.52,+TEMP,0)),U,1) 43 ;DBIA #55744 I STOP'="" S FIEVT("STOP CODE")=$P(^DIC(40.7,STOP,0),U,1,2)45 E S FIEVT("STOP CODE")=""46 38 Q 47 39 ; … … 66 58 ;maintenance output. 67 59 N DATE,EM,IND,JND,NOUT,RATE,TEMP,TEXTOUT,TYPE 60 S TYPE=$$EXTERNAL^DILFD(120.5,.03,"",IFIEVAL("TYPE"),.EM) 68 61 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 70 63 S IND=0 71 64 F S IND=+$O(IFIEVAL(IND)) Q:IND=0 D -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMVPTR.m
r628 r636 1 1 PXRMVPTR ; SLC/PKR - Routines for dealing with variable pointers. ; 02/06/2001 2 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1232 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ;================================================== … … 20 20 ;indexed by the file number. 21 21 N FN,IND,ROOT,TEMP 22 ;DBIA #299123 22 S IND=0 24 23 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. ;0 2/22/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMVSIT ; SLC/PKR - Visit related info for reminders. ;07/06/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;====================================================== 5 GETDATA(DA, DATA,SVALUE) ;Return data for a specific Visit file entry.5 GETDATA(DA,FIEVT,SVALUE) ;Return data for a specific Visit file entry. 6 6 ;DBIA #2028 for Visit file. 7 N DONE,IEN,HTEMP,LOE,TEMP7 N HTEMP,TEMP 8 8 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) 19 16 ;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) 25 22 ;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)) 29 26 ;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) 37 28 Q 38 29 ; … … 89 80 ;NO-SHOW 90 81 ;NO-SHOW & AUTO RE-BOOK 91 ;NULL92 82 N STATUS,VALID 93 83 ;DBIA #4850 94 84 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) 96 86 Q VALID 97 87 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXD.m
r628 r636 1 PXRMXD ; SLC/PJH - Reminder Due reports DRIVER ; 11/27/20062 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMXD ; SLC/PJH - Reminder Due reports DRIVER ;06/20/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 START ; Arrays and strings … … 17 17 N DBDOWN,DBDUZ,DBERR,PXRMLIST,PXRMLIS1,Y 18 18 N PLISTPUG 19 N PXRMTPAT,PXRMDPAT ,PXRMPML19 N PXRMTPAT,PXRMDPAT 20 20 ; 21 21 S PXRMRT="PXRMX",PXRMTYP="X",PXRMFCMB="N",PXRMLCMB="N",PXRMTCMB="N" … … 153 153 .D LIT,TOTALS^PXRMXSD(.PXRMTOT,LIT1,LIT2,LIT3) 154 154 ; 155 MLOC ;Print Locations empty location at the end of the report156 W !157 S DIR(0)="Y",DIR("B")="YES",DIR("A")="Print locations with no patients"158 D ^DIR159 I Y="^^" G EXIT160 I Y=U G:PXRMREP="D" SSN G TOT161 S PXRMPML=Y162 ;163 155 ;Reminder Category/Individual Reminder Selection 164 156 RCAT ; 165 157 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 168 159 ; 169 160 ;Create combined reminder list -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXDT1.m
r628 r636 1 PXRMXDT1 ; SLC/PJH - Build Patient list SUBROUTINES;0 8/16/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMXDT1 ; SLC/PJH - Build Patient list SUBROUTINES;07/10/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ; Called by label from PXRMXSEO,PXRMXSE … … 167 167 Q 168 168 ; 169 ERRMSG(TYPE) ;169 DBDOWN(TYPE) ; 170 170 N CNT,CNT1,CNT2,STR,NLINES,OUTPUT,TIME 171 171 K ^TMP("PXRMXMZ",$J) … … 173 173 I TYPE="C" D Q 174 174 .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) 176 176 I 'PXRMQUE D 177 177 .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):" … … 180 180 .F CNT=1:1:NLINES W !,OUTPUT(CNT) 181 181 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 cancelledfor 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):" 183 183 .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 184 .D SEND^PXRMMSG("Cancelled Reminders Due Report("_$$FMTE^XLFDT($$NOW^XLFDT)_")",1) 185 185 .S ZTSTOP=1 186 186 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXGPR.m
r628 r636 1 PXRMXGPR ; SLC/PJH - Reminder Due print calls ; 11/16/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMXGPR ; SLC/PJH - Reminder Due print calls ;01/09/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;Called from PXRMXPR … … 174 174 ; 175 175 ;form feed to new page 176 PAGE I ($E(IOST ,1,2)="C-")&(IO=IO(0))&(PAGE>0) D176 PAGE I ($E(IOST)="C")&(IO=IO(0))&(PAGE>0) D 177 177 .S DIR(0)="E" 178 178 .W ! … … 181 181 W:$D(IOF)&(PAGE>0) @IOF 182 182 S PAGE=PAGE+1,FIRST=0 183 I $E(IOST ,1,2)="C-",IO=IO(0) W @IOF183 I $E(IOST)="C",IO=IO(0) W @IOF 184 184 E W ! 185 185 N TEMP,TEXTLEN -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXGUT.m
r628 r636 1 PXRMXGUT ; SLC/PJH - General utilities for reminder reports; 11/16/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMXGUT ; SLC/PJH - General utilities for reminder reports; 05/31/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;======================================= 5 5 EOR ;End of report display. 6 I $E(IOST ,1,2)="C-",IO=IO(0) D6 I $E(IOST)="C",IO=IO(0) D 7 7 . S DIR(0)="EA" 8 8 . S DIR("A")="End of the report. Press ENTER/RETURN to continue..." … … 29 29 ; 30 30 ;======================================= 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 31 VLIST(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 37 51 ; 38 52 ;======================================= … … 75 89 Q STR 76 90 ; 77 ;=======================================78 VLIST(SLIST,LIST,MESSAGE) ;Make sure all the elements of LIST are in79 ;SLIST. If they are, then LIST is valid. The elements of LIST can be80 ;separated by commas and spaces.81 N IC,LE,LEN,VALID82 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=188 S LEN=$L(LIST)89 I LEN=0 D90 . W !,"The list is empty!"91 . S VALID=092 F IC=1:1:LEN D93 . S LE=$E(LIST,IC,IC)94 . I SLIST'[LE D95 .. W !,LE,MESSAGE96 .. S VALID=097 Q VALID98 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXPR.m
r628 r636 1 PXRMXPR ; SLC/PJH - Print Reminder Due report. ; 11/27/20062 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMXPR ; SLC/PJH - Print Reminder Due report. ;01/14/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ; Called/Jobbed after PXRMXSE1 … … 135 135 I ('DONE),$O(^XTMP(PXRMXTMP,PX,""))="" D NULL^PXRMXGPR G EXIT 136 136 ; Report selected patient sample with no patients 137 I $D(MISSED) ,PXRMPML=1D MISSED^PXRMXPR1(0,.MISSED)137 I $D(MISSED) D MISSED^PXRMXPR1(0,.MISSED) 138 138 ; 139 139 ;Print Patient List … … 143 143 I $D(^XTMP(PXRMXTMP,"ERROR"))>0!($D(^XTMP(PXRMXTMP,"CNBD"))>0) D ERROR^PXRMXBSY 144 144 EXIT ; 145 D TIMING^PXRMXGUT146 145 D EXIT^PXRMXGUT 147 146 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXPR1.m
r628 r636 1 1 PXRMXPR1 ; SLC/AGP - Print Reminder Due report carryover code. ;01/05/2006 2 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1232 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ;Patient list display … … 70 70 N DATA,IC,LTYPE,MARK 71 71 S IC="" 72 I PXRMSEL="P" D Q72 I PXRMSEL="P" D 73 73 . F S IC=$O(PXRMPRV(IC)) Q:IC="" D 74 74 .. S DATA=PXRMPRV(IC) -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXQUE.m
r628 r636 1 PXRMXQUE ; SLC/PJH - Reminder reports general queuing routine.;0 3/23/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMXQUE ; SLC/PJH - Reminder reports general queuing routine.;02/24/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 ;Determine whether the report should be queued.4 ;Determine whether the report should be queued. 5 5 JOB ; 6 6 N %ZIS S %ZIS="Q" … … 42 42 Q $G(ZTSK) 43 43 ; 44 DEVICE(RTN,DESC,SAVE,%ZIS,RETZTSK) ; 45 ;Pass RETZTSK as number such as 1 if you want to get ZTSK. 46 N ZTSK 44 DEVICE(ZTRTN,ZTDESC,ZTSAVE,%ZIS,ZTSK) ; 47 45 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 51 50 ; 52 51 ;======================================================================= … … 138 137 S ZTSAVE("PXRMDPAT")="" 139 138 I +$G(PXRMIDOD)>0 S ZTSAVE("PXRMIDOD")="" 140 S ZTSAVE("PXRMPML")=""141 139 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXSC.m
r628 r636 1 PXRMXSC ; SLC/PJH - Reminder reports service category selection ;1 2/18/20062 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMXSC ; SLC/PJH - Reminder reports service category selection ;11/03/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 SCAT ;Get the list of service categories. … … 10 10 D HELP^DIE(9000010,"",.07,"S","SCA") 11 11 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 13 22 S DIR("??")=U_"D SCATHELP^PXRMXSC" 14 23 SCATP ; … … 28 37 ; 29 38 ;====================================================== 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 39 SCATHELP ;?? help for service categories. 43 40 W !!,"Enter the letter(s), separated by commas, corresponding to the desired service" 44 41 W !,"category or categories. For example A,H,T,E would allow only encounters with" 45 42 W !,"service categories of ambulatory, hospitalization, telecommunications, and" 46 43 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)49 44 Q 50 45 ; -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXSE1.m
r628 r636 1 PXRMXSE1 ; SLC/PJH - Build Patient lists for Reminder Due report; 0 8/16/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMXSE1 ; SLC/PJH - Build Patient lists for Reminder Due report; 01/25/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ; Called/jobbed from PXRMXD … … 64 64 ..N DA,DIK S DA=PXRMLIS1,DIK="^PXRMXP(810.5," D ^DIK 65 65 .;Otherwise create patient list 66 .D UPDLST^PXRMRULE("PXRMXPAT",PXRMLIS1,"","" ,"",PXRMDPAT,PXRMTPAT)66 .D UPDLST^PXRMRULE("PXRMXPAT",PXRMLIS1,"","") 67 67 .S $P(^PXRMXP(810.5,PXRMLIS1,0),U,9)=1 68 68 K ^TMP($J,"PXRMXPAT") … … 152 152 ; 153 153 XTMP(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 156 155 K ^TMP($J,"PXRM CNBD") 157 156 S CCNT=0,MCNBD=$G(^PXRM(800,1,"MIERR")),MCNBDR=0 … … 189 188 ....I PXRMREP="D" D SDET^PXRMXDT1(DFN,STATUS,NAM,FACILITY,INP) 190 189 ....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") 192 191 K ^TMP($J,"PXRM CNBD") 193 192 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") 197 194 ;I PXRMDBUG="Y" D DEBUG("DEBUG PATIENT DATA EVALUATION","DEBUG","^TMP($J,""PXRMDEBUG"")") 198 195 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/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMXSL1 ; SLC/PJH - Process Visits/Appts Reminder Due report;12/09/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ; Called from PXRMXSE … … 25 25 I '$D(PXRMFACN(HFAC)) Q "" 26 26 Q HFAC 27 ;28 INACTCL(HLIEN,PXRMBDT) ;29 ;Check to see if clinic is inactivated before the start of30 ;the reporting period31 N INACT,REACT32 S INACT=+$P($G(^SC(HLIEN,"I")),U) I INACT=0 Q 033 S REACT=+$P($G(^SC(HLIEN,"I")),U,2)34 I REACT'<INACT Q 035 I INACT<PXRMBDT Q 136 Q 037 27 ; 38 28 INPADM ; … … 61 51 ; 62 52 BHLOC ; 63 N CLINIEN,END,FACILITY,NAM,HLIEN,I,START,TEXT 64 N INACT,REACT 53 N CLINIEN,END,FACILITY,NAM,HLIEN,I,START 65 54 I '(PXRMQUE!$D(IO("S"))) D INIT^PXRMXBSY(.BUSY) 66 55 ;All inpatient, outpatient all location credit stop and encounter … … 69 58 .S HLIEN=0 F S HLIEN=$O(^SC(HLIEN)) Q:HLIEN'>0 D 70 59 ..S FACILITY=$$HFAC(HLIEN) I FACILITY'>0 Q 71 ..I $$INACTCL(HLIEN,PXRMBDT)=1 Q72 60 ..S NAM=$P(^SC(HLIEN,0),U) 73 61 ..I ('(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")))&(DBDOWN=0) D SPIN^PXRMXBSY("Building Hospital Locations List",.BUSY) … … 82 70 .S HLIEN=0 F S HLIEN=$O(PXRMLOCN(HLIEN)) Q:HLIEN'>0 D 83 71 ..S FACILITY=$$HFAC(HLIEN) I FACILITY'>0 Q 84 ..I $$INACTCL(HLIEN,PXRMBDT)=1 Q85 72 ..S NAM=$P(^SC(HLIEN,0),U) 86 73 ..I ('(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")))&(DBDOWN=0) D SPIN^PXRMXBSY("Building Hospital Locations List",.BUSY) … … 91 78 ..S HLIEN=0 F S HLIEN=$O(^SC("AST",CLINIEN,HLIEN)) Q:HLIEN'>0 D 92 79 ...S FACILITY=$$HFAC(HLIEN) I FACILITY'>0 Q 93 ...I $$INACTCL(HLIEN,PXRMBDT)=1 Q94 80 ...S NAM=$P(^DIC(40.7,CLINIEN,0),U)_" "_$P(PXRMCS($G(PXRMCSN(CLINIEN))),U,3) 95 81 ...I ('(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")))&(DBDOWN=0) D SPIN^PXRMXBSY("Building Hospital Locations List",.BUSY) … … 100 86 ..S HLIEN=0 F S HLIEN=$O(^SC("ASCRPW",CGRPIEN,HLIEN)) Q:HLIEN'>0 D 101 87 ...S FACILITY=$$HFAC(HLIEN) I FACILITY'>0 Q 102 ...I $$INACTCL(HLIEN,PXRMBDT)=1 Q103 88 ...I ('(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")))&(DBDOWN=0) D SPIN^PXRMXBSY("Building Hospital Locations List",.BUSY) 104 89 ...S ^XTMP(PXRMXTMP,"HLOC",HLIEN)=FACILITY_U_$P(^SC(HLIEN,0),U)_U_CGRPIEN 105 90 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DONE^PXRMXBSY("Done") 106 91 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 ; 95 DETIME(START,END,SECTION) ; 113 96 N ETIME,TEXT 114 97 S ETIME=$$HDIFF^XLFDT(END,START,2) 115 98 I ETIME>90 D 116 99 . 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 120 104 ; 121 105 OERR ; … … 145 129 I '(PXRMQUE!$D(IO("S"))) D INIT^PXRMXBSY(.BUSY) 146 130 N CNT,SCDT,LIST,SCERR,SCLIST,II,PCM,NAM,PNAM,PXRM,OK 147 N FACILITY,NAM148 131 S SCDT("BEGIN")=PXRMSDT,SCDT("END")=PXRMSDT 149 132 ;Include patient if in team on any day in range … … 163 146 ..I PXRMPRIM="P",($$PCASSIGN^PXRMXAP(DFN)'=1) Q 164 147 ..;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)="" 169 149 ..I $G(DCLN)'="" S PXRMDCLN(DCLN)="" 170 150 ..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; 0 8/16/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMXSL2 ; SLC/AGP - Process Visits/Appts Reminder Due report; 06/07/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 APPTS ; … … 6 6 N APPTDT,BDT,EDT,NODE,DFN,FACILITY,HLIEN,NAM 7 7 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 11 10 I PXRMEDT["." S EDT=PXRMEDT 12 11 E S EDT=PXRMEDT+.2359 … … 41 40 ; 42 41 SDAM301(BD,ED,PXRMSEL,PXRMFD,PXRMREP) ; 43 N ARRAY,BUSY,FACILITY,NAM,OPIEN,STATUS ,TEXT42 N ARRAY,BUSY,FACILITY,NAM,OPIEN,STATUS 44 43 K ^TMP($J,"PXRM FUTURE APPT") 45 44 K ^TMP($J,"PXRM FACILITY FUTURE APPT") … … 64 63 S COUNT=$$SDAPI^SDAMA301(.ARRAY) 65 64 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") 69 66 I COUNT<0 D Q 70 67 .N CNT … … 72 69 .F S CNT=$O(^TMP($J,"SDAMA301",CNT)) Q:CNT'>0 D 73 70 ..S DBERR(CNT)=$G(^TMP($J,"SDAMA301",CNT)) 74 .D ERRMSG^PXRMXDT1("E")71 .D DBDOWN^PXRMXDT1("E") 75 72 ; 76 73 LOOP ; 77 74 I PXRMFD'="P"!(PXRMSEL'="L") Q 78 N APPTDT,CIEN,DFN,FUTDT,NODE, TEXT,VIEN75 N APPTDT,CIEN,DFN,FUTDT,NODE,VIEN 79 76 ;LOOP THROUGH PATIENT 80 77 S START=$H … … 102 99 S END=$H 103 100 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") 107 102 Q 108 103 ; 109 104 ;Scan visit file to build list of patients 110 105 VISITS ; 111 N BUSY,DAS,DATE,DFN,DS,END,ETIME,HLOC,NF112 N SC,START,TEMP,TEXT,TGLIST,TIME113 S START=$H114 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="" D123 . S NF=0124 . F S NF=$O(^TMP($J,"PLIST",DFN,NF)) Q:NF="" D125 .. S TEMP=^TMP($J,"PLIST",DFN,NF)126 .. S SC=$P(TEMP,U,4)127 .. I '$D(PXRMSCAT(SC)) Q128 .. ;Remove test Patients129 .. I 'PXRMTPAT,$$TESTPAT^VADPT(DFN)=1 Q130 .. ;Remove deceased patients131 .. I 'PXRMDPAT,$P($G(^DPT(DFN,.35)),U,1)>0 Q132 .. 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=$H136 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")=TEXT139 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) W !,TEXT140 I PXRMREP="D" D SDAM301(PXRMBDT,PXRMEDT,PXRMSEL,PXRMFD,PXRMREP)141 I DBDOWN=1 Q142 S START=$H143 S BUSY=0144 I '(PXRMQUE!$D(IO("S"))) D INIT^PXRMXBSY(.BUSY)145 N HLIEN,NAM,FACILITY,LSEL,NODE146 S DFN=0 F S DFN=$O(^TMP($J,"PXRM PATIENT LIST",DFN)) Q:DFN'>0 D147 .S HLIEN=0148 .F S HLIEN=$O(^TMP($J,"PXRM PATIENT LIST",DFN,HLIEN)) Q:HLIEN'>0 D149 ..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=$H158 S TEXT="Elapsed time for removing invalid encounter(s): "_$$DETIME^PXRMXSL1(START,END)159 S ^XTMP(PXRMXTMP,"TIMING","REMOVING INVALID ENCOUNTER(S)")=TEXT160 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) W !,TEXT161 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) D DONE^PXRMXBSY("Done")162 Q163 ;164 VISITSO ; Old entry point165 106 N BTIME,DAS,DATE,DEND,DFN,DONE,DS,ETIME,HLOC,INVBD,INVDATE,INVDT,INVED 166 N NFOUND,SC,TEMP,T EXT,TGLIST,TIME107 N NFOUND,SC,TEMP,TGLIST,TIME 167 108 N DOD,START,END 168 109 S START=$H … … 175 116 S INVBD=9999999-$P(PXRMBDT,".",1),BTIME=+("."_$P(PXRMBDT,".",2)) 176 117 S INVED=9999999-$P(DEND,".",1),ETIME=+("."_$P(DEND,".",2)) 177 S DS=INVED- .000001118 S DS=INVED-1 178 119 S HLOC="" 179 120 F S HLOC=$O(^XTMP(PXRMXTMP,"HLOC",HLOC)) Q:HLOC="" D … … 203 144 S END=$H 204 145 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) 210 148 ; 211 149 I DBDOWN=1 Q 212 150 S START=$H 213 151 S BUSY=0 152 I DBDOWN=1 Q 214 153 N NODE 215 154 I '(PXRMQUE!$D(IO("S"))) D INIT^PXRMXBSY(.BUSY) … … 227 166 ..S ^TMP($J,"PXRM PATIENT EVAL",DFN)="" 228 167 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)")=TEXT231 I '(PXRMQUE!$D(IO("S"))!(PXRMTABS="Y")) W !,TEXT232 168 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)") 233 170 Q -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXTB.m
r628 r636 1 PXRMXTB ; SLC/PJH - Reminder Reports Template Load ; 11/27/20062 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1231 PXRMXTB ; SLC/PJH - Reminder Reports Template Load ;08/01/2001 2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ; Called from PXRMXD … … 58 58 S XREF("PXRMLCSC")=1.5 59 59 S XREF("PXRMFD")=1.6 60 S XREF("PXRMPML")=1.761 60 S XREF("PXRMREM")=2 62 61 S XREF("PXRMFAC")=3 -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXTD.m
r628 r636 1 PXRMXTD ; SLC/PJH - Reminder Reports Template Display ;11/ 16/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMXTD ; SLC/PJH - Reminder Reports Template Display ;11/03/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ; Called from PXRMXT/PXRMXTF … … 24 24 .I $E(PXRMLCSC,2)'="A" W ! D ARRS 25 25 I DONE Q 26 W !?PSTART,"Print Locations without Patients:",?32,$S($G(PXRMPML)=0:"NO",1:"YES")27 26 S IC="" F S IC=$O(PXRMRCAT(IC)) Q:IC="" D Q:DONE 28 27 .W !,?PSTART W:IC=1 "Category:" … … 95 94 ;form feed to new page 96 95 ;--------------------- 97 PAGE I ($E(IOST ,1,2)="C-")&(IO=IO(0))&(PAGE>0) D96 PAGE I ($E(IOST)="C")&(IO=IO(0))&(PAGE>0) D 98 97 .S DIR(0)="E" 99 98 .W ! -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXTE.m
r628 r636 1 PXRMXTE ; SLC/PJH - Reminder Reports Template Edit ; 11/27/20062 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMXTE ; SLC/PJH - Reminder Reports Template Edit ;08/03/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ; Called from PXRMYD,PXRMXD … … 58 58 ;Report type (detail or summary) 59 59 S DR=DR_";1.4" 60 ;Print Locations without patients61 S DR=DR_";1.7"62 60 ;Reminder Categories 63 61 I $D(^PXRMPT(810.1,DA,12,0))>0 D -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXTF.m
r628 r636 1 1 PXRMXTF ; SLC/PJH - Reminder Reports Template Filing ;05/02/2002 2 ;;2.0;CLINICAL REMINDERS; **6**;Feb 04, 2005;Build 1232 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005 3 3 ; 4 4 ; Called from PXRMXTA -
FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMXTU.m
r628 r636 1 PXRMXTU ; SLC/PJH - Reminder Reports Template Update ;11/ 27/20062 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMXTU ; SLC/PJH - Reminder Reports Template Update ;11/03/2005 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 4 ; Called from PXRMYD,PXRMXD (also at UPD from PXRMXPR/PXRMYPR) … … 59 59 ; 60 60 ;Save single fields into FDA 61 F IC="NAME","PXRMLCSC","PXRMPRIM","PXRMREP","PXRMSEL","PXRMTYP" ,"PXRMPML"D61 F IC="NAME","PXRMLCSC","PXRMPRIM","PXRMREP","PXRMSEL","PXRMTYP" D 62 62 .S FDA(810.1,MODE,XREF(IC))=$G(@IC) 63 63 F IC="PXRMFD","PXRMSCAT","RUN","TITLE" D
Note:
See TracChangeset
for help on using the changeset viewer.