PXQMAIN4 ;ISL/JVS - USER FRIENDLY REPORT ;3/25/97 11:09
;;1.0;PCE PATIENT CARE ENCOUNTER;**4,29**;Aug 12,1996
;
REPT ;--PCE VISIT TRAIL CUSTONIZED REPORT OPTION
N DFN,IEN,VISIT,ANS,I,PXBCNT,PXBHIGH,PXQRECI
S PXQRECI=0
;
;--SET UP OR RETRIEVE DEFAULTS
I '$D(^DISV(DUZ,"PXQREP1")) S ^DISV(DUZ,"PXQREP1")="P"
;
ASK ;--ASK BY PATIENT OR BY IEN
S DIR("A",1)="Enter '^' to exit"
S DIR("A")="Select by (P)atient or (I)en"
S DIR("B")=$G(^DISV(DUZ,"PXQREP1"))
S DIR(0)="SOM^P:Patient List of Visits;I:Internal Entry Number of VISIT"
D ^DIR K DIR
I Y=""!(Y["^")!(Y<0) G EXIT
I "IP"[Y S ^DISV(DUZ,"PXQREP1")=Y
I Y="I" G IEN
;
PAT ;--ASK FOR PATIENT
S DFN=$$ASKPAT^PXQUTL Q:DFN<0
;--ASK DATE RANGE
D DATE^PXQUTL2
I '$G(PXQSTART)!('$G(PXQEND)) G PAT
;--GET A LIST OF VISITS
S (IEN,VISIT)=$$VISITLST^PXQGVST(DFN,PXQSTART,PXQEND,"","X") K PXQSTART,PXQEND G:IEN<0 ASK
I $G(IEN)'<0 S ^DISV(DUZ,"PXQREP3")="`"_$G(IEN)
G FORM
IEN ;--ASK FOR IEN OF VISIT
N DFN,IEN,VISIT,ANS,I,BROKEN
I $G(^DISV(DUZ,"PXQREP3"))]"" S DIR("B")=$G(^DISV(DUZ,"PXQREP3"))
S (VISIT,IEN)=$$ASKNUM1^PXQUTL K DIR I IEN<0 D G:IEN<0 ASK
.I $G(IEN)]""&($G(IEN)'["^")&($G(IEN)'<0) S ^DISV(DUZ,"PXQREP3")=$G(IEN)
;.R !,"Look at a Possible BROKER POINTER to a visit? (Y/N): N// ",ANS:DTIME
;.I ANS["N"!(ANS="")!(ANS["^") Q
;.R !,"Enter Visit IEN: ",ANS:DTIME
;.I +ANS<1 G IEN
;.S (VISIT,IEN)=ANS
;.S ^DISV(DUZ,"PXQREP3")="`"_$G(IEN)
;.I '$D(^AUPNVSIT(ANS)) S BROKEN=1
I $G(IEN)'<0 S ^DISV(DUZ,"PXQREP3")="`"_$G(IEN)
;
;
FORM ;--FORMAT FO THE RPORT
S DIR("A",1)="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
S DIR("A",2)="To Customize your display use VA Fileman to add entries in file"
S DIR("A",3)="PCE CUSTOMIZE REPORT, with your NAME, FILE/SUBFILE#s, and FIELD#s"
S DIR("A",4)="that you want to have included in the report."
S DIR("A",5)="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
S DIR("A",6)=" "
S DIR("A",7)="Enter '^^' to exit option"
S DIR("A")="Format of Print out"
S DIR("B")=$G(^DISV(DUZ,"PXQREP2"))
S DIR(0)="SOM^D:Default (first field of each file/subfile);A:All fields in a file/subfile (except 'NULL');C:Customized by User (Default plus added fields) "
D ^DIR K DIR
I Y=""!(Y="^") G ASK
I Y="^^" G EXIT
I "CDA^^"'[Y G FORM
I "DAC"[Y S ^DISV(DUZ,"PXQREP2")=Y
I Y="D" S PXQFORM=".01"_"^"_Y
I Y="A" S PXQFORM="**"_"^"_Y
I Y="C" S PXQFORM=".01"_"^"_Y
;
OPEN ;--OPEN DEVICE
S OPTION=10
D ZIS^PXQZIS G:POP EXIT
;
;--RESET $X,$Y TO ZERO
N DX,DY S (DX,DY)=0 X ^%ZOSF("XY")
;
REPORT ;--DO REPORT
K ^TMP("PXQDATA",$J)
N VAR
W $$RE^PXQUTL("*** R E C O R D O F R E L A T E D E N T R I E S ***")
W $$RE^PXQUTL(" ")
W $$RE^PXQUTL(" The Following is the VISIT file entry and")
W $$RE^PXQUTL(" ALL records pointing back to this entry.")
W $$RE^PXQUTL(" ")
W $$RE^PXQUTL(" VISIT RECORD --- #"_VISIT_"")
W $$RE^PXQUTL(" ")
I $D(^AUPNVSIT(VISIT)) D
.N PXQSTUFF,PXQPAT,PXQDT,PXQCLN
.D GETS^DIQ(9000010,VISIT_",",".01;.05;.22","EI","PXQSTUFF","PXQSTUFF")
.D GETS^DIQ(9000010,VISIT_",","**","E","^TMP(""PXQDATA"",$J,")
.S PXQDT=$G(PXQSTUFF(9000010,VISIT_",",.01,"E"))
.S PXQPAT=$G(PXQSTUFF(9000010,VISIT_",",.05,"E"))
.S PXQCLN=$G(PXQSTUFF(9000010,VISIT_",",.22,"E"))
.S DFN=$G(PXQSTUFF(9000010,VISIT_",",.05,"I"))
.W $$RE^PXQUTL(" DATE/TIME --- "_PXQDT_"")
.W $$RE^PXQUTL(" PATIENT --- "_PXQPAT_"")
.W $$RE^PXQUTL(" LOCATION --- "_PXQCLN_"")
.W $$RE^PXQUTL(" ")
.W $$RE^PXQUTL("______________________________________________________________")
S VAR=$$DEC^PXQUTL1(VISIT,9000010,"",PXQFORM)
I $D(PXQENC) D K PXQENC
.N PXQII
.S PXQII=0 F S PXQII=$O(PXQENC(PXQII)) Q:PXQII="" D
..W $$RE^PXQUTL(" ")
..W $$RE^PXQUTL(" The Following is the OUTPATIENT ENCOUNTER entry and")
..W $$RE^PXQUTL(" most of the records pointing back to it.")
..W $$RE^PXQUTL(" ")
..W $$RE^PXQUTL(" OUTPATIENT ENCOUNTER --- #"_PXQII_"")
..W $$RE^PXQUTL(" ")
..W $$RE^PXQUTL("______________________________________________________________")
..S VAR=$$DEC^PXQUTL1(PXQII,409.68,"",PXQFORM)
W $$RE^PXQUTL(" ")
W $$RE^PXQUTL(" The Following is the SCHEDULING VISITS file.")
W $$RE^PXQUTL(" This is where Scheduling stores the CPT codes.")
W $$RE^PXQUTL(" ")
D SDV^PXQUTL
;--READ TO DEVICE
D READ^PXQUTL
;--CLOSE DEVICE
D ^%ZISC
I $D(ZTSK) G EXIT
E D FORM
Q
;
;
EXIT ;--CLEAN UP AND QUIT
K DIR,DIC,OPTION
K ^TMP("PXQDATA",$J)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXQMAIN4 4654 printed Oct 16, 2024@18:30:47 Page 2
PXQMAIN4 ;ISL/JVS - USER FRIENDLY REPORT ;3/25/97 11:09
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**4,29**;Aug 12,1996
+2 ;
REPT ;--PCE VISIT TRAIL CUSTONIZED REPORT OPTION
+1 NEW DFN,IEN,VISIT,ANS,I,PXBCNT,PXBHIGH,PXQRECI
+2 SET PXQRECI=0
+3 ;
+4 ;--SET UP OR RETRIEVE DEFAULTS
+5 IF '$DATA(^DISV(DUZ,"PXQREP1"))
SET ^DISV(DUZ,"PXQREP1")="P"
+6 ;
ASK ;--ASK BY PATIENT OR BY IEN
+1 SET DIR("A",1)="Enter '^' to exit"
+2 SET DIR("A")="Select by (P)atient or (I)en"
+3 SET DIR("B")=$GET(^DISV(DUZ,"PXQREP1"))
+4 SET DIR(0)="SOM^P:Patient List of Visits;I:Internal Entry Number of VISIT"
+5 DO ^DIR
KILL DIR
+6 IF Y=""!(Y["^")!(Y<0)
GOTO EXIT
+7 IF "IP"[Y
SET ^DISV(DUZ,"PXQREP1")=Y
+8 IF Y="I"
GOTO IEN
+9 ;
PAT ;--ASK FOR PATIENT
+1 SET DFN=$$ASKPAT^PXQUTL
if DFN<0
QUIT
+2 ;--ASK DATE RANGE
+3 DO DATE^PXQUTL2
+4 IF '$GET(PXQSTART)!('$GET(PXQEND))
GOTO PAT
+5 ;--GET A LIST OF VISITS
+6 SET (IEN,VISIT)=$$VISITLST^PXQGVST(DFN,PXQSTART,PXQEND,"","X")
KILL PXQSTART,PXQEND
if IEN<0
GOTO ASK
+7 IF $GET(IEN)'<0
SET ^DISV(DUZ,"PXQREP3")="`"_$GET(IEN)
+8 GOTO FORM
IEN ;--ASK FOR IEN OF VISIT
+1 NEW DFN,IEN,VISIT,ANS,I,BROKEN
+2 IF $GET(^DISV(DUZ,"PXQREP3"))]""
SET DIR("B")=$GET(^DISV(DUZ,"PXQREP3"))
+3 SET (VISIT,IEN)=$$ASKNUM1^PXQUTL
KILL DIR
IF IEN<0
Begin DoDot:1
+4 IF $GET(IEN)]""&($GET(IEN)'["^")&($GET(IEN)'<0)
SET ^DISV(DUZ,"PXQREP3")=$GET(IEN)
End DoDot:1
if IEN<0
GOTO ASK
+5 ;.R !,"Look at a Possible BROKER POINTER to a visit? (Y/N): N// ",ANS:DTIME
+6 ;.I ANS["N"!(ANS="")!(ANS["^") Q
+7 ;.R !,"Enter Visit IEN: ",ANS:DTIME
+8 ;.I +ANS<1 G IEN
+9 ;.S (VISIT,IEN)=ANS
+10 ;.S ^DISV(DUZ,"PXQREP3")="`"_$G(IEN)
+11 ;.I '$D(^AUPNVSIT(ANS)) S BROKEN=1
+12 IF $GET(IEN)'<0
SET ^DISV(DUZ,"PXQREP3")="`"_$GET(IEN)
+13 ;
+14 ;
FORM ;--FORMAT FO THE RPORT
+1 SET DIR("A",1)="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+2 SET DIR("A",2)="To Customize your display use VA Fileman to add entries in file"
+3 SET DIR("A",3)="PCE CUSTOMIZE REPORT, with your NAME, FILE/SUBFILE#s, and FIELD#s"
+4 SET DIR("A",4)="that you want to have included in the report."
+5 SET DIR("A",5)="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+6 SET DIR("A",6)=" "
+7 SET DIR("A",7)="Enter '^^' to exit option"
+8 SET DIR("A")="Format of Print out"
+9 SET DIR("B")=$GET(^DISV(DUZ,"PXQREP2"))
+10 SET DIR(0)="SOM^D:Default (first field of each file/subfile);A:All fields in a file/subfile (except 'NULL');C:Customized by User (Default plus added fields) "
+11 DO ^DIR
KILL DIR
+12 IF Y=""!(Y="^")
GOTO ASK
+13 IF Y="^^"
GOTO EXIT
+14 IF "CDA^^"'[Y
GOTO FORM
+15 IF "DAC"[Y
SET ^DISV(DUZ,"PXQREP2")=Y
+16 IF Y="D"
SET PXQFORM=".01"_"^"_Y
+17 IF Y="A"
SET PXQFORM="**"_"^"_Y
+18 IF Y="C"
SET PXQFORM=".01"_"^"_Y
+19 ;
OPEN ;--OPEN DEVICE
+1 SET OPTION=10
+2 DO ZIS^PXQZIS
if POP
GOTO EXIT
+3 ;
+4 ;--RESET $X,$Y TO ZERO
+5 NEW DX,DY
SET (DX,DY)=0
XECUTE ^%ZOSF("XY")
+6 ;
REPORT ;--DO REPORT
+1 KILL ^TMP("PXQDATA",$JOB)
+2 NEW VAR
+3 WRITE $$RE^PXQUTL("*** R E C O R D O F R E L A T E D E N T R I E S ***")
+4 WRITE $$RE^PXQUTL(" ")
+5 WRITE $$RE^PXQUTL(" The Following is the VISIT file entry and")
+6 WRITE $$RE^PXQUTL(" ALL records pointing back to this entry.")
+7 WRITE $$RE^PXQUTL(" ")
+8 WRITE $$RE^PXQUTL(" VISIT RECORD --- #"_VISIT_"")
+9 WRITE $$RE^PXQUTL(" ")
+10 IF $DATA(^AUPNVSIT(VISIT))
Begin DoDot:1
+11 NEW PXQSTUFF,PXQPAT,PXQDT,PXQCLN
+12 DO GETS^DIQ(9000010,VISIT_",",".01;.05;.22","EI","PXQSTUFF","PXQSTUFF")
+13 DO GETS^DIQ(9000010,VISIT_",","**","E","^TMP(""PXQDATA"",$J,")
+14 SET PXQDT=$GET(PXQSTUFF(9000010,VISIT_",",.01,"E"))
+15 SET PXQPAT=$GET(PXQSTUFF(9000010,VISIT_",",.05,"E"))
+16 SET PXQCLN=$GET(PXQSTUFF(9000010,VISIT_",",.22,"E"))
+17 SET DFN=$GET(PXQSTUFF(9000010,VISIT_",",.05,"I"))
+18 WRITE $$RE^PXQUTL(" DATE/TIME --- "_PXQDT_"")
+19 WRITE $$RE^PXQUTL(" PATIENT --- "_PXQPAT_"")
+20 WRITE $$RE^PXQUTL(" LOCATION --- "_PXQCLN_"")
+21 WRITE $$RE^PXQUTL(" ")
+22 WRITE $$RE^PXQUTL("______________________________________________________________")
End DoDot:1
+23 SET VAR=$$DEC^PXQUTL1(VISIT,9000010,"",PXQFORM)
+24 IF $DATA(PXQENC)
Begin DoDot:1
+25 NEW PXQII
+26 SET PXQII=0
FOR
SET PXQII=$ORDER(PXQENC(PXQII))
if PXQII=""
QUIT
Begin DoDot:2
+27 WRITE $$RE^PXQUTL(" ")
+28 WRITE $$RE^PXQUTL(" The Following is the OUTPATIENT ENCOUNTER entry and")
+29 WRITE $$RE^PXQUTL(" most of the records pointing back to it.")
+30 WRITE $$RE^PXQUTL(" ")
+31 WRITE $$RE^PXQUTL(" OUTPATIENT ENCOUNTER --- #"_PXQII_"")
+32 WRITE $$RE^PXQUTL(" ")
+33 WRITE $$RE^PXQUTL("______________________________________________________________")
+34 SET VAR=$$DEC^PXQUTL1(PXQII,409.68,"",PXQFORM)
End DoDot:2
End DoDot:1
KILL PXQENC
+35 WRITE $$RE^PXQUTL(" ")
+36 WRITE $$RE^PXQUTL(" The Following is the SCHEDULING VISITS file.")
+37 WRITE $$RE^PXQUTL(" This is where Scheduling stores the CPT codes.")
+38 WRITE $$RE^PXQUTL(" ")
+39 DO SDV^PXQUTL
+40 ;--READ TO DEVICE
+41 DO READ^PXQUTL
+42 ;--CLOSE DEVICE
+43 DO ^%ZISC
+44 IF $DATA(ZTSK)
GOTO EXIT
+45 IF '$TEST
DO FORM
+46 QUIT
+47 ;
+48 ;
EXIT ;--CLEAN UP AND QUIT
+1 KILL DIR,DIC,OPTION
+2 KILL ^TMP("PXQDATA",$JOB)
+3 QUIT