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

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

initial load of WorldVistAEHR

File size: 4.5 KB
RevLine 
[613]1PXRRPCR2 ;HIN/MjK - Clinic Specfic Workload Reports ;6/7/96
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;;Aug 12, 1996
3ACTIVTY ;:_._._._._._._._._._._._.Caseload Activity_._._._._._._._._._._._.
4 S PXRRQ=1 D HDR^PXRRPCR W ?11,"Report Date Range: ",$$FMTE^XLFDT($P(PXRRBDT,"."))," through ",$$FMTE^XLFDT($P(PXRREDT,"."))
5 I $D(PXRSTPNM) W !?22,"Clinic Stop: ",PXRSTPNM G HDR
6 W !?2,"Clinic(s): ",$P($G(PXRRCLIN(1)),U) F I=2:1 Q:'$D(PXRRCLIN(I)) D
7 . I ($L($P(PXRRCLIN(I),U))+$X+3)<IOM W ", ",$P(PXRRCLIN(I),U) Q
8 . W !?13,$P($G(PXRRCLIN(I)),U)
9HDR W !?2,"CASELOAD ACTIVITY...patients' hospital admissions/discharges, emergency room",!?2,"visits and critical lab values ;address,phone,future appts",!
10NONE ;_._._.If no Pateint Activity_._._.
11 I '$D(^TMP($J,"PATIENT")) W !,"No patients were recorded to have these actitvites within the",!,"selected date range." Q
12ADM ;A = Patient DFN ;B/C = Admission Date ;E=Discharge Date ;T = Line Tag
13 W !,"____________________________ADMISSIONS/DISCHARGES____________________________",! S T="ADMH^PXRRPCR"
14 I '$D(^TMP($J,"ADM")) W !?5,"o There were no ADMISSIONS for these patients during this date range.",! G ER
15 D @T S A=0 F S A=$O(^TMP($J,"ADM",A)) Q:'A!('PXRRQ) S B=0 F S B=$O(^TMP($J,"ADM",A,B)) Q:'B!('PXRRQ) S C=$$FMTE^XLFDT(B),E=$$FMTE^XLFDT($P($P(^TMP($J,"ADM",A,B),U),".")) D CHK:$Y>(IOSL-12) Q:'PXRRQ D
16 . W !,$P(C,"@"),?13,E,?30,$E($P(^DPT(A,0),U),1,25)
17 . W ?57,$P(^DPT(A,0),U,9)
18 . W ?69,$P(^TMP($J,"ADM",A,B),U,2) W:'$O(^(B)) !
19 . I '$O(^TMP($J,"ADM",A,B)) D
20 .. W ?2,"Addr: ",$S($P($G(^(B)),U,3)'="":$P($G(^(B)),U,3)_" "_$P($G(^(B)),U,4),1:"Not Available")_" / "
21 .. W $S($P($G(^(B)),U,5)'="":$E($P($G(^(B)),U,5),1,20),1:"No TOWN")_" "
22 .. W $P($G(^(B)),U,6)_" "
23 .. W $S($P($G(^(B)),U,7)'="":$P($G(^(B)),U,7),1:"No ZIP")_" / "
24 .. W "Ph: "_$S($P($G(^(B)),U,8)'="":$P($G(^(B)),U,8),1:"No PHONE"),!
25 .. D CHK:$Y>(IOSL-11) Q:'PXRRQ
26 .. D FUT W !?32,"~~~~~~~~~~~~"
27 Q:'PXRRQ
28ER ;A = Patient DFN ;B/C = Visit Date ;T = Line Tag
29 W !,"_____________________________EMERGENCY ROOM VISITS_____________________________",! S T="ERH^PXRRPCR"
30 I '$D(^TMP($J,"ER")) W !?5,"o There were no ER VISITS for these patients during this date range.",! G LAB
31 D @T S A=0 F S A=$O(^TMP($J,"ER",A)) Q:'A!('PXRRQ) S B=0 F S B=$O(^TMP($J,"ER",A,B)) Q:'B S C=$$FMTE^XLFDT(B) D CHK:$Y>(IOSL-6) Q:'PXRRQ D
32 . W !,C,?27,$E($P(^DPT(A,0),U),1,27),?57,$P(^DPT(A,0),U,9)
33 . I '$O(^TMP($J,"ER",A,B)) D
34 .. W !?2,"Addr: ",$S($P($G(^TMP($J,"ER",A,B)),U)'="":$P($G(^(B)),U)_$P($G(^(B)),U,2),1:"No Address")_" / "
35 .. W $S($P($G(^TMP($J,"ER",A,B)),U,3)'="":$P($G(^(B)),U,3),1:"No TOWN")_" "
36 .. W $P($G(^TMP($J,"ER",A,B)),U,4)_" "
37 .. W $S($P($G(^TMP($J,"ER",A,B)),U,5)'="":$P($G(^(B)),U,5),1:"No ZIP")_" "
38 .. W "PH: "_$S($P($G(^(B)),U,6)'="":$P($G(^(B)),U,6),1:"No Phone"),!
39 .. D CHK:$Y>(IOSL-6) Q:'PXRRQ D FUT W !?32,"~~~~~~~~~~~~"
40 Q:'PXRRQ
41LAB ;A = Patient DFN ;B/C = Lab Date ;E =Lab Test Field No. ;T =Line Tag
42 W !,"____________________________CRITICAL LAB VALUES____________________________",! S T="LABH^PXRRPCR"
43 I '$D(^TMP($J,"LAB")) W !?5,"o There were no CRITICAL LABS for these patients during this date range. ",! G Q
44 D @T S A=0 F S A=$O(^TMP($J,"LAB",A)) Q:'A!('PXRRQ) S B=0 F S B=$O(^TMP($J,"LAB",A,B)) Q:'B S C=$$FMTE^XLFDT(B),E=0 F S E=$O(^TMP($J,"LAB",A,B,E)) Q:'E D CHK:$Y>(IOSL-6) Q:'PXRRQ D
45 . W !,$P(C,"@"),?13,$E($P(^DPT(A,0),U),1,20),?35,$P(^DPT(A,0),U,9)
46 . W ?48,$P($G(^TMP($J,"LAB",A,B,E)),U)
47 . W ?75,$P($G(^TMP($J,"LAB",A,B,E)),U,8)
48 . I '$O(^TMP($J,"LAB",A,B))&('$O(^TMP($J,"LAB",A,B,E))) D
49 .. W !?2,"Addr. ",$S($P($G(^TMP($J,"LAB",A,B,E)),U,2)'="":$P($G(^(E)),U,2),1:"No Address")_" / "
50 .. W $S($P($G(^TMP($J,"LAB",A,B,E)),U,4)'="":$P($G(^(E)),U,4),1:"No TOWN")_" "
51 .. W $P($G(^TMP($J,"LAB",A,B,E)),U,5)_" "
52 .. W $S($P($G(^TMP($J,"LAB",A,B,E)),U,6)'="":$P($G(^(E)),U,6),1:"No ZIP")_" / "
53 .. W "Ph: ",$S($P($G(^TMP($J,"LAB",A,B,E)),U,7)'="":$P($G(^(E)),U,7),1:"Not Avail."),!
54 .. D CHK:$Y>(IOSL-6) Q:'PXRRQ
55 .. D FUT W !?32,"~~~~~~~~~~~~"
56Q W !,"______________________________________________________________________________",! ;?2,"TOTAL UNIQUE PATIENTS: ",PXRRTPAT,?50,"TOTAL VISITS: ",PXRRTVS
57 Q
58FUT ;Z/Q = Fut Appointment Date ;A = Patient DFN
59 I '$D(^TMP($J,"FUT",A)) W !?2,"Future Appt. Dt: ",?22,"NONE" Q
60 S Z=0 F S Z=$O(^TMP($J,"FUT",A,Z)) Q:'Z S Q=$$FMTE^XLFDT(Z) D
61 . W !?8,"Fut. Appt. Dt: ",Q,?41," - CL: ",$E($G(^TMP($J,"FUT",A,Z)),1,30)
62 D CHK:$Y>(IOSL-4) Q:'PXRRQ
63 Q
64CHK ;Hold Screen, Format for Home Device Viewing
65 I IOST?1"C-".E S DIR(0)="E" D ^DIR S PXRRQ=$S(Y:1,1:0) K DIR
66 I +PXRRQ D HDR^PXRRPCR,@T
67 Q
Note: See TracBrowser for help on using the repository browser.