PXQUTL1 ;ISL/JVS - DEBUGGING UTILITIES ;5/1/97 08:30
;;1.0;PCE PATIENT CARE ENCOUNTER;**4,29**;Aug 12 1996
;
;
DEC(VISIT,FLENUM,VISUAL,PXQFORM) ;Test looking through DD to find fields pointing to the visit entries.
;Q:'$D(^AUPNVSIT(VISIT)) ""
Q:'$D(DUZ) ""
Q:$G(PXQFORM)=""
; VISIT =Visit ien to looked up and counted
; VISUAL =Set to 1 if you want and interactive display of what is found
; PXQFORM=The format that it is to be diplayed.
;
; Look for file and field
;
N DD,PXQKY,COUNT,FIELD,FILE,GET,PIECE,PX,REF,SNDPIECE,STOP,SUB,PXQDATA
N PXQTYPE,VAR,UPFILE,PXQVGHN,PXQFLD,PXQLIEN,PXQKY,PXQKY1,PXQKY2,PXQKY3
N PXQNFLD,PXX
;
S PXQTYPE=$P(PXQFORM,"^",2),PXQFORM=$P(PXQFORM,"^",1) D:$G(PXQTYPE)="C" ADD2 D:$G(PXQTYPE)="D" MUST
S DD="^DD"
S FILE=""
F S FILE=$O(@DD@(FLENUM,0,"PT",FILE)) Q:FILE="" D
.S FIELD=""
.F S FIELD=$O(@DD@(FLENUM,0,"PT",FILE,FIELD)) Q:FIELD="" D
..S VDD(FILE,FIELD)=""
D EN1^PXQUTL2
D REF,QUE
K VDDN,VDDR
K ^TMP("PXQADDITIONAL",$J)
I $G(VISUAL) W !,"COUNT= "
Q COUNT
;
REF ;Look for all of the regular cross references and other
;
S FILE="" F S FILE=$O(VDD(FILE)) Q:FILE="" D
.S FIELD="" F S FIELD=$O(VDD(FILE,FIELD)) Q:FIELD="" D
..D REG
K VDD
Q
;
REG ;Look for regular cross references
;
S STOP=0
I '$D(@DD@(FILE,FIELD,1)) S VDDN(FILE,FIELD)="" Q
S SUB=0 F S SUB=$O(@DD@(FILE,FIELD,1,SUB)) Q:SUB="" D
.S GET=$G(@DD@(FILE,FIELD,1,SUB,0))
.I $P(GET,"^",3)']"" S VDDR(FILE,SUB)=FILE_"^"_FIELD_"^"_SUB S STOP=1
.E S VDDN(FILE,FIELD)=""
Q
QUE ;CHECK OUT CROSS REFERENCE
;
S FILE="",FIELD="",STOP="",COUNT=0
F S FILE=$O(VDDR(FILE)) Q:FILE="" D
.S SUB=0,STOP="" F S SUB=$O(VDDR(FILE,SUB)) Q:SUB="" Q:STOP=1 S GET=$G(VDDR(FILE,SUB)) D
..S REF=$G(@DD@($P(GET,"^",1),$P(GET,"^",2),1,$P(GET,"^",3),1))
..I $P(REF,"""",1)["DA(1)" Q
..S PIECE=$P(REF," ",2)
..S SNDPIECE=$P(PIECE,"""",1,2)_""""
..S PXQVGHN=$P(PIECE,"""",1,2)_""")"
..I $D(@PXQVGHN) D S STOP=1
...S PX=SNDPIECE_",VISIT)"
...I $D(@PX) D
....S PXQKY=0 F S PXQKY=$O(@PX@(PXQKY)) Q:PXQKY="" S COUNT=COUNT+1,PXB=PXQKY S:FILE=409.68 PXQENC(PXQKY)="" D
.....S VAR="" S VAR=$O(@PX@(PXQKY,VAR)) I VAR="" D DIS S PX=PXX Q
.....S PXQKY1=0 F S PXQKY1=$O(@PX@(PXQKY,PXQKY1)) Q:PXQKY1="" S PXB1=PXQKY1 D
......S VAR="" S VAR=$O(@PX@(PXQKY,PXQKY1,VAR)) I VAR="" D DIS S PX=PXX Q
......S PXQKY2=0 F S PXQKY2=$O(@PX@(PXQKY,PXQKY1,PXQKY2)) Q:PXQKY2="" S PXB2=PXQKY2 D
.......S VAR="" S VAR=$O(@PX@(PXQKY,PXQKY1,PXQKY2,VAR)) I VAR="" D DIS S PX=PXX Q
.......S PXQKY3=0 F S PXQKY3=$O(@PX@(PXQKY,PXQKY1,PXQKY2,PXQKY3)) Q:PXQKY3="" S PXB3=PXQKY3 D
........S VAR="" S VAR=$O(@PX@(PXQKY,PXQKY1,PXQKY2,PXQKY3,VAR)) I VAR="" D DIS S PX=PXX Q
Q
;
DIS ;--DISPLAY
S PXX=PX
W:$G(VISUAL) !," ",SNDPIECE_","_VISIT_","_$G(PXB) S PXBIEN=$G(PXB)
W:$G(VISUAL) $S($G(PXB1):","_$G(PXB1),1:"") S PXBIEN=PXBIEN_","_$G(PXB1)
W:$G(VISUAL) $S($G(PXB2):","_$G(PXB2),1:"") S PXBIEN=PXBIEN_","_$G(PXB2)
W:$G(VISUAL) $S($G(PXB3):","_$G(PXB3),1:"") S PXBIEN=PXBIEN_","_$G(PXB3)
K ^TMP("PXQDATA",$J)
;
;
;--REVERSE ORDER OF PXBIEN
S PXQIENS="" F PXQI=($L(PXBIEN,",")-1):-1:1 S PXQJ=+$P($G(PXBIEN),",",PXQI) D
.I PXQJ>0 S PXQIENS=PXQIENS_PXQJ_","
K PXBIEN
;
;--DO FIRST CALL TO GETS^DIQ
S PXQFORM2=PXQFORM
I FILE=8925,PXQFORM["**" S PXQFORM=".01:.999;2.1:999999"
I $G(PXQIENS) D GETS^DIQ(FILE,PXQIENS,PXQFORM,"NE","^TMP(""PXQDATA"",$J")
D ADD
;
;--GET NEXT FILE NUMBER
S UPFILE=FILE
F S UPFILE=$G(@DD@(UPFILE,0,"UP")) Q:UPFILE'>0 D
.S PXQIENS=$P($G(PXQIENS),",",2,10)
.I FILE=8925,PXQFORM["**" S PXQFORM=".01:.999;2.1:999999"
.I $G(PXQIENS) D GETS^DIQ(UPFILE,PXQIENS,PXQFORM,"NE","^TMP(""PXQDATA"",$J")
.D ADD1
S PXQFORM=PXQFORM2
;
;
D PRINT
EXIT ;---CLEAN UP AND QUIT DOESN'T QUIT THE ROUTINE
K PXB,PXB1,PXB2,PXB3,PXQI,PXQJ
K PXQIENS,PXQTEST,PXQWORD
S VAR=""
Q
PRINT ;--PRINT TO SCREEN
N PXQFILE,PXQIENS,PXQFIELD,PXQLEIN,PXQNAME,PXQSPAC,PXQENTRY,PXQENTR
N PXQX
S PXQLIEN=0
S PXQFILE="" F S PXQFILE=$O(^TMP("PXQDATA",$J,PXQFILE)) Q:PXQFILE="" D
.S PXQNAME=$O(@DD@(PXQFILE,0,"NM",""))
.S PXQSPAC="?"_(PXQLIEN+4)_","
.S PXQTEST=PXQSPAC_""""_"FILE = "_PXQNAME_" #"_PXQFILE
.S PXQIENS="" F S PXQIENS=$O(^TMP("PXQDATA",$J,PXQFILE,PXQIENS)) Q:PXQIENS="" D
..S PXQLIEN=($L(PXQIENS,",")*4)
..S PXQENTRY=$P(PXQIENS,",",1) ;--($L(PXQIENS,",")-1))
..S PXQENTR=" RECORD #"_PXQENTRY
..W $$RE^PXQUTL(""_PXQTEST_PXQENTR_"""")
..S PXQFIELD="" F S PXQFIELD=$O(^TMP("PXQDATA",$J,PXQFILE,PXQIENS,PXQFIELD)) Q:PXQFIELD="" D
...;---NEW CODE 3/24/97
...D FIELD^DID(PXQFILE,PXQFIELD,"","TYPE","PXQWORD","PXQWORD")
...I PXQWORD("TYPE")["WORD-PROCESSING" D
....K PXQWORD,^TMP("PXQDATA",$J,PXQFILE,PXQIENS,PXQFIELD)
....S ^TMP("PXQDATA",$J,PXQFILE,PXQIENS,PXQFIELD,"E")="(word-processing field)"
...S PXQX=$G(^TMP("PXQDATA",$J,PXQFILE,PXQIENS,PXQFIELD,"E"))
...I PXQX["""" S PXQX="(not displayable-look up entry)"
...S ^TMP("PXQDATA",$J,PXQFILE,PXQIENS,PXQFIELD,"E")=PXQX
...;---END OF CODE
...N PXQNF,PXQMOV
...S PXQMOV=""",?35,"""
...S PXQNF=$P($G(@DD@(PXQFILE,PXQFIELD,0)),"^",1)_PXQMOV_" = "_$G(^TMP("PXQDATA",$J,PXQFILE,PXQIENS,PXQFIELD,"E"))
...W $$RE^PXQUTL(""_"?"_PXQLIEN_","_""""_PXQNF_"""")
W $$RE^PXQUTL("______________________________________________________________")
Q
;
ADD ;--GET FIELD VALUES FOR FILE
I $D(^TMP("PXQADDITIONAL",$J,FILE)) D
.S PXQNFLD=0 F S PXQNFLD=$O(^TMP("PXQADDITIONAL",$J,FILE,PXQNFLD)) Q:PXQNFLD="" D
..I $G(PXQIENS) D GETS^DIQ(FILE,PXQIENS,PXQNFLD,"E","^TMP(""PXQDATA"",$J,")
Q
;
ADD1 ;--GET FIELD VALUES FOR UPFILE
I $D(^TMP("PXQADDITIONAL",$J,UPFILE)) D
.S PXQNFLD=0 F S PXQNFLD=$O(^TMP("PXQADDITIONAL",$J,UPFILE,PXQNFLD)) Q:PXQNFLD="" D
..I $G(PXQIENS) D GETS^DIQ(UPFILE,PXQIENS,PXQNFLD,"E","^TMP(""PXQDATA"",$J,")
Q
;
ADD2 ;--ADDITIONAL FIELDS IN A FILE TO BE DIAPLAYED
;--LOCATE DUZ ENTRY
; VARIABLES:
; PXQUSER = Entry in file #812 representing the DUZ
; PXQFLE = File Number
; PXQFLEIE= File Number IEN in file #812
; PXQFLD = The Field in the above file
;
N PXQUSER,PXQFLE,PXQFLEIE,PXQFLD
S PXQUSER=$O(^PXD(812,"B",DUZ,0)) I PXQUSER="" Q
;--LOCATE FILE NUMBERS
S PXQFLE=0 F S PXQFLE=$O(^PXD(812,PXQUSER,"FILE","B",PXQFLE)) Q:PXQFLE="" D
.S PXQFLEIE=0 F S PXQFLEIE=$O(^PXD(812,PXQUSER,"FILE","B",PXQFLE,PXQFLEIE)) Q:PXQFLEIE="" D
..S PXQFLD=0 F S PXQFLD=$O(^PXD(812,PXQUSER,"FILE",PXQFLEIE,"FIELD","B",PXQFLD)) Q:PXQFLD="" D
...S ^TMP("PXQADDITIONAL",$J,PXQFLE,PXQFLD)=""
;
MUST ;--MUST ADDITIONAL ENTRIES TO MAKE SENSE
S ^TMP("PXQADDITIONAL",$J,9000010.18,.16)="" ;-QUANTITY -V CPT
S ^TMP("PXQADDITIONAL",$J,409.51,21)="" ;-CPT CODES - SCHEDULING VISITS
S ^TMP("PXQADDITIONAL",$J,409.51,22)="" ; " "
S ^TMP("PXQADDITIONAL",$J,409.51,23)="" ; " "
S ^TMP("PXQADDITIONAL",$J,409.51,24)="" ; " "
S ^TMP("PXQADDITIONAL",$J,409.51,25)="" ; " "
S ^TMP("PXQADDITIONAL",$J,409.68,.04)="" ;-LOCATION - ENCOUNTER
S ^TMP("PXQADDITIONAL",$J,409.68,.08)="" ;-ORIGINATING - ENCOUNTER
S ^TMP("PXQADDITIONAL",$J,9000010,.22)="" ;-VISIT - LOCATION
S ^TMP("PXQADDITIONAL",$J,9000010,.05)="" ;-VISIT - PATIENT
S ^TMP("PXQADDITIONAL",$J,70.02,3)="" ;-REGISTERED EXAMS - DIVISION
S ^TMP("PXQADDITIONAL",$J,70.02,4)="" ;-REGISTERED EXAMS - LOCATION
S ^TMP("PXQADDITIONAL",$J,70.02,5)="" ;-REGISTERED EXAMS - EXAM SET
S ^TMP("PXQADDITIONAL",$J,70.03,2)="" ;-EXAMINATIONS - PROCEDURE
S ^TMP("PXQADDITIONAL",$J,70.03,3)="" ;-EXAMINATIONS - EXAM STATUS
S ^TMP("PXQADDITIONAL",$J,70.03,4)="" ;-EXAMINATIONS - CATEGORY
S ^TMP("PXQADDITIONAL",$J,70.03,23)="" ;-EXAMINATIONS - CLINIC STOP REC
S ^TMP("PXQADDITIONAL",$J,70.03,26)="" ;-EXAMINATIONS - CREDIT METHOD
;
;S ^TMP("PXQADDITIONAL",$J,8925,.02)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,.03)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,.04)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,.05)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,.07)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,.1)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,1201)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,1202)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,1204)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,1205)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,1301)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,1302)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,1404)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,1502)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,1503)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,1504)="" ;-TIU FIELDS
;S ^TMP("PXQADDITIONAL",$J,8925,1505)="" ;-TIU FIELDS
Q
PXQUTL1 ;ISL/JVS - DEBUGGING UTILITIES ;5/1/97 08:30
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**4,29**;Aug 12 1996
+2 ;
+3 ;
DEC(VISIT,FLENUM,VISUAL,PXQFORM) ;Test looking through DD to find fields pointing to the visit entries.
+1 ;Q:'$D(^AUPNVSIT(VISIT)) ""
+2 IF '$DATA(DUZ)
QUIT ""
+3 IF $GET(PXQFORM)=""
QUIT
+4 ; VISIT =Visit ien to looked up and counted
+5 ; VISUAL =Set to 1 if you want and interactive display of what is found
+6 ; PXQFORM=The format that it is to be diplayed.
+7 ;
+8 ; Look for file and field
+9 ;
+10 NEW DD,PXQKY,COUNT,FIELD,FILE,GET,PIECE,PX,REF,SNDPIECE,STOP,SUB,PXQDATA
+11 NEW PXQTYPE,VAR,UPFILE,PXQVGHN,PXQFLD,PXQLIEN,PXQKY,PXQKY1,PXQKY2,PXQKY3
+12 NEW PXQNFLD,PXX
+13 ;
+14 SET PXQTYPE=$PIECE(PXQFORM,"^",2)
SET PXQFORM=$PIECE(PXQFORM,"^",1)
IF $GET(PXQTYPE)="C"
DO ADD2
IF $GET(PXQTYPE)="D"
DO MUST
+15 SET DD="^DD"
+16 SET FILE=""
+17 FOR
SET FILE=$ORDER(@DD@(FLENUM,0,"PT",FILE))
IF FILE=""
QUIT
Begin DoDot:1
+18 SET FIELD=""
+19 FOR
SET FIELD=$ORDER(@DD@(FLENUM,0,"PT",FILE,FIELD))
IF FIELD=""
QUIT
Begin DoDot:2
+20 SET VDD(FILE,FIELD)=""
End DoDot:2
End DoDot:1
+21 DO EN1^PXQUTL2
+22 DO REF
DO QUE
+23 KILL VDDN,VDDR
+24 KILL ^TMP("PXQADDITIONAL",$JOB)
+25 IF $GET(VISUAL)
WRITE !,"COUNT= "
+26 QUIT COUNT
+27 ;
REF ;Look for all of the regular cross references and other
+1 ;
+2 SET FILE=""
FOR
SET FILE=$ORDER(VDD(FILE))
IF FILE=""
QUIT
Begin DoDot:1
+3 SET FIELD=""
FOR
SET FIELD=$ORDER(VDD(FILE,FIELD))
IF FIELD=""
QUIT
Begin DoDot:2
+4 DO REG
End DoDot:2
End DoDot:1
+5 KILL VDD
+6 QUIT
+7 ;
REG ;Look for regular cross references
+1 ;
+2 SET STOP=0
+3 IF '$DATA(@DD@(FILE,FIELD,1))
SET VDDN(FILE,FIELD)=""
QUIT
+4 SET SUB=0
FOR
SET SUB=$ORDER(@DD@(FILE,FIELD,1,SUB))
IF SUB=""
QUIT
Begin DoDot:1
+5 SET GET=$GET(@DD@(FILE,FIELD,1,SUB,0))
+6 IF $PIECE(GET,"^",3)']""
SET VDDR(FILE,SUB)=FILE_"^"_FIELD_"^"_SUB
SET STOP=1
+7 IF '$TEST
SET VDDN(FILE,FIELD)=""
End DoDot:1
+8 QUIT
QUE ;CHECK OUT CROSS REFERENCE
+1 ;
+2 SET FILE=""
SET FIELD=""
SET STOP=""
SET COUNT=0
+3 FOR
SET FILE=$ORDER(VDDR(FILE))
IF FILE=""
QUIT
Begin DoDot:1
+4 SET SUB=0
SET STOP=""
FOR
SET SUB=$ORDER(VDDR(FILE,SUB))
IF SUB=""
QUIT
IF STOP=1
QUIT
SET GET=$GET(VDDR(FILE,SUB))
Begin DoDot:2
+5 SET REF=$GET(@DD@($PIECE(GET,"^",1),$PIECE(GET,"^",2),1,$PIECE(GET,"^",3),1))
+6 IF $PIECE(REF,"""",1)["DA(1)"
QUIT
+7 SET PIECE=$PIECE(REF," ",2)
+8 SET SNDPIECE=$PIECE(PIECE,"""",1,2)_""""
+9 SET PXQVGHN=$PIECE(PIECE,"""",1,2)_""")"
+10 IF $DATA(@PXQVGHN)
Begin DoDot:3
+11 SET PX=SNDPIECE_",VISIT)"
+12 IF $DATA(@PX)
Begin DoDot:4
+13 SET PXQKY=0
FOR
SET PXQKY=$ORDER(@PX@(PXQKY))
IF PXQKY=""
QUIT
SET COUNT=COUNT+1
SET PXB=PXQKY
IF FILE=409.68
SET PXQENC(PXQKY)=""
Begin DoDot:5
+14 SET VAR=""
SET VAR=$ORDER(@PX@(PXQKY,VAR))
IF VAR=""
DO DIS
SET PX=PXX
QUIT
+15 SET PXQKY1=0
FOR
SET PXQKY1=$ORDER(@PX@(PXQKY,PXQKY1))
IF PXQKY1=""
QUIT
SET PXB1=PXQKY1
Begin DoDot:6
+16 SET VAR=""
SET VAR=$ORDER(@PX@(PXQKY,PXQKY1,VAR))
IF VAR=""
DO DIS
SET PX=PXX
QUIT
+17 SET PXQKY2=0
FOR
SET PXQKY2=$ORDER(@PX@(PXQKY,PXQKY1,PXQKY2))
IF PXQKY2=""
QUIT
SET PXB2=PXQKY2
Begin DoDot:7
+18 SET VAR=""
SET VAR=$ORDER(@PX@(PXQKY,PXQKY1,PXQKY2,VAR))
IF VAR=""
DO DIS
SET PX=PXX
QUIT
+19 SET PXQKY3=0
FOR
SET PXQKY3=$ORDER(@PX@(PXQKY,PXQKY1,PXQKY2,PXQKY3))
IF PXQKY3=""
QUIT
SET PXB3=PXQKY3
Begin DoDot:8
+20 SET VAR=""
SET VAR=$ORDER(@PX@(PXQKY,PXQKY1,PXQKY2,PXQKY3,VAR))
IF VAR=""
DO DIS
SET PX=PXX
QUIT
End DoDot:8
End DoDot:7
End DoDot:6
End DoDot:5
End DoDot:4
End DoDot:3
SET STOP=1
End DoDot:2
End DoDot:1
+21 QUIT
+22 ;
DIS ;--DISPLAY
+1 SET PXX=PX
+2 IF $GET(VISUAL)
WRITE !," ",SNDPIECE_","_VISIT_","_$GET(PXB)
SET PXBIEN=$GET(PXB)
+3 IF $GET(VISUAL)
WRITE $SELECT($GET(PXB1):","_$GET(PXB1),1:"")
SET PXBIEN=PXBIEN_","_$GET(PXB1)
+4 IF $GET(VISUAL)
WRITE $SELECT($GET(PXB2):","_$GET(PXB2),1:"")
SET PXBIEN=PXBIEN_","_$GET(PXB2)
+5 IF $GET(VISUAL)
WRITE $SELECT($GET(PXB3):","_$GET(PXB3),1:"")
SET PXBIEN=PXBIEN_","_$GET(PXB3)
+6 KILL ^TMP("PXQDATA",$JOB)
+7 ;
+8 ;
+9 ;--REVERSE ORDER OF PXBIEN
+10 SET PXQIENS=""
FOR PXQI=($LENGTH(PXBIEN,",")-1):-1:1
SET PXQJ=+$PIECE($GET(PXBIEN),",",PXQI)
Begin DoDot:1
+11 IF PXQJ>0
SET PXQIENS=PXQIENS_PXQJ_","
End DoDot:1
+12 KILL PXBIEN
+13 ;
+14 ;--DO FIRST CALL TO GETS^DIQ
+15 SET PXQFORM2=PXQFORM
+16 IF FILE=8925
IF PXQFORM["**"
SET PXQFORM=".01:.999;2.1:999999"
+17 IF $GET(PXQIENS)
DO GETS^DIQ(FILE,PXQIENS,PXQFORM,"NE","^TMP(""PXQDATA"",$J")
+18 DO ADD
+19 ;
+20 ;--GET NEXT FILE NUMBER
+21 SET UPFILE=FILE
+22 FOR
SET UPFILE=$GET(@DD@(UPFILE,0,"UP"))
IF UPFILE'>0
QUIT
Begin DoDot:1
+23 SET PXQIENS=$PIECE($GET(PXQIENS),",",2,10)
+24 IF FILE=8925
IF PXQFORM["**"
SET PXQFORM=".01:.999;2.1:999999"
+25 IF $GET(PXQIENS)
DO GETS^DIQ(UPFILE,PXQIENS,PXQFORM,"NE","^TMP(""PXQDATA"",$J")
+26 DO ADD1
End DoDot:1
+27 SET PXQFORM=PXQFORM2
+28 ;
+29 ;
+30 DO PRINT
EXIT ;---CLEAN UP AND QUIT DOESN'T QUIT THE ROUTINE
+1 KILL PXB,PXB1,PXB2,PXB3,PXQI,PXQJ
+2 KILL PXQIENS,PXQTEST,PXQWORD
+3 SET VAR=""
+4 QUIT
PRINT ;--PRINT TO SCREEN
+1 NEW PXQFILE,PXQIENS,PXQFIELD,PXQLEIN,PXQNAME,PXQSPAC,PXQENTRY,PXQENTR
+2 NEW PXQX
+3 SET PXQLIEN=0
+4 SET PXQFILE=""
FOR
SET PXQFILE=$ORDER(^TMP("PXQDATA",$JOB,PXQFILE))
IF PXQFILE=""
QUIT
Begin DoDot:1
+5 SET PXQNAME=$ORDER(@DD@(PXQFILE,0,"NM",""))
+6 SET PXQSPAC="?"_(PXQLIEN+4)_","
+7 SET PXQTEST=PXQSPAC_""""_"FILE = "_PXQNAME_" #"_PXQFILE
+8 SET PXQIENS=""
FOR
SET PXQIENS=$ORDER(^TMP("PXQDATA",$JOB,PXQFILE,PXQIENS))
IF PXQIENS=""
QUIT
Begin DoDot:2
+9 SET PXQLIEN=($LENGTH(PXQIENS,",")*4)
+10 ;--($L(PXQIENS,",")-1))
SET PXQENTRY=$PIECE(PXQIENS,",",1)
+11 SET PXQENTR=" RECORD #"_PXQENTRY
+12 WRITE $$RE^PXQUTL(""_PXQTEST_PXQENTR_"""")
+13 SET PXQFIELD=""
FOR
SET PXQFIELD=$ORDER(^TMP("PXQDATA",$JOB,PXQFILE,PXQIENS,PXQFIELD))
IF PXQFIELD=""
QUIT
Begin DoDot:3
+14 ;---NEW CODE 3/24/97
+15 DO FIELD^DID(PXQFILE,PXQFIELD,"","TYPE","PXQWORD","PXQWORD")
+16 IF PXQWORD("TYPE")["WORD-PROCESSING"
Begin DoDot:4
+17 KILL PXQWORD,^TMP("PXQDATA",$JOB,PXQFILE,PXQIENS,PXQFIELD)
+18 SET ^TMP("PXQDATA",$JOB,PXQFILE,PXQIENS,PXQFIELD,"E")="(word-processing field)"
End DoDot:4
+19 SET PXQX=$GET(^TMP("PXQDATA",$JOB,PXQFILE,PXQIENS,PXQFIELD,"E"))
+20 IF PXQX[""""
SET PXQX="(not displayable-look up entry)"
+21 SET ^TMP("PXQDATA",$JOB,PXQFILE,PXQIENS,PXQFIELD,"E")=PXQX
+22 ;---END OF CODE
+23 NEW PXQNF,PXQMOV
+24 SET PXQMOV=""",?35,"""
+25 SET PXQNF=$PIECE($GET(@DD@(PXQFILE,PXQFIELD,0)),"^",1)_PXQMOV_" = "_$GET(^TMP("PXQDATA",$JOB,PXQFILE,PXQIENS,PXQFIELD,"E"))
+26 WRITE $$RE^PXQUTL(""_"?"_PXQLIEN_","_""""_PXQNF_"""")
End DoDot:3
End DoDot:2
End DoDot:1
+27 WRITE $$RE^PXQUTL("______________________________________________________________")
+28 QUIT
+29 ;
ADD ;--GET FIELD VALUES FOR FILE
+1 IF $DATA(^TMP("PXQADDITIONAL",$JOB,FILE))
Begin DoDot:1
+2 SET PXQNFLD=0
FOR
SET PXQNFLD=$ORDER(^TMP("PXQADDITIONAL",$JOB,FILE,PXQNFLD))
IF PXQNFLD=""
QUIT
Begin DoDot:2
+3 IF $GET(PXQIENS)
DO GETS^DIQ(FILE,PXQIENS,PXQNFLD,"E","^TMP(""PXQDATA"",$J,")
End DoDot:2
End DoDot:1
+4 QUIT
+5 ;
ADD1 ;--GET FIELD VALUES FOR UPFILE
+1 IF $DATA(^TMP("PXQADDITIONAL",$JOB,UPFILE))
Begin DoDot:1
+2 SET PXQNFLD=0
FOR
SET PXQNFLD=$ORDER(^TMP("PXQADDITIONAL",$JOB,UPFILE,PXQNFLD))
IF PXQNFLD=""
QUIT
Begin DoDot:2
+3 IF $GET(PXQIENS)
DO GETS^DIQ(UPFILE,PXQIENS,PXQNFLD,"E","^TMP(""PXQDATA"",$J,")
End DoDot:2
End DoDot:1
+4 QUIT
+5 ;
ADD2 ;--ADDITIONAL FIELDS IN A FILE TO BE DIAPLAYED
+1 ;--LOCATE DUZ ENTRY
+2 ; VARIABLES:
+3 ; PXQUSER = Entry in file #812 representing the DUZ
+4 ; PXQFLE = File Number
+5 ; PXQFLEIE= File Number IEN in file #812
+6 ; PXQFLD = The Field in the above file
+7 ;
+8 NEW PXQUSER,PXQFLE,PXQFLEIE,PXQFLD
+9 SET PXQUSER=$ORDER(^PXD(812,"B",DUZ,0))
IF PXQUSER=""
QUIT
+10 ;--LOCATE FILE NUMBERS
+11 SET PXQFLE=0
FOR
SET PXQFLE=$ORDER(^PXD(812,PXQUSER,"FILE","B",PXQFLE))
IF PXQFLE=""
QUIT
Begin DoDot:1
+12 SET PXQFLEIE=0
FOR
SET PXQFLEIE=$ORDER(^PXD(812,PXQUSER,"FILE","B",PXQFLE,PXQFLEIE))
IF PXQFLEIE=""
QUIT
Begin DoDot:2
+13 SET PXQFLD=0
FOR
SET PXQFLD=$ORDER(^PXD(812,PXQUSER,"FILE",PXQFLEIE,"FIELD","B",PXQFLD))
IF PXQFLD=""
QUIT
Begin DoDot:3
+14 SET ^TMP("PXQADDITIONAL",$JOB,PXQFLE,PXQFLD)=""
End DoDot:3
End DoDot:2
End DoDot:1
+15 ;
MUST ;--MUST ADDITIONAL ENTRIES TO MAKE SENSE
+1 ;-QUANTITY -V CPT
SET ^TMP("PXQADDITIONAL",$JOB,9000010.18,.16)=""
+2 ;-CPT CODES - SCHEDULING VISITS
SET ^TMP("PXQADDITIONAL",$JOB,409.51,21)=""
+3 ; " "
SET ^TMP("PXQADDITIONAL",$JOB,409.51,22)=""
+4 ; " "
SET ^TMP("PXQADDITIONAL",$JOB,409.51,23)=""
+5 ; " "
SET ^TMP("PXQADDITIONAL",$JOB,409.51,24)=""
+6 ; " "
SET ^TMP("PXQADDITIONAL",$JOB,409.51,25)=""
+7 ;-LOCATION - ENCOUNTER
SET ^TMP("PXQADDITIONAL",$JOB,409.68,.04)=""
+8 ;-ORIGINATING - ENCOUNTER
SET ^TMP("PXQADDITIONAL",$JOB,409.68,.08)=""
+9 ;-VISIT - LOCATION
SET ^TMP("PXQADDITIONAL",$JOB,9000010,.22)=""
+10 ;-VISIT - PATIENT
SET ^TMP("PXQADDITIONAL",$JOB,9000010,.05)=""
+11 ;-REGISTERED EXAMS - DIVISION
SET ^TMP("PXQADDITIONAL",$JOB,70.02,3)=""
+12 ;-REGISTERED EXAMS - LOCATION
SET ^TMP("PXQADDITIONAL",$JOB,70.02,4)=""
+13 ;-REGISTERED EXAMS - EXAM SET
SET ^TMP("PXQADDITIONAL",$JOB,70.02,5)=""
+14 ;-EXAMINATIONS - PROCEDURE
SET ^TMP("PXQADDITIONAL",$JOB,70.03,2)=""
+15 ;-EXAMINATIONS - EXAM STATUS
SET ^TMP("PXQADDITIONAL",$JOB,70.03,3)=""
+16 ;-EXAMINATIONS - CATEGORY
SET ^TMP("PXQADDITIONAL",$JOB,70.03,4)=""
+17 ;-EXAMINATIONS - CLINIC STOP REC
SET ^TMP("PXQADDITIONAL",$JOB,70.03,23)=""
+18 ;-EXAMINATIONS - CREDIT METHOD
SET ^TMP("PXQADDITIONAL",$JOB,70.03,26)=""
+19 ;
+20 ;S ^TMP("PXQADDITIONAL",$J,8925,.02)="" ;-TIU FIELDS
+21 ;S ^TMP("PXQADDITIONAL",$J,8925,.03)="" ;-TIU FIELDS
+22 ;S ^TMP("PXQADDITIONAL",$J,8925,.04)="" ;-TIU FIELDS
+23 ;S ^TMP("PXQADDITIONAL",$J,8925,.05)="" ;-TIU FIELDS
+24 ;S ^TMP("PXQADDITIONAL",$J,8925,.07)="" ;-TIU FIELDS
+25 ;S ^TMP("PXQADDITIONAL",$J,8925,.1)="" ;-TIU FIELDS
+26 ;S ^TMP("PXQADDITIONAL",$J,8925,1201)="" ;-TIU FIELDS
+27 ;S ^TMP("PXQADDITIONAL",$J,8925,1202)="" ;-TIU FIELDS
+28 ;S ^TMP("PXQADDITIONAL",$J,8925,1204)="" ;-TIU FIELDS
+29 ;S ^TMP("PXQADDITIONAL",$J,8925,1205)="" ;-TIU FIELDS
+30 ;S ^TMP("PXQADDITIONAL",$J,8925,1301)="" ;-TIU FIELDS
+31 ;S ^TMP("PXQADDITIONAL",$J,8925,1302)="" ;-TIU FIELDS
+32 ;S ^TMP("PXQADDITIONAL",$J,8925,1404)="" ;-TIU FIELDS
+33 ;S ^TMP("PXQADDITIONAL",$J,8925,1502)="" ;-TIU FIELDS
+34 ;S ^TMP("PXQADDITIONAL",$J,8925,1503)="" ;-TIU FIELDS
+35 ;S ^TMP("PXQADDITIONAL",$J,8925,1504)="" ;-TIU FIELDS
+36 ;S ^TMP("PXQADDITIONAL",$J,8925,1505)="" ;-TIU FIELDS
+37 QUIT