source: WorldVistAEHR/trunk/r/PCE_PATIENT_CARE_ENCOUNTER-AUTN-EFDP-PX-VSIT--PXRM/PXQMAIN4.m@ 975

Last change on this file since 975 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.4 KB
Line 
1PXQMAIN4 ;ISL/JVS - USER FRIENDLY REPORT ;3/25/97 11:09
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**4,29**;Aug 12,1996
3 ;
4REPT ;--PCE VISIT TRAIL CUSTONIZED REPORT OPTION
5 N DFN,IEN,VISIT,ANS,I,PXBCNT,PXBHIGH,PXQRECI
6 S PXQRECI=0
7 ;
8 ;--SET UP OR RETRIEVE DEFAULTS
9 I '$D(^DISV(DUZ,"PXQREP1")) S ^DISV(DUZ,"PXQREP1")="P"
10 ;
11ASK ;--ASK BY PATIENT OR BY IEN
12 S DIR("A",1)="Enter '^' to exit"
13 S DIR("A")="Select by (P)atient or (I)en"
14 S DIR("B")=$G(^DISV(DUZ,"PXQREP1"))
15 S DIR(0)="SOM^P:Patient List of Visits;I:Internal Entry Number of VISIT"
16 D ^DIR K DIR
17 I Y=""!(Y["^")!(Y<0) G EXIT
18 I "IP"[Y S ^DISV(DUZ,"PXQREP1")=Y
19 I Y="I" G IEN
20 ;
21PAT ;--ASK FOR PATIENT
22 S DFN=$$ASKPAT^PXQUTL Q:DFN<0
23 ;--ASK DATE RANGE
24 D DATE^PXQUTL2
25 I '$G(PXQSTART)!('$G(PXQEND)) G PAT
26 ;--GET A LIST OF VISITS
27 S (IEN,VISIT)=$$VISITLST^PXQGVST(DFN,PXQSTART,PXQEND,"","X") K PXQSTART,PXQEND G:IEN<0 ASK
28 I $G(IEN)'<0 S ^DISV(DUZ,"PXQREP3")="`"_$G(IEN)
29 G FORM
30IEN ;--ASK FOR IEN OF VISIT
31 N DFN,IEN,VISIT,ANS,I,BROKEN
32 I $G(^DISV(DUZ,"PXQREP3"))]"" S DIR("B")=$G(^DISV(DUZ,"PXQREP3"))
33 S (VISIT,IEN)=$$ASKNUM1^PXQUTL K DIR I IEN<0 D G:IEN<0 ASK
34 .I $G(IEN)]""&($G(IEN)'["^")&($G(IEN)'<0) S ^DISV(DUZ,"PXQREP3")=$G(IEN)
35 ;.R !,"Look at a Possible BROKER POINTER to a visit? (Y/N): N// ",ANS:DTIME
36 ;.I ANS["N"!(ANS="")!(ANS["^") Q
37 ;.R !,"Enter Visit IEN: ",ANS:DTIME
38 ;.I +ANS<1 G IEN
39 ;.S (VISIT,IEN)=ANS
40 ;.S ^DISV(DUZ,"PXQREP3")="`"_$G(IEN)
41 ;.I '$D(^AUPNVSIT(ANS)) S BROKEN=1
42 I $G(IEN)'<0 S ^DISV(DUZ,"PXQREP3")="`"_$G(IEN)
43 ;
44 ;
45FORM ;--FORMAT FO THE RPORT
46 S DIR("A",1)="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
47 S DIR("A",2)="To Customize your display use VA Fileman to add entries in file"
48 S DIR("A",3)="PCE CUSTOMIZE REPORT, with your NAME, FILE/SUBFILE#s, and FIELD#s"
49 S DIR("A",4)="that you want to have included in the report."
50 S DIR("A",5)="~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
51 S DIR("A",6)=" "
52 S DIR("A",7)="Enter '^^' to exit option"
53 S DIR("A")="Format of Print out"
54 S DIR("B")=$G(^DISV(DUZ,"PXQREP2"))
55 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) "
56 D ^DIR K DIR
57 I Y=""!(Y="^") G ASK
58 I Y="^^" G EXIT
59 I "CDA^^"'[Y G FORM
60 I "DAC"[Y S ^DISV(DUZ,"PXQREP2")=Y
61 I Y="D" S PXQFORM=".01"_"^"_Y
62 I Y="A" S PXQFORM="**"_"^"_Y
63 I Y="C" S PXQFORM=".01"_"^"_Y
64 ;
65OPEN ;--OPEN DEVICE
66 S OPTION=10
67 D ZIS^PXQZIS G:POP EXIT
68 ;
69 ;--RESET $X,$Y TO ZERO
70 N DX,DY S (DX,DY)=0 X ^%ZOSF("XY")
71 ;
72REPORT ;--DO REPORT
73 K ^TMP("PXQDATA",$J)
74 N VAR
75 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 ***")
76 W $$RE^PXQUTL(" ")
77 W $$RE^PXQUTL(" The Following is the VISIT file entry and")
78 W $$RE^PXQUTL(" ALL records pointing back to this entry.")
79 W $$RE^PXQUTL(" ")
80 W $$RE^PXQUTL(" VISIT RECORD --- #"_VISIT_"")
81 W $$RE^PXQUTL(" ")
82 I $D(^AUPNVSIT(VISIT)) D
83 .N PXQSTUFF,PXQPAT,PXQDT,PXQCLN
84 .D GETS^DIQ(9000010,VISIT_",",".01;.05;.22","EI","PXQSTUFF","PXQSTUFF")
85 .D GETS^DIQ(9000010,VISIT_",","**","E","^TMP(""PXQDATA"",$J,")
86 .S PXQDT=$G(PXQSTUFF(9000010,VISIT_",",.01,"E"))
87 .S PXQPAT=$G(PXQSTUFF(9000010,VISIT_",",.05,"E"))
88 .S PXQCLN=$G(PXQSTUFF(9000010,VISIT_",",.22,"E"))
89 .S DFN=$G(PXQSTUFF(9000010,VISIT_",",.05,"I"))
90 .W $$RE^PXQUTL(" DATE/TIME --- "_PXQDT_"")
91 .W $$RE^PXQUTL(" PATIENT --- "_PXQPAT_"")
92 .W $$RE^PXQUTL(" LOCATION --- "_PXQCLN_"")
93 .W $$RE^PXQUTL(" ")
94 .W $$RE^PXQUTL("______________________________________________________________")
95 S VAR=$$DEC^PXQUTL1(VISIT,9000010,"",PXQFORM)
96 I $D(PXQENC) D K PXQENC
97 .N PXQII
98 .S PXQII=0 F S PXQII=$O(PXQENC(PXQII)) Q:PXQII="" D
99 ..W $$RE^PXQUTL(" ")
100 ..W $$RE^PXQUTL(" The Following is the OUTPATIENT ENCOUNTER entry and")
101 ..W $$RE^PXQUTL(" most of the records pointing back to it.")
102 ..W $$RE^PXQUTL(" ")
103 ..W $$RE^PXQUTL(" OUTPATIENT ENCOUNTER --- #"_PXQII_"")
104 ..W $$RE^PXQUTL(" ")
105 ..W $$RE^PXQUTL("______________________________________________________________")
106 ..S VAR=$$DEC^PXQUTL1(PXQII,409.68,"",PXQFORM)
107 W $$RE^PXQUTL(" ")
108 W $$RE^PXQUTL(" The Following is the SCHEDULING VISITS file.")
109 W $$RE^PXQUTL(" This is where Scheduling stores the CPT codes.")
110 W $$RE^PXQUTL(" ")
111 D SDV^PXQUTL
112 ;--READ TO DEVICE
113 D READ^PXQUTL
114 ;--CLOSE DEVICE
115 D ^%ZISC
116 I $D(ZTSK) G EXIT
117 E D FORM
118 Q
119 ;
120 ;
121EXIT ;--CLEAN UP AND QUIT
122 K DIR,DIC,OPTION
123 K ^TMP("PXQDATA",$J)
124 Q
Note: See TracBrowser for help on using the repository browser.